QC
This commit is contained in:
parent
734b78feca
commit
fa4fc32f1c
@ -22,4 +22,6 @@ public class QcBatchno {
|
|||||||
private String standsrc;
|
private String standsrc;
|
||||||
private String bk;
|
private String bk;
|
||||||
private String batchno;
|
private String batchno;
|
||||||
|
private String zkpphold;
|
||||||
|
private String zkphold;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -33,4 +33,5 @@ public class QcSample {
|
|||||||
private Integer qc_sampleid;
|
private Integer qc_sampleid;
|
||||||
private Date expiredt;
|
private Date expiredt;
|
||||||
private BigDecimal qccv;
|
private BigDecimal qccv;
|
||||||
|
private String xmmc;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,15 +3,14 @@ package com.czlis.liswork.controller.qc;
|
|||||||
import com.czlis.common.core.controller.BaseController;
|
import com.czlis.common.core.controller.BaseController;
|
||||||
import com.czlis.common.core.domain.Result;
|
import com.czlis.common.core.domain.Result;
|
||||||
import com.czlis.common.core.domain.entity.lis.QcBatchno;
|
import com.czlis.common.core.domain.entity.lis.QcBatchno;
|
||||||
|
import com.czlis.common.core.domain.entity.lis.QcSample;
|
||||||
import com.czlis.common.core.page.TableDataInfo;
|
import com.czlis.common.core.page.TableDataInfo;
|
||||||
import com.czlis.liswork.service.QcBatchnoService;
|
import com.czlis.liswork.service.QcBatchnoService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -30,15 +29,39 @@ public class QcBatchnoController extends BaseController {
|
|||||||
|
|
||||||
@ApiOperation("查询质控批号")
|
@ApiOperation("查询质控批号")
|
||||||
@GetMapping("/query")
|
@GetMapping("/query")
|
||||||
public TableDataInfo queryList(QcBatchno qcBatchno) {
|
public Result queryList(QcBatchno qcBatchno) {
|
||||||
startPage();
|
// startPage();
|
||||||
List<QcBatchno> qcBatchnoList = qcBatchnoService.queryList(qcBatchno);
|
List<QcBatchno> qcBatchnoList = qcBatchnoService.queryList(qcBatchno);
|
||||||
return getDataTable(qcBatchnoList);
|
return new Result("0","获取数据成功!",qcBatchnoList);
|
||||||
|
}
|
||||||
|
@ApiOperation("删除质控批号")
|
||||||
|
@DeleteMapping("/delBatchno")
|
||||||
|
public Result delBatchno(QcBatchno qcBatchno) {
|
||||||
|
return qcBatchnoService.delBatchno(qcBatchno);
|
||||||
|
}
|
||||||
|
@ApiOperation("新增质控批号")
|
||||||
|
@PostMapping("/addBatchno")
|
||||||
|
public Result addBatchno(QcBatchno qcBatchno) {
|
||||||
|
return qcBatchnoService.addBatchno(qcBatchno);
|
||||||
|
}
|
||||||
|
@ApiOperation("修改质控批号")
|
||||||
|
@PostMapping("/updateBatchno")
|
||||||
|
public Result updateBatchno(QcBatchno qcBatchno) {
|
||||||
|
return qcBatchnoService.updateBatchno(qcBatchno);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("获取项目列表")
|
@ApiOperation("获取项目列表")
|
||||||
@GetMapping("/queryVal")
|
@GetMapping("/queryVal")
|
||||||
public Result queryValList(String yq){
|
public Result queryValList(String yq,String zkpph,String zkph){
|
||||||
return qcBatchnoService.queryValList(yq);
|
return qcBatchnoService.queryValList(yq,zkpph,zkph);
|
||||||
|
}
|
||||||
|
@ApiOperation("获取项目单项参数")
|
||||||
|
@GetMapping("/queryValXmdh")
|
||||||
|
public Result queryValXmdh(String yq,String zkpph,String zkph,String xmdh){
|
||||||
|
return qcBatchnoService.queryValXmdh(yq,zkpph,zkph, xmdh);
|
||||||
|
}
|
||||||
|
@ApiOperation("保存质控品参数")
|
||||||
|
@PostMapping("/saveQcSample")
|
||||||
|
public Result saveQcSample(@RequestBody List<QcSample> qcSampleList){
|
||||||
|
return qcBatchnoService.saveQcSample(qcSampleList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import com.czlis.common.annotation.Log;
|
|||||||
import com.czlis.common.core.controller.BaseController;
|
import com.czlis.common.core.controller.BaseController;
|
||||||
import com.czlis.common.core.domain.Result;
|
import com.czlis.common.core.domain.Result;
|
||||||
import com.czlis.common.core.domain.entity.lis.ComOpt;
|
import com.czlis.common.core.domain.entity.lis.ComOpt;
|
||||||
|
import com.czlis.common.core.domain.entity.lis.QcFrmsmpl;
|
||||||
import com.czlis.common.core.domain.entity.lis.QcRules;
|
import com.czlis.common.core.domain.entity.lis.QcRules;
|
||||||
import com.czlis.common.core.domain.entity.lis.QcSample;
|
import com.czlis.common.core.domain.entity.lis.QcSample;
|
||||||
import com.czlis.common.enums.BusinessType;
|
import com.czlis.common.enums.BusinessType;
|
||||||
@ -32,13 +33,6 @@ public class QualitySetController extends BaseController {
|
|||||||
private QualitySetService qualitySetService;
|
private QualitySetService qualitySetService;
|
||||||
|
|
||||||
|
|
||||||
@Log(title = SysLogConstants.QCRULES_LOG,businessType = BusinessType.UPDATE)
|
|
||||||
@ApiOperation("保存数据")
|
|
||||||
@PostMapping("/saveOpt")
|
|
||||||
public Result saveOpt(@RequestBody List<ComOpt> comOptList){
|
|
||||||
return qualitySetService.saveOpt(comOptList);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Log(title = SysLogConstants.QCRULES_LOG,businessType = BusinessType.UPDATE_DETAIL)
|
@Log(title = SysLogConstants.QCRULES_LOG,businessType = BusinessType.UPDATE_DETAIL)
|
||||||
@ApiOperation("保存质控项目数据")
|
@ApiOperation("保存质控项目数据")
|
||||||
@PostMapping("/saveQCItem")
|
@PostMapping("/saveQCItem")
|
||||||
@ -59,21 +53,13 @@ public class QualitySetController extends BaseController {
|
|||||||
return qualitySetService.queryDataFromSample(yq);
|
return qualitySetService.queryDataFromSample(yq);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("查询质控品数据")
|
@ApiOperation("保存普通标本和质控标本对应关系")
|
||||||
@GetMapping("/queryQcSample")
|
@PostMapping("/saveQcFromSample")
|
||||||
public Result queryQcSample(QcSample qcSample){
|
public Result saveQcFromSample(@RequestBody List<QcFrmsmpl> QcFrmsmpl){
|
||||||
return qualitySetService.queryQcSample(qcSample);
|
return qualitySetService.saveQcFromSample(QcFrmsmpl);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("保存质控品标本数据")
|
|
||||||
@PostMapping("/saveQcSample")
|
|
||||||
public Result saveQcSample(@RequestBody QcSampleDTO qcSampleDTO){
|
|
||||||
return qualitySetService.saveQcSample(qcSampleDTO);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation("/删除普通标本和质控标本对应关系")
|
@ApiOperation("/删除普通标本和质控标本对应关系")
|
||||||
@GetMapping("/deleteQcSample")
|
@GetMapping("/deleteQcFromSample")
|
||||||
public Result deleteQcFromSample(String yq,String ybh){
|
public Result deleteQcFromSample(String yq,String ybh){
|
||||||
return qualitySetService.deleteQcFromSample(yq,ybh);
|
return qualitySetService.deleteQcFromSample(yq,ybh);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -208,4 +208,9 @@ public class LisWorkController extends BaseController {
|
|||||||
public Result setiteminter(Date jyrq, String yq, String ybh, String xmdh, String xmdh0) {
|
public Result setiteminter(Date jyrq, String yq, String ybh, String xmdh, String xmdh0) {
|
||||||
return lisWorkService.setiteminter(jyrq, yq, ybh, xmdh, xmdh0);
|
return lisWorkService.setiteminter(jyrq, yq, ybh, xmdh, xmdh0);
|
||||||
}
|
}
|
||||||
|
@ApiOperation("签收条码")
|
||||||
|
@GetMapping("/querybarcode")
|
||||||
|
public Result querybarcode(String sqh) {
|
||||||
|
return lisWorkService.querybarcode(sqh);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
package com.czlis.liswork.mapper;
|
package com.czlis.liswork.mapper;
|
||||||
|
|
||||||
import com.czlis.common.core.domain.entity.lis.QcBatchno;
|
import com.czlis.common.core.domain.entity.lis.QcBatchno;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -10,5 +11,6 @@ public interface QcBatchnoMapper {
|
|||||||
void insert(QcBatchno qcBatchno);
|
void insert(QcBatchno qcBatchno);
|
||||||
void update(QcBatchno qcBatchno);
|
void update(QcBatchno qcBatchno);
|
||||||
void delete(QcBatchno qcBatchno);
|
void delete(QcBatchno qcBatchno);
|
||||||
List<Map<String,Object>> qcSampleList(String yq);
|
List<Map<String,Object>> qcSampleList(@Param("yq") String yq, @Param("zkpph") String zkpph,@Param("zkph") String zkph);
|
||||||
|
List<Map<String,Object>> qcSampleByXmdh(@Param("yq") String yq, @Param("zkpph") String zkpph,@Param("zkph") String zkph,@Param("xmdh") String xmdh);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,10 +1,13 @@
|
|||||||
package com.czlis.liswork.mapper;
|
package com.czlis.liswork.mapper;
|
||||||
|
|
||||||
import com.czlis.common.core.domain.entity.lis.QcSample;
|
import com.czlis.common.core.domain.entity.lis.QcSample;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
public interface QcSampleMapper {
|
public interface QcSampleMapper {
|
||||||
void insert(QcSample qcSample);
|
void insert(QcSample qcSample);
|
||||||
void update(QcSample qcSample);
|
void update(QcSample qcSample);
|
||||||
void delete(QcSample qcSample);
|
void delete(QcSample qcSample);
|
||||||
|
void deletezkpph(QcSample qcSample);
|
||||||
|
void updatezkpph(@Param("yq") String yq, @Param("zkpph") String zkpph, @Param("zkph") String zkph,@Param("zkpphold") String zkpphold, @Param("zkphold") String zkphold);
|
||||||
QcSample queryOne(QcSample qcSample);
|
QcSample queryOne(QcSample qcSample);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -31,4 +31,5 @@ public interface LisWorkService {
|
|||||||
Result getnoitemresult(Date jyrq, String yq,String ybh);
|
Result getnoitemresult(Date jyrq, String yq,String ybh);
|
||||||
Result setiteminter(Date jyrq, String yq,String ybh,String xmdh,String xmdh0);
|
Result setiteminter(Date jyrq, String yq,String ybh,String xmdh,String xmdh0);
|
||||||
Result clearprintflag(Date jyrq, String yq,String ybh);
|
Result clearprintflag(Date jyrq, String yq,String ybh);
|
||||||
|
Result querybarcode(String sqh);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,12 +2,16 @@ package com.czlis.liswork.service;
|
|||||||
|
|
||||||
import com.czlis.common.core.domain.Result;
|
import com.czlis.common.core.domain.Result;
|
||||||
import com.czlis.common.core.domain.entity.lis.QcBatchno;
|
import com.czlis.common.core.domain.entity.lis.QcBatchno;
|
||||||
|
import com.czlis.common.core.domain.entity.lis.QcSample;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public interface QcBatchnoService {
|
public interface QcBatchnoService {
|
||||||
List<QcBatchno> queryList(QcBatchno qcBatchno);
|
List<QcBatchno> queryList(QcBatchno qcBatchno);
|
||||||
|
Result addBatchno(QcBatchno qcBatchno);
|
||||||
Result queryValList(String yq);
|
Result updateBatchno(QcBatchno qcBatchno);
|
||||||
|
Result delBatchno(QcBatchno qcBatchno);
|
||||||
|
Result saveQcSample(List<QcSample> qcSampleList);
|
||||||
|
Result queryValList(String yq,String zkpph,String zkph);
|
||||||
|
Result queryValXmdh(String yq,String zkpph,String zkph,String xmdh);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,27 +1,18 @@
|
|||||||
package com.czlis.liswork.service;
|
package com.czlis.liswork.service;
|
||||||
|
|
||||||
import com.czlis.common.core.domain.Result;
|
import com.czlis.common.core.domain.Result;
|
||||||
import com.czlis.common.core.domain.entity.lis.ComOpt;
|
import com.czlis.common.core.domain.entity.lis.*;
|
||||||
import com.czlis.common.core.domain.entity.lis.QcRules;
|
|
||||||
import com.czlis.common.core.domain.entity.lis.QcSample;
|
|
||||||
import com.czlis.common.core.domain.entity.lis.XmInfoNew;
|
|
||||||
import com.czlis.liswork.pojo.DTO.QcRulesDTO;
|
import com.czlis.liswork.pojo.DTO.QcRulesDTO;
|
||||||
import com.czlis.liswork.pojo.DTO.QcSampleDTO;
|
import com.czlis.liswork.pojo.DTO.QcSampleDTO;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public interface QualitySetService {
|
public interface QualitySetService {
|
||||||
Result saveOpt(List<ComOpt> comOptList);
|
|
||||||
|
|
||||||
Result saveQCItem(List<QcRulesDTO> QcRulesDTOList);
|
Result saveQCItem(List<QcRulesDTO> QcRulesDTOList);
|
||||||
|
|
||||||
Result queryRules(QcRules qcRules);
|
Result queryRules(QcRules qcRules);
|
||||||
|
|
||||||
Result queryDataFromSample(String yq);
|
Result queryDataFromSample(String yq);
|
||||||
|
Result saveQcFromSample(List<QcFrmsmpl> QcFrmsmpl);
|
||||||
Result queryQcSample(QcSample qcSample);
|
|
||||||
|
|
||||||
Result saveQcSample(QcSampleDTO qcSampleDTO);
|
|
||||||
|
|
||||||
Result deleteQcFromSample(String yq, String ybh);
|
Result deleteQcFromSample(String yq, String ybh);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import com.czlis.common.core.domain.entity.*;
|
|||||||
import com.czlis.common.core.domain.entity.lis.*;
|
import com.czlis.common.core.domain.entity.lis.*;
|
||||||
import com.czlis.common.enums.UserStatus;
|
import com.czlis.common.enums.UserStatus;
|
||||||
import com.czlis.common.exception.ServiceException;
|
import com.czlis.common.exception.ServiceException;
|
||||||
|
import com.czlis.common.utils.DateUtils;
|
||||||
import com.czlis.common.utils.MessageUtils;
|
import com.czlis.common.utils.MessageUtils;
|
||||||
import com.czlis.common.utils.SecurityUtils;
|
import com.czlis.common.utils.SecurityUtils;
|
||||||
import com.czlis.common.utils.StringUtils;
|
import com.czlis.common.utils.StringUtils;
|
||||||
@ -12,6 +13,8 @@ import com.czlis.interfaceCommon.constants.ComLogConstants;
|
|||||||
import com.czlis.interfaceCommon.constants.LabReqmainConstants;
|
import com.czlis.interfaceCommon.constants.LabReqmainConstants;
|
||||||
import com.czlis.interfaceCommon.constants.LisinterfaceNameConstants;
|
import com.czlis.interfaceCommon.constants.LisinterfaceNameConstants;
|
||||||
import com.czlis.interfaceCommon.pojo.entity.LastLabPatParam;
|
import com.czlis.interfaceCommon.pojo.entity.LastLabPatParam;
|
||||||
|
import com.czlis.interfaceCommon.pojo.inter.GetReqInterface;
|
||||||
|
import com.czlis.interfaceCommon.pojo.inter.SetReqStatus;
|
||||||
import com.czlis.interfaceCommon.utils.*;
|
import com.czlis.interfaceCommon.utils.*;
|
||||||
import com.czlis.liswork.mapper.LisWorkMapper;
|
import com.czlis.liswork.mapper.LisWorkMapper;
|
||||||
|
|
||||||
@ -37,7 +40,8 @@ public class LisWorkServiceImpl implements LisWorkService {
|
|||||||
ReportUtil reportUtil;
|
ReportUtil reportUtil;
|
||||||
@Autowired
|
@Autowired
|
||||||
LisWorkUtils lisWorkUtils;
|
LisWorkUtils lisWorkUtils;
|
||||||
|
@Autowired
|
||||||
|
LisInterfaceUtil lisInterfaceUtil;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result getXmInfo(String yq) {
|
public Result getXmInfo(String yq) {
|
||||||
@ -607,4 +611,66 @@ public class LisWorkServiceImpl implements LisWorkService {
|
|||||||
}
|
}
|
||||||
return new Result("0", "成功!");
|
return new Result("0", "成功!");
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
|
public Result querybarcode(String sqh) {
|
||||||
|
String yhdh = SecurityUtils.getUsername();
|
||||||
|
LabReqmain labReqmainOne = commonUtil.getLabReqmainOne(sqh);
|
||||||
|
if (labReqmainOne == null) {
|
||||||
|
//1.调用接口,获取申请单信息
|
||||||
|
GetReqInterface getReqInterface = new GetReqInterface();
|
||||||
|
getReqInterface.setSqh(sqh);
|
||||||
|
getReqInterface.setBrdh("");
|
||||||
|
getReqInterface.setDept("");
|
||||||
|
getReqInterface.setUserid(yhdh);
|
||||||
|
getReqInterface.setEtime("");
|
||||||
|
getReqInterface.setEtime("");
|
||||||
|
getReqInterface.setYljg(loginConfigParamUtil.getLoginConfigParam().getLoginYLJG());
|
||||||
|
getReqInterface.setIp(SecurityUtils.getLoginUser().getIpaddr());
|
||||||
|
lisInterfaceUtil.invokeLisInterface(LisinterfaceNameConstants.GETREQINTERFACE, getReqInterface);
|
||||||
|
labReqmainOne = commonUtil.getLabReqmainOne(sqh);
|
||||||
|
}
|
||||||
|
if (labReqmainOne == null) return new Result("-1", "没有获取到申请单信息!");
|
||||||
|
String zt = labReqmainOne.getZt().trim();
|
||||||
|
if ("9".equals(zt)) return new Result("-1", "当前条码已经作废,禁止签收!");
|
||||||
|
String RCV_BBSJBL= commonUtil.getComOptValue("_BAR_","RCV_BBSJBL");
|
||||||
|
if("1".equals(RCV_BBSJBL)) {
|
||||||
|
Date bbsjsj=labReqmainOne.getBbsjsj();
|
||||||
|
if(bbsjsj!=null)return new Result("-1", "当前条码未送检登记,禁止签收!");
|
||||||
|
}
|
||||||
|
String RCV_CYBL= commonUtil.getComOptValue("_BAR_","RCV_CYBL");
|
||||||
|
if("1".equals(RCV_CYBL)) {
|
||||||
|
Date cysj=labReqmainOne.getCysj();
|
||||||
|
if(cysj!=null)return new Result("-1", "当前条码未采样登记,禁止签收!");
|
||||||
|
}
|
||||||
|
if ("2".equals(zt)) {
|
||||||
|
String RCV_RE= commonUtil.getComOptValue("_BAR_","RCV_RE");
|
||||||
|
if(!"1".equals(RCV_RE)) {
|
||||||
|
Date jssj=labReqmainOne.getJssj();
|
||||||
|
String sj= DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss",jssj);
|
||||||
|
return new Result("-1", "当前条码已签收过了,禁止签收,上次签收时间为:"+sj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
int zx=reqbilling(labReqmainOne);
|
||||||
|
if(zx==-1)return new Result("-1", "申请单执行失败,禁止签收!");
|
||||||
|
if ("2".equals(zt)){
|
||||||
|
Date jssj=labReqmainOne.getJssj();
|
||||||
|
String sj= DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss",jssj);
|
||||||
|
return new Result("3", "当前条码已签收过了时间为:"+sj,labReqmainOne);
|
||||||
|
}
|
||||||
|
return new Result("0", "成功!",labReqmainOne);
|
||||||
|
}
|
||||||
|
public int reqbilling(LabReqmain labReqmain){
|
||||||
|
String yhdh = SecurityUtils.getUsername();
|
||||||
|
String sqh=labReqmain.getSqh();
|
||||||
|
//3.调用his执行申请单
|
||||||
|
SetReqStatus setReqStatus = new SetReqStatus();
|
||||||
|
setReqStatus.setIp("");
|
||||||
|
setReqStatus.setSqh(sqh);
|
||||||
|
setReqStatus.setUserid(yhdh);
|
||||||
|
setReqStatus.setStatus(LabReqmainConstants.SIGNFOR);
|
||||||
|
Result result = lisInterfaceUtil.invokeLisInterface(LisinterfaceNameConstants.SETREQSTATUS, setReqStatus);
|
||||||
|
if (!result.getCode().equals("0")) return -1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,20 +2,27 @@ package com.czlis.liswork.service.impl.qc;
|
|||||||
|
|
||||||
import com.czlis.common.core.domain.Result;
|
import com.czlis.common.core.domain.Result;
|
||||||
import com.czlis.common.core.domain.entity.lis.QcBatchno;
|
import com.czlis.common.core.domain.entity.lis.QcBatchno;
|
||||||
|
import com.czlis.common.core.domain.entity.lis.QcSample;
|
||||||
import com.czlis.liswork.mapper.QcBatchnoMapper;
|
import com.czlis.liswork.mapper.QcBatchnoMapper;
|
||||||
|
import com.czlis.liswork.mapper.QcSampleMapper;
|
||||||
import com.czlis.liswork.service.QcBatchnoService;
|
import com.czlis.liswork.service.QcBatchnoService;
|
||||||
|
import lombok.Data;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class QcBatchnoServiceImpl implements QcBatchnoService {
|
public class QcBatchnoServiceImpl implements QcBatchnoService {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private QcBatchnoMapper qcBatchnoMapper;
|
private QcBatchnoMapper qcBatchnoMapper;
|
||||||
|
@Autowired
|
||||||
|
QcSampleMapper qcSampleMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<QcBatchno> queryList(QcBatchno qcBatchno) {
|
public List<QcBatchno> queryList(QcBatchno qcBatchno) {
|
||||||
@ -24,10 +31,68 @@ public class QcBatchnoServiceImpl implements QcBatchnoService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result queryValList(String yq) {
|
public Result queryValList(String yq,String zkpph,String zkph) {
|
||||||
List<Map<String, Object>> mapList = qcBatchnoMapper.qcSampleList(yq);
|
List<Map<String, Object>> mapList = qcBatchnoMapper.qcSampleList(yq,zkpph,zkph);
|
||||||
return new Result("0","获取数据成功!",mapList);
|
return new Result("0","获取数据成功!",mapList);
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
|
public Result queryValXmdh(String yq,String zkpph,String zkph,String xmdh) {
|
||||||
|
List<Map<String, Object>> mapList = qcBatchnoMapper.qcSampleByXmdh(yq,zkpph,zkph,xmdh);
|
||||||
|
return new Result("0","获取数据成功!",mapList);
|
||||||
|
}
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
@Override
|
||||||
|
public Result addBatchno(QcBatchno qcBatchno){
|
||||||
|
qcBatchnoMapper.insert(qcBatchno);
|
||||||
|
return new Result("0","成功!");
|
||||||
|
}
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
@Override
|
||||||
|
public Result updateBatchno(QcBatchno qcBatchno){
|
||||||
|
String yq=qcBatchno.getYq();
|
||||||
|
String zkpph=qcBatchno.getZkpph();
|
||||||
|
String zkph=qcBatchno.getZkph();
|
||||||
|
String zkpphold=qcBatchno.getZkpphold();
|
||||||
|
String zkphold=qcBatchno.getZkphold();
|
||||||
|
if(zkpphold!=null&&zkphold!=null) {
|
||||||
|
if(!zkpphold.equals(zkpph)||!zkphold.equals(zkph)) {
|
||||||
|
qcSampleMapper.updatezkpph(yq, zkpph, zkph, zkpphold, zkphold);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
qcBatchnoMapper.update(qcBatchno);
|
||||||
|
return new Result("0","成功!");
|
||||||
|
}
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
@Override
|
||||||
|
public Result delBatchno(QcBatchno qcBatchno) {
|
||||||
|
String yq=qcBatchno.getYq();
|
||||||
|
String zkpph=qcBatchno.getZkpph();
|
||||||
|
String zkph=qcBatchno.getZkph();
|
||||||
|
Date ksrq=qcBatchno.getStartda();
|
||||||
|
QcSample qcSample=new QcSample();
|
||||||
|
qcSample.setYq(yq);
|
||||||
|
qcSample.setZkpph(zkpph);
|
||||||
|
qcSample.setZkph(zkph);
|
||||||
|
qcSample.setKsrq(ksrq);
|
||||||
|
qcSampleMapper.deletezkpph(qcSample);
|
||||||
|
qcBatchnoMapper.delete(qcBatchno);
|
||||||
|
return new Result("0","成功!");
|
||||||
|
}
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
@Override
|
||||||
|
public Result saveQcSample(List<QcSample> qcSampleList0) {
|
||||||
|
List<QcSample> qcSampleList=qcSampleList0.stream().filter(ss->ss.getZkbz()!=null&&!"".equals(ss.getZkbz())).collect(Collectors.toList());
|
||||||
|
if(qcSampleList != null && !qcSampleList.isEmpty()){
|
||||||
|
for (QcSample qcSample : qcSampleList) {
|
||||||
|
QcSample qcSample1 = qcSampleMapper.queryOne(qcSample);
|
||||||
|
if(qcSample1 == null){
|
||||||
|
qcSampleMapper.insert(qcSample);
|
||||||
|
}else{
|
||||||
|
qcSampleMapper.update(qcSample);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return new Result("0","保存数据成功!");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,8 +23,6 @@ import java.util.List;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
public class QualitySetServiceImpl implements QualitySetService {
|
public class QualitySetServiceImpl implements QualitySetService {
|
||||||
|
|
||||||
@Autowired
|
|
||||||
ComOptMapper comOptMapper;
|
|
||||||
@Autowired
|
@Autowired
|
||||||
ReportItemMapper reportItemMapper;
|
ReportItemMapper reportItemMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
@ -34,27 +32,6 @@ public class QualitySetServiceImpl implements QualitySetService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
QcSampleMapper qcSampleMapper;
|
QcSampleMapper qcSampleMapper;
|
||||||
|
|
||||||
@Override
|
|
||||||
public Result saveOpt(List<ComOpt> comOptList) {
|
|
||||||
for (ComOpt comOpt : comOptList) {
|
|
||||||
String yq = comOpt.getYq();
|
|
||||||
String xxdh = comOpt.getXxdh();
|
|
||||||
if(yq == null) return new Result("-1","仪器参数不能为空!");
|
|
||||||
if(xxdh == null) return new Result("-1","参数代码不能为空!");
|
|
||||||
ComOpt comOptOne = comOptMapper.getComOptOne(yq, xxdh);
|
|
||||||
if(comOptOne == null) {
|
|
||||||
comOpt.setXxlb("QC");
|
|
||||||
comOpt.setXxdh("QCRULES");
|
|
||||||
comOpt.setBz("在用的质控规则");
|
|
||||||
comOptMapper.add(comOpt);
|
|
||||||
}else{
|
|
||||||
comOptMapper.update(comOpt);
|
|
||||||
}
|
|
||||||
//设置缓存
|
|
||||||
ComOptionUtils.setOptCache(yq, xxdh, comOpt);
|
|
||||||
}
|
|
||||||
return new Result("0","修改成功!");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@Override
|
@Override
|
||||||
@ -110,28 +87,9 @@ public class QualitySetServiceImpl implements QualitySetService {
|
|||||||
return new Result("0","查询成功!",qcFrmsmplList);
|
return new Result("0","查询成功!",qcFrmsmplList);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Result queryQcSample(QcSample qcSample) {
|
|
||||||
List<QcSample> qcSampleList = qcRulesMapper.queryQcSample(qcSample);
|
|
||||||
return new Result("0","查询成功!",qcSampleList);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@Override
|
@Override
|
||||||
public Result saveQcSample(QcSampleDTO qcSampleDTO) {
|
public Result saveQcFromSample(List<QcFrmsmpl> qcFrmsmplList) {
|
||||||
List<QcSample> qcSampleList = qcSampleDTO.getQcSampleList();
|
|
||||||
List<QcFrmsmpl> qcFrmsmplList = qcSampleDTO.getQcFrmsmplList();
|
|
||||||
if(qcSampleList != null && !qcSampleList.isEmpty()){
|
|
||||||
for (QcSample qcSample : qcSampleList) {
|
|
||||||
QcSample qcSample1 = qcSampleMapper.queryOne(qcSample);
|
|
||||||
if(qcSample1 == null){
|
|
||||||
qcSampleMapper.insert(qcSample);
|
|
||||||
}else{
|
|
||||||
qcSampleMapper.update(qcSample);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(qcFrmsmplList != null && qcFrmsmplList.size() > 0){
|
if(qcFrmsmplList != null && qcFrmsmplList.size() > 0){
|
||||||
for (QcFrmsmpl qcFrmsmpl : qcFrmsmplList) {
|
for (QcFrmsmpl qcFrmsmpl : qcFrmsmplList) {
|
||||||
QcFrmsmpl qcFrmsmpl1 = qcFrmsmplMapper.queryOne(qcFrmsmpl);
|
QcFrmsmpl qcFrmsmpl1 = qcFrmsmplMapper.queryOne(qcFrmsmpl);
|
||||||
@ -142,11 +100,9 @@ public class QualitySetServiceImpl implements QualitySetService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return new Result("0","保存数据成功!");
|
return new Result("0","保存数据成功!");
|
||||||
}
|
}
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@Override
|
@Override
|
||||||
public Result deleteQcFromSample(String yq, String ybh) {
|
public Result deleteQcFromSample(String yq, String ybh) {
|
||||||
QcFrmsmpl qcFrmsmpl = new QcFrmsmpl();
|
QcFrmsmpl qcFrmsmpl = new QcFrmsmpl();
|
||||||
|
|||||||
@ -9,19 +9,20 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<update id="update">
|
<update id="update">
|
||||||
update qc_batchno set
|
update qc_batchno SET
|
||||||
<if test="startda != null">startda = #{startda},</if>
|
startda = #{startda},
|
||||||
<if test="conc != null and conc != ''">conc = #{conc},</if>
|
conc = #{conc},
|
||||||
<if test="conc != null">conc = #{conc},</if>
|
conc = #{conc},
|
||||||
<if test="expiredt != null">expiredt = #{expiredt},</if>
|
expiredt = #{expiredt},
|
||||||
<if test="endda != null">endda = #{endda},</if>
|
endda = #{endda},
|
||||||
<if test="useflag != null and useflag != ''">useflag = #{useflag},</if>
|
useflag = #{useflag},
|
||||||
<if test="qcsrc != null and qcsrc != ''">qcsrc = #{qcsrc},</if>
|
qcsrc = #{qcsrc},
|
||||||
<if test="standsrc != null and standsrc != ''">standsrc = #{standsrc},</if>
|
standsrc = #{standsrc},
|
||||||
<if test="bk != null and bk != ''">bk = #{bk},</if>
|
bk = #{bk},
|
||||||
<if test="batchno != null and batchno != ''">batchno = #{batchno},</if>
|
batchno = #{batchno},
|
||||||
yq = #{yq}
|
zkpph = #{zkpph},
|
||||||
where yq = #{yq} and zkpph = #{zkpph} and zkph = #{zkph}
|
zkph = #{zkph}
|
||||||
|
where yq = #{yq} and zkpph = #{zkpphold} and zkph = #{zkphold}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<delete id="delete">
|
<delete id="delete">
|
||||||
@ -35,6 +36,33 @@
|
|||||||
|
|
||||||
|
|
||||||
<select id="qcSampleList" resultType="map">
|
<select id="qcSampleList" resultType="map">
|
||||||
|
SELECT xm_info.yq,
|
||||||
|
xm_info.xmdh,
|
||||||
|
xm_info.xmmc,
|
||||||
|
#{zkph} as zkph,
|
||||||
|
qc_sample.ksrq,
|
||||||
|
#{zkpph} as zkpph,
|
||||||
|
qc_sample.ld,
|
||||||
|
qc_sample.cv,
|
||||||
|
qc_sample.sd,
|
||||||
|
qc_sample.zkbz,
|
||||||
|
qc_sample.bc,
|
||||||
|
qc_sample.ff,
|
||||||
|
qc_sample.sjph,
|
||||||
|
qc_sample.sm,
|
||||||
|
qc_sample.bz1,
|
||||||
|
qc_sample.expiredt,
|
||||||
|
qc_sample.qcsrc,
|
||||||
|
qc_sample.standsrc,
|
||||||
|
qc_sample.outdt,
|
||||||
|
qc_sample.stopdate,isnull(qc_sample.qccv,xm_info.qccv) as qccv
|
||||||
|
FROM xm_info LEFT OUTER JOIN qc_sample
|
||||||
|
ON xm_info.yq = qc_sample.yq and qc_sample.xmdh = xm_info.xmdh and qc_sample.zkpph=#{zkpph} and qc_sample.zkph=#{zkph}
|
||||||
|
and qc_sample.ksrq=(select max(ksrq) from qc_sample x where x.yq=qc_sample.yq and x.zkpph=qc_sample.zkpph and x.zkph=qc_sample.zkph and x.xmdh=qc_sample.xmdh)
|
||||||
|
WHERE ( xm_info.yq = #{yq} ) AND ( xm_info.zkxm = 'Y' )
|
||||||
|
order by xm_info.dyxh
|
||||||
|
</select>
|
||||||
|
<select id="qcSampleByXmdh" resultType="map">
|
||||||
SELECT xm_info.yq,
|
SELECT xm_info.yq,
|
||||||
xm_info.xmdh,
|
xm_info.xmdh,
|
||||||
xm_info.xmmc,
|
xm_info.xmmc,
|
||||||
@ -54,12 +82,10 @@
|
|||||||
qc_sample.qcsrc,
|
qc_sample.qcsrc,
|
||||||
qc_sample.standsrc,
|
qc_sample.standsrc,
|
||||||
qc_sample.outdt,
|
qc_sample.outdt,
|
||||||
qc_sample.stopdate,qc_sample.qccv,
|
qc_sample.stopdate,isnull(qc_sample.qccv,xm_info.qccv) as qccv
|
||||||
0 as rowid
|
FROM xm_info JOIN qc_sample
|
||||||
FROM xm_info LEFT OUTER JOIN qc_sample ON xm_info.yq = qc_sample.yq and qc_sample.xmdh = '@'
|
ON xm_info.yq = qc_sample.yq and qc_sample.xmdh = xm_info.xmdh and qc_sample.zkpph=#{zkpph} and qc_sample.zkph=#{zkph}
|
||||||
WHERE ( xm_info.yq = #{yq} ) AND ( xm_info.zkxm = 'Y' )
|
WHERE ( xm_info.yq = #{yq} ) AND ( xm_info.zkxm = 'Y' ) AND ( xm_info.xmdh = #{xmdh})
|
||||||
order by xm_info.dyxh
|
order by xm_info.dyxh
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@ -7,10 +7,12 @@
|
|||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<update id="update">
|
<update id="update">
|
||||||
update qc_frmsmpl set
|
update qc_frmsmpl
|
||||||
|
<set>
|
||||||
<if test="zkph != null and zkph != ''">zkph = #{zkph},</if>
|
<if test="zkph != null and zkph != ''">zkph = #{zkph},</if>
|
||||||
<if test="cs != null">cs = #{cs},</if>
|
<if test="cs != null">cs = #{cs},</if>
|
||||||
<if test="batchno != null and batchno != ''">batchno = #{batchno},</if>
|
<if test="batchno != null and batchno != ''">batchno = #{batchno},</if>
|
||||||
|
</set>
|
||||||
where yq = #{yq} and ybh = #{ybh}
|
where yq = #{yq} and ybh = #{ybh}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
|||||||
@ -46,32 +46,36 @@
|
|||||||
|
|
||||||
<update id="update">
|
<update id="update">
|
||||||
update qc_sample set
|
update qc_sample set
|
||||||
<if test="zkpph != null and zkpph != ''">zkpph = #{zkpph},</if>
|
zkpph = #{zkpph},
|
||||||
<if test="ld != null and ld != ''">ld = #{ld},</if>
|
ld = #{ld},
|
||||||
<if test="cv != null">cv = #{cv},</if>
|
<if test="cv != null">cv = #{cv},</if>
|
||||||
<if test="sd != null">sd = #{sd},</if>
|
<if test="sd != null">sd = #{sd},</if>
|
||||||
<if test="zkbz != null">zkbz = #{zkbz},</if>
|
zkbz = #{zkbz},
|
||||||
<if test="bc != null and bc != ''">bc = #{bc},</if>
|
bc = #{bc},
|
||||||
<if test="ff != null and ff != ''">ff = #{ff},</if>
|
ff = #{ff},
|
||||||
<if test="sjph != null and sjph != ''">sjph = #{sjph},</if>
|
sjph = #{sjph},
|
||||||
<if test="sm != null and sm != ''">sm = #{sm},</if>
|
sm = #{sm},
|
||||||
<if test="bz1 != null and bz1 != ''">bz1 = #{bz1},</if>
|
bz1 = #{bz1},
|
||||||
<if test="endrq != null ">endrq = #{endrq},</if>
|
<if test="endrq != null ">endrq = #{endrq},</if>
|
||||||
<if test="standsrc != null and standsrc != ''">standsrc = #{standsrc},</if>
|
standsrc = #{standsrc},
|
||||||
<if test="outdt != null ">outdt = #{outdt},</if>
|
<if test="outdt != null ">outdt = #{outdt},</if>
|
||||||
<if test="stopdate != null ">stopdate = #{stopdate},</if>
|
<if test="stopdate != null ">stopdate = #{stopdate},</if>
|
||||||
<if test="qcsrc != null and qcsrc != ''">qcsrc = #{qcsrc},</if>
|
qcsrc = #{qcsrc},
|
||||||
<if test="expiredt != null ">expiredt = #{expiredt},</if>
|
<if test="expiredt != null ">expiredt = #{expiredt},</if>
|
||||||
<if test="qccv != null ">qccv = #{qccv},</if>
|
qccv = #{qccv}
|
||||||
yq = #{yq}, xmdh = #{xmdh}, zkph = #{zkph}, ksrq = #{ksrq}
|
|
||||||
where yq = #{yq} and xmdh = #{xmdh} and zkph = #{zkph} and ksrq = #{ksrq}
|
where yq = #{yq} and xmdh = #{xmdh} and zkph = #{zkph} and ksrq = #{ksrq}
|
||||||
</update>
|
</update>
|
||||||
|
<update id="updatezkpph">
|
||||||
|
update qc_sample set zkpph = #{zkpph}, zkph = #{zkph}
|
||||||
|
where yq = #{yq} and zkpph = #{zkpphold} and zkph = #{zkphold}
|
||||||
|
</update>
|
||||||
|
|
||||||
<delete id="delete">
|
<delete id="delete">
|
||||||
delete from qc_sample where yq = #{yq} and xmdh = #{xmdh} and zkph = #{zkph} and ksrq = #{ksrq}
|
delete from qc_sample where yq = #{yq} and xmdh = #{xmdh} and zkph = #{zkph} and ksrq = #{ksrq}
|
||||||
</delete>
|
</delete>
|
||||||
|
<delete id="deletezkpph">
|
||||||
|
delete from qc_sample where yq = #{yq} and zkpph = #{zkpph} and zkph = #{zkph}
|
||||||
|
</delete>
|
||||||
<select id="queryOne" resultType="com.czlis.common.core.domain.entity.lis.QcSample">
|
<select id="queryOne" resultType="com.czlis.common.core.domain.entity.lis.QcSample">
|
||||||
select * from qc_sample where yq = #{yq} and xmdh = #{xmdh} and zkph = #{zkph} and ksrq = #{ksrq}
|
select * from qc_sample where yq = #{yq} and xmdh = #{xmdh} and zkph = #{zkph} and ksrq = #{ksrq}
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user