质控参数维护
This commit is contained in:
parent
c335ce54c7
commit
c3cc37a605
@ -0,0 +1,15 @@
|
|||||||
|
package com.czlis.common.core.domain.entity.lis;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class QcRules {
|
||||||
|
private String yq;
|
||||||
|
private String xmdh;
|
||||||
|
private String rules;
|
||||||
|
private String bz;
|
||||||
|
}
|
||||||
@ -2,15 +2,15 @@ package com.czlis.liswork.controller.qc;
|
|||||||
|
|
||||||
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.QcRules;
|
||||||
|
import com.czlis.common.core.domain.entity.lis.XmInfoNew;
|
||||||
|
import com.czlis.liswork.pojo.DTO.QcRulesDTO;
|
||||||
import com.czlis.liswork.service.QualitySetService;
|
import com.czlis.liswork.service.QualitySetService;
|
||||||
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.PostMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -35,9 +35,14 @@ public class QualitySetController {
|
|||||||
|
|
||||||
@ApiOperation("保存质控项目数据")
|
@ApiOperation("保存质控项目数据")
|
||||||
@PostMapping("/saveQCItem")
|
@PostMapping("/saveQCItem")
|
||||||
public Result saveQCItem(){
|
public Result saveQCItem(@RequestBody List<QcRulesDTO> QcRulesDTOList){
|
||||||
//return qualitySetService.saveQCItem();
|
return qualitySetService.saveQCItem(QcRulesDTOList);
|
||||||
return null;
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询项目的质控规则")
|
||||||
|
@GetMapping("/queryRules")
|
||||||
|
public Result queryRules(QcRules qcRules){
|
||||||
|
return qualitySetService.queryRules(qcRules);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,11 @@
|
|||||||
|
package com.czlis.liswork.mapper;
|
||||||
|
|
||||||
|
import com.czlis.common.core.domain.entity.lis.QcRules;
|
||||||
|
|
||||||
|
public interface QcRulesMapper {
|
||||||
|
|
||||||
|
QcRules queryOne(QcRules qcRules);
|
||||||
|
void insert(QcRules qcRules);
|
||||||
|
void update(QcRules qcRules);
|
||||||
|
void delete(QcRules qcRules);
|
||||||
|
}
|
||||||
@ -32,7 +32,7 @@ public interface ReportItemMapper {
|
|||||||
void deleteXmValNew(XmValNew xmValNew);
|
void deleteXmValNew(XmValNew xmValNew);
|
||||||
|
|
||||||
Long getXmInfoVsCount(Integer xmid);
|
Long getXmInfoVsCount(Integer xmid);
|
||||||
|
void updateXmInfoNew1(XmInfoNew xmInfoNew);
|
||||||
void updateXmInfoNew(XmInfoNew xmInfoNewRow);
|
void updateXmInfoNew(XmInfoNew xmInfoNewRow);
|
||||||
void updateXmDoubleRow(XmDouble xmDoubleRow);
|
void updateXmDoubleRow(XmDouble xmDoubleRow);
|
||||||
void updateXmInterRow(XmInter xmInterRow);
|
void updateXmInterRow(XmInter xmInterRow);
|
||||||
|
|||||||
@ -0,0 +1,15 @@
|
|||||||
|
package com.czlis.liswork.pojo.DTO;
|
||||||
|
|
||||||
|
import com.czlis.common.core.domain.entity.lis.QcRules;
|
||||||
|
import com.czlis.common.core.domain.entity.lis.XmInfoNew;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class QcRulesDTO {
|
||||||
|
private QcRules qcRules;
|
||||||
|
private XmInfoNew xmInfoNew;
|
||||||
|
}
|
||||||
@ -2,9 +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.ComOpt;
|
import com.czlis.common.core.domain.entity.lis.ComOpt;
|
||||||
|
import com.czlis.common.core.domain.entity.lis.QcRules;
|
||||||
|
import com.czlis.common.core.domain.entity.lis.XmInfoNew;
|
||||||
|
import com.czlis.liswork.pojo.DTO.QcRulesDTO;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public interface QualitySetService {
|
public interface QualitySetService {
|
||||||
Result saveOpt(List<ComOpt> comOptList);
|
Result saveOpt(List<ComOpt> comOptList);
|
||||||
|
|
||||||
|
Result saveQCItem(List<QcRulesDTO> QcRulesDTOList);
|
||||||
|
|
||||||
|
Result queryRules(QcRules qcRules);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,12 +2,19 @@ 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.ComOpt;
|
import com.czlis.common.core.domain.entity.lis.ComOpt;
|
||||||
|
import com.czlis.common.core.domain.entity.lis.QcRules;
|
||||||
|
import com.czlis.common.core.domain.entity.lis.XmInfoNew;
|
||||||
|
import com.czlis.common.core.domain.entity.lis.XmInfoVs;
|
||||||
import com.czlis.common.utils.ComOptionUtils;
|
import com.czlis.common.utils.ComOptionUtils;
|
||||||
import com.czlis.interfaceCommon.mapper.ComOptMapper;
|
import com.czlis.interfaceCommon.mapper.ComOptMapper;
|
||||||
|
import com.czlis.liswork.mapper.QcRulesMapper;
|
||||||
|
import com.czlis.liswork.mapper.dict.ReportItemMapper;
|
||||||
|
import com.czlis.liswork.pojo.DTO.QcRulesDTO;
|
||||||
import com.czlis.liswork.service.QualitySetService;
|
import com.czlis.liswork.service.QualitySetService;
|
||||||
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.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -17,6 +24,10 @@ public class QualitySetServiceImpl implements QualitySetService {
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
ComOptMapper comOptMapper;
|
ComOptMapper comOptMapper;
|
||||||
|
@Autowired
|
||||||
|
ReportItemMapper reportItemMapper;
|
||||||
|
@Autowired
|
||||||
|
QcRulesMapper qcRulesMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result saveOpt(List<ComOpt> comOptList) {
|
public Result saveOpt(List<ComOpt> comOptList) {
|
||||||
@ -39,4 +50,44 @@ public class QualitySetServiceImpl implements QualitySetService {
|
|||||||
}
|
}
|
||||||
return new Result("0","修改成功!");
|
return new Result("0","修改成功!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
@Override
|
||||||
|
public Result saveQCItem(List<QcRulesDTO> QcRulesDTOList) {
|
||||||
|
for (QcRulesDTO qcRulesDTO : QcRulesDTOList) {
|
||||||
|
XmInfoNew xmInfoNew = qcRulesDTO.getXmInfoNew();
|
||||||
|
QcRules qcRules = qcRulesDTO.getQcRules();
|
||||||
|
String yq = xmInfoNew.getYq();
|
||||||
|
String xmdh = xmInfoNew.getXmdh();
|
||||||
|
if(yq == null) return new Result("-1","仪器参数不能为空!");
|
||||||
|
if(xmdh == null) return new Result("-1","项目代号不能为空!");
|
||||||
|
XmInfoNew xmInfoNew1 = new XmInfoNew();
|
||||||
|
xmInfoNew1.setYq(yq);
|
||||||
|
xmInfoNew1.setXmdh(xmdh);
|
||||||
|
List<XmInfoNew> xmInfoNewOneList = reportItemMapper.query(xmInfoNew1);
|
||||||
|
if(xmInfoNewOneList.size() <= 0) return new Result("-1","没有查询到xm_info表中的数据!");
|
||||||
|
reportItemMapper.updateXmInfoNew1(xmInfoNew);
|
||||||
|
Integer xmid = xmInfoNewOneList.get(0).getXmid();
|
||||||
|
XmInfoVs xmInfoVs = new XmInfoVs();
|
||||||
|
xmInfoVs.setZkxm(xmInfoNew.getZkxm());
|
||||||
|
xmInfoVs.setYq(xmInfoNew.getYq());
|
||||||
|
xmInfoVs.setXmid(xmid);
|
||||||
|
reportItemMapper.updateXminfoVs(xmInfoVs);
|
||||||
|
//保存质控规则
|
||||||
|
QcRules qcRules1 = qcRulesMapper.queryOne(qcRules);
|
||||||
|
if(qcRules1 == null) {
|
||||||
|
qcRulesMapper.insert(qcRules);
|
||||||
|
}else{
|
||||||
|
qcRulesMapper.update(qcRules);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
return new Result("0","修改数据成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result queryRules(QcRules qcRules) {
|
||||||
|
QcRules qcRulesOne = qcRulesMapper.queryOne(qcRules);
|
||||||
|
return new Result("0","获取数据成功!",qcRulesOne);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
21
liswork/src/main/resources/mapper/QcRulesMapper.xml
Normal file
21
liswork/src/main/resources/mapper/QcRulesMapper.xml
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||||
|
<mapper namespace="com.czlis.liswork.mapper.QcRulesMapper">
|
||||||
|
<select id="queryOne" resultType="com.czlis.common.core.domain.entity.lis.QcRules">
|
||||||
|
select * from qc_rules where yq = #{yq} and xmdh = #{xmdh}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insert">
|
||||||
|
insert into qc_rules(yq, xmdh, rules, bz) values (#{yq},#{xmdh},#{rules},#{bz})
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="update">
|
||||||
|
update qc_rules set rules = #{rules}, bz = #{bz} where yq = #{yq} and xmdh = #{xmdh}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="delete">
|
||||||
|
delete from qc_rules where yq = #{yq} and xmdh = #{xmdh}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@ -403,6 +403,16 @@
|
|||||||
where xmid = #{xmid}
|
where xmid = #{xmid}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<update id="updateXmInfoNew1">
|
||||||
|
update xm_info_new set
|
||||||
|
<if test="zkxm != null and zkxm != ''">zkxm = #{zkxm},</if>
|
||||||
|
<if test="qcuselog != null and qcuselog != ''">qcuselog = #{qcuselog},</if>
|
||||||
|
<if test="qcusepos != null and qcusepos != ''">qcusepos = #{qcusepos},</if>
|
||||||
|
<if test="qccv != null and qccv != ''">qccv = #{qccv},</if>
|
||||||
|
yq = #{yq}, xmdh = #{xmdh}
|
||||||
|
where yq = #{yq} and xmdh = #{xmdh}
|
||||||
|
</update>
|
||||||
|
|
||||||
<update id="updateXmDoubleRow">
|
<update id="updateXmDoubleRow">
|
||||||
update xm_double
|
update xm_double
|
||||||
<set>
|
<set>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user