Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
f56d08816a
|
@ -2,6 +2,8 @@ package zcgj.zcdev.zcdev.fs.plugin.form;
|
||||||
|
|
||||||
import com.alibaba.druid.util.StringUtils;
|
import com.alibaba.druid.util.StringUtils;
|
||||||
import kd.bos.bill.AbstractBillPlugIn;
|
import kd.bos.bill.AbstractBillPlugIn;
|
||||||
|
import kd.bos.bill.BillShowParameter;
|
||||||
|
import kd.bos.bill.OperationStatus;
|
||||||
import kd.bos.context.RequestContext;
|
import kd.bos.context.RequestContext;
|
||||||
import kd.bos.dataentity.entity.DynamicObject;
|
import kd.bos.dataentity.entity.DynamicObject;
|
||||||
import kd.bos.dataentity.entity.DynamicObjectCollection;
|
import kd.bos.dataentity.entity.DynamicObjectCollection;
|
||||||
|
@ -27,20 +29,24 @@ public class TriprAutoCalWorkingDaysPlugin extends AbstractBillPlugIn implements
|
||||||
@Override
|
@Override
|
||||||
public void afterBindData(EventObject e) {
|
public void afterBindData(EventObject e) {
|
||||||
super.afterBindData(e);
|
super.afterBindData(e);
|
||||||
//当前切换选择的组织
|
//如果是新增时
|
||||||
Object company = this.getModel().getValue("costcompany");//核算组织(费用承担公司)
|
BillShowParameter bsp=(BillShowParameter)this.getView().getFormShowParameter();
|
||||||
Long currentOrgId = RequestContext.get().getOrgId();
|
if(bsp.getStatus()== OperationStatus.ADDNEW ){
|
||||||
if(company!=null){
|
//当前切换选择的组织
|
||||||
DynamicObject companyObj = (DynamicObject)company;
|
Object company = this.getModel().getValue("costcompany");//核算组织(费用承担公司)
|
||||||
Long companyId = companyObj.getLong("id");
|
Long currentOrgId = RequestContext.get().getOrgId();
|
||||||
if(OrgCheckUtils.isKS(companyId)){
|
if(company!=null){
|
||||||
Set<LocalDate> allSet = new HashSet<>();
|
DynamicObject companyObj = (DynamicObject)company;
|
||||||
Set<LocalDate> localDates1 = calHomeentityDay();
|
Long companyId = companyObj.getLong("id");
|
||||||
Set<LocalDate> localDates2 = calTripentryDay();
|
if(OrgCheckUtils.isKS(companyId)){
|
||||||
allSet.addAll(localDates1);
|
Set<LocalDate> allSet = new HashSet<>();
|
||||||
allSet.addAll(localDates2);
|
Set<LocalDate> localDates1 = calHomeentityDay();
|
||||||
this.getModel().setValue("zcgj_kccbdays",allSet.size());
|
Set<LocalDate> localDates2 = calTripentryDay();
|
||||||
|
allSet.addAll(localDates1);
|
||||||
|
allSet.addAll(localDates2);
|
||||||
|
this.getModel().setValue("zcgj_kccbdays",allSet.size());
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,7 @@ import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 职务消费休假台账
|
* 职务消费台账
|
||||||
* 报表取数插件
|
* 报表取数插件
|
||||||
*/
|
*/
|
||||||
public class PositionFeesRptQueryPlugin extends AbstractReportListDataPlugin {
|
public class PositionFeesRptQueryPlugin extends AbstractReportListDataPlugin {
|
||||||
|
@ -133,6 +133,10 @@ public class PositionFeesRptQueryPlugin extends AbstractReportListDataPlugin {
|
||||||
|
|
||||||
DynamicObjectCollection entrys = dynamicObject.getDynamicObjectCollection("expenseentryentity");
|
DynamicObjectCollection entrys = dynamicObject.getDynamicObjectCollection("expenseentryentity");
|
||||||
for (DynamicObject entry : entrys) {
|
for (DynamicObject entry : entrys) {
|
||||||
|
DynamicObject zcgjCostmangerEntity = entry.getDynamicObject("zcgj_costmanger_entity");
|
||||||
|
if(zcgjCostmangerEntity == null){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
DynamicObject expenseitemObj = entry.getDynamicObject("expenseitem"); //费用项目
|
DynamicObject expenseitemObj = entry.getDynamicObject("expenseitem"); //费用项目
|
||||||
if(expenseitemObj == null){
|
if(expenseitemObj == null){
|
||||||
continue;
|
continue;
|
||||||
|
@ -412,7 +416,7 @@ public class PositionFeesRptQueryPlugin extends AbstractReportListDataPlugin {
|
||||||
searchFilterList.add(new QFilter("expenseentryentity.happendate", QCP.less_equals, lastDay));
|
searchFilterList.add(new QFilter("expenseentryentity.happendate", QCP.less_equals, lastDay));
|
||||||
searchFilterList.add(new QFilter("billstatus", QCP.in, billStatuslist));//增加过滤
|
searchFilterList.add(new QFilter("billstatus", QCP.in, billStatuslist));//增加过滤
|
||||||
DynamicObject[] load = BusinessDataServiceHelper.load("er_dailyreimbursebill",
|
DynamicObject[] load = BusinessDataServiceHelper.load("er_dailyreimbursebill",
|
||||||
"id,description,billno,expenseentryentity," +
|
"id,description,billno,expenseentryentity,zcgj_costmanger_entity," +
|
||||||
DEV_KEY+"_is_business_foreign,"+
|
DEV_KEY+"_is_business_foreign,"+
|
||||||
"expenseentryentity.happendate," + //费用发生日期
|
"expenseentryentity.happendate," + //费用发生日期
|
||||||
"expenseentryentity.expenseitem," + //费用项目
|
"expenseentryentity.expenseitem," + //费用项目
|
||||||
|
|
|
@ -0,0 +1,61 @@
|
||||||
|
package zcgj.zcdev.zcdev.pr.plugin.form;
|
||||||
|
|
||||||
|
import kd.bos.dataentity.entity.DynamicObject;
|
||||||
|
import kd.bos.form.FormShowParameter;
|
||||||
|
import kd.bos.form.plugin.AbstractFormPlugin;
|
||||||
|
import kd.bos.logging.Log;
|
||||||
|
import kd.bos.logging.LogFactory;
|
||||||
|
import kd.bos.orm.query.QFilter;
|
||||||
|
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
||||||
|
|
||||||
|
import java.util.EventObject;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表单插件公共方法<br>
|
||||||
|
* 1.获取菜单参数配置的单据类型编码,菜单参数:<br>
|
||||||
|
* key=billType,value=单据类型编码 <br>
|
||||||
|
* key=filedMark,value=单据类型字段标识 <br>
|
||||||
|
* 2.将单据类型编码转换为编辑界面单据类型字段的值
|
||||||
|
*/
|
||||||
|
public class CommonFormPlugin extends AbstractFormPlugin {
|
||||||
|
private final static Log logger = LogFactory.getLog(CommonFormPlugin.class);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 初始化时,从获取参数类型,设置单据类型值
|
||||||
|
* @param e
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void afterCreateNewData(EventObject e) {
|
||||||
|
FormShowParameter formShowParameter = this.getView().getFormShowParameter();
|
||||||
|
if(null!=formShowParameter){
|
||||||
|
Map<String, Object> customParams = formShowParameter.getCustomParams();
|
||||||
|
if(null!=customParams){
|
||||||
|
//获取列表界面配置的参数:billType=单据类型编码
|
||||||
|
Object billType = customParams.get("billType");
|
||||||
|
//获取列表界面配置的参数:filedMark=单据类型字段标识
|
||||||
|
Object filedMark = customParams.get("filedMark");
|
||||||
|
if(null!=billType&&null!=filedMark){
|
||||||
|
DynamicObject billTypeObj = (DynamicObject)this.getModel().getValue(filedMark.toString());
|
||||||
|
if(null==billTypeObj){
|
||||||
|
//单据类型为空,赋值
|
||||||
|
QFilter q1 = new QFilter("number", "=", billType.toString());
|
||||||
|
DynamicObject billTypeObject = BusinessDataServiceHelper.loadSingle("bos_billtype", new QFilter[]{q1});
|
||||||
|
this.getModel().setValue(filedMark.toString(), billTypeObject);
|
||||||
|
}else if(!billTypeObj.getString("number").equals(billType.toString())){
|
||||||
|
//单据类型和列表菜单参数一致,不再赋值
|
||||||
|
QFilter q1 = new QFilter("number", "=", billType.toString());
|
||||||
|
DynamicObject billTypeObject = BusinessDataServiceHelper.loadSingle("bos_billtype", new QFilter[]{q1});
|
||||||
|
this.getModel().setValue(filedMark.toString(), billTypeObject);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
super.afterCreateNewData(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,32 @@
|
||||||
|
package zcgj.zcdev.zcdev.pr.plugin.form;
|
||||||
|
|
||||||
|
import kd.bos.form.FormShowParameter;
|
||||||
|
import kd.bos.list.events.BeforeShowBillFormEvent;
|
||||||
|
import kd.bos.list.plugin.AbstractListPlugin;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class CommonListPlugin extends AbstractListPlugin {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void beforeShowBill(BeforeShowBillFormEvent e) {
|
||||||
|
FormShowParameter formShowParameter = this.getView().getFormShowParameter();
|
||||||
|
if(null!=formShowParameter){
|
||||||
|
Map<String, Object> customParams =formShowParameter.getCustomParams();
|
||||||
|
if(null!=customParams){
|
||||||
|
Object billtype = customParams.get("billType");
|
||||||
|
Object filedMark = customParams.get("filedMark");
|
||||||
|
if(null!=billtype&&null!=filedMark){
|
||||||
|
customParams.putAll(e.getParameter().getCustomParams());
|
||||||
|
customParams.put("billtype",billtype.toString());
|
||||||
|
customParams.put("filedMark",filedMark.toString());
|
||||||
|
customParams.put("formId","zcgj_zckstopublicbill");
|
||||||
|
e.getParameter().setCustomParams(customParams);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
super.beforeShowBill(e);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,96 @@
|
||||||
|
package zcgj.zcdev.zcdev.pr.plugin.form;
|
||||||
|
|
||||||
|
import com.greenpineyu.fel.common.NumberUtil;
|
||||||
|
import kd.bos.dataentity.entity.DynamicObject;
|
||||||
|
import kd.bos.entity.datamodel.ListSelectedRow;
|
||||||
|
import kd.bos.entity.datamodel.ListSelectedRowCollection;
|
||||||
|
import kd.bos.form.control.events.BeforeItemClickEvent;
|
||||||
|
import kd.bos.form.control.events.ItemClickEvent;
|
||||||
|
import kd.bos.form.events.BeforeDoOperationEventArgs;
|
||||||
|
import kd.bos.form.operate.FormOperate;
|
||||||
|
import kd.bos.list.plugin.AbstractListPlugin;
|
||||||
|
import kd.bos.orm.query.QCP;
|
||||||
|
import kd.bos.orm.query.QFilter;
|
||||||
|
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
||||||
|
import kd.bos.servicehelper.operation.SaveServiceHelper;
|
||||||
|
import kd.sdk.plugin.Plugin;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
import java.util.EventObject;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
public class EquipmentCardListPlugin extends AbstractListPlugin implements Plugin {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void registerListener(EventObject e) {
|
||||||
|
super.registerListener(e);
|
||||||
|
this.addItemClickListeners("tbmain");//监听按钮
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void itemClick(ItemClickEvent evt) {
|
||||||
|
super.itemClick(evt);
|
||||||
|
String itemKey = evt.getItemKey();
|
||||||
|
if (itemKey.equals("zcgj_idle")){
|
||||||
|
Set<Long> setIds = getSelectOrderIds(this.getSelectedRows());
|
||||||
|
DynamicObject[] equipments = BusinessDataServiceHelper.load("eceq_equipment_card", "billno,billname,equipstatus", new QFilter[]{new QFilter("id", "in", setIds)});
|
||||||
|
for (DynamicObject equipment : equipments) {
|
||||||
|
equipment.set("equipstatus","FREE");
|
||||||
|
}
|
||||||
|
Object[] save = SaveServiceHelper.save(equipments);
|
||||||
|
System.out.println();
|
||||||
|
this.getView().showMessage("闲置成功!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void beforeDoOperation(BeforeDoOperationEventArgs args) {
|
||||||
|
super.beforeDoOperation(args);
|
||||||
|
// FormOperate operate = (FormOperate) args.getSource();
|
||||||
|
// String operateNo = operate.getOperateKey();
|
||||||
|
// if(operateNo.equalsIgnoreCase("zcgj_idle")){
|
||||||
|
// ListSelectedRowCollection listSelectedData = args.getListSelectedData();
|
||||||
|
// for (ListSelectedRow listSelectedDatum : listSelectedData) {
|
||||||
|
// String billNo = listSelectedDatum.getBillNo();
|
||||||
|
// QFilter qf = new QFilter("billno", QCP.equals,billNo);
|
||||||
|
// DynamicObject equipment = BusinessDataServiceHelper.loadSingle("eceq_equipment_card", new QFilter[]{qf});
|
||||||
|
// String equipstatus = equipment.getString("equipstatus");
|
||||||
|
// if (!equipstatus.equals("USED")){
|
||||||
|
// this.getView().showErrorNotification("只有在用状态下的设备才可置为闲置");
|
||||||
|
// args.setCancel(true);
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void beforeItemClick(BeforeItemClickEvent evt) {
|
||||||
|
super.beforeItemClick(evt);
|
||||||
|
String itemKey = evt.getItemKey();
|
||||||
|
if(itemKey.equals("zcgj_idle")){
|
||||||
|
Set<Long> setIds = getSelectOrderIds(this.getSelectedRows());
|
||||||
|
DynamicObject[] equipments = BusinessDataServiceHelper.load("eceq_equipment_card", "billno,billname,equipstatus", new QFilter[]{new QFilter("id", "in", setIds)});
|
||||||
|
for (DynamicObject equipment : equipments) {
|
||||||
|
String equipstatus = equipment.getString("equipstatus");
|
||||||
|
if (!equipstatus.equals("USED")){
|
||||||
|
this.getView().showErrorNotification("只有在用状态下的设备才可置为闲置");
|
||||||
|
evt.setCancel(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
private Set<Long> getSelectOrderIds(@NotNull ListSelectedRowCollection selectedRows) {
|
||||||
|
Set<Long> setIds = new HashSet<>();
|
||||||
|
for (ListSelectedRow selectedRow : selectedRows) {
|
||||||
|
setIds.add(NumberUtil.toLong(selectedRow.getPrimaryKeyValue()));
|
||||||
|
}
|
||||||
|
return setIds;
|
||||||
|
}
|
||||||
|
}
|
|
@ -163,6 +163,24 @@ public class PaymentApplySupplierPlugin extends AbstractBillPlugIn implements Pl
|
||||||
// for (int i = 0; i < itementry.size(); i++) {
|
// for (int i = 0; i < itementry.size(); i++) {
|
||||||
// this.getModel().setValue("zcgj_supplier1", supplier, i);
|
// this.getModel().setValue("zcgj_supplier1", supplier, i);
|
||||||
// }
|
// }
|
||||||
|
}else if (propName.equals("zcgj_maintenance")) {
|
||||||
|
//关联设备维修
|
||||||
|
Object value = this.getModel().getValue("zcgj_maintenance");
|
||||||
|
if (value!=null){
|
||||||
|
DynamicObject maintenance = (DynamicObject) value;
|
||||||
|
QFilter qf = new QFilter("id", QCP.equals, maintenance.getLong("id"));
|
||||||
|
DynamicObject maintenancebill = BusinessDataServiceHelper.loadSingle("zcgj_maintenanceackbill", new QFilter[]{qf});
|
||||||
|
this.getModel().setValue("totalshouldpay",maintenancebill.getBigDecimal("zcgj_toactualamount"));
|
||||||
|
this.getModel().setValue("project",maintenancebill.getDynamicObject("zcgj_project"));
|
||||||
|
this.getModel().setValue("fiaccountorg",maintenancebill.getDynamicObject("zcgj_accountorg"));
|
||||||
|
DynamicObjectCollection maintenanceentry = maintenancebill.getDynamicObjectCollection("entryentity");
|
||||||
|
for (int i = 0; i < maintenanceentry.size(); i++) {
|
||||||
|
DynamicObject object = maintenanceentry.get(i);
|
||||||
|
i = this.getModel().createNewEntryRow("itementry");
|
||||||
|
this.getModel().setValue("zcgj_supplier1", object.getDynamicObject("zcgj_supplier"), i);
|
||||||
|
this.getModel().setValue("zcgj_requestedamount", object.getBigDecimal("zcgj_actualamount"), i);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@ package zcgj.zcdev.zcdev.pr.plugin.form;
|
||||||
|
|
||||||
import kd.bos.bill.AbstractBillPlugIn;
|
import kd.bos.bill.AbstractBillPlugIn;
|
||||||
import kd.bos.dataentity.entity.DynamicObject;
|
import kd.bos.dataentity.entity.DynamicObject;
|
||||||
|
import kd.bos.dataentity.entity.DynamicObjectCollection;
|
||||||
import kd.bos.form.field.BasedataEdit;
|
import kd.bos.form.field.BasedataEdit;
|
||||||
import kd.bos.form.field.events.BeforeF7SelectEvent;
|
import kd.bos.form.field.events.BeforeF7SelectEvent;
|
||||||
import kd.bos.form.field.events.BeforeF7SelectListener;
|
import kd.bos.form.field.events.BeforeF7SelectListener;
|
||||||
|
@ -36,8 +37,32 @@ public class RecAndPayInitPlugin extends AbstractBillPlugIn implements Plugin, B
|
||||||
if(name.equals("zcgj_in_contract") || name.equals("zcgj_out_contract")){
|
if(name.equals("zcgj_in_contract") || name.equals("zcgj_out_contract")){
|
||||||
DynamicObject project = (DynamicObject)this.getModel().getValue("zcgj_project");
|
DynamicObject project = (DynamicObject)this.getModel().getValue("zcgj_project");
|
||||||
List<QFilter> qFilterList = new ArrayList<QFilter>();
|
List<QFilter> qFilterList = new ArrayList<QFilter>();
|
||||||
qFilterList.add(new QFilter("project", QCP.equals,project.getLong("id")));
|
if(project == null){
|
||||||
arg0.setCustomQFilters(qFilterList);
|
this.getView().showErrorNotification("请选择项目!");
|
||||||
|
arg0.setCancel(true);
|
||||||
|
}else{
|
||||||
|
qFilterList.add(new QFilter("project", QCP.equals,project.getLong("id")));
|
||||||
|
String entryKey = "zcgj_payable";
|
||||||
|
String contractKey = "zcgj_out_contract";
|
||||||
|
if(name.equals("zcgj_in_contract")){
|
||||||
|
entryKey="zcgj_receivable";
|
||||||
|
contractKey="zcgj_in_contract";
|
||||||
|
}
|
||||||
|
DynamicObjectCollection dynamicObjectCollection = this.getModel().getDataEntity(true).getDynamicObjectCollection(entryKey);
|
||||||
|
if(dynamicObjectCollection != null){
|
||||||
|
List<Long> ids = new ArrayList<>();
|
||||||
|
for (DynamicObject dynamicObject : dynamicObjectCollection) {
|
||||||
|
DynamicObject contract = dynamicObject.getDynamicObject(contractKey);
|
||||||
|
if(contract != null){
|
||||||
|
long inContractId = contract.getLong("id");
|
||||||
|
ids.add(inContractId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
qFilterList.add(new QFilter("id", QCP.not_in,ids));
|
||||||
|
}
|
||||||
|
|
||||||
|
arg0.setCustomQFilters(qFilterList);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue