zjh
2024-09-27 59363c48a5977f4df327d87085d4c565c06bc96c
ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjOrderController.java
@@ -20,7 +20,9 @@
import cn.hutool.core.codec.Base64;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.RandomUtil;
import cn.hutool.crypto.symmetric.DES;
import cn.hutool.extra.pinyin.PinyinUtil;
import cn.hutool.json.JSONArray;
@@ -38,6 +40,8 @@
import com.ltkj.common.core.domain.entity.SysUser;
import com.ltkj.common.core.redis.RedisCache;
import com.ltkj.common.enums.DataSourceType;
import com.ltkj.common.utils.AgeResult;
import com.ltkj.common.utils.DateUtils;
import com.ltkj.common.utils.PDFDocumentUtil;
import com.ltkj.common.utils.SecurityUtils;
import com.ltkj.framework.config.MatchUtils;
@@ -50,6 +54,7 @@
import com.ltkj.hosp.hisDto.OutpinimpapplyDto;
import com.ltkj.hosp.hisDto.OutpinmedicapplyDto;
import com.ltkj.hosp.mapper.TestMapper;
import com.ltkj.hosp.pacsDto.SavePacsApply;
import com.ltkj.hosp.service.*;
import com.ltkj.hosp.sqlDomain.LtkjMiddleDetail;
import com.ltkj.hosp.sqlDomain.LtkjMiddleHead;
@@ -71,10 +76,13 @@
import com.ltkj.web.controller.his.HisApiMethod;
import com.ltkj.web.controller.his.HisApiMethodService;
import com.ltkj.web.controller.his.HisMzJysqController;
import com.ltkj.web.controller.lis.LisApiMethod;
import com.ltkj.web.controller.pacs.PacsApiMethodService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.aspectj.weaver.ast.Var;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
@@ -198,6 +206,12 @@
    private TjProBlService blService;
    @Autowired
    private LtkjJianchajianyanTreeService ltkjJianchajianyanTreeService;
    @Autowired
    private PacsApiMethodService pacsApiMethodService;
    @Autowired
    private ITbTransitionService tbTransitionService;
    @Autowired
    private LisApiMethod lisApiMethod;
    @Autowired
    private TjCfService cfService;
@@ -958,8 +972,11 @@
            tjOrder.setFinishTime(new Date());
            tjOrder.setCheckStatus(1);
            tjOrder.setStatus(TjConstants.TJ_WAIT);
            tjFlowingWater.setPayStasus(1L);
//            tjFlowingWater.setPayStasus(1L);
        }
//        else {
            tjFlowingWater.setPayStasus(0L);
//        }
        if (tjOrderService.save(tjOrder)) {
            //保存收货地址
@@ -1032,8 +1049,6 @@
            if (tjFlowingWaterService.save(tjFlowingWater)) {
                tjOrder.setTjSerialNumber(String.valueOf(tjFlowingWater.getTjSerialNumber()));
                tjOrderService.updateById(tjOrder);
            }
            //修改每项的原价现价 //修改临时表体检号
@@ -1049,6 +1064,7 @@
                    if(null !=jzh && null !=jzh.toString()){
                        hisApiMethod.ZfHisApiMethod(jzh.toString());
                    }
                    log.info("该登记人挂号失败, 就诊号为: "+tjOrder.getCardId());
                    return AjaxResult.error("挂号失败!" + result.get("msg").toString());
                }
@@ -1062,7 +1078,19 @@
                    //asyncService.newSaveextracted(tjOrder, tjCustomer, discount, sysUser, tjReservation, tjFlowingWater);
                    newSaveextracted(tjOrder, tjCustomer, discount, sysUser, tjReservation, tjFlowingWater);
                }
                hisApiMethod.tijianshenqing(tjCustomer,DateUtil.format(date1,"yyyy-MM-dd HH:mm:ss"),tjOrder.getCardId());
                // 查询 对接Lis、Pacs申请如果类型包含在配置内则使用对接lis、pacs
//                String useLisAndPacsRegisterDictTeam = configService.selectConfigByKey("use_lis_and_pacs_register_dict_team");
//                String[] split = useLisAndPacsRegisterDictTeam.split(",");
//                List<String> list = Arrays.asList(split);
//                if (list.contains(tjOrder.getTjType())) {
//                    List<TbTransition> detailList = tbTransitionService.getTbTransitionListByCusId(tjCustomer.getCusIdcard(),tjOrder.getCardId());
//                    pacsApiMethodService.save(tjOrder,tjCustomer,detailList);
//                    lisApiMethod.save(tjOrder,tjCustomer,detailList);
//                }else {
//                    hisApiMethod.tijianshenqing(tjCustomer, DateUtil.format(date1, "yyyy-MM-dd HH:mm:ss"), tjOrder.getCardId());
//                }
                hisApiMethod.tijianshenqing(tjCustomer, DateUtil.format(date1, "yyyy-MM-dd HH:mm:ss"), tjOrder.getCardId());
                return AjaxResult.success(tjNumber);
            } else {
@@ -1812,7 +1840,6 @@
                dto.setJzqk(9);
                controller.Outpinimpapply(dto);
            }*/
            return AjaxResult.success("签离成功!");
        } else {
            return getAjaxResult(tjNumber);
@@ -2250,7 +2277,8 @@
    public void newSaveextracted(TjOrder tjOrder, TjCustomer tjCustomer, BigDecimal discount, SysUser sysUser, TjReservation tjReservation, TjFlowingWater tjFlowingWater) {
        tjAskMedicalHistoryService.updateTjAskMedicalHistoryByCusId(tjOrder.getTjNumber(), sysUser.getNickName(), String.valueOf(sysUser.getUserId()), String.valueOf(tjCustomer.getCusId()));
        if (null != tjOrder.getTjCategory() && tjOrder.getTjCategory().equals("13")) {
            tjOrderDetailService.saveJSYTjOrderDetailsByCusId(tjCustomer.getCusIdcard(), String.valueOf(tjOrder.getOrderId()), sysUser.getNickName(), String.valueOf(sysUser.getUserId()),tjOrder.getCardId());
            tjOrderDetailService.saveJSYTjOrderDetailsByCusId(tjCustomer.getCusIdcard(),
                    String.valueOf(tjOrder.getOrderId()), sysUser.getNickName(), String.valueOf(sysUser.getUserId()),tjOrder.getCardId(),String.valueOf(tjFlowingWater.getTjSerialNumber()));
        } else {
            tjOrderDetailService.saveTjOrderDetailsByCusId(tjCustomer.getCusIdcard(), String.valueOf(tjOrder.getOrderId()), sysUser.getNickName(), String.valueOf(sysUser.getUserId()),tjOrder.getCardId());
        }
@@ -2279,7 +2307,7 @@
            tjFlowingWater.setCopeWith(tjOrder.getTjFlowingWater().getCopeWith());
            tjFlowingWater.setPayType(4L);
            tjFlowingWaterService.updateById(tjFlowingWater);
            asyncService.addTjChargingStandard(tjOrder, transitionService.getTbTransitionListByCusId(tjCustomer.getCusIdcard(), tjOrder.getCardId()), sysUser);
//            asyncService.addTjChargingStandard(tjOrder, transitionService.getTbTransitionListByCusId(tjCustomer.getCusIdcard(), tjOrder.getCardId()), sysUser);
        }
    }