feat:样品库接口调整
This commit is contained in:
@@ -4,6 +4,9 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleDispatchPageReqVO;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleDispatchRespVO;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleDispatchSaveReqVO;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO;
|
||||
import com.zt.plat.module.qms.business.bus.service.BusinessSubSampleService;
|
||||
import com.zt.plat.module.qms.enums.QmsCommonConstant;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -30,6 +33,7 @@ import com.zt.plat.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
import static com.zt.plat.module.qms.enums.ErrorCodeConstants.BUSINESS_SUB_SAMPLE_NOT_EXISTS;
|
||||
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleDispatchDO;
|
||||
import com.zt.plat.module.qms.business.bus.service.BusinessSampleDispatchService;
|
||||
@@ -41,8 +45,8 @@ import com.zt.plat.module.qms.business.bus.service.BusinessSampleDispatchService
|
||||
public class BusinessSampleDispatchController implements BusinessControllerMarker {
|
||||
|
||||
|
||||
@Resource
|
||||
private BusinessSampleDispatchService businessSampleDispatchService;
|
||||
@Resource private BusinessSampleDispatchService businessSampleDispatchService;
|
||||
@Resource private BusinessSubSampleService businessSubSampleService;
|
||||
|
||||
@PostMapping("/createTempData")
|
||||
@Operation(summary = "创建临时数据")
|
||||
@@ -67,6 +71,32 @@ public class BusinessSampleDispatchController implements BusinessControllerMarke
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PutMapping("/addBySampleCode")
|
||||
@Operation(summary = "增加或移除样品")
|
||||
public CommonResult<Boolean> addBySampleCode(HttpServletRequest request) {
|
||||
String id = request.getParameter("id");
|
||||
String sampleCode = request.getParameter("sampleCode");
|
||||
BusinessSubSampleDO businessSubSampleDO = businessSubSampleService.getBySampleCode(sampleCode);
|
||||
if(businessSubSampleDO == null)
|
||||
return CommonResult.error(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "未查询到此样品!");
|
||||
//判断样品状态
|
||||
String returnStatus = businessSubSampleDO.getReturnStatus();
|
||||
if(!QmsCommonConstant.COMPLETED.equals(returnStatus)){
|
||||
return CommonResult.error(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "样品状态为:"+returnStatus+",不能调拨!");
|
||||
}
|
||||
String dispatchStatus = businessSubSampleDO.getDispatchStatus();
|
||||
if("1".equals(dispatchStatus)){
|
||||
return CommonResult.error(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "样品已被调拨:请归还后再调拨!");
|
||||
}
|
||||
List<Long> sampleIds = new ArrayList<>();
|
||||
sampleIds.add(businessSubSampleDO.getId());
|
||||
BusinessSampleDispatchSaveReqVO updateReqVO = new BusinessSampleDispatchSaveReqVO();
|
||||
updateReqVO.setId(Long.valueOf(id));
|
||||
updateReqVO.setAddSubSampleIds(sampleIds);
|
||||
businessSampleDispatchService.addOrRemoveSample(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PostMapping("/createProcessInstance")
|
||||
@Operation(summary = "发起流程")
|
||||
public CommonResult<BusinessSampleDispatchRespVO> createProcessInstance(@Valid @RequestBody BusinessSampleDispatchSaveReqVO vo) {
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
package com.zt.plat.module.qms.business.bus.controller.admin;
|
||||
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleDispatchDetailExtendRespVO;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleDispatchDetailPageReqVO;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleDispatchDetailRespVO;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleDispatchDetailSaveReqVO;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.*;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO;
|
||||
import com.zt.plat.module.qms.business.bus.service.BusinessSubSampleService;
|
||||
import com.zt.plat.module.qms.enums.QmsCommonConstant;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -30,6 +31,8 @@ import com.zt.plat.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
import static com.zt.plat.module.qms.enums.ErrorCodeConstants.BUSINESS_SAMPLE_DISPATCH_DETAIL_NOT_EXISTS;
|
||||
import static com.zt.plat.module.qms.enums.ErrorCodeConstants.BUSINESS_SUB_SAMPLE_NOT_EXISTS;
|
||||
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleDispatchDetailDO;
|
||||
import com.zt.plat.module.qms.business.bus.service.BusinessSampleDispatchDetailService;
|
||||
@@ -41,8 +44,28 @@ import com.zt.plat.module.qms.business.bus.service.BusinessSampleDispatchDetailS
|
||||
public class BusinessSampleDispatchDetailController implements BusinessControllerMarker {
|
||||
|
||||
|
||||
@Resource
|
||||
private BusinessSampleDispatchDetailService businessSampleDispatchDetailService;
|
||||
@Resource private BusinessSampleDispatchDetailService businessSampleDispatchDetailService;
|
||||
@Resource private BusinessSubSampleService businessSubSampleService;
|
||||
|
||||
@GetMapping("/searchBySampleCode")
|
||||
@Operation(summary = "扫码查询待归还样品")
|
||||
public CommonResult<BusinessSampleDispatchDetailExtendRespVO> searchBySampleCode(HttpServletRequest request) {
|
||||
String sampleCode = request.getParameter("sampleCode");
|
||||
if(ObjectUtils.isEmpty(sampleCode))
|
||||
return CommonResult.error(BUSINESS_SAMPLE_DISPATCH_DETAIL_NOT_EXISTS.getCode(), "请输入样品编号!");
|
||||
BusinessSampleDispatchDetailPageReqVO reqVO = new BusinessSampleDispatchDetailPageReqVO();
|
||||
reqVO.setSampleCode(sampleCode);
|
||||
reqVO.setBorrowStatus("1");
|
||||
reqVO.setGivebackStatus("0");
|
||||
|
||||
PageResult<BusinessSampleDispatchDetailExtendRespVO> pageResult = businessSampleDispatchDetailService.getBusinessSampleDispatchDetailPage(reqVO);
|
||||
if(pageResult.getTotal() == 0)
|
||||
return CommonResult.error(BUSINESS_SAMPLE_DISPATCH_DETAIL_NOT_EXISTS.getCode(), "未查询到此样品!");
|
||||
if(pageResult.getList().size() > 1)
|
||||
return CommonResult.error(BUSINESS_SAMPLE_DISPATCH_DETAIL_NOT_EXISTS.getCode(), "样品编号重复,请联系管理员检查数据!");
|
||||
BusinessSampleDispatchDetailExtendRespVO businessSampleDispatchDetailExtendRespVO = pageResult.getList().get(0);
|
||||
return success(businessSampleDispatchDetailExtendRespVO);
|
||||
}
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建样品调拨明细")
|
||||
|
||||
@@ -24,6 +24,9 @@ public class BusinessSampleDispatchDetailExtendRespVO extends BusinessSampleDisp
|
||||
//调拨状态
|
||||
private String dispatchStatus;
|
||||
|
||||
//归库状态
|
||||
private String returnStatus;
|
||||
|
||||
//库位编码
|
||||
private String warehouseLocationCode;
|
||||
|
||||
|
||||
@@ -66,5 +66,9 @@ public class BusinessSampleDispatchDetailPageReqVO extends PageParam {
|
||||
@Schema(description = "idsList")
|
||||
private List<Long> idList;
|
||||
|
||||
@Schema(description = "调拨状态")
|
||||
private String dispatchStatus;
|
||||
|
||||
@Schema(description = "归库状态")
|
||||
private String returnStatus;
|
||||
}
|
||||
@@ -34,6 +34,9 @@ public class BusinessSampleDispatchPageReqVO extends PageParam {
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] applyTime;
|
||||
|
||||
@Schema(description = "申请原因")
|
||||
private String applyContent;
|
||||
|
||||
@Schema(description = "库管员")
|
||||
private String warehouseUser;
|
||||
|
||||
|
||||
@@ -43,6 +43,10 @@ public class BusinessSampleDispatchRespVO {
|
||||
@ExcelProperty("申请时间")
|
||||
private LocalDateTime applyTime;
|
||||
|
||||
@Schema(description = "申请原因")
|
||||
@ExcelProperty("申请原因")
|
||||
private String applyContent;
|
||||
|
||||
@Schema(description = "库管员")
|
||||
@ExcelProperty("库管员")
|
||||
private String warehouseUser;
|
||||
|
||||
@@ -34,6 +34,9 @@ public class BusinessSampleDispatchSaveReqVO {
|
||||
@Schema(description = "申请时间")
|
||||
private LocalDateTime applyTime;
|
||||
|
||||
@Schema(description = "申请原因")
|
||||
private String applyContent;
|
||||
|
||||
@Schema(description = "库管员")
|
||||
private String warehouseUser;
|
||||
|
||||
|
||||
@@ -23,4 +23,10 @@ public class BusinessSubSampleExtendRespVO extends BusinessSubSampleRespVO {
|
||||
|
||||
@Schema(description = "样品标签打印模版")
|
||||
private String printTemplate;
|
||||
|
||||
@Schema(description = "库位编码")
|
||||
private String warehouseLocationCode;
|
||||
|
||||
@Schema(description = "仓库名称")
|
||||
private String warehouseName;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.zt.plat.module.qms.business.bus.controller.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
@@ -99,6 +100,9 @@ public class BusinessSubSamplePageReqVO extends PageParam {
|
||||
@Schema(description = "归库状态,【字典】【jy_sample_return_status】待归库、已归库、已调拨、已下架、待销毁、已销毁", example = "2")
|
||||
private String returnStatus;
|
||||
|
||||
@Schema(description = "调拨状态")
|
||||
private String dispatchStatus;
|
||||
|
||||
@Schema(description = "打印次数", example = "32651")
|
||||
private Integer returnCodePrintCount;
|
||||
|
||||
@@ -128,4 +132,8 @@ public class BusinessSubSamplePageReqVO extends PageParam {
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
//扩展字段
|
||||
@Schema(description = "库位编码")
|
||||
private String warehouseLocationCode;
|
||||
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.zt.plat.module.qms.business.bus.controller.vo;
|
||||
|
||||
import com.zt.plat.module.qms.core.aspect.annotation.Dict;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
@@ -123,6 +124,7 @@ public class BusinessSubSampleRespVO {
|
||||
|
||||
@Schema(description = "归库状态,【字典】【jy_sample_return_status】待归库、已归库、已调拨、已下架、待销毁、已销毁", example = "2")
|
||||
@ExcelProperty("归库状态,【字典】【jy_sample_return_status】待归库、已归库、已调拨、已下架、待销毁、已销毁")
|
||||
@Dict(dicCode = "jy_sample_return_status")
|
||||
private String returnStatus;
|
||||
|
||||
@Schema(description = "调拨状态")
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user