From b6aed9f9d2af7f34862712b2439f27f0e19f26d4 Mon Sep 17 00:00:00 2001 From: zjf <1799650030@qq.com> Date: Tue, 13 May 2025 21:50:36 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E9=A3=9F=E5=A0=82=E8=BF=9B=E9=94=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../canteen/vo/erp/ProductionRecordDTO.java | 43 +++++++ .../vo/erp/ProductionRecordItemDTO.java | 105 ++++++++++++++++++ .../vo/erp/ProductionTemplateDetailVO.java | 3 + .../CanteenProductionRecordController.java | 2 +- .../CanteenProductionRecordService.java | 10 ++ .../CanteenProductionRecordServiceImpl.java | 7 ++ .../CanteenProductionTemplateServiceImpl.java | 2 + 7 files changed, 171 insertions(+), 1 deletion(-) create mode 100644 pjcloud-canteen/pjcloud-canteen-api/src/main/java/com/bsd/pjcloud/canteen/vo/erp/ProductionRecordDTO.java create mode 100644 pjcloud-canteen/pjcloud-canteen-api/src/main/java/com/bsd/pjcloud/canteen/vo/erp/ProductionRecordItemDTO.java diff --git a/pjcloud-canteen/pjcloud-canteen-api/src/main/java/com/bsd/pjcloud/canteen/vo/erp/ProductionRecordDTO.java b/pjcloud-canteen/pjcloud-canteen-api/src/main/java/com/bsd/pjcloud/canteen/vo/erp/ProductionRecordDTO.java new file mode 100644 index 000000000..4452b59a0 --- /dev/null +++ b/pjcloud-canteen/pjcloud-canteen-api/src/main/java/com/bsd/pjcloud/canteen/vo/erp/ProductionRecordDTO.java @@ -0,0 +1,43 @@ +package com.bsd.pjcloud.canteen.vo.erp; + + +import com.baomidou.mybatisplus.annotation.*; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.time.LocalDateTime; + +@Data +public class ProductionRecordDTO { + /** + * id + */ + @Schema(description="id") + private Long id; + + /** + * 加工日期 + */ + @Schema(description="加工日期") + private LocalDateTime productionTime; + + /** + * 加工人 + */ + @Schema(description="加工人") + private String handlerUser; + + /** + * 加工批次号 + */ + @Schema(description="加工批次号") + private String recordCode; + + /** + * 备注 + */ + @Schema(description="备注") + private String remark; + + +} diff --git a/pjcloud-canteen/pjcloud-canteen-api/src/main/java/com/bsd/pjcloud/canteen/vo/erp/ProductionRecordItemDTO.java b/pjcloud-canteen/pjcloud-canteen-api/src/main/java/com/bsd/pjcloud/canteen/vo/erp/ProductionRecordItemDTO.java new file mode 100644 index 000000000..52cd557b0 --- /dev/null +++ b/pjcloud-canteen/pjcloud-canteen-api/src/main/java/com/bsd/pjcloud/canteen/vo/erp/ProductionRecordItemDTO.java @@ -0,0 +1,105 @@ +package com.bsd.pjcloud.canteen.vo.erp; + + +import com.baomidou.mybatisplus.annotation.*; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.time.LocalDateTime; + +@Data +public class ProductionRecordItemDTO { + /** + * id + */ + @Schema(description="id") + private Long id; + + /** + * 单据类型(字典inventory_type) + */ + @Schema(description="单据类型(字典inventory_type)") + private String inventoryType; + + /** + * 原料id + */ + @Schema(description="原料id") + private Long erpMaterialId; + + /** + * 商户编号 + */ + @Schema(description="商户编号") + private Long merchantId; + + + /** + * 出入库数量 + */ + @Schema(description="出入库数量") + private Double quantity; + + /** + * 单价 + */ + @Schema(description="单价") + private Integer unitPrice; + + /** + * 总金额 + */ + @Schema(description="总金额") + private Integer totalAmount; + + /** + * 税率% + */ + @Schema(description="税率%") + private Integer taxRate; + + /** + * 税前金额 + */ + @Schema(description="税前金额") + private Integer taxAmount; + + /** + * 货商 + */ + @Schema(description="货商") + private Long supplierId; + + /** + * 备注 + */ + @Schema(description="备注") + private String remark; + + + /** + * 总数 + */ + @Schema(description="总数") + private Integer totalNumber; + + /** + * 账面数量 + */ + @Schema(description="账面数量") + private Integer accountNumber; + + /** + * 实际数量 + */ + @Schema(description="实际数量") + private Integer realNumber; + + /** + * 实际单价 + */ + @Schema(description="实际单价") + private Integer realPrice; + + +} diff --git a/pjcloud-canteen/pjcloud-canteen-api/src/main/java/com/bsd/pjcloud/canteen/vo/erp/ProductionTemplateDetailVO.java b/pjcloud-canteen/pjcloud-canteen-api/src/main/java/com/bsd/pjcloud/canteen/vo/erp/ProductionTemplateDetailVO.java index 55e194998..bfb605c5b 100644 --- a/pjcloud-canteen/pjcloud-canteen-api/src/main/java/com/bsd/pjcloud/canteen/vo/erp/ProductionTemplateDetailVO.java +++ b/pjcloud-canteen/pjcloud-canteen-api/src/main/java/com/bsd/pjcloud/canteen/vo/erp/ProductionTemplateDetailVO.java @@ -56,4 +56,7 @@ public class ProductionTemplateDetailVO{ @Schema(description="食材名称") private String materialName; + @Schema(description="单位") + private String unit; + } \ No newline at end of file diff --git a/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/controller/CanteenProductionRecordController.java b/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/controller/CanteenProductionRecordController.java index 77098357e..e9b93b67f 100644 --- a/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/controller/CanteenProductionRecordController.java +++ b/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/controller/CanteenProductionRecordController.java @@ -51,7 +51,7 @@ public class CanteenProductionRecordController { LambdaQueryWrapper wrapper = Wrappers.lambdaQuery(); wrapper.eq(Objects.nonNull(canteenProductionRecord.getProductionTime()),CanteenProductionRecordEntity::getProductionTime,canteenProductionRecord.getProductionTime()); wrapper.eq(StrUtil.isNotBlank(canteenProductionRecord.getRecordCode()),CanteenProductionRecordEntity::getRecordCode,canteenProductionRecord.getRecordCode()); - return R.ok(canteenProductionRecordService.page(page, wrapper)); + return R.ok(canteenProductionRecordService.pageScope(page, wrapper)); } diff --git a/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/service/CanteenProductionRecordService.java b/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/service/CanteenProductionRecordService.java index 8896d5f33..843e67e18 100644 --- a/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/service/CanteenProductionRecordService.java +++ b/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/service/CanteenProductionRecordService.java @@ -1,8 +1,18 @@ package com.bsd.pjcloud.canteen.service; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; import com.bsd.pjcloud.canteen.entity.CanteenProductionRecordEntity; public interface CanteenProductionRecordService extends IService { + + /** + * 分页 + * @param page + * @param wrapper + * @return + */ + Object pageScope(Page page, LambdaQueryWrapper wrapper); } \ No newline at end of file diff --git a/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/service/impl/CanteenProductionRecordServiceImpl.java b/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/service/impl/CanteenProductionRecordServiceImpl.java index fd42c1086..228adb443 100644 --- a/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/service/impl/CanteenProductionRecordServiceImpl.java +++ b/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/service/impl/CanteenProductionRecordServiceImpl.java @@ -1,9 +1,12 @@ package com.bsd.pjcloud.canteen.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.bsd.pjcloud.canteen.entity.CanteenProductionRecordEntity; import com.bsd.pjcloud.canteen.mapper.CanteenProductionRecordMapper; import com.bsd.pjcloud.canteen.service.CanteenProductionRecordService; +import com.bsd.pjcloud.common.data.datascope.DataScope; import org.springframework.stereotype.Service; /** * 食材加工记录表 @@ -13,4 +16,8 @@ import org.springframework.stereotype.Service; */ @Service public class CanteenProductionRecordServiceImpl extends ServiceImpl implements CanteenProductionRecordService { + @Override + public Object pageScope(Page page, LambdaQueryWrapper wrapper) { + return baseMapper.selectPageByScope(page, wrapper, DataScope.of()); + } } \ No newline at end of file diff --git a/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/service/impl/CanteenProductionTemplateServiceImpl.java b/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/service/impl/CanteenProductionTemplateServiceImpl.java index 005f97e5a..2147d855b 100644 --- a/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/service/impl/CanteenProductionTemplateServiceImpl.java +++ b/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/service/impl/CanteenProductionTemplateServiceImpl.java @@ -97,6 +97,7 @@ public class CanteenProductionTemplateServiceImpl extends ServiceImpl productionTemplateDetailVOList = BeanUtils.toBean(canteenProductionTemplateDetailEntities, ProductionTemplateDetailVO.class); productionTemplateDetailVOList.forEach(item->{ item.setMaterialName(materialMap.getOrDefault(item.getMaterialId(), new CanteenErpMaterialEntity()).getName()); + item.setUnit(materialMap.getOrDefault(item.getMaterialId(), new CanteenErpMaterialEntity()).getUnit()); }); Map> detailMap = productionTemplateDetailVOList.stream() .collect(Collectors.groupingBy(ProductionTemplateDetailVO::getTemplateId)); From 1492d6053e9c2b00088ab27dadec7588a9a066f1 Mon Sep 17 00:00:00 2001 From: zjf <1799650030@qq.com> Date: Wed, 14 May 2025 10:07:07 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E9=A3=9F=E5=A0=82=E8=BF=9B=E9=94=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../vo/erp/CanteenProductionRecordPageVO.java | 162 ++++++++++++++---- .../mapper/CanteenInventoryRecordsMapper.xml | 4 +- 2 files changed, 127 insertions(+), 39 deletions(-) diff --git a/pjcloud-canteen/pjcloud-canteen-api/src/main/java/com/bsd/pjcloud/canteen/vo/erp/CanteenProductionRecordPageVO.java b/pjcloud-canteen/pjcloud-canteen-api/src/main/java/com/bsd/pjcloud/canteen/vo/erp/CanteenProductionRecordPageVO.java index 8d468e52c..ac36c9e7a 100644 --- a/pjcloud-canteen/pjcloud-canteen-api/src/main/java/com/bsd/pjcloud/canteen/vo/erp/CanteenProductionRecordPageVO.java +++ b/pjcloud-canteen/pjcloud-canteen-api/src/main/java/com/bsd/pjcloud/canteen/vo/erp/CanteenProductionRecordPageVO.java @@ -4,7 +4,9 @@ import com.baomidou.mybatisplus.annotation.*; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; +import java.time.LocalDate; import java.time.LocalDateTime; +import java.util.Map; /** * 食材加工记录表 @@ -13,61 +15,147 @@ import java.time.LocalDateTime; * @date 2025-05-08 11:02:09 */ @Data -@Schema(description = "食材加工记录表vo") +@Schema(description = "采购入库分页vo") public class CanteenProductionRecordPageVO { - /** - * id - */ - @Schema(description="id") - private Long id; /** - * 加工日期 - */ - @Schema(description="加工日期") - private LocalDateTime productionTime; + * 主键 + */ + @Schema(description="主键") + private Long id; /** - * 加工人 - */ - @Schema(description="加工人") - private String handlerUser; + * 单据编号(规则生成,出入库编号) + */ + @Schema(description="单据编号(规则生成,出入库编号)") + private String inventoryCode; /** - * 主id - */ - @Schema(description="主id") - private Long recordId; + * 单据日期 + */ + @Schema(description="单据日期") + private LocalDate inventoryDate; /** - * 加工批次号 - */ - @Schema(description="加工批次号") - private String recordCode; + * 单据类型(字典inventory_type)采购入库、采购退货、盘点入库等 + */ + @Schema(description="单据类型(字典inventory_type)采购入库、采购退货、盘点入库等") + private String inventoryType; /** - * 备注 - */ - @Schema(description="备注") - private String remark; - + * 来源ID(根据类型指向对应的表,如采购单ID、退货单ID等) + */ + @Schema(description="来源code") + private String linkCode; /** - * 创建人 - */ + * 仓库id + */ + @Schema(description="仓库id") + private String warehouseId; + + /** + * 经办人id + */ + @Schema(description="经办人id") + private Long handlerUserId; + + /** + * 审批状态 + */ + @Schema(description="审批状态") + private String checkStatus; + + /** + * 审批人id + */ + @Schema(description="审批人id") + private String checkUserId; + + /** + * 审核日期 + */ + @Schema(description="审核日期") + private LocalDateTime checkTime; + + /** + * 商户编号 + */ + @Schema(description="商户编号") + private Long merchantId; + + /** + * 部门id + */ + @Schema(description="部门id") + private Long deptId; + + /** + * 货商 + */ + @Schema(description="货商") + private Long supplierId; + + /** + * 备注 + */ + @Schema(description="备注") + private String remark; + + /** + * 订单类型(1入库 2出库) + */ + @Schema(description="订单类型(1入库 2出库)") + private String orderType; + + /** + * 入库总金额 + */ + @Schema(description="入库总金额") + private Integer totalAmount; + + /** + * 创建时间 + */ @TableField(fill = FieldFill.INSERT) - @Schema(description="创建人") - private String createBy; + @Schema(description="创建时间") + private LocalDateTime createTime; /** - * 创建时间 - */ - @TableField(fill = FieldFill.INSERT) - @Schema(description="创建时间") - private LocalDateTime createTime; + * 租户编号 + */ + @Schema(description="租户编号") + private Long tenantId; - @Schema(description="食材名称") + @Schema(description="设备类型") + private Integer deviceType; + + @Schema(description="流程实例id") + private String processInstanceId; + + @Schema(description="审核原因") + private String checkReason; + + @Schema(description="商品名称") + @TableField(exist = false) private String productName; + + @Schema(description="经办人名称") + @TableField(exist = false) + private String handlerUserName; + + @Schema(description="收货数量") + private Integer receiveAmount; + + @Schema(description="货商名称") + @TableField(exist = false) + private String supplierName; + + + @Schema(description="参数") + @TableField(exist = false) + private Map paramMap; + } \ No newline at end of file diff --git a/pjcloud-canteen/pjcloud-canteen-biz/src/main/resources/mapper/CanteenInventoryRecordsMapper.xml b/pjcloud-canteen/pjcloud-canteen-biz/src/main/resources/mapper/CanteenInventoryRecordsMapper.xml index 97f258397..ddff9e2f5 100644 --- a/pjcloud-canteen/pjcloud-canteen-biz/src/main/resources/mapper/CanteenInventoryRecordsMapper.xml +++ b/pjcloud-canteen/pjcloud-canteen-biz/src/main/resources/mapper/CanteenInventoryRecordsMapper.xml @@ -31,7 +31,7 @@ \ No newline at end of file