From d6c8f0180e42e5b3bef67a2dd856216cf903f036 Mon Sep 17 00:00:00 2001 From: liux <963924687@qq.com> Date: Wed, 9 Jul 2025 17:38:45 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A6=85=E9=81=93=E9=97=AE=E9=A2=98=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=EF=BC=8C=E9=A2=86=E6=96=99=E5=8D=95=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/FetchMaterialController.java | 2 +- .../core/ims/domain/FetchMaterial.java | 4 +- .../core/ims/dto/FetchMaterialCommitDTO.java | 17 +++++++-- .../core/ims/dto/FetchMaterialPageDTO.java | 12 ++++++ .../core/ims/dto/FetchMaterialSaveDTO.java | 29 +++++++++++++-- .../core/ims/dto/RefundGoodsAddDTO.java | 13 +++++++ .../impl/FetchMaterialServiceImpl.java | 11 ++++-- .../service/impl/RefundGoodsServiceImpl.java | 5 +++ .../ims/vo/FetchMaterialDetailPageVO.java | 37 ++++++++++--------- .../core/ims/vo/FetchMaterialPageVO.java | 13 +++++++ .../impl/KitchenHomePageerviceImpl.java | 8 ++-- .../mapper/ims/FetchMaterialDetailMapper.xml | 4 +- .../mapper/ims/FetchMaterialMapper.xml | 5 +++ .../mapper/kitchen/KitchenHomePageMapper.xml | 5 ++- 14 files changed, 129 insertions(+), 36 deletions(-) diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/controller/FetchMaterialController.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/controller/FetchMaterialController.java index a27bac7..3e5308e 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/controller/FetchMaterialController.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/controller/FetchMaterialController.java @@ -82,7 +82,7 @@ public class FetchMaterialController extends BaseController { @GetMapping({"/page-detail"}) @ApiOperation("分页查询领料单明细") public TableDataInfo pageFetchMaterialDetail(@Valid FetchMaterialDetailPageDTO dto) { - startPage(); + // startPage(); return getDataTable(this.fetchMaterialService.pageFetchMaterialDetail(dto)); } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/domain/FetchMaterial.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/domain/FetchMaterial.java index 65e6c25..c95e3fd 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/domain/FetchMaterial.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/domain/FetchMaterial.java @@ -11,7 +11,7 @@ import com.bonus.common.core.web.domain.BaseEntity; /** * 领料单对象 ims_fetch_material - * + * * @author xsheng * @date 2025-07-07 */ @@ -74,6 +74,8 @@ public class FetchMaterial extends BaseEntity { @ApiModelProperty(value = "领料人") private Long fetchUserId; + private String fetchUser; + /** 审批状态(1待审核,2审批中,3审批通过,4审批不通过) */ @Excel(name = "审批状态(1待审核,2审批中,3审批通过,4审批不通过)") @ApiModelProperty(value = "审批状态(1待审核,2审批中,3审批通过,4审批不通过)") diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/dto/FetchMaterialCommitDTO.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/dto/FetchMaterialCommitDTO.java index 1e05725..002e20c 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/dto/FetchMaterialCommitDTO.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/dto/FetchMaterialCommitDTO.java @@ -43,9 +43,10 @@ public class FetchMaterialCommitDTO { @ApiModelProperty("领料时间") private LocalDateTime fetchMaterialTime; @ApiModelProperty("领料人") - private @NotNull( - message = "领料人不能为空!" -) Long fetchUserId; + private Long fetchUserId; + + @ApiModelProperty("领料人") + private String fetchUser; @ApiModelProperty("明细") private @Valid @Size( @@ -93,6 +94,16 @@ public class FetchMaterialCommitDTO { return this.detailList; } + + public String getFetchUser() { + return fetchUser; + } + + public FetchMaterialCommitDTO setFetchUser(String fetchUser) { + this.fetchUser = fetchUser; + return this; + } + public FetchMaterialCommitDTO setFetchMaterialId(final Long fetchMaterialId) { this.fetchMaterialId = fetchMaterialId; return this; diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/dto/FetchMaterialPageDTO.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/dto/FetchMaterialPageDTO.java index 265c113..0241400 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/dto/FetchMaterialPageDTO.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/dto/FetchMaterialPageDTO.java @@ -31,6 +31,8 @@ public class FetchMaterialPageDTO { private LocalDateTime endTime; @ApiModelProperty("领料人") private Long fetchUserId; + @ApiModelProperty("领料人名称") + private String fetchUser; @ApiModelProperty("制表开始时间") private LocalDateTime crtimeStart; @ApiModelProperty("制表结束时间") @@ -115,6 +117,16 @@ public class FetchMaterialPageDTO { return this.areaAuth; } + + public String getFetchUser() { + return fetchUser; + } + + public FetchMaterialPageDTO setFetchUser(String fetchUser) { + this.fetchUser = fetchUser; + return this; + } + public FetchMaterialPageDTO setFetchMaterialId(final String fetchMaterialId) { this.fetchMaterialId = fetchMaterialId; return this; diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/dto/FetchMaterialSaveDTO.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/dto/FetchMaterialSaveDTO.java index 31ad942..6d9c025 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/dto/FetchMaterialSaveDTO.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/dto/FetchMaterialSaveDTO.java @@ -17,6 +17,9 @@ import java.util.List; public class FetchMaterialSaveDTO { @ApiModelProperty("领料单号") private Long fetchMaterialId; + + /** 领料单编号 */ + private String fetchMaterialCode; @ApiModelProperty("领料单标题") private @NotBlank( message = "领料单标题不能为空!" @@ -40,9 +43,10 @@ public class FetchMaterialSaveDTO { @ApiModelProperty("领料时间") private LocalDateTime fetchMaterialTime; @ApiModelProperty("领料人") - private @NotNull( - message = "领料人不能为空!" -) Long fetchUserId; + private Long fetchUserId; + + @ApiModelProperty("领料人") + private String fetchUser; @ApiModelProperty("明细") private @Valid List detailList; @@ -86,6 +90,25 @@ public class FetchMaterialSaveDTO { return this.detailList; } + + public String getFetchUser() { + return fetchUser; + } + + public String getFetchMaterialCode() { + return fetchMaterialCode; + } + + public FetchMaterialSaveDTO setFetchMaterialCode(String fetchMaterialCode) { + this.fetchMaterialCode = fetchMaterialCode; + return this; + } + + public FetchMaterialSaveDTO setFetchUser(String fetchUser) { + this.fetchUser = fetchUser; + return this; + } + public FetchMaterialSaveDTO setFetchMaterialId(final Long fetchMaterialId) { this.fetchMaterialId = fetchMaterialId; return this; diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/dto/RefundGoodsAddDTO.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/dto/RefundGoodsAddDTO.java index c9abf1a..564d853 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/dto/RefundGoodsAddDTO.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/dto/RefundGoodsAddDTO.java @@ -12,6 +12,8 @@ import java.util.List; public class RefundGoodsAddDTO { private Long refundGoodsId; + + private String refundGoodsCode; @ApiModelProperty("供应商id") private Long supplierId; @ApiModelProperty("退货时间") @@ -33,6 +35,8 @@ public class RefundGoodsAddDTO { @ApiModelProperty("明细集合") private List detailList; + + public Long getSupplierId() { return this.supplierId; } @@ -73,6 +77,15 @@ public class RefundGoodsAddDTO { return refundGoodsId; } + public String getRefundGoodsCode() { + return refundGoodsCode; + } + + public RefundGoodsAddDTO setRefundGoodsCode(String refundGoodsCode) { + this.refundGoodsCode = refundGoodsCode; + return this; + } + public RefundGoodsAddDTO setRefundGoodsId(Long refundGoodsId) { this.refundGoodsId = refundGoodsId; return this; diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/FetchMaterialServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/FetchMaterialServiceImpl.java index 8755cbb..05b470a 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/FetchMaterialServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/FetchMaterialServiceImpl.java @@ -19,6 +19,7 @@ import com.bonus.canteen.core.ims.vo.FetchMaterialDetailPageVO; import com.bonus.canteen.core.ims.vo.FetchMaterialPageVO; import com.bonus.common.core.exception.ServiceException; import com.bonus.common.core.utils.DateUtils; +import com.bonus.common.core.utils.StringUtils; import com.bonus.common.core.web.domain.AjaxResult; import com.bonus.common.houqin.constant.DelFlagEnum; import com.bonus.common.security.utils.SecurityUtils; @@ -83,8 +84,8 @@ public class FetchMaterialServiceImpl implements IFetchMaterialService { FetchMaterial fetchMaterial = new FetchMaterial(); BeanUtil.copyProperties(content, fetchMaterial, new String[0]); Long fetchMaterialId = content.getFetchMaterialId(); - String fetchMaterialCode = NoGenerateUtils.generateFetchMaterialCode(); if (fetchMaterialId == null) { + String fetchMaterialCode = NoGenerateUtils.generateFetchMaterialCode(); // fetchMaterialId = CustomIdGenerateUtil.generateFetchMaterialId(); fetchMaterial.setFetchMaterialId(fetchMaterialId); fetchMaterial.setOutNum(BigDecimal.ZERO); @@ -93,10 +94,14 @@ public class FetchMaterialServiceImpl implements IFetchMaterialService { fetchMaterial.setCreateTime(DateUtils.getNowDate()); this.fetchMaterialMapper.insertFetchMaterial(fetchMaterial); } else { + String code = fetchMaterial.getFetchMaterialCode(); + if(StringUtils.isEmpty(code)){ + throw new ServiceException("领料单号不能为空"); + } fetchMaterial.setUpdateBy(SecurityUtils.getUsername()); fetchMaterial.setUpdateTime(DateUtils.getNowDate()); this.fetchMaterialMapper.updateFetchMaterial(fetchMaterial); - this.fetchMaterialMapper.deleteFetchMaterialByFetchMaterialId(fetchMaterial.getFetchMaterialId()); + this.FetchMaterialDetailMapper.deleteFetchMaterialDetailByFetchMaterialId(fetchMaterial.getFetchMaterialId()); } List detailList = content.getDetailList(); Iterator var5 = detailList.iterator(); @@ -106,7 +111,7 @@ public class FetchMaterialServiceImpl implements IFetchMaterialService { BeanUtil.copyProperties(detail, drpFetchMaterialDetail, new String[0]); drpFetchMaterialDetail.setFetchMaterialId(fetchMaterialId); drpFetchMaterialDetail.setOutCount(BigDecimal.ZERO); - drpFetchMaterialDetail.setFetchMaterialCode(fetchMaterialCode); + drpFetchMaterialDetail.setFetchMaterialCode(fetchMaterial.getFetchMaterialCode()); drpFetchMaterialDetail.setFetchMaterialId(fetchMaterial.getFetchMaterialId()); drpFetchMaterialDetail.setCreateTime(DateUtils.getNowDate()); drpFetchMaterialDetail.setCreateBy(SecurityUtils.getUsername()); diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/RefundGoodsServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/RefundGoodsServiceImpl.java index 8abf40a..1af61b1 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/RefundGoodsServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/RefundGoodsServiceImpl.java @@ -17,6 +17,7 @@ import com.bonus.canteen.core.ims.utils.NoGenerateUtils; import com.bonus.canteen.core.ims.vo.*; import com.bonus.common.core.exception.ServiceException; import com.bonus.common.core.utils.DateUtils; +import com.bonus.common.core.utils.StringUtils; import com.bonus.common.core.web.domain.AjaxResult; import com.bonus.common.houqin.constant.DelFlagEnum; import com.bonus.common.houqin.utils.LeBeanUtil; @@ -88,6 +89,10 @@ public class RefundGoodsServiceImpl implements IRefundGoodsService { drpRefundGoods.setStatus(DrpCommitStatusEnum.COMMIT.key()); refundGoodsMapper.insertRefundGoods(drpRefundGoods); }else{ + String code = drpRefundGoods.getRefundGoodsCode(); + if(StringUtils.isEmpty(code)){ + throw new ServiceException("退货单号不能为空"); + } drpRefundGoods.setUpdateBy(SecurityUtils.getUsername()); drpRefundGoods.setUpdateTime(DateUtils.getNowDate()); refundGoodsMapper.updateRefundGoods(drpRefundGoods); diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/vo/FetchMaterialDetailPageVO.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/vo/FetchMaterialDetailPageVO.java index 7760c7b..9f1067b 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/vo/FetchMaterialDetailPageVO.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/vo/FetchMaterialDetailPageVO.java @@ -24,9 +24,9 @@ public class FetchMaterialDetailPageVO { @ApiModelProperty("货品编码") private String materialCode; @ApiModelProperty("货品类别id") - private Long categoryId; + private Long materialTypeId; @ApiModelProperty("货品类别") - private String categoryName; + private String materialTypeName; @ApiModelProperty("货品单位id") private Long unitId; @ApiModelProperty("货品单位") @@ -84,13 +84,7 @@ public class FetchMaterialDetailPageVO { return this.materialCode; } - public Long getCategoryId() { - return this.categoryId; - } - public String getCategoryName() { - return this.categoryName; - } public Long getUnitId() { return this.unitId; @@ -141,6 +135,24 @@ public class FetchMaterialDetailPageVO { return this.ifRegister; } + public Long getMaterialTypeId() { + return materialTypeId; + } + + public FetchMaterialDetailPageVO setMaterialTypeId(Long materialTypeId) { + this.materialTypeId = materialTypeId; + return this; + } + + public String getMaterialTypeName() { + return materialTypeName; + } + + public FetchMaterialDetailPageVO setMaterialTypeName(String materialTypeName) { + this.materialTypeName = materialTypeName; + return this; + } + public FetchMaterialDetailPageVO setFetchDetailId(final Long fetchDetailId) { this.fetchDetailId = fetchDetailId; return this; @@ -171,15 +183,6 @@ public class FetchMaterialDetailPageVO { return this; } - public FetchMaterialDetailPageVO setCategoryId(final Long categoryId) { - this.categoryId = categoryId; - return this; - } - - public FetchMaterialDetailPageVO setCategoryName(final String categoryName) { - this.categoryName = categoryName; - return this; - } public FetchMaterialDetailPageVO setUnitId(final Long unitId) { this.unitId = unitId; diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/vo/FetchMaterialPageVO.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/vo/FetchMaterialPageVO.java index 045549f..efc4f0d 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/vo/FetchMaterialPageVO.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/vo/FetchMaterialPageVO.java @@ -13,6 +13,9 @@ import java.time.LocalDateTime; public class FetchMaterialPageVO { @ApiModelProperty("领料单号") private String fetchMaterialId; + + @ApiModelProperty("领料单号") + private String fetchMaterialCode; @ApiModelProperty("领料单标题") private String title; @ApiModelProperty("提交状态(1待提交,2已提交)") @@ -174,6 +177,16 @@ public class FetchMaterialPageVO { return this.curUserApprove; } + + public String getFetchMaterialCode() { + return fetchMaterialCode; + } + + public FetchMaterialPageVO setFetchMaterialCode(String fetchMaterialCode) { + this.fetchMaterialCode = fetchMaterialCode; + return this; + } + public FetchMaterialPageVO setFetchMaterialId(final String fetchMaterialId) { this.fetchMaterialId = fetchMaterialId; return this; diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/service/impl/KitchenHomePageerviceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/service/impl/KitchenHomePageerviceImpl.java index af3318c..7b4fa15 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/service/impl/KitchenHomePageerviceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/service/impl/KitchenHomePageerviceImpl.java @@ -187,7 +187,7 @@ public class KitchenHomePageerviceImpl implements IKitchenHomePageService { throw new ServiceException("开始时间不能大于结束时间"); } }else{ - deviceStartDate = LocalDate.now().plusDays(-1); + deviceStartDate = LocalDate.now(); deviceEndTime = LocalDate.now(); } List deviceStatus = kitchenHomePageMapper.getDeviceStatusCount(deviceStartDate.toString(), deviceEndTime.toString()); @@ -225,7 +225,7 @@ public class KitchenHomePageerviceImpl implements IKitchenHomePageService { throw new ServiceException("留样开始时间不能大于结束时间"); } } else { - sampleStartDate = LocalDate.now().plusDays(-1); + sampleStartDate = LocalDate.now(); sampleEndTime = LocalDate.now(); } List sampleRetention = kitchenHomePageMapper.getSampleRetentionCount(sampleStartDate.toString(), sampleEndTime.toString()); @@ -280,14 +280,14 @@ public class KitchenHomePageerviceImpl implements IKitchenHomePageService { IndexMapCountVO indexMapCountVO = new IndexMapCountVO(); int count = kitchenHomePageMapper.getCountNum(kitchenDeviceSensorMetric,"max" ); indexMapCountVO.setCount(count); - indexMapCountVO.setName(name + "过高"); + indexMapCountVO.setName(name + ":过高"); environmentWarning.add(indexMapCountVO); } if(!isZeroMin){ IndexMapCountVO indexMapCountVO = new IndexMapCountVO(); int count = kitchenHomePageMapper.getCountNum(kitchenDeviceSensorMetric,"min" ); indexMapCountVO.setCount(count); - indexMapCountVO.setName(name + "过低"); + indexMapCountVO.setName(name + ":过低"); environmentWarning.add(indexMapCountVO); } } diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/ims/FetchMaterialDetailMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/ims/FetchMaterialDetailMapper.xml index 766e0a1..3297326 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/ims/FetchMaterialDetailMapper.xml +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/ims/FetchMaterialDetailMapper.xml @@ -112,8 +112,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" a.inventory_id, b.material_name, b.material_code, - b.material_type_id as categoryId, - d.material_type_name as materialName, + b.material_type_id , + d.material_type_name , b.unit_id, c.unit_name, e.material_num inventoryNum, diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/ims/FetchMaterialMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/ims/FetchMaterialMapper.xml index e2fbf74..62b5e6b 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/ims/FetchMaterialMapper.xml +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/ims/FetchMaterialMapper.xml @@ -70,6 +70,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" warehouse_id, fetch_material_time, fetch_user_id, + fetch_user, approve_status, process_instance_id, approve_by, @@ -92,6 +93,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{warehouseId}, #{fetchMaterialTime}, #{fetchUserId}, + #{fetchUser}, #{approveStatus}, #{processInstanceId}, #{approveBy}, @@ -118,6 +120,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" warehouse_id = #{warehouseId}, fetch_material_time = #{fetchMaterialTime}, fetch_user_id = #{fetchUserId}, + fetch_user = #{fetchUser}, approve_status = #{approveStatus}, process_instance_id = #{processInstanceId}, approve_by = #{approveBy}, @@ -145,6 +148,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"