feat(flow): 添加排产单主加明细可合并功能模块

- 创建排产单主加明细可合并的实体类 SchProdScheduleItem
- 定义业务对象 SchProdScheduleItemBo 和视图对象 SchProdScheduleItemVo
- 实现排产单主加明细可合并的服务接口 ISchProdScheduleItemService
- 开发控制器 SchProdScheduleItemController 提供 CRUD 操作接口
- 配置 MyBatis 映射器 SchProdScheduleItemMapper 和 XML 映射文件
- 实现服务层业务逻辑 SchProdScheduleItemServiceImpl
- 添加分页查询、新增、修改、删除等核心功能
- 集成 Excel 导出功能支持数据导出操作
This commit is contained in:
2026-06-26 14:14:23 +08:00
parent dc47a91d0f
commit 174cd29280
8 changed files with 948 additions and 0 deletions

View File

@@ -0,0 +1,99 @@
package com.klp.flow.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.flow.domain.vo.SchProdScheduleItemVo;
import com.klp.flow.domain.bo.SchProdScheduleItemBo;
import com.klp.flow.service.ISchProdScheduleItemService;
import com.klp.common.core.page.TableDataInfo;
/**
* 排产单主加明细可合并
*
* @author klp
* @date 2026-06-26
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/flow/prodScheduleItem")
public class SchProdScheduleItemController extends BaseController {
private final ISchProdScheduleItemService iSchProdScheduleItemService;
/**
* 查询排产单主加明细可合并列表
*/
@GetMapping("/list")
public TableDataInfo<SchProdScheduleItemVo> list(SchProdScheduleItemBo bo, PageQuery pageQuery) {
return iSchProdScheduleItemService.queryPageList(bo, pageQuery);
}
/**
* 导出排产单主加明细可合并列表
*/
@Log(title = "排产单主加明细可合并", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(SchProdScheduleItemBo bo, HttpServletResponse response) {
List<SchProdScheduleItemVo> list = iSchProdScheduleItemService.queryList(bo);
ExcelUtil.exportExcel(list, "排产单主加明细可合并", SchProdScheduleItemVo.class, response);
}
/**
* 获取排产单主加明细可合并详细信息
*
* @param scheduleId 主键
*/
@GetMapping("/{scheduleId}")
public R<SchProdScheduleItemVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long scheduleId) {
return R.ok(iSchProdScheduleItemService.queryById(scheduleId));
}
/**
* 新增排产单主加明细可合并
*/
@Log(title = "排产单主加明细可合并", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody SchProdScheduleItemBo bo) {
return toAjax(iSchProdScheduleItemService.insertByBo(bo));
}
/**
* 修改排产单主加明细可合并
*/
@Log(title = "排产单主加明细可合并", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody SchProdScheduleItemBo bo) {
return toAjax(iSchProdScheduleItemService.updateByBo(bo));
}
/**
* 删除排产单主加明细可合并
*
* @param scheduleIds 主键串
*/
@Log(title = "排产单主加明细可合并", businessType = BusinessType.DELETE)
@DeleteMapping("/{scheduleIds}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] scheduleIds) {
return toAjax(iSchProdScheduleItemService.deleteWithValidByIds(Arrays.asList(scheduleIds), true));
}
}

View File

@@ -0,0 +1,168 @@
package com.klp.flow.domain;
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;
import com.fasterxml.jackson.annotation.JsonFormat;
/**
* 排产单主加明细可合并对象 sch_prod_schedule_item
*
* @author klp
* @date 2026-06-26
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("sch_prod_schedule_item")
public class SchProdScheduleItem extends BaseEntity {
private static final long serialVersionUID=1L;
/**
* 排产单主键ID
*/
@TableId(value = "schedule_id")
private Long scheduleId;
/**
* 排产单号(唯一标识,钢卷关联依据)
*/
private String scheduleNo;
/**
* 生产日期(和合同号组成业务关联键)
*/
private Date prodDate;
/**
* 排产状态0草稿 1待审核 2已下达 3已退回
*/
private Long scheduleStatus;
/**
* 排产总计划吨数
*/
private BigDecimal totalPlanWeight;
/**
* 关联销售合同号
*/
private String relContractNo;
/**
* 业务员
*/
private String businessUser;
/**
* 联系电话
*/
private String businessPhone;
/**
* 订单日期
*/
private Date orderDate;
/**
* 订货单位
*/
private String customerName;
/**
* 交货期(天)
*/
private Long deliveryCycle;
/**
* 产品用途
*/
private String usePurpose;
/**
* 品名:冷硬钢卷/镀锌钢卷/冷轧钢卷/镀铬钢卷
*/
private String productType;
/**
* 厚度公差
*/
private String thicknessTolerance;
/**
* 宽度公差
*/
private String widthTolerance;
/**
* 表面质量
*/
private String surfaceQuality;
/**
* 表面处理
*/
private String surfaceTreatment;
/**
* 内径尺寸
*/
private String innerDiameter;
/**
* 外径要求
*/
private String outerDiameter;
/**
* 包装要求
*/
private String packReq;
/**
* 切边要求
*/
private String cutEdgeReq;
/**
* 单件重量
*/
private String singleCoilWeight;
/**
* 交货重量偏差
*/
private String weightDeviation;
/**
* 其他技术要求
*/
private String otherTechReq;
/**
* 付款情况说明
*/
private String paymentDesc;
/**
* 退回原因
*/
private String returnReason;
/**
* 排产单主表ID
*/
private String scheduleIds;
/**
* 来源销售订单明细ID溯源原始订单规格
*/
private String orderDetailIds;
/**
* 规格 例1.0X1250
*/
private String spec;
/**
* 材质 DX51D
*/
private String material;
/**
* 本次排产吨数(数量),可审核修改
*/
private BigDecimal scheduleWeight;
/**
* 品名项
*/
private String productItem;
/**
* 单行排产备注
*/
private String rowRemark;
/**
* 备注
*/
private String remark;
/**
* 删除标识 0正常 2删除
*/
@TableLogic
private Long delFlag;
}

View File

@@ -0,0 +1,194 @@
package com.klp.flow.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;
/**
* 排产单主加明细可合并业务对象 sch_prod_schedule_item
*
* @author klp
* @date 2026-06-26
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class SchProdScheduleItemBo extends BaseEntity {
/**
* 排产单主键ID
*/
private Long scheduleId;
/**
* 排产单号(唯一标识,钢卷关联依据)
*/
private String scheduleNo;
/**
* 生产日期(和合同号组成业务关联键)
*/
private Date prodDate;
/**
* 排产状态0草稿 1待审核 2已下达 3已退回
*/
private Long scheduleStatus;
/**
* 排产总计划吨数
*/
private BigDecimal totalPlanWeight;
/**
* 关联销售合同号
*/
private String relContractNo;
/**
* 业务员
*/
private String businessUser;
/**
* 联系电话
*/
private String businessPhone;
/**
* 订单日期
*/
private Date orderDate;
/**
* 订货单位
*/
private String customerName;
/**
* 交货期(天)
*/
private Long deliveryCycle;
/**
* 产品用途
*/
private String usePurpose;
/**
* 品名:冷硬钢卷/镀锌钢卷/冷轧钢卷/镀铬钢卷
*/
private String productType;
/**
* 厚度公差
*/
private String thicknessTolerance;
/**
* 宽度公差
*/
private String widthTolerance;
/**
* 表面质量
*/
private String surfaceQuality;
/**
* 表面处理
*/
private String surfaceTreatment;
/**
* 内径尺寸
*/
private String innerDiameter;
/**
* 外径要求
*/
private String outerDiameter;
/**
* 包装要求
*/
private String packReq;
/**
* 切边要求
*/
private String cutEdgeReq;
/**
* 单件重量
*/
private String singleCoilWeight;
/**
* 交货重量偏差
*/
private String weightDeviation;
/**
* 其他技术要求
*/
private String otherTechReq;
/**
* 付款情况说明
*/
private String paymentDesc;
/**
* 退回原因
*/
private String returnReason;
/**
* 排产单主表ID
*/
private String scheduleIds;
/**
* 来源销售订单明细ID溯源原始订单规格
*/
private String orderDetailIds;
/**
* 规格 例1.0X1250
*/
private String spec;
/**
* 材质 DX51D
*/
private String material;
/**
* 本次排产吨数(数量),可审核修改
*/
private BigDecimal scheduleWeight;
/**
* 品名项
*/
private String productItem;
/**
* 单行排产备注
*/
private String rowRemark;
/**
* 备注
*/
private String remark;
}

View File

@@ -0,0 +1,233 @@
package com.klp.flow.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;
/**
* 排产单主加明细可合并视图对象 sch_prod_schedule_item
*
* @author klp
* @date 2026-06-26
*/
@Data
@ExcelIgnoreUnannotated
public class SchProdScheduleItemVo {
private static final long serialVersionUID = 1L;
/**
* 排产单主键ID
*/
@ExcelProperty(value = "排产单主键ID")
private Long scheduleId;
/**
* 排产单号(唯一标识,钢卷关联依据)
*/
@ExcelProperty(value = "排产单号", converter = ExcelDictConvert.class)
@ExcelDictFormat(readConverterExp = "唯=一标识,钢卷关联依据")
private String scheduleNo;
/**
* 生产日期(和合同号组成业务关联键)
*/
@ExcelProperty(value = "生产日期", converter = ExcelDictConvert.class)
@ExcelDictFormat(readConverterExp = "和=合同号组成业务关联键")
private Date prodDate;
/**
* 排产状态0草稿 1待审核 2已下达 3已退回
*/
@ExcelProperty(value = "排产状态0草稿 1待审核 2已下达 3已退回")
private Long scheduleStatus;
/**
* 排产总计划吨数
*/
@ExcelProperty(value = "排产总计划吨数")
private BigDecimal totalPlanWeight;
/**
* 关联销售合同号
*/
@ExcelProperty(value = "关联销售合同号")
private String relContractNo;
/**
* 业务员
*/
@ExcelProperty(value = "业务员")
private String businessUser;
/**
* 联系电话
*/
@ExcelProperty(value = "联系电话")
private String businessPhone;
/**
* 订单日期
*/
@ExcelProperty(value = "订单日期")
private Date orderDate;
/**
* 订货单位
*/
@ExcelProperty(value = "订货单位")
private String customerName;
/**
* 交货期(天)
*/
@ExcelProperty(value = "交货期(天)")
private Long deliveryCycle;
/**
* 产品用途
*/
@ExcelProperty(value = "产品用途")
private String usePurpose;
/**
* 品名:冷硬钢卷/镀锌钢卷/冷轧钢卷/镀铬钢卷
*/
@ExcelProperty(value = "品名:冷硬钢卷/镀锌钢卷/冷轧钢卷/镀铬钢卷")
private String productType;
/**
* 厚度公差
*/
@ExcelProperty(value = "厚度公差")
private String thicknessTolerance;
/**
* 宽度公差
*/
@ExcelProperty(value = "宽度公差")
private String widthTolerance;
/**
* 表面质量
*/
@ExcelProperty(value = "表面质量")
private String surfaceQuality;
/**
* 表面处理
*/
@ExcelProperty(value = "表面处理")
private String surfaceTreatment;
/**
* 内径尺寸
*/
@ExcelProperty(value = "内径尺寸")
private String innerDiameter;
/**
* 外径要求
*/
@ExcelProperty(value = "外径要求")
private String outerDiameter;
/**
* 包装要求
*/
@ExcelProperty(value = "包装要求")
private String packReq;
/**
* 切边要求
*/
@ExcelProperty(value = "切边要求")
private String cutEdgeReq;
/**
* 单件重量
*/
@ExcelProperty(value = "单件重量")
private String singleCoilWeight;
/**
* 交货重量偏差
*/
@ExcelProperty(value = "交货重量偏差")
private String weightDeviation;
/**
* 其他技术要求
*/
@ExcelProperty(value = "其他技术要求")
private String otherTechReq;
/**
* 付款情况说明
*/
@ExcelProperty(value = "付款情况说明")
private String paymentDesc;
/**
* 退回原因
*/
@ExcelProperty(value = "退回原因")
private String returnReason;
/**
* 排产单主表ID
*/
@ExcelProperty(value = "排产单主表ID")
private String scheduleIds;
/**
* 来源销售订单明细ID溯源原始订单规格
*/
@ExcelProperty(value = "来源销售订单明细ID", converter = ExcelDictConvert.class)
@ExcelDictFormat(readConverterExp = "溯=源原始订单规格")
private String orderDetailIds;
/**
* 规格 例1.0X1250
*/
@ExcelProperty(value = "规格 例1.0X1250")
private String spec;
/**
* 材质 DX51D
*/
@ExcelProperty(value = "材质 DX51D")
private String material;
/**
* 本次排产吨数(数量),可审核修改
*/
@ExcelProperty(value = "本次排产吨数(数量),可审核修改")
private BigDecimal scheduleWeight;
/**
* 品名项
*/
@ExcelProperty(value = "品名项")
private String productItem;
/**
* 单行排产备注
*/
@ExcelProperty(value = "单行排产备注")
private String rowRemark;
/**
* 备注
*/
@ExcelProperty(value = "备注")
private String remark;
}

View File

@@ -0,0 +1,15 @@
package com.klp.flow.mapper;
import com.klp.flow.domain.SchProdScheduleItem;
import com.klp.flow.domain.vo.SchProdScheduleItemVo;
import com.klp.common.core.mapper.BaseMapperPlus;
/**
* 排产单主加明细可合并Mapper接口
*
* @author klp
* @date 2026-06-26
*/
public interface SchProdScheduleItemMapper extends BaseMapperPlus<SchProdScheduleItemMapper, SchProdScheduleItem, SchProdScheduleItemVo> {
}

View File

@@ -0,0 +1,49 @@
package com.klp.flow.service;
import com.klp.flow.domain.SchProdScheduleItem;
import com.klp.flow.domain.vo.SchProdScheduleItemVo;
import com.klp.flow.domain.bo.SchProdScheduleItemBo;
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-06-26
*/
public interface ISchProdScheduleItemService {
/**
* 查询排产单主加明细可合并
*/
SchProdScheduleItemVo queryById(Long scheduleId);
/**
* 查询排产单主加明细可合并列表
*/
TableDataInfo<SchProdScheduleItemVo> queryPageList(SchProdScheduleItemBo bo, PageQuery pageQuery);
/**
* 查询排产单主加明细可合并列表
*/
List<SchProdScheduleItemVo> queryList(SchProdScheduleItemBo bo);
/**
* 新增排产单主加明细可合并
*/
Boolean insertByBo(SchProdScheduleItemBo bo);
/**
* 修改排产单主加明细可合并
*/
Boolean updateByBo(SchProdScheduleItemBo bo);
/**
* 校验并批量删除排产单主加明细可合并信息
*/
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
}

View File

@@ -0,0 +1,140 @@
package com.klp.flow.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.flow.domain.bo.SchProdScheduleItemBo;
import com.klp.flow.domain.vo.SchProdScheduleItemVo;
import com.klp.flow.domain.SchProdScheduleItem;
import com.klp.flow.mapper.SchProdScheduleItemMapper;
import com.klp.flow.service.ISchProdScheduleItemService;
import java.util.List;
import java.util.Map;
import java.util.Collection;
/**
* 排产单主加明细可合并Service业务层处理
*
* @author klp
* @date 2026-06-26
*/
@RequiredArgsConstructor
@Service
public class SchProdScheduleItemServiceImpl implements ISchProdScheduleItemService {
private final SchProdScheduleItemMapper baseMapper;
/**
* 查询排产单主加明细可合并
*/
@Override
public SchProdScheduleItemVo queryById(Long scheduleId){
return baseMapper.selectVoById(scheduleId);
}
/**
* 查询排产单主加明细可合并列表
*/
@Override
public TableDataInfo<SchProdScheduleItemVo> queryPageList(SchProdScheduleItemBo bo, PageQuery pageQuery) {
LambdaQueryWrapper<SchProdScheduleItem> lqw = buildQueryWrapper(bo);
Page<SchProdScheduleItemVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
return TableDataInfo.build(result);
}
/**
* 查询排产单主加明细可合并列表
*/
@Override
public List<SchProdScheduleItemVo> queryList(SchProdScheduleItemBo bo) {
LambdaQueryWrapper<SchProdScheduleItem> lqw = buildQueryWrapper(bo);
return baseMapper.selectVoList(lqw);
}
private LambdaQueryWrapper<SchProdScheduleItem> buildQueryWrapper(SchProdScheduleItemBo bo) {
Map<String, Object> params = bo.getParams();
LambdaQueryWrapper<SchProdScheduleItem> lqw = Wrappers.lambdaQuery();
lqw.eq(StringUtils.isNotBlank(bo.getScheduleNo()), SchProdScheduleItem::getScheduleNo, bo.getScheduleNo());
lqw.eq(bo.getProdDate() != null, SchProdScheduleItem::getProdDate, bo.getProdDate());
lqw.eq(bo.getScheduleStatus() != null, SchProdScheduleItem::getScheduleStatus, bo.getScheduleStatus());
lqw.eq(bo.getTotalPlanWeight() != null, SchProdScheduleItem::getTotalPlanWeight, bo.getTotalPlanWeight());
lqw.eq(StringUtils.isNotBlank(bo.getRelContractNo()), SchProdScheduleItem::getRelContractNo, bo.getRelContractNo());
lqw.eq(StringUtils.isNotBlank(bo.getBusinessUser()), SchProdScheduleItem::getBusinessUser, bo.getBusinessUser());
lqw.eq(StringUtils.isNotBlank(bo.getBusinessPhone()), SchProdScheduleItem::getBusinessPhone, bo.getBusinessPhone());
lqw.eq(bo.getOrderDate() != null, SchProdScheduleItem::getOrderDate, bo.getOrderDate());
lqw.like(StringUtils.isNotBlank(bo.getCustomerName()), SchProdScheduleItem::getCustomerName, bo.getCustomerName());
lqw.eq(bo.getDeliveryCycle() != null, SchProdScheduleItem::getDeliveryCycle, bo.getDeliveryCycle());
lqw.eq(StringUtils.isNotBlank(bo.getUsePurpose()), SchProdScheduleItem::getUsePurpose, bo.getUsePurpose());
lqw.eq(StringUtils.isNotBlank(bo.getProductType()), SchProdScheduleItem::getProductType, bo.getProductType());
lqw.eq(StringUtils.isNotBlank(bo.getThicknessTolerance()), SchProdScheduleItem::getThicknessTolerance, bo.getThicknessTolerance());
lqw.eq(StringUtils.isNotBlank(bo.getWidthTolerance()), SchProdScheduleItem::getWidthTolerance, bo.getWidthTolerance());
lqw.eq(StringUtils.isNotBlank(bo.getSurfaceQuality()), SchProdScheduleItem::getSurfaceQuality, bo.getSurfaceQuality());
lqw.eq(StringUtils.isNotBlank(bo.getSurfaceTreatment()), SchProdScheduleItem::getSurfaceTreatment, bo.getSurfaceTreatment());
lqw.eq(StringUtils.isNotBlank(bo.getInnerDiameter()), SchProdScheduleItem::getInnerDiameter, bo.getInnerDiameter());
lqw.eq(StringUtils.isNotBlank(bo.getOuterDiameter()), SchProdScheduleItem::getOuterDiameter, bo.getOuterDiameter());
lqw.eq(StringUtils.isNotBlank(bo.getPackReq()), SchProdScheduleItem::getPackReq, bo.getPackReq());
lqw.eq(StringUtils.isNotBlank(bo.getCutEdgeReq()), SchProdScheduleItem::getCutEdgeReq, bo.getCutEdgeReq());
lqw.eq(StringUtils.isNotBlank(bo.getSingleCoilWeight()), SchProdScheduleItem::getSingleCoilWeight, bo.getSingleCoilWeight());
lqw.eq(StringUtils.isNotBlank(bo.getWeightDeviation()), SchProdScheduleItem::getWeightDeviation, bo.getWeightDeviation());
lqw.eq(StringUtils.isNotBlank(bo.getOtherTechReq()), SchProdScheduleItem::getOtherTechReq, bo.getOtherTechReq());
lqw.eq(StringUtils.isNotBlank(bo.getPaymentDesc()), SchProdScheduleItem::getPaymentDesc, bo.getPaymentDesc());
lqw.eq(StringUtils.isNotBlank(bo.getReturnReason()), SchProdScheduleItem::getReturnReason, bo.getReturnReason());
lqw.eq(StringUtils.isNotBlank(bo.getScheduleIds()), SchProdScheduleItem::getScheduleIds, bo.getScheduleIds());
lqw.eq(StringUtils.isNotBlank(bo.getOrderDetailIds()), SchProdScheduleItem::getOrderDetailIds, bo.getOrderDetailIds());
lqw.eq(StringUtils.isNotBlank(bo.getSpec()), SchProdScheduleItem::getSpec, bo.getSpec());
lqw.eq(StringUtils.isNotBlank(bo.getMaterial()), SchProdScheduleItem::getMaterial, bo.getMaterial());
lqw.eq(bo.getScheduleWeight() != null, SchProdScheduleItem::getScheduleWeight, bo.getScheduleWeight());
lqw.eq(StringUtils.isNotBlank(bo.getProductItem()), SchProdScheduleItem::getProductItem, bo.getProductItem());
lqw.eq(StringUtils.isNotBlank(bo.getRowRemark()), SchProdScheduleItem::getRowRemark, bo.getRowRemark());
return lqw;
}
/**
* 新增排产单主加明细可合并
*/
@Override
public Boolean insertByBo(SchProdScheduleItemBo bo) {
SchProdScheduleItem add = BeanUtil.toBean(bo, SchProdScheduleItem.class);
validEntityBeforeSave(add);
boolean flag = baseMapper.insert(add) > 0;
if (flag) {
bo.setScheduleId(add.getScheduleId());
}
return flag;
}
/**
* 修改排产单主加明细可合并
*/
@Override
public Boolean updateByBo(SchProdScheduleItemBo bo) {
SchProdScheduleItem update = BeanUtil.toBean(bo, SchProdScheduleItem.class);
validEntityBeforeSave(update);
return baseMapper.updateById(update) > 0;
}
/**
* 保存前的数据校验
*/
private void validEntityBeforeSave(SchProdScheduleItem entity){
//TODO 做一些数据校验,如唯一约束
}
/**
* 批量删除排产单主加明细可合并
*/
@Override
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
if(isValid){
//TODO 做一些业务上的校验,判断是否需要校验
}
return baseMapper.deleteBatchIds(ids) > 0;
}
}

View File

@@ -0,0 +1,50 @@
<?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.flow.mapper.SchProdScheduleItemMapper">
<resultMap type="com.klp.flow.domain.SchProdScheduleItem" id="SchProdScheduleItemResult">
<result property="scheduleId" column="schedule_id"/>
<result property="scheduleNo" column="schedule_no"/>
<result property="prodDate" column="prod_date"/>
<result property="scheduleStatus" column="schedule_status"/>
<result property="totalPlanWeight" column="total_plan_weight"/>
<result property="relContractNo" column="rel_contract_no"/>
<result property="businessUser" column="business_user"/>
<result property="businessPhone" column="business_phone"/>
<result property="orderDate" column="order_date"/>
<result property="customerName" column="customer_name"/>
<result property="deliveryCycle" column="delivery_cycle"/>
<result property="usePurpose" column="use_purpose"/>
<result property="productType" column="product_type"/>
<result property="thicknessTolerance" column="thickness_tolerance"/>
<result property="widthTolerance" column="width_tolerance"/>
<result property="surfaceQuality" column="surface_quality"/>
<result property="surfaceTreatment" column="surface_treatment"/>
<result property="innerDiameter" column="inner_diameter"/>
<result property="outerDiameter" column="outer_diameter"/>
<result property="packReq" column="pack_req"/>
<result property="cutEdgeReq" column="cut_edge_req"/>
<result property="singleCoilWeight" column="single_coil_weight"/>
<result property="weightDeviation" column="weight_deviation"/>
<result property="otherTechReq" column="other_tech_req"/>
<result property="paymentDesc" column="payment_desc"/>
<result property="returnReason" column="return_reason"/>
<result property="scheduleIds" column="schedule_ids"/>
<result property="orderDetailIds" column="order_detail_ids"/>
<result property="spec" column="spec"/>
<result property="material" column="material"/>
<result property="scheduleWeight" column="schedule_weight"/>
<result property="productItem" column="product_item"/>
<result property="rowRemark" column="row_remark"/>
<result property="remark" column="remark"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="delFlag" column="del_flag"/>
</resultMap>
</mapper>