退检模块
This commit is contained in:
parent
79cfe4dee3
commit
42ed699e0a
@ -131,4 +131,7 @@ public class LabReqmain extends BaseEntity {
|
||||
private String qsyljg;
|
||||
@ApiModelProperty(value = "采集部位")
|
||||
private String cjbw;
|
||||
|
||||
private Date st;
|
||||
private Date et;
|
||||
}
|
||||
|
||||
@ -32,16 +32,21 @@
|
||||
</insert>
|
||||
|
||||
<update id="update">
|
||||
update lab_reqdetail set sqh = #{sqh}
|
||||
<if test="xh != null">xh = #{xh},</if>
|
||||
<if test="sqxmdh != null">sqxmdh = #{sqxmdh},</if>
|
||||
<if test="sqxmmc != null">sqxmmc = #{sqxmmc},</if>
|
||||
<if test="sl != null">sl = #{sl},</if>
|
||||
<if test="dj != null">dj = #{dj}</if>
|
||||
<if test="zt != null and zt != ''">zt = #{zt}</if>
|
||||
<if test="jjzt != null and jjzt != ''">jjzt = #{jjzt}</if>
|
||||
<if test="bz1 != null and bz1 != ''">bz1 = #{bz1}</if>
|
||||
<if test="bz2 != null and bz2 != ''">bz2 = #{bz2}</if>
|
||||
update lab_reqdetail
|
||||
<set>
|
||||
<if test="xh != null">xh = #{xh},</if>
|
||||
<if test="sqxmdh != null">sqxmdh = #{sqxmdh},</if>
|
||||
<if test="sqxmmc != null">sqxmmc = #{sqxmmc},</if>
|
||||
<if test="sl != null">sl = #{sl},</if>
|
||||
<if test="dj != null">dj = #{dj},</if>
|
||||
<if test="zt != null and zt != ''">zt = #{zt},</if>
|
||||
<if test="jjzt != null and jjzt != ''">jjzt = #{jjzt},</if>
|
||||
<if test="bz1 != null and bz1 != ''">bz1 = #{bz1},</if>
|
||||
<if test="bz2 != null and bz2 != ''">bz2 = #{bz2},</if>
|
||||
sqh = #{sqh}
|
||||
</set>
|
||||
where sqh = #{sqh}
|
||||
<if test="xh != null"> and xh = #{xh}</if>
|
||||
</update>
|
||||
|
||||
<select id="getLabReqdetailOne" resultType="com.czlis.common.core.domain.entity.lis.LabReqdetail">
|
||||
|
||||
@ -0,0 +1,75 @@
|
||||
package com.czlis.liswork.controller.work;
|
||||
|
||||
import com.czlis.common.core.controller.BaseController;
|
||||
import com.czlis.common.core.domain.Result;
|
||||
import com.czlis.common.core.domain.entity.lis.LabReqmain;
|
||||
import com.czlis.common.core.page.TableDataInfo;
|
||||
import com.czlis.liswork.pojo.VO.CancelCheckVO;
|
||||
import com.czlis.liswork.service.CancelCheckService;
|
||||
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.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 退检
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/cancelCheck")
|
||||
@Slf4j
|
||||
@Api(tags = "退检")
|
||||
public class CancelCheckController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
CancelCheckService cancelCheckService;
|
||||
|
||||
|
||||
@ApiOperation("查询数据列表")
|
||||
@GetMapping("/queryList")
|
||||
public TableDataInfo queryList(LabReqmain labReqmain){
|
||||
startPage();
|
||||
List<LabReqmain> labReqmainList = cancelCheckService.queryList(labReqmain);
|
||||
return getDataTable(labReqmainList);
|
||||
}
|
||||
|
||||
@ApiOperation("获取明细数据")
|
||||
@GetMapping("/queryDetail")
|
||||
public Result queryDetail(LabReqmain labReqmain){
|
||||
String sqh = labReqmain.getSqh();
|
||||
if(sqh == null || sqh.equals("")) return new Result("-1","入参申请单号不能为空!");
|
||||
String zt = labReqmain.getZt();
|
||||
if (zt == null || zt.equals("")) return new Result("-1","入参状态不能为空!");
|
||||
//这里管理员确认不了,先默认允许退费
|
||||
// String cancalfeeadmin = commonUtil.getComOptValue("HISOPT", "sp_cancalfeeadmin");
|
||||
// if(cancalfeeadmin == null) cancalfeeadmin = "";
|
||||
// if(cancalfeeadmin.equals("1")){
|
||||
// return new Result("-1","非管理员不允许退费!");
|
||||
// }
|
||||
if(zt.equals("4")) return new Result("-1","已经审核的报告禁止退检,请先解除审核再退检!");
|
||||
if(zt.equals("9")) return new Result("-1","已经作废的报告禁止退检!");
|
||||
return cancelCheckService.queryDetail(labReqmain);
|
||||
}
|
||||
|
||||
@ApiOperation("退检")
|
||||
@GetMapping("/confirm")
|
||||
public Result cancelCheck(CancelCheckVO cancelCheckVO){
|
||||
String sqh = cancelCheckVO.getSqh();
|
||||
if(sqh == null || sqh.equals("")) return new Result("-1","申请单号sqh不能为空!");
|
||||
String userId = cancelCheckVO.getUserId();
|
||||
if(userId == null) cancelCheckVO.setUserId(getUsername());
|
||||
return cancelCheckService.cancelCheck(cancelCheckVO);
|
||||
}
|
||||
|
||||
@ApiOperation("拒绝退费")
|
||||
@GetMapping("/refuse")
|
||||
public Result refuse(CancelCheckVO cancelCheckVO){
|
||||
return cancelCheckService.refuse(cancelCheckVO);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
package com.czlis.liswork.mapper.work;
|
||||
|
||||
import com.czlis.common.core.domain.entity.lis.LabReqmain;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface CancelCheckMapper {
|
||||
List<LabReqmain> query(LabReqmain labReqmain);
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
package com.czlis.liswork.pojo.VO;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class CancelCheckVO {
|
||||
private String sqh;
|
||||
private String tfyy;
|
||||
private String userId;
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package com.czlis.liswork.service;
|
||||
|
||||
import com.czlis.common.core.domain.Result;
|
||||
import com.czlis.common.core.domain.entity.lis.LabReqmain;
|
||||
import com.czlis.liswork.pojo.VO.CancelCheckVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface CancelCheckService {
|
||||
List<LabReqmain> queryList(LabReqmain labReqmain);
|
||||
|
||||
Result queryDetail(LabReqmain labReqmain);
|
||||
|
||||
Result cancelCheck(CancelCheckVO cancelCheckVO);
|
||||
|
||||
Result refuse(CancelCheckVO cancelCheckVO);
|
||||
|
||||
}
|
||||
@ -0,0 +1,103 @@
|
||||
package com.czlis.liswork.service.impl.work;
|
||||
|
||||
import com.czlis.common.core.domain.Result;
|
||||
import com.czlis.common.core.domain.entity.lis.LabReqdetail;
|
||||
import com.czlis.common.core.domain.entity.lis.LabReqmain;
|
||||
import com.czlis.common.core.domain.entity.lis.LabReqsteplog;
|
||||
import com.czlis.common.utils.ip.IpUtils;
|
||||
import com.czlis.interfaceCommon.constants.LisinterfaceNameConstants;
|
||||
import com.czlis.interfaceCommon.mapper.LabReqdetailMapper;
|
||||
import com.czlis.interfaceCommon.mapper.LabReqsteplogMapper;
|
||||
import com.czlis.interfaceCommon.pojo.inter.DayMessage;
|
||||
import com.czlis.interfaceCommon.utils.CommonUtil;
|
||||
import com.czlis.interfaceCommon.utils.LisInterfaceUtil;
|
||||
import com.czlis.liswork.mapper.work.CancelCheckMapper;
|
||||
import com.czlis.liswork.pojo.VO.CancelCheckVO;
|
||||
import com.czlis.liswork.service.CancelCheckService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class CancelCheckServiceImpl implements CancelCheckService {
|
||||
|
||||
@Autowired
|
||||
CancelCheckMapper cancelCheckMapper;
|
||||
@Autowired
|
||||
private CommonUtil commonUtil;
|
||||
@Autowired
|
||||
LisInterfaceUtil lisInterfaceUtil;
|
||||
@Autowired
|
||||
LabReqsteplogMapper labReqsteplogMapper;
|
||||
@Autowired
|
||||
LabReqdetailMapper labReqdetailMapper;
|
||||
@Autowired
|
||||
private ApplicationContext applicationContext;
|
||||
|
||||
@Override
|
||||
public List<LabReqmain> queryList(LabReqmain labReqmain) {
|
||||
return cancelCheckMapper.query(labReqmain);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result queryDetail(LabReqmain labReqmain) {
|
||||
List<LabReqdetail> labReqdetailList = commonUtil.getLabReqdetailList(labReqmain.getSqh());
|
||||
return new Result("0","获取数据成功!",labReqdetailList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result cancelCheck(CancelCheckVO cancelCheckVO) {
|
||||
//调用接口
|
||||
DayMessage dayMessage = new DayMessage();
|
||||
dayMessage.setMsgid("123");
|
||||
dayMessage.setMsg(cancelCheckVO.getSqh());
|
||||
Result result = lisInterfaceUtil.invokeLisInterface(LisinterfaceNameConstants.DAYMESSAGE, dayMessage);
|
||||
if(!result.getCode().equals("0")) return new Result("-1","退检失败:"+result.getMsg());
|
||||
|
||||
//修改状态
|
||||
applicationContext.getBean(CancelCheckServiceImpl.class).updateStatus(cancelCheckVO.getSqh());
|
||||
|
||||
|
||||
//写日志
|
||||
Integer labReqsteplogMax = labReqsteplogMapper.getLabReqsteplogMax(cancelCheckVO.getSqh());
|
||||
LabReqsteplog labReqsteplog = new LabReqsteplog();
|
||||
labReqsteplog.setSqh(cancelCheckVO.getSqh());
|
||||
labReqsteplog.setXh(labReqsteplogMax + 1);
|
||||
labReqsteplog.setZt("9");
|
||||
labReqsteplog.setUserid(cancelCheckVO.getUserId());
|
||||
labReqsteplog.setChangedate(commonUtil.getCurrentTime());
|
||||
labReqsteplog.setComip(IpUtils.getIpAddr());
|
||||
labReqsteplog.setBz(cancelCheckVO.getTfyy());
|
||||
labReqsteplogMapper.insertLabReqsteplog(labReqsteplog);
|
||||
return new Result("0","退检成功!");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result refuse(CancelCheckVO cancelCheckVO) {
|
||||
//调用接口
|
||||
DayMessage dayMessage = new DayMessage();
|
||||
dayMessage.setMsgid("995");
|
||||
dayMessage.setMsg(cancelCheckVO.getSqh());
|
||||
return lisInterfaceUtil.invokeLisInterface(LisinterfaceNameConstants.DAYMESSAGE, dayMessage);
|
||||
}
|
||||
|
||||
|
||||
@Transactional
|
||||
public void updateStatus(String sqh){
|
||||
LabReqmain labReqmain = new LabReqmain();
|
||||
labReqmain.setZt("9");
|
||||
labReqmain.setJjzt("0");
|
||||
labReqmain.setSqh(sqh);
|
||||
commonUtil.updateLabReqmain(labReqmain);
|
||||
LabReqdetail labReqdetail = new LabReqdetail();
|
||||
labReqdetail.setZt("9");
|
||||
labReqdetail.setSqh(sqh);
|
||||
labReqdetailMapper.update(labReqdetail);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
17
liswork/src/main/resources/mapper/work/CancelCheckMapper.xml
Normal file
17
liswork/src/main/resources/mapper/work/CancelCheckMapper.xml
Normal file
@ -0,0 +1,17 @@
|
||||
<?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.work.CancelCheckMapper">
|
||||
<select id="query" resultType="com.czlis.common.core.domain.entity.lis.LabReqmain">
|
||||
select * from lab_reqmain where
|
||||
<![CDATA[sqsj >= #{st} and sqsj <= #{et}]]>
|
||||
<if test="brdh != null and brdh != ''">and brdh = #{brdh}</if>
|
||||
<if test="brxm != null and brxm != ''">and brxm like '%'+#{brxm}+'%' </if>
|
||||
<if test="sqh != null and sqh != ''">and sqh = #{sqh}</if>
|
||||
<if test="ksdh != null and ksdh != ''">and ksdh = #{ksdh}</if>
|
||||
<if test="brly != null and brly != ''">and brly = #{brly}</if>
|
||||
<if test="powerman != null and powerman != ''">and powerman = #{powerman}</if>
|
||||
<if test="zt != null and zt != ''">and zt = #{zt}</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Loading…
x
Reference in New Issue
Block a user