修改申请单状态数据

This commit is contained in:
jiangs 2026-03-27 23:23:08 +08:00
parent f6e0861676
commit 4622859a2b
10 changed files with 103 additions and 37 deletions

View File

@ -31,4 +31,5 @@ public class RegApplyDetail {
private String barcode; private String barcode;
private String itemclass_bkcolor; private String itemclass_bkcolor;
private String itemclass_tips; private String itemclass_tips;
private String status;
} }

View File

@ -40,21 +40,21 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService {
/** /**
* 项目启动时,初始化字典到缓存 * 项目启动时,初始化字典到缓存
*/ */
@PostConstruct // @PostConstruct
public void init() { // public void init() {
TimerTask task = new TimerTask(){ // TimerTask task = new TimerTask(){
@Override // @Override
public void run() { // public void run() {
try { // try {
// 异步执行目标方法 // // 异步执行目标方法
loadingDictCache(); // loadingDictCache();
} catch (Exception e) { // } catch (Exception e) {
log.error("获取系统字典失败,异步执行{}方法失败","loadingDictCache", e); // log.error("获取系统字典失败,异步执行{}方法失败","loadingDictCache", e);
} // }
} // }
}; // };
AsyncManager.me().execute(task); // AsyncManager.me().execute(task);
} // }
/** /**
* 根据条件分页查询字典类型 * 根据条件分页查询字典类型

View File

@ -1,13 +1,16 @@
package com.transitPlatForm.transitPF.controller.dict; package com.transitPlatForm.transitPF.controller.dict;
import com.transitPlatForm.common.annotation.Log; import com.transitPlatForm.common.annotation.Log;
import com.transitPlatForm.common.constant.CacheConstants;
import com.transitPlatForm.common.core.controller.BaseController; import com.transitPlatForm.common.core.controller.BaseController;
import com.transitPlatForm.common.core.domain.AjaxResult; import com.transitPlatForm.common.core.domain.AjaxResult;
import com.transitPlatForm.common.core.domain.Result; import com.transitPlatForm.common.core.domain.Result;
import com.transitPlatForm.common.core.page.TableDataInfo; import com.transitPlatForm.common.core.page.TableDataInfo;
import com.transitPlatForm.common.core.redis.RedisCache;
import com.transitPlatForm.common.enums.BusinessType; import com.transitPlatForm.common.enums.BusinessType;
import com.transitPlatForm.common.utils.poi.ExcelUtil; import com.transitPlatForm.common.utils.poi.ExcelUtil;
import com.transitPlatForm.common.core.domain.entity.reg.RegDict; import com.transitPlatForm.common.core.domain.entity.reg.RegDict;
import com.transitPlatForm.common.utils.spring.SpringUtils;
import com.transitPlatForm.interfaceCommon.constants.SysLogConstants; import com.transitPlatForm.interfaceCommon.constants.SysLogConstants;
import com.transitPlatForm.transitPF.service.RegDictService; import com.transitPlatForm.transitPF.service.RegDictService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
@ -19,6 +22,7 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collection;
import java.util.List; import java.util.List;
@Api(tags = "区域检验中心-常用字典管理") @Api(tags = "区域检验中心-常用字典管理")
@ -143,4 +147,12 @@ public class RegDictController extends BaseController {
if(loginYLJG==null || loginYLJG.equals("")) return AjaxResult.error("获取登录的医疗机构失败!"); if(loginYLJG==null || loginYLJG.equals("")) return AjaxResult.error("获取登录的医疗机构失败!");
return regDictService.getMaxDictCode(dictType,loginYLJG); return regDictService.getMaxDictCode(dictType,loginYLJG);
} }
@ApiOperation("清空缓存")
@GetMapping("/clearCache")
public Result clearCache(){
Collection<String> keys = SpringUtils.getBean(RedisCache.class).keys(CacheConstants.REG_DICT_KEY + "*");
SpringUtils.getBean(RedisCache.class).deleteObject(keys);
return new Result("0","清空缓存成功!");
}
} }

View File

@ -24,4 +24,6 @@ public interface RegTransitSampleMapper {
void updateRegTransitSample(RegTransitSample regTransitSample); void updateRegTransitSample(RegTransitSample regTransitSample);
List<RegTransitSample> getRegTransitSampleSignBack(RegTransitSample regTransitSample); List<RegTransitSample> getRegTransitSampleSignBack(RegTransitSample regTransitSample);
List<RegTransitSample> getSampleInfoByApplyid(String applyid);
} }

View File

@ -20,6 +20,7 @@ import org.springframework.stereotype.Component;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
@Component @Component
@Slf4j @Slf4j
@ -179,6 +180,9 @@ public class RegInterfaceImpl {
String regApplyId = requestInfoUtil.getRegApplyId(barcode); String regApplyId = requestInfoUtil.getRegApplyId(barcode);
RegApply regApply = new RegApply(); RegApply regApply = new RegApply();
regApply.setApplyid(regApplyId); regApply.setApplyid(regApplyId);
List<RegTransitSample> regTransitSampleList1 = requestInfoUtil.getRegTransitSampleByApplyid(regApplyId);
switch (statusParam){ switch (statusParam){
case "20": //标本采集 case "20": //标本采集
if(Integer.parseInt(status) >= 20) continue;//return new Result("0","该标本已经采集!"); if(Integer.parseInt(status) >= 20) continue;//return new Result("0","该标本已经采集!");
@ -195,8 +199,8 @@ public class RegInterfaceImpl {
regTransitSample20.setAffirmUserName(affirmUserName); regTransitSample20.setAffirmUserName(affirmUserName);
regTransitSample20.setStatus("20"); regTransitSample20.setStatus("20");
regApply.setStatus("20"); //regApply.setStatus("10");
requestInfoUtil.updateRegTransitSampleStatus(regTransitSample20,regApply); requestInfoUtil.updateRegTransitSampleStatus(regTransitSample20,null);
break; break;
case "30": //标本送检 case "30": //标本送检
Date sendPackTime = sampleSignVO.getSendPackTime(); Date sendPackTime = sampleSignVO.getSendPackTime();
@ -218,7 +222,11 @@ public class RegInterfaceImpl {
} }
regTransitSample.setStatus("30"); regTransitSample.setStatus("30");
regApply.setStatus("30"); List<RegTransitSample> collect = regTransitSampleList1.stream().filter(regTransitSample2 -> regTransitSample2.getStatus().equals("10") || regTransitSample2.getStatus().equals("20")).collect(Collectors.toList());
if(collect.size() <= 0){
//全部已送出, 修改状态
regApply.setStatus("20");
}
requestInfoUtil.updateRegTransitSampleStatus(regTransitSample,regApply); requestInfoUtil.updateRegTransitSampleStatus(regTransitSample,regApply);
break; break;
case "40": //标本外送 case "40": //标本外送
@ -238,8 +246,8 @@ public class RegInterfaceImpl {
regTransitSample50.setSignInUserName(signUserName); regTransitSample50.setSignInUserName(signUserName);
regTransitSample50.setStatus("50"); regTransitSample50.setStatus("50");
regApply.setStatus("50"); //regApply.setStatus("20");
requestInfoUtil.updateRegTransitSampleStatus(regTransitSample50,regApply); requestInfoUtil.updateRegTransitSampleStatus(regTransitSample50,null);
break; break;
case "60": //上机检测 case "60": //上机检测
break; break;
@ -258,7 +266,13 @@ public class RegInterfaceImpl {
regTransitSample70.setReportUserName(reportUserName); regTransitSample70.setReportUserName(reportUserName);
regTransitSample70.setStatus("70"); regTransitSample70.setStatus("70");
regApply.setStatus("70"); List<RegTransitSample> collect1 = regTransitSampleList1.stream().filter(regTransitSample2 -> Integer.parseInt(regTransitSample2.getStatus()) < 70).collect(Collectors.toList());
if(collect1.size() >= 0){
regApply.setStatus("20");
}else{
regApply.setStatus("30");
}
requestInfoUtil.updateRegTransitSampleStatus(regTransitSample70,regApply); requestInfoUtil.updateRegTransitSampleStatus(regTransitSample70,regApply);
break; break;
case "90": //申请作废 case "90": //申请作废
@ -276,7 +290,11 @@ public class RegInterfaceImpl {
regTransitSample90.setCancelName(cancelName); regTransitSample90.setCancelName(cancelName);
regTransitSample90.setStatus("90"); regTransitSample90.setStatus("90");
regApply.setStatus("90"); List<RegTransitSample> collect2 = regTransitSampleList1.stream().filter(regTransitSample2 -> Integer.parseInt(regTransitSample2.getStatus()) != 90).collect(Collectors.toList());
if(collect2.size() <= 0){
regApply.setStatus("40");
}
requestInfoUtil.updateRegTransitSampleStatus(regTransitSample90,regApply); requestInfoUtil.updateRegTransitSampleStatus(regTransitSample90,regApply);
break; break;
case "100": //标本退回 case "100": //标本退回
@ -295,7 +313,7 @@ public class RegInterfaceImpl {
regTransitSample100.setBackUserName(backUserName); regTransitSample100.setBackUserName(backUserName);
regTransitSample100.setStatus("100"); regTransitSample100.setStatus("100");
regApply.setStatus("100"); //regApply.setStatus("20");
requestInfoUtil.updateRegTransitSampleStatus(regTransitSample100,regApply); requestInfoUtil.updateRegTransitSampleStatus(regTransitSample100,regApply);
break; break;

View File

@ -181,9 +181,19 @@ public class RegRequestInfoServiceImpl implements RegRequestInfoService {
public Result cancelReq(String applyId) { public Result cancelReq(String applyId) {
RegApply regApply = regApplyMapper.queryOne(applyId); RegApply regApply = regApplyMapper.queryOne(applyId);
if (regApply == null) return new Result("-1", "没有找到申请单信息!"); if (regApply == null) return new Result("-1", "没有找到申请单信息!");
int status = Integer.parseInt(regApply.getStatus()); //int status = Integer.parseInt(regApply.getStatus());
if (status > 40 && status != 100) return new Result("-1", "条码已经签收或者已经作废,不允许作废!"); //if (status >= 30) return new Result("-1", "条码已经签收或者已经作废,不允许作废!");
List<String> barcodeList = getBarcodeList(applyId); List<String> barcodeList = getBarcodeList(applyId);
for (String barcode : barcodeList) {
RegTransitSample regTransitSample = new RegTransitSample();
regTransitSample.setBarcode(barcode);
List<RegTransitSample> regTransitSampleList = regTransitSampleMapper.getRegTransitSample(regTransitSample);
if(regTransitSampleList.size() >= 0){
String status = regTransitSampleList.get(0).getStatus();
int i_status = Integer.parseInt(status);
if(i_status >= 50 && i_status != 100) return new Result("-1", "条码已经签收或者已经作废,不允许作废!");
}
}
requestInfoUtil.cancelRequest(applyId, barcodeList); requestInfoUtil.cancelRequest(applyId, barcodeList);
return new Result("0", "作废申请单成功!"); return new Result("0", "作废申请单成功!");
} }
@ -483,10 +493,10 @@ public class RegRequestInfoServiceImpl implements RegRequestInfoService {
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void updatePrintStatus(String applyId, String barCode,String userName) { public void updatePrintStatus(String applyId, String barCode,String userName) {
//修改申请单状态 //修改申请单状态
RegApply regApply = new RegApply(); // RegApply regApply = new RegApply();
regApply.setStatus("20"); // regApply.setStatus("20");
regApply.setApplyid(applyId); // regApply.setApplyid(applyId);
regApplyMapper.update(regApply); // regApplyMapper.update(regApply);
String nickName = ""; String nickName = "";
SysUser sysUserOne = commonUtil.getSysUserOne(userName); SysUser sysUserOne = commonUtil.getSysUserOne(userName);

View File

@ -22,6 +22,7 @@ import org.springframework.stereotype.Service;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
@Service @Service
@Slf4j @Slf4j
@ -116,6 +117,8 @@ public class RegTransitSampleServiceImpl implements RegTransitSampleService {
RegApply regApply = new RegApply(); RegApply regApply = new RegApply();
regApply.setApplyid(regApplyId); regApply.setApplyid(regApplyId);
List<RegTransitSample> regTransitSampleList1 = requestInfoUtil.getRegTransitSampleByApplyid(regApplyId);
switch (status) { switch (status) {
case "20": //标本采集 case "20": //标本采集
//if(affirmTime == null) return new Result("-1","affirmTime标本采集时间不能为空!"); //if(affirmTime == null) return new Result("-1","affirmTime标本采集时间不能为空!");
@ -129,7 +132,7 @@ public class RegTransitSampleServiceImpl implements RegTransitSampleService {
regTransitSample.setAffirmUserName(affirmUserName); regTransitSample.setAffirmUserName(affirmUserName);
regTransitSample.setStatus("20"); regTransitSample.setStatus("20");
regApply.setStatus("20"); regApply.setStatus("10");
requestInfoUtil.updateRegTransitSampleStatus(regTransitSample,regApply); requestInfoUtil.updateRegTransitSampleStatus(regTransitSample,regApply);
break; break;
case "30": //标本送检 case "30": //标本送检
@ -145,7 +148,13 @@ public class RegTransitSampleServiceImpl implements RegTransitSampleService {
regTransitSample.setSendUserCode(sendUserCode); regTransitSample.setSendUserCode(sendUserCode);
regTransitSample.setSendUserName(sendUserName); regTransitSample.setSendUserName(sendUserName);
regApply.setStatus("30");
List<RegTransitSample> collect = regTransitSampleList1.stream().filter(regTransitSample1 -> regTransitSample1.getStatus().equals("10") || regTransitSample1.getStatus().equals("20")).collect(Collectors.toList());
if(collect.size() <= 0){
//全部已送出, 修改状态
regApply.setStatus("20");
}
requestInfoUtil.updateRegTransitSampleStatus(regTransitSample,regApply); requestInfoUtil.updateRegTransitSampleStatus(regTransitSample,regApply);
break; break;
case "50": //标本签收 case "50": //标本签收
@ -156,8 +165,9 @@ public class RegTransitSampleServiceImpl implements RegTransitSampleService {
regTransitSample.setSignInUserCode(userId); regTransitSample.setSignInUserCode(userId);
regTransitSample.setSignInUserName(nickName); regTransitSample.setSignInUserName(nickName);
regApply.setStatus("50");
requestInfoUtil.updateRegTransitSampleStatus(regTransitSample,regApply); //regApply.setStatus("20");
requestInfoUtil.updateRegTransitSampleStatus(regTransitSample,null);
break; break;
case "100": //标本退回 case "100": //标本退回
if (statusSample.equals("100")) return new Result("0", "该标本已经退回!"); if (statusSample.equals("100")) return new Result("0", "该标本已经退回!");
@ -167,7 +177,7 @@ public class RegTransitSampleServiceImpl implements RegTransitSampleService {
regTransitSample.setBackUserName(backUserName); regTransitSample.setBackUserName(backUserName);
regTransitSample.setBackTime(commonUtil.getCurrentTime()); regTransitSample.setBackTime(commonUtil.getCurrentTime());
regApply.setStatus("100"); //regApply.setStatus("20");
requestInfoUtil.updateRegTransitSampleStatus(regTransitSample,regApply); requestInfoUtil.updateRegTransitSampleStatus(regTransitSample,regApply);
break; break;

View File

@ -28,7 +28,7 @@ public class RequestInfoUtil {
public void cancelRequest(String applyId,List<String> barcodeList){ public void cancelRequest(String applyId,List<String> barcodeList){
//作废申请单信息 //作废申请单信息
RegApply regApply = new RegApply(); RegApply regApply = new RegApply();
regApply.setStatus("90"); regApply.setStatus("40");
regApply.setApplyid(applyId); regApply.setApplyid(applyId);
regApplyMapper.update(regApply); regApplyMapper.update(regApply);
@ -45,9 +45,11 @@ public class RequestInfoUtil {
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void updateRegTransitSampleStatus(RegTransitSample regTransitSample,RegApply regApply){ public void updateRegTransitSampleStatus(RegTransitSample regTransitSample,RegApply regApply){
regTransitSampleMapper.updateRegTransitSample(regTransitSample); if(regApply != null){
regApplyMapper.update(regApply); regApplyMapper.update(regApply);
} }
regTransitSampleMapper.updateRegTransitSample(regTransitSample);
}
public String getRegApplyId(String barcode){ public String getRegApplyId(String barcode){
@ -104,5 +106,9 @@ public class RequestInfoUtil {
regResultMapper.deleteRegReportFile(reportNo); regResultMapper.deleteRegReportFile(reportNo);
} }
public List<RegTransitSample> getRegTransitSampleByApplyid(String applyid){
return regTransitSampleMapper.getSampleInfoByApplyid(applyid);
}
} }

View File

@ -15,7 +15,9 @@
</select> </select>
<select id="queryReqDetail" resultType="com.transitPlatForm.common.core.domain.entity.reg.RegApplyDetail"> <select id="queryReqDetail" resultType="com.transitPlatForm.common.core.domain.entity.reg.RegApplyDetail">
select a.*,b.itemclass, c.classid,d.barcode,c.itemclass_bkcolor,c.itemclass_tips from reg_apply_detail a left join reg_TransitSample_detail d on (d.applyid = a.applyid and d.applyDetailId = a.uid),reg_item b,reg_itemclass c select a.*,b.itemclass, c.classid,d.barcode,c.itemclass_bkcolor,c.itemclass_tips,e.status from reg_apply_detail a
left join reg_TransitSample_detail d on (d.applyid = a.applyid and d.applyDetailId = a.uid)
left join reg_TransitSample e on (e.barcode = d.barcode),reg_item b,reg_itemclass c
where a.applyid = #{applyid} and a.OrderItemCode = b.itemcode and c.itemclass_code = b.itemclass where a.applyid = #{applyid} and a.OrderItemCode = b.itemcode and c.itemclass_code = b.itemclass
</select> </select>

View File

@ -20,6 +20,7 @@
<if test="DateType == '采样时间'">and (a.AffirmTime between #{DateStart} and #{DateEnd}) </if> <if test="DateType == '采样时间'">and (a.AffirmTime between #{DateStart} and #{DateEnd}) </if>
<if test="DateType == '送出时间'">and (a.SendPackTime between #{DateStart} and #{DateEnd}) </if> <if test="DateType == '送出时间'">and (a.SendPackTime between #{DateStart} and #{DateEnd}) </if>
<if test="DateType == '签收时间'">and (a.SignInTime between #{DateStart} and #{DateEnd}) </if> <if test="DateType == '签收时间'">and (a.SignInTime between #{DateStart} and #{DateEnd}) </if>
order by a.patname
</select> </select>
<select id="getRegTransitSampleDetail" resultType="com.transitPlatForm.common.core.domain.entity.reg.RegTransitSampleDetail"> <select id="getRegTransitSampleDetail" resultType="com.transitPlatForm.common.core.domain.entity.reg.RegTransitSampleDetail">
@ -292,4 +293,8 @@
<if test="DateType == '签收时间'">and (SignInTime between #{DateStart} and #{DateEnd}) </if> <if test="DateType == '签收时间'">and (SignInTime between #{DateStart} and #{DateEnd}) </if>
</select> </select>
<select id="getSampleInfoByApplyid" resultType="com.transitPlatForm.common.core.domain.entity.reg.RegTransitSample">
select * from reg_TransitSample where barcode in (select barcode from reg_TransitSample_detail a,reg_apply b where a.applyid = b.applyid and b.applyid = #{applyid})
</select>
</mapper> </mapper>