自助开单界面,打印,作废功能
This commit is contained in:
parent
aca5de6aae
commit
636088f638
@ -51,9 +51,6 @@ public class RegApply {
|
|||||||
private Date create_time;
|
private Date create_time;
|
||||||
private String update_by;
|
private String update_by;
|
||||||
private Date update_time;
|
private Date update_time;
|
||||||
/**
|
|
||||||
* 状态 0.正常,9 作废
|
|
||||||
*/
|
|
||||||
private String Status;
|
private String Status;
|
||||||
private String applyid;
|
private String applyid;
|
||||||
private String reqDetailName;
|
private String reqDetailName;
|
||||||
|
|||||||
@ -65,5 +65,11 @@ public class RegRequestInfoController extends BaseController {
|
|||||||
return regRequestInfoService.printBarCode(applyId);
|
return regRequestInfoService.printBarCode(applyId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("作废申请单")
|
||||||
|
@GetMapping("/cancelReq")
|
||||||
|
public Result cancelReq(String applyId){
|
||||||
|
return regRequestInfoService.cancelReq(applyId);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,4 +14,6 @@ public interface RegRequestInfoService {
|
|||||||
Result saveReqInfo(ReqApplyInfoDTO reqApplyInfoDTO);
|
Result saveReqInfo(ReqApplyInfoDTO reqApplyInfoDTO);
|
||||||
|
|
||||||
Result printBarCode(String applyId);
|
Result printBarCode(String applyId);
|
||||||
|
|
||||||
|
Result cancelReq(String applyId);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,6 +14,7 @@ import com.transitPlatForm.transitPF.mapper.RegTransitSampleMapper;
|
|||||||
import com.transitPlatForm.transitPF.pojo.DTO.RegRequestInfoDTO;
|
import com.transitPlatForm.transitPF.pojo.DTO.RegRequestInfoDTO;
|
||||||
import com.transitPlatForm.transitPF.pojo.DTO.ReqApplyInfoDTO;
|
import com.transitPlatForm.transitPF.pojo.DTO.ReqApplyInfoDTO;
|
||||||
import com.transitPlatForm.transitPF.service.RegRequestInfoService;
|
import com.transitPlatForm.transitPF.service.RegRequestInfoService;
|
||||||
|
import com.transitPlatForm.transitPF.service.util.RequestInfoUtil;
|
||||||
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.context.ApplicationContext;
|
import org.springframework.context.ApplicationContext;
|
||||||
@ -44,6 +45,8 @@ public class RegRequestInfoServiceImpl implements RegRequestInfoService {
|
|||||||
private ApplicationContext applicationContext;
|
private ApplicationContext applicationContext;
|
||||||
@Resource
|
@Resource
|
||||||
private RegTransitSampleMapper regTransitSampleMapper;
|
private RegTransitSampleMapper regTransitSampleMapper;
|
||||||
|
@Resource
|
||||||
|
RequestInfoUtil requestInfoUtil;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -90,7 +93,7 @@ public class RegRequestInfoServiceImpl implements RegRequestInfoService {
|
|||||||
if(!status.equals("0") && !status.equals("")) return new Result("0","不是新增状态不能修改申请单!");
|
if(!status.equals("0") && !status.equals("")) return new Result("0","不是新增状态不能修改申请单!");
|
||||||
//修改数据
|
//修改数据
|
||||||
if(!status.equals("")){
|
if(!status.equals("")){
|
||||||
//保存条码信息
|
//修改申请单信息
|
||||||
applicationContext.getBean(RegRequestInfoServiceImpl.class).updateApply(regApply,regApplyDetailList);
|
applicationContext.getBean(RegRequestInfoServiceImpl.class).updateApply(regApply,regApplyDetailList);
|
||||||
//删除条码信息
|
//删除条码信息
|
||||||
applicationContext.getBean(RegRequestInfoServiceImpl.class).delSampleInfo(regApply.getApplyid());
|
applicationContext.getBean(RegRequestInfoServiceImpl.class).delSampleInfo(regApply.getApplyid());
|
||||||
@ -100,7 +103,7 @@ public class RegRequestInfoServiceImpl implements RegRequestInfoService {
|
|||||||
//申请单号
|
//申请单号
|
||||||
String applyId = "PT"+regApply.getSrcHospCode()+DateUtil.format(commonUtil.getCurrentTime(),"yyyyMMdd")+commonUtil.getNextSeq_pro("applyno",4);
|
String applyId = "PT"+regApply.getSrcHospCode()+DateUtil.format(commonUtil.getCurrentTime(),"yyyyMMdd")+commonUtil.getNextSeq_pro("applyno",4);
|
||||||
regApply.setApplyid(applyId);
|
regApply.setApplyid(applyId);
|
||||||
regApply.setStatus("0"); //申请单状态 0 正常,1 作废
|
regApply.setStatus("10"); //申请单状态
|
||||||
regApply.setCreate_by(regApply.getUserCode());
|
regApply.setCreate_by(regApply.getUserCode());
|
||||||
regApply.setCreate_time(commonUtil.getCurrentTime());
|
regApply.setCreate_time(commonUtil.getCurrentTime());
|
||||||
regApply.setOrderTime(commonUtil.getCurrentTime());
|
regApply.setOrderTime(commonUtil.getCurrentTime());
|
||||||
@ -133,10 +136,13 @@ public class RegRequestInfoServiceImpl implements RegRequestInfoService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Result printBarCode(String applyId) {
|
public Result printBarCode(String applyId) {
|
||||||
|
//产生条码信息
|
||||||
|
Result result1 = createBarcode(applyId);
|
||||||
|
if(!result1.getCode().equals("0")) return result1;
|
||||||
RegTransitSampleDetail regTransitSampleDetail = new RegTransitSampleDetail();
|
RegTransitSampleDetail regTransitSampleDetail = new RegTransitSampleDetail();
|
||||||
regTransitSampleDetail.setApplyid(applyId);
|
regTransitSampleDetail.setApplyid(applyId);
|
||||||
List<RegTransitSampleDetail> regTransitSampleDetailList = regTransitSampleMapper.getRegTransitSampleDetail(regTransitSampleDetail);
|
List<RegTransitSampleDetail> regTransitSampleDetailList = regTransitSampleMapper.getRegTransitSampleDetail(regTransitSampleDetail);
|
||||||
if(regTransitSampleDetailList.size() <= 0) return new Result("-1","没有找到对应的申请单信息!");
|
if(regTransitSampleDetailList.size() <= 0) return new Result("-1","没有找到对应的条码信息!");
|
||||||
List<String> barcodeList = new ArrayList<>();
|
List<String> barcodeList = new ArrayList<>();
|
||||||
for (RegTransitSampleDetail transitSampleDetail : regTransitSampleDetailList) {
|
for (RegTransitSampleDetail transitSampleDetail : regTransitSampleDetailList) {
|
||||||
if(barcodeList.contains(transitSampleDetail.getBarcode())) continue;
|
if(barcodeList.contains(transitSampleDetail.getBarcode())) continue;
|
||||||
@ -146,12 +152,23 @@ public class RegRequestInfoServiceImpl implements RegRequestInfoService {
|
|||||||
Result result = printBar(barCode);
|
Result result = printBar(barCode);
|
||||||
if(!result.equals("0")) return result;
|
if(!result.equals("0")) return result;
|
||||||
//修改状态
|
//修改状态
|
||||||
applicationContext.getBean(RegRequestInfoServiceImpl.class).updateStatus(applyId,barCode);
|
applicationContext.getBean(RegRequestInfoServiceImpl.class).updatePrintStatus(applyId,barCode);
|
||||||
|
|
||||||
}
|
}
|
||||||
return new Result("0","打印成功!");
|
return new Result("0","打印成功!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result cancelReq(String applyId) {
|
||||||
|
RegApply regApply = regApplyMapper.queryOne(applyId);
|
||||||
|
if(regApply == null) return new Result("-1","没有找到申请单信息!");
|
||||||
|
int status = Integer.parseInt(regApply.getStatus());
|
||||||
|
if(status > 40 && status != 100) return new Result("-1","条码已经签收,不允许作废!");
|
||||||
|
List<String> barcodeList = getBarcodeList(applyId);
|
||||||
|
requestInfoUtil.cancelRequest(applyId,barcodeList);
|
||||||
|
return new Result("0","作废申请单成功!");
|
||||||
|
}
|
||||||
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void saveReqInfo(RegApply regApply,List<RegApplyDetail> regApplyDetailList){
|
public void saveReqInfo(RegApply regApply,List<RegApplyDetail> regApplyDetailList){
|
||||||
regApplyMapper.insert(regApply);
|
regApplyMapper.insert(regApply);
|
||||||
@ -412,10 +429,10 @@ public class RegRequestInfoServiceImpl implements RegRequestInfoService {
|
|||||||
|
|
||||||
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void updateStatus(String applyId,String barCode){
|
public void updatePrintStatus(String applyId,String barCode){
|
||||||
//修改申请单状态
|
//修改申请单状态
|
||||||
RegApply regApply = new RegApply();
|
RegApply regApply = new RegApply();
|
||||||
regApply.setStatus("1");
|
regApply.setStatus("20");
|
||||||
regApply.setApplyid(applyId);
|
regApply.setApplyid(applyId);
|
||||||
regApplyMapper.update(regApply);
|
regApplyMapper.update(regApply);
|
||||||
|
|
||||||
@ -426,4 +443,19 @@ public class RegRequestInfoServiceImpl implements RegRequestInfoService {
|
|||||||
regTransitSampleMapper.updateRegTransitSample(regTransitSample);
|
regTransitSampleMapper.updateRegTransitSample(regTransitSample);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public List<String> getBarcodeList(String applyId){
|
||||||
|
List<String> barcodeList = new ArrayList<>();
|
||||||
|
RegTransitSampleDetail regTransitSampleDetail = new RegTransitSampleDetail();
|
||||||
|
regTransitSampleDetail.setApplyid(applyId);
|
||||||
|
List<RegTransitSampleDetail> regTransitSampleDetailList = regTransitSampleMapper.getRegTransitSampleDetail(regTransitSampleDetail);
|
||||||
|
if(regTransitSampleDetailList.size() <= 0) return barcodeList;
|
||||||
|
|
||||||
|
for (RegTransitSampleDetail transitSampleDetail : regTransitSampleDetailList) {
|
||||||
|
if(barcodeList.contains(transitSampleDetail.getBarcode())) continue;
|
||||||
|
barcodeList.add(transitSampleDetail.getBarcode());
|
||||||
|
}
|
||||||
|
return barcodeList;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,44 @@
|
|||||||
|
package com.transitPlatForm.transitPF.service.util;
|
||||||
|
|
||||||
|
import com.transitPlatForm.common.core.domain.entity.reg.RegApply;
|
||||||
|
import com.transitPlatForm.common.core.domain.entity.reg.RegTransitSample;
|
||||||
|
import com.transitPlatForm.common.core.domain.entity.reg.RegTransitSampleDetail;
|
||||||
|
import com.transitPlatForm.interfaceCommon.mapper.RegApplyMapper;
|
||||||
|
import com.transitPlatForm.transitPF.mapper.RegTransitSampleMapper;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class RequestInfoUtil {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private RegApplyMapper regApplyMapper;
|
||||||
|
@Resource
|
||||||
|
private RegTransitSampleMapper regTransitSampleMapper;
|
||||||
|
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void cancelRequest(String applyId,List<String> barcodeList){
|
||||||
|
//作废申请单信息
|
||||||
|
RegApply regApply = new RegApply();
|
||||||
|
regApply.setStatus("90");
|
||||||
|
regApply.setApplyid(applyId);
|
||||||
|
regApplyMapper.update(regApply);
|
||||||
|
|
||||||
|
//作废条码信息
|
||||||
|
for (String barcode : barcodeList) {
|
||||||
|
RegTransitSample regTransitSample = new RegTransitSample();
|
||||||
|
regTransitSample.setStatus("90");
|
||||||
|
regTransitSample.setBarcode(barcode);
|
||||||
|
regTransitSampleMapper.updateRegTransitSample(regTransitSample);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user