qianxb 8 mēneši atpakaļ
vecāks
revīzija
9d457c1334

+ 61 - 0
blade-service-api/blade-meter-api/src/main/java/org/springblade/meter/entity/MeterApproveOpinion.java

@@ -24,6 +24,7 @@ import org.springblade.core.mp.base.BaseEntity;
 
 import java.math.BigDecimal;
 import java.time.LocalDate;
+import java.time.LocalDateTime;
 
 /**
  * 开工预付款计量单实体类
@@ -78,4 +79,64 @@ public class MeterApproveOpinion extends BaseEntity {
     @ApiModelProperty(value = "董事长意见")
     private String chiefExecutive;
 
+    @ApiModelProperty(value = "总监理工程师名称")
+    private String chiefSupervisorUserName;
+
+    @ApiModelProperty(value = "总监理工程师审批时间")
+    private LocalDateTime chiefSupervisorTime;
+
+    @ApiModelProperty(value = "监理审核意见名称")
+    private String supervisorAuditUserName;
+
+    @ApiModelProperty(value = "监理审核意见时间")
+    private LocalDateTime supervisorAuditTime;
+
+    @ApiModelProperty(value = "工程建设部意见名称")
+    private String projectBuildUserName;
+
+    @ApiModelProperty(value = "工程建设部意见时间")
+    private LocalDateTime projectBuildTime;
+
+    @ApiModelProperty(value = "工程建设部分管领导意见名称")
+    private String projectBuildLeaderUserName;
+
+    @ApiModelProperty(value = "工程建设部分管领导意见时间")
+    private LocalDateTime projectBuildLeaderTime;
+
+    @ApiModelProperty(value = "安全管理部意见名称")
+    private String safetyManagerUserName;
+
+    @ApiModelProperty(value = "安全管理部意见时间")
+    private LocalDateTime safetyManagerTime;
+
+    @ApiModelProperty(value = "安全管理部分管领导意见名称")
+    private String safetyManagerLeaderUserName;
+
+    @ApiModelProperty(value = "安全管理部分管领导意见时间")
+    private LocalDateTime safetyManagerLeaderTime;
+
+    @ApiModelProperty(value = "合同部意见名称")
+    private String contractDeptUserName;
+
+    @ApiModelProperty(value = "合同部意见时间")
+    private LocalDateTime contractDeptTime;
+
+    @ApiModelProperty(value = "合同部分管领导意见名称")
+    private String contractDeptLeaderUserName;
+
+    @ApiModelProperty(value = "合同部分管领导意见时间")
+    private LocalDateTime contractDeptLeaderTime;
+
+    @ApiModelProperty(value = "总经理意见名称")
+    private String generalManagerUserName;
+
+    @ApiModelProperty(value = "总经理意见时间")
+    private LocalDateTime generalManagerTime;
+
+    @ApiModelProperty(value = "董事长意见名称")
+    private String chiefExecutiveUserName;
+
+    @ApiModelProperty(value = "董事长意见时间")
+    private LocalDateTime chiefExecutiveTime;
+
 }

+ 2 - 1
blade-service/blade-land/src/main/java/org/springblade/land/mapper/CompensationInfoMapper.xml

@@ -26,7 +26,8 @@
 
     <select id="getTables" resultType="org.springblade.manager.entity.WbsTreePrivate">
         SELECT * FROM m_wbs_tree_private
-        WHERE project_id = #{projectId} and wbs_type = 5 and `type` = 2 and node_type = #{nodeType}
+        WHERE project_id = #{projectId} and parent_id = (select id from m_wbs_tree_private
+                where project_id = #{projectId} and wbs_type = 5 and parent_id != 0 and `type` = 1 and node_type = #{nodeType})
         order by sort
     </select>
     <select id="getWbsPrivateTable" resultType="org.springblade.manager.entity.WbsTreePrivate">

+ 7 - 1
blade-service/blade-land/src/main/java/org/springblade/land/service/impl/ClearingAgreementInfoServiceImpl.java

@@ -127,7 +127,11 @@ public class ClearingAgreementInfoServiceImpl extends BaseServiceImpl<ClearingAg
             this.updateById(info);
         }
         //自动生成后管配置的所有结算表单,超过一页自动分页
-        buildPdf(linkTables,info);
+        try {
+            buildPdf(linkTables, info);
+        }catch (Exception e){
+            throw new ServiceException("生成PDF失败:"+e.getMessage());
+        }
         //合并PDF
         this.mergePdfs(info.getId());
 
@@ -140,6 +144,8 @@ public class ClearingAgreementInfoServiceImpl extends BaseServiceImpl<ClearingAg
         List<Long> agreeIds = Func.toLongList(info.getAgreementIds());
         //获取选择的补偿协议下所有的填报数据
         List<TableDataVO> dataVOS = baseMapper.getAllDataByAgreeIds(agreeIds);
+        //目前先过滤没有配置字典的数据
+        dataVOS = dataVOS.stream().filter(l->l.getDictValue() != null).collect(Collectors.toList());
         //填报数据按照字典分组
         Map<Integer, List<TableDataVO>> allDataMap = dataVOS.stream().collect(Collectors.groupingBy(TableDataVO::getDictValue));
         //获取结算协议所有表单的配置

+ 13 - 13
blade-service/blade-land/src/main/java/org/springblade/land/service/impl/CompensationInfoServiceImpl.java

@@ -411,7 +411,7 @@ public class CompensationInfoServiceImpl extends BaseServiceImpl<CompensationInf
                     //循环统计字段
                     for (WbsFormElement element : elements) {
                         Integer dict = element.getDynamicDict();
-                        if (dict.equals(41)){
+                        if (dict.equals(51)){
                             continue;
                         }
                         //获取当前统计字段所有填写的值
@@ -421,9 +421,9 @@ public class CompensationInfoServiceImpl extends BaseServiceImpl<CompensationInf
                             continue;
                         }
                         //单独计算面积
-                        if (dict.equals(42)) {
+                        if (dict.equals(52)) {
                             //统计面积,去找到当前行的地类dict为41
-                            List<WbsFormElement> collect = elements.stream().filter(l -> l.getDynamicDict().equals(41)).collect(Collectors.toList());
+                            List<WbsFormElement> collect = elements.stream().filter(l -> l.getDynamicDict().equals(51)).collect(Collectors.toList());
                             //获取dict为41的key,如果key不存在则提示未配置土地性质
                             if (collect == null || collect.size() == 0){
                                 throw new ServiceException("未配置地类");
@@ -459,29 +459,29 @@ public class CompensationInfoServiceImpl extends BaseServiceImpl<CompensationInf
                         }else {
                             //当前统计值
                             try {
-                                if (dict.equals(80)) {
+                                if (dict.equals(48)) {
                                     //户主姓名
                                     List<String> list = vos.stream().sorted(Comparator.comparing(TableDataVO::getDictRow)).map(l -> l.getTabVal()).collect(Collectors.toList());
                                     str.addAll(list);
-                                }else if (dict.equals(81)){
+                                }else if (dict.equals(50)){
                                     //身份证
                                     size1 = vos.size();
-                                } else if (dict.equals(82)) {
+                                } else if (dict.equals(43)) {
                                     //土地
                                     b1 = b1.add(vos.stream().map(l -> new BigDecimal(l.getTabVal())).reduce(BigDecimal.valueOf(0), BigDecimal::add));
-                                } else if (dict.equals(83)) {
+                                } else if (dict.equals(44)) {
                                     //青苗
                                     b2 = b2.add(vos.stream().map(l -> new BigDecimal(l.getTabVal())).reduce(BigDecimal.valueOf(0), BigDecimal::add));
-                                } else if (dict.equals(84)) {
+                                } else if (dict.equals(45)) {
                                     //地面
                                     b3 = b3.add(vos.stream().map(l -> new BigDecimal(l.getTabVal())).reduce(BigDecimal.valueOf(0), BigDecimal::add));
-                                } else if (dict.equals(85)){
+                                } else if (dict.equals(46)){
                                     //时段
                                     b4 = b4.add(vos.stream().map(l -> new BigDecimal(l.getTabVal())).reduce(BigDecimal.valueOf(0), BigDecimal::add));
-                                } else if (dict.equals(86)) {
+                                } else if (dict.equals(47)) {
                                     //补偿合计
                                     b5 = b5.add(vos.stream().map(l -> new BigDecimal(l.getTabVal())).reduce(BigDecimal.valueOf(0), BigDecimal::add));
-                                } else if (dict.equals(87)){
+                                } else if (dict.equals(49)){
                                     //银行卡
                                     size2 = vos.size();
                                 }
@@ -493,10 +493,10 @@ public class CompensationInfoServiceImpl extends BaseServiceImpl<CompensationInf
                 }
                 //校验数据
                 if (str.size() != size1){
-                    throw new ServiceException("身份证信息请填写完整");
+                    throw new ServiceException("登记确认表身份证信息请填写完整");
                 }
                 if (str.size() != size2){
-                    throw new ServiceException("银行卡信息请填写完整");
+                    throw new ServiceException("登记确认表银行卡信息请填写完整");
                 }
                 //设置名称
                 if (str.size() > 0){

+ 177 - 20
blade-service/blade-meter/src/main/java/org/springblade/meter/controller/TaskController.java

@@ -52,6 +52,7 @@ import org.springblade.core.log.exception.ServiceException;
 import org.springblade.core.mp.base.BaseService;
 import org.springblade.core.oss.model.BladeFile;
 import org.springblade.core.redis.cache.BladeRedis;
+import org.springblade.core.secure.BladeUser;
 import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.secure.utils.SecureUtil;
 import org.springblade.core.tool.api.R;
@@ -252,10 +253,10 @@ public class TaskController extends BladeController {
                     throw new ServiceException("当前期数的数据中存在已上报的任务,操作失败");
                 }
                 /*校验计量单金额是否为0*/
-                BigDecimal reduce = middleMeterApplies.stream().map(l -> l.getMeterMoney()).reduce(BigDecimal.ZERO, BigDecimal::add);
-                if (reduce.compareTo(BigDecimal.ZERO) == 0){
-                    throw new ServiceException("上报金额不能为0");
-                }
+//                BigDecimal reduce = middleMeterApplies.stream().map(l -> l.getMeterMoney()).reduce(BigDecimal.ZERO, BigDecimal::add);
+//                if (reduce.compareTo(BigDecimal.ZERO) == 0){
+//                    throw new ServiceException("上报金额不能为0");
+//                }
 
                 /*获取所有中间计量申请下的清单信息*/
                 List<Long> middleMeterAppliesIds = middleMeterApplies.stream().map(MiddleMeterApply::getId).collect(Collectors.toList());
@@ -1393,8 +1394,8 @@ public class TaskController extends BladeController {
                 }else {
                     vo.setType(task.getMeterTaskType() == 2 ? 1 : 2);
                 }
-                if (reportAllMoney == null || reportAllMoney.compareTo(BigDecimal.ZERO) == 0){
-                    throw new ServiceException("上报金额不能为0");
+                if (reportAllMoney == null){
+                    throw new ServiceException("上报金额不能为");
                 }
                 reportAllMoney =reportAllMoney.setScale(0,RoundingMode.HALF_UP);
                 vo.setReportAllMoney(reportAllMoney);
@@ -2542,20 +2543,7 @@ public class TaskController extends BladeController {
 
             //单独保存意见单
             if (task.getMeterTaskType() != null &&  Arrays.asList(1,2,3).contains(task.getMeterTaskType())) {
-                MeterApproveOpinion opinion = dto.getMeterApproveOpinion();
-                if (opinion != null) {
-                    if (StringUtils.isBlank(opinion.getChiefExecutive()))opinion.setChiefExecutive(null);
-                    if (StringUtils.isBlank(opinion.getContractDept()))opinion.setContractDept(null);
-                    if (StringUtils.isBlank(opinion.getProjectBuild()))opinion.setProjectBuild(null);
-                    if (StringUtils.isBlank(opinion.getGeneralManager()))opinion.setGeneralManager(null);
-                    if (StringUtils.isBlank(opinion.getChiefSupervisor()))opinion.setChiefSupervisor(null);
-                    if (StringUtils.isBlank(opinion.getSafetyManager()))opinion.setSafetyManager(null);
-                    if (StringUtils.isBlank(opinion.getContractDeptLeader()))opinion.setContractDeptLeader(null);
-                    if (StringUtils.isBlank(opinion.getProjectBuildLeader()))opinion.setProjectBuildLeader(null);
-                    if (StringUtils.isBlank(opinion.getSafetyManagerLeader()))opinion.setSafetyManagerLeader(null);
-                    if (StringUtils.isBlank(opinion.getSupervisorAudit()))opinion.setSupervisorAudit(null);
-                    opinionMapper.updateById(opinion);
-                }
+                this.saveOpinion(dto);
             }
 
             //如果要生成审计意见单
@@ -2651,6 +2639,175 @@ public class TaskController extends BladeController {
         return R.fail("操作失败");
     }
 
+    private void saveOpinion(TaskApproveDTO dto) {
+        MeterApproveOpinion opinion = dto.getMeterApproveOpinion();
+        //获取最新的意见单
+        MeterApproveOpinion oldOpinion = opinionMapper.selectById(opinion.getId());
+        if (opinion != null) {
+            if (StringUtils.isBlank(opinion.getChiefExecutive())) {
+                opinion.setChiefExecutive(null);
+            }else {
+                //如果存在数据则判断之前是否填写总监理工程师,填写了则不管,没填写这次填写了,则设置用户id名称时间
+                if (oldOpinion != null){
+                    if (StringUtils.isBlank(oldOpinion.getChiefExecutive())){
+                        opinion.setChiefExecutiveUserName(AuthUtil.getNickName());
+                        opinion.setChiefExecutiveTime(LocalDateTime.now());
+                    }
+                }else {
+                    //如果不存在数据,则判断当前是否填写了总监理工程师数据,填写了,则设置用户id名称时间
+                    opinion.setChiefExecutiveUserName(AuthUtil.getNickName());
+                    opinion.setChiefExecutiveTime(LocalDateTime.now());
+                }
+            }
+
+            if (StringUtils.isBlank(opinion.getContractDept())) {
+                opinion.setContractDept(null);
+            }else {
+                //如果存在数据则判断之前是否填写总监理工程师,填写了则不管,没填写这次填写了,则设置用户id名称时间
+                if (oldOpinion != null){
+                    if (StringUtils.isBlank(oldOpinion.getContractDept())){
+                        opinion.setContractDeptUserName(AuthUtil.getNickName());
+                        opinion.setContractDeptTime(LocalDateTime.now());
+                    }
+                }else {
+                    //如果不存在数据,则判断当前是否填写了总监理工程师数据,填写了,则设置用户id名称时间
+                    opinion.setContractDeptUserName(AuthUtil.getNickName());
+                    opinion.setContractDeptTime(LocalDateTime.now());
+                }
+            }
+
+            if (StringUtils.isBlank(opinion.getProjectBuild())) {
+                opinion.setProjectBuild(null);
+            }else {
+                //如果存在数据则判断之前是否填写总监理工程师,填写了则不管,没填写这次填写了,则设置用户id名称时间
+                if (oldOpinion != null){
+                    if (StringUtils.isBlank(oldOpinion.getProjectBuild())){
+                        opinion.setProjectBuildUserName(AuthUtil.getNickName());
+                        opinion.setProjectBuildTime(LocalDateTime.now());
+                    }
+                }else {
+                    //如果不存在数据,则判断当前是否填写了总监理工程师数据,填写了,则设置用户id名称时间
+                    opinion.setProjectBuildUserName(AuthUtil.getNickName());
+                    opinion.setProjectBuildTime(LocalDateTime.now());
+                }
+            }
+
+            if (StringUtils.isBlank(opinion.getGeneralManager())) {
+                opinion.setGeneralManager(null);
+            }else {
+                //如果存在数据则判断之前是否填写总监理工程师,填写了则不管,没填写这次填写了,则设置用户id名称时间
+                if (oldOpinion != null){
+                    if (StringUtils.isBlank(oldOpinion.getGeneralManager())){
+                        opinion.setGeneralManagerUserName(AuthUtil.getNickName());
+                        opinion.setGeneralManagerTime(LocalDateTime.now());
+                    }
+                }else {
+                    //如果不存在数据,则判断当前是否填写了总监理工程师数据,填写了,则设置用户id名称时间
+                    opinion.setGeneralManagerUserName(AuthUtil.getNickName());
+                    opinion.setGeneralManagerTime(LocalDateTime.now());
+                }
+            }
+
+            if (StringUtils.isBlank(opinion.getChiefSupervisor())) {
+                opinion.setChiefSupervisor(null);
+            }else {
+                //如果存在数据则判断之前是否填写总监理工程师,填写了则不管,没填写这次填写了,则设置用户id名称时间
+                if (oldOpinion != null){
+                    if (StringUtils.isBlank(oldOpinion.getChiefSupervisor())){
+                        opinion.setChiefSupervisorUserName(AuthUtil.getNickName());
+                        opinion.setChiefSupervisorTime(LocalDateTime.now());
+                    }
+                }else {
+                    //如果不存在数据,则判断当前是否填写了总监理工程师数据,填写了,则设置用户id名称时间
+                    opinion.setChiefSupervisorUserName(AuthUtil.getNickName());
+                    opinion.setChiefSupervisorTime(LocalDateTime.now());
+                }
+            }
+
+            if (StringUtils.isBlank(opinion.getSafetyManager())) {
+                opinion.setSafetyManager(null);
+            }else {
+                //如果存在数据则判断之前是否填写总监理工程师,填写了则不管,没填写这次填写了,则设置用户id名称时间
+                if (oldOpinion != null){
+                    if (StringUtils.isBlank(oldOpinion.getSafetyManager())){
+                        opinion.setSafetyManagerUserName(AuthUtil.getNickName());
+                        opinion.setSafetyManagerTime(LocalDateTime.now());
+                    }
+                }else {
+                    //如果不存在数据,则判断当前是否填写了总监理工程师数据,填写了,则设置用户id名称时间
+                    opinion.setSafetyManagerUserName(AuthUtil.getNickName());
+                    opinion.setSafetyManagerTime(LocalDateTime.now());
+                }
+            }
+
+            if (StringUtils.isBlank(opinion.getContractDeptLeader())) {
+                opinion.setContractDeptLeader(null);
+            }else {
+                //如果存在数据则判断之前是否填写总监理工程师,填写了则不管,没填写这次填写了,则设置用户id名称时间
+                if (oldOpinion != null){
+                    if (StringUtils.isBlank(oldOpinion.getContractDeptLeader())){
+                        opinion.setContractDeptLeaderUserName(AuthUtil.getNickName());
+                        opinion.setContractDeptLeaderTime(LocalDateTime.now());
+                    }
+                }else {
+                    //如果不存在数据,则判断当前是否填写了总监理工程师数据,填写了,则设置用户id名称时间
+                    opinion.setContractDeptLeaderUserName(AuthUtil.getNickName());
+                    opinion.setContractDeptLeaderTime(LocalDateTime.now());
+                }
+            }
+
+            if (StringUtils.isBlank(opinion.getProjectBuildLeader())) {
+                opinion.setProjectBuildLeader(null);
+            }else {
+                //如果存在数据则判断之前是否填写总监理工程师,填写了则不管,没填写这次填写了,则设置用户id名称时间
+                if (oldOpinion != null){
+                    if (StringUtils.isBlank(oldOpinion.getProjectBuildLeader())){
+                        opinion.setProjectBuildLeaderUserName(AuthUtil.getNickName());
+                        opinion.setProjectBuildLeaderTime(LocalDateTime.now());
+                    }
+                }else {
+                    //如果不存在数据,则判断当前是否填写了总监理工程师数据,填写了,则设置用户id名称时间
+                    opinion.setProjectBuildLeaderUserName(AuthUtil.getNickName());
+                    opinion.setProjectBuildLeaderTime(LocalDateTime.now());
+                }
+            }
+
+            if (StringUtils.isBlank(opinion.getSafetyManagerLeader())) {
+                opinion.setSafetyManagerLeader(null);
+            }else {
+                //如果存在数据则判断之前是否填写总监理工程师,填写了则不管,没填写这次填写了,则设置用户id名称时间
+                if (oldOpinion != null){
+                    if (StringUtils.isBlank(oldOpinion.getSafetyManagerLeader())){
+                        opinion.setSafetyManagerLeaderUserName(AuthUtil.getNickName());
+                        opinion.setSafetyManagerLeaderTime(LocalDateTime.now());
+                    }
+                }else {
+                    //如果不存在数据,则判断当前是否填写了总监理工程师数据,填写了,则设置用户id名称时间
+                    opinion.setSafetyManagerLeaderUserName(AuthUtil.getNickName());
+                    opinion.setSafetyManagerLeaderTime(LocalDateTime.now());
+                }
+            }
+
+            if (StringUtils.isBlank(opinion.getSupervisorAudit())) {
+                opinion.setSupervisorAudit(null);
+            }else {
+                //如果存在数据则判断之前是否填写总监理工程师,填写了则不管,没填写这次填写了,则设置用户id名称时间
+                if (oldOpinion != null){
+                    if (StringUtils.isBlank(oldOpinion.getSupervisorAudit())){
+                        opinion.setSupervisorAuditUserName(AuthUtil.getNickName());
+                        opinion.setSupervisorAuditTime(LocalDateTime.now());
+                    }
+                }else {
+                    //如果不存在数据,则判断当前是否填写了总监理工程师数据,填写了,则设置用户id名称时间
+                    opinion.setSupervisorAuditUserName(AuthUtil.getNickName());
+                    opinion.setSupervisorAuditTime(LocalDateTime.now());
+                }
+            }
+
+            opinionMapper.updateById(opinion);
+        }
+    }
+
     private void checkMiddleApp(TaskApproveDTO dto, Task task, List<TaskParallel> taskParallels) {
         String html = this.getExcelHtmlByBuss(Long.valueOf(task.getProjectId()));
         if (html != null) {

+ 3 - 3
blade-service/blade-meter/src/main/java/org/springblade/meter/service/impl/ContractMaterialServiceImpl.java

@@ -93,9 +93,9 @@ public class ContractMaterialServiceImpl extends BaseServiceImpl<ContractMateria
         if (StringUtils.isBlank(contractMaterial.getMaterialName())){
             throw new ServiceException("请填写材料名称");
         }
-        if (contractMaterial.getPrice() == null){
-            throw new ServiceException("请填写(基期)单价");
-        }
+//        if (contractMaterial.getPrice() == null){
+//            throw new ServiceException("请填写(基期)单价");
+//        }
         //校验是否存在当前材料编号和名称
         LambdaQueryWrapper<ContractMaterial> wrapper1 = new LambdaQueryWrapper<>();
         wrapper1.eq(ContractMaterial::getContractId,contractMaterial.getContractId());

+ 3 - 3
blade-service/blade-meter/src/main/java/org/springblade/meter/service/impl/MaterialMeterFormServiceImpl.java

@@ -68,9 +68,9 @@ public class MaterialMeterFormServiceImpl extends BaseServiceImpl<MaterialMeterF
         if (period.getApproveStatus() != 0){
             throw new ServiceException("新增失败,当前计量期已经上报或审批");
         }
-        if (dto.getMeterMoney() == null){
-            throw new ServiceException("计量金额不能为空");
-        }
+//        if (dto.getMeterMoney() == null){
+//            throw new ServiceException("计量金额不能为空");
+//        }
         //保存材料计量单信息
         MaterialMeterForm form = new MaterialMeterForm();
         BeanUtils.copyProperties(dto,form);