Compare commits
2 Commits
7d8a5c1e88
...
50cfdea28d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
50cfdea28d | ||
|
|
d5b40bfba0 |
@@ -77,6 +77,9 @@ public interface QmsCommonConstant {
|
||||
/** 已驳回 **/
|
||||
String REJECTED = "rejected";
|
||||
|
||||
/** 已拒绝 **/
|
||||
String REFUSED = "refused";
|
||||
|
||||
/** 作废 **/
|
||||
String VOID = "void";
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore;
|
||||
import com.zt.plat.framework.excel.core.util.ExcelUtils;
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryInboundPageReqVO;
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryInboundRespVO;
|
||||
@@ -31,8 +32,9 @@ import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - 入库")
|
||||
@RestController
|
||||
@RequestMapping("/t/material-inventory-inbound")
|
||||
@RequestMapping("/qms/resource/material-inventory-inbound")
|
||||
@Validated
|
||||
@DeptDataPermissionIgnore(enable = "true")
|
||||
public class MaterialInventoryInboundController implements BusinessControllerMarker {
|
||||
|
||||
|
||||
@@ -40,15 +42,15 @@ public class MaterialInventoryInboundController implements BusinessControllerMar
|
||||
private MaterialInventoryInboundService materialInventoryInboundService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建入库")
|
||||
@PreAuthorize("@ss.hasPermission('t:material-inventory-inbound:create')")
|
||||
@Operation(summary = "物料入库")
|
||||
// @PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound:create')")
|
||||
public CommonResult<MaterialInventoryInboundRespVO> createMaterialInventoryInbound(@Valid @RequestBody MaterialInventoryInboundSaveReqVO createReqVO) {
|
||||
return success(materialInventoryInboundService.createMaterialInventoryInbound(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新入库")
|
||||
@PreAuthorize("@ss.hasPermission('t:material-inventory-inbound:update')")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound:update')")
|
||||
public CommonResult<Boolean> updateMaterialInventoryInbound(@Valid @RequestBody MaterialInventoryInboundSaveReqVO updateReqVO) {
|
||||
materialInventoryInboundService.updateMaterialInventoryInbound(updateReqVO);
|
||||
return success(true);
|
||||
@@ -57,7 +59,7 @@ public class MaterialInventoryInboundController implements BusinessControllerMar
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除入库")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('t:material-inventory-inbound:delete')")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound:delete')")
|
||||
public CommonResult<Boolean> deleteMaterialInventoryInbound(@RequestParam("id") Long id) {
|
||||
materialInventoryInboundService.deleteMaterialInventoryInbound(id);
|
||||
return success(true);
|
||||
@@ -66,7 +68,7 @@ public class MaterialInventoryInboundController implements BusinessControllerMar
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除入库")
|
||||
@PreAuthorize("@ss.hasPermission('t:material-inventory-inbound:delete')")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound:delete')")
|
||||
public CommonResult<Boolean> deleteMaterialInventoryInboundList(@RequestBody BatchDeleteReqVO req) {
|
||||
materialInventoryInboundService.deleteMaterialInventoryInboundListByIds(req.getIds());
|
||||
return success(true);
|
||||
@@ -75,7 +77,7 @@ public class MaterialInventoryInboundController implements BusinessControllerMar
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得入库")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('t:material-inventory-inbound:query')")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound:query')")
|
||||
public CommonResult<MaterialInventoryInboundRespVO> getMaterialInventoryInbound(@RequestParam("id") Long id) {
|
||||
MaterialInventoryInboundDO materialInventoryInbound = materialInventoryInboundService.getMaterialInventoryInbound(id);
|
||||
return success(BeanUtils.toBean(materialInventoryInbound, MaterialInventoryInboundRespVO.class));
|
||||
@@ -83,7 +85,7 @@ public class MaterialInventoryInboundController implements BusinessControllerMar
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得入库分页")
|
||||
@PreAuthorize("@ss.hasPermission('t:material-inventory-inbound:query')")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound:query')")
|
||||
public CommonResult<PageResult<MaterialInventoryInboundRespVO>> getMaterialInventoryInboundPage(@Valid MaterialInventoryInboundPageReqVO pageReqVO) {
|
||||
PageResult<MaterialInventoryInboundDO> pageResult = materialInventoryInboundService.getMaterialInventoryInboundPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, MaterialInventoryInboundRespVO.class));
|
||||
@@ -91,7 +93,7 @@ public class MaterialInventoryInboundController implements BusinessControllerMar
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出入库 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('t:material-inventory-inbound:export')")
|
||||
@PreAuthorize("@ss.hasPermission('qms:material-inventory-inbound:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportMaterialInventoryInboundExcel(@Valid MaterialInventoryInboundPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 入库 Response VO")
|
||||
@@ -48,6 +49,26 @@ public class MaterialInventoryInboundRespVO {
|
||||
@ExcelProperty("申请时间")
|
||||
private LocalDateTime applyTime;
|
||||
|
||||
@Schema(description = "监督人,危化品才有")
|
||||
@ExcelProperty("监督人,危化品才有")
|
||||
private String superviseUser;
|
||||
|
||||
@Schema(description = "监督人id,危化品才有")
|
||||
@ExcelProperty("监督人id,危化品才有")
|
||||
private Long superviseUserId;
|
||||
|
||||
@Schema(description = "批次工段id")
|
||||
@ExcelProperty("批次工段id")
|
||||
private Long gongduanId;
|
||||
|
||||
@Schema(description = "入库数量")
|
||||
@ExcelProperty("入库数量")
|
||||
private BigDecimal quantity;
|
||||
|
||||
@Schema(description = "库位id")
|
||||
@ExcelProperty("库位id")
|
||||
private Long locationId;
|
||||
|
||||
@Schema(description = "流程实例id", example = "16660")
|
||||
@ExcelProperty("流程实例id")
|
||||
private String flowInstanceId;
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
package com.zt.plat.module.qms.resource.material.controller.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 入库新增/修改 Request VO")
|
||||
@@ -36,6 +38,21 @@ public class MaterialInventoryInboundSaveReqVO {
|
||||
@Schema(description = "申请时间")
|
||||
private LocalDateTime applyTime;
|
||||
|
||||
@Schema(description = "监督人,危化品才有")
|
||||
private String superviseUser;
|
||||
|
||||
@Schema(description = "监督人id,危化品才有")
|
||||
private Long superviseUserId;
|
||||
|
||||
@Schema(description = "批次工段id")
|
||||
private Long gongduanId;
|
||||
|
||||
@Schema(description = "入库数量")
|
||||
private BigDecimal quantity;
|
||||
|
||||
@Schema(description = "库位id")
|
||||
private Long locationId;
|
||||
|
||||
@Schema(description = "流程实例id", example = "16660")
|
||||
private String flowInstanceId;
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.zt.plat.module.qms.resource.material.controller.vo;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.zt.plat.module.qms.core.aspect.annotation.Dict;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -97,6 +98,7 @@ public class MaterialProductRespVO {
|
||||
|
||||
@Schema(description = "开封后保质期是否变化,1-是,0-否")
|
||||
@ExcelProperty("开封后保质期是否变化,1-是,0-否")
|
||||
@Dict(dicCode = "yes_or_no")
|
||||
private Integer openDueFlag;
|
||||
|
||||
@Schema(description = "开封后保质期(天)")
|
||||
@@ -133,6 +135,7 @@ public class MaterialProductRespVO {
|
||||
|
||||
@Schema(description = "是否进行库存预警,1-是,0-否")
|
||||
@ExcelProperty("是否进行库存预警,1-是,0-否")
|
||||
@Dict(dicCode = "yes_or_no")
|
||||
private Integer InventoryAlarmFlag;
|
||||
|
||||
@Schema(description = "库存预警区间,json格式配置")
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
/**
|
||||
* 入库 DO
|
||||
@@ -70,6 +71,31 @@ public class MaterialInventoryInboundDO extends BusinessBaseDO {
|
||||
*/
|
||||
@TableField("APL_TM")
|
||||
private LocalDateTime applyTime;
|
||||
/**
|
||||
* 监督人,危化品才有
|
||||
*/
|
||||
@TableField("SUPR_USER")
|
||||
private String superviseUser;
|
||||
/**
|
||||
* 监督人id,危化品才有
|
||||
*/
|
||||
@TableField("SUPR_USER_ID")
|
||||
private Long superviseUserId;
|
||||
/**
|
||||
* 批次工段id
|
||||
*/
|
||||
@TableField("GONG_ID")
|
||||
private Long gongduanId;
|
||||
/**
|
||||
* 入库数量
|
||||
*/
|
||||
@TableField("QTY")
|
||||
private BigDecimal quantity;
|
||||
/**
|
||||
* 库位id
|
||||
*/
|
||||
@TableField("LOC_ID")
|
||||
private Long locationId;
|
||||
/**
|
||||
* 流程实例id
|
||||
*/
|
||||
|
||||
@@ -85,11 +85,14 @@ public interface MaterialBatchMapper extends BaseMapperX<MaterialBatchDO> {
|
||||
.selectAs(MaterialProductDO::getName, MaterialBatchRespVO::getProductName)
|
||||
.selectAs(MaterialProductDO::getCode, MaterialBatchRespVO::getProductCode)
|
||||
.selectAs(MaterialProductDO::getModelNo, MaterialBatchRespVO::getProductModelNo)
|
||||
.selectAs("batch.MFR_DT", MaterialBatchDO::getManufacturerDate)
|
||||
.selectAs("batch.DUE_DT", MaterialBatchDO::getDueDate)
|
||||
.leftJoin(MaterialProductDO.class, MaterialProductDO::getId, MaterialBatchDO::getProductId)
|
||||
.leftJoin(MaterialBatchDO.class, "batch", MaterialBatchDO::getId, MaterialBatchDO::getParentId)
|
||||
// 只查询工段
|
||||
.ne(MaterialBatchDO::getParentId, 0)
|
||||
.eq(MaterialBatchDO::getSubmitStatus, 1)
|
||||
.notExists("SELECT 1 FROM t_mtrl_lfc_dtl ld WHERE ld.BAT_GONG_ID = t.id AND ld.DELETED = 0")
|
||||
.notExists("SELECT 1 FROM t_mtrl_lfc_dtl ld WHERE ld.BAT_GONG_ID = t.ID AND ld.DELETED = 0")
|
||||
// .eq(onlyGong != null && visitDeptId != null && onlyGong, MaterialBatchDO::getAssignDepartmentId, visitDeptId)
|
||||
.in(CollUtil.isNotEmpty(pdtIds), MaterialBatchDO::getProductId, pdtIds)
|
||||
.eq(CollUtil.isEmpty(pdtIds) && reqVO.getProductId() != null, MaterialBatchDO::getProductId, reqVO.getProductId())
|
||||
@@ -106,7 +109,7 @@ public interface MaterialBatchMapper extends BaseMapperX<MaterialBatchDO> {
|
||||
.eqIfExists(MaterialBatchDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
|
||||
.eqIfExists(MaterialBatchDO::getRemark, reqVO.getRemark())
|
||||
// .betweenIfPresent(MaterialBatchDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(MaterialBatchDO::getId);
|
||||
.orderByDesc(MaterialBatchDO::getParentId);
|
||||
return selectJoinPage(reqVO, MaterialBatchRespVO.class, wrapper);
|
||||
}
|
||||
|
||||
|
||||
@@ -7,8 +7,10 @@ import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryI
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryInboundRespVO;
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryInboundSaveReqVO;
|
||||
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInventoryInboundDO;
|
||||
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialLifecycleDetailDO;
|
||||
import com.zt.plat.module.qms.resource.material.dal.mapper.MaterialInventoryInboundMapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
@@ -30,8 +32,18 @@ public class MaterialInventoryInboundServiceImpl implements MaterialInventoryInb
|
||||
@Resource
|
||||
private MaterialInventoryInboundMapper materialInventoryInboundMapper;
|
||||
|
||||
@Autowired
|
||||
private MaterialLifecycleDetailService materialLifecycleDetailService;
|
||||
|
||||
@Override
|
||||
public MaterialInventoryInboundRespVO createMaterialInventoryInbound(MaterialInventoryInboundSaveReqVO createReqVO) {
|
||||
// 1.校验工段是否已经验收
|
||||
Long gongduanId = createReqVO.getGongduanId();
|
||||
MaterialLifecycleDetailDO lifecycleDetail = materialLifecycleDetailService.getMaterialLifecycleDetailByGongId(gongduanId);
|
||||
// 2.入库数量不大于批次工段数量
|
||||
// 3.保存入库记录
|
||||
// 4.生成物料实例
|
||||
// 5.保存入库明细
|
||||
// 插入
|
||||
MaterialInventoryInboundDO materialInventoryInbound = BeanUtils.toBean(createReqVO, MaterialInventoryInboundDO.class);
|
||||
materialInventoryInboundMapper.insert(materialInventoryInbound);
|
||||
|
||||
@@ -89,4 +89,19 @@ public interface MaterialLifecycleDetailService {
|
||||
* @return 明细列表
|
||||
*/
|
||||
List<MaterialLifecycleDetailRespVO> getMaterialLifecycleDetailListByLfcId(Long id);
|
||||
|
||||
/**
|
||||
* 根据工段id 获取流程明细数据
|
||||
* @param gongduanId 工段id
|
||||
* @return 明细数据
|
||||
*/
|
||||
MaterialLifecycleDetailDO getMaterialLifecycleDetailByGongId(Long gongduanId);
|
||||
|
||||
/**
|
||||
* 更新流程明细状态
|
||||
*
|
||||
* @param lfcId 流程id
|
||||
* @param status 状态
|
||||
*/
|
||||
void updateDetailStatus(Long lfcId, String status);
|
||||
}
|
||||
@@ -4,6 +4,8 @@ import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import com.zt.plat.module.qms.enums.QmsBpmConstant;
|
||||
import com.zt.plat.module.qms.enums.QmsCommonConstant;
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLifecycleDetailPageReqVO;
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLifecycleDetailRespVO;
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLifecycleDetailSaveReqVO;
|
||||
@@ -112,4 +114,21 @@ public class MaterialLifecycleDetailServiceImpl implements MaterialLifecycleDeta
|
||||
return materialLifecycleDetailMapper.selectListWithPdtBatInfo(id);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public MaterialLifecycleDetailDO getMaterialLifecycleDetailByGongId(Long gongduanId) {
|
||||
|
||||
return materialLifecycleDetailMapper.selectOne(Wrappers.lambdaQuery(MaterialLifecycleDetailDO.class)
|
||||
.eq(MaterialLifecycleDetailDO::getBatchGongduanId, gongduanId)
|
||||
.eq(MaterialLifecycleDetailDO::getTreatmentStatus, QmsCommonConstant.COMPLETED));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateDetailStatus(Long lfcId, String status) {
|
||||
boolean isCompleted = QmsCommonConstant.COMPLETED.equals(status);
|
||||
MaterialLifecycleDetailDO detailUpdate = new MaterialLifecycleDetailDO().setTreatmentStatus(isCompleted ? 1 : 0);
|
||||
materialLifecycleDetailMapper.update(detailUpdate, Wrappers.lambdaQuery(MaterialLifecycleDetailDO.class)
|
||||
.eq(MaterialLifecycleDetailDO::getLifecycleId, lfcId));
|
||||
}
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user