This commit is contained in:
dzc committed 2025-05-14 16:45:32 +08:00
commit 4360790f68
9 files changed
+298 -40

No files matched your search

@@ -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<String, Object> paramMap;
}
@@ -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;
}
@@ -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;
}
@@ -56,4 +56,7 @@ public class ProductionTemplateDetailVO{
@Schema(description="食材名称")
private String materialName;
@Schema(description="单位")
private String unit;
}
@@ -51,7 +51,7 @@ public class CanteenProductionRecordController {
LambdaQueryWrapper<CanteenProductionRecordEntity> 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));
}
@@ -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<CanteenProductionRecordEntity> {
/**
* 分页
* @param page
* @param wrapper
* @return
*/
Object pageScope(Page page, LambdaQueryWrapper<CanteenProductionRecordEntity> wrapper);
}
@@ -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<CanteenProductionRecordMapper, CanteenProductionRecordEntity> implements CanteenProductionRecordService {
@Override
public Object pageScope(Page page, LambdaQueryWrapper<CanteenProductionRecordEntity> wrapper) {
return baseMapper.selectPageByScope(page, wrapper, DataScope.of());
}
}
@@ -97,6 +97,7 @@ public class CanteenProductionTemplateServiceImpl extends ServiceImpl<CanteenPro
Long materialId = productionTemplateDetailVO.getMaterialId();
CanteenErpMaterialEntity canteenErpMaterialEntity = canteenErpMaterialMapper.selectById(materialId);
productionTemplateDetailVO.setMaterialName(canteenErpMaterialEntity.getName());
productionTemplateDetailVO.setUnit(canteenErpMaterialEntity.getUnit());
}
bean.setCanteenProductionTemplateDetailList(productionTemplateDetailVOList);
return bean;
@@ -136,6 +137,7 @@ public class CanteenProductionTemplateServiceImpl extends ServiceImpl<CanteenPro
List<ProductionTemplateDetailVO> 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<Long, List<ProductionTemplateDetailVO>> detailMap = productionTemplateDetailVOList.stream()
.collect(Collectors.groupingBy(ProductionTemplateDetailVO::getTemplateId));
@@ -31,7 +31,7 @@
</resultMap>
<select id="selectPageDataByScope"
resultType="com.bsd.pjcloud.canteen.vo.erp.CanteenProductionRecordPageVO">
SELECT r.inventory_code,r.inventory_date, COALESCE(GROUP_CONCAT(m.name ORDER BY m.name SEPARATOR ','), '') AS product_name,r.remark,r.total_amount,s.supplier_name
SELECT r.id, r.inventory_code,r.inventory_date, COALESCE(GROUP_CONCAT(m.name ORDER BY m.name SEPARATOR ','), '') AS product_name,r.remark,r.total_amount,s.supplier_name
FROM `canteen_inventory_records` r
LEFT JOIN canteen_inventory_records_item i
on r.id=i.inventory_id
@@ -48,6 +48,6 @@
and cpr.production_time = #{inventoryDate}
</if>
</where>
GROUP BY r.id;
</select>
</mapper>