Commit 01bd6e20 authored by danfuman's avatar danfuman

Merge branch 'V20231129-中建一局二公司' of http://192.168.60.201/root/dsk-operate-sys...

Merge branch 'V20231129-中建一局二公司' of http://192.168.60.201/root/dsk-operate-sys into V20231129-中建一局二公司
parents ef1eb1ab c8f28343
......@@ -83,5 +83,13 @@ public class CbQuantitySummaryController extends BaseController {
return R.ok();
}
/**
* 修改工程量
*/
@PostMapping("/editEngineeringQuantity")
public R<Void> editEngineeringQuantity(@RequestBody CbQuantitySummaryActual bo) {
return toAjax(baseService.editEngineeringQuantity(bo));
}
}
......@@ -17,4 +17,8 @@ public class CbQuantitySummaryListBo extends CbProjectBaseBo {
* 记录月份
*/
private String recordDate;
/**
* 是否超出计划成本合价(不含税)
*/
private Boolean isOutPlanCostCombinedPrice;
}
......@@ -100,6 +100,14 @@ public class CbQuantitySummaryListVo {
* 采购单价
*/
private Double purchaseUnitPrice;
/**
* 实际成本合价(不含税)
*/
private Double actualCombinedPrice = 0.0;
/**
* 实际成本合价(不含税)成本是否超出计划成本当中合价(不含税)
*/
private Boolean isActualGreaterThanPlan;
/**
* 创建时间
*/
......@@ -117,7 +125,7 @@ public class CbQuantitySummaryListVo {
*/
private Double pushQuantities;
/**
* IPM项目编码
* IPM项目编码
*/
private String ipmProjectCode;
/**
......
......@@ -32,5 +32,10 @@ public interface ICbQuantitySummaryService extends IService<CbQuantitySummary> {
boolean batchInsert(List<CbQuantitySummary> list);
R conversionNotice(CbQuantitySummaryListBo bo);
/**
* 修改工程量
*/
Boolean editEngineeringQuantity(CbQuantitySummaryActual bo);
}
......@@ -65,21 +65,21 @@ public class CbQuantitySummaryServiceImpl extends ServiceImpl<CbQuantitySummaryM
Collectors.groupingBy(item -> item.get("two").toString(),
Collectors.groupingBy(item -> item.get("three").toString(),
Collectors.groupingBy(item -> item.get("four").toString()
)))));
)))));
Map<String, Object> resMap = new HashMap<>();
List<Map<String, Object>> resList = new ArrayList<>();
resMap.put("name", "房建类成本科目");
resMap.put("sort", 1);
for (Map.Entry<String,Map<String, Map<String, Map<String, List<Map<String, Object>>>>>> entry : map.entrySet()) {
for (Map.Entry<String, Map<String, Map<String, Map<String, List<Map<String, Object>>>>>> entry : map.entrySet()) {
Map<String, Object> oneMap = new HashMap<>();
List<Map<String, Object>> oneList = new ArrayList<>();
oneMap.put("name", entry.getKey());
oneMap.put("sort", cbSubjectMapper.selectOne(Wrappers.<CbSubject>lambdaQuery().eq(CbSubject::getCbSubjectName, entry.getKey())).getSort());
for (Map.Entry<String,Map<String, Map<String, List<Map<String, Object>>>>> twoEntry : entry.getValue().entrySet()) {
for (Map.Entry<String, Map<String, Map<String, List<Map<String, Object>>>>> twoEntry : entry.getValue().entrySet()) {
Map<String, Object> twoMap = new HashMap<>();
List<Map<String, Object>> twoList = new ArrayList<>();
twoMap.put("name", twoEntry.getKey());
for (Map.Entry<String, Map<String,List<Map<String, Object>>>> threeEntry : twoEntry.getValue().entrySet()) {
for (Map.Entry<String, Map<String, List<Map<String, Object>>>> threeEntry : twoEntry.getValue().entrySet()) {
Map<String, Object> threeMap = new HashMap<>();
List<Map<String, Object>> threeList = new ArrayList<>();
threeMap.put("name", threeEntry.getKey());
......@@ -118,13 +118,52 @@ public class CbQuantitySummaryServiceImpl extends ServiceImpl<CbQuantitySummaryM
@Override
public List<CbQuantitySummaryListVo> subjectList(CbQuantitySummaryListBo bo) {
if(ObjectUtils.isEmpty(bo.getRecordDate())){
if (ObjectUtils.isEmpty(bo.getRecordDate())) {
//默认当前月
bo.setRecordDate(DatePattern.SIMPLE_MONTH_FORMAT.format(new Date()));
}
if (ObjectUtils.isEmpty(bo.getProjectId())) throw new BeanException("项目id不能为空!");
if (ObjectUtils.isEmpty(bo.getCbStage())) throw new BeanException("成本阶段不能为空!");
return baseMapper.selectListBySubject(bo);
List<CbQuantitySummaryListVo> listVo = baseMapper.selectListBySubject(bo);
//超出计划成本合价(不含税)的集合
List<CbQuantitySummaryListVo> outList = new ArrayList<>();
//未超出计划成本合价(不含税)的集合
List<CbQuantitySummaryListVo> notOutList = new ArrayList<>();
listVo.forEach(vo -> {
if (ObjectUtil.isNotNull(vo.getPushQuantities())) {
//实际成本合价(不含税)
vo.setActualCombinedPrice(vo.getQuantity() * vo.getPushQuantities());
} else {
//实际成本合价(不含税)
vo.setActualCombinedPrice(
(ObjectUtil.isNull(vo.getPurchaseUnitPrice()) ? 0.0 : vo.getPurchaseUnitPrice())
*
(ObjectUtil.isNull(vo.getPushQuantities()) ? 0.0 : vo.getPushQuantities())
);
}
//如果实际成本合价(不含税)超出了计划成本合价(不含税),则设置标识,以便前端标红
Double combinedPrice = ObjectUtil.isNull(vo.getCombinedPrice()) ? 0.0 : vo.getCombinedPrice();
if (vo.getActualCombinedPrice().compareTo(combinedPrice) > 0) {
//vo.setActualCombinedPrice(Double.parseDouble(StringUtils.markInRed(vo.getActualCombinedPrice().toString(), vo.getActualCombinedPrice().toString())));
vo.setIsActualGreaterThanPlan(true);
outList.add(vo);
} else {
vo.setIsActualGreaterThanPlan(false);
notOutList.add(vo);
}
});
//筛选是否超出计划成本合价(不含税)
Boolean flag = bo.getIsOutPlanCostCombinedPrice();
if (ObjectUtil.isNotNull(flag)) {
if (flag) {
return outList;
} else {
return notOutList;
}
}
return listVo;
}
@Override
......@@ -199,5 +238,20 @@ public class CbQuantitySummaryServiceImpl extends ServiceImpl<CbQuantitySummaryM
}
return R.ok();
}
/**
* 修改工程量
*/
@Override
public Boolean editEngineeringQuantity(CbQuantitySummaryActual bo) {
if (ObjectUtils.isEmpty(bo.getId())) throw new BeanException("id不能为空!");
if (ObjectUtils.isEmpty(bo.getPushQuantities())) throw new BeanException("修改后的工程量不能为空!");
boolean update = baseActualService.updateById(bo);
if (!update) {
log.error("CbQuantitySummaryServiceImpl.editEngineeringQuantity() data update error! data:" + JSONUtil.toJsonStr(bo));
throw new ServiceException("数据更新错误!");
}
return update;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment