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));