fix:物料接口调整,开封、到期提醒
This commit is contained in:
@@ -14,6 +14,7 @@ import com.zt.plat.framework.excel.core.util.ExcelUtils;
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryOutboundPageReqVO;
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryOutboundRespVO;
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialInventoryOutboundSaveReqVO;
|
||||
import com.zt.plat.module.qms.resource.material.controller.vo.export.MaterialConsumeStatisticsExportVO;
|
||||
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialInventoryOutboundDO;
|
||||
import com.zt.plat.module.qms.resource.material.service.MaterialInventoryOutboundService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
@@ -113,4 +114,23 @@ public class MaterialInventoryOutboundController extends AbstractFileUploadContr
|
||||
BeanUtils.toBean(list, MaterialInventoryOutboundRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/consume-statistics")
|
||||
@Operation(summary = "按部门消耗统计")
|
||||
public CommonResult<List<MaterialInventoryOutboundRespVO>> getUsageOutboundStatisticsByDept(@Valid MaterialInventoryOutboundPageReqVO reqVO) {
|
||||
List<MaterialInventoryOutboundRespVO> outboundRespVOS = materialInventoryOutboundService.getUsageOutboundStatisticsByDept(reqVO);
|
||||
return success(outboundRespVOS);
|
||||
}
|
||||
|
||||
@GetMapping("/consume-statistics/export-excel")
|
||||
@Operation(summary = "导出按部门消耗统计 Excel")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportUsageOutboundStatisticsExcel(@Valid MaterialInventoryOutboundPageReqVO reqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
List<MaterialInventoryOutboundRespVO> list = materialInventoryOutboundService.getUsageOutboundStatisticsByDept(reqVO);
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "物料消耗统计.xls", "数据", MaterialConsumeStatisticsExportVO.class,
|
||||
BeanUtils.toBean(list, MaterialConsumeStatisticsExportVO.class));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -19,6 +19,9 @@ public class MaterialBatchPageReqVO extends PageParam {
|
||||
@Schema(description = "物料大类id", example = "9381")
|
||||
private Long productId;
|
||||
|
||||
@Schema(description = "功能操作类型 batch_manage-批次管理,acceptance-验收,inbound-入库,return_exchange-退换货")
|
||||
private String operationType;
|
||||
|
||||
@Schema(description = "是否需要组装 children")
|
||||
private Boolean children = false;
|
||||
|
||||
|
||||
@@ -41,6 +41,10 @@ public class MaterialBatchRespVO {
|
||||
@ExcelProperty("物料大类型号")
|
||||
private String productModelNo;
|
||||
|
||||
@Schema(description = "额定容量")
|
||||
@ExcelProperty("额定容量")
|
||||
private BigDecimal standardCapacity;
|
||||
|
||||
@Schema(description = "标签模板key")
|
||||
@ExcelProperty("标签模板key")
|
||||
private String labelTemplateKey;
|
||||
|
||||
@@ -83,6 +83,15 @@ public class MaterialInfomationPageReqVO extends PageParam {
|
||||
@Schema(description = "用完标记,0-未标记,1-已用完标记")
|
||||
private Integer useEndFlag;
|
||||
|
||||
@Schema(description = "是否危险品,1-是,0-否")
|
||||
private Integer hazardous;
|
||||
|
||||
@Schema(description = "是否标准溶液,1-是,0-否")
|
||||
private Integer standardSolutionFlag;
|
||||
|
||||
@Schema(description = "是否标准物质,1-是,0-否")
|
||||
private Integer standardMaterialFlag;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
|
||||
@@ -35,6 +35,9 @@ public class MaterialInventoryOutboundPageReqVO extends PageParam {
|
||||
@Schema(description = "申请部门id", example = "845")
|
||||
private Long applyDepartmentId;
|
||||
|
||||
@Schema(description = "物料名称")
|
||||
private String productName;
|
||||
|
||||
@Schema(description = "申请时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] applyTime;
|
||||
|
||||
@@ -28,6 +28,34 @@ public class MaterialInventoryOutboundRespVO {
|
||||
@ExcelProperty("业务类型编码")
|
||||
private String businessTypeCode;
|
||||
|
||||
@Schema(description = "物料 ID")
|
||||
@ExcelProperty("物料 ID")
|
||||
private Long productId;
|
||||
|
||||
@Schema(description = "申请时间")
|
||||
@ExcelProperty("日期")
|
||||
private LocalDateTime applyTime;
|
||||
|
||||
@Schema(description = "物料名称", example = "硫酸")
|
||||
@ExcelProperty("试剂名称")
|
||||
private String productName;
|
||||
|
||||
@Schema(description = "申请部门")
|
||||
@ExcelProperty("消耗部门")
|
||||
private String applyDepartment;
|
||||
|
||||
@Schema(description = "申请部门id", example = "845")
|
||||
@ExcelProperty("消耗部门id")
|
||||
private Long applyDepartmentId;
|
||||
|
||||
@Schema(description = "物料型号", example = "AR 500ml")
|
||||
@ExcelProperty("规格型号")
|
||||
private String productModelNo;
|
||||
|
||||
@Schema(description = "物料单位", example = "瓶")
|
||||
@ExcelProperty("单位")
|
||||
private String unit;
|
||||
|
||||
@Schema(description = "申请人")
|
||||
@ExcelProperty("申请人")
|
||||
private String applyUser;
|
||||
@@ -36,17 +64,9 @@ public class MaterialInventoryOutboundRespVO {
|
||||
@ExcelProperty("申请人id")
|
||||
private Long applyUserId;
|
||||
|
||||
@Schema(description = "申请部门")
|
||||
@ExcelProperty("申请部门")
|
||||
private String applyDepartment;
|
||||
|
||||
@Schema(description = "申请部门id", example = "845")
|
||||
@ExcelProperty("申请部门id")
|
||||
private Long applyDepartmentId;
|
||||
|
||||
@Schema(description = "申请时间")
|
||||
@ExcelProperty("申请时间")
|
||||
private LocalDateTime applyTime;
|
||||
@Schema(description = "消耗量-按部门")
|
||||
@ExcelProperty("消耗量-按部门")
|
||||
private String usageQuantity;
|
||||
|
||||
@Schema(description = "监督人")
|
||||
@ExcelProperty("监督人")
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.zt.plat.module.qms.resource.material.controller.vo.export;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 物料消耗统计导出VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class MaterialConsumeStatisticsExportVO {
|
||||
|
||||
@Schema(description = "物料 ID")
|
||||
private Long productId;
|
||||
|
||||
@Schema(description = "申请时间")
|
||||
@ExcelProperty("日期")
|
||||
private LocalDate applyTime;
|
||||
|
||||
@Schema(description = "物料名称", example = "硫酸")
|
||||
@ExcelProperty("试剂名称")
|
||||
private String productName;
|
||||
|
||||
@Schema(description = "申请部门")
|
||||
@ExcelProperty("消耗部门")
|
||||
private String applyDepartment;
|
||||
|
||||
@Schema(description = "申请部门id", example = "845")
|
||||
private Long applyDepartmentId;
|
||||
|
||||
@Schema(description = "物料型号", example = "AR 500ml")
|
||||
@ExcelProperty("规格型号")
|
||||
private String productModelNo;
|
||||
|
||||
@Schema(description = "物料单位", example = "瓶")
|
||||
@ExcelProperty("单位")
|
||||
private String unit;
|
||||
|
||||
@Schema(description = "消耗量-按部门")
|
||||
@ExcelProperty("消耗量")
|
||||
private String usageQuantity;
|
||||
|
||||
@Schema(description = "备注")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.zt.plat.module.qms.resource.material.controller.vo.query;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
@@ -55,6 +56,9 @@ public class MaterialInfomationQueryVO {
|
||||
@Schema(description = "负责人", example = "张三")
|
||||
private String managerUserName;
|
||||
|
||||
@Schema(description = "开封后保质期是否变化,1-是,0-否")
|
||||
private Integer openDueFlag;
|
||||
|
||||
@Schema(description = "开封状态,0-未开封,1-已开封", example = "2")
|
||||
private Integer openStatus;
|
||||
|
||||
|
||||
@@ -55,6 +55,7 @@ public interface MaterialBatchMapper extends BaseMapperX<MaterialBatchDO> {
|
||||
.selectAll(MaterialBatchDO.class)
|
||||
.selectAs(MaterialProductDO::getName, MaterialBatchRespVO::getProductName)
|
||||
.selectAs(MaterialProductDO::getCode, MaterialBatchRespVO::getProductCode)
|
||||
.selectAs(MaterialProductDO::getStandardCapacity, MaterialBatchRespVO::getStandardCapacity)
|
||||
.selectAs(MaterialProductDO::getModelNo, MaterialBatchRespVO::getProductModelNo)
|
||||
// 标签模板,用于入库
|
||||
.selectAs(MaterialProductDO::getLabelTemplateKey, MaterialBatchRespVO::getLabelTemplateKey)
|
||||
@@ -68,7 +69,7 @@ public interface MaterialBatchMapper extends BaseMapperX<MaterialBatchDO> {
|
||||
// 只要工段
|
||||
.ne(MaterialBatchGongType.gong.name().equals(reqVO.getDataType()), MaterialBatchDO::getParentId, 0)
|
||||
// 用于批次分页
|
||||
.eq(StrUtil.isBlank(reqVO.getDataType()) && reqVO.getChildren(), MaterialBatchDO::getParentId, 0)
|
||||
.eq(StrUtil.isBlank(reqVO.getDataType()), MaterialBatchDO::getParentId, 0)
|
||||
// 用于退换货(已提交)
|
||||
.eqIfExists(MaterialBatchDO::getSubmitStatus, reqVO.getSubmitStatus())
|
||||
// 用于验收(提交且未验收)
|
||||
@@ -79,10 +80,10 @@ public interface MaterialBatchMapper extends BaseMapperX<MaterialBatchDO> {
|
||||
"SELECT 1 FROM t_mtrl_lfc_dtl ld WHERE ld.BAT_GONG_ID = t.ID AND ld.TMT_STS = 0 AND ld.DELETED = 0")
|
||||
// 用于入库(分已处理和未处理)
|
||||
// 已处理
|
||||
.apply(reqVO.getSubmitStatus() != null && reqVO.getSubmitStatus() == 1 && MaterialAcceptStatus.accepted.name().equals(reqVO.getAcceptanceStatus())
|
||||
.apply(MaterialAcceptStatus.accepted.name().equals(reqVO.getAcceptanceStatus())
|
||||
&& reqVO.getTreatment(), "t.INB_END_QTY >= t.INB_QTY")
|
||||
// 未处理
|
||||
.apply(reqVO.getSubmitStatus() != null && reqVO.getSubmitStatus() == 1 && MaterialAcceptStatus.accepted.name().equals(reqVO.getAcceptanceStatus())
|
||||
.apply(MaterialAcceptStatus.accepted.name().equals(reqVO.getAcceptanceStatus())
|
||||
&& !reqVO.getTreatment(), "t.INB_END_QTY < t.INB_QTY")
|
||||
.in(CollUtil.isNotEmpty(pdtIds), MaterialBatchDO::getProductId, pdtIds)
|
||||
.eq(CollUtil.isEmpty(pdtIds) && reqVO.getProductId() != null, MaterialBatchDO::getProductId, reqVO.getProductId())
|
||||
|
||||
@@ -83,6 +83,9 @@ public interface MaterialInfomationMapper extends BaseMapperX<MaterialInfomation
|
||||
.eqIfExists(MaterialInfomationDO::getBatchId, reqVO.getBatchId())
|
||||
.eqIfExists(MaterialInfomationDO::getLocationId, reqVO.getLocationId())
|
||||
.eqIfExists(MaterialInfomationDO::getCode, reqVO.getCode())
|
||||
.eqIfExists(MaterialProductDO::getStandardMaterialFlag, reqVO.getStandardMaterialFlag())
|
||||
.eqIfExists(MaterialProductDO::getStandardSolutionFlag, reqVO.getStandardSolutionFlag())
|
||||
.eqIfExists(MaterialProductDO::getHazardous, reqVO.getHazardous())
|
||||
.eqIfExists(MaterialProductDO::getParameter, reqVO.getParameter())
|
||||
.eqIfExists(MaterialInfomationDO::getPublishStatus, reqVO.getPublishStatus())
|
||||
.eqIfExists(MaterialInfomationDO::getUsageStatus, reqVO.getUsageStatus())
|
||||
@@ -108,7 +111,9 @@ public interface MaterialInfomationMapper extends BaseMapperX<MaterialInfomation
|
||||
.eqIfExists(MaterialInfomationDO::getUseEndFlag, queryVO.getUseEndFlag())
|
||||
.eqIfExists(MaterialProductDO::getHazardous, queryVO.getHazardous())
|
||||
.eqIfExists(MaterialProductDO::getStandardMaterialFlag, queryVO.getStandardMaterialFlag())
|
||||
.eqIfExists(MaterialProductDO::getStandardSolutionFlag, queryVO.getStandardSolutionFlag());
|
||||
.eqIfExists(MaterialProductDO::getStandardSolutionFlag, queryVO.getStandardSolutionFlag())
|
||||
.eqIfExists(MaterialProductDO::getOpenDueFlag, queryVO.getOpenDueFlag())
|
||||
.eqIfExists(MaterialInfomationDO::getOpenStatus, queryVO.getOpenStatus());
|
||||
return selectJoinOne(MaterialInfomationRespVO.class, wrapper);
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user