Compare commits
No commits in common. "b72bc57fc0b2f8cc98caf270b41323aae8d7f9fd" and "56a0e0846f98799ca9c65e88ddfe7716ee19e6ff" have entirely different histories.
b72bc57fc0
...
56a0e0846f
@ -1,19 +0,0 @@
|
|||||||
package com.czlis.liswork.controller.qc;
|
|
||||||
|
|
||||||
import com.czlis.common.core.controller.BaseController;
|
|
||||||
import com.czlis.liswork.service.QcBatchnoService;
|
|
||||||
import com.czlis.liswork.service.QcGraphService;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/qc")
|
|
||||||
@Slf4j
|
|
||||||
@Api(tags = "质控批号设置")
|
|
||||||
public class QcGraphController extends BaseController {
|
|
||||||
@Autowired
|
|
||||||
private QcGraphService qcGraphService;
|
|
||||||
}
|
|
||||||
@ -1,18 +0,0 @@
|
|||||||
package com.czlis.liswork.mapper;
|
|
||||||
|
|
||||||
import com.czlis.common.core.domain.entity.lis.QcSample;
|
|
||||||
import com.czlis.liswork.pojo.DTO.QcGraphParamDTO;
|
|
||||||
import com.czlis.liswork.pojo.DTO.QcMonthstDTO;
|
|
||||||
import com.czlis.liswork.pojo.DTO.QcValDTO;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public interface QcGraphMapper {
|
|
||||||
List<QcSample> querysample(QcGraphParamDTO qcGraphParamDTO);
|
|
||||||
List<QcMonthstDTO> queryhead(QcGraphParamDTO qcGraphParamDTO);
|
|
||||||
List<QcMonthstDTO> queryhead1(QcGraphParamDTO qcGraphParamDTO);
|
|
||||||
List<QcValDTO> query(QcGraphParamDTO qcGraphParamDTO);
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,25 +0,0 @@
|
|||||||
package com.czlis.liswork.pojo.DTO;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
public class QcGraphParamDTO {
|
|
||||||
@ApiModelProperty(value = "*质控开始日期")
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
|
||||||
private Date zkrq1;
|
|
||||||
@ApiModelProperty(value = "*质控截止日期")
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
|
||||||
private Date zkrq2;
|
|
||||||
@ApiModelProperty(value = "*质控仪器")
|
|
||||||
private String yq;
|
|
||||||
@ApiModelProperty(value = "*质控品号")
|
|
||||||
private String zkph;
|
|
||||||
@ApiModelProperty(value = "*项目代号")
|
|
||||||
private String xmdh;
|
|
||||||
@ApiModelProperty(value = "*次数")
|
|
||||||
private Integer cs;
|
|
||||||
@ApiModelProperty(value = "质控品批号")
|
|
||||||
private String zkpph;
|
|
||||||
}
|
|
||||||
@ -1,53 +0,0 @@
|
|||||||
package com.czlis.liswork.pojo.DTO;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
public class QcValDTO {
|
|
||||||
private Long qc_valid;
|
|
||||||
@ApiModelProperty(value = "仪器")
|
|
||||||
private String yq;
|
|
||||||
@ApiModelProperty(value = "质控日期")
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
|
||||||
private Date zkrq;
|
|
||||||
@ApiModelProperty(value = "项目代码")
|
|
||||||
private String xmdh;
|
|
||||||
@ApiModelProperty(value = "质控号")
|
|
||||||
private String zkph;
|
|
||||||
@ApiModelProperty(value = "批号")
|
|
||||||
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;
|
|
||||||
private String xmmc;
|
|
||||||
private BigDecimal cv;
|
|
||||||
private BigDecimal sd;
|
|
||||||
private BigDecimal zkbz;
|
|
||||||
}
|
|
||||||
@ -1,4 +0,0 @@
|
|||||||
package com.czlis.liswork.service;
|
|
||||||
|
|
||||||
public interface QcGraphService {
|
|
||||||
}
|
|
||||||
@ -1,22 +0,0 @@
|
|||||||
package com.czlis.liswork.service.impl.qc;
|
|
||||||
|
|
||||||
import com.czlis.common.core.domain.Result;
|
|
||||||
import com.czlis.common.core.domain.entity.lis.QcSample;
|
|
||||||
import com.czlis.common.core.domain.entity.lis.QcVal;
|
|
||||||
import com.czlis.common.utils.SecurityUtils;
|
|
||||||
import com.czlis.liswork.mapper.QcSampleMapper;
|
|
||||||
import com.czlis.liswork.mapper.QcStatMapper;
|
|
||||||
import com.czlis.liswork.pojo.DTO.QcMonthstDTO;
|
|
||||||
import com.czlis.liswork.service.QcGraphService;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
@Service
|
|
||||||
public class QcGraphServiceImpl implements QcGraphService {
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -52,14 +52,12 @@ public class QcStatServiceImpl implements QcStatService {
|
|||||||
public Result queryMonthskzj(QcSample qcSample){
|
public Result queryMonthskzj(QcSample qcSample){
|
||||||
qcSample.setXmdh("_skxj_");
|
qcSample.setXmdh("_skxj_");
|
||||||
QcSample qcSample0 =qcSampleMapper.queryOne(qcSample);
|
QcSample qcSample0 =qcSampleMapper.queryOne(qcSample);
|
||||||
if(qcSample0==null) return new Result("0","成功");
|
|
||||||
return new Result("0","成功",qcSample0.getBz1());
|
return new Result("0","成功",qcSample0.getBz1());
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public Result queryMonthpj(QcSample qcSample){
|
public Result queryMonthpj(QcSample qcSample){
|
||||||
qcSample.setXmdh("_pj_");
|
qcSample.setXmdh("_pj_");
|
||||||
QcSample qcSample0 =qcSampleMapper.queryOne(qcSample);
|
QcSample qcSample0 =qcSampleMapper.queryOne(qcSample);
|
||||||
if(qcSample0==null) return new Result("0","成功");
|
|
||||||
return new Result("0","成功",qcSample0.getBz1());
|
return new Result("0","成功",qcSample0.getBz1());
|
||||||
}
|
}
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
|||||||
@ -1,92 +0,0 @@
|
|||||||
<?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.QcGraphMapper">
|
|
||||||
<select id="querysample" resultType="com.czlis.common.core.domain.entity.lis.QcSample">
|
|
||||||
select * from qc_sample
|
|
||||||
<where>
|
|
||||||
<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="zkpph != null and zkpph !=''">and zkpph = #{zkpph}</if>
|
|
||||||
<if test="yq != null and yq !=''">and yq = #{yq}</if>
|
|
||||||
<if test="yq != null and yq !=''">and yq = #{yq}</if>
|
|
||||||
<if test="zkrq1 != null">and ksrq >=(select max(ksrq) from qc_sample x where x.yq=qc_sample.yq and x.xmdh=qc_sample.xmdh and x.zkph=qc_sample.zkph and #{zkrq1}>=x.ksrq)</if>
|
|
||||||
<if test="zkrq2 != null">and #{zkrq2}>= ksrq </if>
|
|
||||||
</where>
|
|
||||||
and xmdh not in('_pj_','_skxj_') and (zkph not like '%bz' )
|
|
||||||
order by yq,xmdh,ksrq,zkph
|
|
||||||
</select>
|
|
||||||
<select id="query" resultType="com.czlis.liswork.pojo.DTO.QcValDTO">
|
|
||||||
SELECT qc_val.yq,qc_val.xmdh,xm_info.xmmc,xm_info.dyxh,qc_val.zkph,
|
|
||||||
qc_val.cs,qc_val.zkrq,qc_val.zkjg,isnull((select yhxm from com_usr where com_usr.yhdh=qc_val.yhdh),qc_val.yhdh) as yhdh,
|
|
||||||
qc_sample.zkbz,qc_sample.sd,qc_sample.cv
|
|
||||||
FROM qc_val join xm_info on xm_info.yq=qc_val.yq and xm_info.xmdh=qc_val.xmdh
|
|
||||||
join qc_sample on qc_sample.yq=qc_val.yq and qc_sample.xmdh=qc_val.xmdh and qc_sample.zkph=qc_val.zkph
|
|
||||||
and qc_sample.ksrq=(select max(ksrq) from qc_sample x
|
|
||||||
where x.yq=qc_val.yq and x.xmdh=qc_val.xmdh and x.zkph=qc_val.zkph and qc_val.zkrq>=x.ksrq)
|
|
||||||
<where>
|
|
||||||
<if test="yq != null and yq !=''">and qc_val.yq = #{yq}</if>
|
|
||||||
<if test="xmdh != null and xmdh !=''">and qc_val.xmdh = #{xmdh}</if>
|
|
||||||
<if test="zkph != null and zkph !=''">and qc_val.zkph = #{zkph}</if>
|
|
||||||
<if test="zkpph != null and zkpph !=''">and qc_sample.zkpph = #{zkpph}</if>
|
|
||||||
<if test="zkrq1 != null">and qc_val.ksrq>= #{zkrq1} </if>
|
|
||||||
<if test="zkrq2 != null">and #{zkrq2}>= qc_val.ksrq </if>
|
|
||||||
<if test="cs != null and cs !=10">and qc_val.cs = #{cs}</if>
|
|
||||||
</where>
|
|
||||||
order by qc_val.zkrq,qc_val.cs
|
|
||||||
</select>
|
|
||||||
<select id="queryhead" resultType="com.czlis.liswork.pojo.DTO.QcMonthstDTO">
|
|
||||||
SELECT qc_val.yq,qc_val.xmdh,xm_info.xmmc,xm_info.dyxh,qc_val.zkph,count(1) cnt,
|
|
||||||
sum((case when qc_val.zkjg>(zkbz + 3*sd) then 1 when (zkbz - 3*sd)>qc_val.zkjg then 1 when isnull(outreason,'')!='' then 1 else 0 end) ) as badcnt,
|
|
||||||
sum(case when isnull(bz,'')!='' then 1 else 0 end) as process,
|
|
||||||
cast(qc_sample.zkbz as decimal(12, 3)) as avg0,
|
|
||||||
cast(qc_sample.sd as decimal(12, 3)) as sd0,
|
|
||||||
cast(qc_sample.cv as decimal(12, 3)) as cv0,
|
|
||||||
cast(avg(zkjg) as decimal(12, 3)) avg1,
|
|
||||||
cast(STDEV(zkjg) as decimal(12, 3)) sd1,
|
|
||||||
cast(100*STDEV(zkjg)/avg(zkjg) as decimal(12, 3)) as cv1,
|
|
||||||
max(qc_sample.zkpph) as zkpph,
|
|
||||||
max(isnull(qc_sample.qccv,xm_info.qccv)) as qccv,
|
|
||||||
max(qc_sample.ld) as ld
|
|
||||||
FROM qc_val join xm_info on xm_info.yq=qc_val.yq and xm_info.xmdh=qc_val.xmdh
|
|
||||||
join qc_sample on qc_sample.yq=qc_val.yq and qc_sample.xmdh=qc_val.xmdh and qc_sample.zkph=qc_val.zkph
|
|
||||||
and qc_sample.ksrq=(select max(ksrq) from qc_sample x where x.yq=qc_val.yq and x.xmdh=qc_val.xmdh and x.zkph=qc_val.zkph and qc_val.zkrq>=x.ksrq)
|
|
||||||
<if test="yq != null and yq !=''">and qc_val.yq = #{yq}</if>
|
|
||||||
<if test="xmdh != null and xmdh !=''">and qc_val.xmdh = #{xmdh}</if>
|
|
||||||
<if test="zkph != null and zkph !=''">and qc_val.zkph = #{zkph}</if>
|
|
||||||
<if test="zkpph != null and zkpph !=''">and qc_sample.zkpph = #{zkpph}</if>
|
|
||||||
<if test="zkrq1 != null">and qc_val.ksrq>= #{zkrq1} </if>
|
|
||||||
<if test="zkrq2 != null">and #{zkrq2}>= qc_val.ksrq </if>
|
|
||||||
<if test="cs != null and cs !=10">and qc_val.cs = #{cs}</if>
|
|
||||||
group by qc_val.yq,qc_val.zkph,qc_val.xmdh,xm_info.xmmc,xm_info.dyxh,qc_sample.zkbz,qc_sample.sd,qc_sample.cv
|
|
||||||
order by xm_info.dyxh
|
|
||||||
</select>
|
|
||||||
<select id="queryMonthst2" resultType="com.czlis.liswork.pojo.DTO.QcMonthstDTO">
|
|
||||||
SELECT qc_val.yq,qc_val.xmdh,qc_val.zkph,count(1) cnt,cast(avg(zkjg) as decimal(12, 3)) avg2,
|
|
||||||
cast(STDEV(zkjg) as decimal(12, 3)) sd2,cast(100*STDEV(zkjg)/avg(zkjg) as decimal(12, 3)) as cv2
|
|
||||||
FROM qc_val join xm_info on xm_info.yq=qc_val.yq and xm_info.xmdh=qc_val.xmdh
|
|
||||||
join qc_sample on qc_sample.yq=qc_val.yq and qc_sample.xmdh=qc_val.xmdh and qc_sample.zkph=qc_val.zkph
|
|
||||||
and qc_sample.ksrq=(select max(ksrq) from qc_sample x where x.yq=qc_val.yq and x.xmdh=qc_val.xmdh and x.zkph=qc_val.zkph and qc_val.zkrq>=x.ksrq)
|
|
||||||
where convert(char(8),zkrq,120) = convert(char(8),#{zkrq} ,120)
|
|
||||||
and (zkbz + 3*sd)>qc_val.zkjg and qc_val.zkjg>(zkbz - 3*sd) and isnull(outreason,'')=''
|
|
||||||
and qc_val.yq=#{yq} and qc_val.zkph=#{zkph}
|
|
||||||
group by qc_val.yq,qc_val.zkph,qc_val.xmdh
|
|
||||||
</select>
|
|
||||||
<select id="queryMonthst3" resultType="com.czlis.liswork.pojo.DTO.QcMonthstDTO">
|
|
||||||
SELECT qc_val.yq,qc_val.xmdh,qc_val.zkph,count(1) cnt3,cast(avg(zkjg) as decimal(12, 3)) avg3,
|
|
||||||
cast(STDEV(zkjg) as decimal(12, 3)) sd3,cast(100*STDEV(zkjg)/avg(zkjg) as decimal(12, 3)) as cv3
|
|
||||||
FROM qc_val where zkrq>=(select max(ksrq) from qc_sample x where x.yq=qc_val.yq and x.xmdh=qc_val.xmdh and x.zkph=qc_val.zkph and convert(datetime,convert(char(8),#{zkrq},120)+'01') >=x.ksrq)
|
|
||||||
and isnull((select min(ksrq) from qc_sample x where x.yq=qc_val.yq and x.xmdh=qc_val.xmdh and x.zkph=qc_val.zkph and x.ksrq>(select max(ksrq) from qc_sample x where x.yq=qc_val.yq and x.xmdh=qc_val.xmdh and x.zkph=qc_val.zkph and convert(datetime,convert(char(8),#{zkrq},120)+'01')>=x.ksrq ) and convert(datetime,convert(char(8),DATEADD(month,1,#{zkrq}),120)+'01')>=x.ksrq ),convert(datetime,convert(char(8),DATEADD(month,1,#{zkrq}),120)+'01') )>zkrq
|
|
||||||
and qc_val.yq=#{yq} and qc_val.zkph=#{zkph}
|
|
||||||
group by qc_val.yq,qc_val.zkph,qc_val.xmdh
|
|
||||||
</select>
|
|
||||||
<select id="queryMonthskzj" resultType="String">
|
|
||||||
select bz1 FROM qc_val where ksrq=convert(datetime,convert(char(8),#{zkrq},120)+'01') and xmdh='_skxj_'
|
|
||||||
and qc_val.yq=#{yq} and qc_val.zkph=#{zkph}
|
|
||||||
</select>
|
|
||||||
<select id="queryMonthpj" resultType="String">
|
|
||||||
select bz1 FROM qc_val where ksrq=convert(datetime,convert(char(8),#{zkrq},120)+'01') and xmdh='_pj_'
|
|
||||||
and qc_val.yq=#{yq} and qc_val.zkph=#{zkph}
|
|
||||||
</select>
|
|
||||||
</mapper>
|
|
||||||
Loading…
x
Reference in New Issue
Block a user