| | |
| | | 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.*; |
| | |
| | | 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; |
| | |
| | | * 获取采样客户列表 |
| | | * |
| | | * @param isSignFor |
| | | * @param tjNum |
| | | * @param tjNumber |
| | | * @param name |
| | | * @param pageNum |
| | | * @param pageSize |
| | |
| | | @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, |
| | |
| | | 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.groupBy(TjSampling::getCusId); |
| | | wrapper.groupBy(TjSampling::getTjNum); |
| | | wrapper.orderByDesc(TjSampling::getCreateTime); |
| | | // wrapper.last("LIMIT " + (pageNum - 1) * pageSize + "," + pageSize); |
| | | Page<TjSampling> page = tjSamplingService.page(samplingPage, wrapper); |
| | |
| | | TjCustomer customer = customerService.getById(tjSampling.getCusId()); |
| | | if(null !=customer){ |
| | | TjOrder order = orderService.getOrderByTjNum(tjSampling.getTjNum()); |
| | | 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); |
| | | 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<>(); |