From 0a68d1ae4a7e797342cf039a757fae4fc357faef Mon Sep 17 00:00:00 2001
From: zjh <1084500556@qq.com>
Date: 星期四, 07 八月 2025 08:46:07 +0800
Subject: [PATCH] zjh202500807
---
ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjSamplingController.java | 49 +++++++++++++++++++++++++++----------------------
1 files changed, 27 insertions(+), 22 deletions(-)
diff --git a/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjSamplingController.java b/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjSamplingController.java
index c3e82e4..0de6c6c 100644
--- a/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjSamplingController.java
+++ b/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjSamplingController.java
@@ -4,20 +4,13 @@
import java.util.*;
import java.util.stream.Collectors;
import javax.annotation.Resource;
-import javax.servlet.ServletSecurityElement;
import javax.servlet.http.HttpServletResponse;
-import javax.swing.plaf.basic.BasicScrollPaneUI;
-import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.StrUtil;
-import cn.hutool.extra.pinyin.PinyinUtil;
-import cn.hutool.json.JSONArray;
-import cn.hutool.json.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ltkj.common.core.redis.RedisCache;
-import com.ltkj.common.utils.IdUtils;
import com.ltkj.framework.config.MatchUtils;
import com.ltkj.hosp.domain.*;
import com.ltkj.hosp.service.*;
@@ -28,12 +21,8 @@
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
-import org.aspectj.weaver.AjAttribute;
-import org.springframework.beans.BeanUtils;
-import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
-import org.springframework.transaction.interceptor.TransactionAspectSupport;
import org.springframework.web.bind.annotation.*;
import com.ltkj.common.annotation.Log;
import com.ltkj.common.core.controller.BaseController;
@@ -219,8 +208,9 @@
@GetMapping("/getCusList")
@ApiOperation(value = "鑾峰彇閲囨牱瀹㈡埛鍒楄〃")
public AjaxResult getCusList(@RequestParam(defaultValue = "1") @ApiParam(value = "0鏄�1鍚�") Integer isSignFor,
- @RequestParam(required = false) @ApiParam(value = "浣撴鍙�") String tjNum,
+ @RequestParam(required = false) @ApiParam(value = "浣撴鍙�") String tjNumber,
@RequestParam(required = false) @ApiParam(value = "瀹㈡埛濮撳悕") String name,
+ @RequestParam(required = false) @ApiParam(value = "鍗曚綅") String dw,
@ApiParam(value = "椤电爜鏁�(榛樿1)") @RequestParam(defaultValue = "1") Integer pageNum,
@ApiParam(value = "鏄剧ず鏉℃暟(榛樿10)") @RequestParam(defaultValue = "10") Integer pageSize,
@ApiParam(value = "寮�濮嬫椂闂�") @RequestParam(required = false) String beginTime,
@@ -228,13 +218,24 @@
Page<TjSampling> samplingPage = new Page<>(pageNum, pageSize);
LambdaQueryWrapper<TjSampling> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(TjSampling::getIsSignFor, isSignFor);
- if (null != tjNum && StrUtil.isNotBlank(tjNum))
- wrapper.like(TjSampling::getTjNum, tjNum);
+ if (null != tjNumber && StrUtil.isNotBlank(tjNumber))
+ wrapper.like(TjSampling::getTjNum, tjNumber);
if (null != name && StrUtil.isNotBlank(name))
wrapper.like(TjSampling::getCusName, name);
if (null != beginTime && null != endTime && StrUtil.isNotBlank(beginTime) && StrUtil.isNotBlank(endTime))
wrapper.between(TjSampling::getApplicationTime, beginTime, endTime);
- wrapper.groupBy(TjSampling::getCusId);
+ if (StrUtil.isNotBlank(dw)){
+ LambdaQueryWrapper<TjOrder> wqq=new LambdaQueryWrapper<>();
+ wqq.like(TjOrder::getFirmId,dw);
+ wqq.select(TjOrder::getTjNumber);
+ List<TjOrder> orderList = orderService.list(wqq);
+ if(null !=orderList && !orderList.isEmpty()){
+ List<String> list = orderList.stream().map(TjOrder::getTjNumber).collect(Collectors.toList());
+ wrapper.in(TjSampling::getTjNum, list);
+ }
+ }
+
+ wrapper.groupBy(TjSampling::getTjNum);
wrapper.orderByDesc(TjSampling::getCreateTime);
// wrapper.last("LIMIT " + (pageNum - 1) * pageSize + "," + pageSize);
Page<TjSampling> page = tjSamplingService.page(samplingPage, wrapper);
@@ -243,12 +244,16 @@
for (TjSampling tjSampling : list) {
TjCustomer customer = customerService.getById(tjSampling.getCusId());
if(null !=customer){
- customer.setCusName(customer.getCusName());
- customer.setCusPhone(MatchUtils.hidePhoneNum(customer.getCusPhone()));
- customer.setCusIdcard(MatchUtils.hideIdCardNum(customer.getCusIdcard()));
- customer.setTjNumber(tjSampling.getTjNum());
- customer.setApplicationTime(tjSampling.getApplicationTime());
- tjCustomers.add(customer);
+ TjOrder order = orderService.getOrderByTjNum(tjSampling.getTjNum());
+ if(null !=order){
+ customer.setCompName(order.getFirmName());
+ customer.setCusName(customer.getCusName());
+ customer.setCusPhone(MatchUtils.hidePhoneNum(customer.getCusPhone()));
+ customer.setCusIdcard(MatchUtils.hideIdCardNum(customer.getCusIdcard()));
+ customer.setTjNumber(tjSampling.getTjNum());
+ customer.setApplicationTime(tjSampling.getApplicationTime());
+ tjCustomers.add(customer);
+ }
}
}
HashMap<String, Object> hashMap = new HashMap<>();
@@ -364,7 +369,7 @@
if (list.size() >= 2) {
// 杩涜鍚堝苟
List<String> stringList = list.stream().map(TjSampling::getId).collect(Collectors.toList());
- log.info("鎻愬彇id ->{}",stringList);
+// log.info("鎻愬彇id ->{}",stringList);
for (String s : stringList) {
if (tjSamplingService.isMergeItem(s) != 0) {
list.removeIf(item -> Objects.equals(item.getId(), s));
--
Gitblit v1.8.0