Ver Fonte

管道提交报告bug

xuzhancheng há 5 dias atrás
pai
commit
5a9a838f35

+ 25 - 0
tz-module-pressure2/tz-module-pressure2-biz/src/main/java/cn/start/tz/module/pressure2/controller/admin/synchronization/SynchronizationController.java

@@ -29,4 +29,29 @@ public class SynchronizationController {
         synchronizationService.pipe(null);
         return CommonResult.success(null);
     }
+
+    @GetMapping("/checkTask/boiler")
+    public CommonResult<Object> checkTaskBoiler() {
+        synchronizationService.checkTaskBoiler(null);
+        return CommonResult.success(null);
+    }
+
+    @GetMapping("/checkTask/pipe")
+    public CommonResult<Object> checkTaskPipe() {
+        synchronizationService.checkTaskPipe(null);
+        return CommonResult.success(null);
+    }
+
+    @GetMapping("/taskEquipment/boiler")
+    public CommonResult<Object> taskEquipmentBoiler() {
+        synchronizationService.taskEquipmentBoiler(null);
+        return CommonResult.success(null);
+    }
+
+    @GetMapping("/taskEquipment/pipe")
+    public CommonResult<Object> taskEquipmentPipe() {
+        synchronizationService.taskEquipmentPipe(null);
+        return CommonResult.success(null);
+    }
+
 }

+ 1 - 1
tz-module-pressure2/tz-module-pressure2-biz/src/main/java/cn/start/tz/module/pressure2/service/pipetaskorder/PipeTaskOrderServiceImpl.java

@@ -3137,7 +3137,7 @@ public class PipeTaskOrderServiceImpl extends ServiceImpl<PipeTaskOrderMapper, P
             throw new Exception("没有任务单明细");
         }
         PipeTaskOrderItemDO pipeTaskOrderItemDO = pipeTaskOrderItemDOS.get(0);
-        List<PipeTaskOrderItemDetailDO> pipeTaskOrderItemDetailDOS = pipeTaskOrderItemDetailMapper.selectList(PipeTaskOrderItemDetailDO::getOrderId, pipeTaskOrderItemDO.getId());
+        List<PipeTaskOrderItemDetailDO> pipeTaskOrderItemDetailDOS = pipeTaskOrderItemDetailMapper.selectList(PipeTaskOrderItemDetailDO::getOrderId, pipeTaskOrderItemDO.getOrderId());
         if (pipeTaskOrderItemDetailDOS.isEmpty()){
             throw new Exception("没有任务单明细");
         }

+ 20 - 0
tz-module-pressure2/tz-module-pressure2-biz/src/main/java/cn/start/tz/module/pressure2/service/synchronization/SynchronizationService.java

@@ -23,4 +23,24 @@ public interface SynchronizationService {
      * 上传报告
      */
     boolean uploadReport(ReportDto reportDto);
+
+    /**
+     * 同步锅炉检验任务
+     */
+    void checkTaskBoiler(String updateDate);
+
+    /**
+     * 同步管道检验任务
+     */
+    void checkTaskPipe(String updateDate);
+
+    /**
+     * 同步锅炉任务设备
+     */
+    void taskEquipmentBoiler(String updateDate);
+
+    /**
+     * 同步管道任务设备
+     */
+    void taskEquipmentPipe(String updateDate);
 }

+ 221 - 0
tz-module-pressure2/tz-module-pressure2-biz/src/main/java/cn/start/tz/module/pressure2/service/synchronization/SynchronizationServiceImpl.java

@@ -252,6 +252,227 @@ public class SynchronizationServiceImpl implements SynchronizationService {
         return false;
     }
 
+    /**
+     * 同步锅炉检验任务数据
+     *
+     * @param updateDate 更新时间,只同步此时间之后的数据
+     */
+    @Override
+    public void checkTaskBoiler(String updateDate) {
+        log.info("同步锅炉检验任务定时任务执行中...");
+        
+        Map<String, Object> form = new HashMap<>();
+        form.put("pageNum", 0);
+        form.put("pageSize", DEFAULT_PAGE_SIZE);
+        if (updateDate != null) {
+            form.put("UPDATEDATE_gt", updateDate);
+        }
+        // 添加锅炉类型过滤条件
+        form.put("CHECK_TASK_TYPE", "锅炉");
+        
+        String checkTaskData = getRequest("chcektask", form);
+        ResponseDto checkTaskResponseDto = JSONObject.parseObject(checkTaskData, ResponseDto.class);
+        log.info("同步数据中台返回锅炉检验任务数据:{}", checkTaskResponseDto);
+        
+        if (checkTaskResponseDto.getTotal() > 0 && !checkTaskResponseDto.getData().isEmpty()) {
+            List<CheckTaskDto> list = checkTaskResponseDto.getData().stream()
+                    .map(data -> ((JSONObject) data).toJavaObject(CheckTaskDto.class))
+                    .toList();
+            
+            log.info("同步锅炉检验任务数据共{}条", list.size());
+            
+            // 这里可以根据业务需求进行处理,例如:
+            // 1. 保存到本地数据库
+            // 2. 更新相关状态
+            // 3. 触发后续业务流程
+            
+            for (CheckTaskDto checkTaskDto : list) {
+                try {
+                    // 处理单个检验任务
+                    processCheckTask(checkTaskDto, "BOILER");
+                } catch (Exception e) {
+                    log.error("处理锅炉检验任务失败,任务号:{}", checkTaskDto.getTaskNo(), e);
+                }
+            }
+        }
+    }
+
+    /**
+     * 同步管道检验任务数据
+     *
+     * @param updateDate 更新时间,只同步此时间之后的数据
+     */
+    @Override
+    public void checkTaskPipe(String updateDate) {
+        log.info("同步管道检验任务定时任务执行中...");
+        
+        Map<String, Object> form = new HashMap<>();
+        form.put("pageNum", 0);
+        form.put("pageSize", DEFAULT_PAGE_SIZE);
+        if (updateDate != null) {
+            form.put("UPDATEDATE_gt", updateDate);
+        }
+        // 添加管道类型过滤条件
+        form.put("CHECK_TASK_TYPE", "管道");
+        
+        String checkTaskData = getRequest("chcektask", form);
+        ResponseDto checkTaskResponseDto = JSONObject.parseObject(checkTaskData, ResponseDto.class);
+        log.info("同步数据中台返回管道检验任务数据:{}", checkTaskResponseDto);
+        
+        if (checkTaskResponseDto.getTotal() > 0 && !checkTaskResponseDto.getData().isEmpty()) {
+            List<CheckTaskDto> list = checkTaskResponseDto.getData().stream()
+                    .map(data -> ((JSONObject) data).toJavaObject(CheckTaskDto.class))
+                    .toList();
+            
+            log.info("同步管道检验任务数据共{}条", list.size());
+            
+            // 这里可以根据业务需求进行处理,例如:
+            // 1. 保存到本地数据库
+            // 2. 更新相关状态
+            // 3. 触发后续业务流程
+            
+            for (CheckTaskDto checkTaskDto : list) {
+                try {
+                    // 处理单个检验任务
+                    processCheckTask(checkTaskDto, "PIPE");
+                } catch (Exception e) {
+                    log.error("处理管道检验任务失败,任务号:{}", checkTaskDto.getTaskNo(), e);
+                }
+            }
+        }
+    }
+
+    /**
+     * 处理单个检验任务
+     *
+     * @param checkTaskDto 检验任务DTO
+     * @param taskType     任务类型(BOILER/PIPE)
+     */
+    private void processCheckTask(CheckTaskDto checkTaskDto, String taskType) {
+        log.info("处理{}检验任务,任务号:{}", taskType, checkTaskDto.getTaskNo());
+        
+        // 这里可以实现具体的业务逻辑,例如:
+        // 1. 根据任务号查询本地是否存在该任务
+        // 2. 如果存在则更新,不存在则新增
+        // 3. 关联相关的设备信息
+        // 4. 更新单位信息等
+        
+        // 示例:记录日志
+        log.info("检验任务详情 - 任务号:{}, 单位:{}, 联系人:{}, 检验日期:{}",
+                checkTaskDto.getTaskNo(),
+                checkTaskDto.getUnitName(),
+                checkTaskDto.getLinkMan(),
+                checkTaskDto.getCheckDate());
+    }
+
+    /**
+     * 同步锅炉任务设备数据
+     *
+     * @param updateDate 更新时间,只同步此时间之后的数据
+     */
+    @Override
+    public void taskEquipmentBoiler(String updateDate) {
+        log.info("同步锅炉任务设备定时任务执行中...");
+        
+        Map<String, Object> form = new HashMap<>();
+        form.put("pageNum", 0);
+        form.put("pageSize", DEFAULT_PAGE_SIZE);
+        if (updateDate != null) {
+            form.put("UPDATEDATE_gt", updateDate);
+        }
+        // 添加设备类型过滤条件 - 锅炉
+        form.put("EQUIPMENT_TYPE", "锅炉");
+        
+        String taskEquipmentData = getRequest("task_equipment", form);
+        ResponseDto taskEquipmentResponseDto = JSONObject.parseObject(taskEquipmentData, ResponseDto.class);
+        log.info("同步数据中台返回锅炉任务设备数据:{}", taskEquipmentResponseDto);
+        
+        if (taskEquipmentResponseDto.getTotal() > 0 && !taskEquipmentResponseDto.getData().isEmpty()) {
+            List<TaskEquipmentDto> list = taskEquipmentResponseDto.getData().stream()
+                    .map(data -> ((JSONObject) data).toJavaObject(TaskEquipmentDto.class))
+                    .toList();
+            
+            log.info("同步锅炉任务设备数据共{}条", list.size());
+            
+            for (TaskEquipmentDto taskEquipmentDto : list) {
+                try {
+                    // 处理单个任务设备
+                    processTaskEquipment(taskEquipmentDto, "BOILER");
+                } catch (Exception e) {
+                    log.error("处理锅炉任务设备失败,任务号:{},设备注册号:{}", 
+                            taskEquipmentDto.getTaskNo(), taskEquipmentDto.getRegisterNo(), e);
+                }
+            }
+        }
+    }
+
+    /**
+     * 同步管道任务设备数据
+     *
+     * @param updateDate 更新时间,只同步此时间之后的数据
+     */
+    @Override
+    public void taskEquipmentPipe(String updateDate) {
+        log.info("同步管道任务设备定时任务执行中...");
+        
+        Map<String, Object> form = new HashMap<>();
+        form.put("pageNum", 0);
+        form.put("pageSize", DEFAULT_PAGE_SIZE);
+        if (updateDate != null) {
+            form.put("UPDATEDATE_gt", updateDate);
+        }
+        // 添加设备类型过滤条件 - 管道
+        form.put("EQUIPMENT_TYPE", "管道");
+        
+        String taskEquipmentData = getRequest("task_equipment", form);
+        ResponseDto taskEquipmentResponseDto = JSONObject.parseObject(taskEquipmentData, ResponseDto.class);
+        log.info("同步数据中台返回管道任务设备数据:{}", taskEquipmentResponseDto);
+        
+        if (taskEquipmentResponseDto.getTotal() > 0 && !taskEquipmentResponseDto.getData().isEmpty()) {
+            List<TaskEquipmentDto> list = taskEquipmentResponseDto.getData().stream()
+                    .map(data -> ((JSONObject) data).toJavaObject(TaskEquipmentDto.class))
+                    .toList();
+            
+            log.info("同步管道任务设备数据共{}条", list.size());
+            
+            for (TaskEquipmentDto taskEquipmentDto : list) {
+                try {
+                    // 处理单个任务设备
+                    processTaskEquipment(taskEquipmentDto, "PIPE");
+                } catch (Exception e) {
+                    log.error("处理管道任务设备失败,任务号:{},设备注册号:{}", 
+                            taskEquipmentDto.getTaskNo(), taskEquipmentDto.getRegisterNo(), e);
+                }
+            }
+        }
+    }
+
+    /**
+     * 处理单个任务设备
+     *
+     * @param taskEquipmentDto 任务设备DTO
+     * @param equipmentType    设备类型(BOILER/PIPE)
+     */
+    private void processTaskEquipment(TaskEquipmentDto taskEquipmentDto, String equipmentType) {
+        log.info("处理{}任务设备,任务号:{},设备注册号:{}", 
+                equipmentType, taskEquipmentDto.getTaskNo(), taskEquipmentDto.getRegisterNo());
+        
+        // 这里可以实现具体的业务逻辑,例如:
+        // 1. 根据任务号和设备注册号查询本地是否存在该任务设备
+        // 2. 如果存在则更新,不存在则新增
+        // 3. 关联相关的检验任务信息
+        // 4. 更新费用信息、检验项目等
+        
+        // 示例:记录日志
+        log.info("任务设备详情 - 任务号:{}, 设备注册号:{}, 主检员:{}, 法定费用:{}, 服务费用:{}, 检验项目:{}",
+                taskEquipmentDto.getTaskNo(),
+                taskEquipmentDto.getRegisterNo(),
+                taskEquipmentDto.getMasterChecker(),
+                taskEquipmentDto.getLegalTotalFee(),
+                taskEquipmentDto.getServiceTotalFee(),
+                taskEquipmentDto.getCheckItem());
+    }
+
 
     /**
      * 发起get请求到数据中台

+ 97 - 0
tz-module-pressure2/tz-module-pressure2-biz/src/main/java/cn/start/tz/module/pressure2/service/synchronization/dto/CheckTaskDto.java

@@ -0,0 +1,97 @@
+package cn.start.tz.module.pressure2.service.synchronization.dto;
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+/**
+ * 检验任务DTO - 对应数据中台的chcektask表
+ */
+@Data
+public class CheckTaskDto {
+    private Long id;
+    private String taskNo;
+    private Long apprizeId;
+    private String apprizeNo;
+    private String contractNo;
+    private String superviseNo;
+    private String unitCode;
+    private String unitName;
+    private String linkMan;
+    private String linkBranch;
+    private String tel;
+    private String mobile;
+    private String address;
+    private String zipCode;
+    private String hasUseNo;
+    private String withoutUseNo;
+    private String security; // 0否 1是
+    private String traffic;
+    private String checkDate;
+    private String feeType;
+    private String acceptType;
+    private String sendType;
+    private String checkType;
+    private String others;
+    private String remark;
+    private String isWaterOil; // 0不是 1是
+    private String woChecker;
+    private String userId;
+    private String inputDate;
+    private String masterChecker;
+    private String checker;
+    private String status;
+    private String assessor;
+    private String auditingDate;
+    private String confirm;
+    private String affirmant;
+    private String confirmDate;
+    private String chargeNo;
+    private String isBalance;
+    private BigDecimal legalFee;
+    private BigDecimal serviceFee;
+    private String cancelUser;
+    private String cancelDate;
+    private String cancelReason;
+    private Integer safetyNums;
+    private String getDate;
+    private String reAuditingFlag;
+    private String reAssessor;
+    private String reAuditingDate;
+    private String isAdjust;
+    private String isTag;
+    private String isCheckMobileNow;
+    private String printStatus;
+    private String printDate;
+    private String sendNo;
+    private String isOver20Years;
+    private String isUpload;
+    private String isCurrentInstall;
+    private String installType;
+    private String isLiquidPressure;
+    private String isSubsidyStatistics;
+    private String planId;
+    private String checkTaskType;
+    private String eqRegisterNo;
+    private String safeReceive;
+    private String safeAppearanceCheck;
+    private String safeCheckOut;
+    private String safeSeal;
+    private String safeProofread;
+    private BigDecimal receivableFee;
+    private BigDecimal deratePercent;
+    private String azxkzbh;
+    private String checkDate2;
+    private String aqfsjfs;
+    private String azdw;
+    private String agent;
+    private String unitNameBill;
+    private String flag;
+    private String isLegalFree;
+    private BigDecimal legalFree;
+    private String feeNature;
+    private String apprVolNo;
+    private String orgName;
+    private String changeStatus;
+    private String oldTaskNo;
+}

+ 42 - 0
tz-module-pressure2/tz-module-pressure2-biz/src/main/java/cn/start/tz/module/pressure2/service/synchronization/dto/TaskEquipmentDto.java

@@ -0,0 +1,42 @@
+package cn.start.tz.module.pressure2.service.synchronization.dto;
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+/**
+ * 任务设备DTO - 对应数据中台的task_equipment表
+ */
+@Data
+public class TaskEquipmentDto {
+    private Long id;
+    private String taskNo;
+    private String recordNo;
+    private String registerNo;
+    private String equipmentType;
+    private String tableName;
+    private String masterChecker;
+    private String typeCode;
+    private String itemCodes;
+    private String checkItem;
+    private BigDecimal legalTotalFee;
+    private BigDecimal serviceTotalFee;
+    private String isPlan;
+    private String isUpload;
+    private String hasPressure;
+    private String isClient;
+    private String pressureUser;
+    private String itemNames;
+    private String feeItem;
+    private String aheadFeeItem;
+    private String deviceId;
+    private String isExchange;
+    private String isWaterSubmit;
+    private String checkResultFee;
+    private String isCheck;
+    private String waterPressChecker;
+    private String waterPressDate;
+    private String resultAndFee;
+    private String apprizeInfoId;
+    private String relevantDept;
+}