From 4f873f73c5b7a5af020cd71a0062c438771f98e7 Mon Sep 17 00:00:00 2001
From: zjh <1084500556@qq.com>
Date: 星期四, 20 三月 2025 18:02:06 +0800
Subject: [PATCH] zjh20250320

---
 ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjXdPictureController.java |   85 ++++++++++++++++++++++++++++++------------
 1 files changed, 60 insertions(+), 25 deletions(-)

diff --git a/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjXdPictureController.java b/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjXdPictureController.java
index d087141..78d6b3e 100644
--- a/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjXdPictureController.java
+++ b/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjXdPictureController.java
@@ -11,14 +11,8 @@
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.ltkj.common.core.redis.RedisCache;
 import com.ltkj.framework.config.MatchUtils;
-import com.ltkj.hosp.domain.TjCustomer;
-import com.ltkj.hosp.domain.TjProject;
-import com.ltkj.hosp.domain.TjSampling;
-import com.ltkj.hosp.domain.TjXdPicture;
-import com.ltkj.hosp.service.ITjCustomerService;
-import com.ltkj.hosp.service.ITjProjectService;
-import com.ltkj.hosp.service.ITjXdPictureService;
-import com.ltkj.hosp.service.TjAsyncService;
+import com.ltkj.hosp.domain.*;
+import com.ltkj.hosp.service.*;
 import com.ltkj.system.service.ISysConfigService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -49,11 +43,19 @@
     private ITjCustomerService customerService;
     @Autowired
     private ISysConfigService configService;
+    @Resource
+    private ITjOrderService orderService;
+    @Resource
+    private ITjOrderDetailService detailService;
+    @Resource
+    private ITjOrderRemarkService remarkService;
+    @Resource
+    private ITjProjectService projectService;
 
     /**
      * 鏌ヨ浣撴蹇冪數鍥剧鐞嗗垪琛�
      */
-    @PreAuthorize("@ss.hasPermi('picture:picture:list')")
+    //@PreAuthorize("@ss.hasPermi('picture:picture:list')")
     @GetMapping("/list")
     @ApiOperation(value = "鏌ヨ浣撴蹇冪數鍥剧鐞嗗垪琛�(鑷甫榛樿)")
     public TableDataInfo list(TjXdPicture tjXdPicture) {
@@ -74,24 +76,27 @@
         wq.orderByDesc(TjXdPicture::getCreateTime);
         List<TjXdPicture> list = tjXdPictureService.list(wq);
         List<Map<String,Object>> arrayList=new ArrayList<>();
-        if(null !=list && list.size()>0){
+        if(null !=list && !list.isEmpty()){
             Map<String, List<TjXdPicture>> stringListMap = list.stream().collect(Collectors.groupingBy(TjXdPicture::getCusId));
             for (Map.Entry<String, List<TjXdPicture>> entry : stringListMap.entrySet()) {
                 Map<String,Object>map=new HashMap<>();
                 TjCustomer customer = customerService.getById(entry.getKey());
-                customer.setCusName(MatchUtils.hideCusName(customer.getCusName()));
-                customer.setCusPhone(MatchUtils.hidePhoneNum(customer.getCusPhone()));
-                customer.setCusIdcard(MatchUtils.hideIdCardNum(customer.getCusIdcard()));
-                customer.setTjNumber(entry.getValue().get(0).getTjNum());
-                map.put("list",entry.getValue());
-                map.put("customer",customer);
-                map.put("picturePath",configService.selectConfigByKey("TjXdPicture"));
-                arrayList.add(map);
+                if(null !=customer){
+                    customer.setCusName(MatchUtils.hideCusName(customer.getCusName()));
+                    customer.setCusPhone(MatchUtils.hidePhoneNum(customer.getCusPhone()));
+                    customer.setCusIdcard(MatchUtils.hideIdCardNum(customer.getCusIdcard()));
+                    customer.setTjNumber(entry.getValue().get(0).getTjNum());
+                    map.put("list",entry.getValue());
+                    map.put("customer",customer);
+                    map.put("picturePath",configService.selectConfigByKey("TjXdPicture"));
+                    arrayList.add(map);
+                }
+
             }
         }
         List<Map<String, Object>> collect =null;
         Map<String,Object>map=new HashMap<>();
-        if(arrayList.size()>0){
+        if(!arrayList.isEmpty()){
             collect = arrayList.stream().skip((long) (pageNum - 1) * pageSize).limit(pageSize).collect(Collectors.toList());
         }
         map.put("list",collect);
@@ -102,7 +107,7 @@
     /**
      * 瀵煎嚭浣撴蹇冪數鍥剧鐞嗗垪琛�
      */
-    @PreAuthorize("@ss.hasPermi('picture:picture:export')")
+    //@PreAuthorize("@ss.hasPermi('picture:picture:export')")
     @Log(title = "浣撴蹇冪數鍥剧鐞�", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
     @ApiOperation(value = "瀵煎嚭浣撴蹇冪數鍥剧鐞嗗垪琛�")
@@ -115,7 +120,7 @@
     /**
      * 鑾峰彇浣撴蹇冪數鍥剧鐞嗚缁嗕俊鎭�
      */
-    @PreAuthorize("@ss.hasPermi('picture:picture:query')")
+    //@PreAuthorize("@ss.hasPermi('picture:picture:query')")
     @GetMapping(value = "/{id}")
     @ApiOperation(value = "鑾峰彇浣撴蹇冪數鍥剧鐞嗚缁嗕俊鎭�")
     public AjaxResult getInfo(@PathVariable("id") String id) {
@@ -125,7 +130,7 @@
     /**
      * 鏂板浣撴蹇冪數鍥剧鐞�
      */
-    @PreAuthorize("@ss.hasPermi('picture:picture:add')")
+    //@PreAuthorize("@ss.hasPermi('picture:picture:add')")
     @Log(title = "浣撴蹇冪數鍥剧鐞�", businessType = BusinessType.INSERT)
     @PostMapping
     @ApiOperation(value = "鏂板浣撴蹇冪數鍥剧鐞�")
@@ -136,18 +141,48 @@
     /**
      * 淇敼浣撴蹇冪數鍥剧鐞�
      */
-    @PreAuthorize("@ss.hasPermi('picture:picture:edit')")
+    //@PreAuthorize("@ss.hasPermi('picture:picture:edit')")
     @Log(title = "浣撴蹇冪數鍥剧鐞�", businessType = BusinessType.UPDATE)
     @PutMapping
     @ApiOperation(value = "淇敼浣撴蹇冪數鍥剧鐞�")
     public AjaxResult edit(@RequestBody TjXdPicture tjXdPicture) {
-        return toAjax(tjXdPictureService.updateTjXdPicture(tjXdPicture));
+        if (tjXdPictureService.updateById(tjXdPicture)) {
+            TjOrder order = orderService.getOrderByTjNum(tjXdPicture.getTjNum());
+            LambdaQueryWrapper<TjOrderDetail>wq=new LambdaQueryWrapper<>();
+            wq.eq(TjOrderDetail::getOrderId,order.getOrderId());
+            wq.eq(TjOrderDetail::getProId,tjXdPicture.getProId());
+            TjOrderDetail detail = detailService.getOne(wq);
+            detail.setProResult(tjXdPicture.getProResult());
+            detail.setConclusion(tjXdPicture.getConclusion());
+            detail.setTjStatus(1L);
+            detailService.updateById(detail);
+
+            TjProject tjProject = projectService.getById(tjXdPicture.getProId());
+            TjProject tjProjectp = projectService.getById(tjProject.getProParentId());
+
+            LambdaQueryWrapper<TjOrderDetail>wq1=new LambdaQueryWrapper<>();
+            wq1.eq(TjOrderDetail::getOrderId,order.getOrderId());
+            wq1.eq(TjOrderDetail::getProId,tjProjectp.getProId());
+            TjOrderDetail detailp = detailService.getOne(wq);
+            detailp.setTjStatus(1L);
+            detailService.updateById(detailp);
+
+            LambdaQueryWrapper<TjOrderRemark> wq2=new LambdaQueryWrapper<>();
+            wq2.eq(TjOrderRemark::getTjNumber,tjXdPicture.getTjNum());
+            wq2.eq(TjOrderRemark::getProId,tjProjectp.getProId());
+            TjOrderRemark remark = remarkService.getOne(wq2);
+            remark.setType(1);
+            remark.setRemark(tjXdPicture.getConclusion());
+            remarkService.updateById(remark);
+            return AjaxResult.success();
+        }
+        return AjaxResult.error();
     }
 
     /**
      * 鍒犻櫎浣撴蹇冪數鍥剧鐞�
      */
-    @PreAuthorize("@ss.hasPermi('picture:picture:remove')")
+    //@PreAuthorize("@ss.hasPermi('picture:picture:remove')")
     @Log(title = "浣撴蹇冪數鍥剧鐞�", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     @ApiOperation(value = "鍒犻櫎浣撴蹇冪數鍥剧鐞�")

--
Gitblit v1.8.0