liusheng
昨天 46fab8daeed497e8529e7070712ceca9b04ee0f7
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/devrent/DevRentServiceImpl.java
@@ -25,6 +25,9 @@
import cn.lihu.jh.module.ecg.feign.FeeConfirmFeignService;
import cn.lihu.jh.module.ecg.service.queue.QueueServiceTxFunctions;
import cn.lihu.jh.module.ecg.webservice.WebServiceClient;
import cn.lihu.jh.module.infra.dal.dataobject.config.ConfigDO;
import cn.lihu.jh.module.infra.dal.mysql.config.ConfigMapper;
import cn.lihu.jh.module.infra.service.config.ConfigService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
@@ -36,6 +39,7 @@
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import static cn.lihu.jh.framework.common.exception.util.ServiceExceptionUtil.exception;
@@ -75,11 +79,11 @@
    @Resource
    CheckTypeMapper checkTypeMapper;
    @Resource
    private ConfigService configService;
    @Autowired
    private WebServiceClient webServiceClient;
    @Value("${spring.profiles.active}")
    private String active;
    @Override
@@ -162,7 +166,8 @@
        }
        //检查完成后,此时检查登记写成了,需要将这个回写给集成平台(线上环境才回写)
        if (active.equals("prod")) {
        ConfigDO configDO = configService.getConfigByKey("ecg.back.data");
        if (configDO.getValue().equals("1")) {
            if (createReqVO.getCheckType() != 100 && createReqVO.getCheckType() != 1000 && createReqVO.getCheckType() != 1100 && createReqVO.getCheckType() != 1400 && createReqVO.getCheckType() != 1500) {
                AppointmentDO appointmentDO = appointmentMapper.getByApplyNo(createReqVO.getApplyNo());
                ApplicationTemplate app = new ApplicationTemplate();
@@ -172,20 +177,11 @@
                log.info("routineFinishWebServiceClient的返回值为:{}", s);
                if (s.contains("更新成功")) {
                    //需要根据applyNo,将appiontment表里的status改成3
                    appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "3");
                    appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "3", new Date());
                }
            } else {
                //检查类型是床边的或常规的,需要根据applyNo,将appiontment表里的status改成7
                appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "7");
            }
        } else {
            if (createReqVO.getCheckType() != 100 && createReqVO.getCheckType() != 1000 && createReqVO.getCheckType() != 1100 && createReqVO.getCheckType() != 1400 && createReqVO.getCheckType() != 1500) {
                //需要根据applyNo,将appiontment表里的status改成3
                appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "4");
            } else {
                //检查类型是床边的或常规的,需要根据applyNo,将appiontment表里的status改成7
                appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "7");
                appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "7", null);
            }
        }
@@ -214,7 +210,8 @@
        }
        //设备领取完成后,此时检查登记写成了,需要将这个回写给集成平台(线上环境才回写)
        if (active.equals("prod")) {
        ConfigDO configDO = configService.getConfigByKey("ecg.back.data");
        if (configDO.getValue().equals("1")) {
            AppointmentDO appointmentDO = appointmentMapper.getByApplyNo(createReqVO.getApplyNo());
            ApplicationTemplate app = new ApplicationTemplate();
            String action = "S0405";
@@ -223,11 +220,8 @@
            log.info("webservice的返回值为:{}", s);
            if (s.contains("更新成功")) {
                //需要根据applyNo,将appiontment表里的status改成3
                appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "3");
                appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "3", new Date());
            }
        } else {
            appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "3");
        }
        List<Integer> jobTypeList = new ArrayList<Integer>();
        jobTypeList.add(DevRentStateEnum.RECEIVED.getState());
@@ -487,7 +481,8 @@
            createReqVO.setState(DevRentStateEnum.ROUTINE_CANCELLED.getState());
            updateDevRent(createReqVO);
            if (active.equals("prod")) {
            ConfigDO configDO = configService.getConfigByKey("ecg.back.data");
            if (configDO.getValue().equals("1")) {
                if (cancelReqVO.getCheckType() != 100 && cancelReqVO.getCheckType() != 1000 && cancelReqVO.getCheckType() != 1100 && cancelReqVO.getCheckType() != 1400 && cancelReqVO.getCheckType() != 1500) {
                    AppointmentDO appointmentDO = appointmentMapper.getByApplyNo(createReqVO.getApplyNo());
                    ApplicationTemplate app = new ApplicationTemplate();
@@ -497,20 +492,11 @@
                    log.info("routineFinishWebServiceClient的返回值为:{}", s);
                    if (s.contains("更新成功")) {
                        //需要根据applyNo,将appiontment表里的status改成3
                        appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "4");
                        appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "4", null);
                    }
                } else {
                    //检查类型是床边的或常规的,需要根据applyNo,将appiontment表里的status改成7
                    appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "7");
                }
            } else {
                if (cancelReqVO.getCheckType() != 100 && cancelReqVO.getCheckType() != 1000 && cancelReqVO.getCheckType() != 1100 && cancelReqVO.getCheckType() != 1400 && cancelReqVO.getCheckType() != 1500) {
                    //需要根据applyNo,将appiontment表里的status改成3
                    appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "4");
                } else {
                    //检查类型是床边的或常规的,需要根据applyNo,将appiontment表里的status改成7
                    appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "7");
                    appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "7", null);
                }
            }
@@ -579,7 +565,8 @@
            createReqVO.setState(DevRentStateEnum.RECEIVED_CANCELLED.getState());
            updateDevRent(createReqVO);
            if (active.equals("prod")) {
            ConfigDO configDO = configService.getConfigByKey("ecg.back.data");
            if (configDO.getValue().equals("1")) {
                AppointmentDO appointmentDO = appointmentMapper.getByApplyNo(createReqVO.getApplyNo());
                ApplicationTemplate app = new ApplicationTemplate();
                String action = "S0405";
@@ -588,16 +575,7 @@
                log.info("routineFinishWebServiceClient的返回值为:{}", s);
                if (s.contains("更新成功")) {
                    //需要根据applyNo,将appiontment表里的status改成3
                    appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "4");
                }
            } else {
                if (cancelReqVO.getCheckType() != 100 && cancelReqVO.getCheckType() != 1000 && cancelReqVO.getCheckType() != 1100 && cancelReqVO.getCheckType() != 1400 && cancelReqVO.getCheckType() != 1500) {
                    //需要根据applyNo,将appiontment表里的status改成3
                    appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "4");
                } else {
                    //检查类型是床边的或常规的,需要根据applyNo,将appiontment表里的status改成7
                    appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "7");
                    appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "4", null);
                }
            }
@@ -662,7 +640,8 @@
            createReqVO.setState(DevRentStateEnum.INSTALL_CANCELLED.getState());
            updateDevRent(createReqVO);
            if (active.equals("prod")) {
            ConfigDO configDO = configService.getConfigByKey("ecg.back.data");
            if (configDO.getValue().equals("1")) {
                AppointmentDO appointmentDO = appointmentMapper.getByApplyNo(createReqVO.getApplyNo());
                ApplicationTemplate app = new ApplicationTemplate();
                String action = "S0405";
@@ -671,16 +650,7 @@
                log.info("routineFinishWebServiceClient的返回值为:{}", s);
                if (s.contains("更新成功")) {
                    //需要根据applyNo,将appiontment表里的status改成3
                    appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "4");
                }
            } else {
                if (cancelReqVO.getCheckType() != 100 && cancelReqVO.getCheckType() != 1000 && cancelReqVO.getCheckType() != 1100 && cancelReqVO.getCheckType() != 1400 && cancelReqVO.getCheckType() != 1500) {
                    //需要根据applyNo,将appiontment表里的status改成3
                    appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "4");
                } else {
                    //检查类型是床边的或常规的,需要根据applyNo,将appiontment表里的status改成7
                    appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "7");
                    appointmentMapper.updateStatusByApplyNo(createReqVO.getApplyNo(), "4", null);
                }
            }