feat:样品库功能,开发基本完成,需进一步调细节。 报告数据微调
This commit is contained in:
@@ -83,6 +83,9 @@ public interface QmsCommonConstant {
|
||||
/** 已完成 **/
|
||||
String COMPLETED = "completed";
|
||||
|
||||
/** 已下架 **/
|
||||
String TAKEN_OFF = "taken_off";
|
||||
|
||||
/** 分配任务 **/
|
||||
String TASK_ASSIGN = "task_assign";
|
||||
|
||||
@@ -125,6 +128,9 @@ public interface QmsCommonConstant {
|
||||
/** 班组送样 **/
|
||||
String FLOW_NODE_TEAM_SEND = "flw_team_send";
|
||||
|
||||
/** 样品归库 **/
|
||||
String FLOW_SAMPLE_STORAGE = "flw_sample_storage";
|
||||
|
||||
/** 结束 **/
|
||||
String FLOW_NODE_END = "flw_end";
|
||||
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.zt.plat.module.qms.enums;
|
||||
|
||||
/**
|
||||
* 权限模块常量
|
||||
*/
|
||||
public interface QmsWarehouseLocationConstant {
|
||||
//数据类型
|
||||
String DATA_TYPE_LOCATION = "库位";
|
||||
|
||||
String DATA_TYPE_WAREHOUSE = "仓库";
|
||||
|
||||
|
||||
//仓库分类
|
||||
String WAREHOUSE_TYPE_SAMPLE = "样品库";
|
||||
String WAREHOUSE_TYPE_MATERIAL = "物料试剂";
|
||||
|
||||
//样品下架操作方式
|
||||
String SAMPLE_TAKE_OFF_ACTION_WAY_SAMPLE = "sample";
|
||||
String SAMPLE_TAKE_OFF_ACTION_WAY_LOCATION = "warehouseLocation";
|
||||
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.zt.plat.module.qms.business.bus.controller.admin;
|
||||
|
||||
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;
|
||||
@@ -43,21 +44,47 @@ public class BusinessSampleDispatchController implements BusinessControllerMarke
|
||||
@Resource
|
||||
private BusinessSampleDispatchService businessSampleDispatchService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建样品调拨")
|
||||
// @PreAuthorize("@ss.hasPermission('qms:business-sample-dispatch:create')")
|
||||
public CommonResult<BusinessSampleDispatchRespVO> createBusinessSampleDispatch(@Valid @RequestBody BusinessSampleDispatchSaveReqVO createReqVO) {
|
||||
return success(businessSampleDispatchService.createBusinessSampleDispatch(createReqVO));
|
||||
@PostMapping("/createTempData")
|
||||
@Operation(summary = "创建临时数据")
|
||||
public CommonResult<BusinessSampleDispatchRespVO> createTempData() {
|
||||
BusinessSampleDispatchSaveReqVO vo = new BusinessSampleDispatchSaveReqVO();
|
||||
vo.setCancelStatus("-1");
|
||||
return success(businessSampleDispatchService.createBusinessSampleDispatch(vo));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新样品调拨")
|
||||
// @PreAuthorize("@ss.hasPermission('qms:business-sample-dispatch:update')")
|
||||
public CommonResult<Boolean> updateBusinessSampleDispatch(@Valid @RequestBody BusinessSampleDispatchSaveReqVO updateReqVO) {
|
||||
updateReqVO.setCancelStatus("0");
|
||||
businessSampleDispatchService.updateBusinessSampleDispatch(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PutMapping("/addOrRemoveSample")
|
||||
@Operation(summary = "增加或移除样品")
|
||||
public CommonResult<Boolean> addOrRemoveSample(@Valid @RequestBody BusinessSampleDispatchSaveReqVO updateReqVO) {
|
||||
businessSampleDispatchService.addOrRemoveSample(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PostMapping("/createProcessInstance")
|
||||
@Operation(summary = "发起流程")
|
||||
public CommonResult<BusinessSampleDispatchRespVO> createProcessInstance(@Valid @RequestBody BusinessSampleDispatchSaveReqVO vo) {
|
||||
return businessSampleDispatchService.createProcessInstance(vo);
|
||||
}
|
||||
|
||||
@PostMapping("/execDispatch")
|
||||
@Operation(summary = "执行调拨")
|
||||
public CommonResult<String> execDispatch(@Valid @RequestBody BusinessSampleDispatchSaveReqVO vo) {
|
||||
return businessSampleDispatchService.execDispatch(vo);
|
||||
}
|
||||
|
||||
@PostMapping("/execGiveback")
|
||||
@Operation(summary = "调拨归还")
|
||||
public CommonResult<String> execGiveback(@RequestBody JSONObject vo) {
|
||||
return businessSampleDispatchService.execGiveback(vo);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除样品调拨")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
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;
|
||||
@@ -88,9 +89,9 @@ public class BusinessSampleDispatchDetailController implements BusinessControlle
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得样品调拨明细分页")
|
||||
// @PreAuthorize("@ss.hasPermission('qms:business-sample-dispatch-detail:query')")
|
||||
public CommonResult<PageResult<BusinessSampleDispatchDetailRespVO>> getBusinessSampleDispatchDetailPage(@Valid BusinessSampleDispatchDetailPageReqVO pageReqVO) {
|
||||
PageResult<BusinessSampleDispatchDetailDO> pageResult = businessSampleDispatchDetailService.getBusinessSampleDispatchDetailPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, BusinessSampleDispatchDetailRespVO.class));
|
||||
public CommonResult<PageResult<BusinessSampleDispatchDetailExtendRespVO>> getBusinessSampleDispatchDetailPage(@Valid BusinessSampleDispatchDetailPageReqVO pageReqVO) {
|
||||
PageResult<BusinessSampleDispatchDetailExtendRespVO> pageResult = businessSampleDispatchDetailService.getBusinessSampleDispatchDetailPage(pageReqVO);
|
||||
return success(pageResult);
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@@ -100,7 +101,7 @@ public class BusinessSampleDispatchDetailController implements BusinessControlle
|
||||
public void exportBusinessSampleDispatchDetailExcel(@Valid BusinessSampleDispatchDetailPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<BusinessSampleDispatchDetailDO> list = businessSampleDispatchDetailService.getBusinessSampleDispatchDetailPage(pageReqVO).getList();
|
||||
List<BusinessSampleDispatchDetailExtendRespVO> list = businessSampleDispatchDetailService.getBusinessSampleDispatchDetailPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "样品调拨明细.xls", "数据", BusinessSampleDispatchDetailRespVO.class,
|
||||
BeanUtils.toBean(list, BusinessSampleDispatchDetailRespVO.class));
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.zt.plat.module.qms.business.bus.controller.admin;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.*;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
@@ -105,6 +106,13 @@ public class BusinessSubSampleController implements BusinessControllerMarker {
|
||||
return success(pageResult);
|
||||
}
|
||||
|
||||
@GetMapping("/page-stock")
|
||||
@Operation(summary = "查询样品库分页数据")
|
||||
public CommonResult<PageResult<BusinessSubSampleExtendRespVO>> pageStock(@Valid BusinessSubSamplePageReqVO pageReqVO) {
|
||||
PageResult<BusinessSubSampleExtendRespVO> pageResult = businessSubSampleService.getBusinessSubSamplePage(pageReqVO);
|
||||
return success(pageResult);
|
||||
}
|
||||
|
||||
@GetMapping("/page-task")
|
||||
@Operation(summary = "获得子样业务分页")
|
||||
//@PreAuthorize("@ss.hasPermission('qms:business-sub-sample:query')")
|
||||
@@ -141,4 +149,24 @@ public class BusinessSubSampleController implements BusinessControllerMarker {
|
||||
BeanUtils.toBean(list, BusinessSubSampleRespVO.class));
|
||||
}
|
||||
|
||||
@PostMapping("/execReturnToStock")
|
||||
@Operation(summary = "样品归库")
|
||||
public CommonResult<BusinessSubSampleRespVO> execReturnToStock(@Valid @RequestBody BusinessSubSampleSaveReqVO reqVO) {
|
||||
return success(businessSubSampleService.execReturnToStock(reqVO));
|
||||
}
|
||||
|
||||
@PostMapping("/execTakeOff")
|
||||
@Operation(summary = "样品下架")
|
||||
public CommonResult<Integer> execTakeOff(@RequestBody JSONObject reqVO) {
|
||||
Integer count = businessSubSampleService.execTakeOff(reqVO);
|
||||
return success(count);
|
||||
}
|
||||
|
||||
@PostMapping("/execChangeLocation")
|
||||
@Operation(summary = "库位变更")
|
||||
public CommonResult<Integer> execChangeLocation(@RequestBody JSONObject reqVO) {
|
||||
Integer count = businessSubSampleService.execChangeLocation(reqVO);
|
||||
return success(count);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -20,7 +20,7 @@ public class BusinessHandoverRecordSubSaveReqVO {
|
||||
private Long businessSubSampleId;
|
||||
|
||||
@Schema(description = "样品流程配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "9154")
|
||||
@NotNull(message = "样品流程配置ID不能为空")
|
||||
// @NotNull(message = "样品流程配置ID不能为空")
|
||||
private Long configSampleFlowId;
|
||||
|
||||
@Schema(description = "样品流程节点KEY", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@@ -50,11 +50,11 @@ public class BusinessHandoverRecordSubSaveReqVO {
|
||||
private Long operatorId;
|
||||
|
||||
@Schema(description = "送样人", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "送样人不能为空")
|
||||
// @NotEmpty(message = "送样人不能为空")
|
||||
private String sendSampleOperator;
|
||||
|
||||
@Schema(description = "收样人", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "收样人不能为空")
|
||||
// @NotEmpty(message = "收样人不能为空")
|
||||
private String receiveSampleOperator;
|
||||
|
||||
@Schema(description = "上一个交接记录ID", example = "5605")
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.zt.plat.module.qms.business.bus.controller.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
public class BusinessSampleDispatchDetailExtendRespVO extends BusinessSampleDispatchDetailRespVO{
|
||||
//样品编号
|
||||
private String sampleCode;
|
||||
|
||||
//样品名称
|
||||
private String sampleName;
|
||||
|
||||
//归库码
|
||||
private String sampleReturnCode;
|
||||
|
||||
//归库状态
|
||||
private String sampleReturnStatus;
|
||||
|
||||
//归库时间
|
||||
private LocalDateTime sampleReturnTime;
|
||||
|
||||
//调拨状态
|
||||
private String dispatchStatus;
|
||||
|
||||
//库位编码
|
||||
private String warehouseLocationCode;
|
||||
|
||||
//仓库名称
|
||||
private String warehouseName;
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@@ -12,66 +13,41 @@ import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH
|
||||
@Data
|
||||
public class BusinessSampleDispatchDetailPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "主表数据id,支持", example = "10889")
|
||||
@Schema(description = "父ID", example = "828")
|
||||
private Long parentId;
|
||||
|
||||
@Schema(description = "业务数据ID", example = "10723")
|
||||
@Schema(description = "子样数据ID", example = "828")
|
||||
private Long businessSubSampleId;
|
||||
|
||||
@Schema(description = "领用人")
|
||||
private String borrowUser;
|
||||
|
||||
@Schema(description = "领用人id", example = "11884")
|
||||
@Schema(description = "领用人id", example = "22151")
|
||||
private Long borrowUserId;
|
||||
|
||||
@Schema(description = "领用时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private Long[] borrowTime;
|
||||
private LocalDateTime[] borrowTime;
|
||||
|
||||
@Schema(description = "领用状态,0-未领用;1-已领用", example = "1")
|
||||
private String borrowStatus;
|
||||
|
||||
@Schema(description = "归还人")
|
||||
private String givebackUser;
|
||||
|
||||
@Schema(description = "归还人id", example = "30812")
|
||||
@Schema(description = "归还人id", example = "23976")
|
||||
private Long givebackUserId;
|
||||
|
||||
@Schema(description = "归还时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private Long[] givebackTime;
|
||||
private LocalDateTime[] givebackTime;
|
||||
|
||||
@Schema(description = "申请部门")
|
||||
private String applyDepartment;
|
||||
|
||||
@Schema(description = "申请部门id", example = "10703")
|
||||
private Long applyDepartmentId;
|
||||
|
||||
@Schema(description = "申请时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] applyTime;
|
||||
|
||||
@Schema(description = "提交状态,0-未提交;1-已提交", example = "2")
|
||||
private String submitStatus;
|
||||
|
||||
@Schema(description = "审批状态,0-未审批;1-已审批", example = "2")
|
||||
private String approvalStatus;
|
||||
@Schema(description = "归还状态,0-未归还;1-已归还", example = "2")
|
||||
private String givebackStatus;
|
||||
|
||||
@Schema(description = "使用状态", example = "2")
|
||||
private String useStatus;
|
||||
|
||||
@Schema(description = "表单数据,表单数据")
|
||||
private String formData;
|
||||
|
||||
@Schema(description = "表单模板,表单编辑器模板")
|
||||
private String formTemplate;
|
||||
|
||||
@Schema(description = "流程实例id", example = "25078")
|
||||
private String flowInstanceId;
|
||||
|
||||
@Schema(description = "流程审批状态", example = "1")
|
||||
private String flowStatus;
|
||||
|
||||
@Schema(description = "审批意见")
|
||||
private String opinion;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
@@ -82,4 +58,13 @@ public class BusinessSampleDispatchDetailPageReqVO extends PageParam {
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
//================================扩展字段=============================================
|
||||
|
||||
@Schema(description = "样品号")
|
||||
private String sampleCode;
|
||||
|
||||
@Schema(description = "idsList")
|
||||
private List<Long> idList;
|
||||
|
||||
|
||||
}
|
||||
@@ -11,86 +11,54 @@ import com.alibaba.excel.annotation.*;
|
||||
@ExcelIgnoreUnannotated
|
||||
public class BusinessSampleDispatchDetailRespVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "31752")
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "20771")
|
||||
@ExcelProperty("主键")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "主表数据id,支持", requiredMode = Schema.RequiredMode.REQUIRED, example = "10889")
|
||||
@ExcelProperty("主表数据id,支持")
|
||||
@Schema(description = "父ID", example = "828")
|
||||
@ExcelProperty("父ID")
|
||||
private Long parentId;
|
||||
|
||||
@Schema(description = "业务数据ID", example = "10723")
|
||||
@ExcelProperty("业务数据ID")
|
||||
@Schema(description = "子样数据ID", example = "828")
|
||||
@ExcelProperty("子样数据ID")
|
||||
private Long businessSubSampleId;
|
||||
|
||||
@Schema(description = "领用人")
|
||||
@ExcelProperty("领用人")
|
||||
private String borrowUser;
|
||||
|
||||
@Schema(description = "领用人id", example = "11884")
|
||||
@Schema(description = "领用人id", example = "22151")
|
||||
@ExcelProperty("领用人id")
|
||||
private Long borrowUserId;
|
||||
|
||||
@Schema(description = "领用时间")
|
||||
@ExcelProperty("领用时间")
|
||||
private Long borrowTime;
|
||||
private LocalDateTime borrowTime;
|
||||
|
||||
@Schema(description = "领用状态,0-未领用;1-已领用", example = "1")
|
||||
@ExcelProperty("领用状态,0-未领用;1-已领用")
|
||||
private String borrowStatus;
|
||||
|
||||
@Schema(description = "归还人")
|
||||
@ExcelProperty("归还人")
|
||||
private String givebackUser;
|
||||
|
||||
@Schema(description = "归还人id", example = "30812")
|
||||
@Schema(description = "归还人id", example = "23976")
|
||||
@ExcelProperty("归还人id")
|
||||
private Long givebackUserId;
|
||||
|
||||
@Schema(description = "归还时间")
|
||||
@ExcelProperty("归还时间")
|
||||
private Long givebackTime;
|
||||
private LocalDateTime givebackTime;
|
||||
|
||||
@Schema(description = "申请部门")
|
||||
@ExcelProperty("申请部门")
|
||||
private String applyDepartment;
|
||||
|
||||
@Schema(description = "申请部门id", example = "10703")
|
||||
@ExcelProperty("申请部门id")
|
||||
private Long applyDepartmentId;
|
||||
|
||||
@Schema(description = "申请时间")
|
||||
@ExcelProperty("申请时间")
|
||||
private LocalDateTime applyTime;
|
||||
|
||||
@Schema(description = "提交状态,0-未提交;1-已提交", example = "2")
|
||||
@ExcelProperty("提交状态,0-未提交;1-已提交")
|
||||
private String submitStatus;
|
||||
|
||||
@Schema(description = "审批状态,0-未审批;1-已审批", example = "2")
|
||||
@ExcelProperty("审批状态,0-未审批;1-已审批")
|
||||
private String approvalStatus;
|
||||
@Schema(description = "归还状态,0-未归还;1-已归还", example = "2")
|
||||
@ExcelProperty("归还状态,0-未归还;1-已归还")
|
||||
private String givebackStatus;
|
||||
|
||||
@Schema(description = "使用状态", example = "2")
|
||||
@ExcelProperty("使用状态")
|
||||
private String useStatus;
|
||||
|
||||
@Schema(description = "表单数据,表单数据")
|
||||
@ExcelProperty("表单数据,表单数据")
|
||||
private String formData;
|
||||
|
||||
@Schema(description = "表单模板,表单编辑器模板")
|
||||
@ExcelProperty("表单模板,表单编辑器模板")
|
||||
private String formTemplate;
|
||||
|
||||
@Schema(description = "流程实例id", example = "25078")
|
||||
@ExcelProperty("流程实例id")
|
||||
private String flowInstanceId;
|
||||
|
||||
@Schema(description = "流程审批状态", example = "1")
|
||||
@ExcelProperty("流程审批状态")
|
||||
private String flowStatus;
|
||||
|
||||
@Schema(description = "审批意见")
|
||||
@ExcelProperty("审批意见")
|
||||
private String opinion;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
@ExcelProperty("所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
@@ -10,67 +10,42 @@ import java.time.LocalDateTime;
|
||||
@Data
|
||||
public class BusinessSampleDispatchDetailSaveReqVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "31752")
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "20771")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "主表数据id,支持", requiredMode = Schema.RequiredMode.REQUIRED, example = "10889")
|
||||
@NotNull(message = "主表数据id,支持不能为空")
|
||||
@Schema(description = "父ID", example = "828")
|
||||
private Long parentId;
|
||||
|
||||
@Schema(description = "业务数据ID", example = "10723")
|
||||
@Schema(description = "子样数据ID", example = "828")
|
||||
private Long businessSubSampleId;
|
||||
|
||||
@Schema(description = "领用人")
|
||||
private String borrowUser;
|
||||
|
||||
@Schema(description = "领用人id", example = "11884")
|
||||
@Schema(description = "领用人id", example = "22151")
|
||||
private Long borrowUserId;
|
||||
|
||||
@Schema(description = "领用时间")
|
||||
private Long borrowTime;
|
||||
private LocalDateTime borrowTime;
|
||||
|
||||
@Schema(description = "领用状态,0-未领用;1-已领用", example = "1")
|
||||
private String borrowStatus;
|
||||
|
||||
@Schema(description = "归还人")
|
||||
private String givebackUser;
|
||||
|
||||
@Schema(description = "归还人id", example = "30812")
|
||||
@Schema(description = "归还人id", example = "23976")
|
||||
private Long givebackUserId;
|
||||
|
||||
@Schema(description = "归还时间")
|
||||
private Long givebackTime;
|
||||
private LocalDateTime givebackTime;
|
||||
|
||||
@Schema(description = "申请部门")
|
||||
private String applyDepartment;
|
||||
|
||||
@Schema(description = "申请部门id", example = "10703")
|
||||
private Long applyDepartmentId;
|
||||
|
||||
@Schema(description = "申请时间")
|
||||
private LocalDateTime applyTime;
|
||||
|
||||
@Schema(description = "提交状态,0-未提交;1-已提交", example = "2")
|
||||
private String submitStatus;
|
||||
|
||||
@Schema(description = "审批状态,0-未审批;1-已审批", example = "2")
|
||||
private String approvalStatus;
|
||||
@Schema(description = "归还状态,0-未归还;1-已归还", example = "2")
|
||||
private String givebackStatus;
|
||||
|
||||
@Schema(description = "使用状态", example = "2")
|
||||
private String useStatus;
|
||||
|
||||
@Schema(description = "表单数据,表单数据")
|
||||
private String formData;
|
||||
|
||||
@Schema(description = "表单模板,表单编辑器模板")
|
||||
private String formTemplate;
|
||||
|
||||
@Schema(description = "流程实例id", example = "25078")
|
||||
private String flowInstanceId;
|
||||
|
||||
@Schema(description = "流程审批状态", example = "1")
|
||||
private String flowStatus;
|
||||
|
||||
@Schema(description = "审批意见")
|
||||
private String opinion;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - 样品调拨新增/修改 Request VO")
|
||||
@Data
|
||||
@@ -60,4 +61,12 @@ public class BusinessSampleDispatchSaveReqVO {
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
//=========================扩展字段=======================================
|
||||
@Schema(description = "新增子样id")
|
||||
List<Long> addSubSampleIds;
|
||||
|
||||
@Schema(description = "移除明细id")
|
||||
List<Long> removeDetailIds;
|
||||
|
||||
|
||||
}
|
||||
@@ -99,6 +99,9 @@ public class BusinessSubSampleReqVO {
|
||||
@Schema(description = "归库状态,【字典】【jy_sample_return_status】待归库、已归库、已调拨、已下架、待销毁、已销毁", example = "2")
|
||||
private String returnStatus;
|
||||
|
||||
@Schema(description = "调拨状态")
|
||||
private String dispatchStatus;
|
||||
|
||||
@Schema(description = "打印次数", example = "32651")
|
||||
private Integer returnCodePrintCount;
|
||||
|
||||
|
||||
@@ -125,6 +125,10 @@ public class BusinessSubSampleRespVO {
|
||||
@ExcelProperty("归库状态,【字典】【jy_sample_return_status】待归库、已归库、已调拨、已下架、待销毁、已销毁")
|
||||
private String returnStatus;
|
||||
|
||||
@Schema(description = "调拨状态")
|
||||
@ExcelProperty("调拨状态")
|
||||
private String dispatchStatus;
|
||||
|
||||
@Schema(description = "打印次数", requiredMode = Schema.RequiredMode.REQUIRED, example = "32651")
|
||||
@ExcelProperty("打印次数")
|
||||
private Integer returnCodePrintCount;
|
||||
|
||||
@@ -16,37 +16,37 @@ public class BusinessSubSampleSaveReqVO {
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "样品主样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "10824")
|
||||
@NotNull(message = "样品主样ID不能为空")
|
||||
// @NotNull(message = "样品主样ID不能为空")
|
||||
private Long businessBaseSampleId;
|
||||
|
||||
@Schema(description = "样品分样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "31262")
|
||||
@NotNull(message = "样品分样ID不能为空")
|
||||
// @NotNull(message = "样品分样ID不能为空")
|
||||
private Long businessSubParentSampleId;
|
||||
|
||||
@Schema(description = "子样配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "19843")
|
||||
@NotNull(message = "子样配置ID不能为空")
|
||||
// @NotNull(message = "子样配置ID不能为空")
|
||||
private Long configSubSampleId;
|
||||
|
||||
@Schema(description = "子样类型ID,字典表:【T_DIC_BSN】化学分析样、试金分析样、仪器分析样", requiredMode = Schema.RequiredMode.REQUIRED, example = "25153")
|
||||
@NotNull(message = "子样类型ID,字典表:【T_DIC_BSN】化学分析样、试金分析样、仪器分析样不能为空")
|
||||
// @NotNull(message = "子样类型ID,字典表:【T_DIC_BSN】化学分析样、试金分析样、仪器分析样不能为空")
|
||||
private Long dictionaryBusinessId;
|
||||
|
||||
@Schema(description = "库位信息ID", example = "5479")
|
||||
private Long configWarehouseLocationInfomationId;
|
||||
|
||||
@Schema(description = "样品ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "15518")
|
||||
@NotNull(message = "样品ID不能为空")
|
||||
// @NotNull(message = "样品ID不能为空")
|
||||
private Long sampleId;
|
||||
|
||||
@Schema(description = "组ID,如果是委托创建的,则组ID和样品分样ID一致", example = "16918")
|
||||
private String groupId;
|
||||
|
||||
@Schema(description = "样品名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
|
||||
@NotEmpty(message = "样品名称不能为空")
|
||||
// @NotEmpty(message = "样品名称不能为空")
|
||||
private String sampleName;
|
||||
|
||||
@Schema(description = "样品编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "样品编号不能为空")
|
||||
// @NotEmpty(message = "样品编号不能为空")
|
||||
private String sampleCode;
|
||||
|
||||
@Schema(description = "分析编号")
|
||||
@@ -56,7 +56,7 @@ public class BusinessSubSampleSaveReqVO {
|
||||
private String sampleReturnCode;
|
||||
|
||||
@Schema(description = "是否称重,1-启用,0-不启用", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "是否称重,1-启用,0-不启用不能为空")
|
||||
// @NotNull(message = "是否称重,1-启用,0-不启用不能为空")
|
||||
private Integer isWeighing;
|
||||
|
||||
@Schema(description = "末次重量,末次样品重量")
|
||||
@@ -66,37 +66,37 @@ public class BusinessSubSampleSaveReqVO {
|
||||
private String lastBalanceCode;
|
||||
|
||||
@Schema(description = "样品流程配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "15413")
|
||||
@NotNull(message = "样品流程配置ID不能为空")
|
||||
// @NotNull(message = "样品流程配置ID不能为空")
|
||||
private Long configSampleFlowId;
|
||||
|
||||
@Schema(description = "样品流程节点KEY", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "样品流程节点KEY不能为空")
|
||||
// @NotEmpty(message = "样品流程节点KEY不能为空")
|
||||
private String sampleFlowNodeKey;
|
||||
|
||||
@Schema(description = "样品流程节点时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "样品流程节点时间不能为空")
|
||||
// @NotNull(message = "样品流程节点时间不能为空")
|
||||
private LocalDateTime sampleFlowNodeTime;
|
||||
|
||||
@Schema(description = "下一步样品流程节点名称", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "下一步样品流程节点名称不能为空")
|
||||
// @NotEmpty(message = "下一步样品流程节点名称不能为空")
|
||||
private String nextSampleFlowNode;
|
||||
|
||||
@Schema(description = "样品状态,【字典】【jy_sample_status】normal-正常、isolation-隔离、void-作废", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotEmpty(message = "样品状态,【字典】【jy_sample_status】normal-正常、isolation-隔离、void-作废不能为空")
|
||||
// @NotEmpty(message = "样品状态,【字典】【jy_sample_status】normal-正常、isolation-隔离、void-作废不能为空")
|
||||
private String sampleStatus;
|
||||
|
||||
@Schema(description = "分析人")
|
||||
private String assayOperator;
|
||||
|
||||
@Schema(description = "是否已分配任务", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "是否已分配任务不能为空")
|
||||
// @NotNull(message = "是否已分配任务不能为空")
|
||||
private Integer isAssignTasked;
|
||||
|
||||
@Schema(description = "分配任务时间")
|
||||
private LocalDateTime assignTaskTime;
|
||||
|
||||
@Schema(description = "是否已上报", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "是否已上报不能为空")
|
||||
// @NotNull(message = "是否已上报不能为空")
|
||||
private Integer isReported;
|
||||
|
||||
@Schema(description = "上报人")
|
||||
@@ -111,8 +111,11 @@ public class BusinessSubSampleSaveReqVO {
|
||||
@Schema(description = "归库状态,【字典】【jy_sample_return_status】待归库、已归库、已调拨、已下架、待销毁、已销毁", example = "2")
|
||||
private String returnStatus;
|
||||
|
||||
@Schema(description = "调拨状态")
|
||||
private String dispatchStatus;
|
||||
|
||||
@Schema(description = "打印次数", requiredMode = Schema.RequiredMode.REQUIRED, example = "32651")
|
||||
@NotNull(message = "打印次数不能为空")
|
||||
// @NotNull(message = "打印次数不能为空")
|
||||
private Integer returnCodePrintCount;
|
||||
|
||||
@Schema(description = "末次打印时间")
|
||||
@@ -125,7 +128,7 @@ public class BusinessSubSampleSaveReqVO {
|
||||
private String analysisRemark;
|
||||
|
||||
@Schema(description = "是否启用,1-启用,0-不启用", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "是否启用,1-启用,0-不启用不能为空")
|
||||
// @NotNull(message = "是否启用,1-启用,0-不启用不能为空")
|
||||
private Integer isEnabled;
|
||||
|
||||
@Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@@ -137,4 +140,10 @@ public class BusinessSubSampleSaveReqVO {
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
//============================扩展属性===============================
|
||||
@Schema(description = "库位编码")
|
||||
private String warehouseLocationCode;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -27,113 +27,72 @@ public class BusinessSampleDispatchDetailDO extends BusinessBaseDO {
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
/**
|
||||
* 主表数据id,支持
|
||||
*/
|
||||
|
||||
@TableField("PRN_ID")
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 业务数据ID
|
||||
*/
|
||||
* 子样数据ID
|
||||
*/
|
||||
@TableField("BSN_SB_SMP_ID")
|
||||
private Long businessSubSampleId;
|
||||
/**
|
||||
* 领用人
|
||||
*/
|
||||
* 领用人
|
||||
*/
|
||||
@TableField("BRW_USER")
|
||||
private String borrowUser;
|
||||
/**
|
||||
* 领用人id
|
||||
*/
|
||||
* 领用人id
|
||||
*/
|
||||
@TableField("BRW_USER_ID")
|
||||
private Long borrowUserId;
|
||||
/**
|
||||
* 领用时间
|
||||
*/
|
||||
* 领用时间
|
||||
*/
|
||||
@TableField("BRW_TM")
|
||||
private Long borrowTime;
|
||||
private LocalDateTime borrowTime;
|
||||
/**
|
||||
* 归还人
|
||||
*/
|
||||
* 领用状态,0-未领用;1-已领用
|
||||
*/
|
||||
@TableField("BRW_STS")
|
||||
private String borrowStatus;
|
||||
/**
|
||||
* 归还人
|
||||
*/
|
||||
@TableField("GIV_USER")
|
||||
private String givebackUser;
|
||||
/**
|
||||
* 归还人id
|
||||
*/
|
||||
* 归还人id
|
||||
*/
|
||||
@TableField("GIV_USER_ID")
|
||||
private Long givebackUserId;
|
||||
/**
|
||||
* 归还时间
|
||||
*/
|
||||
* 归还时间
|
||||
*/
|
||||
@TableField("GIV_TM")
|
||||
private Long givebackTime;
|
||||
private LocalDateTime givebackTime;
|
||||
/**
|
||||
* 申请部门
|
||||
*/
|
||||
@TableField("APL_DEPT")
|
||||
private String applyDepartment;
|
||||
* 归还状态,0-未归还;1-已归还
|
||||
*/
|
||||
@TableField("GIV_STS")
|
||||
private String givebackStatus;
|
||||
/**
|
||||
* 申请部门id
|
||||
*/
|
||||
@TableField("APL_DEPT_ID")
|
||||
private Long applyDepartmentId;
|
||||
/**
|
||||
* 申请时间
|
||||
*/
|
||||
@TableField("APL_TM")
|
||||
private LocalDateTime applyTime;
|
||||
/**
|
||||
* 提交状态,0-未提交;1-已提交
|
||||
*/
|
||||
@TableField("SBM_STS")
|
||||
private String submitStatus;
|
||||
/**
|
||||
* 审批状态,0-未审批;1-已审批
|
||||
*/
|
||||
@TableField("APRV_STS")
|
||||
private String approvalStatus;
|
||||
/**
|
||||
* 使用状态
|
||||
*/
|
||||
* 使用状态
|
||||
*/
|
||||
@TableField("USE_STS")
|
||||
private String useStatus;
|
||||
/**
|
||||
* 表单数据,表单数据
|
||||
*/
|
||||
@TableField("FORM_DAT")
|
||||
private String formData;
|
||||
/**
|
||||
* 表单模板,表单编辑器模板
|
||||
*/
|
||||
@TableField("FORM_TMPL")
|
||||
private String formTemplate;
|
||||
/**
|
||||
* 流程实例id
|
||||
*/
|
||||
@TableField("FLW_INSC_ID")
|
||||
private String flowInstanceId;
|
||||
/**
|
||||
* 流程审批状态
|
||||
*/
|
||||
@TableField("FLW_STS")
|
||||
private String flowStatus;
|
||||
/**
|
||||
* 审批意见
|
||||
*/
|
||||
@TableField("ONN")
|
||||
private String opinion;
|
||||
/**
|
||||
* 所属部门
|
||||
*/
|
||||
* 所属部门
|
||||
*/
|
||||
@TableField("SYS_DEPT_CD")
|
||||
private String systemDepartmentCode;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
* 备注
|
||||
*/
|
||||
@TableField("RMK")
|
||||
private String remark;
|
||||
|
||||
|
||||
@@ -172,6 +172,11 @@ public class BusinessSubSampleDO extends BusinessBaseDO {
|
||||
*/
|
||||
@TableField("RTN_STS")
|
||||
private String returnStatus;
|
||||
|
||||
//调拨状态
|
||||
@TableField("DST_STS")
|
||||
private String dispatchStatus;
|
||||
|
||||
/**
|
||||
* 打印次数
|
||||
*/
|
||||
|
||||
@@ -3,8 +3,14 @@ package com.zt.plat.module.qms.business.bus.dal.mapper;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX;
|
||||
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.dal.dataobject.BusinessSampleDispatchDetailDO;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigWarehouseLocationDO;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigWarehouseLocationParDO;
|
||||
import com.zt.plat.module.qms.enums.QmsWarehouseLocationConstant;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
@@ -15,31 +21,46 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
@Mapper
|
||||
public interface BusinessSampleDispatchDetailMapper extends BaseMapperX<BusinessSampleDispatchDetailDO> {
|
||||
|
||||
default PageResult<BusinessSampleDispatchDetailDO> selectPage(BusinessSampleDispatchDetailPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<BusinessSampleDispatchDetailDO>()
|
||||
default PageResult<BusinessSampleDispatchDetailExtendRespVO> selectPage(BusinessSampleDispatchDetailPageReqVO reqVO) {
|
||||
MPJLambdaWrapperX<BusinessSampleDispatchDetailDO> wrapper = new MPJLambdaWrapperX<>();
|
||||
//子样表
|
||||
wrapper.leftJoin(BusinessSubSampleDO.class , BusinessSubSampleDO::getId, BusinessSampleDispatchDetailDO::getBusinessSubSampleId);
|
||||
//库位
|
||||
wrapper.leftJoin(ConfigWarehouseLocationDO.class, ConfigWarehouseLocationDO::getId, BusinessSubSampleDO::getConfigWarehouseLocationInfomationId, w->{
|
||||
w.eq(ConfigWarehouseLocationDO::getWarehouseType, QmsWarehouseLocationConstant.WAREHOUSE_TYPE_SAMPLE);
|
||||
});
|
||||
//仓库
|
||||
wrapper.leftJoin(ConfigWarehouseLocationParDO.class, ConfigWarehouseLocationParDO::getId, ConfigWarehouseLocationDO::getParentId);
|
||||
wrapper.selectAll(BusinessSampleDispatchDetailDO.class)
|
||||
.selectAs(BusinessSubSampleDO::getSampleCode, BusinessSampleDispatchDetailExtendRespVO::getSampleCode)
|
||||
.selectAs(BusinessSubSampleDO::getSampleName, BusinessSampleDispatchDetailExtendRespVO::getSampleName)
|
||||
.selectAs(BusinessSubSampleDO::getSampleReturnCode, BusinessSampleDispatchDetailExtendRespVO::getSampleReturnCode)
|
||||
.selectAs(BusinessSubSampleDO::getReturnStatus, BusinessSampleDispatchDetailExtendRespVO::getSampleReturnStatus)
|
||||
.selectAs(BusinessSubSampleDO::getReturnTime, BusinessSampleDispatchDetailExtendRespVO::getSampleReturnTime)
|
||||
.selectAs(BusinessSubSampleDO::getDispatchStatus, BusinessSampleDispatchDetailExtendRespVO::getDispatchStatus)
|
||||
.selectAs(ConfigWarehouseLocationDO::getCode, BusinessSampleDispatchDetailExtendRespVO::getWarehouseLocationCode)
|
||||
.selectAs(ConfigWarehouseLocationParDO::getName, BusinessSampleDispatchDetailExtendRespVO::getWarehouseName)
|
||||
//查询条件
|
||||
.inIfPresent(BusinessSampleDispatchDetailDO::getId, reqVO.getIdList())
|
||||
.eqIfPresent(BusinessSampleDispatchDetailDO::getParentId, reqVO.getParentId())
|
||||
.eqIfPresent(BusinessSampleDispatchDetailDO::getBusinessSubSampleId, reqVO.getBusinessSubSampleId())
|
||||
.eqIfPresent(BusinessSampleDispatchDetailDO::getBorrowUser, reqVO.getBorrowUser())
|
||||
.eqIfPresent(BusinessSampleDispatchDetailDO::getBorrowUserId, reqVO.getBorrowUserId())
|
||||
.betweenIfPresent(BusinessSampleDispatchDetailDO::getBorrowTime, reqVO.getBorrowTime())
|
||||
.eqIfPresent(BusinessSampleDispatchDetailDO::getBorrowStatus, reqVO.getBorrowStatus())
|
||||
.eqIfPresent(BusinessSampleDispatchDetailDO::getGivebackUser, reqVO.getGivebackUser())
|
||||
.eqIfPresent(BusinessSampleDispatchDetailDO::getGivebackUserId, reqVO.getGivebackUserId())
|
||||
.betweenIfPresent(BusinessSampleDispatchDetailDO::getGivebackTime, reqVO.getGivebackTime())
|
||||
.eqIfPresent(BusinessSampleDispatchDetailDO::getApplyDepartment, reqVO.getApplyDepartment())
|
||||
.eqIfPresent(BusinessSampleDispatchDetailDO::getApplyDepartmentId, reqVO.getApplyDepartmentId())
|
||||
.betweenIfPresent(BusinessSampleDispatchDetailDO::getApplyTime, reqVO.getApplyTime())
|
||||
.eqIfPresent(BusinessSampleDispatchDetailDO::getSubmitStatus, reqVO.getSubmitStatus())
|
||||
.eqIfPresent(BusinessSampleDispatchDetailDO::getApprovalStatus, reqVO.getApprovalStatus())
|
||||
.eqIfPresent(BusinessSampleDispatchDetailDO::getGivebackStatus, reqVO.getGivebackStatus())
|
||||
.eqIfPresent(BusinessSampleDispatchDetailDO::getUseStatus, reqVO.getUseStatus())
|
||||
.eqIfPresent(BusinessSampleDispatchDetailDO::getFormData, reqVO.getFormData())
|
||||
.eqIfPresent(BusinessSampleDispatchDetailDO::getFormTemplate, reqVO.getFormTemplate())
|
||||
.eqIfPresent(BusinessSampleDispatchDetailDO::getFlowInstanceId, reqVO.getFlowInstanceId())
|
||||
.eqIfPresent(BusinessSampleDispatchDetailDO::getFlowStatus, reqVO.getFlowStatus())
|
||||
.eqIfPresent(BusinessSampleDispatchDetailDO::getOpinion, reqVO.getOpinion())
|
||||
.eqIfPresent(BusinessSampleDispatchDetailDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
|
||||
.eqIfPresent(BusinessSampleDispatchDetailDO::getRemark, reqVO.getRemark())
|
||||
.betweenIfPresent(BusinessSampleDispatchDetailDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(BusinessSampleDispatchDetailDO::getId));
|
||||
//排序
|
||||
.orderByDesc(BusinessSampleDispatchDetailDO::getId);
|
||||
|
||||
return selectJoinPage(reqVO, BusinessSampleDispatchDetailExtendRespVO.class, wrapper);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -34,6 +34,7 @@ public interface BusinessSampleDispatchMapper extends BaseMapperX<BusinessSample
|
||||
.eqIfPresent(BusinessSampleDispatchDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
|
||||
.eqIfPresent(BusinessSampleDispatchDO::getRemark, reqVO.getRemark())
|
||||
.betweenIfPresent(BusinessSampleDispatchDO::getCreateTime, reqVO.getCreateTime())
|
||||
.ne(BusinessSampleDispatchDO::getCancelStatus, "-1")
|
||||
.orderByDesc(BusinessSampleDispatchDO::getId));
|
||||
}
|
||||
|
||||
|
||||
@@ -64,4 +64,5 @@ public interface BusinessHandoverRecordSubService {
|
||||
*/
|
||||
PageResult<BusinessHandoverRecordSubExtendRespVO> getBusinessHandoverRecordSubPage(BusinessHandoverRecordSubPageReqVO pageReqVO);
|
||||
|
||||
void insertBatch(List<BusinessHandoverRecordSubDO> list);
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import com.zt.plat.module.qms.business.bus.controller.vo.BusinessHandoverRecordS
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessHandoverRecordSubSaveReqVO;
|
||||
import org.springframework.stereotype.Service;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.*;
|
||||
@@ -91,4 +92,9 @@ public class BusinessHandoverRecordSubServiceImpl implements BusinessHandoverRec
|
||||
return businessHandoverRecordSubMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void insertBatch(List<BusinessHandoverRecordSubDO> list) {
|
||||
businessHandoverRecordSubMapper.insertBatch(list);
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package com.zt.plat.module.qms.business.bus.service;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
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;
|
||||
@@ -16,6 +17,11 @@ import com.zt.plat.framework.common.pojo.PageResult;
|
||||
*/
|
||||
public interface BusinessSampleDispatchDetailService {
|
||||
|
||||
List<BusinessSampleDispatchDetailDO> listByParID(Long parID);
|
||||
|
||||
void insertBatch(List<BusinessSampleDispatchDetailDO> list);
|
||||
void updateBatch(List<BusinessSampleDispatchDetailDO> list);
|
||||
|
||||
/**
|
||||
* 创建样品调拨明细
|
||||
*
|
||||
@@ -59,6 +65,6 @@ public interface BusinessSampleDispatchDetailService {
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 样品调拨明细分页
|
||||
*/
|
||||
PageResult<BusinessSampleDispatchDetailDO> getBusinessSampleDispatchDetailPage(BusinessSampleDispatchDetailPageReqVO pageReqVO);
|
||||
PageResult<BusinessSampleDispatchDetailExtendRespVO> getBusinessSampleDispatchDetailPage(BusinessSampleDispatchDetailPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.zt.plat.module.qms.business.bus.service;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
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;
|
||||
@@ -32,6 +34,23 @@ public class BusinessSampleDispatchDetailServiceImpl implements BusinessSampleDi
|
||||
@Resource
|
||||
private BusinessSampleDispatchDetailMapper businessSampleDispatchDetailMapper;
|
||||
|
||||
@Override
|
||||
public List<BusinessSampleDispatchDetailDO> listByParID(Long parID) {
|
||||
LambdaQueryWrapper<BusinessSampleDispatchDetailDO> query = new LambdaQueryWrapper<>();
|
||||
query.eq(BusinessSampleDispatchDetailDO::getParentId, parID);
|
||||
return businessSampleDispatchDetailMapper.selectList(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insertBatch(List<BusinessSampleDispatchDetailDO> list) {
|
||||
businessSampleDispatchDetailMapper.insertBatch(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateBatch(List<BusinessSampleDispatchDetailDO> list) {
|
||||
businessSampleDispatchDetailMapper.updateBatch(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BusinessSampleDispatchDetailRespVO createBusinessSampleDispatchDetail(BusinessSampleDispatchDetailSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
@@ -85,7 +104,7 @@ public class BusinessSampleDispatchDetailServiceImpl implements BusinessSampleDi
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<BusinessSampleDispatchDetailDO> getBusinessSampleDispatchDetailPage(BusinessSampleDispatchDetailPageReqVO pageReqVO) {
|
||||
public PageResult<BusinessSampleDispatchDetailExtendRespVO> getBusinessSampleDispatchDetailPage(BusinessSampleDispatchDetailPageReqVO pageReqVO) {
|
||||
return businessSampleDispatchDetailMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,8 @@ package com.zt.plat.module.qms.business.bus.service;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
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;
|
||||
@@ -16,6 +18,16 @@ import com.zt.plat.framework.common.pojo.PageResult;
|
||||
*/
|
||||
public interface BusinessSampleDispatchService {
|
||||
|
||||
//增加样品
|
||||
void addOrRemoveSample(@Valid BusinessSampleDispatchSaveReqVO paramVo);
|
||||
|
||||
//发起流程
|
||||
CommonResult<BusinessSampleDispatchRespVO> createProcessInstance(BusinessSampleDispatchSaveReqVO paramVo);
|
||||
|
||||
//执行调拨
|
||||
CommonResult<String> execDispatch(BusinessSampleDispatchSaveReqVO paramVo);
|
||||
CommonResult<String> execGiveback(JSONObject paramVo);
|
||||
|
||||
/**
|
||||
* 创建样品调拨
|
||||
*
|
||||
|
||||
@@ -1,13 +1,31 @@
|
||||
package com.zt.plat.module.qms.business.bus.service;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
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.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.framework.security.core.LoginUser;
|
||||
import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import com.zt.plat.module.bpm.api.task.BpmProcessInstanceApi;
|
||||
import com.zt.plat.module.bpm.api.task.BpmTaskApi;
|
||||
import com.zt.plat.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO;
|
||||
import com.zt.plat.module.qms.api.task.BMPCallbackInterface;
|
||||
import com.zt.plat.module.qms.api.task.dto.QmsBpmDTO;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.*;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessHandoverRecordSubDO;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleDispatchDetailDO;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO;
|
||||
import com.zt.plat.module.qms.common.dic.service.DictionaryBusinessService;
|
||||
import com.zt.plat.module.qms.enums.QmsBpmConstant;
|
||||
import com.zt.plat.module.qms.enums.QmsCommonConstant;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleDispatchDO;
|
||||
@@ -17,8 +35,9 @@ import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSampleDispatchMapper;
|
||||
|
||||
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList;
|
||||
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception0;
|
||||
import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*;
|
||||
import static com.zt.plat.module.qms.enums.QmsBpmConstant.BPM_CALLBACK_BEAN_NAME;
|
||||
|
||||
/**
|
||||
* 样品调拨 Service 实现类
|
||||
@@ -27,10 +46,193 @@ import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*;
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class BusinessSampleDispatchServiceImpl implements BusinessSampleDispatchService {
|
||||
@Slf4j
|
||||
public class BusinessSampleDispatchServiceImpl implements BusinessSampleDispatchService, BMPCallbackInterface {
|
||||
|
||||
@Resource
|
||||
private BusinessSampleDispatchMapper businessSampleDispatchMapper;
|
||||
@Resource private BusinessSampleDispatchMapper businessSampleDispatchMapper;
|
||||
@Resource private BusinessSampleDispatchDetailService businessSampleDispatchDetailService;
|
||||
@Resource private BusinessSubSampleService businessSubSampleService;
|
||||
@Resource private BpmProcessInstanceApi bpmProcessInstanceApi;
|
||||
@Resource private BpmTaskApi bpmTaskApi;
|
||||
@Resource private DictionaryBusinessService dictionaryBusinessService;
|
||||
@Resource private BusinessHandoverRecordSubService businessHandoverRecordSubService;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void addOrRemoveSample(BusinessSampleDispatchSaveReqVO paramVo) {
|
||||
Long id = paramVo.getId();
|
||||
List<Long> addSubSampleIds = paramVo.getAddSubSampleIds();
|
||||
List<Long> removeDetailIds = paramVo.getRemoveDetailIds();
|
||||
|
||||
//处理移除
|
||||
if(!removeDetailIds.isEmpty()){
|
||||
businessSampleDispatchDetailService.deleteBusinessSampleDispatchDetailListByIds(removeDetailIds);
|
||||
}
|
||||
//处理新增
|
||||
if(!addSubSampleIds.isEmpty()){
|
||||
List<BusinessSampleDispatchDetailDO> detailList = businessSampleDispatchDetailService.listByParID(id);
|
||||
//去除已添加过的
|
||||
List<Long> hasIds = detailList.stream().map(BusinessSampleDispatchDetailDO::getBusinessSubSampleId).toList();
|
||||
addSubSampleIds.removeAll(hasIds);
|
||||
List<BusinessSampleDispatchDetailDO> insertList = new ArrayList<>();
|
||||
for (Long subSampleId : addSubSampleIds) {
|
||||
BusinessSampleDispatchDetailDO detail = new BusinessSampleDispatchDetailDO();
|
||||
detail.setBusinessSubSampleId(subSampleId);
|
||||
detail.setParentId(id);
|
||||
insertList.add(detail);
|
||||
}
|
||||
if(!insertList.isEmpty())
|
||||
businessSampleDispatchDetailService.insertBatch(insertList);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public CommonResult<BusinessSampleDispatchRespVO> createProcessInstance(BusinessSampleDispatchSaveReqVO param) {
|
||||
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
||||
//当前登录用户昵称
|
||||
String nickName = SecurityFrameworkUtils.getLoginUserNickname();
|
||||
Long id = param.getId();
|
||||
BusinessSampleDispatchDO entity = getBusinessSampleDispatch( id);
|
||||
JSONObject formData = new JSONObject();
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
entity.setApplyUser(nickName);
|
||||
entity.setApplyUserId(loginUser.getId());
|
||||
entity.setApplyDepartment(loginUser.getVisitDeptName());
|
||||
entity.setApplyDepartmentId(loginUser.getVisitDeptId());
|
||||
entity.setApplyTime(LocalDateTime.now());
|
||||
|
||||
formData.put("mainId", id);
|
||||
formData.put("applyUser", nickName);
|
||||
formData.put("applyUserId", loginUser.getId());
|
||||
formData.put("applyDepartment", loginUser.getVisitDeptName());
|
||||
formData.put("applyDepartmentId", loginUser.getVisitDeptId());
|
||||
formData.put("applyTime", sdf.format(new Date()));
|
||||
formData.put("mainDepartmentId", entity.getMainDepartmentId());
|
||||
formData.put("mainDepartmentName", entity.getMainDepartmentName());
|
||||
Map<String, Object> variables = formData.toJavaObject(Map.class);
|
||||
variables.put(BPM_CALLBACK_BEAN_NAME, "businessSampleDispatchService"); //流程回调时使用的service
|
||||
String dictKey = "qms_sample_dispatch_flow_key"; //todo 创建业务字典
|
||||
String flowKey = dictionaryBusinessService.getValueByDataKey(dictKey);
|
||||
BpmProcessInstanceCreateReqDTO reqDTO = new BpmProcessInstanceCreateReqDTO();
|
||||
reqDTO.setBusinessKey(String.valueOf(id));
|
||||
reqDTO.setProcessDefinitionKey(flowKey);
|
||||
reqDTO.setVariables(variables);
|
||||
CommonResult<String> result = bpmProcessInstanceApi.createProcessInstance(loginUser.getId(), reqDTO);
|
||||
if(!result.isSuccess()){
|
||||
throw exception0(ERROR_CODE_MODULE_COMMON, result.getMsg());
|
||||
}
|
||||
String wfInsId = result.getData();
|
||||
entity.setFlowInstanceId(wfInsId);
|
||||
entity.setFlowStatus(QmsCommonConstant.IN_PROGRESS);
|
||||
businessSampleDispatchMapper.updateById(entity);
|
||||
BusinessSampleDispatchRespVO respVO = BeanUtils.toBean(entity, BusinessSampleDispatchRespVO.class);
|
||||
return CommonResult.success(respVO);
|
||||
}
|
||||
|
||||
/*
|
||||
* 执行调拨,传入调拨申请id,将所有明细置为已调拨状态*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public CommonResult<String> execDispatch(BusinessSampleDispatchSaveReqVO paramVo) {
|
||||
Long id = paramVo.getId();
|
||||
String warehouseUser = paramVo.getWarehouseUser(); //库管员
|
||||
Long warehouseUserId = paramVo.getWarehouseUserId();
|
||||
BusinessSampleDispatchDO entity = getBusinessSampleDispatch( id);
|
||||
BusinessSampleDispatchDetailPageReqVO pageReqVO = new BusinessSampleDispatchDetailPageReqVO();
|
||||
pageReqVO.setParentId(id);
|
||||
pageReqVO.setPageSize(9999);
|
||||
List<BusinessSampleDispatchDetailExtendRespVO> detailList = businessSampleDispatchDetailService.getBusinessSampleDispatchDetailPage(pageReqVO).getList();
|
||||
List<BusinessSampleDispatchDetailDO> detailUpdateList = new ArrayList<>();
|
||||
|
||||
LocalDateTime borrowTime = LocalDateTime.now();
|
||||
List<BusinessHandoverRecordSubDO> handoverRecordList = new ArrayList<>();
|
||||
for (BusinessSampleDispatchDetailExtendRespVO detail : detailList) {
|
||||
BusinessSampleDispatchDetailDO u = new BusinessSampleDispatchDetailDO();
|
||||
u.setUseStatus("1");
|
||||
u.setBorrowStatus("1");
|
||||
u.setBorrowUser(entity.getApplyUser());
|
||||
u.setBorrowUserId(entity.getApplyUserId());
|
||||
u.setBorrowTime(borrowTime);
|
||||
detailUpdateList.add(u);
|
||||
//交接记录
|
||||
BusinessHandoverRecordSubDO handoverRecord = new BusinessHandoverRecordSubDO();
|
||||
handoverRecord.setBusinessSubSampleId(detail.getBusinessSubSampleId());
|
||||
handoverRecord.setSampleCode(detail.getSampleCode());
|
||||
handoverRecord.setOperationTime(borrowTime);
|
||||
handoverRecord.setOperator(warehouseUser);
|
||||
handoverRecord.setOperatorId(warehouseUserId);
|
||||
handoverRecord.setSendSampleOperator(warehouseUser); //送样人
|
||||
handoverRecord.setReceiveSampleOperator(entity.getApplyUser()); //收样人
|
||||
handoverRecordList.add(handoverRecord);
|
||||
}
|
||||
businessSampleDispatchDetailService.updateBatch(detailUpdateList);
|
||||
businessHandoverRecordSubService.insertBatch(handoverRecordList);
|
||||
entity.setFinishStatus(QmsCommonConstant.COMPLETED);
|
||||
entity.setWarehouseUser(warehouseUser);
|
||||
entity.setWarehouseUserId(warehouseUserId);
|
||||
businessSampleDispatchMapper.updateById(entity);
|
||||
//更新子样状态
|
||||
List<Long> subSampleIds = detailList.stream().map(BusinessSampleDispatchDetailExtendRespVO::getBusinessSubSampleId).toList();
|
||||
List<BusinessSubSampleDO> subSampleList = businessSubSampleService.listByIdList(subSampleIds);
|
||||
for (BusinessSubSampleDO subSample : subSampleList) {
|
||||
subSample.setDispatchStatus("1");
|
||||
}
|
||||
businessSubSampleService.updateBatch(subSampleList);
|
||||
|
||||
|
||||
|
||||
return CommonResult.success("操作成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<String> execGiveback(JSONObject paramVo) {
|
||||
|
||||
String givebackUser = paramVo.getString("givebackUser"); //归还人
|
||||
Long givebackUserId = paramVo.getLong("givebackUserId");
|
||||
String warehouseUser = paramVo.getString("warehouseUser"); //库管员
|
||||
Long warehouseUserId = paramVo.getLong("warehouseUserId");
|
||||
String detailIds = paramVo.getString("detailIds");
|
||||
List< Long> detailIdList = Arrays.asList(detailIds.split(",")).stream().map(Long::parseLong).toList();
|
||||
LocalDateTime givebackTime = LocalDateTime.now();
|
||||
BusinessSampleDispatchDetailPageReqVO pageReqVO = new BusinessSampleDispatchDetailPageReqVO();
|
||||
pageReqVO.setIdList(detailIdList);
|
||||
pageReqVO.setPageSize(detailIdList.size() + 999);
|
||||
List<BusinessSampleDispatchDetailExtendRespVO> detailList = businessSampleDispatchDetailService.getBusinessSampleDispatchDetailPage(pageReqVO).getList();
|
||||
List<BusinessSampleDispatchDetailDO> detailUpdateList = new ArrayList<>();
|
||||
List<BusinessHandoverRecordSubDO> handoverRecordList = new ArrayList<>();
|
||||
for (BusinessSampleDispatchDetailExtendRespVO detail : detailList) {
|
||||
BusinessSampleDispatchDetailDO u = new BusinessSampleDispatchDetailDO();
|
||||
u.setGivebackUser(givebackUser);
|
||||
u.setGivebackUserId(givebackUserId);
|
||||
u.setGivebackTime(givebackTime);
|
||||
u.setGivebackStatus("1");
|
||||
u.setId(detail.getId());
|
||||
detailUpdateList.add(u);
|
||||
|
||||
//交接记录
|
||||
BusinessHandoverRecordSubDO handoverRecord = new BusinessHandoverRecordSubDO();
|
||||
handoverRecord.setBusinessSubSampleId(detail.getBusinessSubSampleId());
|
||||
handoverRecord.setSampleCode(detail.getSampleCode());
|
||||
handoverRecord.setOperationTime(givebackTime);
|
||||
handoverRecord.setOperator(givebackUser);
|
||||
handoverRecord.setOperatorId(givebackUserId);
|
||||
handoverRecord.setSendSampleOperator(givebackUser); //送样人
|
||||
handoverRecord.setReceiveSampleOperator(warehouseUser); //收样人
|
||||
handoverRecordList.add(handoverRecord);
|
||||
}
|
||||
businessSampleDispatchDetailService.updateBatch(detailUpdateList);
|
||||
businessHandoverRecordSubService.insertBatch(handoverRecordList);
|
||||
//更新子样状态
|
||||
List<Long> subSampleIds = detailList.stream().map(BusinessSampleDispatchDetailExtendRespVO::getBusinessSubSampleId).toList();
|
||||
List<BusinessSubSampleDO> subSampleList = businessSubSampleService.listByIdList(subSampleIds);
|
||||
for (BusinessSubSampleDO subSample : subSampleList) {
|
||||
subSample.setDispatchStatus("0");
|
||||
}
|
||||
businessSubSampleService.updateBatch(subSampleList);
|
||||
return CommonResult.success("操作成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public BusinessSampleDispatchRespVO createBusinessSampleDispatch(BusinessSampleDispatchSaveReqVO createReqVO) {
|
||||
@@ -89,4 +291,57 @@ public class BusinessSampleDispatchServiceImpl implements BusinessSampleDispatch
|
||||
return businessSampleDispatchMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
//流程回调
|
||||
@Override
|
||||
public CommonResult<JSONObject> callback(QmsBpmDTO reqDTO) {
|
||||
JSONObject variables = reqDTO.getVariables();
|
||||
|
||||
//流程状态 1-提交(含退回) 4-取消流程
|
||||
String PROCESS_STATUS = variables.getString(QmsBpmConstant.PROCESS_INSTANCE_VARIABLE_STATUS);
|
||||
String mainId = variables.getString("mainId");
|
||||
JSONArray fieldExtensions = new JSONArray();
|
||||
if(variables.containsKey(QmsBpmConstant.BPM_FIELD_EXTENSIONS)){
|
||||
fieldExtensions = variables.getJSONArray(QmsBpmConstant.BPM_FIELD_EXTENSIONS);
|
||||
}
|
||||
BusinessSampleDispatchDO entity = getBusinessSampleDispatch(Long.valueOf(mainId));
|
||||
log.error("流程回调:{}", JSONObject.toJSONString(reqDTO));
|
||||
String currentActivityId = variables.getString(QmsBpmConstant.BPM_CALLBACK_ACTIVITY_ID);
|
||||
String RETURN_FLAG_PREFIX_KEY = QmsBpmConstant.BPM_CALLBACK_RETURN_FLAG_PREFIX_KEY;
|
||||
String returnFlagKey = RETURN_FLAG_PREFIX_KEY + "Activity_001";
|
||||
|
||||
//判断是否最后一个节点
|
||||
String lastActivityFlag = "0";
|
||||
String firstActivityFlag = "0";
|
||||
if(!fieldExtensions.isEmpty()){
|
||||
for(int i = 0; i < fieldExtensions.size(); i++){
|
||||
JSONObject fieldExtension = fieldExtensions.getJSONObject(i);
|
||||
if(fieldExtension.getString("fieldName").equals(QmsBpmConstant.BPM_LAST_ACTIVITY_FLAG)){
|
||||
lastActivityFlag = "1";
|
||||
}
|
||||
if(fieldExtension.getString("fieldName").equals(QmsBpmConstant.BPM_FIRST_ACTIVITY_FLAG)){
|
||||
firstActivityFlag = "1";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//"RETURN_FLAG_Activity_001": true 标识驳回到发起环节
|
||||
if(variables.containsKey(returnFlagKey) && variables.getString(returnFlagKey).equals("true")){
|
||||
//驳回。流程需要配置退回到发起节点
|
||||
entity.setFlowStatus(QmsCommonConstant.REJECTED);
|
||||
}else if("4".equals(PROCESS_STATUS)){
|
||||
//作废
|
||||
entity.setFlowStatus(QmsCommonConstant.VOID);
|
||||
}else if("1".equals(PROCESS_STATUS)){
|
||||
//通过
|
||||
if("1".equals(firstActivityFlag))
|
||||
entity.setFlowStatus(QmsCommonConstant.IN_PROGRESS); //驳回后重新提交
|
||||
if("1".equals(lastActivityFlag)){
|
||||
entity.setFlowStatus(QmsCommonConstant.COMPLETED); //结束审批
|
||||
entity.setFinishStatus(QmsCommonConstant.PENDING);
|
||||
}
|
||||
}
|
||||
businessSampleDispatchMapper.updateById(entity);
|
||||
JSONObject ret = new JSONObject();
|
||||
return CommonResult.success(ret);
|
||||
}
|
||||
}
|
||||
@@ -61,4 +61,5 @@ public interface BusinessSampleHandoverDetailService {
|
||||
*/
|
||||
PageResult<BusinessSampleHandoverDetailDO> getBusinessSampleHandoverDetailPage(BusinessSampleHandoverDetailPageReqVO pageReqVO);
|
||||
|
||||
void insertBatch(List<BusinessSampleHandoverDetailDO> list);
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleHandoverD
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleHandoverDetailSaveReqVO;
|
||||
import org.springframework.stereotype.Service;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.*;
|
||||
@@ -90,4 +91,9 @@ public class BusinessSampleHandoverDetailServiceImpl implements BusinessSampleHa
|
||||
return businessSampleHandoverDetailMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void insertBatch(List<BusinessSampleHandoverDetailDO> list) {
|
||||
businessSampleHandoverDetailMapper.insertBatch(list);
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package com.zt.plat.module.qms.business.bus.service;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.*;
|
||||
import jakarta.validation.*;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
@@ -16,6 +17,9 @@ import com.zt.plat.framework.common.pojo.PageParam;
|
||||
*/
|
||||
public interface BusinessSubSampleService {
|
||||
|
||||
void updateBatch(List<BusinessSubSampleDO> businessSubSampleDOList);
|
||||
|
||||
List<BusinessSubSampleDO> listByIdList(List<Long> idList);
|
||||
/**
|
||||
* 创建子样业务
|
||||
*
|
||||
@@ -53,6 +57,8 @@ public interface BusinessSubSampleService {
|
||||
*/
|
||||
BusinessSubSampleExtendRespVO getBusinessSubSample(Long id);
|
||||
|
||||
BusinessSubSampleDO getBySampleCode(String sampleCode);
|
||||
|
||||
/**
|
||||
* 获得子样业务分页
|
||||
*
|
||||
@@ -75,4 +81,12 @@ public interface BusinessSubSampleService {
|
||||
*/
|
||||
BusinessSubSampleExtendRespVO getBySampleCodeAndFlowKey(@Valid BusinessSubSampleReqVO reqVO);
|
||||
|
||||
//样品归库
|
||||
BusinessSubSampleRespVO execReturnToStock(@Valid BusinessSubSampleSaveReqVO reqVo);
|
||||
|
||||
//样品下架
|
||||
Integer execTakeOff(JSONObject reqVo);
|
||||
|
||||
//库位变更
|
||||
Integer execChangeLocation(JSONObject reqVo);
|
||||
}
|
||||
@@ -1,26 +1,39 @@
|
||||
package com.zt.plat.module.qms.business.bus.service;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.zt.plat.framework.security.core.LoginUser;
|
||||
import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.*;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessHandoverRecordSubDO;
|
||||
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.config.dal.dataobject.ConfigWarehouseLocationDO;
|
||||
import com.zt.plat.module.qms.business.config.service.ConfigWarehouseLocationService;
|
||||
import com.zt.plat.module.qms.core.code.SequenceUtil;
|
||||
import com.zt.plat.module.qms.enums.QmsCommonConstant;
|
||||
import com.zt.plat.module.qms.enums.QmsWarehouseLocationConstant;
|
||||
import org.springframework.stereotype.Service;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
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.dal.mapper.BusinessSubSampleAnalysisGroupMapper;
|
||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleMapper;
|
||||
import com.zt.plat.module.qms.enums.QmsCommonConstant;
|
||||
|
||||
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
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.diffList;
|
||||
import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
@@ -38,6 +51,23 @@ public class BusinessSubSampleServiceImpl implements BusinessSubSampleService {
|
||||
@Resource
|
||||
private BusinessSubSampleAnalysisGroupMapper businessSubSampleAnalysisGroupMapper;
|
||||
|
||||
@Resource private ConfigWarehouseLocationService configWarehouseLocationService;
|
||||
@Resource private BusinessSampleHandoverService businessSampleHandoverService;
|
||||
@Resource private BusinessSampleHandoverDetailService businessSampleHandoverDetailService;
|
||||
@Resource private BusinessHandoverRecordSubService businessHandoverRecordSubService;
|
||||
@Resource private SequenceUtil sequenceUtil;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateBatch(List<BusinessSubSampleDO> businessSubSampleDOList) {
|
||||
businessSubSampleMapper.updateBatch(businessSubSampleDOList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BusinessSubSampleDO> listByIdList(List<Long> idList) {
|
||||
return businessSubSampleMapper.selectByIds(idList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BusinessSubSampleRespVO createBusinessSubSample(BusinessSubSampleSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
@@ -90,6 +120,13 @@ public class BusinessSubSampleServiceImpl implements BusinessSubSampleService {
|
||||
return businessSubSampleMapper.selectExtendById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BusinessSubSampleDO getBySampleCode(String sampleCode) {
|
||||
LambdaQueryWrapper<BusinessSubSampleDO> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(BusinessSubSampleDO::getSampleCode, sampleCode);
|
||||
return businessSubSampleMapper.selectOne(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<BusinessSubSampleExtendRespVO> getBusinessSubSamplePage(BusinessSubSamplePageReqVO pageReqVO) {
|
||||
PageResult<BusinessSubSampleExtendRespVO> page = businessSubSampleMapper.selectPage(pageReqVO);
|
||||
@@ -109,4 +146,171 @@ public class BusinessSubSampleServiceImpl implements BusinessSubSampleService {
|
||||
return businessSubSampleMapper.getBySampleCodeAndFlowKey(reqVO);
|
||||
}
|
||||
|
||||
//样品归库
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public BusinessSubSampleRespVO execReturnToStock(BusinessSubSampleSaveReqVO reqVo) {
|
||||
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
||||
String loginUserName = SecurityFrameworkUtils.getLoginUserNickname();
|
||||
BusinessSubSampleDO businessSubSampleDO = this.getBySampleCode(reqVo.getSampleCode());
|
||||
if(businessSubSampleDO == null)
|
||||
throw exception(BUSINESS_SUB_SAMPLE_NOT_EXISTS);
|
||||
//检查样品状态
|
||||
if(!QmsCommonConstant.FLOW_SAMPLE_STORAGE.equals(businessSubSampleDO.getSampleFlowNodeKey()))
|
||||
throw exception0(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "子样任务不在“归库”环节,请检查前置任务是否已完成!");
|
||||
if(QmsCommonConstant.COMPLETED.equals(businessSubSampleDO.getReturnStatus()))
|
||||
throw exception0(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "样品已归库,请勿重复操作!");
|
||||
|
||||
ConfigWarehouseLocationDO locationDO = configWarehouseLocationService.getLocationByCode(reqVo.getWarehouseLocationCode(), QmsWarehouseLocationConstant.WAREHOUSE_TYPE_SAMPLE);
|
||||
if(locationDO == null)
|
||||
throw exception(CONFIG_WAREHOUSE_LOCATION_NOT_EXISTS);
|
||||
|
||||
//更新入库状态
|
||||
businessSubSampleDO.setReturnStatus(QmsCommonConstant.COMPLETED);
|
||||
businessSubSampleDO.setConfigWarehouseLocationInfomationId(locationDO.getId());
|
||||
businessSubSampleDO.setReturnTime(LocalDateTime.now());
|
||||
businessSubSampleMapper.updateById(businessSubSampleDO);
|
||||
|
||||
//更新流转记录 T_BSN_HND_RCD_SB。这不记录送样人、收样人。在调拨和归还时需要记录
|
||||
BusinessHandoverRecordSubSaveReqVO recordSubVO = new BusinessHandoverRecordSubSaveReqVO();
|
||||
recordSubVO.setBusinessSubSampleId(businessSubSampleDO.getId());
|
||||
recordSubVO.setSampleFlowNodeKey(QmsCommonConstant.FLOW_SAMPLE_STORAGE);
|
||||
recordSubVO.setSampleCode(businessSubSampleDO.getSampleReturnCode());
|
||||
recordSubVO.setOperationTime(LocalDateTime.now());
|
||||
recordSubVO.setOperator(loginUserName);
|
||||
recordSubVO.setOperatorId(loginUser.getId());
|
||||
recordSubVO.setSendSampleOperator("");
|
||||
recordSubVO.setReceiveSampleOperator("");
|
||||
recordSubVO.setConfigSampleFlowId(0L);
|
||||
businessHandoverRecordSubService.createBusinessHandoverRecordSub(recordSubVO);
|
||||
/*
|
||||
* 样品编码用归库码
|
||||
* 这里不更新交接人。 调拨和归还时记录交接人
|
||||
*
|
||||
* */
|
||||
|
||||
return BeanUtils.toBean(businessSubSampleDO, BusinessSubSampleRespVO.class);
|
||||
}
|
||||
|
||||
//样品下架
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Integer execTakeOff(JSONObject reqVo) {
|
||||
String actionWay = reqVo.getString("actionWay");
|
||||
String warehouseLocationCode = reqVo.getString("warehouseLocationCode");
|
||||
String sampleCode = reqVo.getString("sampleCode");
|
||||
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
||||
String loginUserName = SecurityFrameworkUtils.getLoginUserNickname();
|
||||
//查询要操作的样品
|
||||
LambdaQueryWrapper<BusinessSubSampleDO> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(BusinessSubSampleDO::getSampleFlowNodeKey, QmsCommonConstant.FLOW_SAMPLE_STORAGE);
|
||||
queryWrapper.eq(BusinessSubSampleDO::getReturnStatus, QmsCommonConstant.COMPLETED);
|
||||
if(QmsWarehouseLocationConstant.SAMPLE_TAKE_OFF_ACTION_WAY_SAMPLE.equals(actionWay)){
|
||||
//按编号查询样品
|
||||
if(ObjectUtils.isEmpty(sampleCode))
|
||||
throw exception0(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "缺少样品编号参数!");
|
||||
List<String> sampleCodes = Arrays.asList(sampleCode.split( ","));
|
||||
queryWrapper.in(BusinessSubSampleDO::getSampleCode, sampleCodes);
|
||||
}
|
||||
else if(QmsWarehouseLocationConstant.SAMPLE_TAKE_OFF_ACTION_WAY_LOCATION.equals(actionWay)){
|
||||
//按库位查询样品
|
||||
if(ObjectUtils.isEmpty(warehouseLocationCode))
|
||||
throw exception0(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "缺少库位编码参数!");
|
||||
ConfigWarehouseLocationDO locationDO = configWarehouseLocationService.getLocationByCode(warehouseLocationCode, QmsWarehouseLocationConstant.WAREHOUSE_TYPE_SAMPLE);
|
||||
if(locationDO == null)
|
||||
throw exception(CONFIG_WAREHOUSE_LOCATION_NOT_EXISTS);
|
||||
queryWrapper.eq(BusinessSubSampleDO::getConfigWarehouseLocationInfomationId, warehouseLocationCode);
|
||||
}else{
|
||||
throw exception0(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "actionWay参数错误!");
|
||||
}
|
||||
List<BusinessSubSampleDO> waitingList = businessSubSampleMapper.selectList(queryWrapper);
|
||||
if(waitingList.isEmpty())
|
||||
throw exception0(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "无待下架的样品!");
|
||||
Integer sampleCount = waitingList.size();
|
||||
|
||||
//创建交接抬头
|
||||
BusinessSampleHandoverSaveReqVO handoverVO = new BusinessSampleHandoverSaveReqVO();
|
||||
String code = sequenceUtil.genCode("/XJ|@yyMMdd|*XJ_CODE-3-D");
|
||||
handoverVO.setCode(code);
|
||||
handoverVO.setName("样品下架记录");
|
||||
handoverVO.setSampleFlowNodeKey(QmsCommonConstant.FLOW_SAMPLE_STORAGE);
|
||||
handoverVO.setOperationTime(LocalDateTime.now());
|
||||
handoverVO.setOperator(loginUserName);
|
||||
handoverVO.setOperatorId(loginUser.getId());
|
||||
BusinessSampleHandoverRespVO handoverRespVO = businessSampleHandoverService.createBusinessSampleHandover(handoverVO);
|
||||
|
||||
//更新下架状态
|
||||
List<BusinessHandoverRecordSubDO> recordList = new ArrayList<>();
|
||||
List<BusinessSampleHandoverDetailDO> detailList = new ArrayList<>(); //通过样品交接明细记录下架记录
|
||||
for(BusinessSubSampleDO businessSubSampleDO : waitingList){
|
||||
businessSubSampleDO.setReturnStatus(QmsCommonConstant.TAKEN_OFF);
|
||||
//创建流转记录
|
||||
BusinessHandoverRecordSubDO reecordDO = new BusinessHandoverRecordSubDO();
|
||||
reecordDO.setBusinessSubSampleId(businessSubSampleDO.getId());
|
||||
reecordDO.setSampleFlowNodeKey(QmsCommonConstant.FLOW_SAMPLE_STORAGE);
|
||||
reecordDO.setSampleCode(businessSubSampleDO.getSampleReturnCode());
|
||||
reecordDO.setOperationTime(LocalDateTime.now());
|
||||
reecordDO.setOperator(loginUserName);
|
||||
reecordDO.setOperatorId(loginUser.getId());
|
||||
reecordDO.setSendSampleOperator("");
|
||||
reecordDO.setReceiveSampleOperator("");
|
||||
reecordDO.setConfigSampleFlowId(0L);
|
||||
recordList.add(reecordDO);
|
||||
|
||||
|
||||
BusinessSampleHandoverDetailDO detailDO = new BusinessSampleHandoverDetailDO();
|
||||
detailDO.setBusinessSampleHandoverId(handoverRespVO.getId());
|
||||
detailDO.setBusinessSubSampleId(businessSubSampleDO.getId());
|
||||
detailDO.setSampleName(businessSubSampleDO.getSampleName());
|
||||
detailDO.setSampleCode(businessSubSampleDO.getSampleReturnCode());
|
||||
detailList.add(detailDO);
|
||||
}
|
||||
businessHandoverRecordSubService.insertBatch(recordList);
|
||||
businessSampleHandoverDetailService.insertBatch(detailList);
|
||||
businessSubSampleMapper.updateBatch(waitingList);
|
||||
return sampleCount;
|
||||
}
|
||||
|
||||
//库位变更
|
||||
@Override
|
||||
public Integer execChangeLocation(JSONObject reqVo) {
|
||||
String actionWay = reqVo.getString("actionWay");
|
||||
String targetLocation = reqVo.getString("targetLocation");
|
||||
String warehouseLocationCode = reqVo.getString("warehouseLocationCode");
|
||||
String sampleCode = reqVo.getString("sampleCode");
|
||||
if(ObjectUtils.isEmpty(targetLocation))
|
||||
throw exception0(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "缺少目标库位参数!");
|
||||
ConfigWarehouseLocationDO targetLocationDO = configWarehouseLocationService.getLocationByCode(targetLocation, QmsWarehouseLocationConstant.WAREHOUSE_TYPE_SAMPLE);
|
||||
//查询要操作的样品
|
||||
LambdaQueryWrapper<BusinessSubSampleDO> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(BusinessSubSampleDO::getSampleFlowNodeKey, QmsCommonConstant.FLOW_SAMPLE_STORAGE);
|
||||
queryWrapper.eq(BusinessSubSampleDO::getReturnStatus, QmsCommonConstant.COMPLETED);
|
||||
if(QmsWarehouseLocationConstant.SAMPLE_TAKE_OFF_ACTION_WAY_SAMPLE.equals(actionWay)){
|
||||
//按编号查询样品
|
||||
if(ObjectUtils.isEmpty(sampleCode))
|
||||
throw exception0(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "缺少样品编号参数!");
|
||||
List<String> sampleCodes = Arrays.asList(sampleCode.split( ","));
|
||||
queryWrapper.in(BusinessSubSampleDO::getSampleCode, sampleCodes);
|
||||
}
|
||||
else if(QmsWarehouseLocationConstant.SAMPLE_TAKE_OFF_ACTION_WAY_LOCATION.equals(actionWay)){
|
||||
//按库位查询样品
|
||||
if(ObjectUtils.isEmpty(warehouseLocationCode))
|
||||
throw exception0(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "缺少库位编码参数!");
|
||||
ConfigWarehouseLocationDO locationDO = configWarehouseLocationService.getLocationByCode(warehouseLocationCode, QmsWarehouseLocationConstant.WAREHOUSE_TYPE_SAMPLE);
|
||||
if(locationDO == null)
|
||||
throw exception(CONFIG_WAREHOUSE_LOCATION_NOT_EXISTS);
|
||||
queryWrapper.eq(BusinessSubSampleDO::getConfigWarehouseLocationInfomationId, warehouseLocationCode);
|
||||
}else{
|
||||
throw exception0(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "actionWay参数错误!");
|
||||
}
|
||||
List<BusinessSubSampleDO> waitingList = businessSubSampleMapper.selectList(queryWrapper);
|
||||
if(waitingList.isEmpty())
|
||||
throw exception0(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "没有找到样品!");
|
||||
Integer sampleCount = waitingList.size();
|
||||
for(BusinessSubSampleDO businessSubSampleDO : waitingList){
|
||||
businessSubSampleDO.setConfigWarehouseLocationInfomationId(targetLocationDO.getId());
|
||||
}
|
||||
businessSubSampleMapper.updateBatch(waitingList);
|
||||
return sampleCount;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.zt.plat.module.qms.business.config.controller.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import lombok.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
@@ -36,6 +37,9 @@ public class ConfigWarehouseLocationPageReqVO extends PageParam {
|
||||
@Schema(description = "数据类型(仓库、库位)", example = "2")
|
||||
private String dataType;
|
||||
|
||||
@Schema(description = "仓库分类", example = "2")
|
||||
private String warehouseType;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
|
||||
@@ -47,6 +47,10 @@ public class ConfigWarehouseLocationRespVO {
|
||||
@ExcelProperty("数据类型(仓库、库位)")
|
||||
private String dataType;
|
||||
|
||||
@Schema(description = "仓库分类", example = "2")
|
||||
@ExcelProperty("仓库分类")
|
||||
private String warehouseType;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
@ExcelProperty("所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
@@ -19,14 +19,14 @@ public class ConfigWarehouseLocationSaveReqVO {
|
||||
private String name;
|
||||
|
||||
@Schema(description = "编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "编码不能为空")
|
||||
// @NotEmpty(message = "编码不能为空")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "排序号")
|
||||
private Integer sortNo;
|
||||
|
||||
@Schema(description = "容量", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "容量不能为空")
|
||||
// @NotNull(message = "容量不能为空")
|
||||
private Integer capacity;
|
||||
|
||||
@Schema(description = "主管部门id", example = "12738")
|
||||
@@ -38,6 +38,10 @@ public class ConfigWarehouseLocationSaveReqVO {
|
||||
@Schema(description = "数据类型(仓库、库位)", example = "2")
|
||||
private String dataType;
|
||||
|
||||
@Schema(description = "仓库分类", example = "2")
|
||||
@NotEmpty(message = "仓库分类不能为空")
|
||||
private String warehouseType;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.zt.plat.module.qms.business.config.dal.dataobject;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||
@@ -68,6 +69,11 @@ public class ConfigWarehouseLocationDO extends BusinessBaseDO {
|
||||
*/
|
||||
@TableField("DAT_TP")
|
||||
private String dataType;
|
||||
|
||||
//仓库分类
|
||||
@TableField("WRH_TP")
|
||||
private String warehouseType;
|
||||
|
||||
/**
|
||||
* 所属部门
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.zt.plat.module.qms.business.config.dal.dataobject;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
|
||||
@TableName("t_cfg_wrh_loc")
|
||||
@Data
|
||||
//用于join自关联
|
||||
public class ConfigWarehouseLocationParDO extends ConfigWarehouseLocationDO{
|
||||
}
|
||||
@@ -17,6 +17,7 @@ public interface ConfigWarehouseLocationMapper extends BaseMapperX<ConfigWarehou
|
||||
|
||||
default PageResult<ConfigWarehouseLocationDO> selectPage(ConfigWarehouseLocationPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<ConfigWarehouseLocationDO>()
|
||||
.eqIfPresent(ConfigWarehouseLocationDO::getWarehouseType, reqVO.getWarehouseType())
|
||||
.eqIfPresent(ConfigWarehouseLocationDO::getParentId, reqVO.getParentId())
|
||||
.likeIfPresent(ConfigWarehouseLocationDO::getName, reqVO.getName())
|
||||
.eqIfPresent(ConfigWarehouseLocationDO::getCode, reqVO.getCode())
|
||||
@@ -28,7 +29,7 @@ public interface ConfigWarehouseLocationMapper extends BaseMapperX<ConfigWarehou
|
||||
.eqIfPresent(ConfigWarehouseLocationDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
|
||||
.betweenIfPresent(ConfigWarehouseLocationDO::getCreateTime, reqVO.getCreateTime())
|
||||
.eqIfPresent(ConfigWarehouseLocationDO::getRemark, reqVO.getRemark())
|
||||
.orderByDesc(ConfigWarehouseLocationDO::getId));
|
||||
.orderByDesc(ConfigWarehouseLocationDO::getSortNo));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -16,6 +16,8 @@ import com.zt.plat.framework.common.pojo.PageResult;
|
||||
*/
|
||||
public interface ConfigWarehouseLocationService {
|
||||
|
||||
ConfigWarehouseLocationDO getLocationByCode(String code, String warehouseType);
|
||||
|
||||
/**
|
||||
* 创建存放位置
|
||||
*
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
package com.zt.plat.module.qms.business.config.service;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.zt.plat.module.qms.business.config.controller.vo.ConfigWarehouseLocationPageReqVO;
|
||||
import com.zt.plat.module.qms.business.config.controller.vo.ConfigWarehouseLocationRespVO;
|
||||
import com.zt.plat.module.qms.business.config.controller.vo.ConfigWarehouseLocationSaveReqVO;
|
||||
import com.zt.plat.module.qms.enums.QmsWarehouseLocationConstant;
|
||||
import org.springframework.stereotype.Service;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -29,9 +31,22 @@ import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*;
|
||||
@Validated
|
||||
public class ConfigWarehouseLocationServiceImpl implements ConfigWarehouseLocationService {
|
||||
|
||||
|
||||
|
||||
@Resource
|
||||
private ConfigWarehouseLocationMapper configWarehouseLocationMapper;
|
||||
|
||||
@Override
|
||||
public ConfigWarehouseLocationDO getLocationByCode(String code, String warehouseType) {
|
||||
LambdaQueryWrapper<ConfigWarehouseLocationDO> query = new LambdaQueryWrapper<>();
|
||||
query.eq(ConfigWarehouseLocationDO::getCode, code);
|
||||
query.eq(ConfigWarehouseLocationDO::getWarehouseType, warehouseType);
|
||||
query.eq(ConfigWarehouseLocationDO::getDataType, QmsWarehouseLocationConstant.DATA_TYPE_LOCATION);
|
||||
query.last("limit 1");
|
||||
ConfigWarehouseLocationDO configWarehouseLocation = configWarehouseLocationMapper.selectOne(query);
|
||||
return configWarehouseLocation;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConfigWarehouseLocationRespVO createConfigWarehouseLocation(ConfigWarehouseLocationSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
|
||||
@@ -33,10 +33,8 @@ import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||
import static com.zt.plat.framework.common.pojo.CommonResult.error;
|
||||
@@ -191,6 +189,7 @@ public class ReportDocumentMainController extends AbstractFileUploadController i
|
||||
//处理抬头数据
|
||||
|
||||
if("true".equals(editFlag)){
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
String formData = vo.getFormData();
|
||||
JSONObject formDataJson = new JSONObject();
|
||||
if(!ObjectUtils.isEmpty(formData))
|
||||
@@ -209,6 +208,7 @@ public class ReportDocumentMainController extends AbstractFileUploadController i
|
||||
//处理检测标准
|
||||
String standard = assembleStandard(dataList);
|
||||
formDataJson.put("standard", standard);
|
||||
formDataJson.put("reportTime", sdf.format(new Date()));
|
||||
vo.setFormData(formDataJson.toJSONString());
|
||||
// ReportDocumentMainSaveReqVO updateVO = new ReportDocumentMainSaveReqVO();
|
||||
// updateVO.setId(reportDocumentMain.getId());
|
||||
|
||||
@@ -36,6 +36,7 @@ public interface DictionaryBusinessService {
|
||||
List<DictionaryBusinessDO> queryDictItemsByKey(String key);
|
||||
|
||||
CommonResult<DictionaryBusinessRespVO> getDataByDataKey(String key);
|
||||
String getValueByDataKey(String key);
|
||||
|
||||
|
||||
//保存分类
|
||||
|
||||
@@ -243,6 +243,14 @@ public class DictionaryBusinessServiceImpl implements DictionaryBusinessService
|
||||
return CommonResult.success(vo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getValueByDataKey(String key) {
|
||||
CommonResult<DictionaryBusinessRespVO> result = getDataByDataKey(key);
|
||||
if(!result.isSuccess())
|
||||
return null;
|
||||
return result.getData().getValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<DictionaryBusinessRespVO> saveCategory(DictionaryBusinessSaveReqVO entity) {
|
||||
if(entity.getParentId() == null)
|
||||
|
||||
Reference in New Issue
Block a user