| | |
| | | import java.util.Map; |
| | | 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 com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | import com.ltkj.hosp.domain.*; |
| | | import com.ltkj.hosp.service.*; |
| | | import com.ltkj.web.controller.lis.LisApiMethod; |
| | | import com.sun.xml.internal.bind.v2.TODO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | 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; |
| | |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/sampling/sampling") |
| | | @Api(tags = "体检采样管理") |
| | | @Api(tags = "PC端 体检采样管理") |
| | | public class TjSamplingController extends BaseController { |
| | | @Resource |
| | | private ITjSamplingService tjSamplingService; |
| | |
| | | * @return |
| | | */ |
| | | @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 name, |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/getCusCyList") |
| | | @ApiOperation(value = "根据客户获取采样列表") |
| | | public AjaxResult getCusCyList(@RequestParam @ApiParam(value = "客户id") String cusId){ |
| | | if (cusId == null || StrUtil.isBlank(cusId)) |
| | | return AjaxResult.error("参数错误"); |
| | |
| | | return AjaxResult.success(list); |
| | | } |
| | | |
| | | @PostMapping("/mergeCaiYang") |
| | | public AjaxResult mergeCaiYang(@RequestBody List<String> ids){ |
| | | return AjaxResult.success(); |
| | | @GetMapping("/mergeCaiYang") |
| | | @ApiOperation(value = "采样登记合并项目接口") |
| | | public AjaxResult mergeCaiYang(@RequestParam List<String> ids){ |
| | | if(null !=ids && !ids.isEmpty()){ |
| | | int i = tjSamplingService.panduanshifoukeyihebing(ids); |
| | | if(i>1){ |
| | | return AjaxResult.error("标本类型不一致,不可合并"); |
| | | } |
| | | |
| | | TjSampling tjSampling = tjSamplingService.getById(ids.get(0)); |
| | | |
| | | |
| | | //todo 加一条判断是否存在合并项目的查询sql |
| | | //todo 判断传入的项目是否存在合并项目 不存在走原逻辑 存在走else |
| | | |
| | | |
| | | Map<String,Object> map= tjSamplingService.hebingCaiYangInFo(ids); |
| | | TjSampling sampling=new TjSampling(); |
| | | String proId = map.get("proId").toString(); |
| | | String proName = map.get("proName").toString(); |
| | | BeanUtil.copyProperties(tjSampling,sampling,new String[]{"id"}); |
| | | sampling.setProId(proId); |
| | | sampling.setProName(proName); |
| | | sampling.setIsMerge(1); |
| | | if (tjSamplingService.save(sampling)) { |
| | | for (String id : ids) { |
| | | TjSampling service = tjSamplingService.getById(id); |
| | | service.setParentId(sampling.getId()); |
| | | service.setIsMerge(1); |
| | | tjSamplingService.updateById(service); |
| | | } |
| | | return AjaxResult.success("合并项目成功!"); |
| | | } |
| | | } |
| | | return AjaxResult.error("请选择你要合并的项目!!!"); |
| | | } |
| | | |
| | | /** |