fix:样品库接口调整
This commit is contained in:
@@ -184,4 +184,11 @@ public interface QmsCommonConstant {
|
|||||||
|
|
||||||
/** 手动 **/
|
/** 手动 **/
|
||||||
String MANUAL = "manual";
|
String MANUAL = "manual";
|
||||||
|
|
||||||
|
|
||||||
|
/** 样品库操作类型: 归库、调拨、下架 **/
|
||||||
|
String SAMPLE_STORAGE_OPERATION_TYPE_STORAGE = "storage";
|
||||||
|
String SAMPLE_STORAGE_OPERATION_TYPE_TRANSFER = "dispatch";
|
||||||
|
String SAMPLE_STORAGE_OPERATION_TYPE_TAKEN_OFF = "take_off";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -137,8 +137,11 @@ public class BusinessSampleDispatchServiceImpl implements BusinessSampleDispatch
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public CommonResult<String> execDispatch(BusinessSampleDispatchSaveReqVO paramVo) {
|
public CommonResult<String> execDispatch(BusinessSampleDispatchSaveReqVO paramVo) {
|
||||||
Long id = paramVo.getId();
|
Long id = paramVo.getId();
|
||||||
String warehouseUser = paramVo.getWarehouseUser(); //库管员
|
|
||||||
Long warehouseUserId = paramVo.getWarehouseUserId();
|
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
||||||
|
String nickName = SecurityFrameworkUtils.getLoginUserNickname();
|
||||||
|
String warehouseUser = nickName; //库管员
|
||||||
|
Long warehouseUserId = loginUser.getId();
|
||||||
BusinessSampleDispatchDO entity = getBusinessSampleDispatch( id);
|
BusinessSampleDispatchDO entity = getBusinessSampleDispatch( id);
|
||||||
BusinessSampleDispatchDetailPageReqVO pageReqVO = new BusinessSampleDispatchDetailPageReqVO();
|
BusinessSampleDispatchDetailPageReqVO pageReqVO = new BusinessSampleDispatchDetailPageReqVO();
|
||||||
pageReqVO.setParentId(id);
|
pageReqVO.setParentId(id);
|
||||||
@@ -152,6 +155,7 @@ public class BusinessSampleDispatchServiceImpl implements BusinessSampleDispatch
|
|||||||
BusinessSampleDispatchDetailDO u = new BusinessSampleDispatchDetailDO();
|
BusinessSampleDispatchDetailDO u = new BusinessSampleDispatchDetailDO();
|
||||||
u.setUseStatus("1");
|
u.setUseStatus("1");
|
||||||
u.setBorrowStatus("1");
|
u.setBorrowStatus("1");
|
||||||
|
u.setGivebackStatus("0");
|
||||||
u.setBorrowUser(entity.getApplyUser());
|
u.setBorrowUser(entity.getApplyUser());
|
||||||
u.setBorrowUserId(entity.getApplyUserId());
|
u.setBorrowUserId(entity.getApplyUserId());
|
||||||
u.setBorrowTime(borrowTime);
|
u.setBorrowTime(borrowTime);
|
||||||
@@ -222,6 +226,7 @@ public class BusinessSampleDispatchServiceImpl implements BusinessSampleDispatch
|
|||||||
handoverRecord.setOperatorId(givebackUserId);
|
handoverRecord.setOperatorId(givebackUserId);
|
||||||
handoverRecord.setSendSampleOperator(givebackUser); //送样人
|
handoverRecord.setSendSampleOperator(givebackUser); //送样人
|
||||||
handoverRecord.setReceiveSampleOperator(warehouseUser); //收样人
|
handoverRecord.setReceiveSampleOperator(warehouseUser); //收样人
|
||||||
|
handoverRecord.setSampleFlowNodeKey(QmsCommonConstant.FLOW_SAMPLE_STORAGE);
|
||||||
handoverRecordList.add(handoverRecord);
|
handoverRecordList.add(handoverRecord);
|
||||||
}
|
}
|
||||||
businessSampleDispatchDetailService.updateBatch(detailUpdateList);
|
businessSampleDispatchDetailService.updateBatch(detailUpdateList);
|
||||||
|
|||||||
@@ -15,6 +15,8 @@ import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleDO;
|
|||||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigWarehouseLocationDO;
|
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigWarehouseLocationDO;
|
||||||
import com.zt.plat.module.qms.business.config.service.ConfigSubSampleService;
|
import com.zt.plat.module.qms.business.config.service.ConfigSubSampleService;
|
||||||
import com.zt.plat.module.qms.business.config.service.ConfigWarehouseLocationService;
|
import com.zt.plat.module.qms.business.config.service.ConfigWarehouseLocationService;
|
||||||
|
import com.zt.plat.module.qms.common.dic.dal.dataobject.DictionaryBusinessDO;
|
||||||
|
import com.zt.plat.module.qms.common.dic.dal.mapper.DictionaryBusinessMapper;
|
||||||
import com.zt.plat.module.qms.common.dic.service.DictionaryBusinessService;
|
import com.zt.plat.module.qms.common.dic.service.DictionaryBusinessService;
|
||||||
import com.zt.plat.module.qms.core.code.SequenceUtil;
|
import com.zt.plat.module.qms.core.code.SequenceUtil;
|
||||||
import com.zt.plat.module.qms.enums.QmsCommonConstant;
|
import com.zt.plat.module.qms.enums.QmsCommonConstant;
|
||||||
@@ -43,6 +45,7 @@ import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.e
|
|||||||
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception0;
|
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception0;
|
||||||
import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList;
|
import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList;
|
||||||
import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*;
|
import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*;
|
||||||
|
import static com.zt.plat.module.qms.enums.QmsCommonConstant.SAMPLE_STORAGE_OPERATION_TYPE_TAKEN_OFF;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 子样业务 Service 实现类
|
* 子样业务 Service 实现类
|
||||||
@@ -66,6 +69,8 @@ public class BusinessSubSampleServiceImpl implements BusinessSubSampleService {
|
|||||||
@Resource private DictionaryBusinessService dictionaryBusinessService;
|
@Resource private DictionaryBusinessService dictionaryBusinessService;
|
||||||
@Resource private ConfigSubSampleService configSubSampleService;
|
@Resource private ConfigSubSampleService configSubSampleService;
|
||||||
@Resource private SequenceUtil sequenceUtil;
|
@Resource private SequenceUtil sequenceUtil;
|
||||||
|
@Resource
|
||||||
|
private DictionaryBusinessMapper dictionaryBusinessMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@@ -325,18 +330,17 @@ public class BusinessSubSampleServiceImpl implements BusinessSubSampleService {
|
|||||||
|
|
||||||
//创建交接抬头
|
//创建交接抬头
|
||||||
BusinessSampleHandoverSaveReqVO handoverVO = new BusinessSampleHandoverSaveReqVO();
|
BusinessSampleHandoverSaveReqVO handoverVO = new BusinessSampleHandoverSaveReqVO();
|
||||||
String codeTemplate = dictionaryBusinessService.getValueByDataKey("sample_take_off_serial");
|
String code = sequenceUtil.genCode("QMS_SAMPLE_TAKE_OFF_SERIAL");
|
||||||
if(ObjectUtils.isEmpty(codeTemplate))
|
|
||||||
throw exception0(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "缺少“样品下架记录编号规则”的配置,请在业务参数字典增加此配置!");
|
|
||||||
String code = sequenceUtil.genCode(codeTemplate);
|
|
||||||
handoverVO.setCode(code);
|
handoverVO.setCode(code);
|
||||||
handoverVO.setName("样品下架记录");
|
handoverVO.setName("样品下架记录");
|
||||||
handoverVO.setSampleFlowNodeKey(QmsCommonConstant.FLOW_SAMPLE_STORAGE);
|
handoverVO.setSampleFlowNodeKey(QmsCommonConstant.FLOW_SAMPLE_STORAGE);
|
||||||
handoverVO.setOperationTime(LocalDateTime.now());
|
handoverVO.setOperationTime(LocalDateTime.now());
|
||||||
handoverVO.setOperator(loginUserName);
|
handoverVO.setOperator(loginUserName);
|
||||||
handoverVO.setOperatorId(loginUser.getId());
|
handoverVO.setOperatorId(loginUser.getId());
|
||||||
|
handoverVO.setOperationType(SAMPLE_STORAGE_OPERATION_TYPE_TAKEN_OFF);
|
||||||
BusinessSampleHandoverRespVO handoverRespVO = businessSampleHandoverService.createBusinessSampleHandover(handoverVO);
|
BusinessSampleHandoverRespVO handoverRespVO = businessSampleHandoverService.createBusinessSampleHandover(handoverVO);
|
||||||
|
List<Long> dictionaryBusinessIdList = waitingList.stream().map(m -> m.getDictionaryBusinessId()).distinct().collect(Collectors.toList());
|
||||||
|
List<DictionaryBusinessDO> dictionaryBusinessList = dictionaryBusinessMapper.selectByIds(dictionaryBusinessIdList);
|
||||||
//更新下架状态
|
//更新下架状态
|
||||||
List<BusinessHandoverRecordSubDO> recordList = new ArrayList<>();
|
List<BusinessHandoverRecordSubDO> recordList = new ArrayList<>();
|
||||||
List<BusinessSampleHandoverDetailDO> detailList = new ArrayList<>(); //通过样品交接明细记录下架记录
|
List<BusinessSampleHandoverDetailDO> detailList = new ArrayList<>(); //通过样品交接明细记录下架记录
|
||||||
@@ -361,6 +365,11 @@ public class BusinessSubSampleServiceImpl implements BusinessSubSampleService {
|
|||||||
detailDO.setBusinessSubSampleId(businessSubSampleDO.getId());
|
detailDO.setBusinessSubSampleId(businessSubSampleDO.getId());
|
||||||
detailDO.setSampleName(businessSubSampleDO.getSampleName());
|
detailDO.setSampleName(businessSubSampleDO.getSampleName());
|
||||||
detailDO.setSampleCode(businessSubSampleDO.getSampleReturnCode());
|
detailDO.setSampleCode(businessSubSampleDO.getSampleReturnCode());
|
||||||
|
detailDO.setDictionaryBusinessId(businessSubSampleDO.getDictionaryBusinessId());
|
||||||
|
DictionaryBusinessDO dictionaryBusiness = dictionaryBusinessList.stream().filter(f -> f.getId().equals(businessSubSampleDO.getDictionaryBusinessId())).findFirst().orElse(null);
|
||||||
|
detailDO.setDictionaryBusinessName("");
|
||||||
|
if(dictionaryBusiness != null)
|
||||||
|
detailDO.setDictionaryBusinessName(dictionaryBusiness.getName());
|
||||||
detailList.add(detailDO);
|
detailList.add(detailDO);
|
||||||
}
|
}
|
||||||
businessHandoverRecordSubService.insertBatch(recordList);
|
businessHandoverRecordSubService.insertBatch(recordList);
|
||||||
|
|||||||
Reference in New Issue
Block a user