Merge remote-tracking branch 'origin/main' into main
This commit is contained in:
commit
a4c3ad0dfa
|
@ -10,6 +10,7 @@ import kd.bos.entity.BasedataEntityType;
|
|||
import kd.bos.entity.datamodel.IDataModel;
|
||||
import kd.bos.entity.datamodel.events.BeforeDeleteEntryEventArgs;
|
||||
import kd.bos.entity.datamodel.events.IDataModelChangeListener;
|
||||
import kd.bos.entity.datamodel.events.PropertyChangedArgs;
|
||||
import kd.bos.entity.property.BasedataProp;
|
||||
import kd.bos.entity.property.EntryProp;
|
||||
import kd.bos.entity.property.MulBasedataProp;
|
||||
|
@ -205,6 +206,25 @@ public class ContractFormPlugin extends AbstractFormPlugin implements UploadLis
|
|||
this.getView().invokeOperation("refresh");
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void propertyChanged(PropertyChangedArgs e) {
|
||||
super.propertyChanged(e);
|
||||
|
||||
super.propertyChanged(e);
|
||||
String name = e.getProperty().getName();//字段名称
|
||||
if("qeug_chmentpanel_f".equals(name)){
|
||||
Object qeugChmentpanelF = this.getModel().getValue("qeug_chmentpanel_f");
|
||||
if (qeugChmentpanelF instanceof Number) {
|
||||
int pkLongValue = ((Number) qeugChmentpanelF).intValue(); // 转换为 long
|
||||
if (pkLongValue == 0) {
|
||||
this.getView().getModel().getEntryEntity("qeug_invoiceentryinfo").clear();
|
||||
this.getView().updateView("qeug_invoiceentryinfo");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterDoOperation(AfterDoOperationEventArgs args) {
|
||||
|
||||
|
@ -244,8 +264,9 @@ public class ContractFormPlugin extends AbstractFormPlugin implements UploadLis
|
|||
for (Map<String, Object> fileMap : attachments) {
|
||||
Object attPkId = fileMap.get("attPkId");
|
||||
if (null == attPkId) {
|
||||
this.getView().showTipNotification("请先保存单据");
|
||||
return;
|
||||
// this.getView().showTipNotification("请先保存单据");
|
||||
// return;
|
||||
this.getView().invokeOperation("save");//调用保存
|
||||
}
|
||||
List<Map<String, Object>> attachmentes = AttachmentServiceHelper.getAttachments("recon_contractbill", this.getModel().getValue("id"), "qeug_attachmentpanelap");
|
||||
for (Map<String, Object> attachment : attachmentes) {
|
||||
|
@ -307,7 +328,7 @@ public class ContractFormPlugin extends AbstractFormPlugin implements UploadLis
|
|||
case 0:
|
||||
double num = Double.parseDouble(cell.toString());
|
||||
int result = (int)num;
|
||||
contractsummarylist.set("qeug_seq",String.valueOf(result));//序号
|
||||
contractsummarylist.set("qeug_seqs",result);//序号
|
||||
break;
|
||||
case 1:
|
||||
contractsummarylist.set("qeug_projectnumber",cell);//项目编码
|
||||
|
@ -392,7 +413,7 @@ public class ContractFormPlugin extends AbstractFormPlugin implements UploadLis
|
|||
}
|
||||
this.getView().updateView("qeug_invoiceentryinfo");
|
||||
SaveServiceHelper.save(new DynamicObject[]{this.getView().getModel().getDataEntity()});
|
||||
this.getView().showSuccessNotification("清单汇总识别成功");
|
||||
// this.getView().showSuccessNotification("清单汇总识别成功");
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
|
|
@ -36,13 +36,16 @@ import java.util.Map;
|
|||
*/
|
||||
public class WorkloadcfmbillFormPlugin extends AbstractFormPlugin implements TabSelectListener {
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void beforeDoOperation(BeforeDoOperationEventArgs args) {
|
||||
super.beforeDoOperation(args);
|
||||
|
||||
DynamicObject cqcontract = (DynamicObject) this.getModel().getValue("contractbill");
|
||||
long id = 0;
|
||||
if (null != cqcontract) {
|
||||
id = cqcontract.getLong("id");
|
||||
}
|
||||
|
||||
FormOperate source = (FormOperate) args.getSource();
|
||||
String operateKey = source.getOperateKey();
|
||||
switch (operateKey) {
|
||||
|
@ -54,14 +57,35 @@ public class WorkloadcfmbillFormPlugin extends AbstractFormPlugin implements Tab
|
|||
this.getView().showTipNotification("新增行无法查看明细");
|
||||
return;
|
||||
}
|
||||
DynamicObject cqcontract = (DynamicObject) this.getModel().getValue("contractbill");
|
||||
long id = 0;
|
||||
if (null != cqcontract) {
|
||||
id = cqcontract.getLong("id");
|
||||
}
|
||||
|
||||
getListShowParamer(this.getView(), this.getModel(),String.valueOf(id));
|
||||
break;
|
||||
case "audit":
|
||||
//产值确认--清单明细
|
||||
DynamicObjectCollection invoiceentryinfos = this.getModel().getDataEntity(true).getDynamicObjectCollection("qeug_invoiceentryinfo");
|
||||
//产值确认审核时,将所有明细的完成百分比覆盖掉合同看的清单
|
||||
for (DynamicObject invoiceentryinfo : invoiceentryinfos) {
|
||||
QFilter q3 = new QFilter("qeug_sheetname", QCP.equals, invoiceentryinfo.getString("qeug_summarycontent"));
|
||||
QFilter q4 = new QFilter("qeug_contractid",QCP.equals, String.valueOf(id));
|
||||
QFilter q5 = new QFilter("qeug_workloadcfmid",QCP.equals, String.valueOf(this.getModel().getDataEntity().getPkValue()));
|
||||
DynamicObject[] recon_contractbills = BusinessDataServiceHelper.load("qeug_contractsummarylist",
|
||||
"id,qeug_seq,qeug_seqs,qeug_projectnumber,qeug_projectname,qeug_featuredescript,qeug_engincontent," +
|
||||
"qeug_unit,qeug_decimalqty,qeug_unitprice,qeug_amounttotal,qeug_artificial,qeug_provisional," +
|
||||
"qeug_remarks,qeug_contractid,qeug_sheetname,qeug_cumulativepreofpro", new QFilter[]{q3,q4,q5});
|
||||
if (recon_contractbills.length > 0) {
|
||||
for (int i = 0; i < recon_contractbills.length; i++) {
|
||||
DynamicObject contractsummarylist = recon_contractbills[i];
|
||||
QFilter q6 = new QFilter("qeug_workloadcfmid",QCP.equals, "");//未作产值确认时的清单
|
||||
QFilter q7 = new QFilter("qeug_seqs",QCP.equals, contractsummarylist.getBigDecimal("qeug_seqs"));//项目编码
|
||||
DynamicObject add = BusinessDataServiceHelper.loadSingle("qeug_contractsummarylist", new QFilter[]{q3, q4, q6, q7});
|
||||
if (null != add) {
|
||||
add.set("qeug_cumulativepreofpro",contractsummarylist.getBigDecimal("qeug_cumulativepreofpro"));//累计进度百分比(%)
|
||||
SaveServiceHelper.save(new DynamicObject[]{add});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -73,32 +97,14 @@ public class WorkloadcfmbillFormPlugin extends AbstractFormPlugin implements Tab
|
|||
* @param model 模型
|
||||
*/
|
||||
private void getListShowParamer(IFormView formView, IDataModel model,String contentId) {
|
||||
|
||||
// ListShowParameter parameter = ShowFormHelper.createShowListForm("qeug_contractsummarylist", true);
|
||||
// parameter.getOpenStyle().setShowType(ShowType.MainNewTabPage);//Floating MainNewTabPage NewBrowserPage NewTabPage
|
||||
// parameter.setBillFormId("qeug_contractsummarylist");
|
||||
// parameter.setHasRight(true);
|
||||
// StyleCss styleCss = new StyleCss();
|
||||
// styleCss.setWidth("1500");
|
||||
// styleCss.setHeight("800");
|
||||
// parameter.getOpenStyle().setInlineStyleCss(styleCss);
|
||||
DynamicObjectCollection dynColl = formView.getModel().getEntryEntity("qeug_invoiceentryinfo");
|
||||
int index = model.getEntryCurrentRowIndex("qeug_invoiceentryinfo");
|
||||
DynamicObject dynamicObject = dynColl.get(index);
|
||||
String qeug_summarycontent = dynamicObject.getString("qeug_summarycontent");//汇总内容(sheetName)
|
||||
//// Object pkValue = formView.getModel().getDataEntity().getPkValue();//合同ID
|
||||
//
|
||||
QFilter q1 = new QFilter("qeug_sheetname", QCP.equals, qeug_summarycontent);
|
||||
QFilter q2 = new QFilter("qeug_contractid",QCP.equals, contentId);
|
||||
QFilter q3 = new QFilter("qeug_workloadcfmid",QCP.equals,String.valueOf(this.getModel().getDataEntity().getPkValue()));
|
||||
// List<QFilter> listQF = Lists.newArrayList();
|
||||
// listQF.add(q1.and(q2));
|
||||
// parameter.setListFilterParameter(new ListFilterParameter(listQF, null));
|
||||
// parameter.setCustomParam("qeug_sheetname",qeug_summarycontent);
|
||||
// parameter.setCustomParam("qeug_contractid",contentId);
|
||||
// parameter.setStatus(OperationStatus.ADDNEW);
|
||||
// this.getView().showForm(parameter);
|
||||
// OpenFormUtils.openListPage();
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
map.put("Workloadcfmbill_id", this.getModel().getDataEntity().getPkValue());
|
||||
OpenFormUtils.openListPage(this.getView(), "qeug_contractsummarylist", ShowType.MainNewTabPage,map, q1.and(q2).and(q3), (CloseCallBack) null);
|
||||
|
@ -139,11 +145,6 @@ public class WorkloadcfmbillFormPlugin extends AbstractFormPlugin implements Tab
|
|||
add.set("qeug_isnew", qeug_invoiceentryinfo.get("qeug_isnew"));
|
||||
add.set("qeug_remarks", qeug_invoiceentryinfo.get("qeug_remarks"));
|
||||
add.set("qeug_currencylist", qeug_invoiceentryinfo.get("qeug_currencylist"));
|
||||
// this.getModel().setValue("qeug_summarycontent", qeug_invoiceentryinfo.get("qeug_summarycontent"), i);//汇总内容
|
||||
// this.getModel().setValue("qeug_amount", qeug_invoiceentryinfo.get("qeug_amount"), i);//金额(元)
|
||||
// this.getModel().setValue("qeug_isnew", qeug_invoiceentryinfo.get("qeug_isnew"), i);//是否新增行
|
||||
// this.getModel().setValue("qeug_remarks", qeug_invoiceentryinfo.get("qeug_remarks"), i);//备注
|
||||
// this.getModel().setValue("qeug_currencylist", qeug_invoiceentryinfo.get("qeug_currencylist"), i);//清单币别
|
||||
}
|
||||
|
||||
//携带工程经理
|
||||
|
@ -162,16 +163,16 @@ public class WorkloadcfmbillFormPlugin extends AbstractFormPlugin implements Tab
|
|||
QFilter q4 = new QFilter("qeug_contractid",QCP.equals, String.valueOf(id));
|
||||
QFilter q5 = new QFilter("qeug_workloadcfmid",QCP.equals, "");//防止第二次产值确认时,id覆盖确认过的清单产值确认
|
||||
DynamicObject[] recon_contractbills = BusinessDataServiceHelper.load("qeug_contractsummarylist",
|
||||
"id,qeug_seq,qeug_projectnumber,qeug_projectname,qeug_featuredescript,qeug_engincontent," +
|
||||
"id,qeug_seqs,qeug_projectnumber,qeug_projectname,qeug_featuredescript,qeug_engincontent," +
|
||||
"qeug_unit,qeug_decimalqty,qeug_unitprice,qeug_amounttotal,qeug_artificial,qeug_provisional," +
|
||||
"qeug_remarks,qeug_contractid,qeug_sheetname", new QFilter[]{q3,q4,q5});
|
||||
"qeug_remarks,qeug_contractid,qeug_sheetname,qeug_cumulativepreofpro", new QFilter[]{q3,q4,q5});
|
||||
if (recon_contractbills.length > 0) {
|
||||
for (int i = 0; i < recon_contractbills.length; i++) {
|
||||
DynamicObject contractsummarylist = recon_contractbills[i];
|
||||
DynamicObject add = BusinessDataServiceHelper.newDynamicObject("qeug_contractsummarylist");
|
||||
add.set("qeug_seq", contractsummarylist.getString("qeug_seq"));
|
||||
add.set("qeug_projectnumber", contractsummarylist.getString("qeug_projectnumber"));
|
||||
add.set("qeug_projectname", contractsummarylist.getString("qeug_projectname"));
|
||||
add.set("qeug_seqs", contractsummarylist.getString("qeug_seqs"));
|
||||
add.set("qeug_projectnumber", contractsummarylist.getString("qeug_projectnumber").trim());
|
||||
add.set("qeug_projectname", contractsummarylist.getString("qeug_projectname").trim());
|
||||
add.set("qeug_featuredescript", contractsummarylist.getString("qeug_featuredescript"));
|
||||
add.set("qeug_engincontent", contractsummarylist.getString("qeug_engincontent"));
|
||||
add.set("qeug_unit", contractsummarylist.getString("qeug_unit"));
|
||||
|
@ -183,6 +184,7 @@ public class WorkloadcfmbillFormPlugin extends AbstractFormPlugin implements Tab
|
|||
add.set("qeug_remarks", contractsummarylist.getString("qeug_remarks"));
|
||||
add.set("qeug_contractid", contractsummarylist.getString("qeug_contractid"));
|
||||
add.set("qeug_sheetname", contractsummarylist.getString("qeug_sheetname"));
|
||||
add.set("qeug_cumulativepreofpro", contractsummarylist.getString("qeug_cumulativepreofpro"));//累计完成百分比
|
||||
add.set("qeug_workloadcfmid",String.valueOf(this.getModel().getDataEntity().getPkValue()));
|
||||
add.set("enable","1");//使用状态
|
||||
add.set("status","A");//数据状态
|
||||
|
|
|
@ -21,11 +21,9 @@ public class IntroduceContractPlugin extends BatchImportPlugin {
|
|||
while (iterator.hasNext()){
|
||||
ImportBillData importBillData = iterator.next();
|
||||
JSONObject data = importBillData.getData();
|
||||
String qeug_bcdecimalqtys = (String) data.get("qeug_bcdecimalqtys");//本次完工量
|
||||
String qeug_decimalqty = (String) data.get("qeug_decimalqty");//工程量
|
||||
String qeug_preofpro = (String) data.get("qeug_preofpro");//进度百分比
|
||||
String qeug_workloadcfmid = (String) data.get("qeug_workloadcfmid");//产值确认id
|
||||
BigDecimal bcdecimalqty = null;
|
||||
String qeug_preofpro = (String) data.get("qeug_preofpro");//当前进度百分比
|
||||
String qeug_cumulativepreofpro = (String) data.get("qeug_cumulativepreofpro");//累计进度百分比
|
||||
BigDecimal decimalqty =null;
|
||||
BigDecimal preofpro =null;
|
||||
if (qeug_decimalqty != null && qeug_preofpro!= null) {
|
||||
|
@ -37,11 +35,17 @@ public class IntroduceContractPlugin extends BatchImportPlugin {
|
|||
logger.log(importBillData.getStartIndex(),"工程量数据格式有误").fail();
|
||||
iterator.remove();
|
||||
}
|
||||
// 本次完工量 = 工程量 * 进度百分比
|
||||
// 本次完工量 = 工程量 * (当前进度百分比-累计完成百分比)
|
||||
BigDecimal bd1 = new BigDecimal(qeug_decimalqty);
|
||||
BigDecimal bd2 = new BigDecimal(qeug_preofpro);
|
||||
BigDecimal result = bd1.multiply(bd2).multiply(BigDecimal.valueOf(0.01));
|
||||
// result = result.setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
BigDecimal bd3;
|
||||
if (StringUtils.isEmpty(qeug_cumulativepreofpro)) {
|
||||
bd3 = BigDecimal.ZERO; // 如果 qeug_cumulativepreofpro 为空,则赋值为 0
|
||||
} else {
|
||||
bd3 = new BigDecimal(qeug_cumulativepreofpro);
|
||||
}
|
||||
BigDecimal bd4 = bd2.subtract(bd3);
|
||||
BigDecimal result = bd1.multiply(bd4).multiply(BigDecimal.valueOf(0.01));
|
||||
data.put("qeug_bcdecimalqtys",result);
|
||||
if (StringUtils.isNotEmpty(qeug_preofpro)) {
|
||||
preofpro = new BigDecimal(qeug_preofpro);
|
||||
|
@ -51,6 +55,11 @@ public class IntroduceContractPlugin extends BatchImportPlugin {
|
|||
logger.log(importBillData.getStartIndex(), "进度百分比不能大于100").fail();
|
||||
iterator.remove();
|
||||
}
|
||||
if (bd3.compareTo(bd2) > 0) {
|
||||
logger.log(importBillData.getStartIndex(), "当前进度百分比不能小于累计完成百分比").fail();
|
||||
iterator.remove();
|
||||
}
|
||||
data.put("qeug_cumulativepreofpro",bd2);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -331,13 +331,19 @@ public class YongyouBIPOperation extends AbstractOperationServicePlugIn implemen
|
|||
items.put("pu_org",companyDept[0]);//业务组织编码 同表头公司编码
|
||||
// items.put("pu_deptid",companyDept[1]);//业务部门编码 费用承担部门编码,转换成财务组织编码
|
||||
//外部公司:22020104\应付账款\往来单位\外部单位(工程类)
|
||||
//内部关联公司:22020105\应付账款\往来单位\内部单位(关联方)
|
||||
String suptype = getSupplierType(supplierid);
|
||||
if("DB01".equals(suptype)){
|
||||
items.put("pk_subjcode","22020105");//集团内
|
||||
//集团内部关联公司:22020105\应付账款\往来单位\内部单位(关联方)
|
||||
//如果费用登记中用户选择了会计科目,则使用该字段编号,否则还使用集团内外 yxl 20241116
|
||||
if(isnotext && payrequestinfo.getDynamicObject("qeug_accountview")!=null){
|
||||
items.put("pk_subjcode",payrequestinfo.getDynamicObject("qeug_accountview").getString("number"));
|
||||
}else{
|
||||
items.put("pk_subjcode","22020104");//收支项目编码 费用项目,例:660224-管理费用-服务费 会计科目(一个)
|
||||
String suptype = getSupplierType(supplierid);
|
||||
if("DB01".equals(suptype)){
|
||||
items.put("pk_subjcode","22020105");//集团内
|
||||
}else{
|
||||
items.put("pk_subjcode","22020104");//收支项目编码 费用项目,例:660224-管理费用-服务费 会计科目(一个)
|
||||
}
|
||||
}
|
||||
|
||||
items.put("ap_payaccount",ap_payaccount);//付款银行账户编码 同表头
|
||||
items.put("ap_recaccount",ap_recaccount);//收款银行账户编码
|
||||
items.put("pk_balatype","07");//结算方式编码,传编码例:07-网银
|
||||
|
|
|
@ -0,0 +1,149 @@
|
|||
package shkd.repc.resm.formplugin;
|
||||
|
||||
import kd.bos.bill.AbstractBillPlugIn;
|
||||
import kd.bos.dataentity.entity.DataEntityBase;
|
||||
import kd.bos.dataentity.entity.DynamicObject;
|
||||
import kd.bos.dataentity.entity.DynamicObjectCollection;
|
||||
import kd.bos.dataentity.resource.ResManager;
|
||||
import kd.bos.dataentity.utils.StringUtils;
|
||||
import kd.bos.entity.EntityMetadataCache;
|
||||
import kd.bos.entity.datamodel.IDataModel;
|
||||
import kd.bos.form.container.Tab;
|
||||
import kd.bos.form.control.Control;
|
||||
import kd.bos.orm.query.QCP;
|
||||
import kd.bos.orm.query.QFilter;
|
||||
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
||||
import kd.repc.common.util.resm.eval.EvalUtils;
|
||||
import kd.sdk.plugin.Plugin;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 单据界面插件
|
||||
*/
|
||||
public class ContractListDateFilterPlugin extends AbstractBillPlugIn implements Plugin {
|
||||
|
||||
/*
|
||||
* 评估计划-生成的评估清单里的合同增加根据评估期间过滤
|
||||
* 合同执行中:合同签约日期 <= 评估结束日期
|
||||
* 合同已结算:评估开始日期 <= 合同结算日期 <= 评估结束日期
|
||||
* */
|
||||
|
||||
@Override
|
||||
public void registerListener(EventObject e) {
|
||||
this.addClickListeners("btn_contractlist");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void click(EventObject evt) {
|
||||
super.click(evt);
|
||||
IDataModel model = this.getModel();
|
||||
Date startTime = (Date) model.getValue("interval_starttime");// 评估开始日期
|
||||
Date endTime = (Date) model.getValue("interval_endtime");// 评估结束日期
|
||||
|
||||
DynamicObjectCollection contractEntries = model.getEntryEntity("contract_entry");
|
||||
if (contractEntries != null && !contractEntries.isEmpty()) {
|
||||
if (endTime != null) {
|
||||
ArrayList<DynamicObject> deleteEntries = new ArrayList<>();
|
||||
for (DynamicObject contractEntry : contractEntries) {
|
||||
DynamicObject eyContract = contractEntry.getDynamicObject("ey_contract");
|
||||
String evalTypeNum = contractEntry.getString("ey_eval_type.number");// 评估类型
|
||||
if (eyContract != null) {
|
||||
DynamicObject contract = BusinessDataServiceHelper.loadSingle(eyContract.getPkValue(), "resm_contract_book", "id,sign_date,contract,ismaincontract,maincontract");
|
||||
if ("008".equals(evalTypeNum)) {// 执行中
|
||||
Date signDate = contract.getDate("sign_date");// 签约日期
|
||||
if (signDate != null) {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(signDate);
|
||||
calendar.set(Calendar.HOUR_OF_DAY, 0);
|
||||
calendar.set(Calendar.MINUTE, 0);
|
||||
calendar.set(Calendar.SECOND, 0);
|
||||
calendar.set(Calendar.MILLISECOND, 0);
|
||||
signDate = calendar.getTime();
|
||||
|
||||
if (!signDate.before(endTime))
|
||||
deleteEntries.add(contractEntry);
|
||||
}
|
||||
} else if ("007".equals(evalTypeNum) && startTime != null) {// 已结算
|
||||
DynamicObject contractSettle;
|
||||
|
||||
boolean isMainContract = contract.getBoolean("ismaincontract");// 是否主合同
|
||||
DynamicObject mainContract = contract.getDynamicObject("maincontract");// 关联主合同
|
||||
if (!isMainContract && mainContract != null) {
|
||||
mainContract = BusinessDataServiceHelper.loadSingle(mainContract.getPkValue(), "resm_contract_book", "id,sign_date,contract");
|
||||
Long contractId = mainContract.getLong("contract");
|
||||
QFilter idQF = new QFilter("contractbill", QCP.equals, contractId);
|
||||
contractSettle = BusinessDataServiceHelper.loadSingle("recon_consettlebill", "id,bizdate", idQF.toArray());// 合同结算
|
||||
} else {
|
||||
Long contractId = contract.getLong("contract");
|
||||
QFilter idQF = new QFilter("contractbill", QCP.equals, contractId);
|
||||
contractSettle = BusinessDataServiceHelper.loadSingle("recon_consettlebill", "id,bizdate", idQF.toArray());// 合同结算
|
||||
}
|
||||
|
||||
if (contractSettle != null) {
|
||||
Date bizDate = contractSettle.getDate("bizdate");// 结算日期
|
||||
if (bizDate != null) {
|
||||
if (bizDate.before(startTime) || bizDate.after(endTime))
|
||||
deleteEntries.add(contractEntry);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!deleteEntries.isEmpty()) {
|
||||
for (DynamicObject deleteEntry : deleteEntries) {
|
||||
contractEntries.remove(deleteEntry);
|
||||
}
|
||||
this.getView().updateView("contract_entry");
|
||||
}
|
||||
}
|
||||
|
||||
if (contractEntries.isEmpty()) {
|
||||
this.getView().showTipNotification(ResManager.loadKDString("没有符合条件的合同,请检查。", "EvalPlanEdit_13", "repc-resm-formplugin", new Object[0]));
|
||||
Tab tabap = (Tab)this.getView().getControl("tabap");
|
||||
tabap.activeTab("tab_info");
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < contractEntries.size(); i++) {
|
||||
DynamicObject contractEntry = contractEntries.get(i);
|
||||
DynamicObject eyContract = contractEntry.getDynamicObject("ey_contract");
|
||||
if (eyContract != null) {
|
||||
DynamicObject contract = BusinessDataServiceHelper.loadSingle(eyContract.getPkValue(), "resm_contract_book", "id,sign_date,contract,ismaincontract,maincontract");
|
||||
Date signDate = contract.getDate("sign_date");// 签约日期
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(signDate);
|
||||
calendar.set(Calendar.HOUR_OF_DAY, 0);
|
||||
calendar.set(Calendar.MINUTE, 0);
|
||||
calendar.set(Calendar.SECOND, 0);
|
||||
calendar.set(Calendar.MILLISECOND, 0);
|
||||
signDate = calendar.getTime();
|
||||
model.setValue("qeug_sign_date", signDate, i);
|
||||
|
||||
String evalTypeNum = contractEntry.getString("ey_eval_type.number");// 评估类型
|
||||
if (!"007".equals(evalTypeNum)) continue;
|
||||
|
||||
DynamicObject contractSettle;
|
||||
boolean isMainContract = contract.getBoolean("ismaincontract");
|
||||
DynamicObject mainContract = contract.getDynamicObject("maincontract");// 关联主合同
|
||||
if (!isMainContract && mainContract != null) {
|
||||
mainContract = BusinessDataServiceHelper.loadSingle(mainContract.getPkValue(), "resm_contract_book", "id,sign_date,contract");
|
||||
Long contractId = mainContract.getLong("contract");
|
||||
QFilter idQF = new QFilter("contractbill", QCP.equals, contractId);
|
||||
contractSettle = BusinessDataServiceHelper.loadSingle("recon_consettlebill", "id,bizdate", idQF.toArray());// 合同结算
|
||||
} else {
|
||||
Long contractId = contract.getLong("contract");
|
||||
QFilter idQF = new QFilter("contractbill", QCP.equals, contractId);
|
||||
contractSettle = BusinessDataServiceHelper.loadSingle("recon_consettlebill", "id,bizdate", idQF.toArray());// 合同结算
|
||||
}
|
||||
if (contractSettle != null) {
|
||||
Date bizDate = contractSettle.getDate("bizdate");// 结算日期
|
||||
model.setValue("qeug_bizdate", bizDate, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -17,32 +17,32 @@ public class RegisteredFormPlugin extends AbstractFormPlugin {
|
|||
public void afterDoOperation(AfterDoOperationEventArgs args) {
|
||||
super.afterDoOperation(args);
|
||||
String operateKey = args.getOperateKey();
|
||||
switch (operateKey) {
|
||||
// 注册完成时将信息携带到潜在供应商
|
||||
case "finishregistered":
|
||||
DynamicObject dataEntity = this.getModel().getDataEntity();
|
||||
//注册供应商
|
||||
DynamicObject resp_registered = BusinessDataServiceHelper.loadSingle(dataEntity.getPkValue(), "resp_registered");
|
||||
if (null != resp_registered) {
|
||||
DynamicObject regSupplier = resp_registered.getDynamicObject("regsuppplier");
|
||||
//潜在供应商
|
||||
if (regSupplier != null) {
|
||||
regSupplier = BusinessDataServiceHelper.loadSingle(regSupplier.getPkValue(), "resm_regsupplier");
|
||||
regSupplier.set("qeug_controllingperses",resp_registered.getString("qeug_controllingperses"));//公司实际控制人/权(股份公司)
|
||||
regSupplier.set("qeug_regnumberes",resp_registered.getString("qeug_regnumberes"));//企业注册号
|
||||
regSupplier.set("qeug_orgnumberes",resp_registered.getString("qeug_orgnumberes"));//组织机构代码
|
||||
regSupplier.set("qeug_regstatuses",resp_registered.getString("qeug_regstatuses"));//经营状态
|
||||
regSupplier.set("qeug_linkman",resp_registered.getString("qeug_linkman"));//外部联系人
|
||||
regSupplier.set("recommender",resp_registered.getDynamicObject("recommender"));//外部联系人
|
||||
SaveServiceHelper.save(new DynamicObject[]{regSupplier});
|
||||
DobeDWUtils.saveLog("注册供应商",
|
||||
"注册供应商",null, null,
|
||||
true,"注册供应商成功带入潜在供应商");
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
// switch (operateKey) {
|
||||
// // 注册完成时将信息携带到潜在供应商
|
||||
// case "finishregistered":
|
||||
// DynamicObject dataEntity = this.getModel().getDataEntity();
|
||||
// //注册供应商
|
||||
// DynamicObject resp_registered = BusinessDataServiceHelper.loadSingle(dataEntity.getPkValue(), "resp_registered");
|
||||
// if (null != resp_registered) {
|
||||
// DynamicObject regSupplier = resp_registered.getDynamicObject("regsuppplier");
|
||||
// //潜在供应商
|
||||
// if (regSupplier != null) {
|
||||
// regSupplier = BusinessDataServiceHelper.loadSingle(regSupplier.getPkValue(), "resm_regsupplier");
|
||||
// regSupplier.set("qeug_controllingperses",resp_registered.getString("qeug_controllingperses"));//公司实际控制人/权(股份公司)
|
||||
// regSupplier.set("qeug_regnumberes",resp_registered.getString("qeug_regnumberes"));//企业注册号
|
||||
// regSupplier.set("qeug_orgnumberes",resp_registered.getString("qeug_orgnumberes"));//组织机构代码
|
||||
// regSupplier.set("qeug_regstatuses",resp_registered.getString("qeug_regstatuses"));//经营状态
|
||||
// regSupplier.set("qeug_linkman",resp_registered.getString("qeug_linkman"));//外部联系人
|
||||
// regSupplier.set("recommender",resp_registered.getDynamicObject("recommender"));//外部联系人
|
||||
// SaveServiceHelper.save(new DynamicObject[]{regSupplier});
|
||||
// DobeDWUtils.saveLog("注册供应商",
|
||||
// "注册供应商",null, null,
|
||||
// true,"注册供应商成功带入潜在供应商");
|
||||
// }
|
||||
// }
|
||||
// break;
|
||||
// default:
|
||||
// break;
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ import kd.bos.bill.OperationStatus;
|
|||
import kd.bos.dataentity.OperateOption;
|
||||
import kd.bos.dataentity.entity.DynamicObject;
|
||||
import kd.bos.dataentity.entity.DynamicObjectCollection;
|
||||
import kd.bos.dataentity.entity.OrmLocaleValue;
|
||||
import kd.bos.dataentity.resource.ResManager;
|
||||
import kd.bos.dataentity.utils.StringUtils;
|
||||
import kd.bos.entity.EntityMetadataCache;
|
||||
|
@ -20,6 +21,7 @@ import kd.bos.orm.query.QFilter;
|
|||
import kd.bos.orm.util.CollectionUtils;
|
||||
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
||||
import kd.bos.servicehelper.operation.OperationServiceHelper;
|
||||
import kd.bos.servicehelper.operation.SaveServiceHelper;
|
||||
import kd.repc.common.enums.PersontypeEnum;
|
||||
import kd.repc.common.enums.resm.RegSupplierStatusEnum;
|
||||
import kd.repc.common.util.PermissionUtils;
|
||||
|
@ -28,6 +30,7 @@ import kd.repc.common.util.resm.SupplierStrategyUtil;
|
|||
//import kd.repc.common.util.resm.SupplierStrategyUtil;
|
||||
//import kd.repc.common.util.MultiLangEnumBridge;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
@ -84,10 +87,98 @@ public class TycQzSupplierFormPlugin extends AbstractFormPlugin {
|
|||
this.showPreaudit(args);
|
||||
}
|
||||
}
|
||||
// if ("query_tyc".equals(operateKey)) {
|
||||
// this.getView().invokeOperation("save");
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterDoOperation(AfterDoOperationEventArgs afterDoOperationEventArgs) {
|
||||
super.afterDoOperation(afterDoOperationEventArgs);
|
||||
String operateKey = afterDoOperationEventArgs.getOperateKey();
|
||||
|
||||
if ("query_tyc".equals(operateKey) || "preaudit".equals(operateKey)) {
|
||||
Object pkValue = this.getModel().getDataEntity().getPkValue();
|
||||
if (pkValue instanceof Number) {
|
||||
long pkLongValue = ((Number) pkValue).longValue(); // 转换为 long
|
||||
if (pkLongValue == 0) {
|
||||
this.getView().showMessage("请先保存单据");
|
||||
return;
|
||||
}
|
||||
}
|
||||
DynamicObject resm_regsupplier = BusinessDataServiceHelper.loadSingle(pkValue, "resm_regsupplier");
|
||||
|
||||
if ("preaudit".equals(operateKey) && resm_regsupplier != null) {
|
||||
DynamicObjectCollection qeug_infocheckentry = resm_regsupplier.getDynamicObjectCollection("qeug_infocheckentry");
|
||||
if (qeug_infocheckentry.size() > 0) {
|
||||
return; // 如果存在核对项,直接返回
|
||||
}
|
||||
}
|
||||
|
||||
showPreaudit();
|
||||
this.getView().invokeOperation("refresh");
|
||||
}
|
||||
}
|
||||
|
||||
private void showPreaudit() {
|
||||
Object pkValue = this.getModel().getDataEntity().getPkValue();
|
||||
DynamicObject resm_regsupplier = BusinessDataServiceHelper.loadSingle(pkValue, "resm_regsupplier");
|
||||
|
||||
if (resm_regsupplier != null) {
|
||||
DynamicObjectCollection qeug_infocheckentry = resm_regsupplier.getDynamicObjectCollection("qeug_infocheckentry");
|
||||
qeug_infocheckentry.clear();
|
||||
|
||||
DynamicObject[] qeugTycInfochecks = BusinessDataServiceHelper.load("qeug_tyc_infocheck", "number,name,qeug_apifields", null);
|
||||
|
||||
SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd");
|
||||
|
||||
for (int i = 0; i < qeugTycInfochecks.length; i++) {
|
||||
DynamicObject qeugTycInfocheck = qeugTycInfochecks[i];
|
||||
DynamicObject add = qeug_infocheckentry.addNew();
|
||||
add.set("seq", i);
|
||||
add.set("qeug_bsfield", qeugTycInfocheck.getString("number")); // 核对字段标识
|
||||
add.set("qeug_bsfieldname", qeugTycInfocheck.getString("name")); // 核对项目名称
|
||||
add.set("qeug_bsinput", getBsInput(resm_regsupplier, qeugTycInfocheck.getString("number"), sd)); // 录入内容
|
||||
String qeugApifields = qeugTycInfocheck.getString("qeug_apifields"); // 接口字段标识
|
||||
add.set("qeug_apifield", qeugApifields); // 接口字段标识
|
||||
add.set("qeug_queryresult", getQueryResult(resm_regsupplier, qeugApifields, sd)); // 接口查询结果
|
||||
|
||||
// 判断是否匹配
|
||||
String bsinput = add.getString("qeug_bsinput");
|
||||
String queryresult = add.getString("qeug_queryresult");
|
||||
add.set("qeug_issame", bsinput.equals(queryresult) ? "1" : "0"); // 0: 不匹配 1: 匹配
|
||||
}
|
||||
|
||||
SaveServiceHelper.save(new DynamicObject[]{resm_regsupplier});
|
||||
}
|
||||
}
|
||||
|
||||
// 获取录入内容
|
||||
private String getBsInput(DynamicObject resm_regsupplier, String number, SimpleDateFormat sd) {
|
||||
Object obj = resm_regsupplier.get(number);
|
||||
return formatFieldValue(obj, sd);
|
||||
}
|
||||
|
||||
// 获取查询结果
|
||||
private String getQueryResult(DynamicObject resm_regsupplier, String qeugApifields, SimpleDateFormat sd) {
|
||||
Object obj = resm_regsupplier.get(qeugApifields);
|
||||
return formatFieldValue(obj, sd);
|
||||
}
|
||||
|
||||
// 格式化字段值
|
||||
private String formatFieldValue(Object obj, SimpleDateFormat sd) {
|
||||
if (obj instanceof Date) {
|
||||
return sd.format((Date) obj);
|
||||
} else if (obj instanceof String) {
|
||||
return (String) obj;
|
||||
} else if (obj instanceof Long) {
|
||||
return sd.format(new Date((Long) obj));
|
||||
}else if(obj instanceof OrmLocaleValue) {
|
||||
OrmLocaleValue o = (OrmLocaleValue) obj;
|
||||
return (String)o.get("zh_CN");
|
||||
}
|
||||
return ""; // 返回空字符串表示无效值
|
||||
}
|
||||
protected boolean checkIsCanDo(BeforeDoOperationEventArgs args) {
|
||||
if (!SupplierStrategyUtil.isPreTrial()) {
|
||||
return true;
|
||||
|
|
|
@ -2,12 +2,16 @@ package shkd.repc.resm.formplugin;
|
|||
|
||||
import kd.bos.dataentity.entity.DynamicObject;
|
||||
import kd.bos.dataentity.entity.DynamicObjectCollection;
|
||||
import kd.bos.dataentity.entity.OrmLocaleValue;
|
||||
import kd.bos.form.events.AfterDoOperationEventArgs;
|
||||
import kd.bos.form.plugin.AbstractFormPlugin;
|
||||
import kd.bos.orm.query.QCP;
|
||||
import kd.bos.orm.query.QFilter;
|
||||
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
||||
import kd.bos.servicehelper.operation.SaveServiceHelper;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.EventObject;
|
||||
|
||||
/**
|
||||
|
@ -390,4 +394,69 @@ public class TycSupplieFormPlugin extends AbstractFormPlugin {
|
|||
}
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterDoOperation(AfterDoOperationEventArgs afterDoOperationEventArgs) {
|
||||
super.afterDoOperation(afterDoOperationEventArgs);
|
||||
String operateKey = afterDoOperationEventArgs.getOperateKey();
|
||||
if ("query_tyc".equals(operateKey)) {
|
||||
DynamicObject dynamicObject = this.getModel().getDataEntity();
|
||||
Long supplierid = dynamicObject.getLong("supplierid");
|
||||
QFilter q1 = new QFilter("id", QCP.equals, supplierid);
|
||||
DynamicObject supplier_t = BusinessDataServiceHelper.loadSingle("resm_official_supplier", new QFilter[]{q1});
|
||||
if (null != supplier_t) {
|
||||
|
||||
/**
|
||||
* -------------------------------------------基本信息核对------------------------------------------
|
||||
*/
|
||||
|
||||
DynamicObjectCollection qeug_infocheckentry = supplier_t.getDynamicObjectCollection("qeug_infocheckentry");
|
||||
qeug_infocheckentry.clear();
|
||||
DynamicObject[] qeugTycInfochecks = BusinessDataServiceHelper.load("qeug_tyc_infocheck",
|
||||
"number,name,qeug_apifields", null);
|
||||
for (int i = 0; i < qeugTycInfochecks.length; i++) {
|
||||
DynamicObject qeugTycInfocheck = qeugTycInfochecks[i];
|
||||
DynamicObject add = qeug_infocheckentry.addNew();
|
||||
add.set("seq",i);
|
||||
String number = qeugTycInfocheck.getString("number");
|
||||
add.set("qeug_bsfield",number);//核对字段标识
|
||||
add.set("qeug_bsfieldname",qeugTycInfocheck.getString("name"));//核对项目名称
|
||||
String bsinput = "";//录入内容
|
||||
Object obj = supplier_t.get(number);
|
||||
SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd");
|
||||
if (obj instanceof Date) {
|
||||
Date date = (Date) obj;
|
||||
bsinput = sd.format(date);
|
||||
} else if(obj instanceof String) {
|
||||
bsinput =(String) obj;
|
||||
}else if(obj instanceof OrmLocaleValue) {
|
||||
OrmLocaleValue o = (OrmLocaleValue) obj;
|
||||
bsinput = o.get("zh_CN");
|
||||
}
|
||||
add.set("qeug_bsinput",bsinput);
|
||||
String qeugApifields = qeugTycInfocheck.getString("qeug_apifields");//接口字段标识
|
||||
add.set("qeug_apifield",qeugApifields);//接口字段标识
|
||||
String queryresult = "";//接口查询结果
|
||||
Object obj1 = dynamicObject.get(qeugApifields);
|
||||
if (obj1 instanceof Date) {
|
||||
Date date = (Date) obj1;
|
||||
queryresult = sd.format(date);
|
||||
} else if(obj1 instanceof String) {
|
||||
queryresult =(String) obj1;
|
||||
} else if(obj1 instanceof Long) {
|
||||
Date date = new Date((Long) obj1);
|
||||
queryresult = sd.format(date);
|
||||
}
|
||||
add.set("qeug_queryresult",queryresult);
|
||||
if (bsinput.equals(queryresult)) {
|
||||
add.set("qeug_issame","1");//0:不匹配 1:匹配
|
||||
}else {
|
||||
add.set("qeug_issame","0");
|
||||
}
|
||||
}
|
||||
SaveServiceHelper.save(new DynamicObject[]{supplier_t});
|
||||
}
|
||||
this.getView().invokeOperation("refresh");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,47 @@
|
|||
package shkd.repc.resm.opplugin;
|
||||
|
||||
import kd.bos.dataentity.entity.DynamicObject;
|
||||
import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
|
||||
import kd.bos.entity.plugin.args.AfterOperationArgs;
|
||||
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
||||
import kd.bos.servicehelper.operation.SaveServiceHelper;
|
||||
import shkd.utils.DobeDWUtils;
|
||||
|
||||
/**
|
||||
* 注册完成时将信息携带到潜在供应商
|
||||
* qeug_resp_registered_ext
|
||||
*/
|
||||
public class RegisteredFinishregOPPlugin extends AbstractOperationServicePlugIn {
|
||||
|
||||
@Override
|
||||
public void afterExecuteOperationTransaction(AfterOperationArgs e) {
|
||||
super.afterExecuteOperationTransaction(e);
|
||||
|
||||
String operationKey = e.getOperationKey();
|
||||
if ("finishregistered".equals(operationKey)) {
|
||||
|
||||
// DynamicObject dataEntity = this.getModel().getDataEntity();
|
||||
DynamicObject[] dataEntities1 = e.getDataEntities();
|
||||
DynamicObject dataEntity = dataEntities1[0];
|
||||
//注册供应商
|
||||
DynamicObject resp_registered = BusinessDataServiceHelper.loadSingle(dataEntity.getPkValue(), "resp_registered");
|
||||
if (null != resp_registered) {
|
||||
DynamicObject regSupplier = resp_registered.getDynamicObject("regsuppplier");
|
||||
//潜在供应商
|
||||
if (regSupplier != null) {
|
||||
regSupplier = BusinessDataServiceHelper.loadSingle(regSupplier.getPkValue(), "resm_regsupplier");
|
||||
regSupplier.set("qeug_controllingperses",resp_registered.getString("qeug_controllingperses"));//公司实际控制人/权(股份公司)
|
||||
regSupplier.set("qeug_regnumberes",resp_registered.getString("qeug_regnumberes"));//企业注册号
|
||||
regSupplier.set("qeug_orgnumberes",resp_registered.getString("qeug_orgnumberes"));//组织机构代码
|
||||
regSupplier.set("qeug_regstatuses",resp_registered.getString("qeug_regstatuses"));//经营状态
|
||||
regSupplier.set("qeug_linkman",resp_registered.getString("qeug_linkman"));//外部联系人
|
||||
regSupplier.set("recommender",resp_registered.getDynamicObject("recommender"));//外部联系人
|
||||
SaveServiceHelper.save(new DynamicObject[]{regSupplier});
|
||||
DobeDWUtils.saveLog("注册供应商",
|
||||
"注册供应商",null, null,
|
||||
true,"注册供应商成功带入潜在供应商");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -57,7 +57,6 @@ public class TycSupplierSearchOPPlugin extends AbstractOperationServicePlugIn {
|
|||
if (null != supplier_t) {
|
||||
queryTyc(supplier_t);
|
||||
}
|
||||
|
||||
}
|
||||
//todo 测试定时任务代码
|
||||
//正式供应商列表批量查询
|
||||
|
@ -74,12 +73,67 @@ public class TycSupplierSearchOPPlugin extends AbstractOperationServicePlugIn {
|
|||
DynamicObject supplier = BusinessDataServiceHelper.loadSingle("resm_official_supplier", new QFilter[]{q1});
|
||||
if (null != supplier) {
|
||||
logger.info(name+"3333333正式供应商列表批量查询");
|
||||
|
||||
queryTyc(supplier);
|
||||
dbTYC(supplier);//比对天眼查数据
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void dbTYC(DynamicObject supplier_zs){
|
||||
|
||||
/**
|
||||
* -------------------------------------------基本信息核对------------------------------------------
|
||||
*/
|
||||
|
||||
DynamicObjectCollection qeug_infocheckentry = supplier_zs.getDynamicObjectCollection("qeug_infocheckentry");
|
||||
qeug_infocheckentry.clear();
|
||||
DynamicObject[] qeugTycInfochecks = BusinessDataServiceHelper.load("qeug_tyc_infocheck",
|
||||
"number,name,qeug_apifields", null);
|
||||
for (int i = 0; i < qeugTycInfochecks.length; i++) {
|
||||
DynamicObject qeugTycInfocheck = qeugTycInfochecks[i];
|
||||
DynamicObject add = qeug_infocheckentry.addNew();
|
||||
add.set("seq",i);
|
||||
String number = qeugTycInfocheck.getString("number");
|
||||
add.set("qeug_bsfield",number);//核对字段标识
|
||||
add.set("qeug_bsfieldname",qeugTycInfocheck.getString("name"));//核对项目名称
|
||||
String bsinput = "";//录入内容
|
||||
Object obj = supplier_zs.get(number);
|
||||
SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd");
|
||||
if (obj instanceof Date) {
|
||||
Date date = (Date) obj;
|
||||
bsinput = sd.format(date);
|
||||
} else if(obj instanceof String) {
|
||||
bsinput =(String) obj;
|
||||
}else if(obj instanceof OrmLocaleValue) {
|
||||
OrmLocaleValue o = (OrmLocaleValue) obj;
|
||||
bsinput = o.get("zh_CN");
|
||||
}
|
||||
add.set("qeug_bsinput",bsinput);
|
||||
String qeugApifields = qeugTycInfocheck.getString("qeug_apifields");//接口字段标识
|
||||
add.set("qeug_apifield",qeugApifields);//接口字段标识
|
||||
String queryresult = "";//接口查询结果
|
||||
Object obj1 = supplier_zs.get(qeugApifields);
|
||||
if (obj1 instanceof Date) {
|
||||
Date date = (Date) obj1;
|
||||
queryresult = sd.format(date);
|
||||
} else if(obj1 instanceof String) {
|
||||
queryresult =(String) obj1;
|
||||
} else if(obj1 instanceof Long) {
|
||||
Date date = new Date((Long) obj1);
|
||||
queryresult = sd.format(date);
|
||||
}
|
||||
add.set("qeug_queryresult",queryresult);
|
||||
if (bsinput.equals(queryresult)) {
|
||||
add.set("qeug_issame","1");//0:不匹配 1:匹配
|
||||
}else {
|
||||
add.set("qeug_issame","0");
|
||||
}
|
||||
}
|
||||
SaveServiceHelper.save(new DynamicObject[]{supplier_zs});
|
||||
}
|
||||
|
||||
public static void queryTyc(DynamicObject supplier_zs) {
|
||||
DynamicObject dynamicObject = supplier_zs;//正式供应商
|
||||
// DynamicObject supplier_t = supplier_zs;//正式供应商
|
||||
|
@ -211,70 +265,7 @@ public class TycSupplierSearchOPPlugin extends AbstractOperationServicePlugIn {
|
|||
dynamicObject.set("qeug_businessscopes",businessScope);//经营范围
|
||||
SaveServiceHelper.save(new DynamicObject[]{dynamicObject});
|
||||
|
||||
/**
|
||||
* -------------------------------------------基本信息核对------------------------------------------
|
||||
*/
|
||||
|
||||
DynamicObjectCollection qeug_infocheckentry = dynamicObject.getDynamicObjectCollection("qeug_infocheckentry");
|
||||
qeug_infocheckentry.clear();
|
||||
DynamicObject[] qeugTycInfochecks = BusinessDataServiceHelper.load("qeug_tyc_infocheck",
|
||||
"number,name,qeug_apifields", null);
|
||||
for (int i = 0; i < qeugTycInfochecks.length; i++) {
|
||||
DynamicObject qeugTycInfocheck = qeugTycInfochecks[i];
|
||||
DynamicObject add = qeug_infocheckentry.addNew();
|
||||
add.set("seq",i);
|
||||
String number = qeugTycInfocheck.getString("number");
|
||||
add.set("qeug_bsfield",number);//核对字段标识
|
||||
add.set("qeug_bsfieldname",qeugTycInfocheck.getString("name"));//核对项目名称
|
||||
String bsinput = "";//录入内容
|
||||
Object obj = dynamicObject.get(number);
|
||||
SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd");
|
||||
if (obj instanceof Date) {
|
||||
Date date = (Date) obj;
|
||||
bsinput = sd.format(date);
|
||||
} else if(obj instanceof String) {
|
||||
bsinput =(String) obj;
|
||||
}else if(obj instanceof OrmLocaleValue) {
|
||||
OrmLocaleValue o = (OrmLocaleValue) obj;
|
||||
bsinput = o.get("zh_CN");
|
||||
}
|
||||
add.set("qeug_bsinput",bsinput);
|
||||
String qeugApifields = qeugTycInfocheck.getString("qeug_apifields");//接口字段标识
|
||||
add.set("qeug_apifield",qeugApifields);//接口字段标识
|
||||
String queryresult = "";//接口查询结果
|
||||
Object obj1 = tyc_Baseinfo_result.get(qeugApifields);
|
||||
if (obj1 instanceof Date) {
|
||||
Date date = (Date) obj1;
|
||||
queryresult = sd.format(date);
|
||||
} else if(obj1 instanceof String) {
|
||||
queryresult =(String) obj1;
|
||||
} else if(obj1 instanceof Long) {
|
||||
Date date = new Date((Long) obj1);
|
||||
queryresult = sd.format(date);
|
||||
}
|
||||
add.set("qeug_queryresult",queryresult);
|
||||
if (bsinput.equals(queryresult)) {
|
||||
add.set("qeug_issame","1");//0:不匹配 1:匹配
|
||||
}else {
|
||||
add.set("qeug_issame","0");
|
||||
}
|
||||
}
|
||||
SaveServiceHelper.save(new DynamicObject[]{dynamicObject});
|
||||
|
||||
}
|
||||
// else {
|
||||
// //接口调用失败
|
||||
// Integer error_code = (Integer)tyc_Baseinfo_results.get("error_code");//状态码
|
||||
// if (error_code.equals(300003)) {
|
||||
// String reason = (String)tyc_Baseinfo_results.get("reason");//错误信息
|
||||
// OperateErrorInfo operateErrorInfo = new OperateErrorInfo();
|
||||
// operateErrorInfo.setMessage(reason + ",请联系管理员");
|
||||
// operateErrorInfo.setErrorLevel(ErrorLevel.Error.name());
|
||||
// operateErrorInfo.setPkValue(dynamicObject.getPkValue());
|
||||
// this.operationResult.addErrorInfo(operateErrorInfo);
|
||||
// logger.error("天眼查接口调用失败,错误码:" + error_code + ",原因:" + reason);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -28,6 +28,7 @@ public class DobeDWorgRelationTask extends AbstractTask implements Plugin {
|
|||
|
||||
private static Log log = LogFactory.getLog(DobeDWorgRelationTask.class);
|
||||
private static final String entityName = "qeug_recon_orgrelation";//供应链库 表名 tk_qeug_recon_orgrelation
|
||||
private static final String orgEntityName = "bos_org";//系统库 表名 t_ORG_ORG
|
||||
private static final String dw_menthod = "mdm_orgcorp";
|
||||
|
||||
@Override
|
||||
|
@ -91,6 +92,7 @@ public class DobeDWorgRelationTask extends AbstractTask implements Plugin {
|
|||
String paybank = null;
|
||||
String paynumber = null;
|
||||
String taxno = null;
|
||||
DynamicObject yworginfo = null;
|
||||
|
||||
for (int i = 0; i < detailsJson.size(); i++) {
|
||||
json_body = detailsJson.getJSONObject(i);
|
||||
|
@ -137,6 +139,15 @@ public class DobeDWorgRelationTask extends AbstractTask implements Plugin {
|
|||
//保存数据:直接保存入库,不走操作校验
|
||||
SaveServiceHelper.save(new DynamicObject[]{orginfo});
|
||||
}
|
||||
//根据行政组织编号找到星瀚上的业务单元对象
|
||||
yworginfo = BusinessDataServiceHelper.loadSingle(orgEntityName,new QFilter[]{new QFilter("number","=",orgNumber)});
|
||||
if(yworginfo != null){
|
||||
yworginfo.set("ffirmname", companyName);//业务单元-公司名称
|
||||
yworginfo.set("depositbank", paybank);//业务单元-开户行
|
||||
yworginfo.set("bankaccount", paynumber);//业务单元-银行账户
|
||||
yworginfo.set("uniformsocialcreditcode", taxno);//业务单元-统一社会信用代码
|
||||
SaveServiceHelper.update(yworginfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -83,16 +83,17 @@ public class DobeDWprojectTask extends AbstractTask implements Plugin {
|
|||
|
||||
String fbillno = null;//项目编号
|
||||
String fbillname = null;//项目名称
|
||||
String fprojectstageid = null;//项目阶段 repmd_projectstages t_repmd_projectstage
|
||||
// String fprojectstageid = null;//项目阶段 repmd_projectstages t_repmd_projectstage 用户自行在界面上选择
|
||||
// String fversionnum = null;//版本号
|
||||
// String fisleaf = null;//是否叶子节点
|
||||
String faddress = null;//项目地址
|
||||
String project_stage = null;//项目性质--二开字段,用于工作流发起判断
|
||||
String forgid = null;//所属组织-行政组织
|
||||
Date project_getdate = null;//项目获取时间
|
||||
String fdwid = null;//数仓项目id
|
||||
DynamicObject orginfo = null;
|
||||
DynamicObject projectinfo = null;
|
||||
DynamicObject projectstageinfo = null;
|
||||
// DynamicObject projectstageinfo = null;
|
||||
for (int i = 0; i < detailsJson.size(); i++) {
|
||||
json_body = detailsJson.getJSONObject(i);
|
||||
fbillno = json_body.getString("project_code");
|
||||
|
@ -101,7 +102,7 @@ public class DobeDWprojectTask extends AbstractTask implements Plugin {
|
|||
// fisleaf = json_body.getString("fisleaf");
|
||||
forgid = json_body.getString("org_code");
|
||||
project_getdate = json_body.getDate("project_getdate");
|
||||
fprojectstageid = json_body.getString("project_stage");
|
||||
project_stage = json_body.getString("project_stage");
|
||||
fdwid = json_body.getString("project_id");
|
||||
if(DobeDWUtils.isEmpty(fbillno) || DobeDWUtils.isEmpty(fbillname) || DobeDWUtils.isEmpty(forgid) || DobeDWUtils.isEmpty(fdwid)){
|
||||
log.info(String.format("项目接口入参为空异常:%s", json_body.toJSONString()));
|
||||
|
@ -110,7 +111,7 @@ public class DobeDWprojectTask extends AbstractTask implements Plugin {
|
|||
//根据数仓id查找项目是否已存在
|
||||
projectinfo = BusinessDataServiceHelper.loadSingle(entityName,new QFilter[]{new QFilter("qeug_dwid","=",fdwid)});
|
||||
//项目阶段表名:t_repmd_projectstage
|
||||
projectstageinfo = QueryServiceHelper.queryOne("repmd_projectstages","id,number",new QFilter[]{new QFilter("number","=",fprojectstageid)});
|
||||
// projectstageinfo = QueryServiceHelper.queryOne("repmd_projectstages","id,number",new QFilter[]{new QFilter("number","=",fprojectstageid)});
|
||||
if(projectinfo != null){
|
||||
if("C".equals(projectinfo.getString("billstatus"))){
|
||||
//如果项目已审核,则不进行修改
|
||||
|
@ -119,9 +120,9 @@ public class DobeDWprojectTask extends AbstractTask implements Plugin {
|
|||
//已存在,做更新 名称 阶段 版本号等信息;组织、编号、是否叶子节点不能更新;需要前台操作
|
||||
projectinfo.set("billname", fbillname);
|
||||
projectinfo.set("fullname", fbillname);//项目全称
|
||||
if(projectstageinfo != null){
|
||||
projectinfo.set("projectstage", projectstageinfo.getLong("id"));//项目阶段
|
||||
}
|
||||
// if(projectstageinfo != null){
|
||||
// projectinfo.set("projectstage", projectstageinfo.getLong("id"));//项目阶段
|
||||
// }
|
||||
projectinfo.set("address", faddress);
|
||||
projectinfo.set("acquiredate", project_getdate);
|
||||
// projectinfo.set("billstatus", "A");//单据状态 A保存 B已提交 C已审核
|
||||
|
@ -129,6 +130,11 @@ public class DobeDWprojectTask extends AbstractTask implements Plugin {
|
|||
projectinfo.set("enable", 1);//是否启用
|
||||
projectinfo.set("islatestversion", true);//是否最新版
|
||||
projectinfo.set("mainprojectid", projectinfo.getLong("id"));//主项目ID
|
||||
if("新拓园区".equals(project_stage)){
|
||||
projectinfo.set("qeug_combofield", "xintuo");
|
||||
}else if("成熟园区".equals(project_stage)){
|
||||
projectinfo.set("qeug_combofield", "chengshu");
|
||||
}
|
||||
// projectinfo.set("billno", fbillno);
|
||||
// projectinfo.set("org", );
|
||||
// projectinfo.set("isleaf", fisleaf);
|
||||
|
@ -147,9 +153,9 @@ public class DobeDWprojectTask extends AbstractTask implements Plugin {
|
|||
// }
|
||||
projectinfo.set("bizdate", new Date());//业务日期
|
||||
projectinfo.set("showflag", true);//是否列表显示
|
||||
if(projectstageinfo != null){
|
||||
projectinfo.set("projectstage", projectstageinfo.getLong("id"));//项目阶段
|
||||
}
|
||||
// if(projectstageinfo != null){
|
||||
// projectinfo.set("projectstage", projectstageinfo.getLong("id"));//项目阶段
|
||||
// }
|
||||
projectinfo.set("address", faddress);
|
||||
projectinfo.set("acquiredate", project_getdate);
|
||||
orginfo = QueryServiceHelper.queryOne("bos_org","id,number,name",new QFilter[]{new QFilter("number","=",forgid)});
|
||||
|
@ -164,6 +170,11 @@ public class DobeDWprojectTask extends AbstractTask implements Plugin {
|
|||
projectinfo.set("enable", 1);//是否启用
|
||||
projectinfo.set("billstatus", "A");//单据状态 A保存 B已提交 C已审核
|
||||
projectinfo.set("creator", 43007523L);//创建人默认指定为金小蝶
|
||||
if("新拓园区".equals(project_stage)){
|
||||
projectinfo.set("qeug_combofield", "xintuo");
|
||||
}else if("成熟园区".equals(project_stage)){
|
||||
projectinfo.set("qeug_combofield", "chengshu");
|
||||
}
|
||||
//保存数据:直接保存入库,不走操作校验
|
||||
SaveServiceHelper.save(new DynamicObject[]{projectinfo});
|
||||
}
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
package shkd.todotask;
|
||||
|
||||
import kd.bos.form.FormShowParameter;
|
||||
import kd.bos.logging.Log;
|
||||
import kd.bos.logging.LogFactory;
|
||||
import kd.bos.mvc.form.FormView;
|
||||
import kd.bos.workflow.taskcenter.plugin.validate.IApprovalSubPlugin;
|
||||
import shkd.utils.OAUtils;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
|
@ -15,8 +18,24 @@ public class closeTaskPagePlugin implements IApprovalSubPlugin {
|
|||
@Override
|
||||
public boolean executeClosePageAfterSubmitTask(boolean isPCShow, Map<String, Object> customParams) {
|
||||
logger.info("进入页面关闭方法");
|
||||
logger.info("进入页面关闭方法");
|
||||
return false;
|
||||
boolean flag = false;
|
||||
FormView view = (FormView) customParams.get("formView");
|
||||
FormShowParameter parameter = view.getFormShowParameter();
|
||||
logger.info("获取view对象成功");
|
||||
HashMap<String,Object> map = new HashMap<>();
|
||||
if (parameter.getCustomParams().containsKey("apptype")) {
|
||||
String apptype = parameter.getCustomParam("apptype");
|
||||
if ("zhiyuan".equals(apptype)) {
|
||||
try {
|
||||
view.close();
|
||||
}catch (Exception e) {
|
||||
logger.info("发送指令时异常" + e.getMessage());
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -212,29 +212,37 @@ public class todoZyTaskServiceHandler extends AbstractMessageServiceHandler {
|
|||
public void sendMessage(MessageContext messageContext, MessageInfo message) {
|
||||
super.sendMessage(messageContext, message);
|
||||
//获取单据编码
|
||||
String billNo = messageContext.getBillNo();
|
||||
// String billNo = messageContext.getBillNo();
|
||||
String billNo =message.getNestBillno();
|
||||
//消息内容
|
||||
String content = message.getContent();
|
||||
//消息时间
|
||||
Date createDate = messageContext.getCreateDate();
|
||||
// Date createDate = messageContext.getCreateDate();
|
||||
// Date createDate = new Date();
|
||||
Date createDate = message.getSendTime();
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
String createDateStr = sdf.format(createDate);
|
||||
//获取当前任务ID
|
||||
Long taskId = messageContext.getTaskId();
|
||||
// Long taskId = messageContext.getTaskId();
|
||||
Long taskId = message.getId();
|
||||
|
||||
//获取审批人集合
|
||||
List<DynamicObject> approvers = new ArrayList<>();
|
||||
List<Long> userIds = message.getUserIds(); // 审批人ID集合
|
||||
List<DynamicObject> approversLists = getApprovers(userIds, approvers);
|
||||
//获取任务创建人
|
||||
Long startUserId = messageContext.getStartUserId(); // 审批实例发起人id
|
||||
DynamicObject startUser = BusinessDataServiceHelper.loadSingle(startUserId, "bos_user");
|
||||
//获取任务创建人 // 信息发送人
|
||||
Long startUserId = message.getSenderId();
|
||||
// Long startUserId = messageContext.getStartUserId(); // 审批实例发起人id
|
||||
String startNumber = "";
|
||||
String startName = "";
|
||||
if (null != startUser) {
|
||||
startNumber = startUser.getString("number");
|
||||
startName = startUser.getString("name");
|
||||
if (!userIds.contains(startUserId)) {
|
||||
approversLists.add(startUser);//添加发起人到审批人集合_便于后续接口调用(用户绑定接口)
|
||||
if (null != startUserId) {
|
||||
DynamicObject startUser = BusinessDataServiceHelper.loadSingle(startUserId, "bos_user");
|
||||
if (null != startUser) {
|
||||
startNumber = startUser.getString("number");
|
||||
startName = startUser.getString("name");
|
||||
if (!userIds.contains(startUserId)) {
|
||||
approversLists.add(startUser);//添加发起人到审批人集合_便于后续接口调用(用户绑定接口)
|
||||
}
|
||||
}
|
||||
}
|
||||
//获取Url
|
||||
|
@ -262,7 +270,7 @@ public class todoZyTaskServiceHandler extends AbstractMessageServiceHandler {
|
|||
thirdPartyMap.put("billNo",billNo);
|
||||
thirdPartyMap.put("startNumber",startNumber);//发起人
|
||||
|
||||
//推送OA待办新增接口
|
||||
//推送OA消息新增接口
|
||||
thirdpartyMessage(thirdPartyMap);
|
||||
|
||||
}
|
||||
|
|
|
@ -24,14 +24,14 @@ public class DobeDWUtils {
|
|||
|
||||
//授权模式,客户端模式为client,密码模式为:password
|
||||
// public static final String granttype = "client_credentials";
|
||||
//第三方应用id,对应系统中的app_id
|
||||
//BIP第三方应用id,对应系统中的app_id
|
||||
public static final String clientid = "ISC";
|
||||
// 第三方应用秘钥,对请求加签使用
|
||||
public static final String clientsecret = "72135b74ab7046dbab06";
|
||||
//BIP 第三方应用秘钥,对请求加签使用
|
||||
public static final String clientsecret = "cb729cf706934e97aa84";
|
||||
//访问的BIP系统的账套code
|
||||
public static final String bizcenter = "01";
|
||||
//公钥,加解密使用
|
||||
public static final String pubKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtifU2Nm6/lwYybVGNMzmn/UvOmtjqs9tuesdchx0pK6HsiubCRiFKr/TFGLHhBKJ3TXtH4gwJLkGrMJRdTicWHOCAwcU9hmM+XsHCF4FQ4UWcWA73Ha9qR3SC1tSxwDw8n2/uHUKtKzlOGuJQnzL5hBN7DnDU4M7FqEZ+ctG71ufkjytY1TKVoHfThRTAP1ouSNo3gM/pMwjISTkFH5vY7twdu9IW09+S5/uo8C+pw7BahDpOv5z7F1yWDEnw1sdwNdqPFV2DsB1JS3GfLe9P3ZACeR+lcD3KrwBsQky3oZsg3y6NsDqOpzoLk9pToFzmci1GMfCKoc4MzVF9fq7XQIDAQAB";
|
||||
//BIP公钥,加解密使用
|
||||
public static final String pubKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA8cLD7SZ8W15DF+XZ5+WURaxFP6TBvUG6fabTEh5oV2NFdsowuS88fFUx3rh0KqWQ3VtRRCVjHgGBuPIDakEZ8rn+kDq3BV10+ihJunuqqP/LBSr4Y2JYHj6vqwYw6K3raH4li/sAR02rQdoR922OU2bPxc3BlLTA0yLFqjo/3/Bf8DvYIo/yZ+enK1glK6SYVX7+dLv2a8sWb2MtUDm7JXW14rqwuO9dwlTTBTbrZ3AKubvaE7qXXqbJdYDLGTiLSD2mXJa7vwO+6ZTQJDN4sJUCeFchNMeB2xIjzbV3ZpL75xKPbbRnhANpswiaRN5OhtQcUKK3Y0+TRiihfIc3RQIDAQAB";
|
||||
//用友接口IP地址
|
||||
public static final String yyip = "106.14.25.83";
|
||||
//用友接口端口
|
||||
|
|
Loading…
Reference in New Issue