From ec2bb08f0aad10bbf1f133046d8e9943be3a6d72 Mon Sep 17 00:00:00 2001
From: zjh <zjh@888>
Date: 星期三, 26 六月 2024 15:34:44 +0800
Subject: [PATCH] zjh 本地 2024/06/26 --3修改签到撤销接口不判断作废状态

---
 ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjOrderController.java |   73 +++++++++++++++++++++++++++++++++++-
 1 files changed, 70 insertions(+), 3 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 683b6a5..192b101 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
@@ -23,6 +23,9 @@
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.crypto.symmetric.DES;
 import cn.hutool.extra.pinyin.PinyinUtil;
+import cn.hutool.json.JSONArray;
+import cn.hutool.json.JSONObject;
+import cn.hutool.json.JSONUtil;
 import com.alibaba.fastjson2.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -183,6 +186,8 @@
     private HisMzJysqController hisMzJysqController;
     @Autowired
     private HisApiGetMethodService hisApiGetMethodService;
+    @Autowired
+    private ISysDeptService sysDeptService;
 
 
     /**
@@ -440,9 +445,8 @@
                 if (null != tjCustomer) {
                     order.setTjCustomerSex(tjCustomer.getCusSex());
                     order.setTjCustomerAge(DateUtil.ageOfNow(tjCustomer.getCusBrithday()));
-                    order.setTjCustomerName(MatchUtils.hideCusName(tjCustomer.getCusName()));
                     order.setTjCustomerName(tjCustomer.getCusName());
-                    order.setTjCustomerPhone(MatchUtils.hidePhoneNum(tjCustomer.getCusPhone()));
+                    order.setTjCustomerPhone(tjCustomer.getCusPhone());
 //                    order.setTjCusIdCard(MatchUtils.hideIdCardNum(tjCustomer.getCusIdcard()));
                     order.setTjCusIdCard(tjCustomer.getCusIdcard());
                     order.setCareer(tjCustomer.getCareer());
@@ -1921,6 +1925,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("pacName", aPackage.getPacName());
                 TjProject tjProject = projectService.getById(entry.getKey());
 //                TjPackageProject project = tjPackageProjectService.getOne(new LambdaQueryWrapper<TjPackageProject>().eq(TjPackageProject::getPacId, pacId)
@@ -1933,6 +1938,7 @@
 //                }
                 map.put("nowPrice", transitionService.getTbTransitionDxPriceByPac(cusId, entry.getKey(), cardId, pacId));
             } else {
+                map.put("tjCategory",null);
                 map.put("pacName", "鍗曢」");
                 List<TbTransition> tbTransitionList = entry.getValue();
                 if (null != tbTransitionList && tbTransitionList.size() > 0) {
@@ -1971,6 +1977,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("pacName", aPackage.getPacName());
                 TjProject tjProject = projectService.getById(entry.getKey());
 //                TjPackageProject project = tjPackageProjectService.getOne(new LambdaQueryWrapper<TjPackageProject>().eq(TjPackageProject::getPacId, pacId)
@@ -1981,8 +1988,9 @@
 //                } else {
 //                    map.put("nowPrice", tjProject.getProPrice());
 //                }
-                map.put("nowPrice", transitionService.getTbTransitionDxPriceByPac(cusId, entry.getKey(), cardId, pacId));
+                map.put("nowPrice",tjProject.getProPrice());
             } else {
+                map.put("tjCategory",null);
                 map.put("pacName", "鍗曢」");
                 List<TbTransition> tbTransitionList = entry.getValue();
                 if (null != tbTransitionList && tbTransitionList.size() > 0) {
@@ -2218,6 +2226,65 @@
         return AjaxResult.success(transitionService.remove(wq));
     }
 
+    @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)
+                .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);
+        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());
+            SysDept dept = sysDeptService.getOne(queryWrapper);
+            for (TbTransition tbTransition : list) {
+                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());
+                    huiZong.add(obj);
+                }
+            }
+        }
+        wrapper = new QueryWrapper<>();
+        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());
+            BigDecimal ordPrice = tbTransition.getOrdPrice();
+            obj.putOpt("zongjia",ordPrice);
+            QueryWrapper<TjProject> queryWrapper = new QueryWrapper<>();
+            queryWrapper.eq("pro_id",tbTransition.getProId());
+            TjProject tjProject = projectService.getOne(queryWrapper);
+            Integer num = tjProject.getSl();
+            obj.putOpt("num",num);
+            BigDecimal price = ordPrice.divide(new BigDecimal(num));
+            obj.putOpt("danjia",price);
+            Date createTime = tbTransition.getCreateTime();
+            SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            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);
+    }
+
     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()));
         tjOrderDetailService.saveTjOrderDetailsByCusId(tjCustomer.getCusIdcard(), String.valueOf(tjOrder.getOrderId()), sysUser.getNickName(), String.valueOf(sysUser.getUserId()));

--
Gitblit v1.8.0