产值确认优化
This commit is contained in:
parent
5e0a0af3a6
commit
2e2bd6c5b5
main/java/shkd/repc/recon
|
@ -165,9 +165,9 @@ public class ContractFormPlugin extends AbstractFormPlugin implements UploadLis
|
|||
if ("qeug_attachmentpanelap".equals(key)) {
|
||||
|
||||
boolean b = deleteList();
|
||||
if (b) {
|
||||
this.getView().showSuccessNotification("已同步删除明细数据");
|
||||
}
|
||||
// if (b) {
|
||||
//// this.getView().showSuccessNotification("已同步删除明细数据");
|
||||
// }
|
||||
}
|
||||
}
|
||||
/**
|
||||
|
@ -199,10 +199,13 @@ public class ContractFormPlugin extends AbstractFormPlugin implements UploadLis
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
int size = qeug_invoiceentryinfos.size();
|
||||
//删除单据体数据
|
||||
qeug_invoiceentryinfos.clear();
|
||||
SaveServiceHelper.save(new DynamicObject[]{this.getModel().getDataEntity()});
|
||||
for (int i = 0; i < size; i++) {
|
||||
this.getView().getModel().deleteEntryRow("qeug_invoiceentryinfo",0);
|
||||
}
|
||||
// SaveServiceHelper.save(new DynamicObject[]{this.getModel().getDataEntity(true)});
|
||||
this.getView().invokeOperation("save");
|
||||
// 删除完成之后刷新界面
|
||||
this.getView().invokeOperation("refresh");
|
||||
return result;
|
||||
|
@ -269,7 +272,7 @@ public class ContractFormPlugin extends AbstractFormPlugin implements UploadLis
|
|||
// return;
|
||||
this.getView().invokeOperation("save");//调用保存
|
||||
}
|
||||
List<Map<String, Object>> attachmentes = AttachmentServiceHelper.getAttachments("recon_contractbill", this.getModel().getValue("id"), "qeug_attachmentpanelap");
|
||||
List<Map<String, Object>> attachmentes = AttachmentServiceHelper.getAttachments(billtype, this.getModel().getValue("id"), "qeug_attachmentpanelap");
|
||||
for (Map<String, Object> attachment : attachmentes) {
|
||||
String url = attachment.get("url").toString();
|
||||
try {
|
||||
|
@ -365,15 +368,25 @@ public class ContractFormPlugin extends AbstractFormPlugin implements UploadLis
|
|||
break;
|
||||
case 10:
|
||||
if (StringUtils.isNotEmpty(cell.toString())) {
|
||||
contractsummarylist.set("qeug_artificial",BigDecimal.valueOf(Double.parseDouble(cell.toString())));//人工费
|
||||
contractsummarylist.set("qeug_artificial",BigDecimal.valueOf(Double.parseDouble(cell.toString())));//人工单价
|
||||
}
|
||||
break;
|
||||
case 12:
|
||||
if (StringUtils.isNotEmpty(cell.toString())) {
|
||||
contractsummarylist.set("qeug_provisional",BigDecimal.valueOf(Double.parseDouble(cell.toString())));//材料及工程设备暂估价
|
||||
contractsummarylist.set("qeug_provisional",BigDecimal.valueOf(Double.parseDouble(cell.toString())));//辅材单价
|
||||
}
|
||||
break;
|
||||
case 13:
|
||||
if (StringUtils.isNotEmpty(cell.toString())) {
|
||||
contractsummarylist.set("qeug_unitpriceofmainmater",BigDecimal.valueOf(Double.parseDouble(cell.toString())));//主材单价
|
||||
}
|
||||
break;
|
||||
case 14:
|
||||
if (StringUtils.isNotEmpty(cell.toString())) {
|
||||
contractsummarylist.set("qeug_mechanicalunitprice",BigDecimal.valueOf(Double.parseDouble(cell.toString())));//机械,设备单价
|
||||
}
|
||||
break;
|
||||
case 15:
|
||||
if (StringUtils.isNotEmpty(cell.toString())) {
|
||||
contractsummarylist.set("qeug_remarks",cell);//备注
|
||||
}
|
||||
|
|
|
@ -61,36 +61,54 @@ public class WorkloadcfmbillFormPlugin extends AbstractFormPlugin implements Tab
|
|||
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});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
updateCumulativeProgress("audit",id);
|
||||
break;
|
||||
case "unaudit":
|
||||
updateCumulativeProgress("unaudit",id);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void updateCumulativeProgress(String operation,long id) {
|
||||
// 产值确认--清单明细
|
||||
DynamicObjectCollection invoiceEntryInfos = this.getModel().getDataEntity(true).getDynamicObjectCollection("qeug_invoiceentryinfo");
|
||||
|
||||
for (DynamicObject invoiceEntryInfo : invoiceEntryInfos) {
|
||||
QFilter qSheetName = new QFilter("qeug_sheetname", QCP.equals, invoiceEntryInfo.getString("qeug_summarycontent"));
|
||||
QFilter qContractId = new QFilter("qeug_contractid", QCP.equals, String.valueOf(id));
|
||||
QFilter qWorkloadCfmId = new QFilter("qeug_workloadcfmid", QCP.equals, String.valueOf(this.getModel().getDataEntity().getPkValue()));
|
||||
|
||||
DynamicObject[] 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,qeug_thisprogress",
|
||||
new QFilter[]{qSheetName, qContractId, qWorkloadCfmId});
|
||||
|
||||
for (DynamicObject contractSummary : contractBills) {
|
||||
QFilter qNoConfirm = new QFilter("qeug_workloadcfmid", QCP.equals, ""); // 未作产值确认时的清单
|
||||
QFilter qSeqs = new QFilter("qeug_seqs", QCP.equals, contractSummary.getBigDecimal("qeug_seqs")); // 项目编码
|
||||
|
||||
DynamicObject add = BusinessDataServiceHelper.loadSingle("qeug_contractsummarylist", new QFilter[]{qSheetName, qContractId, qNoConfirm, qSeqs});
|
||||
|
||||
if (add != null) {
|
||||
BigDecimal cumulativeProgress = add.getBigDecimal("qeug_cumulativepreofpro"); // 累计进度百分比
|
||||
BigDecimal thisProgress = contractSummary.getBigDecimal("qeug_thisprogress"); // 本次进度百分比(%)
|
||||
|
||||
if ("audit".equals(operation)) {
|
||||
cumulativeProgress = cumulativeProgress.add(thisProgress); // 累加
|
||||
} else if ("unaudit".equals(operation)) {
|
||||
cumulativeProgress = cumulativeProgress.subtract(thisProgress); // 减去
|
||||
}
|
||||
|
||||
add.set("qeug_cumulativepreofpro", cumulativeProgress); // 更新累计进度百分比(%)
|
||||
SaveServiceHelper.save(new DynamicObject[]{add});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 打开列表展示清单详情页
|
||||
* @param formView 页面
|
||||
|
@ -165,7 +183,8 @@ public class WorkloadcfmbillFormPlugin extends AbstractFormPlugin implements Tab
|
|||
DynamicObject[] recon_contractbills = BusinessDataServiceHelper.load("qeug_contractsummarylist",
|
||||
"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,qeug_cumulativepreofpro", new QFilter[]{q3,q4,q5});
|
||||
"qeug_remarks,qeug_contractid,qeug_sheetname,qeug_cumulativepreofpro,qeug_mechanicalunitprice," +
|
||||
"qeug_unitpriceofmainmater", new QFilter[]{q3,q4,q5});
|
||||
if (recon_contractbills.length > 0) {
|
||||
for (int i = 0; i < recon_contractbills.length; i++) {
|
||||
DynamicObject contractsummarylist = recon_contractbills[i];
|
||||
|
@ -181,6 +200,8 @@ public class WorkloadcfmbillFormPlugin extends AbstractFormPlugin implements Tab
|
|||
add.set("qeug_amounttotal", contractsummarylist.getBigDecimal("qeug_amounttotal"));
|
||||
add.set("qeug_artificial", contractsummarylist.getBigDecimal("qeug_artificial"));
|
||||
add.set("qeug_provisional", contractsummarylist.getBigDecimal("qeug_provisional"));
|
||||
add.set("qeug_unitpriceofmainmater", contractsummarylist.getBigDecimal("qeug_unitpriceofmainmater"));
|
||||
add.set("qeug_mechanicalunitprice", contractsummarylist.getBigDecimal("qeug_mechanicalunitprice"));
|
||||
add.set("qeug_remarks", contractsummarylist.getString("qeug_remarks"));
|
||||
add.set("qeug_contractid", contractsummarylist.getString("qeug_contractid"));
|
||||
add.set("qeug_sheetname", contractsummarylist.getString("qeug_sheetname"));
|
||||
|
|
|
@ -45,8 +45,9 @@ public class IntroduceContractPlugin extends BatchImportPlugin {
|
|||
bd3 = new BigDecimal(qeug_cumulativepreofpro);
|
||||
}
|
||||
BigDecimal bd4 = bd2.subtract(bd3);
|
||||
data.put("qeug_thisprogress",bd4);//本次进度百分比(%)
|
||||
BigDecimal result = bd1.multiply(bd4).multiply(BigDecimal.valueOf(0.01));
|
||||
data.put("qeug_bcdecimalqtys",result);
|
||||
data.put("qeug_bcdecimalqtys",result);//本次完工量
|
||||
if (StringUtils.isNotEmpty(qeug_preofpro)) {
|
||||
preofpro = new BigDecimal(qeug_preofpro);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue