From 5978bf12f908c76e18dd229293bdedd729e1183c Mon Sep 17 00:00:00 2001
From: zjh <1084500556@qq.com>
Date: 星期三, 31 七月 2024 14:38:39 +0800
Subject: [PATCH] zjh 2024/07/31-1

---
 ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjOrderController.java |  558 ++++++++++++++++++++++++++++++++++---------------------
 1 files changed, 343 insertions(+), 215 deletions(-)

diff --git a/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjOrderController.java b/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjOrderController.java
index 3b21af4..2a026cf 100644
--- a/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjOrderController.java
+++ b/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjOrderController.java
@@ -46,7 +46,9 @@
 import com.ltkj.framework.datasource.DynamicDataSourceContextHolder;
 import com.ltkj.hosp.domain.*;
 import com.ltkj.hosp.dto.QianDaoDto;
+import com.ltkj.hosp.dto.TjProBlDto;
 import com.ltkj.hosp.hisDto.OutpinimpapplyDto;
+import com.ltkj.hosp.hisDto.OutpinmedicapplyDto;
 import com.ltkj.hosp.mapper.TestMapper;
 import com.ltkj.hosp.service.*;
 import com.ltkj.hosp.sqlDomain.LtkjMiddleDetail;
@@ -97,8 +99,8 @@
  * @date 2022-11-21
  */
 @RestController
-@RequestMapping("/hosp/order")
-@Api(tags = "PC绔� ----浣撴璁板綍鎺ュ彛")
+@RequestMapping ("/hosp/order")
+@Api (tags = "PC绔� ----浣撴璁板綍鎺ュ彛")
 @Slf4j
 public class TjOrderController extends BaseController {
     @Resource
@@ -123,7 +125,7 @@
     private ITbTransitionService transitionService;
     @Resource
     private ISysConfigService configService;
-    @Value("${path.filePath}")
+    @Value ("${path.filePath}")
     private String value;
     @Resource
     private ITjOrderRemarkService remarkService;
@@ -192,13 +194,31 @@
     private ISysDeptService sysDeptService;
     @Autowired
     private HisApiMethodService controller;
+    @Autowired
+    private TjProBlService blService;
+    @Autowired
+    private LtkjJianchajianyanTreeService ltkjJianchajianyanTreeService;
+
+    @Autowired
+    private TjCfService cfService;
+
+    //灏嗘柟娉曡繑鍥炲�艰В鏋愭垚json鏍煎紡
+    public JSONObject getJSONObject(String builder) {
+        String Response = JSONUtil.parseObj(builder).getStr("Response");
+        return JSONUtil.parseObj(Response);
+    }
+
+    //鑾峰彇鏂规硶杩斿洖鍊间俊鎭�
+    public String getAjaxResult(AjaxResult result) {
+        return result.get("data").toString();
+    }
 
     /**
      * 鏌ヨ浣撴璁板綍鍒楄〃
      */
 //    @PreAuthorize("@ss.hasPermi('hosp:order:list')")
-    @GetMapping("/list")
-    @ApiOperation(value = "鏌ヨ浣撴璁板綍鍒楄〃(榛樿)")
+    @GetMapping ("/list")
+    @ApiOperation (value = "鏌ヨ浣撴璁板綍鍒楄〃(榛樿)")
     public TableDataInfo list(TjOrder tjOrder) {
         startPage();
         startOrderBy();
@@ -231,16 +251,16 @@
     }
 
 
-    @GetMapping("/getWenJuanList")
-    @ApiOperation(value = "鏌ヨ浣撴璁板綍鍒楄〃")
-    public AjaxResult getWenJuanList(@ApiParam(value = "椤电爜鏁�(榛樿1)") @RequestParam(defaultValue = "1") Integer pageNum,
-                                     @ApiParam(value = "鏄剧ず鏉℃暟(榛樿10)") @RequestParam(defaultValue = "10") Integer pageSize,
-                                     @ApiParam(value = "浣撴鍙�") @RequestParam(required = false) String tjNum,
-                                     @ApiParam(value = "濮撳悕") @RequestParam(required = false) String name,
-                                     @ApiParam(value = "鐧昏寮�濮嬫椂闂�") @RequestParam(required = false) Date djbeginTime,
-                                     @ApiParam(value = "鐧昏缁撴潫鏃堕棿") @RequestParam(required = false) Date djendTime,
-                                     @ApiParam(value = "鎶ュ憡寮�濮嬫椂闂�") @RequestParam(required = false) Date bgbeginTime,
-                                     @ApiParam(value = "鎶ュ憡缁撴潫鏃堕棿") @RequestParam(required = false) Date bgendTime) {
+    @GetMapping ("/getWenJuanList")
+    @ApiOperation (value = "鏌ヨ浣撴璁板綍鍒楄〃")
+    public AjaxResult getWenJuanList(@ApiParam (value = "椤电爜鏁�(榛樿1)") @RequestParam (defaultValue = "1") Integer pageNum,
+                                     @ApiParam (value = "鏄剧ず鏉℃暟(榛樿10)") @RequestParam (defaultValue = "10") Integer pageSize,
+                                     @ApiParam (value = "浣撴鍙�") @RequestParam (required = false) String tjNum,
+                                     @ApiParam (value = "濮撳悕") @RequestParam (required = false) String name,
+                                     @ApiParam (value = "鐧昏寮�濮嬫椂闂�") @RequestParam (required = false) Date djbeginTime,
+                                     @ApiParam (value = "鐧昏缁撴潫鏃堕棿") @RequestParam (required = false) Date djendTime,
+                                     @ApiParam (value = "鎶ュ憡寮�濮嬫椂闂�") @RequestParam (required = false) Date bgbeginTime,
+                                     @ApiParam (value = "鎶ュ憡缁撴潫鏃堕棿") @RequestParam (required = false) Date bgendTime) {
         Map<String, Object> map = new HashMap<>();
         if (null != name) {
             LambdaQueryWrapper<TjCustomer> wqq = new LambdaQueryWrapper<>();
@@ -360,16 +380,17 @@
     }
 
 
-    @GetMapping("/getOrderList")
-    @ApiOperation(value = "鏌ヨ浣撴璁板綍鍒楄〃")
-    public AjaxResult getOrderList(@ApiParam(value = "椤电爜鏁�(榛樿1)") @RequestParam(defaultValue = "1") Integer pageNum,
-                                   @ApiParam(value = "鏄剧ず鏉℃暟(榛樿10)") @RequestParam(defaultValue = "10") Integer pageSize,
-                                   @ApiParam(value = "浣撴鍙�)") @RequestParam(required = false) String tjNum,
-                                   @ApiParam(value = "濮撳悕)") @RequestParam(required = false) String name,
-                                   @ApiParam(value = "鐧昏寮�濮嬫椂闂�") @RequestParam(required = false) Date djbeginTime,
-                                   @ApiParam(value = "鐧昏缁撴潫鏃堕棿") @RequestParam(required = false) Date djendTime,
-                                   @ApiParam(value = "鎶ュ憡寮�濮嬫椂闂�") @RequestParam(required = false) Date bgbeginTime,
-                                   @ApiParam(value = "鎶ュ憡缁撴潫鏃堕棿") @RequestParam(required = false) Date bgendTime) {
+    @GetMapping ("/getOrderList")
+    @ApiOperation (value = "鏌ヨ浣撴璁板綍鍒楄〃")
+    public AjaxResult getOrderList(@ApiParam (value = "椤电爜鏁�(榛樿1)") @RequestParam (defaultValue = "1") Integer pageNum,
+                                   @ApiParam (value = "鏄剧ず鏉℃暟(榛樿10)") @RequestParam (defaultValue = "10") Integer pageSize,
+                                   @ApiParam (value = "浣撴鍙�)") @RequestParam (required = false) String tjNum,
+                                   @ApiParam (value = "濮撳悕)") @RequestParam (required = false) String name,
+                                   @ApiParam (value = "椤圭洰鍚�)") @RequestParam (required = false) String xmmc,
+                                   @ApiParam (value = "鐧昏寮�濮嬫椂闂�") @RequestParam (required = false) Date djbeginTime,
+                                   @ApiParam (value = "鐧昏缁撴潫鏃堕棿") @RequestParam (required = false) Date djendTime,
+                                   @ApiParam (value = "鎶ュ憡寮�濮嬫椂闂�") @RequestParam (required = false) Date bgbeginTime,
+                                   @ApiParam (value = "鎶ュ憡缁撴潫鏃堕棿") @RequestParam (required = false) Date bgendTime) {
         Map<String, Object> map = new HashMap<>();
         if (null != name) {
             LambdaQueryWrapper<TjCustomer> wqq = new LambdaQueryWrapper<>();
@@ -439,6 +460,12 @@
         if (null != tjNum) {
             wq.eq(TjOrder::getTjNumber, tjNum);
         }
+
+
+        if (null != xmmc) {
+            wq.in(TjOrder::getTjNumber, projectService.getTjNumLIstByXmmx(xmmc));
+        }
+
         wq.orderByDesc(TjOrder::getCreateTime);
         Page<TjOrder> page2 = tjOrderService.page(page1, wq);
         List<TjOrder> list = page2.getRecords();
@@ -450,7 +477,6 @@
                     order.setTjCustomerAge(DateUtil.ageOfNow(tjCustomer.getCusBrithday()));
                     order.setTjCustomerName(tjCustomer.getCusName());
                     order.setTjCustomerPhone(tjCustomer.getCusPhone());
-//                    order.setTjCusIdCard(MatchUtils.hideIdCardNum(tjCustomer.getCusIdcard()));
                     order.setTjCusIdCard(tjCustomer.getCusIdcard());
                     order.setCareer(tjCustomer.getCareer());
                     order.setIdType(tjCustomer.getIdType());
@@ -464,7 +490,7 @@
                 if (null != order.getPacId()) {
                     if (null != tjPackageService.getById(order.getPacId())) {
                         order.setPacName(tjPackageService.getById(order.getPacId()).getPacName());
-                    }
+                    }else
                     if (null != dwDeptService.getById(order.getPacId())) {
                         order.setPacName(dwDeptService.getById(order.getPacId()).getDwDeptName());
                     }
@@ -477,14 +503,14 @@
     }
 
 
-    @GetMapping("/getOrderListOO")
-    @ApiOperation(value = "浣撴鎶ュ憡椤甸潰鈥斺�斾綋妫�璁板綍鍒楄〃")
-    public AjaxResult getOrderListOO(@ApiParam(value = "椤电爜鏁�(榛樿1)") @RequestParam(defaultValue = "1") Integer pageNum,
-                                     @ApiParam(value = "鏄剧ず鏉℃暟(榛樿10)") @RequestParam(defaultValue = "10") Integer pageSize,
-                                     @ApiParam(value = "浣撴鍙�)") @RequestParam(required = false) String tjNum,
-                                     @ApiParam(value = "濮撳悕)") @RequestParam(required = false) String name,
-                                     @ApiParam(value = "鎶ュ憡寮�濮嬫椂闂�") @RequestParam(required = false) Date bgbeginTime,
-                                     @ApiParam(value = "鎶ュ憡缁撴潫鏃堕棿") @RequestParam(required = false) Date bgendTime) {
+    @GetMapping ("/getOrderListOO")
+    @ApiOperation (value = "浣撴鎶ュ憡椤甸潰鈥斺�斾綋妫�璁板綍鍒楄〃")
+    public AjaxResult getOrderListOO(@ApiParam (value = "椤电爜鏁�(榛樿1)") @RequestParam (defaultValue = "1") Integer pageNum,
+                                     @ApiParam (value = "鏄剧ず鏉℃暟(榛樿10)") @RequestParam (defaultValue = "10") Integer pageSize,
+                                     @ApiParam (value = "浣撴鍙�)") @RequestParam (required = false) String tjNum,
+                                     @ApiParam (value = "濮撳悕)") @RequestParam (required = false) String name,
+                                     @ApiParam (value = "鎶ュ憡寮�濮嬫椂闂�") @RequestParam (required = false) Date bgbeginTime,
+                                     @ApiParam (value = "鎶ュ憡缁撴潫鏃堕棿") @RequestParam (required = false) Date bgendTime) {
         Map<String, Object> map = new HashMap<>();
         if (null != name) {
             LambdaQueryWrapper<TjCustomer> wqq = new LambdaQueryWrapper<>();
@@ -606,15 +632,15 @@
     }
 
 
-    @GetMapping("/getPrintOrderList")
-    @ApiOperation(value = "浣撴鍙戠エ鎵撳嵃鎺ュ彛")
-    public AjaxResult getPrintOrderList(@ApiParam(value = "椤电爜鏁�(榛樿1)") @RequestParam(defaultValue = "1") Integer pageNum,
-                                        @ApiParam(value = "鏄剧ず鏉℃暟(榛樿10)") @RequestParam(defaultValue = "10") Integer pageSize,
-                                        @ApiParam(value = "浣撴鍙�)") @RequestParam(required = false) String tjNum,
-                                        @ApiParam(value = "宸叉墦鍗版湭鎵撳嵃0鏈墦鍗�1宸叉墦鍗�)") @RequestParam(required = false) Integer type,
-                                        @ApiParam(value = "濮撳悕") @RequestParam(required = false) String name,
-                                        @ApiParam(value = "鎶ュ憡寮�濮嬫椂闂�") @RequestParam(required = false) Date bgbeginTime,
-                                        @ApiParam(value = "鎶ュ憡缁撴潫鏃堕棿") @RequestParam(required = false) Date bgendTime) {
+    @GetMapping ("/getPrintOrderList")
+    @ApiOperation (value = "浣撴鍙戠エ鎵撳嵃鎺ュ彛")
+    public AjaxResult getPrintOrderList(@ApiParam (value = "椤电爜鏁�(榛樿1)") @RequestParam (defaultValue = "1") Integer pageNum,
+                                        @ApiParam (value = "鏄剧ず鏉℃暟(榛樿10)") @RequestParam (defaultValue = "10") Integer pageSize,
+                                        @ApiParam (value = "浣撴鍙�)") @RequestParam (required = false) String tjNum,
+                                        @ApiParam (value = "宸叉墦鍗版湭鎵撳嵃0鏈墦鍗�1宸叉墦鍗�)") @RequestParam (required = false) Integer type,
+                                        @ApiParam (value = "濮撳悕") @RequestParam (required = false) String name,
+                                        @ApiParam (value = "鎶ュ憡寮�濮嬫椂闂�") @RequestParam (required = false) Date bgbeginTime,
+                                        @ApiParam (value = "鎶ュ憡缁撴潫鏃堕棿") @RequestParam (required = false) Date bgendTime) {
         Map<String, Object> map = new HashMap<>();
         List<TjOrder> collect = null;
         if (null != name) {
@@ -805,9 +831,9 @@
      * 瀵煎嚭浣撴璁板綍鍒楄〃
      */
 //    @PreAuthorize("@ss.hasPermi('hosp:order:export')")
-    @Log(title = "浣撴璁板綍", businessType = BusinessType.EXPORT)
-    @PostMapping("/export")
-    @ApiOperation(value = "瀵煎嚭浣撴璁板綍鍒楄〃")
+    @Log (title = "浣撴璁板綍", businessType = BusinessType.EXPORT)
+    @PostMapping ("/export")
+    @ApiOperation (value = "瀵煎嚭浣撴璁板綍鍒楄〃")
     public void export(HttpServletResponse response, TjOrder tjOrder) {
         //List<TjOrder> list = tjOrderService.selectTjOrderList(tjOrder);
         List<TjOrder> list = tjOrderService.selectExportOrderList(tjOrder);
@@ -819,15 +845,15 @@
      * 鑾峰彇浣撴璁板綍璇︾粏淇℃伅
      */
 //    @PreAuthorize("@ss.hasPermi('hosp:order:query')")
-    @GetMapping(value = "/{orderId}")
-    @ApiOperation(value = "鑾峰彇浣撴璁板綍璇︾粏淇℃伅")
-    public AjaxResult getInfo(@PathVariable("orderId") Long orderId) {
+    @GetMapping (value = "/{orderId}")
+    @ApiOperation (value = "鑾峰彇浣撴璁板綍璇︾粏淇℃伅")
+    public AjaxResult getInfo(@PathVariable ("orderId") Long orderId) {
         return success(tjOrderService.selectTjOrderByOrderId(orderId));
     }
 
 
-    @GetMapping("/getIsRequired")
-    @ApiOperation(value = "鏍规嵁鍙傛暟閰嶇疆鑾峰彇鏄惁蹇呭~椤癸紙韬唤璇併�佹�у埆銆佺數璇濄�佺収鐗囥�佹槸鍚︾洿鎺ヤ笅鍗曪級")
+    @GetMapping ("/getIsRequired")
+    @ApiOperation (value = "鏍规嵁鍙傛暟閰嶇疆鑾峰彇鏄惁蹇呭~椤癸紙韬唤璇併�佹�у埆銆佺數璇濄�佺収鐗囥�佹槸鍚︾洿鎺ヤ笅鍗曪級")
     public AjaxResult getIsRequired() {
         Map<String, String> res = new HashMap<>();
         res.put("has_idcard", configService.selectConfigByKey("has_idcard"));
@@ -843,7 +869,7 @@
      * 浣撴绛惧埌鐧昏鎺ュ彛
      */
     @PostMapping
-    @ApiOperation(value = "浣撴绛惧埌鐧昏鎺ュ彛")
+    @ApiOperation (value = "浣撴绛惧埌鐧昏鎺ュ彛")
     @Transactional  //(鍒囨崲鏁版嵁搴撳嚭閿欙紝鎵�浠ユ敞閲�)
     public AjaxResult addOrderAndDetail(@RequestBody TjOrder tjOrder) throws Exception {
         Long userId = Long.valueOf(SecurityUtils.getLoginUser().getUserId());
@@ -876,9 +902,9 @@
         if (null != tjReservation) {
             tjOrder.setReservationId(tjReservation.getId());
             mallOrder = mallOrderService.getOne(new LambdaQueryWrapper<MallOrder>().eq(MallOrder::getReservationId, tjReservation.getId()));
-            if (DateUtil.endOfDay(new Date()).before(tjReservation.getReservationTime())) {
-                return AjaxResult.error("鏈埌棰勭害鏃堕棿");
-            }
+//            if (DateUtil.endOfDay(new Date()).before(tjReservation.getReservationTime())) {
+//                return AjaxResult.error("鏈埌棰勭害鏃堕棿");
+//            }
             if (DateUtil.endOfDay(tjReservation.getReservationTime()).before(new Date())) {
                 tjReservation.setIsExpire(1);
                 tjReservationService.updateById(tjReservation);
@@ -928,7 +954,7 @@
         if (null != mallOrder) tjOrder.setMallOrderId(String.valueOf(mallOrder.getId()));
         tjOrder.setStatus(TjConstants.TJ_BEGIN);
         tjOrder.setCardId(tjCustomer.getCardId());
-        if(null !=tjOrder.getTjCategory() && tjOrder.getTjCategory().equals("13")){
+        if (null != tjOrder.getTjCategory() && tjOrder.getTjCategory().equals("13")) {
             tjOrder.setFinishTime(new Date());
             tjOrder.setCheckStatus(1);
             tjOrder.setStatus(TjConstants.TJ_WAIT);
@@ -946,7 +972,7 @@
             Long cusNumber = tjCustomer.getCusNumber();
             cusNumber += 1;
             tjCustomer.setCusNumber(cusNumber);
-            BigDecimal discount = BigDecimal.valueOf(Double.parseDouble(tjOrder.getTjFlowingWater().getDiscount())).divide(BigDecimal.valueOf(10));
+            BigDecimal discount = BigDecimal.valueOf(Double.parseDouble(tjOrder.getTjFlowingWater().getDiscount()));
             TjFlowingWater tjFlowingWater = new TjFlowingWater();
             tjFlowingWater.setPayStasus(0L);
             if ("1".equals(tjOrder.getTjType())) {
@@ -1050,6 +1076,10 @@
                 AjaxResult result = hisApiMethod.HisApiMethods(tjCustomer, tjOrder.getOrderId());
                 if (!result.get("code").toString().equals("200")) {
                     TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+                    Object jzh = result.get("jzh");
+                    if(null !=jzh && null !=jzh.toString()){
+                        hisApiMethod.ZfHisApiMethod(jzh.toString());
+                    }
                     return AjaxResult.error("鎸傚彿澶辫触!" + result.get("msg").toString());
                 }
             } else {
@@ -1065,8 +1095,8 @@
     }
 
 
-    @PostMapping("/addPlOrderAndDetail")
-    @ApiOperation(value = "浣撴鎵归噺绛惧埌鐧昏鎺ュ彛")
+    @PostMapping ("/addPlOrderAndDetail")
+    @ApiOperation (value = "浣撴鎵归噺绛惧埌鐧昏鎺ュ彛")
     @Transactional  //(鍒囨崲鏁版嵁搴撳嚭閿欙紝鎵�浠ユ敞閲�)
     public AjaxResult addPlOrderAndDetail(@RequestBody QianDaoDto daoDto, HttpServletResponse response) {
         SysUser sysUser = UserHoder.getLoginUser().getUser();
@@ -1464,9 +1494,9 @@
      * 淇敼浣撴璁板綍
      */
 //    @PreAuthorize("@ss.hasPermi('hosp:order:edit')")
-    @Log(title = "浣撴璁板綍", businessType = BusinessType.UPDATE)
+    @Log (title = "浣撴璁板綍", businessType = BusinessType.UPDATE)
     @PutMapping
-    @ApiOperation(value = "淇敼浣撴璁板綍")
+    @ApiOperation (value = "淇敼浣撴璁板綍")
     public AjaxResult edit(@RequestBody TjOrder tjOrder) {
         return toAjax(tjOrderService.updateTjOrder(tjOrder));
     }
@@ -1475,16 +1505,16 @@
      * 鍒犻櫎浣撴璁板綍
      */
 //    @PreAuthorize("@ss.hasPermi('hosp:order:remove')")
-    @Log(title = "浣撴璁板綍", businessType = BusinessType.DELETE)
-    @DeleteMapping("/{orderIds}")
-    @ApiOperation(value = "鍒犻櫎浣撴璁板綍")
+    @Log (title = "浣撴璁板綍", businessType = BusinessType.DELETE)
+    @DeleteMapping ("/{orderIds}")
+    @ApiOperation (value = "鍒犻櫎浣撴璁板綍")
     public AjaxResult remove(@PathVariable Long[] orderIds) {
         return toAjax(tjOrderService.deleteTjOrderByOrderIds(orderIds));
     }
 
-    @GetMapping("/getOrderDetailByTjNumber")
-    @ApiOperation(value = "鏍规嵁浣撴鍙疯幏鍙栦綋妫�璇︽儏")
-    public AjaxResult getOrderDetailByTjNumber(@RequestParam @ApiParam(value = "浣撴鍙�") String tjNumber) {
+    @GetMapping ("/getOrderDetailByTjNumber")
+    @ApiOperation (value = "鏍规嵁浣撴鍙疯幏鍙栦綋妫�璇︽儏")
+    public AjaxResult getOrderDetailByTjNumber(@RequestParam @ApiParam (value = "浣撴鍙�") String tjNumber) {
         LambdaQueryWrapper<TjOrder> wq0 = new LambdaQueryWrapper<>();
         wq0.eq(TjOrder::getTjNumber, tjNumber);
         TjOrder tjOrder = tjOrderService.getOne(wq0);
@@ -1504,8 +1534,8 @@
         return AjaxResult.success("鏆傛棤鏁版嵁");
     }
 
-    @PostMapping("/addtTransition")
-    @ApiOperation(value = "娣诲姞杩囨浮琛ㄦ暟鎹�")
+    @PostMapping ("/addtTransition")
+    @ApiOperation (value = "娣诲姞杩囨浮琛ㄦ暟鎹�")
     @Transactional
     public AjaxResult addtTransition(@RequestBody Map<String, Object> map) {
         Object packId = map.get("pacId");
@@ -1551,7 +1581,7 @@
 //                }
                 List<TjPackageProject> ppList = tjPackageProjectService.getTjPackageProjectListByPacId(String.valueOf(pacId));
                 if (null != ppList && ppList.size() > 0) {
-                    transitionService.saveRedisTransitionByPacId(cusId,cardId ,pacId);
+                    transitionService.saveRedisTransitionByPacId(cusId, cardId, pacId);
                     //寮傛淇濆瓨鏁版嵁搴�
 //                    asyncService.addRedisTransitionPac(cusId, pacId, ppList);
 //                    asyncService.saveRedisTransitionByPacId(cusId, cardId, pacId, null);
@@ -1602,10 +1632,10 @@
 //            asyncService.saveRedisTransitionByPacId(cusId, cardId, null, proIds);
             for (Long proId : proIds) {
                 TjProject project = projectService.selectTjProjectByProId(proId);
-                if(null !=project){ //&& (!project.getProName().contains("闈欒剦閲囪")|| !project.getProName().contains("璐�"))
+                if (null != project) { //&& (!project.getProName().contains("闈欒剦閲囪")|| !project.getProName().contains("璐�"))
                     List<TbTransition> transitionList = transitionService.getTbTransitionListByCusIdAndPacIdAndProId(cusId, String.valueOf(proId));
                     if (null == transitionList || transitionList.size() == 0) {
-                        transitionService.saveRedisTransitionByProId(cusId,cardId, proId);
+                        transitionService.saveRedisTransitionByProId(cusId, cardId, proId);
                     }
                 }
 //            if(null !=project) transitionService.saveRedisTransitionByProId(cusId,cardId, proId);
@@ -1671,9 +1701,9 @@
     }
 
 
-    @GetMapping("/getTransitionList")
-    @ApiOperation(value = "鏌ヨ杩囨浮琛ㄦ暟鎹�")
-    public AjaxResult getTransitionList(@RequestParam @ApiParam(value = "瀹㈡埛id") String cusId) {
+    @GetMapping ("/getTransitionList")
+    @ApiOperation (value = "鏌ヨ杩囨浮琛ㄦ暟鎹�")
+    public AjaxResult getTransitionList(@RequestParam @ApiParam (value = "瀹㈡埛id") String cusId) {
         if (redisCache.hasKey(cusId + "cusId")) {
             List<Map<String, Object>> list = redisCache.getCacheMapValue(cusId + "cusId", cusId);
             return AjaxResult.success(list);
@@ -1688,16 +1718,16 @@
     }
 
 
-    @GetMapping("/getQianLiList")
-    @ApiOperation(value = "鏌ヨ浣撴璁板綍鍒楄〃")
-    public AjaxResult getQianLiList(@ApiParam(value = "椤电爜鏁�(榛樿1)") @RequestParam(defaultValue = "1") Integer pageNum,
-                                    @ApiParam(value = "鏄剧ず鏉℃暟(榛樿10)") @RequestParam(defaultValue = "10") Integer pageSize,
-                                    @ApiParam(value = "浣撴鍙�") @RequestParam(required = false) String tjNum,
-                                    @ApiParam(value = "濮撳悕") @RequestParam(required = false) String name,
-                                    @ApiParam(value = "鐧昏寮�濮嬫椂闂�") @RequestParam(required = false) Date djbeginTime,
-                                    @ApiParam(value = "鐧昏缁撴潫鏃堕棿") @RequestParam(required = false) Date djendTime,
-                                    @ApiParam(value = "鎶ュ憡寮�濮嬫椂闂�") @RequestParam(required = false) Date bgbeginTime,
-                                    @ApiParam(value = "鎶ュ憡缁撴潫鏃堕棿") @RequestParam(required = false) Date bgendTime) {
+    @GetMapping ("/getQianLiList")
+    @ApiOperation (value = "鏌ヨ浣撴璁板綍鍒楄〃")
+    public AjaxResult getQianLiList(@ApiParam (value = "椤电爜鏁�(榛樿1)") @RequestParam (defaultValue = "1") Integer pageNum,
+                                    @ApiParam (value = "鏄剧ず鏉℃暟(榛樿10)") @RequestParam (defaultValue = "10") Integer pageSize,
+                                    @ApiParam (value = "浣撴鍙�") @RequestParam (required = false) String tjNum,
+                                    @ApiParam (value = "濮撳悕") @RequestParam (required = false) String name,
+                                    @ApiParam (value = "鐧昏寮�濮嬫椂闂�") @RequestParam (required = false) Date djbeginTime,
+                                    @ApiParam (value = "鐧昏缁撴潫鏃堕棿") @RequestParam (required = false) Date djendTime,
+                                    @ApiParam (value = "鎶ュ憡寮�濮嬫椂闂�") @RequestParam (required = false) Date bgbeginTime,
+                                    @ApiParam (value = "鎶ュ憡缁撴潫鏃堕棿") @RequestParam (required = false) Date bgendTime) {
         Map<String, Object> map = new HashMap<>();
         if (null != name) {
             LambdaQueryWrapper<TjCustomer> wqq = new LambdaQueryWrapper<>();
@@ -1806,9 +1836,9 @@
     /**
      * 绛剧寮冩纭杩斿洖鏁版嵁
      */
-    @GetMapping("/abandon")
-    @ApiOperation(value = "绛剧寮冩纭杩斿洖鏁版嵁")
-    public AjaxResult abandon(@RequestParam @ApiParam(value = "浣撴鍙�") String tjNumber) {
+    @GetMapping ("/abandon")
+    @ApiOperation (value = "绛剧寮冩纭杩斿洖鏁版嵁")
+    public AjaxResult abandon(@RequestParam @ApiParam (value = "浣撴鍙�") String tjNumber) {
         LambdaQueryWrapper<TjOrderRemark> wq = new LambdaQueryWrapper<>();
         wq.eq(TjOrderRemark::getTjNumber, tjNumber);
         List<TjOrderRemark> remarkList = remarkService.list(wq);
@@ -1833,8 +1863,8 @@
      *
      * @ApiParam(value = "浣撴鍙�") String tjNumber
      */
-    @PostMapping("/tjGoOut")
-    @ApiOperation(value = "浣撴绛剧")
+    @PostMapping ("/tjGoOut")
+    @ApiOperation (value = "浣撴绛剧")
     @Transactional
     public AjaxResult tjGoOut(@RequestBody Map<String, Object> map) {
         Long userId = Long.valueOf(SecurityUtils.getLoginUser().getUserId());
@@ -1870,7 +1900,7 @@
             TjCustomer customer = tjCustomerService.selectTjCustomerByCusId(tjOrder.getUserId());
             customer.setCardId("0");
             tjCustomerService.updateById(customer);
-            String config = configService.selectConfigByKey("sfkqdyhis");
+          /*  String config = configService.selectConfigByKey("sfkqdyhis");
             if(null !=config && config.equals("Y")){
                 final String date = DateUtil.format(tjOrder.getCreateTime(), "yyyy-MM-dd HH:mm:ss");
                 OutpinimpapplyDto dto=new OutpinimpapplyDto();
@@ -1898,7 +1928,7 @@
                 dto.setSfqj("0");
                 dto.setJzqk(9);
                 controller.Outpinimpapply(dto);
-            }
+            }*/
 
             return AjaxResult.success("绛剧鎴愬姛锛�");
         } else {
@@ -1910,10 +1940,10 @@
     /**
      * 绛剧
      */
-    @GetMapping("/goOut")
-    @ApiOperation(value = "绛剧")
+    @GetMapping ("/goOut")
+    @ApiOperation (value = "绛剧")
     @Transactional
-    public AjaxResult goOut(@RequestParam @ApiParam(value = "浣撴鍙�") String tjNumber) {
+    public AjaxResult goOut(@RequestParam @ApiParam (value = "浣撴鍙�") String tjNumber) {
         return getAjaxResult(tjNumber);
     }
 
@@ -1921,9 +1951,9 @@
     /**
      * 鏍搁攢璁㈠崟鎺ュ彛
      */
-    @GetMapping("/orderShip")
-    @ApiOperation(value = "PC绔墜鍔ㄦ牳閿�璁㈠崟鎺ュ彛")
-    public AjaxResult orderShip(@RequestParam @ApiParam(value = "浣撴鍙�") String tjNum) {
+    @GetMapping ("/orderShip")
+    @ApiOperation (value = "PC绔墜鍔ㄦ牳閿�璁㈠崟鎺ュ彛")
+    public AjaxResult orderShip(@RequestParam @ApiParam (value = "浣撴鍙�") String tjNum) {
         if (tjNum == null) {
             return AjaxResult.error();
         }
@@ -1974,7 +2004,7 @@
             map.put("proPrantId", entry.getKey().toString());
             if (null != pacId) {
                 TjPackage aPackage = tjPackageService.getById(entry.getValue().get(0).getPacId());
-                map.put("tjCategory",aPackage.getTjCategory());
+                map.put("tjCategory", aPackage.getTjCategory());
                 map.put("pacName", aPackage.getPacName());
                 TjProject tjProject = projectService.getById(entry.getKey());
 //                TjPackageProject project = tjPackageProjectService.getOne(new LambdaQueryWrapper<TjPackageProject>().eq(TjPackageProject::getPacId, pacId)
@@ -1987,7 +2017,7 @@
 //                }
                 map.put("nowPrice", transitionService.getTbTransitionDxPriceByPac(cusId, entry.getKey(), cardId, pacId));
             } else {
-                map.put("tjCategory",null);
+                map.put("tjCategory", null);
                 map.put("pacName", "鍗曢」");
                 List<TbTransition> tbTransitionList = entry.getValue();
                 if (null != tbTransitionList && tbTransitionList.size() > 0) {
@@ -2026,7 +2056,7 @@
             map.put("proPrantId", entry.getKey().toString());
             if (null != pacId) {
                 TjPackage aPackage = tjPackageService.getById(entry.getValue().get(0).getPacId());
-                map.put("tjCategory",aPackage.getTjCategory());
+                map.put("tjCategory", aPackage.getTjCategory());
                 map.put("pacName", aPackage.getPacName());
                 TjProject tjProject = projectService.getById(entry.getKey());
 //                TjPackageProject project = tjPackageProjectService.getOne(new LambdaQueryWrapper<TjPackageProject>().eq(TjPackageProject::getPacId, pacId)
@@ -2037,9 +2067,9 @@
 //                } else {
 //                    map.put("nowPrice", tjProject.getProPrice());
 //                }
-                map.put("nowPrice",tjProject.getProPrice());
+                map.put("nowPrice", tjProject.getProPrice());
             } else {
-                map.put("tjCategory",null);
+                map.put("tjCategory", null);
                 map.put("pacName", "鍗曢」");
                 List<TbTransition> tbTransitionList = entry.getValue();
                 if (null != tbTransitionList && tbTransitionList.size() > 0) {
@@ -2090,15 +2120,15 @@
     }
 
 
-    @GetMapping("/tuanTiListById")
-    @ApiOperation(value = "鏌ヨ鍥綋浣撴鐘舵��")
-    public AjaxResult tuanTiListById(@ApiParam(value = "椤电爜鏁�(榛樿1)") @RequestParam(defaultValue = "1") Integer pageNum,
-                                     @ApiParam(value = "鏄剧ず鏉℃暟(榛樿10)") @RequestParam(defaultValue = "10") Integer pageSize,
-                                     @ApiParam(value = "鍗曚綅") @RequestParam String firmId,
-                                     @ApiParam(value = "閮ㄩ棬") @RequestParam(required = false) String dwDeptId,
-                                     @ApiParam(value = "鍒嗙粍") @RequestParam(required = false) String groupId,
-                                     @ApiParam(value = "鐧昏寮�濮嬫椂闂�") @RequestParam Date beginTime,
-                                     @ApiParam(value = "鐧昏缁撴潫鏃堕棿") @RequestParam Date endTime) {
+    @GetMapping ("/tuanTiListById")
+    @ApiOperation (value = "鏌ヨ鍥綋浣撴鐘舵��")
+    public AjaxResult tuanTiListById(@ApiParam (value = "椤电爜鏁�(榛樿1)") @RequestParam (defaultValue = "1") Integer pageNum,
+                                     @ApiParam (value = "鏄剧ず鏉℃暟(榛樿10)") @RequestParam (defaultValue = "10") Integer pageSize,
+                                     @ApiParam (value = "鍗曚綅") @RequestParam String firmId,
+                                     @ApiParam (value = "閮ㄩ棬") @RequestParam (required = false) String dwDeptId,
+                                     @ApiParam (value = "鍒嗙粍") @RequestParam (required = false) String groupId,
+                                     @ApiParam (value = "鐧昏寮�濮嬫椂闂�") @RequestParam Date beginTime,
+                                     @ApiParam (value = "鐧昏缁撴潫鏃堕棿") @RequestParam Date endTime) {
         Map<String, Object> map = new HashMap<>();
         int a = 0;
         int b = 0;
@@ -2163,11 +2193,11 @@
     }
 
 
-    @GetMapping("/tuanTiBingById")
-    @ApiOperation(value = "鏌ヨ鍥綋浣撴鐥呯璇︾粏淇℃伅")
-    public AjaxResult tuanTiBingById(@ApiParam(value = "鍗曚綅") @RequestParam String firmId,
-                                     @ApiParam(value = "閮ㄩ棬") @RequestParam String firmDeptId,
-                                     @ApiParam(value = "鐥呯") @RequestParam(required = false) String bingZhong) {
+    @GetMapping ("/tuanTiBingById")
+    @ApiOperation (value = "鏌ヨ鍥綋浣撴鐥呯璇︾粏淇℃伅")
+    public AjaxResult tuanTiBingById(@ApiParam (value = "鍗曚綅") @RequestParam String firmId,
+                                     @ApiParam (value = "閮ㄩ棬") @RequestParam String firmDeptId,
+                                     @ApiParam (value = "鐥呯") @RequestParam (required = false) String bingZhong) {
         List<TjOrderDetailRules> res1 = new ArrayList<>();
         List<BingZhongVO> res = new ArrayList<>();
 
@@ -2226,8 +2256,8 @@
     }
 
 
-    @PostMapping("/tuanTiBingChart")
-    @ApiOperation(value = "鏌ヨ鍥綋浣撴鐥呯缁熻鍥�")
+    @PostMapping ("/tuanTiBingChart")
+    @ApiOperation (value = "鏌ヨ鍥綋浣撴鐥呯缁熻鍥�")
     public AjaxResult tuanTiBingChart(@RequestBody BingZhongVO bingZhongVO) {
         List<TjOrderDetailRules> res1 = new ArrayList<>();
 
@@ -2266,90 +2296,90 @@
     }
 
 
-    @PostMapping("/deletedTbTransitionByCusId")
-    @ApiOperation(value = "鏍规嵁韬唤璇佸彿鍒犻櫎涓存椂琛ㄦ暟鎹�")
-    public AjaxResult deletedTbTransitionByCusId(@RequestParam @ApiParam(value = "韬唤璇佸彿") String cusId) {
+    @PostMapping ("/deletedTbTransitionByCusId")
+    @ApiOperation (value = "鏍规嵁韬唤璇佸彿鍒犻櫎涓存椂琛ㄦ暟鎹�")
+    public AjaxResult deletedTbTransitionByCusId(@RequestParam @ApiParam (value = "韬唤璇佸彿") String cusId) {
         LambdaQueryWrapper<TbTransition> wq = new LambdaQueryWrapper<>();
         wq.between(TbTransition::getCreateTime, transitionService.getTbTransitionCreateTimeByCusId(cusId), new Date());
         wq.eq(TbTransition::getCusId, cusId);
         return AjaxResult.success(transitionService.remove(wq));
     }
 
-    @GetMapping("/getTransitionInfo")
-    @ApiOperation(value = "鏍规嵁浣撴鍙疯幏鍙栨眹鎬诲拰鏄庣粏鐨勬暟鎹�")
-    public AjaxResult getTransitionInfo(@RequestParam("tjNumber")String tjNumber){
+    @GetMapping ("/getTransitionInfo")
+    @ApiOperation (value = "鏍规嵁浣撴鍙疯幏鍙栨眹鎬诲拰鏄庣粏鐨勬暟鎹�")
+    public AjaxResult getTransitionInfo(@RequestParam ("tjNumber") String tjNumber) {
         QueryWrapper<TbTransition> wrapper = new QueryWrapper<>();
-        wrapper.select("parent_pro_id","parent_pro_name","sum(ord_price) as ord_price")
-                .eq("tj_num",tjNumber)
+        wrapper.select("parent_pro_id", "parent_pro_name", "sum(ord_price) as ord_price")
+                .eq("tj_num", tjNumber)
                 .groupBy("parent_pro_name");
         List<TbTransition> list = transitionService.list(wrapper);
         List<Long> parentProIds = list.stream().map(item -> item.getParentProId()).collect(Collectors.toList());
         LambdaQueryWrapper<TjProject> projectQueryWrapper = new LambdaQueryWrapper<>();
-        projectQueryWrapper.in(TjProject::getProId,parentProIds);
+        projectQueryWrapper.in(TjProject::getProId, parentProIds);
         List<TjProject> projects = projectService.list(projectQueryWrapper);
         JSONArray huiZong = JSONUtil.createArray();
         int index = 1;
         for (TjProject project : projects) {
             LambdaQueryWrapper<SysDept> queryWrapper = new LambdaQueryWrapper<>();
-            queryWrapper.eq(SysDept::getDeptId,project.getDeptId());
+            queryWrapper.eq(SysDept::getDeptId, project.getDeptId());
             SysDept dept = sysDeptService.getOne(queryWrapper);
             for (TbTransition tbTransition : list) {
-                if (tbTransition.getParentProId().toString().equals(project.getProId().toString())){
+                if (tbTransition.getParentProId().toString().equals(project.getProId().toString())) {
                     JSONObject obj = JSONUtil.createObj();
-                    obj.putOpt("index",index++);
-                    obj.putOpt("parent_pro_name",tbTransition.getParentProName());
-                    obj.putOpt("price",tbTransition.getOrdPrice());
-                    obj.putOpt("ks",dept.getDeptName());
+                    obj.putOpt("index", index++);
+                    obj.putOpt("parent_pro_name", tbTransition.getParentProName());
+                    obj.putOpt("price", tbTransition.getOrdPrice());
+                    obj.putOpt("ks", dept.getDeptName());
                     huiZong.add(obj);
                 }
             }
         }
         wrapper = new QueryWrapper<>();
-        wrapper.eq("tj_num",tjNumber);
+        wrapper.eq("tj_num", tjNumber);
         list = transitionService.list(wrapper);
         JSONArray info = JSONUtil.createArray();
         index = 1;
         for (TbTransition tbTransition : list) {
             JSONObject obj = JSONUtil.createObj();
-            obj.putOpt("index",index++);
-            obj.putOpt("parent_pro_name",tbTransition.getParentProName());
-            obj.putOpt("pro_name",tbTransition.getProName());
+            obj.putOpt("index", index++);
+            obj.putOpt("parent_pro_name", tbTransition.getParentProName());
+            obj.putOpt("pro_name", tbTransition.getProName());
             BigDecimal ordPrice = tbTransition.getOrdPrice();
-            obj.putOpt("zongjia",ordPrice);
+            obj.putOpt("zongjia", ordPrice);
             QueryWrapper<TjProject> queryWrapper = new QueryWrapper<>();
-            queryWrapper.eq("pro_id",tbTransition.getProId());
+            queryWrapper.eq("pro_id", tbTransition.getProId());
             TjProject tjProject = projectService.getOne(queryWrapper);
             Integer num = tjProject.getSl();
-            obj.putOpt("num",num);
+            obj.putOpt("num", num);
             BigDecimal price = ordPrice.divide(new BigDecimal(num));
-            obj.putOpt("danjia",price);
+            obj.putOpt("danjia", price);
             Date createTime = tbTransition.getCreateTime();
             SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-            obj.putOpt("time",dateFormat.format(createTime));
+            obj.putOpt("time", dateFormat.format(createTime));
             info.put(obj);
         }
         HashMap<String, Object> map = new HashMap<>();
-        map.put("huizong",huiZong);
-        map.put("info",info);
-        return AjaxResult.success().put("data",map);
+        map.put("huizong", huiZong);
+        map.put("info", info);
+        return AjaxResult.success().put("data", map);
     }
 
     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()));
-         }else {
-             tjOrderDetailService.saveTjOrderDetailsByCusId(tjCustomer.getCusIdcard(), String.valueOf(tjOrder.getOrderId()), sysUser.getNickName(), String.valueOf(sysUser.getUserId()));
-         }
+        if (null != tjOrder.getTjCategory() && tjOrder.getTjCategory().equals("13")) {
+            tjOrderDetailService.saveJSYTjOrderDetailsByCusId(tjCustomer.getCusIdcard(), String.valueOf(tjOrder.getOrderId()), sysUser.getNickName(), String.valueOf(sysUser.getUserId()));
+        } else {
+            tjOrderDetailService.saveTjOrderDetailsByCusId(tjCustomer.getCusIdcard(), String.valueOf(tjOrder.getOrderId()), sysUser.getNickName(), String.valueOf(sysUser.getUserId()));
+        }
 
         tjOrderDetailService.saveTjPureToneTesByCusId(tjCustomer.getCusIdcard(), tjOrder.getTjNumber(), sysUser.getNickName(), String.valueOf(sysUser.getUserId()));
         //淇敼姣忛」鐨勫師浠风幇浠� //淇敼涓存椂琛ㄤ綋妫�鍙�
         transitionService.updateTbTransitionPriceByCusId(tjCustomer.getCusIdcard(), discount, tjOrder.getTjNumber());
         //娣诲姞remark琛ㄦ暟鎹�
-        if(null !=tjOrder.getTjCategory() && tjOrder.getTjCategory().equals("13")){
+        if (null != tjOrder.getTjCategory() && tjOrder.getTjCategory().equals("13")) {
             remarkService.saveJSYTjOrderRemarkByOrderId(tjOrder.getTjNumber(), sysUser.getNickName(), String.valueOf(sysUser.getUserId()), String.valueOf(tjOrder.getOrderId()));
 
-        }else {
+        } else {
             remarkService.saveTjOrderRemarkByOrderId(tjOrder.getTjNumber(), sysUser.getNickName(), String.valueOf(sysUser.getUserId()), String.valueOf(tjOrder.getOrderId()));
 
         }
@@ -2373,8 +2403,8 @@
     }
 
 
-    @PostMapping("/heXiaoByIds/{orderIds}")
-    @ApiOperation(value = "鏍告敹鎶ュ憡鈥斺�斺�斺�斺�斺�旀�绘瀹℃牳閫氳繃鍚庡彲浠ユ牳閿�锛屾牳鏀跺悗鎵嶈兘鎵撳嵃")
+    @PostMapping ("/heXiaoByIds/{orderIds}")
+    @ApiOperation (value = "鏍告敹鎶ュ憡鈥斺�斺�斺�斺�斺�旀�绘瀹℃牳閫氳繃鍚庡彲浠ユ牳閿�锛屾牳鏀跺悗鎵嶈兘鎵撳嵃")
     @Transactional
     public AjaxResult heXiaoByIds(@PathVariable String[] orderIds) {
         for (String orderId : orderIds) {
@@ -2390,8 +2420,8 @@
         return AjaxResult.success("鏍告敹鎴愬姛");
     }
 
-    @GetMapping("/getHistryTjOrderByCusIdCard")
-    @ApiOperation(value = "鏍规嵁韬唤璇佸彿鏌ョ湅鍘嗗彶浣撴璁板綍")
+    @GetMapping ("/getHistryTjOrderByCusIdCard")
+    @ApiOperation (value = "鏍规嵁韬唤璇佸彿鏌ョ湅鍘嗗彶浣撴璁板綍")
     @Transactional
     public AjaxResult getHistryTjOrderByCusIdCard(@RequestParam String cusIdCard) {
         TjCustomer tjCustomer = tjCustomerService.getTjCustomerByCusIdCard(cusIdCard);
@@ -2411,8 +2441,8 @@
     }
 
 
-    @GetMapping("/getHistryTjOrderProByCusIdCard")
-    @ApiOperation(value = "鏍规嵁韬唤璇佸彿鏌ョ湅鍘嗗彶浣撴椤圭洰璁板綍")
+    @GetMapping ("/getHistryTjOrderProByCusIdCard")
+    @ApiOperation (value = "鏍规嵁韬唤璇佸彿鏌ョ湅鍘嗗彶浣撴椤圭洰璁板綍")
     @Transactional
     public AjaxResult getHistryTjOrderProByCusIdCard(@RequestParam String cusIdCard) {
         TjCustomer tjCustomer = tjCustomerService.getTjCustomerByCusIdCard(cusIdCard);
@@ -2471,8 +2501,8 @@
     }
 
 
-    @GetMapping("/getHistryTjOrderByCusId")
-    @ApiOperation(value = "鏍规嵁瀹㈡埛id鏌ョ湅鍘嗗彶浣撴璁板綍")
+    @GetMapping ("/getHistryTjOrderByCusId")
+    @ApiOperation (value = "鏍规嵁瀹㈡埛id鏌ョ湅鍘嗗彶浣撴璁板綍")
     @Transactional
     public AjaxResult getHistryTjOrderByCusId(@RequestParam String cusId) {
         TjCustomer tjCustomer = tjCustomerService.getById(cusId);
@@ -2506,10 +2536,10 @@
     }
 
 
-    @GetMapping("/revokeTjOrderByTjNum")
-    @ApiOperation(value = "鏍规嵁瀹㈡埛浣撴鍙锋挙閿�浣撴璁板綍")
+    @GetMapping ("/revokeTjOrderByTjNum")
+    @ApiOperation (value = "鏍规嵁瀹㈡埛浣撴鍙锋挙閿�浣撴璁板綍")
     @Transactional
-    public AjaxResult revokeTjOrderByTjNum(@RequestParam @ApiParam(value = "浣撴鍙�") String tjNum) {
+    public AjaxResult revokeTjOrderByTjNum(@RequestParam @ApiParam (value = "浣撴鍙�") String tjNum) {
 
         TjOrder order = tjOrderService.getOrderByTjNum(tjNum);
         if (null != order) {
@@ -2524,53 +2554,50 @@
             transitionService.deletedTbTransitionByTjNum(tjNum);
 
             TjCustomer customer = tjCustomerService.getById(order.getUserId());
-            if (null != customer) {
-                customer.setCardId("0");
-                tjCustomerService.updateById(customer);
-            }
+            customer.setCardId("0");
+            tjCustomerService.updateById(customer);
             String configByKey = configService.selectConfigByKey("sfkqdyhis");
             if (configByKey.equals("Y")) {
-                HashMap<String, Object> map = new HashMap<>();
-                map.put("cardtype", "4");
-                map.put("input", order.getCardId());
-                LocalDate currentDate = LocalDate.now();
-                LocalDateTime startOfDay = currentDate.atStartOfDay();
-                LocalDateTime nineteenOClock = currentDate.atTime(LocalTime.of(19, 0));
-                DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
-                String ksrq = startOfDay.format(formatter);
-                String jsrq = nineteenOClock.format(formatter);
-                map.put("ksrq", ksrq);
-                map.put("jsrq", jsrq);
-                AjaxResult result = hisApiGetMethodService.getHISDataNew("Getoutpatientcostinfo", map);
-                if (Integer.parseInt(String.valueOf(result.get("code"))) == 200) {
-                    TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
-                    return AjaxResult.error("鎾ら攢澶辫触,闂ㄨ瘖鎮h�呰垂鐢ㄦ竻鍗曚俊鎭笉涓虹┖");
-                } else {
-                    boolean zfHisApiMethods = hisApiMethod.ZfHisApiMethods(null, order);
-                    if (zfHisApiMethods) {
-                        return AjaxResult.success("鎾ら攢鎴愬姛", map);
-                    } else {
+
+                HashMap<String, Object> hisRequestParams = new HashMap<>();
+                hisRequestParams.put("patientId", order.getCardId());
+                AjaxResult queryPay = hisApiGetMethodService.getHISDataNew("QueryPay", hisRequestParams);
+                if (Integer.parseInt(queryPay.get("code").toString()) == 200) {
+                    List<Map<String, String>> data = (List<Map<String, String>>) queryPay.get("data");
+
+                    BigDecimal cateFeeAll = BigDecimal.ZERO;
+                    for (Map<String, String> datum : data) {
+                        BigDecimal cateFee = new BigDecimal(datum.get("CateFee"));
+                        cateFeeAll = cateFeeAll.add(cateFee);
+                    }
+                    if (cateFeeAll.compareTo(BigDecimal.ZERO) != 0) {
                         TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
-                        return AjaxResult.error("鎾ら攢澶辫触,璋冪敤浣滃簾鍑虹幇澶辫触");
+                        return AjaxResult.error("鎾ら攢澶辫触,璇ヤ汉鍛樺凡缂磋垂,璇峰厛閫�璐�!");
                     }
                 }
-            }
+                boolean zfHisApiMethods = hisApiMethod.ZfHisApiMethods(null, order);
+                if (zfHisApiMethods) {
+                    return AjaxResult.success("鎾ら攢鎴愬姛");
+                } else {
+                    TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+                    return AjaxResult.error("鎾ら攢澶辫触,璋冪敤浣滃簾鍑虹幇澶辫触");
+                }
 
-//            transitionService.updateTbTransitionByTjNum(tjNum);
+            }
             return AjaxResult.success("鎾ら攢鎴愬姛!!!");
         }
         return AjaxResult.success("绛惧埌璁板綍涓嶅瓨鍦�!");
     }
 
 
-    @GetMapping("/getCusTomterListByCompId")
-    @ApiOperation(value = "鑾峰彇鍗曚綅id浣撴浜轰俊鎭帴鍙�")
-    public AjaxResult getCusTomterListByCompId(@RequestParam(required = false) @ApiParam(value = "鍗曚綅id") String compId,
-                                               @RequestParam(required = false) @ApiParam(value = "鍚嶅瓧") String name,
-                                               @RequestParam(required = false) @ApiParam(value = "閮ㄩ棬id") String deptId,
-                                               @RequestParam(required = false) @ApiParam(value = "棰勭害鏃堕棿") Date reservationTime,
-                                               @RequestParam(defaultValue = "1") Integer page,
-                                               @RequestParam(defaultValue = "10") Integer pageSize) {
+    @GetMapping ("/getCusTomterListByCompId")
+    @ApiOperation (value = "鑾峰彇鍗曚綅id浣撴浜轰俊鎭帴鍙�")
+    public AjaxResult getCusTomterListByCompId(@RequestParam (required = false) @ApiParam (value = "鍗曚綅id") String compId,
+                                               @RequestParam (required = false) @ApiParam (value = "鍚嶅瓧") String name,
+                                               @RequestParam (required = false) @ApiParam (value = "閮ㄩ棬id") String deptId,
+                                               @RequestParam (required = false) @ApiParam (value = "棰勭害鏃堕棿") Date reservationTime,
+                                               @RequestParam (defaultValue = "1") Integer page,
+                                               @RequestParam (defaultValue = "10") Integer pageSize) {
         Page<TjReservation> pages = new Page<>(page, pageSize);
         LambdaQueryWrapper<TjReservation> wq = new LambdaQueryWrapper<>();
         if (null != compId) wq.eq(TjReservation::getCompanyId, compId);
@@ -2596,10 +2623,10 @@
     }
 
 
-    @PostMapping("/plRevokeTjOrderByTjNum")
-    @ApiOperation(value = "鏍规嵁瀹㈡埛浣撴鍙锋壒閲忔挙閿�浣撴璁板綍")
+    @PostMapping ("/plRevokeTjOrderByTjNum")
+    @ApiOperation (value = "鏍规嵁瀹㈡埛浣撴鍙锋壒閲忔挙閿�浣撴璁板綍")
     @Transactional
-    public AjaxResult plRevokeTjOrderByTjNum(@RequestBody @ApiParam(value = "棰勭害涓婚敭id闆嗗悎") List<String> reservationIds) {
+    public AjaxResult plRevokeTjOrderByTjNum(@RequestBody @ApiParam (value = "棰勭害涓婚敭id闆嗗悎") List<String> reservationIds) {
         if (null != reservationIds && reservationIds.size() > 0) {
             LambdaQueryWrapper<TjOrder> wq1 = new LambdaQueryWrapper<>();
             wq1.in(TjOrder::getReservationId, reservationIds);
@@ -2633,8 +2660,8 @@
         return AjaxResult.error("璇烽�夋嫨瑕佹挙閿�鐨勪汉鍛�!");
     }
 
-    @PostMapping("makeTjPDF")
-    @ApiOperation(value = "鎵归噺鐢熸垚PDF")
+    @PostMapping ("makeTjPDF")
+    @ApiOperation (value = "鎵归噺鐢熸垚PDF")
     public AjaxResult makeTjPDF(@RequestBody List<String> reservations) {
         QueryWrapper<TjOrder> queryWrapper = new QueryWrapper<>();
         queryWrapper.in("reservation_id", reservations);
@@ -2676,11 +2703,11 @@
     }
 
 
-    @GetMapping("/delTbBycusCardIdAndProId")
-    @ApiOperation(value = "鏍规嵁瀹㈡埛韬唤璇佸彿鍜岄」鐩埗椤筰d鍒犻櫎涓存椂琛ㄦ暟鎹�")
+    @GetMapping ("/delTbBycusCardIdAndProId")
+    @ApiOperation (value = "鏍规嵁瀹㈡埛韬唤璇佸彿鍜岄」鐩埗椤筰d鍒犻櫎涓存椂琛ㄦ暟鎹�")
     @Transactional
-    public AjaxResult delTbBycusCardIdAndProId(@RequestParam @ApiParam(value = "韬唤璇佸彿") String cusCardId,
-                                               @RequestParam @ApiParam(value = "鐖堕」id") String proId) {
+    public AjaxResult delTbBycusCardIdAndProId(@RequestParam @ApiParam (value = "韬唤璇佸彿") String cusCardId,
+                                               @RequestParam @ApiParam (value = "鐖堕」id") String proId) {
 
         if (transitionService.delTbBycusCardIdAndProId(cusCardId, proId)) {
             return AjaxResult.success();
@@ -2689,10 +2716,10 @@
     }
 
 
-    @GetMapping("/revokeTjOrderByTjCardId")
-    @ApiOperation(value = "鏍规嵁灏辫瘖鍙锋挙閿�鐢宠璁板綍")
+    @GetMapping ("/revokeTjOrderByTjCardId")
+    @ApiOperation (value = "鏍规嵁灏辫瘖鍙锋挙閿�鐢宠璁板綍")
     @Transactional
-    public AjaxResult revokeTjOrderByTjCardId(@RequestParam @ApiParam(value = "灏辫瘖鍙�") String cardId) {
+    public AjaxResult revokeTjOrderByTjCardId(@RequestParam @ApiParam (value = "灏辫瘖鍙�") String cardId) {
 
         TjOrder order = new TjOrder();
         order.setCardId(cardId);
@@ -2727,10 +2754,10 @@
     }
 
 
-    @GetMapping("/revokeTjOrderByTjh")
-    @ApiOperation(value = "鏍规嵁灏变綋妫�鍙峰垹闄よ褰�")
+    @GetMapping ("/revokeTjOrderByTjh")
+    @ApiOperation (value = "鏍规嵁灏变綋妫�鍙峰垹闄よ褰�")
     @Transactional
-    public AjaxResult revokeTjOrderByTjh(@RequestParam @ApiParam(value = "浣撴鍙�") String tjNum) {
+    public AjaxResult revokeTjOrderByTjh(@RequestParam @ApiParam (value = "浣撴鍙�") String tjNum) {
 
         TjOrder order = tjOrderService.getOrderByTjNum(tjNum);
         if (null != order) {
@@ -2746,5 +2773,106 @@
         }
         return AjaxResult.success();
     }
+
+
+    @GetMapping ("/getBlproByTjh")
+    @ApiOperation (value = "鏍规嵁浣撴鍙疯幏鍙栬ˉ褰曢」鐩褰�")
+    @Transactional
+    public AjaxResult getBlproByTjh(@RequestParam @ApiParam (value = "浣撴鍙�") String tjNum) {
+
+        TjOrder order = tjOrderService.getOrderByTjNum(tjNum);
+        if (null != order) {
+            LambdaQueryWrapper<TjProBl> wq = new LambdaQueryWrapper<>();
+            wq.eq(TjProBl::getTjh, tjNum);
+            List<TjProBl> blList = blService.list(wq);
+            if (null != blList && blList.size() > 0) {
+                for (TjProBl bl : blList) {
+                    LambdaQueryWrapper<TjOrderRemark> wqr = new LambdaQueryWrapper<>();
+                    wqr.eq(TjOrderRemark::getJxbz, bl.getBldh());
+                    List<TjOrderRemark> remarkList = remarkService.list(wqr);
+                    if (null != remarkList && remarkList.size() > 0) {
+                        List<Long> collect = remarkList.stream().map(TjOrderRemark::getProId).collect(Collectors.toList());
+                        LambdaQueryWrapper<TjProject> wqp = new LambdaQueryWrapper<>();
+                        wqp.in(TjProject::getProId, collect);
+                        List<TjProject> projectList = projectService.list(wqp);
+                        for (TjProject project : projectList) {
+                            project.setChildren(projectService.getTjProjectListBySoneId(String.valueOf(project.getProId())));
+                        }
+                        bl.setProjectList(projectList);
+                    }
+                }
+                return AjaxResult.success(blList);
+            }
+            return AjaxResult.success(null);
+        }
+        return AjaxResult.error("鏆傛棤浣撴璁板綍");
+    }
+
+
+    @PostMapping ("/revokeBlProByBldhAndTjh")
+    @ApiOperation (value = "鏍规嵁琛ュ綍鍗曞彿鍜屼綋妫�鍙峰垹闄よ褰�")
+    @Transactional
+    public AjaxResult revokeBlProByBldhAndTjh(@RequestBody TjProBlDto dto) {
+
+        if (null == dto.getBldhs() || dto.getBldhs().size() == 0) {
+            return AjaxResult.error("璇烽�夋嫨瑕佹挙閿�鐨勮ˉ褰曢」鐩�");
+        }
+
+        TjOrder order = tjOrderService.getOrderByTjNum(dto.getTjh());
+        if (null != order) {
+            String configByKey = configService.selectConfigByKey("sfkqdyhis");
+            if (null != configByKey && configByKey.equals("Y")) {
+                HashMap<String, Object> hisRequestParams = new HashMap<>();
+                hisRequestParams.put("patientId", order.getCardId());
+                AjaxResult queryPay = hisApiGetMethodService.getHISDataNew("QueryPay", hisRequestParams);
+                if (Integer.parseInt(queryPay.get("code").toString()) == 200) {
+                    List<Map<String, String>> data = (List<Map<String, String>>) queryPay.get("data");
+                    BigDecimal cateFeeAll = BigDecimal.ZERO;
+                    List<String> advIds = new ArrayList<>();
+                    for (Map<String, String> datum : data) {
+                        String advId = datum.get("Adv_Id").split("_")[1];
+                        BigDecimal cateFee = new BigDecimal(datum.get("CateFee"));
+                        cateFeeAll = cateFeeAll.add(cateFee);
+                        advIds.add(advId);
+                    }
+                    if (advIds.containsAll(dto.getBldhs()) && cateFeeAll.compareTo(BigDecimal.ZERO) != 0) {
+                        return AjaxResult.error("鏀归」鐩凡缂磋垂涓嶅彲鎾ら攢!!!");
+                    }
+
+                }
+                boolean b = hisApiMethod.ZfBlXm(dto.getBldhs(), order);
+                if(!b){
+                    TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+                    return AjaxResult.error("鎾ら攢澶辫触,璋冪敤浣滃簾鍑虹幇澶辫触");
+                }
+            }
+            for (String bldh : dto.getBldhs()) {
+                remarkService.deleteTjOrderDetailByjxbz(bldh);
+                tjOrderDetailService.deleteTjOrderDetailByjxbz(bldh);
+                tjFlowingWaterService.deleteTjOrderDetailByjxbz(bldh);
+                transitionService.deleteTjOrderDetailByjxbz(bldh);
+                blService.remove(new LambdaQueryWrapper<TjProBl>().eq(TjProBl::getTjh, dto.getTjh()).eq(TjProBl::getBldh, bldh));
+            }
+            return AjaxResult.success();
+        }
+        return AjaxResult.error();
+    }
+
+
+    @PostMapping ("/addYaoPinShenQing")
+    @ApiOperation (value = "鑽搧淇℃伅鐢宠")
+    @Transactional
+    public AjaxResult addYaoPinShenQing(@RequestBody OutpinmedicapplyDto dto) {
+        AjaxResult result = controller.Outpinmedicapply(dto);
+        String result1 = getAjaxResult(result);
+        JSONObject object = getJSONObject(result1);
+        String code = object.getStr("ResultCode");
+        if (null != code && code.equals("200")) {
+
+        }
+        return AjaxResult.success();
+    }
+
+
 }
 

--
Gitblit v1.8.0