|
@@ -923,7 +923,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
Formula tf= formulaIdMap.get(d.getK());
|
|
|
if(tf!=null&&e.getId()!=null) {
|
|
|
e.setFormula(tf);
|
|
|
- tec.formDataList.add(e);
|
|
|
+ //tec.formDataList.add(e);
|
|
|
ElementFormulaMapping efm = new ElementFormulaMapping();
|
|
|
efm.setScope(FormulaBean.PARAM);
|
|
|
efm.setParamId(d.getId());
|
|
@@ -2986,13 +2986,13 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
if(index.isPresent()){
|
|
|
int j = index.getAsInt();
|
|
|
if(j>0){
|
|
|
- for (int i = 0; i < j; i++) {
|
|
|
- Object o = bladeRedis.get("redisId"+redisId+"periodId:"+list.get(j).getId()+"formNum:"+key+"nowMoney");
|
|
|
+ //期数ID,章节号
|
|
|
+ Object o = bladeRedis.get("periodId:"+list.get(j-1).getId()+"formNum:"+key+"nowMoney");
|
|
|
if(ObjectUtil.isNotEmpty(o)){
|
|
|
beforeEndMoney=beforeEndMoney.add ((BigDecimal) o);
|
|
|
}
|
|
|
- }
|
|
|
if(!beforeEndMoney.equals(BigDecimal.ZERO)){
|
|
|
+ //到上期末完成
|
|
|
monthlyReport.setBeforeEndMoney(beforeEndMoney);
|
|
|
BigDecimal percentage = monthlyReport.getBeforeEndMoney().divide(monthlyReport.getCurrentMeterMoney(), 10, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100"));
|
|
|
percentage = percentage.setScale(2, BigDecimal.ROUND_HALF_UP); // 设置
|
|
@@ -3002,7 +3002,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
}
|
|
|
}
|
|
|
//本期完成
|
|
|
- Object o = bladeRedis.get("redisId"+redisId+"periodId:"+periodId+"formNum:"+key+"nowMoney");
|
|
|
+ Object o = bladeRedis.get("periodId:"+periodId+"formNum:"+key+"nowMoney");
|
|
|
if(ObjectUtil.isNotEmpty(o)){
|
|
|
monthlyReport.setNowMoney((BigDecimal)o);
|
|
|
BigDecimal percentage = monthlyReport.getNowMoney().divide(monthlyReport.getCurrentMeterMoney(), 10, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100"));
|
|
@@ -3244,21 +3244,19 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
if(index.isPresent()){
|
|
|
int j = index.getAsInt();
|
|
|
if(j>0){
|
|
|
- for (int i = 0; i < j; i++) {
|
|
|
- MiddleMeterApply oldMiddleMeterApply=new MiddleMeterApply();
|
|
|
+ MiddleMeterApply oldMiddleMeterApply=new MiddleMeterApply();
|
|
|
oldMiddleMeterApply.setProjectId(projectId);
|
|
|
oldMiddleMeterApply.setContractId(contractId);
|
|
|
- oldMiddleMeterApply.setContractPeriodId(list.get(i).getId());
|
|
|
+ oldMiddleMeterApply.setContractPeriodId(list.get(j-1).getId());
|
|
|
List<MeterInventoryDetailVO> oldFormDetail=middleMeterApplyClient.formDetail(oldMiddleMeterApply);
|
|
|
- oldFormDetailMap.put("第"+i+1+"期",oldFormDetail);
|
|
|
- }
|
|
|
+ oldFormDetailMap.put("第"+j+"期",oldFormDetail);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
//上期且需要变化的清单明细
|
|
|
Map<String,List<MeterInventoryDetailVO>> changeFormDetailMap=new HashMap<>();
|
|
|
if(oldFormDetailMap.size()>0){
|
|
|
- for (Map.Entry<String, List<MeterInventoryDetailVO>> entry : changeFormDetailMap.entrySet()) {
|
|
|
+ for (Map.Entry<String, List<MeterInventoryDetailVO>> entry : oldFormDetailMap.entrySet()) {
|
|
|
List<MeterInventoryDetailVO>changelist=new ArrayList<>();
|
|
|
List<MeterInventoryDetailVO> value = entry.getValue();
|
|
|
for (MeterInventoryDetailVO vo : value) {
|
|
@@ -3326,17 +3324,17 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
for (Map.Entry<String, List<MeterInventoryDetailVO>> entry : changeFormDetailMap.entrySet()) {
|
|
|
for (MeterInventoryDetailVO changevo : entry.getValue()) {
|
|
|
if(changevo.getFormNumber().equals(vo.getFormNumber())){
|
|
|
- b1=b1.add(changevo.getCurrentMeterTotal());
|
|
|
- b2=b2.add(changevo.getCurrentMeterMoney());
|
|
|
+ b1=b1.add(changevo.getAllMeterTotal());
|
|
|
+ b2=b2.add(changevo.getAllMeterMoney());
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- //到上期末完成工程量
|
|
|
- vo.setBeforeEndTotal(b1.setScale(0, RoundingMode.HALF_UP));
|
|
|
- //到上期末完成金额
|
|
|
- vo.setBeforeEndMoney(b2.setScale(0, RoundingMode.HALF_UP));
|
|
|
- }
|
|
|
+ //到上期末完成工程量
|
|
|
+ vo.setBeforeEndTotal(!b1.equals(BigDecimal.ZERO)?b1.setScale(0, RoundingMode.HALF_UP):null);
|
|
|
+ //到上期末完成金额
|
|
|
+ vo.setBeforeEndMoney(!b2.equals(BigDecimal.ZERO)?b2.setScale(0, RoundingMode.HALF_UP):null);
|
|
|
+ }
|
|
|
//到本期末完成工程量
|
|
|
if(vo.getBeforeEndTotal()!=null){
|
|
|
vo.setNowEndTotal(vo.getBeforeEndTotal().add(vo.getNowTotal()));
|
|
@@ -3485,7 +3483,8 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
NewBladeFile bladeFile = this.commonFileClient.excelToPdf(files);
|
|
|
listUrl.add(bladeFile.getPdfUrl());
|
|
|
}
|
|
|
- bladeRedis.set("redisId"+redisId+"periodId:"+periodId+"formNum:"+listEntry.getKey()+"nowMoney",totalNowMoney);
|
|
|
+ //本期末完成 本期ID+章节号
|
|
|
+ bladeRedis.set("periodId:"+periodId+"formNum:"+listEntry.getKey()+"nowMoney",totalNowMoney);
|
|
|
}
|
|
|
collectionUtilsClient.mergePdfPublicMethods(listUrl, localImgUrl);
|
|
|
//上传oss
|