Kaynağa Gözat

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

yangyj 1 yıl önce
ebeveyn
işleme
5fbbfeb647

+ 3 - 0
blade-service-api/blade-meter-api/src/main/java/org/springblade/meter/entity/StartPayMeterForm.java

@@ -99,4 +99,7 @@ public class StartPayMeterForm extends BaseEntity {
 
     @ApiModelProperty(value = "计算式")
     private String calculateFormula;
+
+    @ApiModelProperty(value = "支付日期")
+    private String payDate;
 }

+ 2 - 0
blade-service-api/blade-meter-api/src/main/java/org/springblade/meter/entity/StartPayMeterFormTask.java

@@ -87,4 +87,6 @@ public class StartPayMeterFormTask extends BaseEntity {
     @ApiModelProperty(value = "计算式")
     private String calculateFormula;
 
+    @ApiModelProperty(value = "支付日期")
+    private String payDate;
 }

+ 2 - 1
blade-service/blade-business/src/main/java/org/springblade/business/mapper/TaskMapper.xml

@@ -38,7 +38,8 @@
                 status,
                 batch,
                 project_id,
-                contract_id
+                contract_id,
+                fixed_flow_id
         from u_task
         where form_data_id like concat('%', #{formDataId}, '%')
         <if test="type == 1">

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

@@ -119,7 +119,11 @@ public class EVisaController {
                 //获取状态为1(待审批)的分支流程
                 List<Task> tasks = taskClient.queryTaskListByFormDataId(taskApprovalVO.getFormDataId());
                 Task masterTask = tasks.get(0);
-                String sql = "SELECT a.* from u_task_parallel a where a.process_instance_id=(SELECT process_instance_id from u_task_parallel b where  b.parallel_process_instance_id='"+taskApprovalVO.getParallelProcessInstanceId()+"') and is_deleted=0 and `status`=1 ";
+                if(masterTask !=null && (masterTask.getApprovalType()==5 || masterTask.getApprovalType()==6 || masterTask.getApprovalType()==7 ) && masterTask.getFixedFlowId()!=null && masterTask.getFixedFlowId()!=0L ){
+                   String upsql = "update u_task_parallel set status=2 ,e_visa_status=1,e_visa_content='电签成功' ,update_time=SYSDATE()  where sort in(SELECT fixed_flow_branch_sort from u_fixed_flow_link where fixed_flow_id ="+masterTask.getFixedFlowId()+" and  fixed_flow_link like'%审计%') and process_instance_id="+masterTask.getProcessInstanceId()+"";
+                    jdbcTemplate.execute(upsql);
+                 }
+                String  sql = "SELECT a.* from u_task_parallel a where a.process_instance_id=(SELECT process_instance_id from u_task_parallel b where  b.parallel_process_instance_id='"+taskApprovalVO.getParallelProcessInstanceId()+"') and is_deleted=0 and `status`=1 ";
                 List<Map<String, Object>> maps = jdbcTemplate.queryForList(sql);
                 if (maps == null || maps.size() == 0) {
                     //说明都审批完成,将主表状态更改为已完成
@@ -166,12 +170,15 @@ public class EVisaController {
                         UpMeterSignDataInfo(taskApprovalVO,finalPdfUrl,1);
                     }
                 }
+            }else if("eContractError".equals(eVisaStatus) || eVisaStatus.contains("eContractError")){ //合同段信息出错
+
+                this.jdbcTemplate.execute("delete from u_task_batch where id="+taskApprovalVO.getId());
+
             }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 {
 
             }

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

@@ -100,8 +100,8 @@ import java.util.stream.Collectors;
 @AllArgsConstructor
 public class EVisaServiceImpl implements EVisaService {
 
-    //private static final String SIGN_HOST = "172.30.224.79";
-    private static final String SIGN_HOST = "47.115.117.246";
+    private static final String SIGN_HOST = "172.30.224.79";
+   // private static final String SIGN_HOST = "47.115.117.246";
 
     private static final String SIGN_PORT = "8183";
 
@@ -117,6 +117,8 @@ public class EVisaServiceImpl implements EVisaService {
 
     private static final String E_VISA_ERROR = "eVisaError";
 
+    private static final String E_CONTRACT_ERROR = "eContractError";
+
     private static final Logger logger = LoggerFactory.getLogger(EVisaServiceImpl.class);
 
     private final SignPfxClient signPfxClient;
@@ -455,6 +457,9 @@ public class EVisaServiceImpl implements EVisaService {
                 String dataInfo = this.taskClient.queryTaskContractId(task.getParallelProcessInstanceId());
                 String ids = String.join(",", eVisaConfigList);
                 //判断电签类型
+                if(dataInfo==null || Func.isEmpty(dataInfo)){
+                    return E_CONTRACT_ERROR;
+                }
                 String contractId = Func.toStrArray(dataInfo)[0];
                 String projectId = Func.toStrArray(dataInfo)[1];
 

+ 2 - 2
blade-service/blade-manager/src/main/java/com/mixsmart/utils/FormulaUtils.java

@@ -863,11 +863,11 @@ public class FormulaUtils {
         }
     }
 
-    public static void main(String[] args) {
+/*    public static void main(String[] args) {
         String uri="C:\\www\\wwwroot\\Users\\hongchuangyanfa\\Desktop\\privateUrl\\1661661730033369088.html";
         getElementExcelCoords(uri,"",null);
         System.out.println();
-    }
+    }*/
 
     /*解析html里的电签关键字*/
     public static Map<String,String> getESignMap(Document document){

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

@@ -1358,9 +1358,11 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                 Elements bhtitle2 = doc.select("el-input[placeholder~=^工程编号]");
                 Elements bhtitle3 = doc.select("el-input[placeholder~=^分项工程编号]");
                 Elements bhtitle4 = doc.select("el-input[placeholder~=^分部分项编号]");
+                Elements bhtitle5 = doc.select("el-input[placeholder~=^单位工程编码]");
                 bhtitle.addAll(bhtitle2);
                 bhtitle.addAll(bhtitle3);
                 bhtitle.addAll(bhtitle4);
+                bhtitle.addAll(bhtitle5);
             }
 
 

+ 48 - 10
blade-service/blade-meter/src/main/java/org/springblade/meter/controller/TaskController.java

@@ -1339,7 +1339,7 @@ public class TaskController extends BladeController {
                     vo.setType(task.getMeterTaskType() == 2 ? 1 : 2);
                 }
                 if (reportAllMoney == null) {
-                    throw new ServiceException("上报金额不能为空");
+                    reportAllMoney = BigDecimal.ZERO;
                 }
                 reportAllMoney = reportAllMoney.setScale(0, RoundingMode.HALF_UP);
                 vo.setReportAllMoney(reportAllMoney);
@@ -2718,7 +2718,7 @@ public class TaskController extends BladeController {
             }
 
             if (StringUtils.isBlank(opinion.getMeterEngineer())) {
-                opinion.setSupervisorAudit(null);
+                opinion.setMeterEngineer(null);
             } else {
                 //如果存在数据则判断之前是否填写总监理工程师,填写了则不管,没填写这次填写了,则设置用户id名称时间
                 if (oldOpinion != null) {
@@ -2734,7 +2734,7 @@ public class TaskController extends BladeController {
             }
 
             if (StringUtils.isBlank(opinion.getProjectManager())) {
-                opinion.setSupervisorAudit(null);
+                opinion.setProjectManager(null);
             } else {
                 //如果存在数据则判断之前是否填写总监理工程师,填写了则不管,没填写这次填写了,则设置用户id名称时间
                 if (oldOpinion != null) {
@@ -2750,7 +2750,7 @@ public class TaskController extends BladeController {
             }
 
             if (StringUtils.isBlank(opinion.getContractSupervisorEngineer())) {
-                opinion.setSupervisorAudit(null);
+                opinion.setContractSupervisorEngineer(null);
             } else {
                 //如果存在数据则判断之前是否填写总监理工程师,填写了则不管,没填写这次填写了,则设置用户id名称时间
                 if (oldOpinion != null) {
@@ -2766,7 +2766,7 @@ public class TaskController extends BladeController {
             }
 
             if (StringUtils.isBlank(opinion.getOwnerDelegate())) {
-                opinion.setSupervisorAudit(null);
+                opinion.setOwnerDelegate(null);
             } else {
                 //如果存在数据则判断之前是否填写总监理工程师,填写了则不管,没填写这次填写了,则设置用户id名称时间
                 if (oldOpinion != null) {
@@ -2808,7 +2808,6 @@ public class TaskController extends BladeController {
                         }
                     }
                     //校验当前用户在第几流程
-                    //Integer sort = query.stream().collect(Collectors.toMap(l -> l.getFixedFlowLinkUser(), l -> l.getFixedFlowBranchSort())).get(AuthUtil.getUserId());
                     for (FixedFlowLink link : query) {
                         if( link.getFixedFlowLinkUser().equals(AuthUtil.getUserId()) && link.getStatus() !=2 ){
                             currentUserFlow=link.getFixedFlowBranchSort();
@@ -2840,10 +2839,8 @@ public class TaskController extends BladeController {
                     if (isDefiniteFlow) {
                         flowIds = query.stream().filter(l -> auditFlow.contains(l.getFixedFlowBranchSort())).collect(Collectors.toMap(l -> l.getFixedFlowLinkUser(), l -> l.getFixedFlowLinkUserName()));
                         //获取出审计流程中所有用户
-                        List<String> ids = query.stream().filter(l -> auditFlow.contains(l.getFixedFlowBranchSort()) && !l.getFixedFlowLinkUser().equals(AuthUtil.getUserId())).map(l -> l.getFixedFlowLinkUser() + "").collect(Collectors.toList());
-                        //根据用户获取这些用户在当前任务中的进度,来判断是否全部审批完成
-                        long count = taskParallels.stream().filter(l -> ids.contains(l.getTaskUser())).filter(l -> l.getStatus() != 2).count();
-                        if (count == 0) {
+                        List<String> ids = query.stream().filter(l -> auditFlow.contains(l.getFixedFlowBranchSort()) && !l.getFixedFlowLinkUser().equals(AuthUtil.getUserId()) && l.getStatus()==1).map(l -> l.getFixedFlowLinkUser() + "").collect(Collectors.toList());
+                        if (ids.size() == 0) {
                             isAllApp = true;
                         }
                     } else {
@@ -3394,6 +3391,44 @@ public class TaskController extends BladeController {
         }
     }
 
+    /**
+     *  任务审批时-查看报表
+     * @param reportId  报表id
+     * @param type  类型 0中间1材料2开工
+     * @param taskType
+     * @return  审批中则重新计算生成PDF,审批完成则直接查看电签PDF
+     */
+    @GetMapping("/taskMeterPdfInfo")
+    @ApiOperationSupport(order = 22)
+    @ApiOperation(value = "任务审批时-查看报表", notes = "任务审批时-查看报表")
+    public R taskMeterPdfInfo(@RequestParam Long taskId, @RequestParam String reportId, @RequestParam Integer type, @RequestParam Integer taskType) {
+        Task task = jdbcTemplate.query("SELECT * FROM u_task WHERE id = ?", new Object[]{taskId}, new BeanPropertyRowMapper<>(Task.class)).stream().findAny().orElse(null);
+        if (task == null){
+            return R.fail("未找到任务相关信息");
+        }
+        if (task.getStatus() == 2){
+            String pdfUrl;
+            //审批完成
+            String sql;
+            if (type == 0) {
+                sql = "select raw_url from s_interim_pay_certificate where id = ?";
+            } else {
+                sql = "select raw_url from s_material_start_statement where id = ?";
+            }
+            pdfUrl = jdbcTemplate.queryForObject(sql, String.class, reportId);
+            if (StringUtils.isBlank(pdfUrl)){
+                return R.fail("电签报表生成中,请稍后再试");
+            }
+            return R.data(pdfUrl);
+        }else if (task.getStatus() == 1){
+            //审批中
+            return calculate(reportId, type, taskType);
+        }else {
+            //已废除
+            return R.fail("已废除无法查看报表");
+        }
+    }
+
 
     @GetMapping("/meterPdfInfo")
     @ApiOperationSupport(order = 22)
@@ -3456,6 +3491,9 @@ public class TaskController extends BladeController {
                             rs.setDeleteRow(start+","+end);
                         }
                     }
+
+                    //
+
                     /*初始化路径*/
                     rs.pathInit(file_path, report.getContractId());
                     rs.setExcelUrl(fileUrlMapping.get(rs.getExcelId().toString()));