zjh
2025-05-19 7e73e7699d55b4b229bef4dc5d89e01aedef5a19
ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjOrderController.java
@@ -15,6 +15,7 @@
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.codec.Base64;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
@@ -844,17 +845,7 @@
    }
    /**
     * 导出体检记录列表
     */
    @Log(title = "体检记录", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    @ApiOperation(value = "导出体检记录列表")
    public void export(HttpServletResponse response, TjOrder tjOrder) {
        List<TjOrder> list = tjOrderService.selectExportOrderList(tjOrder);
        ExcelUtil<TjOrder> util = new ExcelUtil<TjOrder>(TjOrder.class);
        util.exportExcel(response, list, "体检记录数据");
    }
    @PostMapping("/exportOrderList")
    @ApiOperation(value = "导出体检记录列表")
@@ -869,6 +860,7 @@
                                   @ApiParam(value = "报告开始时间") @RequestParam(required = false) Date bgbeginTime,
                                   @ApiParam(value = "报告结束时间") @RequestParam(required = false) Date bgendTime,
                                   @ApiParam(value = "单位") @RequestParam(required = false) String dw,
                                   @ApiParam(value = "当前页或全部数据") @RequestParam(required = false) String dqyorqbsj,
                                   HttpServletResponse response) {
        List<Long> cusIds = null;
        if (null != name) {
@@ -992,9 +984,15 @@
        }
        wq.orderByDesc(TjOrder::getCreateTime);
        Page<TjOrder> page2 = tjOrderService.page(page1, wq);
        List<TjOrder> list = page2.getRecords();
        if (list != null) {
        List<TjOrder> list =null;
        if(StringUtil.isNotBlank(dqyorqbsj) && dqyorqbsj.equals("1")){
            list = tjOrderService.list(wq);
        }else {
            Page<TjOrder> page2 = tjOrderService.page(page1, wq);
            list = page2.getRecords();
        }
        if (!list.isEmpty()) {
            for (TjOrder order : list) {
                TjCustomer tjCustomer = tjCustomerService.getById(order.getUserId());
                if (null != tjCustomer) {
@@ -1162,8 +1160,9 @@
            if (null != tjReservation.getPacId()) tjOrder.setPacId(tjReservation.getPacId());
            if (null != tjReservation.getTjCategory()) tjOrder.setTjCategory(tjReservation.getTjCategory());
            if (null != tjReservation.getGroupingId()) {
                TjDwGrouping dwGrouping = dwGroupingService.getById(tjReservation.getGroupingId());
                tjOrder.setGroupId(tjReservation.getGroupingId());
                tjOrder.setFirmDeptId(tjReservation.getPacId());
                tjOrder.setFirmDeptId(dwGrouping.getDwDeptId());
            }
            tjReservation.setIsExpire(1);
            tjReservationService.updateById(tjReservation);
@@ -1375,6 +1374,23 @@
            /*调用his接口*/
            String config = configService.selectConfigByKey("sfkqdyhis");
            if (null != config && config.equals("Y")) {
                if(tjCustomer.getPationId().equals("0")){
                    AjaxResult result = controller.Outpincreateapply(tjCustomer);
                    String result1 = getAjaxResult(result);
                    JSONObject object = getJSONObject(result1);
                    String code = object.getStr("ResultCode");
                    if (code.equals("0")) {
                        JSONArray resultDatass = object.getJSONArray("ResultData");
                        Map<String, Object> resultData = (Map<String, Object>) resultDatass.get(0);
                        if (null != resultData && !resultData.isEmpty()) {
                            String pationid = resultData.get("PationId").toString();
                            if (null != pationid) {
                                tjCustomer.setPationId(pationid);
                                tjCustomerService.updateById(tjCustomer);
                            }
                        }
                    }
                }
                AjaxResult result = hisApiMethod.HisApiMethods(tjCustomer, tjOrder);
                if (!result.get("code").toString().equals("200")) {
                    TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
@@ -1538,7 +1554,6 @@
                    newSaveextracted(tjOrder, tjCustomer, discount, sysUser, tjReservation, tjFlowingWater);
                    isRequestCommonHisApi(tjOrder, tjCustomer, tjFlowingWater);
                } catch (Exception e) {
//                    TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                    log.error("processOrderWithTransaction 方法异常"+e.getMessage());
                    throw new RuntimeException("调用公共方法失败 强制触发回滚");
//                    return AjaxResult.error();
@@ -4092,16 +4107,6 @@
    @GetMapping(value = "newgetTransitionList")
    @ApiOperation(value = "最新查询过渡表数据")
    public AjaxResult newgetTransitionList(@RequestParam @ApiParam(value = "客户id") String cusId) {
//        String pacId = transitionService.getTbTransitionPacId(cusId);
//        if(StringUtil.isNotBlank(pacId)){
//            //补差价
//            List<Map<String,Object>> cjMaps = groupingProService.huoquxiangmuchajia(pacId, cusId);
//            if(null !=cjMaps && !cjMaps.isEmpty()){
//                for (Map<String, Object> cjMap : cjMaps) {
//                    transitionService.buxiangmuchajia(cusId,pacId,cjMap.get("xmid").toString(),new BigDecimal(cjMap.get("cj").toString()));
//                }
//            }
//        }
        List<TbTransition> list = transitionService.newgetTransitionList(cusId);
        return AjaxResult.success(list);
    }