| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.swing.plaf.basic.BasicScrollPaneUI; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ltkj.common.core.redis.RedisCache; |
| | | import com.ltkj.framework.config.MatchUtils; |
| | | import com.ltkj.hosp.domain.TbTransition; |
| | | import com.ltkj.hosp.domain.TjCustomer; |
| | | import com.ltkj.hosp.domain.TjProject; |
| | | import com.ltkj.hosp.service.ITjCustomerService; |
| | | import com.ltkj.hosp.service.ITjProjectService; |
| | | import com.ltkj.hosp.service.TjAsyncService; |
| | | import com.ltkj.hosp.domain.*; |
| | | import com.ltkj.hosp.service.*; |
| | | import com.ltkj.web.controller.lis.LisApiMethod; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import org.aspectj.weaver.AjAttribute; |
| | | 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; |
| | | import com.ltkj.common.core.domain.AjaxResult; |
| | | import com.ltkj.common.enums.BusinessType; |
| | | import com.ltkj.hosp.domain.TjSampling; |
| | | import com.ltkj.hosp.service.ITjSamplingService; |
| | | import com.ltkj.common.utils.poi.ExcelUtil; |
| | | import com.ltkj.common.core.page.TableDataInfo; |
| | | |
| | |
| | | private TjAsyncService asyncService; |
| | | @Resource |
| | | private RedisCache redisCache; |
| | | @Autowired |
| | | private ITjOrderService orderService; |
| | | @Autowired |
| | | private ITbTransitionService tbTransitionService; |
| | | @Autowired |
| | | private LisApiMethod lisApiMethod; |
| | | |
| | | /** |
| | | * 查询体检采样管理列表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('sampling:sampling:list')") |
| | | //@PreAuthorize("@ss.hasPermi('sampling:sampling:list')") |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "查询体检采样管理列表(自带默认)") |
| | | public TableDataInfo list(TjSampling tjSampling) { |
| | |
| | | } |
| | | |
| | | /** |
| | | * 获取采样客户列表 |
| | | * @param isSignFor |
| | | * @param tjNum |
| | | * @param name |
| | | * @param pageNum |
| | | * @param pageSize |
| | | * @param beginTime |
| | | * @param endTime |
| | | * @return |
| | | */ |
| | | @GetMapping("/getCusList") |
| | | 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 name, |
| | | @ApiParam(value = "页码数(默认1)") @RequestParam(defaultValue = "1") Integer pageNum, |
| | | @ApiParam(value = "显示条数(默认10)") @RequestParam(defaultValue = "10") Integer pageSize, |
| | | @ApiParam(value = "开始时间") @RequestParam(required = false) String beginTime, |
| | | @ApiParam(value = "结束时间") @RequestParam(required = false) String endTime){ |
| | | Page<TjSampling> samplingPage = new Page<>(pageNum, pageSize); |
| | | LambdaQueryWrapper<TjSampling> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(TjSampling::getIsSignFor,isSignFor); |
| | | if (null != tjNum && StrUtil.isNotBlank(tjNum)) |
| | | wrapper.eq(TjSampling::getTjNum,tjNum); |
| | | if (null != name && StrUtil.isNotBlank(name)) |
| | | wrapper.eq(TjSampling::getCusName,name); |
| | | if (null != beginTime && null != endTime && StrUtil.isNotBlank(beginTime) && StrUtil.isNotBlank(endTime)) |
| | | wrapper.between(TjSampling::getApplicationTime, beginTime, endTime); |
| | | wrapper.groupBy(TjSampling::getCusId); |
| | | // wrapper.last("LIMIT " + (pageNum - 1) * pageSize + "," + pageSize); |
| | | Page<TjSampling> page = tjSamplingService.page(samplingPage, wrapper); |
| | | List<TjSampling> list = page.getRecords(); |
| | | ArrayList<TjCustomer> tjCustomers = new ArrayList<>(); |
| | | for (TjSampling tjSampling : list) { |
| | | TjCustomer customer = customerService.getById(tjSampling.getCusId()); |
| | | customer.setCusName(MatchUtils.hideCusName(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<>(); |
| | | hashMap.put("list",tjCustomers); |
| | | hashMap.put("total",page.getTotal()); |
| | | return AjaxResult.success(hashMap); |
| | | } |
| | | |
| | | /** |
| | | * 根据客户获取采样列表 |
| | | * @param cusId |
| | | * @return |
| | | */ |
| | | @GetMapping("/getCusCyList") |
| | | public AjaxResult getCusCyList(@RequestParam @ApiParam(value = "客户id") String cusId){ |
| | | if (cusId == null || StrUtil.isBlank(cusId)) |
| | | return AjaxResult.error("参数错误"); |
| | | LambdaQueryWrapper<TjSampling> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(TjSampling::getCusId,cusId); |
| | | wrapper.isNull(TjSampling::getParentId); |
| | | List<TjSampling> list = tjSamplingService.list(wrapper); |
| | | if (list.isEmpty()) |
| | | return AjaxResult.error("参数错误"); |
| | | for (TjSampling sampling : list) { |
| | | sampling.setCusName(MatchUtils.hideCusName(sampling.getCusName())); |
| | | } |
| | | return AjaxResult.success(list); |
| | | } |
| | | |
| | | @PostMapping("/mergeCaiYang") |
| | | public AjaxResult mergeCaiYang(@RequestBody List<String> ids){ |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | /** |
| | | * 导出体检采样管理列表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('sampling:sampling:export')") |
| | | //@PreAuthorize("@ss.hasPermi('sampling:sampling:export')") |
| | | @Log(title = "体检采样管理", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | @ApiOperation(value = "导出体检采样管理列表") |
| | |
| | | /** |
| | | * 获取体检采样管理详细信息 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('sampling:sampling:query')") |
| | | //@PreAuthorize("@ss.hasPermi('sampling:sampling:query')") |
| | | @GetMapping(value = "/{id}") |
| | | @ApiOperation(value = "获取体检采样管理详细信息") |
| | | public AjaxResult getInfo(@PathVariable("id") String id) { |
| | |
| | | /** |
| | | * 新增体检采样管理 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('sampling:sampling:add')") |
| | | //@PreAuthorize("@ss.hasPermi('sampling:sampling:add')") |
| | | @Log(title = "体检采样管理", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | @ApiOperation(value = "新增体检采样管理") |
| | |
| | | /** |
| | | * 修改体检采样管理 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('sampling:sampling:edit')") |
| | | //@PreAuthorize("@ss.hasPermi('sampling:sampling:edit')") |
| | | @Log(title = "体检采样管理", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | @ApiOperation(value = "修改体检采样管理") |
| | |
| | | /** |
| | | * 删除体检采样管理 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('sampling:sampling:remove')") |
| | | //@PreAuthorize("@ss.hasPermi('sampling:sampling:remove')") |
| | | @Log(title = "体检采样管理", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{ids}") |
| | | @ApiOperation(value = "删除体检采样管理") |
| | |
| | | */ |
| | | @PostMapping("/confirmSampling") |
| | | @ApiOperation(value = "确认采样接口") |
| | | @Transactional |
| | | public AjaxResult confirmSampling(@RequestBody List<String> ids) { |
| | | if (null == ids || ids.size() == 0) { |
| | | return AjaxResult.error("请选择要确认项"); |
| | |
| | | } |
| | | } |
| | | } |
| | | tjSamplingService.updateById(sampling); |
| | | if (!tjSamplingService.updateById(sampling)) { |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | return AjaxResult.error("操作失败,请重试"); |
| | | } |
| | | } |
| | | |
| | | return AjaxResult.success("操作成功"); |
| | | } |
| | | } |