QC
This commit is contained in:
parent
fa4fc32f1c
commit
d8c470b9f8
@ -0,0 +1,47 @@
|
||||
package com.czlis.common.core.domain.entity.lis;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class QcVal {
|
||||
private Integer qcValid;
|
||||
private String yq;
|
||||
private Date zkrq;
|
||||
private String xmdh;
|
||||
private String zkph;
|
||||
private String zkpph;
|
||||
private Integer cs;
|
||||
private String instrybh;
|
||||
private BigDecimal zkjg;
|
||||
private String yhdh;
|
||||
private String bz;
|
||||
private String resultid;
|
||||
private String outreason;
|
||||
private String outtransman;
|
||||
private Date inputdt;
|
||||
private String nouse;
|
||||
private Date modidt;
|
||||
private String modiusr;
|
||||
private String outflag;
|
||||
private String outtxt;
|
||||
private String bz1;
|
||||
private String isconfirm;
|
||||
private Date confirmdt;
|
||||
private String confirmuser;
|
||||
private String nodraw;
|
||||
private String nocalc;
|
||||
private String ifuse;
|
||||
private BigDecimal usrdata;
|
||||
private String sjcs;
|
||||
private String sjph;
|
||||
private String outresult;
|
||||
private BigDecimal skjg;
|
||||
private String zkjgS;
|
||||
}
|
||||
@ -0,0 +1,36 @@
|
||||
package com.czlis.liswork.controller.qc;
|
||||
|
||||
import com.czlis.common.core.controller.BaseController;
|
||||
import com.czlis.common.core.domain.Result;
|
||||
import com.czlis.common.core.domain.entity.lis.QcBatchno;
|
||||
import com.czlis.common.core.domain.entity.lis.QcSample;
|
||||
import com.czlis.common.core.domain.entity.lis.QcVal;
|
||||
import com.czlis.liswork.service.QcBatchnoService;
|
||||
import com.czlis.liswork.service.QcValService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/qc")
|
||||
@Slf4j
|
||||
@Api(tags = "质控数据")
|
||||
public class QcValController extends BaseController {
|
||||
@Autowired
|
||||
private QcValService qcValService;
|
||||
@ApiOperation("查询质控数据")
|
||||
@GetMapping("/getqcval")
|
||||
public Result getqcval(QcVal qcVal) {
|
||||
List<QcVal> qcValList = qcValService.queryList(qcVal);
|
||||
return new Result("0","获取数据成功!",qcValList);
|
||||
}
|
||||
@ApiOperation("保存质控数据")
|
||||
@PostMapping("/saveqcval")
|
||||
public Result saveQcVal(@RequestBody List<QcVal> qcVal){
|
||||
return qcValService.saveQcVal(qcVal);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package com.czlis.liswork.mapper;
|
||||
|
||||
import com.czlis.common.core.domain.entity.lis.QcVal;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface QcValMapper {
|
||||
void insert(QcVal qcVal);
|
||||
void update(QcVal qcVal);
|
||||
void delete(QcVal qcVal);
|
||||
void deleteById(Integer qcValid);
|
||||
QcVal queryById(Integer qcValid);
|
||||
QcVal queryOne(QcVal qcVal);
|
||||
List<QcVal> query(QcVal qcVal);
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
package com.czlis.liswork.service;
|
||||
|
||||
import com.czlis.common.core.domain.Result;
|
||||
import com.czlis.common.core.domain.entity.lis.QcVal;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface QcValService {
|
||||
List<QcVal> queryList(QcVal qcVal);
|
||||
Result saveQcVal(List<QcVal> qcValList);
|
||||
}
|
||||
@ -0,0 +1,45 @@
|
||||
package com.czlis.liswork.service.impl.qc;
|
||||
|
||||
import com.czlis.common.core.domain.Result;
|
||||
import com.czlis.common.core.domain.entity.lis.QcVal;
|
||||
import com.czlis.liswork.mapper.QcValMapper;
|
||||
import com.czlis.liswork.service.QcValService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class QcValServiceImpl implements QcValService {
|
||||
@Autowired
|
||||
private QcValMapper qcValMapper;
|
||||
@Override
|
||||
public List<QcVal> queryList(QcVal qcVal){
|
||||
return qcValMapper.query(qcVal);
|
||||
}
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public Result saveQcVal(List<QcVal> qcValList) {
|
||||
if(qcValList != null && !qcValList.isEmpty()){
|
||||
for (QcVal qcVal : qcValList) {
|
||||
BigDecimal zkjg= qcVal.getZkjg();
|
||||
QcVal qcVal1 = qcValMapper.queryOne(qcVal);
|
||||
if (zkjg==null){
|
||||
if (qcVal1 != null) {
|
||||
qcValMapper.deleteById(qcVal1.getQcValid());
|
||||
}
|
||||
}else {
|
||||
if (qcVal1 == null) {
|
||||
qcValMapper.insert(qcVal);
|
||||
} else {
|
||||
qcVal.setQcValid(qcVal.getQcValid());
|
||||
qcValMapper.update(qcVal);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return new Result("0","保存数据成功!");
|
||||
}
|
||||
}
|
||||
114
liswork/src/main/resources/mapper/QcValMapper.xml
Normal file
114
liswork/src/main/resources/mapper/QcValMapper.xml
Normal file
@ -0,0 +1,114 @@
|
||||
<?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.QcValMapper">
|
||||
<insert id="insert">
|
||||
insert into qc_val ( yq, zkrq,
|
||||
xmdh, zkph, zkpph,
|
||||
cs, instrybh, zkjg,
|
||||
yhdh, bz, resultid,
|
||||
outreason, outtransman, inputdt,
|
||||
nouse, modidt, modiusr,
|
||||
outflag, outtxt, bz1,
|
||||
isconfirm, confirmdt, confirmuser,
|
||||
nodraw, nocalc, ifuse, usrdata,
|
||||
sjcs, sjph, outresult,
|
||||
skjg, zkjg_s)
|
||||
values ( #{yq}, #{zkrq},
|
||||
#{xmdh}, #{zkph}, #{zkpph},
|
||||
#{cs}, #{instrybh}, #{zkjg},
|
||||
#{yhdh}, #{bz}, #{resultid},
|
||||
#{outreason}, #{outtransman}, #{inputdt},
|
||||
#{nouse}, #{modidt}, #{modiusr},
|
||||
#{outflag}, #{outtxt}, #{bz1},
|
||||
#{isconfirm}, #{confirmdt}, #{confirmuser},
|
||||
#{nodraw}, #{nocalc}, #{ifuse}, #{usrdata},
|
||||
#{sjcs}, #{sjph}, #{outresult},
|
||||
#{skjg}, #{zkjgS})
|
||||
</insert>
|
||||
|
||||
<update id="update">
|
||||
update qc_val
|
||||
set yq = #{yq},
|
||||
zkrq = #{zkrq},
|
||||
xmdh = #{xmdh},
|
||||
zkph = #{zkph},
|
||||
zkpph = #{zkpph},
|
||||
cs = #{cs},
|
||||
instrybh = #{instrybh},
|
||||
zkjg = #{zkjg},
|
||||
yhdh = #{yhdh},
|
||||
bz = #{bz},
|
||||
resultid = #{resultid},
|
||||
outreason = #{outreason},
|
||||
outtransman = #{outtransman},
|
||||
inputdt = #{inputdt},
|
||||
nouse = #{nouse},
|
||||
modidt = #{modidt},
|
||||
modiusr = #{modiusr},
|
||||
outflag = #{outflag},
|
||||
outtxt = #{outtxt},
|
||||
bz1 = #{bz1},
|
||||
isconfirm = #{isconfirm},
|
||||
confirmdt = #{confirmdt},
|
||||
confirmuser = #{confirmuser},
|
||||
nodraw = #{nodraw},
|
||||
nocalc = #{nocalc},
|
||||
ifuse = #{ifuse},
|
||||
usrdata = #{usrdata},
|
||||
sjcs = #{sjcs},
|
||||
sjph = #{sjph},
|
||||
outresult = #{outresult},
|
||||
skjg = #{skjg},
|
||||
zkjg_s = #{zkjgS}
|
||||
where qc_valid = #{qcValid}
|
||||
</update>
|
||||
|
||||
<delete id="delete">
|
||||
delete from qc_val where yq = #{yq} and
|
||||
<where>
|
||||
<if test="zkrq != null and zkrq != ''">
|
||||
and zkrq = #{zkrq}
|
||||
</if>
|
||||
<if test="xmdh != null and xmdh != ''">
|
||||
and xmdh = #{xmdh}
|
||||
</if>
|
||||
<if test="zkph != null and zkph != ''">
|
||||
and zkph = #{zkph}
|
||||
</if>
|
||||
<if test="cs != null and cs != ''">
|
||||
and cs = #{cs}
|
||||
</if>
|
||||
</where>
|
||||
</delete>
|
||||
<delete id="deleteById">
|
||||
delete from qc_val where qc_valid = #{qcValid}
|
||||
</delete>
|
||||
<select id="queryOne" resultType="com.czlis.common.core.domain.entity.lis.QcVal">
|
||||
select * from qc_val where yq = #{yq} and xmdh = #{xmdh} and zkph = #{zkph} and zkrq = #{zkrq} and cs = #{cs}
|
||||
</select>
|
||||
<select id="queryById" resultType="com.czlis.common.core.domain.entity.lis.QcVal">
|
||||
select * from qc_val where qc_valid = #{qcValid}
|
||||
</select>
|
||||
<select id="query" resultType="com.czlis.common.core.domain.entity.lis.QcVal">
|
||||
select * from qc_val
|
||||
<where>
|
||||
<if test="zkrq != null and zkrq != ''">
|
||||
and zkrq = #{zkrq}
|
||||
</if>
|
||||
<if test="yq != null and yq != ''">
|
||||
and yq = #{yq}
|
||||
</if>
|
||||
<if test="xmdh != null and xmdh != ''">
|
||||
and xmdh = #{xmdh}
|
||||
</if>
|
||||
<if test="zkph != null and zkph != ''">
|
||||
and zkph = #{zkph}
|
||||
</if>
|
||||
<if test="cs != null and cs != ''">
|
||||
and cs = #{cs}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Loading…
x
Reference in New Issue
Block a user