소스 검색

Merge remote-tracking branch 'origin/master' into master

yangyj 1 년 전
부모
커밋
029e25fb4c
21개의 변경된 파일487개의 추가작업 그리고 146개의 파일을 삭제
  1. 15 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/TextdictInfo.java
  2. 61 0
      blade-service-api/blade-meter-api/src/main/java/org/springblade/meter/entity/MeterApproveOpinion.java
  3. 4 0
      blade-service-api/blade-meter-api/src/main/java/org/springblade/meter/vo/MiddleMeterApplyVO.java
  4. 2 0
      blade-service-api/blade-meter-api/src/main/java/org/springblade/meter/vo/StartPayMeterFormVO.java
  5. 0 14
      blade-service/blade-business/src/main/java/org/springblade/business/controller/EVisaTaskCheckController.java
  6. 4 0
      blade-service/blade-e-visa/src/main/java/org/springblade/evisa/controller/EVisaController.java
  7. 35 13
      blade-service/blade-e-visa/src/main/java/org/springblade/evisa/service/impl/EVisaServiceImpl.java
  8. 2 1
      blade-service/blade-land/src/main/java/org/springblade/land/mapper/CompensationInfoMapper.xml
  9. 7 1
      blade-service/blade-land/src/main/java/org/springblade/land/service/impl/ClearingAgreementInfoServiceImpl.java
  10. 13 13
      blade-service/blade-land/src/main/java/org/springblade/land/service/impl/CompensationInfoServiceImpl.java
  11. 29 37
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExcelTabController.java
  12. 3 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/TextdictInfoMapper.xml
  13. 1 1
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ExcelTabServiceImpl.java
  14. 1 1
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/FormulaServiceImpl.java
  15. 12 7
      blade-service/blade-manager/src/main/java/org/springblade/manager/utils/FileUtils.java
  16. 205 25
      blade-service/blade-meter/src/main/java/org/springblade/meter/controller/TaskController.java
  17. 23 12
      blade-service/blade-meter/src/main/java/org/springblade/meter/mapper/MiddleMeterApplyMapper.xml
  18. 12 6
      blade-service/blade-meter/src/main/java/org/springblade/meter/mapper/StartPayMeterFormMapper.xml
  19. 3 3
      blade-service/blade-meter/src/main/java/org/springblade/meter/service/impl/ContractMaterialServiceImpl.java
  20. 3 3
      blade-service/blade-meter/src/main/java/org/springblade/meter/service/impl/MaterialMeterFormServiceImpl.java
  21. 52 9
      blade-service/blade-meter/src/main/java/org/springblade/meter/utils/FileUtils.java

+ 15 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/TextdictInfo.java

@@ -106,4 +106,19 @@ public class TextdictInfo implements Serializable {
      * 是否删除
      */
     private Integer isDeleted;
+
+    /**
+     * 时间对应key
+     */
+    private String timeColKey;
+
+    /**
+     * 时间对应名称
+     */
+    private String timeName;
+
+    /**
+     * 是否需要时间 1需要 0不需要
+     */
+    private int timeState;
 }

+ 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;
+
 }

+ 4 - 0
blade-service-api/blade-meter-api/src/main/java/org/springblade/meter/vo/MiddleMeterApplyVO.java

@@ -50,4 +50,8 @@ public class MiddleMeterApplyVO extends MiddleMeterApply {
 	@ApiModelProperty(value = "期数Pdf")
 	private String periodPdfUrl;
 
+	@ApiModelProperty(value = "任务Id")
+	private String taskId;
+
+
 }

+ 2 - 0
blade-service-api/blade-meter-api/src/main/java/org/springblade/meter/vo/StartPayMeterFormVO.java

@@ -44,4 +44,6 @@ public class StartPayMeterFormVO extends StartPayMeterForm {
 	@ApiModelProperty(value = "附件列表")
 	private List<AttachmentForm> fileList;
 
+	@ApiModelProperty(value = "任务Id")
+	private String taskId;
 }

+ 0 - 14
blade-service/blade-business/src/main/java/org/springblade/business/controller/EVisaTaskCheckController.java

@@ -797,20 +797,6 @@ public class EVisaTaskCheckController {
      */
     private List<JSONObject> queryTableEVisaConfig(JSONObject json, String eVisaPDFUrl) {
         List<JSONObject> jsonList;
-//        if (json.containsKey("theLogPrimaryKeyId") && StringUtils.isNotEmpty(json.getString("theLogPrimaryKeyId"))) {
-//            //日志,需要先获取对应的表格
-//            jsonList = this.queryTableEVisaConfig(Func.toStrList(json.getString("theLogPrimaryKeyId")));
-//
-//        } else if (json.containsKey("firstId") && StringUtils.isNotEmpty(json.getString("firstId"))) {
-//            //首件,先获取记录
-//            InformationQuery query = this.informationQueryService.getById(json.getLong("firstId"));
-//            if (query != null) {
-//                jsonList = this.queryTableEVisaConfig(Func.toStrList(this.wbsTreeContractClient.getContractNodeByPrimaryKeyId(query.getTableId()).getIsTypePrivatePid().toString()));
-//            } else {
-//                jsonList = null;
-//            }
-//
-//        } else {
             //资料填报
             List<String> ids = PDFUtil.getPdfSignIds(eVisaPDFUrl);
             if (ids == null || ids.size() == 0) {

+ 4 - 0
blade-service/blade-e-visa/src/main/java/org/springblade/evisa/controller/EVisaController.java

@@ -167,6 +167,10 @@ public class EVisaController {
                     }
                 }
             }else if ("eVisaError".equals(eVisaStatus) || eVisaStatus.contains("eVisaError")) {
+                // 修改 主 任务 u_task 表 状态改为3
+                String up_task_par = "update u_task_parallel set status=2 ,e_visa_status=99 ,e_visa_content='"+eVisaStatus.split("####")[1]+"' where parallel_process_instance_id='"+taskApprovalVO.getParallelProcessInstanceId()+"'";
+                this.jdbcTemplate.execute("delete from u_task_batch where id="+taskApprovalVO.getId());
+                jdbcTemplate.execute(up_task_par);
 
             }else {
 

+ 35 - 13
blade-service/blade-e-visa/src/main/java/org/springblade/evisa/service/impl/EVisaServiceImpl.java

@@ -259,15 +259,33 @@ public class EVisaServiceImpl implements EVisaService {
                 }
                 String dataInfo = this.taskClient.queryTaskContractId(task.getParallelProcessInstanceId());
                 String contractId = Func.toStrArray(dataInfo)[0];
+                String projectId = Func.toStrArray(dataInfo)[1];
 
                 String ids = String.join(",", eVisaConfigList);
-                String sqlinfo = "SELECT a.id,a.pyzbx,a.pyzby,b.signature_file_url,b.id as sfId,b.certificate_password,b.certificate_user_name,b.certificate_number from m_textdict_info a ,m_sign_pfx_file b where a.sig_role_id = b.pfx_type and b.project_contract_role like '%" + contractId + "%' and a.is_deleted=0 and b.is_deleted=0 and a.type=6 and a.id in(" + ids + ")";
-                List<Map<String, Object>> maps = jdbcTemplate.queryForList(sqlinfo);
+                String sqlinfo = "SELECT a.id,a.pyzbx,a.pyzby,b.signature_file_url,b.id as sfId,a.project_id,b.certificate_password,b.certificate_user_name,b.certificate_number from m_textdict_info a ,m_sign_pfx_file b where a.sig_role_id = b.pfx_type and b.project_contract_role like '%" + contractId + "%' and a.is_deleted=0 and b.is_deleted=0 and a.type=6 and a.id in(" + ids + ")";
+                List<Map<String, Object>> maps2 = jdbcTemplate.queryForList(sqlinfo);
                 System.out.println("合同-" + contractId + "--" + sqlinfo);
-                if (maps == null || maps.isEmpty()) {
+                if (maps2 == null || maps2.isEmpty()) {
                     return finalPdfUrl;
                 }
                 //
+                List<Map<String, Object>> maps = new ArrayList<>();
+                Map<String, List<Map<String, Object>>> peopleByAge = maps2.stream()
+                        .collect(Collectors.groupingBy( hada ->(Func.toStr(hada.get("id")))));
+
+                for(String keyId :peopleByAge.keySet()){
+                    List<Map<String, Object>> keyList = peopleByAge.get(keyId);
+                    if(keyList!=null && keyList.size()==1){
+                        maps.addAll(keyList);
+                    }else if(keyList!=null && keyList.size()>=2){
+                        for(Map<String, Object> datax : keyList){
+                            if((datax.get("project_id")+"").equals(projectId)){
+                                maps.add(datax);
+                            }
+                        }
+                    }
+                }
+
                 if(reType.equals("2")){ //中方中讯
                     if (maps != null && !maps.isEmpty()) {
                         String fileUrl = finalPdfUrl;
@@ -336,6 +354,7 @@ public class EVisaServiceImpl implements EVisaService {
                         vo.setSealType("3");
                         vo.setCompanySeal(true);
                         vo.setKeyword(eVisaConfig.get("id") + "");
+
                         vo.setOffSetX(eVisaConfig.get("pyzbx") + "");
                         vo.setOffSetY(eVisaConfig.get("pyzby") + "");
                         sealStrategyVOS.add(vo);
@@ -417,7 +436,6 @@ public class EVisaServiceImpl implements EVisaService {
             //获取需要签章的数据
             List<TaskApprovalVO.ApprovalFile> files = taskFile.getApprovalFileList();
 
-
             //这里的文件只会是一张拼接好的PDF
             for (TaskApprovalVO.ApprovalFile file : files) {
 
@@ -441,19 +459,19 @@ public class EVisaServiceImpl implements EVisaService {
                 String projectId = Func.toStrArray(dataInfo)[1];
 
                 if (taskFile.getRemarkType().equals("2")) {//东方 中讯 daMap.put("keyWord","1673632651551965184");
-                    String sqlinfo = " SELECT a.id as keyWord,a.project_id,(SELECT acc_code from blade_user where id='" + task.getUserId() + "' and is_deleted=0  ) as sealId from m_textdict_info a where  a.type =2 and a.id in (" + ids + ")  and sig_role_id in (SELECT DISTINCT c.role_id from m_project_assignment_user c  where c.contract_id=" + contractId + " and user_id=" + task.getUserId() + " and c.is_deleted=0 )";
+                    String sqlinfo = " SELECT * from ( SELECT a.id as keyWord,a.project_id,a.pyzbx ,a.pyzby,(SELECT acc_code from blade_user where id='" + task.getUserId() + "' and is_deleted=0  ) as sealId from m_textdict_info a where  a.type =2 and a.id in (" + ids + ")  and sig_role_id in (SELECT DISTINCT c.role_id from m_project_assignment_user c  where c.contract_id=" + contractId + " and user_id=" + task.getUserId() + " and c.is_deleted=0 ) ) x where x.sealId is not null ";
                     System.out.println("东方中讯-个人-user-id" + task.getUserId() + "--SQL=" + sqlinfo);
                     List<Map<String, Object>> maps2 = jdbcTemplate.queryForList(sqlinfo);
                     if (maps2 != null && !maps2.isEmpty()) {
                         List<Map<String, Object>> maps = new ArrayList<>();
                         Map<String, List<Map<String, Object>>> peopleByAge = maps2.stream()
-                                .collect(Collectors.groupingBy( hada ->(Func.toStr(hada.get("id")))));
+                                .collect(Collectors.groupingBy( hada ->(Func.toStr(hada.get("keyWord")))));
 
                         for(String keyId :peopleByAge.keySet()){
                             List<Map<String, Object>> keyList = peopleByAge.get(keyId);
                             if(keyList!=null && keyList.size()==1){
                                 maps.addAll(keyList);
-                            }else if(keyList!=null && keyList.size()>=1){
+                            }else if(keyList!=null && keyList.size()>=2){
                                 for(Map<String, Object> datax : keyList){
                                     if((datax.get("project_id")+"").equals(projectId)){
                                         maps.add(datax);
@@ -471,12 +489,16 @@ public class EVisaServiceImpl implements EVisaService {
                             daMa.put("showHeight",30);
                             daMa.put("showWidth",60);
                             //设置显示签字体的位置
-                            daMa.put("sealOffsetY",-15);
-                            daMa.put("sealOffsetX",-30);
-
+                            String yzx = dataMap.get("pyzby")+"";
+                            String xzx = dataMap.get("pyzbx")+"";
+                            Double sealOffsetY =Func.toDouble(yzx) -15;
+                            Double sealOffsetX =Func.toDouble(xzx) -30;
+                            daMa.put("sealOffsetX",sealOffsetX);
+                            daMa.put("sealOffsetY",sealOffsetY);
+                           // daMa.put("sealOffsetY",-15);
+                           // daMa.put("sealOffsetX",-30);
                             byte[] fileByte;
                             if (fileUrl.indexOf("aliyuncs.com") >= 0) {
-
                                 URL url =new URL(pdfUrl);
                                 fileByte = IOUtils.toByteArray(url);
                             } else {
@@ -511,7 +533,7 @@ public class EVisaServiceImpl implements EVisaService {
                         return SUCCESS + "@@@@" + taskFile.getApprovalFileList().get(0).getFileUrl();
                     }
                 } else { //安心签证
-                    String sqlinfo = " SELECT DISTINCT a.id,a.pyzbx ,a.pyzby,a.project_id,(SELECT signature_file_url from m_sign_pfx_file where is_register=1 and certificate_user_id='" + task.getUserId() + "' and is_deleted=0  ) as signature_file_url from m_textdict_info a where  a.type =2 and a.id in (" + ids + ")  and sig_role_id in (SELECT DISTINCT c.role_id from m_project_assignment_user c  where c.contract_id=" + contractId + " and user_id=" + task.getUserId() + " and c.is_deleted=0 )";
+                    String sqlinfo = "SELECT * from ( SELECT DISTINCT a.id,a.pyzbx ,a.pyzby,a.project_id,(SELECT signature_file_url from m_sign_pfx_file where is_register=1 and certificate_user_id='" + task.getUserId() + "' and is_deleted=0  ) as signature_file_url from m_textdict_info a where  a.type =2 and a.id in (" + ids + ")  and sig_role_id in (SELECT DISTINCT c.role_id from m_project_assignment_user c  where c.contract_id=" + contractId + " and user_id=" + task.getUserId() + " and c.is_deleted=0 ) ) x where x.signature_file_url is not null ";
                     List<Map<String, Object>> maps2 = jdbcTemplate.queryForList(sqlinfo);
 
                     List<Map<String, Object>> maps = new ArrayList<>();
@@ -522,7 +544,7 @@ public class EVisaServiceImpl implements EVisaService {
                         List<Map<String, Object>> keyList = peopleByAge.get(keyId);
                         if(keyList!=null && keyList.size()==1){
                             maps.addAll(keyList);
-                        }else if(keyList!=null && keyList.size()>=1){
+                        }else if(keyList!=null && keyList.size()>=2){
                             for(Map<String, Object> datax : keyList){
                                 if((datax.get("project_id")+"").equals(projectId)){
                                     maps.add(datax);

+ 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){

+ 29 - 37
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExcelTabController.java

@@ -751,46 +751,38 @@ public class ExcelTabController extends BladeController {
                 Elements tds = tr.select("td");
                 for (int j = 0; j < tds.size(); j++) {
                     Element data = tds.get(j);
-                    int colspan = data.attr("COLSPAN").equals("") ? 0 : Integer.parseInt(data.attr("COLSPAN"));
                     String style = data.attr("style");
                     if (style.indexOf("font-size") >= 0) {
                         int fontsize = Integer.parseInt(style.substring(style.indexOf("font-size:") + 10, style.indexOf(".0pt")));
+                        Element element=null;
                         if (isWater) {
                             if (StringUtils.isNotEmpty(data.text()) && fontsize >= 12) {
-                                trs.get(i - 1).select("td").get(0).text(projectInfo.getProjectName());
+                                 element = trs.get(i - 1).select("td").get(0);
+
                             }
                         } else {
                             if (StringUtils.isNotEmpty(data.text()) && fontsize >= 14) {
-                                trs.get(i - 1).select("td").get(0).text(projectInfo.getProjectName());
+                                element = trs.get(i - 1).select("td").get(0);
+                            }
+                        }
+                        if(element!=null && Func.isNotEmpty(element)){
+                            //
+                            Elements allElements = element.children();
+                            if(allElements.size()>=1 ){
+                                String defText = allElements.get(0).attr("deftext");
+                                if(defText!=null && Func.isNotEmpty(defText)){
+                                    element.text(defText);
+                                }else{
+                                    element.text(projectInfo.getProjectName());
+                                }
+                            }else{
+                                element.text(projectInfo.getProjectName());
                             }
                         }
                     }
                 }
             }
 
-            // 获取公式颜色
-            String tabName = wbsTreeContract.getInitTableName();
-            // 字段查询 获取公式字段
-//        String colkeys = "SELECT e_key from m_table_info a ,m_wbs_form_element b WHERE a.tab_en_name = '" + tabName + "' and a.id=b.f_id and b.id  in(SELECT element_id from m_element_formula_mapping c where c.is_deleted=0) ";
-//
-//        List<Map<String, Object>> maps = jdbcTemplate.queryForList(colkeys);
-//
-//        if (maps != null) {
-//            for (Map<String, Object> keys : maps) {
-//                String key = keys.get("e_key") + "__";
-//                Elements gscolor = doc.select("el-input[keyname~=^" + key + "]");
-//                for (Element element : gscolor) {
-//                    //System.out.println(element.parent());
-//                    element.parent().attr("gscolor", "11");
-//                }
-//
-//                Elements datecolor = doc.select("el-date-picker[keyname~=^" + key + "]");
-//                for (Element element : datecolor) {
-//                    //System.out.println(element.parent());
-//                    element.parent().attr("gscolor", "11");
-//                }
-//            }
-//        }
             WbsTreeContract process = this.wbsTreeContractService.getOne(Wrappers.<WbsTreeContract>lambdaQuery()
                     .eq(WbsTreeContract::getId, wbsTreeContract.getParentId())
                     .eq(WbsTreeContract::getContractId, wbsTreeContract.getContractId())
@@ -938,12 +930,15 @@ public class ExcelTabController extends BladeController {
             Elements tds = tr.select("td");
             for (int j = 0; j < tds.size(); j++) {
                 Element data = tds.get(j);
-                //int colspan = data.attr("COLSPAN").equals("") ? 0 : Integer.parseInt(data.attr("COLSPAN"));
                 String style = data.attr("style");
                 if (style.contains("font-size")) {
                     int fontsize = Integer.parseInt(style.substring(style.indexOf("font-size:") + 10, style.indexOf(".0pt")));
                     if (StringUtils.isNotEmpty(data.text()) && fontsize >= 12) {
-                        trs.get(i - 1).select("td").get(0).text(projectInfo.getProjectName());
+                        Element element = trs.get(i - 1).select("td").get(0);
+                        String textainfo = element.text();
+                        if(textainfo ==null || textainfo == "" || Func.isEmpty(textainfo)){
+                            element.text(projectInfo.getProjectName());
+                        }
                         break;
                     }
                 }
@@ -2335,8 +2330,8 @@ public class ExcelTabController extends BladeController {
                     CellRange[] columns = sheet.getMergedCells();
                     for (int i = 0; i < columns.length; i++) {
                         CellRange cellRange = columns[i];
-                        System.out.println(cellRange.getStyle().getFont().getSize());
-                        if (cellRange.getStyle().getFont().getSize() >= 12) {
+                        System.out.println(cellRange.getText());
+                        if (cellRange.getStyle().getFont().getSize() >= 12 && Func.isNotEmpty(cellRange.getText())) {
                             String title = projectInfo.getProjectName();
                             if (title.length() >= 30) {
                                 cellRange.setRowHeight(40);
@@ -2470,8 +2465,6 @@ public class ExcelTabController extends BladeController {
                                 Elements tdDatas = trData.select("td");
                                 if (tdDatas.size() > Integer.parseInt(trtd[1])) {
                                     Element data = tdDatas.get(Integer.parseInt(trtd[1]));
-                                    //Element data = trs.get(Integer.parseInt(trtd[0])).select("td").get(Integer.parseInt(trtd[1]));
-
                                     int x1 = Integer.parseInt(data.children().get(0).attr("x1"));
                                     if (x1 == 0) {
                                         x1 = 1;
@@ -2581,10 +2574,9 @@ public class ExcelTabController extends BladeController {
                 if (businessDataMap.size() > 0) {
                     // 匹配关联
                     try {
-                        File file1 = ResourceUtil.getFile(tableNode2.getHtmlUrl());
-                        if (file1.exists()) {
-
-                            String htmlString = IoUtil.readToString(new FileInputStream(file1));
+                        if (tableNode2.getHtmlUrl()!=null) {
+                            InputStream inputStreamByUrl = FileUtils.getInputStreamByUrl(tableNode2.getHtmlUrl());
+                            String htmlString = IoUtil.readToString(inputStreamByUrl);
                             Document doc = Jsoup.parse(htmlString);
 
                             // 模糊匹配
@@ -2662,7 +2654,7 @@ public class ExcelTabController extends BladeController {
                                 }
                             }
                         }
-                    } catch (FileNotFoundException e) {
+                    } catch (Exception e) {
                         e.printStackTrace();
                     }
                     for (Map<String, Object> mysqlData : businessDataMap) {

+ 3 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/TextdictInfoMapper.xml

@@ -18,6 +18,9 @@
         <result column="pyzby" property="pyzby"/>
         <result column="excel_id" property="excelId"/>
         <result column="project_id" property="projectId"/>
+        <result column="time_state" property="timeState"/>
+        <result column="time_name" property="timeName"/>
+        <result column="time_col_key" property="timeColKey"/>
     </resultMap>
 
     <select id="selectTextdictInfoPage" resultMap="textdictInfoResultMap">

+ 1 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ExcelTabServiceImpl.java

@@ -1354,7 +1354,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
 
             //编号为父节点划分编号 “编号:”、“工程编号:”、“编号”、“分项工程编号”、“分部分项编号”
             Elements bhtitle = doc.select("el-input[placeholder~=^编号]");
-            if(wbsTreeContract.getWbsType()==1){
+            if(Func.isNotEmpty(wbsTreeContract.getWbsType()) && wbsTreeContract.getWbsType()==1){
                 Elements bhtitle2 = doc.select("el-input[placeholder~=^工程编号]");
                 Elements bhtitle3 = doc.select("el-input[placeholder~=^分项工程编号]");
                 Elements bhtitle4 = doc.select("el-input[placeholder~=^分部分项编号]");

+ 1 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/FormulaServiceImpl.java

@@ -2839,7 +2839,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
         Map<String,Map<String,String>> eSignMaps=new HashMap<>();
         tableList.forEach(nt -> {
             String initTableName =nt.getInitTableName();
-            Document document =documentMap.get(nt.getInitTableName());
+            Document document = documentMap.get(nt.getInitTableName());
             coordinateMap.put(initTableName, FormulaUtils.getElementExcelCoords(document));
             eSignMaps.put(initTableName,FormulaUtils.getESignMap(document));
         });

+ 12 - 7
blade-service/blade-manager/src/main/java/org/springblade/manager/utils/FileUtils.java

@@ -15,6 +15,7 @@ import com.sun.image.codec.jpeg.JPEGCodec;
 import com.sun.image.codec.jpeg.JPEGImageEncoder;
 import org.apache.commons.lang.StringUtils;
 import org.apache.poi.hssf.usermodel.HSSFPrintSetup;
+import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
 import org.apache.poi.ss.usermodel.*;
 import org.apache.poi.ss.util.CellRangeAddress;
 import org.apache.poi.util.Units;
@@ -162,14 +163,18 @@ public class FileUtils {
         return -1;
     }
 
-/*    public static void main(String[] args) {
-        String outPdfUrl = "/Users/hongchuangyanfa/Desktop/pdf/outPdf.pdf";
+ /*   public static void main(String[] args) throws IOException, InvalidFormatException {
+        String exceUrl = "/Users/hongchuangyanfa/Downloads/c884eee1164699711fc783c5fe59d51f.xlsx";
+        File file = new File(exceUrl);
+        org.apache.poi.ss.usermodel.Workbook workbook = new XSSFWorkbook(file);
+        Sheet sheet = workbook.getSheetAt(0);
+
+         Row row = sheet.getRow(12 - 1);
+         if (row != null) {
+             Cell cell = row.getCell(4 - 1);
+             System.out.println(cell);
+         }
 
-        List<String> urlList = new ArrayList<>();
-        for(int i=0; i<=500 ;i++){
-            urlList.add("/Users/hongchuangyanfa/Desktop/pdf/1788120810012016640123.pdf");
-        }
-        mergePdfPublicMethods(urlList, outPdfUrl);
     }*/
 
     /**

+ 205 - 25
blade-service/blade-meter/src/main/java/org/springblade/meter/controller/TaskController.java

@@ -22,6 +22,8 @@ import com.itextpdf.text.Document;
 import com.itextpdf.text.pdf.PdfCopy;
 import com.itextpdf.text.pdf.PdfReader;
 import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import javassist.bytecode.stackmap.BasicBlock;
 import lombok.AllArgsConstructor;
@@ -53,6 +55,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;
@@ -253,10 +256,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());
@@ -1286,9 +1289,11 @@ public class TaskController extends BladeController {
                     }
                 }
                 //校验当前用户在第几流程
-                Integer sort = query.stream().collect(Collectors.toMap(l -> l.getFixedFlowLinkUser(), l -> l.getFixedFlowBranchSort())).get(AuthUtil.getUserId());
+ /*               Map<Long, Integer> collect = query.stream().collect(Collectors.toMap(l -> l.getFixedFlowLinkUser(), l -> l.getFixedFlowBranchSort()));
+
+                Integer sort = collect.get(AuthUtil.getUserId());
                 // 为空则代表是上报人,直接显示当前结果
-                currentUserFlow = sort;
+                currentUserFlow = sort;*/
 
                 Map<String, List<FixedFlowLink>> group = query.stream()
                         .collect(Collectors.groupingBy(obj -> obj.getFixedFlowLink() + "@@@" + obj.getFixedFlowLinkType(),
@@ -1394,8 +1399,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);
@@ -2543,20 +2548,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);
             }
 
             //如果要生成审计意见单
@@ -2565,7 +2557,9 @@ public class TaskController extends BladeController {
                 checkMiddleApp(dto, task, taskParallels);
             }
 
+            //判断签字状态
             boolean isCurrentUserLastApprove = checkTheTaskPersonSort(taskParallels);
+
             /*单条业务数据状态*/
             updateCopyDataStatus(task, dto);
             String reportId = null;
@@ -2652,6 +2646,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) {
@@ -3246,6 +3409,22 @@ public class TaskController extends BladeController {
     }
 
 
+    @GetMapping("/backMeterTask")
+    @ApiOperationSupport(order = 22)
+    @ApiImplicitParams(value = {
+            @ApiImplicitParam(name = "periodId", value = "期数ID"),
+            @ApiImplicitParam(name = "type", value = "类型(0中间,1材料,2开工)")
+    })
+    public R backMeterTask(@RequestParam String periodId, @RequestParam Integer type) {
+        // 0中间,1材料,2开工
+        String delTaskPall = "DELETE from u_task_parallel where process_instance_id in(SELECT process_instance_id from u_task where form_data_id ='"+periodId+"') ";
+        String delTask = "DELETE from u_task where form_data_id ='"+periodId+"'";
+        jdbcTemplate.execute(delTaskPall);
+        jdbcTemplate.execute(delTask);
+        return R.success("成功");
+    }
+
+
     @GetMapping("/meterPdfInfo")
     @ApiOperationSupport(order = 22)
     @ApiOperation(value = "计量生成Pdf", notes = "计量生成Pdf")
@@ -3796,8 +3975,9 @@ public class TaskController extends BladeController {
                 && ObjectUtil.isNotEmpty(dto.getProjectId())
                 && ObjectUtil.isNotEmpty(dto.getContractId())) {
 
+            // 获取流产下的节点流程信息
             List<SaveFixedFlowDTO.FixedBranch> fixedBranchList = dto.getFixedBranchList();
-            Set<String> allUserIds = new HashSet<>();
+            /*Set<String> allUserIds = new HashSet<>();
             Set<String> duplicateUserIds = new HashSet<>();
             for (SaveFixedFlowDTO.FixedBranch fixedBranch : fixedBranchList) {
                 String userIds = fixedBranch.getUserIds();
@@ -3819,7 +3999,7 @@ public class TaskController extends BladeController {
                     names.add(orDefault);
                 }
                 throw new ServiceException("每个任务人只能归属于一个任务中,以下任务人重复:" + String.join("、", names));
-            }
+            }*/
 
             /*检查签字证书信息*/
             List<String> userIds = dto.getFixedBranchList().stream().map(SaveFixedFlowDTO.FixedBranch::getUserIds).collect(Collectors.toList());
@@ -4002,7 +4182,7 @@ public class TaskController extends BladeController {
         } else {
             fileUrl = aPrivate.getHtmlUrl();
         }
-        try (InputStream fileInputStream = new FileInputStream(fileUrl)){
+        try (InputStream fileInputStream = FileUtils.getInputStreamByUrl(fileUrl)){
             String htmlString = IoUtil.readToString(fileInputStream);
             htmlString = htmlString.replaceAll("placeholder", "placeholderxx");
             htmlString = htmlString.replaceAll("title", "titlexx");

+ 23 - 12
blade-service/blade-meter/src/main/java/org/springblade/meter/mapper/MiddleMeterApplyMapper.xml

@@ -100,27 +100,38 @@
             order by mma.create_time desc
     </select>
     <select id="page3" resultType="org.springblade.meter.vo.MiddleMeterApplyVO">
-        SELECT *,
-               CASE when approve_status = 0 then '未上报' when approve_status = 1 then '待审批' when approve_status = 2 then '已审批'
-                    else '已废除' end as approveStatusName,
-               (select period_number from s_contract_meter_period cmp where cmp.id = mma.contract_period_id) as periodNumber,
-               (SELECT raw_url from s_interim_pay_certificate where contract_id=#{apply.contractId} and contract_period_id=mma.contract_period_id and is_deleted=0) as periodPdfUrl
-        FROM s_middle_meter_apply mma
-        WHERE contract_id = #{apply.contractId} and is_deleted = 0
+        SELECT a.*,b.period_number AS periodNumber ,
+        CASE
+        WHEN a.approve_status = 0 THEN
+        '未上报'
+        WHEN a.approve_status = 1 THEN
+            CONCAT('待审批',(
+                SELECT IFNULL(CONCAT( '(', group_concat( CONCAT( a.task_user_name, ',', DATEDIFF( CURDATE(), a.create_time ))), ')' ),"") AS taskUserInfo FROM u_task_parallel a,u_task b
+                    WHERE a.process_instance_id = b.process_instance_id AND b.form_data_id = b.id AND e_visa_status IS NULL AND (e_visa_content IS NULL or e_visa_content ='' ) AND b.STATUS != 3
+                ) )
+        WHEN a.approve_status = 2 THEN
+        '已审批' ELSE '已废除'
+        END AS approveStatusName ,
+        (SELECT id from u_task c where b.id=c.form_data_id) as task_id,
+        ( SELECT raw_url FROM s_interim_pay_certificate WHERE contract_id = #{apply.contractId}  AND contract_period_id = a.contract_period_id AND is_deleted = 0 ) AS periodPdfUrl
+        from
+        s_middle_meter_apply a ,s_contract_meter_period b
+        WHERE
+        a.contract_period_id = b.id
+        and a.contract_id = #{apply.contractId} and a.is_deleted = 0
         <if test="apply.contractPeriodId != -1">
-            and contract_period_id = #{apply.contractPeriodId}
+            and a.contract_period_id = #{apply.contractPeriodId}
         </if>
-
-          and contract_unit_id in (
+          and a.contract_unit_id in (
                 <foreach collection="ids" item="id"  separator=",">
                     #{id}
                 </foreach>
             )
-        order by FIELD(contract_unit_id,
+        order by FIELD(a.contract_unit_id,
             <foreach collection="ids" item="id"  separator=",">
                 #{id}
             </foreach>
-        ),create_time
+        ),a.create_time
 
     </select>
     <select id="meterPeriodAllForm" resultType="org.springblade.meter.vo.MeterInventoryDetailVO">

+ 12 - 6
blade-service/blade-meter/src/main/java/org/springblade/meter/mapper/StartPayMeterFormMapper.xml

@@ -23,14 +23,20 @@
         <result column="sort" property="sort"/>
     </resultMap>
     <select id="meterPage" resultType="org.springblade.meter.vo.StartPayMeterFormVO">
-        select *,
-               (select period_number from s_meter_period smp where smp.id = spmf.meter_period_id) as periodNumber,
-            CASE when approve_status = 0 then '未上报' when approve_status = 1 then '待审批' when approve_status = 2 then '已审批'
-            else '已废除' end as approveStatusName
+        SELECT IF(c.taskUserInfo is NULL,c.approveStatusName,CONCAT(c.approveStatusName,'',c.taskUserInfo))  as approveStatusName,c.* from (
+        select *,(select period_number from s_meter_period smp where smp.id = spmf.meter_period_id) as periodNumber,
+        CASE when approve_status = 0 then '未上报' when approve_status = 1 then '待审批' when approve_status = 2 then '已审批'
+        else '已废除' end as approveStatusName,
+        (
+        SELECT CONCAT('(',GROUP_CONCAT( CONCAT(a.task_user_name, ',', DATEDIFF(CURDATE(), a.create_time))),')') as taskUserInfo from u_task_parallel a ,u_task b where a.process_instance_id=b.process_instance_id and b.form_data_id=spmf.meter_period_id
+        and e_visa_status is null and e_visa_content is NULL
+        )	as taskUserInfo,
+        (SELECT max(id) from u_task c where spmf.meter_period_id=c.form_data_id) as task_id
         from s_start_pay_meter_form spmf
-        where contract_id = #{contractId} and is_deleted = 0
+        ) c
+        where c.contract_id = #{contractId} and c.is_deleted = 0
         <if test="meterPeriodId!=null and meterPeriodId!=''">
-            and meter_period_id = #{meterPeriodId}
+            and c.meter_period_id = #{meterPeriodId}
         </if>
     </select>
     <select id="detail" resultType="org.springblade.meter.vo.StartPayMeterFormVO">

+ 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);

+ 52 - 9
blade-service/blade-meter/src/main/java/org/springblade/meter/utils/FileUtils.java

@@ -11,6 +11,7 @@ import org.jsoup.nodes.Document;
 import org.jsoup.nodes.Element;
 import org.jsoup.select.Elements;
 import org.springblade.common.constant.CommonConstant;
+import org.springblade.common.utils.CommonUtil;
 import org.springblade.common.utils.SystemUtils;
 import org.springblade.core.log.exception.ServiceException;
 import org.springblade.system.cache.ParamCache;
@@ -25,15 +26,6 @@ import java.util.Map;
  * @Date 2024/5/14 16:44
  **/
 public class FileUtils {
-    public static String getSysLocalFileUrl() {
-        String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
-        if (SystemUtils.isMacOs()) {
-            file_path = "/Users/hongchuangyanfa/Desktop/";
-        } else if (SystemUtils.isWindows()) {
-            file_path = "C://upload//";
-        }
-        return file_path;
-    }
 
     public static void setExcelScaleToPdf(String inputPath, String outPath) {
         //读取excel文件
@@ -127,4 +119,55 @@ public class FileUtils {
             throw new ServiceException("解析HTML中key出错");
         }
     }
+
+    // 获取本地 或 远程工作流ParamCache
+    public static InputStream getInputStreamByUrl(String fileUrl) throws Exception {
+
+        File file1 = new File(fileUrl);
+        InputStream fileInputStream = null;
+        if (file1.exists()) {
+            fileInputStream = new FileInputStream(file1);
+        } else {
+            String path = getNetUrl(fileUrl);
+            fileInputStream = CommonUtil.getOSSInputStream(path);
+        }
+        return fileInputStream;
+    }
+
+    public static String getNetUrl(String fileUrl){
+        String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
+        String file_path2 = getSysLocalFileUrl();
+        String sys_file_net_url = ParamCache.getValue(CommonConstant.SYS_FILE_NET_URL);
+        if(fileUrl.indexOf("/www/wwwroot")>=0){
+            file_path2 = file_path;
+        }
+        String path = sys_file_net_url + fileUrl.replaceAll("//", "/").replaceAll(file_path2, "");
+        return path;
+    }
+
+    public static String getSysLocalFileUrl() {
+        String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
+        String sys_isonline = ParamCache.getValue(CommonConstant.SYS_ISONLINE);
+
+        if(sys_isonline.equals("3")){ //正式环境
+            if (SystemUtils.isMacOs()) {
+                file_path = "/Users/hongchuangyanfa/Desktop/";
+            } else if (SystemUtils.isWindows()) {
+                file_path = "C://upload//";
+            }
+        }else if(sys_isonline.equals("2")){ //109测试环境
+            if (SystemUtils.isMacOs()) {
+                file_path = "/Users/hongchuangyanfa/Desktop/";
+            } else if (SystemUtils.isWindows()) {
+                file_path = "C://upload//";
+            }
+        }else{  //本地环境
+            if (SystemUtils.isMacOs()) {
+                file_path = "/Users/hongchuangyanfa/Desktop/";
+            } else if (SystemUtils.isWindows()) {
+                file_path = "C://upload//";
+            }
+        }
+        return file_path;
+    }
 }