feat(aps): 添加排产单和排产明细功能模块
- 创建排产单主实体类 ApsPlanSheet 和业务对象 ApsPlanSheetBo - 创建排产单明细实体类 ApsPlanDetail 和业务对象 ApsPlanDetailBo - 实现排产单主和明细的控制器、服务层和数据访问层 - 添加排产单主和明细的查询、新增、修改、删除和导出功能 - 配置 MyBatis Plus 映射和 XML 结果映射 - 实现分页查询和条件筛选功能 - 添加数据校验和业务逻辑处理
This commit is contained in:
@@ -0,0 +1,99 @@
|
||||
package com.klp.aps.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.*;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import com.klp.common.annotation.RepeatSubmit;
|
||||
import com.klp.common.annotation.Log;
|
||||
import com.klp.common.core.controller.BaseController;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.klp.common.core.domain.R;
|
||||
import com.klp.common.core.validate.AddGroup;
|
||||
import com.klp.common.core.validate.EditGroup;
|
||||
import com.klp.common.enums.BusinessType;
|
||||
import com.klp.common.utils.poi.ExcelUtil;
|
||||
import com.klp.aps.domain.vo.ApsPlanDetailVo;
|
||||
import com.klp.aps.domain.bo.ApsPlanDetailBo;
|
||||
import com.klp.aps.service.IApsPlanDetailService;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 排产单明细
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-03-26
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/aps/planDetail")
|
||||
public class ApsPlanDetailController extends BaseController {
|
||||
|
||||
private final IApsPlanDetailService iApsPlanDetailService;
|
||||
|
||||
/**
|
||||
* 查询排产单明细列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<ApsPlanDetailVo> list(ApsPlanDetailBo bo, PageQuery pageQuery) {
|
||||
return iApsPlanDetailService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出排产单明细列表
|
||||
*/
|
||||
@Log(title = "排产单明细", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(ApsPlanDetailBo bo, HttpServletResponse response) {
|
||||
List<ApsPlanDetailVo> list = iApsPlanDetailService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "排产单明细", ApsPlanDetailVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取排产单明细详细信息
|
||||
*
|
||||
* @param planDetailId 主键
|
||||
*/
|
||||
@GetMapping("/{planDetailId}")
|
||||
public R<ApsPlanDetailVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long planDetailId) {
|
||||
return R.ok(iApsPlanDetailService.queryById(planDetailId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增排产单明细
|
||||
*/
|
||||
@Log(title = "排产单明细", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody ApsPlanDetailBo bo) {
|
||||
return toAjax(iApsPlanDetailService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改排产单明细
|
||||
*/
|
||||
@Log(title = "排产单明细", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody ApsPlanDetailBo bo) {
|
||||
return toAjax(iApsPlanDetailService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除排产单明细
|
||||
*
|
||||
* @param planDetailIds 主键串
|
||||
*/
|
||||
@Log(title = "排产单明细", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{planDetailIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] planDetailIds) {
|
||||
return toAjax(iApsPlanDetailService.deleteWithValidByIds(Arrays.asList(planDetailIds), true));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
package com.klp.aps.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.*;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import com.klp.common.annotation.RepeatSubmit;
|
||||
import com.klp.common.annotation.Log;
|
||||
import com.klp.common.core.controller.BaseController;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.klp.common.core.domain.R;
|
||||
import com.klp.common.core.validate.AddGroup;
|
||||
import com.klp.common.core.validate.EditGroup;
|
||||
import com.klp.common.enums.BusinessType;
|
||||
import com.klp.common.utils.poi.ExcelUtil;
|
||||
import com.klp.aps.domain.vo.ApsPlanSheetVo;
|
||||
import com.klp.aps.domain.bo.ApsPlanSheetBo;
|
||||
import com.klp.aps.service.IApsPlanSheetService;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 排产单主
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-03-26
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/aps/planSheet")
|
||||
public class ApsPlanSheetController extends BaseController {
|
||||
|
||||
private final IApsPlanSheetService iApsPlanSheetService;
|
||||
|
||||
/**
|
||||
* 查询排产单主列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<ApsPlanSheetVo> list(ApsPlanSheetBo bo, PageQuery pageQuery) {
|
||||
return iApsPlanSheetService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出排产单主列表
|
||||
*/
|
||||
@Log(title = "排产单主", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(ApsPlanSheetBo bo, HttpServletResponse response) {
|
||||
List<ApsPlanSheetVo> list = iApsPlanSheetService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "排产单主", ApsPlanSheetVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取排产单主详细信息
|
||||
*
|
||||
* @param planSheetId 主键
|
||||
*/
|
||||
@GetMapping("/{planSheetId}")
|
||||
public R<ApsPlanSheetVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long planSheetId) {
|
||||
return R.ok(iApsPlanSheetService.queryById(planSheetId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增排产单主
|
||||
*/
|
||||
@Log(title = "排产单主", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody ApsPlanSheetBo bo) {
|
||||
return toAjax(iApsPlanSheetService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改排产单主
|
||||
*/
|
||||
@Log(title = "排产单主", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody ApsPlanSheetBo bo) {
|
||||
return toAjax(iApsPlanSheetService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除排产单主
|
||||
*
|
||||
* @param planSheetIds 主键串
|
||||
*/
|
||||
@Log(title = "排产单主", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{planSheetIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] planSheetIds) {
|
||||
return toAjax(iApsPlanSheetService.deleteWithValidByIds(Arrays.asList(planSheetIds), true));
|
||||
}
|
||||
}
|
||||
219
klp-aps/src/main/java/com/klp/aps/domain/bo/ApsPlanDetailBo.java
Normal file
219
klp-aps/src/main/java/com/klp/aps/domain/bo/ApsPlanDetailBo.java
Normal file
@@ -0,0 +1,219 @@
|
||||
package com.klp.aps.domain.bo;
|
||||
|
||||
import com.klp.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
/**
|
||||
* 排产单明细业务对象 aps_plan_detail
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-03-26
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class ApsPlanDetailBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 排产明细主键ID
|
||||
*/
|
||||
private Long planDetailId;
|
||||
|
||||
/**
|
||||
* 关联排产单ID
|
||||
*/
|
||||
private Long planSheetId;
|
||||
|
||||
/**
|
||||
* 内容序号
|
||||
*/
|
||||
private String bizSeqNo;
|
||||
|
||||
/**
|
||||
* 订单ID
|
||||
*/
|
||||
private Long orderId;
|
||||
|
||||
/**
|
||||
* 销售内容:订单号
|
||||
*/
|
||||
private String orderCode;
|
||||
|
||||
/**
|
||||
* 销售内容:订单合同号
|
||||
*/
|
||||
private String contractCode;
|
||||
|
||||
/**
|
||||
* 销售内容:客户
|
||||
*/
|
||||
private String customerName;
|
||||
|
||||
/**
|
||||
* 销售内容:业务员
|
||||
*/
|
||||
private String salesman;
|
||||
|
||||
/**
|
||||
* 原料信息:厂家
|
||||
*/
|
||||
private String rawManufacturer;
|
||||
|
||||
/**
|
||||
* 原料信息:材质
|
||||
*/
|
||||
private String rawMaterial;
|
||||
|
||||
/**
|
||||
* 原料信息:厚度mm
|
||||
*/
|
||||
private BigDecimal rawThick;
|
||||
|
||||
/**
|
||||
* 原料信息:宽度mm
|
||||
*/
|
||||
private BigDecimal rawWidth;
|
||||
|
||||
/**
|
||||
* 原料钢卷ID
|
||||
*/
|
||||
private Long rawMaterialId;
|
||||
|
||||
/**
|
||||
* 原料卷号
|
||||
*/
|
||||
private String rawCoilNos;
|
||||
|
||||
/**
|
||||
* 钢卷位置
|
||||
*/
|
||||
private String rawLocation;
|
||||
|
||||
/**
|
||||
* 包装要求
|
||||
*/
|
||||
private String rawPackaging;
|
||||
|
||||
/**
|
||||
* 宽度要求
|
||||
*/
|
||||
private String rawEdgeReq;
|
||||
|
||||
/**
|
||||
* 镀层种类
|
||||
*/
|
||||
private String rawCoatingType;
|
||||
|
||||
/**
|
||||
* 原料净重
|
||||
*/
|
||||
private BigDecimal rawNetWeight;
|
||||
|
||||
/**
|
||||
* 成品信息:成品名称
|
||||
*/
|
||||
private String productName;
|
||||
|
||||
/**
|
||||
* 成品信息:材质
|
||||
*/
|
||||
private String productMaterial;
|
||||
|
||||
/**
|
||||
* 成品信息:镀层g
|
||||
*/
|
||||
private BigDecimal coatingG;
|
||||
|
||||
/**
|
||||
* 成品信息:成品宽度
|
||||
*/
|
||||
private BigDecimal productWidth;
|
||||
|
||||
/**
|
||||
* 成品信息:轧制厚度
|
||||
*/
|
||||
private BigDecimal rollingThick;
|
||||
|
||||
/**
|
||||
* 成品信息:标签厚度
|
||||
*/
|
||||
private BigDecimal markCoatThick;
|
||||
|
||||
/**
|
||||
* 成品信息:吨钢长度区间m
|
||||
*/
|
||||
private String tonSteelLengthRange;
|
||||
|
||||
/**
|
||||
* 成品信息:数量
|
||||
*/
|
||||
private BigDecimal planQty;
|
||||
|
||||
/**
|
||||
* 成品信息:重量
|
||||
*/
|
||||
private BigDecimal planWeight;
|
||||
|
||||
/**
|
||||
* 成品信息:表面处理
|
||||
*/
|
||||
private String surfaceTreatment;
|
||||
|
||||
/**
|
||||
* 成品信息:切边要求
|
||||
*/
|
||||
private String widthReq;
|
||||
|
||||
/**
|
||||
* 成品信息:包装要求
|
||||
*/
|
||||
private String productPackaging;
|
||||
|
||||
/**
|
||||
* 成品信息:宽度要求
|
||||
*/
|
||||
private String productEdgeReq;
|
||||
|
||||
/**
|
||||
* 成品信息:用途
|
||||
*/
|
||||
private String usageReq;
|
||||
|
||||
/**
|
||||
* 后处理
|
||||
*/
|
||||
private String postProcess;
|
||||
|
||||
/**
|
||||
* 下工序
|
||||
*/
|
||||
private String nextProcess;
|
||||
|
||||
/**
|
||||
* 取样
|
||||
*/
|
||||
private String sampleReq;
|
||||
|
||||
/**
|
||||
* 生产开始时间
|
||||
*/
|
||||
private Date startTime;
|
||||
|
||||
/**
|
||||
* 生产结束时间
|
||||
*/
|
||||
private Date endTime;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.klp.aps.domain.bo;
|
||||
|
||||
import com.klp.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
/**
|
||||
* 排产单主业务对象 aps_plan_sheet
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-03-26
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class ApsPlanSheetBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 排产单主键ID
|
||||
*/
|
||||
private Long planSheetId;
|
||||
|
||||
/**
|
||||
* 排产日期
|
||||
*/
|
||||
private Date planDate;
|
||||
|
||||
/**
|
||||
* 产线ID
|
||||
*/
|
||||
private Long lineId;
|
||||
|
||||
/**
|
||||
* 产线名称
|
||||
*/
|
||||
private String lineName;
|
||||
|
||||
/**
|
||||
* 排产单号
|
||||
*/
|
||||
private String planCode;
|
||||
|
||||
/**
|
||||
* 排产类型
|
||||
*/
|
||||
private String planType;
|
||||
|
||||
/**
|
||||
* 排产人
|
||||
*/
|
||||
private String scheduler;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,187 @@
|
||||
package com.klp.aps.domain.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.klp.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 排产单明细对象 aps_plan_detail
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-03-26
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("aps_plan_detail")
|
||||
public class ApsPlanDetail extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 排产明细主键ID
|
||||
*/
|
||||
@TableId(value = "plan_detail_id")
|
||||
private Long planDetailId;
|
||||
/**
|
||||
* 关联排产单ID
|
||||
*/
|
||||
private Long planSheetId;
|
||||
/**
|
||||
* 内容序号
|
||||
*/
|
||||
private String bizSeqNo;
|
||||
/**
|
||||
* 订单ID
|
||||
*/
|
||||
private Long orderId;
|
||||
/**
|
||||
* 销售内容:订单号
|
||||
*/
|
||||
private String orderCode;
|
||||
/**
|
||||
* 销售内容:订单合同号
|
||||
*/
|
||||
private String contractCode;
|
||||
/**
|
||||
* 销售内容:客户
|
||||
*/
|
||||
private String customerName;
|
||||
/**
|
||||
* 销售内容:业务员
|
||||
*/
|
||||
private String salesman;
|
||||
/**
|
||||
* 原料信息:厂家
|
||||
*/
|
||||
private String rawManufacturer;
|
||||
/**
|
||||
* 原料信息:材质
|
||||
*/
|
||||
private String rawMaterial;
|
||||
/**
|
||||
* 原料信息:厚度mm
|
||||
*/
|
||||
private BigDecimal rawThick;
|
||||
/**
|
||||
* 原料信息:宽度mm
|
||||
*/
|
||||
private BigDecimal rawWidth;
|
||||
/**
|
||||
* 原料钢卷ID
|
||||
*/
|
||||
private Long rawMaterialId;
|
||||
/**
|
||||
* 原料卷号
|
||||
*/
|
||||
private String rawCoilNos;
|
||||
/**
|
||||
* 钢卷位置
|
||||
*/
|
||||
private String rawLocation;
|
||||
/**
|
||||
* 包装要求
|
||||
*/
|
||||
private String rawPackaging;
|
||||
/**
|
||||
* 宽度要求
|
||||
*/
|
||||
private String rawEdgeReq;
|
||||
/**
|
||||
* 镀层种类
|
||||
*/
|
||||
private String rawCoatingType;
|
||||
/**
|
||||
* 原料净重
|
||||
*/
|
||||
private BigDecimal rawNetWeight;
|
||||
/**
|
||||
* 成品信息:成品名称
|
||||
*/
|
||||
private String productName;
|
||||
/**
|
||||
* 成品信息:材质
|
||||
*/
|
||||
private String productMaterial;
|
||||
/**
|
||||
* 成品信息:镀层g
|
||||
*/
|
||||
private BigDecimal coatingG;
|
||||
/**
|
||||
* 成品信息:成品宽度
|
||||
*/
|
||||
private BigDecimal productWidth;
|
||||
/**
|
||||
* 成品信息:轧制厚度
|
||||
*/
|
||||
private BigDecimal rollingThick;
|
||||
/**
|
||||
* 成品信息:标签厚度
|
||||
*/
|
||||
private BigDecimal markCoatThick;
|
||||
/**
|
||||
* 成品信息:吨钢长度区间m
|
||||
*/
|
||||
private String tonSteelLengthRange;
|
||||
/**
|
||||
* 成品信息:数量
|
||||
*/
|
||||
private BigDecimal planQty;
|
||||
/**
|
||||
* 成品信息:重量
|
||||
*/
|
||||
private BigDecimal planWeight;
|
||||
/**
|
||||
* 成品信息:表面处理
|
||||
*/
|
||||
private String surfaceTreatment;
|
||||
/**
|
||||
* 成品信息:切边要求
|
||||
*/
|
||||
private String widthReq;
|
||||
/**
|
||||
* 成品信息:包装要求
|
||||
*/
|
||||
private String productPackaging;
|
||||
/**
|
||||
* 成品信息:宽度要求
|
||||
*/
|
||||
private String productEdgeReq;
|
||||
/**
|
||||
* 成品信息:用途
|
||||
*/
|
||||
private String usageReq;
|
||||
/**
|
||||
* 后处理
|
||||
*/
|
||||
private String postProcess;
|
||||
/**
|
||||
* 下工序
|
||||
*/
|
||||
private String nextProcess;
|
||||
/**
|
||||
* 取样
|
||||
*/
|
||||
private String sampleReq;
|
||||
/**
|
||||
* 生产开始时间
|
||||
*/
|
||||
private Date startTime;
|
||||
/**
|
||||
* 生产结束时间
|
||||
*/
|
||||
private Date endTime;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 删除标记(0正常 1删除)
|
||||
*/
|
||||
@TableLogic
|
||||
private Long delFlag;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.klp.aps.domain.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.klp.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 排产单主对象 aps_plan_sheet
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-03-26
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("aps_plan_sheet")
|
||||
public class ApsPlanSheet extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 排产单主键ID
|
||||
*/
|
||||
@TableId(value = "plan_sheet_id")
|
||||
private Long planSheetId;
|
||||
/**
|
||||
* 排产日期
|
||||
*/
|
||||
private Date planDate;
|
||||
/**
|
||||
* 产线ID
|
||||
*/
|
||||
private Long lineId;
|
||||
/**
|
||||
* 产线名称
|
||||
*/
|
||||
private String lineName;
|
||||
/**
|
||||
* 排产单号
|
||||
*/
|
||||
private String planCode;
|
||||
/**
|
||||
* 排产类型
|
||||
*/
|
||||
private String planType;
|
||||
/**
|
||||
* 排产人
|
||||
*/
|
||||
private String scheduler;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 删除标记(0正常 1删除)
|
||||
*/
|
||||
@TableLogic
|
||||
private Long delFlag;
|
||||
|
||||
}
|
||||
260
klp-aps/src/main/java/com/klp/aps/domain/vo/ApsPlanDetailVo.java
Normal file
260
klp-aps/src/main/java/com/klp/aps/domain/vo/ApsPlanDetailVo.java
Normal file
@@ -0,0 +1,260 @@
|
||||
package com.klp.aps.domain.vo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.klp.common.annotation.ExcelDictFormat;
|
||||
import com.klp.common.convert.ExcelDictConvert;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/**
|
||||
* 排产单明细视图对象 aps_plan_detail
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-03-26
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ApsPlanDetailVo {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 排产明细主键ID
|
||||
*/
|
||||
@ExcelProperty(value = "排产明细主键ID")
|
||||
private Long planDetailId;
|
||||
|
||||
/**
|
||||
* 关联排产单ID
|
||||
*/
|
||||
@ExcelProperty(value = "关联排产单ID")
|
||||
private Long planSheetId;
|
||||
|
||||
/**
|
||||
* 内容序号
|
||||
*/
|
||||
@ExcelProperty(value = "内容序号")
|
||||
private String bizSeqNo;
|
||||
|
||||
/**
|
||||
* 订单ID
|
||||
*/
|
||||
@ExcelProperty(value = "订单ID")
|
||||
private Long orderId;
|
||||
|
||||
/**
|
||||
* 销售内容:订单号
|
||||
*/
|
||||
@ExcelProperty(value = "销售内容:订单号")
|
||||
private String orderCode;
|
||||
|
||||
/**
|
||||
* 销售内容:订单合同号
|
||||
*/
|
||||
@ExcelProperty(value = "销售内容:订单合同号")
|
||||
private String contractCode;
|
||||
|
||||
/**
|
||||
* 销售内容:客户
|
||||
*/
|
||||
@ExcelProperty(value = "销售内容:客户")
|
||||
private String customerName;
|
||||
|
||||
/**
|
||||
* 销售内容:业务员
|
||||
*/
|
||||
@ExcelProperty(value = "销售内容:业务员")
|
||||
private String salesman;
|
||||
|
||||
/**
|
||||
* 原料信息:厂家
|
||||
*/
|
||||
@ExcelProperty(value = "原料信息:厂家")
|
||||
private String rawManufacturer;
|
||||
|
||||
/**
|
||||
* 原料信息:材质
|
||||
*/
|
||||
@ExcelProperty(value = "原料信息:材质")
|
||||
private String rawMaterial;
|
||||
|
||||
/**
|
||||
* 原料信息:厚度mm
|
||||
*/
|
||||
@ExcelProperty(value = "原料信息:厚度mm")
|
||||
private BigDecimal rawThick;
|
||||
|
||||
/**
|
||||
* 原料信息:宽度mm
|
||||
*/
|
||||
@ExcelProperty(value = "原料信息:宽度mm")
|
||||
private BigDecimal rawWidth;
|
||||
|
||||
/**
|
||||
* 原料钢卷ID
|
||||
*/
|
||||
@ExcelProperty(value = "原料钢卷ID")
|
||||
private Long rawMaterialId;
|
||||
|
||||
/**
|
||||
* 原料卷号
|
||||
*/
|
||||
@ExcelProperty(value = "原料卷号")
|
||||
private String rawCoilNos;
|
||||
|
||||
/**
|
||||
* 钢卷位置
|
||||
*/
|
||||
@ExcelProperty(value = "钢卷位置")
|
||||
private String rawLocation;
|
||||
|
||||
/**
|
||||
* 包装要求
|
||||
*/
|
||||
@ExcelProperty(value = "包装要求")
|
||||
private String rawPackaging;
|
||||
|
||||
/**
|
||||
* 宽度要求
|
||||
*/
|
||||
@ExcelProperty(value = "宽度要求")
|
||||
private String rawEdgeReq;
|
||||
|
||||
/**
|
||||
* 镀层种类
|
||||
*/
|
||||
@ExcelProperty(value = "镀层种类")
|
||||
private String rawCoatingType;
|
||||
|
||||
/**
|
||||
* 原料净重
|
||||
*/
|
||||
@ExcelProperty(value = "原料净重")
|
||||
private BigDecimal rawNetWeight;
|
||||
|
||||
/**
|
||||
* 成品信息:成品名称
|
||||
*/
|
||||
@ExcelProperty(value = "成品信息:成品名称")
|
||||
private String productName;
|
||||
|
||||
/**
|
||||
* 成品信息:材质
|
||||
*/
|
||||
@ExcelProperty(value = "成品信息:材质")
|
||||
private String productMaterial;
|
||||
|
||||
/**
|
||||
* 成品信息:镀层g
|
||||
*/
|
||||
@ExcelProperty(value = "成品信息:镀层g")
|
||||
private BigDecimal coatingG;
|
||||
|
||||
/**
|
||||
* 成品信息:成品宽度
|
||||
*/
|
||||
@ExcelProperty(value = "成品信息:成品宽度")
|
||||
private BigDecimal productWidth;
|
||||
|
||||
/**
|
||||
* 成品信息:轧制厚度
|
||||
*/
|
||||
@ExcelProperty(value = "成品信息:轧制厚度")
|
||||
private BigDecimal rollingThick;
|
||||
|
||||
/**
|
||||
* 成品信息:标签厚度
|
||||
*/
|
||||
@ExcelProperty(value = "成品信息:标签厚度")
|
||||
private BigDecimal markCoatThick;
|
||||
|
||||
/**
|
||||
* 成品信息:吨钢长度区间m
|
||||
*/
|
||||
@ExcelProperty(value = "成品信息:吨钢长度区间m")
|
||||
private String tonSteelLengthRange;
|
||||
|
||||
/**
|
||||
* 成品信息:数量
|
||||
*/
|
||||
@ExcelProperty(value = "成品信息:数量")
|
||||
private BigDecimal planQty;
|
||||
|
||||
/**
|
||||
* 成品信息:重量
|
||||
*/
|
||||
@ExcelProperty(value = "成品信息:重量")
|
||||
private BigDecimal planWeight;
|
||||
|
||||
/**
|
||||
* 成品信息:表面处理
|
||||
*/
|
||||
@ExcelProperty(value = "成品信息:表面处理")
|
||||
private String surfaceTreatment;
|
||||
|
||||
/**
|
||||
* 成品信息:切边要求
|
||||
*/
|
||||
@ExcelProperty(value = "成品信息:切边要求")
|
||||
private String widthReq;
|
||||
|
||||
/**
|
||||
* 成品信息:包装要求
|
||||
*/
|
||||
@ExcelProperty(value = "成品信息:包装要求")
|
||||
private String productPackaging;
|
||||
|
||||
/**
|
||||
* 成品信息:宽度要求
|
||||
*/
|
||||
@ExcelProperty(value = "成品信息:宽度要求")
|
||||
private String productEdgeReq;
|
||||
|
||||
/**
|
||||
* 成品信息:用途
|
||||
*/
|
||||
@ExcelProperty(value = "成品信息:用途")
|
||||
private String usageReq;
|
||||
|
||||
/**
|
||||
* 后处理
|
||||
*/
|
||||
@ExcelProperty(value = "后处理")
|
||||
private String postProcess;
|
||||
|
||||
/**
|
||||
* 下工序
|
||||
*/
|
||||
@ExcelProperty(value = "下工序")
|
||||
private String nextProcess;
|
||||
|
||||
/**
|
||||
* 取样
|
||||
*/
|
||||
@ExcelProperty(value = "取样")
|
||||
private String sampleReq;
|
||||
|
||||
/**
|
||||
* 生产开始时间
|
||||
*/
|
||||
@ExcelProperty(value = "生产开始时间")
|
||||
private Date startTime;
|
||||
|
||||
/**
|
||||
* 生产结束时间
|
||||
*/
|
||||
@ExcelProperty(value = "生产结束时间")
|
||||
private Date endTime;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package com.klp.aps.domain.vo;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.klp.common.annotation.ExcelDictFormat;
|
||||
import com.klp.common.convert.ExcelDictConvert;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/**
|
||||
* 排产单主视图对象 aps_plan_sheet
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-03-26
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ApsPlanSheetVo {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 排产单主键ID
|
||||
*/
|
||||
@ExcelProperty(value = "排产单主键ID")
|
||||
private Long planSheetId;
|
||||
|
||||
/**
|
||||
* 排产日期
|
||||
*/
|
||||
@ExcelProperty(value = "排产日期")
|
||||
private Date planDate;
|
||||
|
||||
/**
|
||||
* 产线ID
|
||||
*/
|
||||
@ExcelProperty(value = "产线ID")
|
||||
private Long lineId;
|
||||
|
||||
/**
|
||||
* 产线名称
|
||||
*/
|
||||
@ExcelProperty(value = "产线名称")
|
||||
private String lineName;
|
||||
|
||||
/**
|
||||
* 排产单号
|
||||
*/
|
||||
@ExcelProperty(value = "排产单号")
|
||||
private String planCode;
|
||||
|
||||
/**
|
||||
* 排产类型
|
||||
*/
|
||||
@ExcelProperty(value = "排产类型")
|
||||
private String planType;
|
||||
|
||||
/**
|
||||
* 排产人
|
||||
*/
|
||||
@ExcelProperty(value = "排产人")
|
||||
private String scheduler;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.klp.aps.mapper;
|
||||
|
||||
import com.klp.aps.domain.entity.ApsPlanDetail;
|
||||
import com.klp.aps.domain.vo.ApsPlanDetailVo;
|
||||
import com.klp.common.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 排产单明细Mapper接口
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-03-26
|
||||
*/
|
||||
public interface ApsPlanDetailMapper extends BaseMapperPlus<ApsPlanDetailMapper, ApsPlanDetail, ApsPlanDetailVo> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.klp.aps.mapper;
|
||||
|
||||
import com.klp.aps.domain.entity.ApsPlanSheet;
|
||||
import com.klp.aps.domain.vo.ApsPlanSheetVo;
|
||||
import com.klp.common.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 排产单主Mapper接口
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-03-26
|
||||
*/
|
||||
public interface ApsPlanSheetMapper extends BaseMapperPlus<ApsPlanSheetMapper, ApsPlanSheet, ApsPlanSheetVo> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.klp.aps.service;
|
||||
|
||||
import com.klp.aps.domain.vo.ApsPlanDetailVo;
|
||||
import com.klp.aps.domain.bo.ApsPlanDetailBo;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 排产单明细Service接口
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-03-26
|
||||
*/
|
||||
public interface IApsPlanDetailService {
|
||||
|
||||
/**
|
||||
* 查询排产单明细
|
||||
*/
|
||||
ApsPlanDetailVo queryById(Long planDetailId);
|
||||
|
||||
/**
|
||||
* 查询排产单明细列表
|
||||
*/
|
||||
TableDataInfo<ApsPlanDetailVo> queryPageList(ApsPlanDetailBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询排产单明细列表
|
||||
*/
|
||||
List<ApsPlanDetailVo> queryList(ApsPlanDetailBo bo);
|
||||
|
||||
/**
|
||||
* 新增排产单明细
|
||||
*/
|
||||
Boolean insertByBo(ApsPlanDetailBo bo);
|
||||
|
||||
/**
|
||||
* 修改排产单明细
|
||||
*/
|
||||
Boolean updateByBo(ApsPlanDetailBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除排产单明细信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.klp.aps.service;
|
||||
|
||||
import com.klp.aps.domain.vo.ApsPlanSheetVo;
|
||||
import com.klp.aps.domain.bo.ApsPlanSheetBo;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 排产单主Service接口
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-03-26
|
||||
*/
|
||||
public interface IApsPlanSheetService {
|
||||
|
||||
/**
|
||||
* 查询排产单主
|
||||
*/
|
||||
ApsPlanSheetVo queryById(Long planSheetId);
|
||||
|
||||
/**
|
||||
* 查询排产单主列表
|
||||
*/
|
||||
TableDataInfo<ApsPlanSheetVo> queryPageList(ApsPlanSheetBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询排产单主列表
|
||||
*/
|
||||
List<ApsPlanSheetVo> queryList(ApsPlanSheetBo bo);
|
||||
|
||||
/**
|
||||
* 新增排产单主
|
||||
*/
|
||||
Boolean insertByBo(ApsPlanSheetBo bo);
|
||||
|
||||
/**
|
||||
* 修改排产单主
|
||||
*/
|
||||
Boolean updateByBo(ApsPlanSheetBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除排产单主信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@@ -0,0 +1,145 @@
|
||||
package com.klp.aps.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.klp.common.utils.StringUtils;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.klp.aps.domain.bo.ApsPlanDetailBo;
|
||||
import com.klp.aps.domain.vo.ApsPlanDetailVo;
|
||||
import com.klp.aps.domain.entity.ApsPlanDetail;
|
||||
import com.klp.aps.mapper.ApsPlanDetailMapper;
|
||||
import com.klp.aps.service.IApsPlanDetailService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 排产单明细Service业务层处理
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-03-26
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class ApsPlanDetailServiceImpl implements IApsPlanDetailService {
|
||||
|
||||
private final ApsPlanDetailMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询排产单明细
|
||||
*/
|
||||
@Override
|
||||
public ApsPlanDetailVo queryById(Long planDetailId){
|
||||
return baseMapper.selectVoById(planDetailId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询排产单明细列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<ApsPlanDetailVo> queryPageList(ApsPlanDetailBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<ApsPlanDetail> lqw = buildQueryWrapper(bo);
|
||||
Page<ApsPlanDetailVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询排产单明细列表
|
||||
*/
|
||||
@Override
|
||||
public List<ApsPlanDetailVo> queryList(ApsPlanDetailBo bo) {
|
||||
LambdaQueryWrapper<ApsPlanDetail> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<ApsPlanDetail> buildQueryWrapper(ApsPlanDetailBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<ApsPlanDetail> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(bo.getPlanSheetId() != null, ApsPlanDetail::getPlanSheetId, bo.getPlanSheetId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getBizSeqNo()), ApsPlanDetail::getBizSeqNo, bo.getBizSeqNo());
|
||||
lqw.eq(bo.getOrderId() != null, ApsPlanDetail::getOrderId, bo.getOrderId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getOrderCode()), ApsPlanDetail::getOrderCode, bo.getOrderCode());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getContractCode()), ApsPlanDetail::getContractCode, bo.getContractCode());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getCustomerName()), ApsPlanDetail::getCustomerName, bo.getCustomerName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSalesman()), ApsPlanDetail::getSalesman, bo.getSalesman());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getRawManufacturer()), ApsPlanDetail::getRawManufacturer, bo.getRawManufacturer());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getRawMaterial()), ApsPlanDetail::getRawMaterial, bo.getRawMaterial());
|
||||
lqw.eq(bo.getRawThick() != null, ApsPlanDetail::getRawThick, bo.getRawThick());
|
||||
lqw.eq(bo.getRawWidth() != null, ApsPlanDetail::getRawWidth, bo.getRawWidth());
|
||||
lqw.eq(bo.getRawMaterialId() != null, ApsPlanDetail::getRawMaterialId, bo.getRawMaterialId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getRawCoilNos()), ApsPlanDetail::getRawCoilNos, bo.getRawCoilNos());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getRawLocation()), ApsPlanDetail::getRawLocation, bo.getRawLocation());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getRawPackaging()), ApsPlanDetail::getRawPackaging, bo.getRawPackaging());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getRawEdgeReq()), ApsPlanDetail::getRawEdgeReq, bo.getRawEdgeReq());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getRawCoatingType()), ApsPlanDetail::getRawCoatingType, bo.getRawCoatingType());
|
||||
lqw.eq(bo.getRawNetWeight() != null, ApsPlanDetail::getRawNetWeight, bo.getRawNetWeight());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getProductName()), ApsPlanDetail::getProductName, bo.getProductName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getProductMaterial()), ApsPlanDetail::getProductMaterial, bo.getProductMaterial());
|
||||
lqw.eq(bo.getCoatingG() != null, ApsPlanDetail::getCoatingG, bo.getCoatingG());
|
||||
lqw.eq(bo.getProductWidth() != null, ApsPlanDetail::getProductWidth, bo.getProductWidth());
|
||||
lqw.eq(bo.getRollingThick() != null, ApsPlanDetail::getRollingThick, bo.getRollingThick());
|
||||
lqw.eq(bo.getMarkCoatThick() != null, ApsPlanDetail::getMarkCoatThick, bo.getMarkCoatThick());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getTonSteelLengthRange()), ApsPlanDetail::getTonSteelLengthRange, bo.getTonSteelLengthRange());
|
||||
lqw.eq(bo.getPlanQty() != null, ApsPlanDetail::getPlanQty, bo.getPlanQty());
|
||||
lqw.eq(bo.getPlanWeight() != null, ApsPlanDetail::getPlanWeight, bo.getPlanWeight());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSurfaceTreatment()), ApsPlanDetail::getSurfaceTreatment, bo.getSurfaceTreatment());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getWidthReq()), ApsPlanDetail::getWidthReq, bo.getWidthReq());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getProductPackaging()), ApsPlanDetail::getProductPackaging, bo.getProductPackaging());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getProductEdgeReq()), ApsPlanDetail::getProductEdgeReq, bo.getProductEdgeReq());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getUsageReq()), ApsPlanDetail::getUsageReq, bo.getUsageReq());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getPostProcess()), ApsPlanDetail::getPostProcess, bo.getPostProcess());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getNextProcess()), ApsPlanDetail::getNextProcess, bo.getNextProcess());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSampleReq()), ApsPlanDetail::getSampleReq, bo.getSampleReq());
|
||||
lqw.eq(bo.getStartTime() != null, ApsPlanDetail::getStartTime, bo.getStartTime());
|
||||
lqw.eq(bo.getEndTime() != null, ApsPlanDetail::getEndTime, bo.getEndTime());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增排产单明细
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(ApsPlanDetailBo bo) {
|
||||
ApsPlanDetail add = BeanUtil.toBean(bo, ApsPlanDetail.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setPlanDetailId(add.getPlanDetailId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改排产单明细
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(ApsPlanDetailBo bo) {
|
||||
ApsPlanDetail update = BeanUtil.toBean(bo, ApsPlanDetail.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(ApsPlanDetail entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除排产单明细
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
package com.klp.aps.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.klp.common.utils.StringUtils;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.klp.aps.domain.bo.ApsPlanSheetBo;
|
||||
import com.klp.aps.domain.vo.ApsPlanSheetVo;
|
||||
import com.klp.aps.domain.entity.ApsPlanSheet;
|
||||
import com.klp.aps.mapper.ApsPlanSheetMapper;
|
||||
import com.klp.aps.service.IApsPlanSheetService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 排产单主Service业务层处理
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-03-26
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class ApsPlanSheetServiceImpl implements IApsPlanSheetService {
|
||||
|
||||
private final ApsPlanSheetMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询排产单主
|
||||
*/
|
||||
@Override
|
||||
public ApsPlanSheetVo queryById(Long planSheetId){
|
||||
return baseMapper.selectVoById(planSheetId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询排产单主列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<ApsPlanSheetVo> queryPageList(ApsPlanSheetBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<ApsPlanSheet> lqw = buildQueryWrapper(bo);
|
||||
Page<ApsPlanSheetVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询排产单主列表
|
||||
*/
|
||||
@Override
|
||||
public List<ApsPlanSheetVo> queryList(ApsPlanSheetBo bo) {
|
||||
LambdaQueryWrapper<ApsPlanSheet> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<ApsPlanSheet> buildQueryWrapper(ApsPlanSheetBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<ApsPlanSheet> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(bo.getPlanDate() != null, ApsPlanSheet::getPlanDate, bo.getPlanDate());
|
||||
lqw.eq(bo.getLineId() != null, ApsPlanSheet::getLineId, bo.getLineId());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getLineName()), ApsPlanSheet::getLineName, bo.getLineName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getPlanCode()), ApsPlanSheet::getPlanCode, bo.getPlanCode());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getPlanType()), ApsPlanSheet::getPlanType, bo.getPlanType());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getScheduler()), ApsPlanSheet::getScheduler, bo.getScheduler());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增排产单主
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(ApsPlanSheetBo bo) {
|
||||
ApsPlanSheet add = BeanUtil.toBean(bo, ApsPlanSheet.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setPlanSheetId(add.getPlanSheetId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改排产单主
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(ApsPlanSheetBo bo) {
|
||||
ApsPlanSheet update = BeanUtil.toBean(bo, ApsPlanSheet.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(ApsPlanSheet entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除排产单主
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.klp.aps.mapper.ApsPlanDetailMapper">
|
||||
|
||||
<resultMap type="com.klp.aps.domain.entity.ApsPlanDetail" id="ApsPlanDetailResult">
|
||||
<result property="planDetailId" column="plan_detail_id"/>
|
||||
<result property="planSheetId" column="plan_sheet_id"/>
|
||||
<result property="bizSeqNo" column="biz_seq_no"/>
|
||||
<result property="orderId" column="order_id"/>
|
||||
<result property="orderCode" column="order_code"/>
|
||||
<result property="contractCode" column="contract_code"/>
|
||||
<result property="customerName" column="customer_name"/>
|
||||
<result property="salesman" column="salesman"/>
|
||||
<result property="rawManufacturer" column="raw_manufacturer"/>
|
||||
<result property="rawMaterial" column="raw_material"/>
|
||||
<result property="rawThick" column="raw_thick"/>
|
||||
<result property="rawWidth" column="raw_width"/>
|
||||
<result property="rawMaterialId" column="raw_material_id"/>
|
||||
<result property="rawCoilNos" column="raw_coil_nos"/>
|
||||
<result property="rawLocation" column="raw_location"/>
|
||||
<result property="rawPackaging" column="raw_packaging"/>
|
||||
<result property="rawEdgeReq" column="raw_edge_req"/>
|
||||
<result property="rawCoatingType" column="raw_coating_type"/>
|
||||
<result property="rawNetWeight" column="raw_net_weight"/>
|
||||
<result property="productName" column="product_name"/>
|
||||
<result property="productMaterial" column="product_material"/>
|
||||
<result property="coatingG" column="coating_g"/>
|
||||
<result property="productWidth" column="product_width"/>
|
||||
<result property="rollingThick" column="rolling_thick"/>
|
||||
<result property="markCoatThick" column="mark_coat_thick"/>
|
||||
<result property="tonSteelLengthRange" column="ton_steel_length_range"/>
|
||||
<result property="planQty" column="plan_qty"/>
|
||||
<result property="planWeight" column="plan_weight"/>
|
||||
<result property="surfaceTreatment" column="surface_treatment"/>
|
||||
<result property="widthReq" column="width_req"/>
|
||||
<result property="productPackaging" column="product_packaging"/>
|
||||
<result property="productEdgeReq" column="product_edge_req"/>
|
||||
<result property="usageReq" column="usage_req"/>
|
||||
<result property="postProcess" column="post_process"/>
|
||||
<result property="nextProcess" column="next_process"/>
|
||||
<result property="sampleReq" column="sample_req"/>
|
||||
<result property="startTime" column="start_time"/>
|
||||
<result property="endTime" column="end_time"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
</mapper>
|
||||
24
klp-aps/src/main/resources/mapper/aps/ApsPlanSheetMapper.xml
Normal file
24
klp-aps/src/main/resources/mapper/aps/ApsPlanSheetMapper.xml
Normal file
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.klp.aps.mapper.ApsPlanSheetMapper">
|
||||
|
||||
<resultMap type="com.klp.aps.domain.entity.ApsPlanSheet" id="ApsPlanSheetResult">
|
||||
<result property="planSheetId" column="plan_sheet_id"/>
|
||||
<result property="planDate" column="plan_date"/>
|
||||
<result property="lineId" column="line_id"/>
|
||||
<result property="lineName" column="line_name"/>
|
||||
<result property="planCode" column="plan_code"/>
|
||||
<result property="planType" column="plan_type"/>
|
||||
<result property="scheduler" column="scheduler"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user