fix:报告、样品库等细节
This commit is contained in:
@@ -73,9 +73,9 @@ public class BusinessSampleDispatchController implements BusinessControllerMarke
|
|||||||
|
|
||||||
@PostMapping("/addBySampleCode")
|
@PostMapping("/addBySampleCode")
|
||||||
@Operation(summary = "增加或移除样品")
|
@Operation(summary = "增加或移除样品")
|
||||||
public CommonResult<Boolean> addBySampleCode(HttpServletRequest request) {
|
public CommonResult<Boolean> addBySampleCode(@RequestBody JSONObject param) {
|
||||||
String id = request.getParameter("id");
|
String id = param.getString("id");
|
||||||
String sampleCode = request.getParameter("sampleCode");
|
String sampleCode = param.getString("sampleCode");
|
||||||
BusinessSubSampleDO businessSubSampleDO = businessSubSampleService.getBySampleCode(sampleCode);
|
BusinessSubSampleDO businessSubSampleDO = businessSubSampleService.getBySampleCode(sampleCode);
|
||||||
if(businessSubSampleDO == null)
|
if(businessSubSampleDO == null)
|
||||||
return CommonResult.error(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "未查询到此样品!");
|
return CommonResult.error(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "未查询到此样品!");
|
||||||
@@ -88,6 +88,8 @@ public class BusinessSampleDispatchController implements BusinessControllerMarke
|
|||||||
if("1".equals(dispatchStatus)){
|
if("1".equals(dispatchStatus)){
|
||||||
return CommonResult.error(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "样品已被调拨:请归还后再调拨!");
|
return CommonResult.error(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "样品已被调拨:请归还后再调拨!");
|
||||||
}
|
}
|
||||||
|
//todo 重复校验
|
||||||
|
|
||||||
List<Long> sampleIds = new ArrayList<>();
|
List<Long> sampleIds = new ArrayList<>();
|
||||||
sampleIds.add(businessSubSampleDO.getId());
|
sampleIds.add(businessSubSampleDO.getId());
|
||||||
BusinessSampleDispatchSaveReqVO updateReqVO = new BusinessSampleDispatchSaveReqVO();
|
BusinessSampleDispatchSaveReqVO updateReqVO = new BusinessSampleDispatchSaveReqVO();
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ public class BusinessSampleDispatchDO extends BusinessBaseDO {
|
|||||||
* 申请原因
|
* 申请原因
|
||||||
*/
|
*/
|
||||||
@TableField("APL_CNTT")
|
@TableField("APL_CNTT")
|
||||||
private LocalDateTime applyContent;
|
private String applyContent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 库管员
|
* 库管员
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ import static com.zt.plat.module.qms.enums.QmsBpmConstant.BPM_CALLBACK_BEAN_NAME
|
|||||||
*
|
*
|
||||||
* @author 后台管理
|
* @author 后台管理
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service("businessSampleDispatchService")
|
||||||
@Validated
|
@Validated
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class BusinessSampleDispatchServiceImpl implements BusinessSampleDispatchService, BMPCallbackInterface {
|
public class BusinessSampleDispatchServiceImpl implements BusinessSampleDispatchService, BMPCallbackInterface {
|
||||||
@@ -65,7 +65,7 @@ public class BusinessSampleDispatchServiceImpl implements BusinessSampleDispatch
|
|||||||
List<Long> removeDetailIds = paramVo.getRemoveDetailIds();
|
List<Long> removeDetailIds = paramVo.getRemoveDetailIds();
|
||||||
|
|
||||||
//处理移除
|
//处理移除
|
||||||
if(!removeDetailIds.isEmpty()){
|
if(removeDetailIds != null && !removeDetailIds.isEmpty()){
|
||||||
businessSampleDispatchDetailService.deleteBusinessSampleDispatchDetailListByIds(removeDetailIds);
|
businessSampleDispatchDetailService.deleteBusinessSampleDispatchDetailListByIds(removeDetailIds);
|
||||||
}
|
}
|
||||||
//处理新增
|
//处理新增
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ public interface BusinessSubSampleService {
|
|||||||
BusinessSubSampleExtendRespVO getBusinessSubSample(Long id);
|
BusinessSubSampleExtendRespVO getBusinessSubSample(Long id);
|
||||||
|
|
||||||
BusinessSubSampleDO getBySampleCode(String sampleCode);
|
BusinessSubSampleDO getBySampleCode(String sampleCode);
|
||||||
|
BusinessSubSampleDO getBySampleReturnCode(String sampleReturnCode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获得子样业务分页
|
* 获得子样业务分页
|
||||||
|
|||||||
@@ -10,7 +10,9 @@ import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessHandoverRecord
|
|||||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleHandoverDO;
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleHandoverDO;
|
||||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleHandoverDetailDO;
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleHandoverDetailDO;
|
||||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleAnalysisGroupDO;
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleAnalysisGroupDO;
|
||||||
|
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.ConfigWarehouseLocationService;
|
import com.zt.plat.module.qms.business.config.service.ConfigWarehouseLocationService;
|
||||||
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;
|
||||||
@@ -60,6 +62,7 @@ public class BusinessSubSampleServiceImpl implements BusinessSubSampleService {
|
|||||||
@Resource private BusinessSampleHandoverDetailService businessSampleHandoverDetailService;
|
@Resource private BusinessSampleHandoverDetailService businessSampleHandoverDetailService;
|
||||||
@Resource private BusinessHandoverRecordSubService businessHandoverRecordSubService;
|
@Resource private BusinessHandoverRecordSubService businessHandoverRecordSubService;
|
||||||
@Resource private DictionaryBusinessService dictionaryBusinessService;
|
@Resource private DictionaryBusinessService dictionaryBusinessService;
|
||||||
|
@Resource private ConfigSubSampleService configSubSampleService;
|
||||||
@Resource private SequenceUtil sequenceUtil;
|
@Resource private SequenceUtil sequenceUtil;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -132,6 +135,13 @@ public class BusinessSubSampleServiceImpl implements BusinessSubSampleService {
|
|||||||
return businessSubSampleMapper.selectOne(queryWrapper);
|
return businessSubSampleMapper.selectOne(queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BusinessSubSampleDO getBySampleReturnCode(String sampleReturnCode) {
|
||||||
|
LambdaQueryWrapper<BusinessSubSampleDO> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(BusinessSubSampleDO::getSampleReturnCode, sampleReturnCode);
|
||||||
|
return businessSubSampleMapper.selectOne(queryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageResult<BusinessSubSampleExtendRespVO> getBusinessSubSamplePage(BusinessSubSamplePageReqVO pageReqVO) {
|
public PageResult<BusinessSubSampleExtendRespVO> getBusinessSubSamplePage(BusinessSubSamplePageReqVO pageReqVO) {
|
||||||
PageResult<BusinessSubSampleExtendRespVO> page = businessSubSampleMapper.selectPage(pageReqVO);
|
PageResult<BusinessSubSampleExtendRespVO> page = businessSubSampleMapper.selectPage(pageReqVO);
|
||||||
@@ -190,7 +200,7 @@ public class BusinessSubSampleServiceImpl implements BusinessSubSampleService {
|
|||||||
public BusinessSubSampleRespVO execReturnToStock(BusinessSubSampleSaveReqVO reqVo) {
|
public BusinessSubSampleRespVO execReturnToStock(BusinessSubSampleSaveReqVO reqVo) {
|
||||||
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
||||||
String loginUserName = SecurityFrameworkUtils.getLoginUserNickname();
|
String loginUserName = SecurityFrameworkUtils.getLoginUserNickname();
|
||||||
BusinessSubSampleDO businessSubSampleDO = this.getBySampleCode(reqVo.getSampleCode());
|
BusinessSubSampleDO businessSubSampleDO = this.getBySampleReturnCode(reqVo.getSampleCode());
|
||||||
if(businessSubSampleDO == null)
|
if(businessSubSampleDO == null)
|
||||||
throw exception(BUSINESS_SUB_SAMPLE_NOT_EXISTS);
|
throw exception(BUSINESS_SUB_SAMPLE_NOT_EXISTS);
|
||||||
//检查样品状态
|
//检查样品状态
|
||||||
@@ -199,6 +209,22 @@ public class BusinessSubSampleServiceImpl implements BusinessSubSampleService {
|
|||||||
if(QmsCommonConstant.COMPLETED.equals(businessSubSampleDO.getReturnStatus()))
|
if(QmsCommonConstant.COMPLETED.equals(businessSubSampleDO.getReturnStatus()))
|
||||||
throw exception0(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "样品已归库,请勿重复操作!");
|
throw exception0(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "样品已归库,请勿重复操作!");
|
||||||
|
|
||||||
|
//判断仓库位置
|
||||||
|
Long configSubSampleId = businessSubSampleDO.getConfigSubSampleId();
|
||||||
|
ConfigSubSampleDO configSubSampleDO = configSubSampleService.getConfigSubSample(configSubSampleId);
|
||||||
|
Integer isGenerateSimpleCode = configSubSampleDO.getIsGenerateSimpleCode();
|
||||||
|
Integer printFlag = 0;
|
||||||
|
if(1 == isGenerateSimpleCode){
|
||||||
|
//生成归库码
|
||||||
|
if(businessSubSampleDO.getIsGenerateReturnCode() == 0){
|
||||||
|
String simpleCodeRule = configSubSampleDO.getSimpleCodeRule();
|
||||||
|
String simpleCode = sequenceUtil.genCode(simpleCodeRule);
|
||||||
|
businessSubSampleDO.setSampleReturnCode(simpleCode);
|
||||||
|
businessSubSampleDO.setIsGenerateReturnCode(1);
|
||||||
|
printFlag = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ConfigWarehouseLocationDO locationDO = configWarehouseLocationService.getLocationByCode(reqVo.getWarehouseLocationCode(), QmsWarehouseLocationConstant.WAREHOUSE_TYPE_SAMPLE);
|
ConfigWarehouseLocationDO locationDO = configWarehouseLocationService.getLocationByCode(reqVo.getWarehouseLocationCode(), QmsWarehouseLocationConstant.WAREHOUSE_TYPE_SAMPLE);
|
||||||
if(locationDO == null)
|
if(locationDO == null)
|
||||||
throw exception(CONFIG_WAREHOUSE_LOCATION_NOT_EXISTS);
|
throw exception(CONFIG_WAREHOUSE_LOCATION_NOT_EXISTS);
|
||||||
@@ -226,8 +252,9 @@ public class BusinessSubSampleServiceImpl implements BusinessSubSampleService {
|
|||||||
* 这里不更新交接人。 调拨和归还时记录交接人
|
* 这里不更新交接人。 调拨和归还时记录交接人
|
||||||
*
|
*
|
||||||
* */
|
* */
|
||||||
|
BusinessSubSampleExtendRespVO respVO = BeanUtils.toBean(businessSubSampleDO, BusinessSubSampleExtendRespVO.class);
|
||||||
return BeanUtils.toBean(businessSubSampleDO, BusinessSubSampleRespVO.class);
|
respVO.setIsPrint(printFlag);
|
||||||
|
return respVO;
|
||||||
}
|
}
|
||||||
|
|
||||||
//样品下架
|
//样品下架
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ public class DataTemplateController implements BusinessControllerMarker {
|
|||||||
@GetMapping("/getByKey")
|
@GetMapping("/getByKey")
|
||||||
@Operation(summary = "获得表单设计器模板")
|
@Operation(summary = "获得表单设计器模板")
|
||||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
@PreAuthorize("@ss.hasPermission('qms:data-template:query')")
|
// @PreAuthorize("@ss.hasPermission('qms:data-template:query')")
|
||||||
public CommonResult<DataTemplateRespVO> getByKey(@RequestParam("dataKey") String dataKey) {
|
public CommonResult<DataTemplateRespVO> getByKey(@RequestParam("dataKey") String dataKey) {
|
||||||
LambdaQueryWrapper<DataTemplateDO> query = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<DataTemplateDO> query = new LambdaQueryWrapper<>();
|
||||||
query.eq(DataTemplateDO::getDataKey, dataKey);
|
query.eq(DataTemplateDO::getDataKey, dataKey);
|
||||||
|
|||||||
Reference in New Issue
Block a user