update 生产订单、生产计划代码生成

master
yinq 1 week ago
parent dfe9aa755c
commit 2dafc80207

@ -0,0 +1,117 @@
package org.dromara.mes.controller;
import java.util.List;
import lombok.RequiredArgsConstructor;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.constraints.*;
import cn.dev33.satoken.annotation.SaCheckPermission;
import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated;
import org.dromara.common.idempotent.annotation.RepeatSubmit;
import org.dromara.common.log.annotation.Log;
import org.dromara.common.web.core.BaseController;
import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.core.domain.R;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import org.dromara.common.log.enums.BusinessType;
import org.dromara.common.excel.utils.ExcelUtil;
import org.dromara.mes.domain.vo.ProdOrderInfoVo;
import org.dromara.mes.domain.bo.ProdOrderInfoBo;
import org.dromara.mes.service.IProdOrderInfoService;
import org.dromara.common.mybatis.core.page.TableDataInfo;
/**
*
* 访:/mes/orderInfo
*
* @author Yinq
* @date 2025-01-09
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/orderInfo")
public class ProdOrderInfoController extends BaseController {
private final IProdOrderInfoService prodOrderInfoService;
/**
*
*/
@SaCheckPermission("mes:orderInfo:list")
@GetMapping("/list")
public TableDataInfo<ProdOrderInfoVo> list(ProdOrderInfoBo bo, PageQuery pageQuery) {
return prodOrderInfoService.queryPageList(bo, pageQuery);
}
/**
*
*/
@SaCheckPermission("mes:orderInfo:export")
@Log(title = "生产订单信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(ProdOrderInfoBo bo, HttpServletResponse response) {
List<ProdOrderInfoVo> list = prodOrderInfoService.queryList(bo);
ExcelUtil.exportExcel(list, "生产订单信息", ProdOrderInfoVo.class, response);
}
/**
*
*
* @param productOrderId
*/
@SaCheckPermission("mes:orderInfo:query")
@GetMapping("/{productOrderId}")
public R<ProdOrderInfoVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long productOrderId) {
return R.ok(prodOrderInfoService.queryById(productOrderId));
}
/**
*
*/
@SaCheckPermission("mes:orderInfo:add")
@Log(title = "生产订单信息", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody ProdOrderInfoBo bo) {
return toAjax(prodOrderInfoService.insertByBo(bo));
}
/**
*
*/
@SaCheckPermission("mes:orderInfo:edit")
@Log(title = "生产订单信息", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody ProdOrderInfoBo bo) {
return toAjax(prodOrderInfoService.updateByBo(bo));
}
/**
*
*
* @param productOrderIds
*/
@SaCheckPermission("mes:orderInfo:remove")
@Log(title = "生产订单信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{productOrderIds}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] productOrderIds) {
return toAjax(prodOrderInfoService.deleteWithValidByIds(List.of(productOrderIds), true));
}
/**
*
*/
@GetMapping("getProdOrderInfoList")
public R<List<ProdOrderInfoVo>> getProdOrderInfolist(ProdOrderInfoBo bo) {
List<ProdOrderInfoVo> list = prodOrderInfoService.queryList(bo);
return R.ok(list);
}
}

@ -0,0 +1,117 @@
package org.dromara.mes.controller;
import java.util.List;
import lombok.RequiredArgsConstructor;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.constraints.*;
import cn.dev33.satoken.annotation.SaCheckPermission;
import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated;
import org.dromara.common.idempotent.annotation.RepeatSubmit;
import org.dromara.common.log.annotation.Log;
import org.dromara.common.web.core.BaseController;
import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.core.domain.R;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import org.dromara.common.log.enums.BusinessType;
import org.dromara.common.excel.utils.ExcelUtil;
import org.dromara.mes.domain.vo.ProdPlanInfoVo;
import org.dromara.mes.domain.bo.ProdPlanInfoBo;
import org.dromara.mes.service.IProdPlanInfoService;
import org.dromara.common.mybatis.core.page.TableDataInfo;
/**
*
* 访:/mes/planInfo
*
* @author Yinq
* @date 2025-01-09
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/planInfo")
public class ProdPlanInfoController extends BaseController {
private final IProdPlanInfoService prodPlanInfoService;
/**
*
*/
@SaCheckPermission("mes:planInfo:list")
@GetMapping("/list")
public TableDataInfo<ProdPlanInfoVo> list(ProdPlanInfoBo bo, PageQuery pageQuery) {
return prodPlanInfoService.queryPageList(bo, pageQuery);
}
/**
*
*/
@SaCheckPermission("mes:planInfo:export")
@Log(title = "生产工单信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(ProdPlanInfoBo bo, HttpServletResponse response) {
List<ProdPlanInfoVo> list = prodPlanInfoService.queryList(bo);
ExcelUtil.exportExcel(list, "生产工单信息", ProdPlanInfoVo.class, response);
}
/**
*
*
* @param planId
*/
@SaCheckPermission("mes:planInfo:query")
@GetMapping("/{planId}")
public R<ProdPlanInfoVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long planId) {
return R.ok(prodPlanInfoService.queryById(planId));
}
/**
*
*/
@SaCheckPermission("mes:planInfo:add")
@Log(title = "生产工单信息", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody ProdPlanInfoBo bo) {
return toAjax(prodPlanInfoService.insertByBo(bo));
}
/**
*
*/
@SaCheckPermission("mes:planInfo:edit")
@Log(title = "生产工单信息", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody ProdPlanInfoBo bo) {
return toAjax(prodPlanInfoService.updateByBo(bo));
}
/**
*
*
* @param planIds
*/
@SaCheckPermission("mes:planInfo:remove")
@Log(title = "生产工单信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{planIds}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] planIds) {
return toAjax(prodPlanInfoService.deleteWithValidByIds(List.of(planIds), true));
}
/**
*
*/
@GetMapping("getProdPlanInfoList")
public R<List<ProdPlanInfoVo>> getProdPlanInfolist(ProdPlanInfoBo bo) {
List<ProdPlanInfoVo> list = prodPlanInfoService.queryList(bo);
return R.ok(list);
}
}

@ -0,0 +1,168 @@
package org.dromara.mes.domain;
import org.dromara.common.tenant.core.TenantEntity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serial;
/**
* prod_order_info
*
* @author Yinq
* @date 2025-01-09
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("prod_order_info")
public class ProdOrderInfo extends TenantEntity {
@Serial
private static final long serialVersionUID = 1L;
/**
*
*/
@TableId(value = "product_order_id", type = IdType.AUTO)
private Long productOrderId;
/**
*
*/
private String orderCode;
/**
* ID
*/
private Long saleOrderId;
/**
*
*/
private String projectNo;
/**
* 1 2)
*/
private String orderType;
/**
* ID
*/
private Long materialId;
/**
* BOM_ID;bom
*/
private Long materialBomId;
/**
* (1线 2线 3)
*/
private String dispatchType;
/**
* ID;线线线线
*/
private Long dispatchId;
/**
* ;
*/
private Long saleAmount;
/**
*
*/
private Date planDeliveryDate;
/**
*
*/
private Long planAmount;
/**
* ;线线
*/
private Long dispatchAmount;
/**
*
*/
private Long completeAmount;
/**
*
*/
private Date releaseTime;
/**
*
*/
private Date planBeginTime;
/**
*
*/
private Date planEndTime;
/**
*
*/
private Date realBeginTime;
/**
*
*/
private Date realEndTime;
/**
* 0 1 2 3 4 8 9
*/
private String orderStatus;
/**
* 1 0
*/
private String stockLockFlag;
/**
* ID
*/
private Long preOrderId;
/**
*
*/
private String preOrderCode;
/**
* 0 1 2
*/
private String finishFlag;
/**
* 1 0
*/
private String releaseFlag;
/**
*
*/
private String orderVersion;
/**
* ID
*/
private Long factoryId;
/**
*
*/
private String remark;
}

@ -0,0 +1,183 @@
package org.dromara.mes.domain;
import org.dromara.common.tenant.core.TenantEntity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serial;
/**
* prod_plan_info
*
* @author Yinq
* @date 2025-01-09
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("prod_plan_info")
public class ProdPlanInfo extends TenantEntity {
@Serial
private static final long serialVersionUID = 1L;
/**
*
*/
@TableId(value = "plan_id", type = IdType.AUTO)
private Long planId;
/**
* ID
*/
private Long productOrderId;
/**
* ID
*/
private Long saleOrderId;
/**
*
*/
private String saleorderCode;
/**
*
*/
private String planCode;
/**
*
*/
private String dispatchCode;
/**
* ID;ID
*/
private Long materialId;
/**
* BOM_ID
*/
private Long materialBomId;
/**
* ID
*/
private Long processId;
/**
* ;线
*/
private Long processOrder;
/**
* ID
*/
private Long lastProcessId;
/**
* (1 0)
*/
private String finalProcessFlag;
/**
* (1 2 3)
*/
private String releaseType;
/**
* ID;
*/
private Long releaseId;
/**
* ()
*/
private Long productionTime;
/**
*
*/
private Long planAmount;
/**
*
*/
private Long dispatchAmount;
/**
*
*/
private Long completeAmount;
/**
*
*/
private Date planBeginTime;
/**
*
*/
private Date planEndTime;
/**
*
*/
private Date realBeginTime;
/**
*
*/
private Date realEndTime;
/**
* ;,
*/
private String attachId;
/**
* 0 1 2 3
*/
private String planStatus;
/**
* 0 1ERP
*/
private String importFlag;
/**
* 0 1 2
*/
private String finishFlag;
/**
*
*/
private Long priority;
/**
* ID
*/
private Long shiftId;
/**
* ID
*/
private Long classTeamId;
/**
* L R
*/
private String modelCode;
/**
*
*/
private String remark;
}

@ -0,0 +1,175 @@
package org.dromara.mes.domain.bo;
import org.dromara.mes.domain.ProdOrderInfo;
import org.dromara.common.mybatis.core.domain.BaseEntity;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import lombok.EqualsAndHashCode;
import jakarta.validation.constraints.*;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
/**
* prod_order_info
*
* @author Yinq
* @date 2025-01-09
*/
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = ProdOrderInfo.class, reverseConvertGenerate = false)
public class ProdOrderInfoBo extends BaseEntity {
/**
*
*/
private Long productOrderId;
/**
*
*/
@NotBlank(message = "订单编号不能为空", groups = {AddGroup.class, EditGroup.class})
private String orderCode;
/**
* ID
*/
private Long saleOrderId;
/**
*
*/
private String projectNo;
/**
* 1 2)
*/
private String orderType;
/**
* ID
*/
@NotNull(message = "物料ID不能为空", groups = {AddGroup.class, EditGroup.class})
private Long materialId;
/**
* BOM_ID;bom
*/
// @NotNull(message = "物料BOM_ID;默认选择最新的正常状态的bom可修改不能为空", groups = {AddGroup.class, EditGroup.class})
private Long materialBomId;
/**
* (1线 2线 3)
*/
@NotBlank(message = "派工类型(1产线 2工艺路线 3工序)不能为空", groups = {AddGroup.class, EditGroup.class})
private String dispatchType;
/**
* ID;线线线线
*/
// @NotNull(message = "派工ID;(派工类型为产线关联产线主键,派工类型为工艺路线关联工艺路线主键)不能为空", groups = {AddGroup.class, EditGroup.class})
private Long dispatchId;
/**
* ;
*/
// @NotNull(message = "销售数量;销售订单的销售数量,如果无订单则需要输入不能为空", groups = {AddGroup.class, EditGroup.class})
private Long saleAmount;
/**
*
*/
private Date planDeliveryDate;
/**
*
*/
@NotNull(message = "计划数量不能为空", groups = {AddGroup.class, EditGroup.class})
private Long planAmount;
/**
* ;线线
*/
private Long dispatchAmount;
/**
*
*/
private Long completeAmount;
/**
*
*/
private Date releaseTime;
/**
*
*/
private Date planBeginTime;
/**
*
*/
private Date planEndTime;
/**
*
*/
private Date realBeginTime;
/**
*
*/
private Date realEndTime;
/**
* 0 1 2 3 4 8 9
*/
private String orderStatus;
/**
* 1 0
*/
private String stockLockFlag;
/**
* ID
*/
private Long preOrderId;
/**
*
*/
private String preOrderCode;
/**
* 0 1 2
*/
private String finishFlag;
/**
* 1 0
*/
private String releaseFlag;
/**
*
*/
private String orderVersion;
/**
* ID
*/
private Long factoryId;
/**
*
*/
private String remark;
}

@ -0,0 +1,186 @@
package org.dromara.mes.domain.bo;
import org.dromara.mes.domain.ProdPlanInfo;
import org.dromara.common.mybatis.core.domain.BaseEntity;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import lombok.EqualsAndHashCode;
import jakarta.validation.constraints.*;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
/**
* prod_plan_info
*
* @author Yinq
* @date 2025-01-09
*/
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = ProdPlanInfo.class, reverseConvertGenerate = false)
public class ProdPlanInfoBo extends BaseEntity {
/**
*
*/
private Long planId;
/**
* ID
*/
private Long productOrderId;
/**
* ID
*/
private Long saleOrderId;
/**
*
*/
private String saleorderCode;
/**
*
*/
@NotBlank(message = "工单编号不能为空", groups = { AddGroup.class, EditGroup.class })
private String planCode;
/**
*
*/
private String dispatchCode;
/**
* ID;ID
*/
@NotNull(message = "物料ID;成品ID不能为空", groups = { AddGroup.class, EditGroup.class })
private Long materialId;
/**
* BOM_ID
*/
@NotNull(message = "物料BOM_ID不能为空", groups = { AddGroup.class, EditGroup.class })
private Long materialBomId;
/**
* ID
*/
private Long processId;
/**
* ;线
*/
private Long processOrder;
/**
* ID
*/
private Long lastProcessId;
/**
* (1 0)
*/
private String finalProcessFlag;
/**
* (1 2 3)
*/
private String releaseType;
/**
* ID;
*/
private Long releaseId;
/**
* ()
*/
private Long productionTime;
/**
*
*/
@NotNull(message = "工单计划数量不能为空", groups = { AddGroup.class, EditGroup.class })
private Long planAmount;
/**
*
*/
@NotNull(message = "派工数量不能为空", groups = { AddGroup.class, EditGroup.class })
private Long dispatchAmount;
/**
*
*/
private Long completeAmount;
/**
*
*/
private Date planBeginTime;
/**
*
*/
private Date planEndTime;
/**
*
*/
private Date realBeginTime;
/**
*
*/
private Date realEndTime;
/**
* ;,
*/
private String attachId;
/**
* 0 1 2 3
*/
private String planStatus;
/**
* 0 1ERP
*/
private String importFlag;
/**
* 0 1 2
*/
private String finishFlag;
/**
*
*/
private Long priority;
/**
* ID
*/
private Long shiftId;
/**
* ID
*/
private Long classTeamId;
/**
* L R
*/
private String modelCode;
/**
*
*/
private String remark;
}

@ -0,0 +1,209 @@
package org.dromara.mes.domain.vo;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.dromara.mes.domain.ProdOrderInfo;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import org.dromara.common.excel.annotation.ExcelDictFormat;
import org.dromara.common.excel.convert.ExcelDictConvert;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
/**
* prod_order_info
*
* @author Yinq
* @date 2025-01-09
*/
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = ProdOrderInfo.class)
public class ProdOrderInfoVo implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
*
*/
@ExcelProperty(value = "主键标识")
private Long productOrderId;
/**
*
*/
@ExcelProperty(value = "订单编号")
private String orderCode;
/**
* ID
*/
@ExcelProperty(value = "销售订单ID")
private Long saleOrderId;
/**
*
*/
@ExcelProperty(value = "项目编号")
private String projectNo;
/**
* 1 2)
*/
@ExcelProperty(value = "订单类型", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = "mes_order_type")
private String orderType;
/**
* ID
*/
@ExcelProperty(value = "物料ID")
private Long materialId;
/**
* BOM_ID;bom
*/
@ExcelProperty(value = "物料BOM_ID;默认选择最新的正常状态的bom可修改")
private Long materialBomId;
/**
* (1线 2线 3)
*/
@ExcelProperty(value = "派工类型(1产线 2工艺路线 3工序)", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = "mes_dispatch_type")
private String dispatchType;
/**
* ID;线线线线
*/
@ExcelProperty(value = "派工ID;", converter = ExcelDictConvert.class)
@ExcelDictFormat(readConverterExp = "派=工类型为产线关联产线主键,派工类型为工艺路线关联工艺路线主键")
private Long dispatchId;
/**
* ;
*/
@ExcelProperty(value = "销售数量;销售订单的销售数量,如果无订单则需要输入")
private Long saleAmount;
/**
*
*/
@ExcelProperty(value = "计划交货日期")
private Date planDeliveryDate;
/**
*
*/
@ExcelProperty(value = "计划数量")
private Long planAmount;
/**
* ;线线
*/
@ExcelProperty(value = "已派工数量;派工类型是工艺路线的每个工位派工数量相同,派工类型是产线的派工数量是所有工位累加的")
private Long dispatchAmount;
/**
*
*/
@ExcelProperty(value = "完成数量")
private Long completeAmount;
/**
*
*/
@ExcelProperty(value = "发布时间")
private Date releaseTime;
/**
*
*/
@ExcelProperty(value = "计划开始时间")
private Date planBeginTime;
/**
*
*/
@ExcelProperty(value = "计划结束时间")
private Date planEndTime;
/**
*
*/
@ExcelProperty(value = "开始时间")
private Date realBeginTime;
/**
*
*/
@ExcelProperty(value = "完成时间")
private Date realEndTime;
/**
* 0 1 2 3 4 8 9
*/
@ExcelProperty(value = "订单状态", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = "mes_order_status")
private String orderStatus;
/**
* 1 0
*/
@ExcelProperty(value = "库存锁定标识", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = "mes_stock_lock_flag")
private String stockLockFlag;
/**
* ID
*/
@ExcelProperty(value = "前置生产订单ID")
private Long preOrderId;
/**
*
*/
@ExcelProperty(value = "前置订单编号")
private String preOrderCode;
/**
* 0 1 2
*/
@ExcelProperty(value = "完成标识", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = "mes_finish_flag")
private String finishFlag;
/**
* 1 0
*/
@ExcelProperty(value = "是否已下达工单", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = "mes_release_flag")
private String releaseFlag;
/**
*
*/
@ExcelProperty(value = "订单版本")
private String orderVersion;
/**
* ID
*/
@ExcelProperty(value = "工厂ID")
private Long factoryId;
/**
*
*/
@ExcelProperty(value = "备注")
private String remark;
}

@ -0,0 +1,226 @@
package org.dromara.mes.domain.vo;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.dromara.mes.domain.ProdPlanInfo;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import org.dromara.common.excel.annotation.ExcelDictFormat;
import org.dromara.common.excel.convert.ExcelDictConvert;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
/**
* prod_plan_info
*
* @author Yinq
* @date 2025-01-09
*/
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = ProdPlanInfo.class)
public class ProdPlanInfoVo implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
*
*/
@ExcelProperty(value = "主键标识")
private Long planId;
/**
* ID
*/
@ExcelProperty(value = "生产订单ID")
private Long productOrderId;
/**
* ID
*/
@ExcelProperty(value = "销售订单ID")
private Long saleOrderId;
/**
*
*/
@ExcelProperty(value = "销售订单编号")
private String saleorderCode;
/**
*
*/
@ExcelProperty(value = "工单编号")
private String planCode;
/**
*
*/
@ExcelProperty(value = "派工单号")
private String dispatchCode;
/**
* ID;ID
*/
@ExcelProperty(value = "物料ID;成品ID")
private Long materialId;
/**
* BOM_ID
*/
@ExcelProperty(value = "物料BOM_ID")
private Long materialBomId;
/**
* ID
*/
@ExcelProperty(value = "工序ID")
private Long processId;
/**
* ;线
*/
@ExcelProperty(value = "顺序;派工类型是工艺路线的需要有顺序")
private Long processOrder;
/**
* ID
*/
@ExcelProperty(value = "上一工序ID")
private Long lastProcessId;
/**
* (1 0)
*/
@ExcelProperty(value = "最后工序标识(1是 0否)", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = "active_flag")
private String finalProcessFlag;
/**
* (1 2 3)
*/
@ExcelProperty(value = "下达类型(1机台 2用户 3工位)", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = "mes_release_type")
private String releaseType;
/**
* ID;
*/
@ExcelProperty(value = "下达ID;根据选择的下达类型下发")
private Long releaseId;
/**
* ()
*/
@ExcelProperty(value = "单位生产时间(秒)")
private Long productionTime;
/**
*
*/
@ExcelProperty(value = "工单计划数量")
private Long planAmount;
/**
*
*/
@ExcelProperty(value = "派工数量")
private Long dispatchAmount;
/**
*
*/
@ExcelProperty(value = "完成数量")
private Long completeAmount;
/**
*
*/
@ExcelProperty(value = "计划开始时间")
private Date planBeginTime;
/**
*
*/
@ExcelProperty(value = "计划结束时间")
private Date planEndTime;
/**
*
*/
@ExcelProperty(value = "实际开始时间")
private Date realBeginTime;
/**
*
*/
@ExcelProperty(value = "实际完成时间")
private Date realEndTime;
/**
* ;,
*/
@ExcelProperty(value = "附件信息,关联附件信息主键;多个用,隔开;页面可选择附件信息,也可直接上传")
private String attachId;
/**
* 0 1 2 3
*/
@ExcelProperty(value = "工单计划状态", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = "mes_plan_status")
private String planStatus;
/**
* 0 1ERP
*/
@ExcelProperty(value = "导入类型", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = "mes_import_flag")
private String importFlag;
/**
* 0 1 2
*/
@ExcelProperty(value = "完成标识", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = "mes_finish_flag")
private String finishFlag;
/**
*
*/
@ExcelProperty(value = "优先级")
private Long priority;
/**
* ID
*/
@ExcelProperty(value = "班次ID")
private Long shiftId;
/**
* ID
*/
@ExcelProperty(value = "班组ID")
private Long classTeamId;
/**
* L R
*/
@ExcelProperty(value = "模号", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = "mes_model_code")
private String modelCode;
/**
*
*/
@ExcelProperty(value = "备注")
private String remark;
}

@ -0,0 +1,15 @@
package org.dromara.mes.mapper;
import org.dromara.mes.domain.ProdOrderInfo;
import org.dromara.mes.domain.vo.ProdOrderInfoVo;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
/**
* Mapper
*
* @author Yinq
* @date 2025-01-09
*/
public interface ProdOrderInfoMapper extends BaseMapperPlus<ProdOrderInfo, ProdOrderInfoVo> {
}

@ -0,0 +1,15 @@
package org.dromara.mes.mapper;
import org.dromara.mes.domain.ProdPlanInfo;
import org.dromara.mes.domain.vo.ProdPlanInfoVo;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
/**
* Mapper
*
* @author Yinq
* @date 2025-01-09
*/
public interface ProdPlanInfoMapper extends BaseMapperPlus<ProdPlanInfo, ProdPlanInfoVo> {
}

@ -0,0 +1,69 @@
package org.dromara.mes.service;
import org.dromara.mes.domain.ProdOrderInfo;
import org.dromara.mes.domain.vo.ProdOrderInfoVo;
import org.dromara.mes.domain.bo.ProdOrderInfoBo;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.common.mybatis.core.page.PageQuery;
import java.util.Collection;
import java.util.List;
/**
* Service
*
* @author Yinq
* @date 2025-01-09
*/
public interface IProdOrderInfoService {
/**
*
*
* @param productOrderId
* @return
*/
ProdOrderInfoVo queryById(Long productOrderId);
/**
*
*
* @param bo
* @param pageQuery
* @return
*/
TableDataInfo<ProdOrderInfoVo> queryPageList(ProdOrderInfoBo bo, PageQuery pageQuery);
/**
*
*
* @param bo
* @return
*/
List<ProdOrderInfoVo> queryList(ProdOrderInfoBo bo);
/**
*
*
* @param bo
* @return
*/
Boolean insertByBo(ProdOrderInfoBo bo);
/**
*
*
* @param bo
* @return
*/
Boolean updateByBo(ProdOrderInfoBo bo);
/**
*
*
* @param ids
* @param isValid
* @return
*/
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
}

@ -0,0 +1,69 @@
package org.dromara.mes.service;
import org.dromara.mes.domain.ProdPlanInfo;
import org.dromara.mes.domain.vo.ProdPlanInfoVo;
import org.dromara.mes.domain.bo.ProdPlanInfoBo;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.common.mybatis.core.page.PageQuery;
import java.util.Collection;
import java.util.List;
/**
* Service
*
* @author Yinq
* @date 2025-01-09
*/
public interface IProdPlanInfoService {
/**
*
*
* @param planId
* @return
*/
ProdPlanInfoVo queryById(Long planId);
/**
*
*
* @param bo
* @param pageQuery
* @return
*/
TableDataInfo<ProdPlanInfoVo> queryPageList(ProdPlanInfoBo bo, PageQuery pageQuery);
/**
*
*
* @param bo
* @return
*/
List<ProdPlanInfoVo> queryList(ProdPlanInfoBo bo);
/**
*
*
* @param bo
* @return
*/
Boolean insertByBo(ProdPlanInfoBo bo);
/**
*
*
* @param bo
* @return
*/
Boolean updateByBo(ProdPlanInfoBo bo);
/**
*
*
* @param ids
* @param isValid
* @return
*/
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
}

@ -0,0 +1,158 @@
package org.dromara.mes.service.impl;
import org.dromara.common.core.utils.MapstructUtils;
import org.dromara.common.core.utils.StringUtils;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.common.mybatis.core.page.PageQuery;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.yulichang.toolkit.JoinWrappers;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.dromara.mes.domain.bo.ProdOrderInfoBo;
import org.dromara.mes.domain.vo.ProdOrderInfoVo;
import org.dromara.mes.domain.ProdOrderInfo;
import org.dromara.mes.mapper.ProdOrderInfoMapper;
import org.dromara.mes.service.IProdOrderInfoService;
import java.util.List;
import java.util.Map;
import java.util.Collection;
/**
* Service
*
* @author Yinq
* @date 2025-01-09
*/
@RequiredArgsConstructor
@Service
public class ProdOrderInfoServiceImpl implements IProdOrderInfoService {
private final ProdOrderInfoMapper baseMapper;
/**
*
*
* @param productOrderId
* @return
*/
@Override
public ProdOrderInfoVo queryById(Long productOrderId){
return baseMapper.selectVoById(productOrderId);
}
/**
*
*
* @param bo
* @param pageQuery
* @return
*/
@Override
public TableDataInfo<ProdOrderInfoVo> queryPageList(ProdOrderInfoBo bo, PageQuery pageQuery) {
MPJLambdaWrapper<ProdOrderInfo> lqw = buildQueryWrapper(bo);
Page<ProdOrderInfoVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
return TableDataInfo.build(result);
}
/**
*
*
* @param bo
* @return
*/
@Override
public List<ProdOrderInfoVo> queryList(ProdOrderInfoBo bo) {
MPJLambdaWrapper<ProdOrderInfo> lqw = buildQueryWrapper(bo);
return baseMapper.selectVoList(lqw);
}
private MPJLambdaWrapper<ProdOrderInfo> buildQueryWrapper(ProdOrderInfoBo bo) {
Map<String, Object> params = bo.getParams();
MPJLambdaWrapper<ProdOrderInfo> lqw = JoinWrappers.lambda(ProdOrderInfo.class)
.selectAll(ProdOrderInfo.class)
.eq(bo.getProductOrderId() != null, ProdOrderInfo::getProductOrderId, bo.getProductOrderId())
.eq(StringUtils.isNotBlank(bo.getOrderCode()), ProdOrderInfo::getOrderCode, bo.getOrderCode())
.eq(bo.getSaleOrderId() != null, ProdOrderInfo::getSaleOrderId, bo.getSaleOrderId())
.eq(StringUtils.isNotBlank(bo.getProjectNo()), ProdOrderInfo::getProjectNo, bo.getProjectNo())
.eq(StringUtils.isNotBlank(bo.getOrderType()), ProdOrderInfo::getOrderType, bo.getOrderType())
.eq(bo.getMaterialId() != null, ProdOrderInfo::getMaterialId, bo.getMaterialId())
.eq(bo.getMaterialBomId() != null, ProdOrderInfo::getMaterialBomId, bo.getMaterialBomId())
.eq(StringUtils.isNotBlank(bo.getDispatchType()), ProdOrderInfo::getDispatchType, bo.getDispatchType())
.eq(bo.getDispatchId() != null, ProdOrderInfo::getDispatchId, bo.getDispatchId())
.eq(bo.getSaleAmount() != null, ProdOrderInfo::getSaleAmount, bo.getSaleAmount())
.eq(bo.getPlanDeliveryDate() != null, ProdOrderInfo::getPlanDeliveryDate, bo.getPlanDeliveryDate())
.eq(bo.getPlanAmount() != null, ProdOrderInfo::getPlanAmount, bo.getPlanAmount())
.eq(bo.getDispatchAmount() != null, ProdOrderInfo::getDispatchAmount, bo.getDispatchAmount())
.eq(bo.getCompleteAmount() != null, ProdOrderInfo::getCompleteAmount, bo.getCompleteAmount())
.eq(bo.getReleaseTime() != null, ProdOrderInfo::getReleaseTime, bo.getReleaseTime())
.eq(bo.getPlanBeginTime() != null, ProdOrderInfo::getPlanBeginTime, bo.getPlanBeginTime())
.eq(bo.getPlanEndTime() != null, ProdOrderInfo::getPlanEndTime, bo.getPlanEndTime())
.eq(bo.getRealBeginTime() != null, ProdOrderInfo::getRealBeginTime, bo.getRealBeginTime())
.eq(bo.getRealEndTime() != null, ProdOrderInfo::getRealEndTime, bo.getRealEndTime())
.eq(StringUtils.isNotBlank(bo.getOrderStatus()), ProdOrderInfo::getOrderStatus, bo.getOrderStatus())
.eq(StringUtils.isNotBlank(bo.getStockLockFlag()), ProdOrderInfo::getStockLockFlag, bo.getStockLockFlag())
.eq(bo.getPreOrderId() != null, ProdOrderInfo::getPreOrderId, bo.getPreOrderId())
.eq(StringUtils.isNotBlank(bo.getPreOrderCode()), ProdOrderInfo::getPreOrderCode, bo.getPreOrderCode())
.eq(StringUtils.isNotBlank(bo.getFinishFlag()), ProdOrderInfo::getFinishFlag, bo.getFinishFlag())
.eq(StringUtils.isNotBlank(bo.getReleaseFlag()), ProdOrderInfo::getReleaseFlag, bo.getReleaseFlag())
.eq(StringUtils.isNotBlank(bo.getOrderVersion()), ProdOrderInfo::getOrderVersion, bo.getOrderVersion())
.eq(bo.getFactoryId() != null, ProdOrderInfo::getFactoryId, bo.getFactoryId())
.orderByDesc(ProdOrderInfo::getCreateTime);
return lqw;
}
/**
*
*
* @param bo
* @return
*/
@Override
public Boolean insertByBo(ProdOrderInfoBo bo) {
ProdOrderInfo add = MapstructUtils.convert(bo, ProdOrderInfo.class);
validEntityBeforeSave(add);
boolean flag = baseMapper.insert(add) > 0;
if (flag) {
bo.setProductOrderId(add.getProductOrderId());
}
return flag;
}
/**
*
*
* @param bo
* @return
*/
@Override
public Boolean updateByBo(ProdOrderInfoBo bo) {
ProdOrderInfo update = MapstructUtils.convert(bo, ProdOrderInfo.class);
validEntityBeforeSave(update);
return baseMapper.updateById(update) > 0;
}
/**
*
*/
private void validEntityBeforeSave(ProdOrderInfo entity){
//TODO 做一些数据校验,如唯一约束
}
/**
*
*
* @param ids
* @param isValid
* @return
*/
@Override
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
if(isValid){
//TODO 做一些业务上的校验,判断是否需要校验
}
return baseMapper.deleteByIds(ids) > 0;
}
}

@ -0,0 +1,161 @@
package org.dromara.mes.service.impl;
import org.dromara.common.core.utils.MapstructUtils;
import org.dromara.common.core.utils.StringUtils;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.common.mybatis.core.page.PageQuery;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.yulichang.toolkit.JoinWrappers;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.dromara.mes.domain.bo.ProdPlanInfoBo;
import org.dromara.mes.domain.vo.ProdPlanInfoVo;
import org.dromara.mes.domain.ProdPlanInfo;
import org.dromara.mes.mapper.ProdPlanInfoMapper;
import org.dromara.mes.service.IProdPlanInfoService;
import java.util.List;
import java.util.Map;
import java.util.Collection;
/**
* Service
*
* @author Yinq
* @date 2025-01-09
*/
@RequiredArgsConstructor
@Service
public class ProdPlanInfoServiceImpl implements IProdPlanInfoService {
private final ProdPlanInfoMapper baseMapper;
/**
*
*
* @param planId
* @return
*/
@Override
public ProdPlanInfoVo queryById(Long planId){
return baseMapper.selectVoById(planId);
}
/**
*
*
* @param bo
* @param pageQuery
* @return
*/
@Override
public TableDataInfo<ProdPlanInfoVo> queryPageList(ProdPlanInfoBo bo, PageQuery pageQuery) {
MPJLambdaWrapper<ProdPlanInfo> lqw = buildQueryWrapper(bo);
Page<ProdPlanInfoVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
return TableDataInfo.build(result);
}
/**
*
*
* @param bo
* @return
*/
@Override
public List<ProdPlanInfoVo> queryList(ProdPlanInfoBo bo) {
MPJLambdaWrapper<ProdPlanInfo> lqw = buildQueryWrapper(bo);
return baseMapper.selectVoList(lqw);
}
private MPJLambdaWrapper<ProdPlanInfo> buildQueryWrapper(ProdPlanInfoBo bo) {
Map<String, Object> params = bo.getParams();
MPJLambdaWrapper<ProdPlanInfo> lqw = JoinWrappers.lambda(ProdPlanInfo.class)
.selectAll(ProdPlanInfo.class)
.eq(bo.getPlanId() != null, ProdPlanInfo::getPlanId, bo.getPlanId())
.eq(bo.getProductOrderId() != null, ProdPlanInfo::getProductOrderId, bo.getProductOrderId())
.eq(bo.getSaleOrderId() != null, ProdPlanInfo::getSaleOrderId, bo.getSaleOrderId())
.eq(StringUtils.isNotBlank(bo.getSaleorderCode()), ProdPlanInfo::getSaleorderCode, bo.getSaleorderCode())
.eq(StringUtils.isNotBlank(bo.getPlanCode()), ProdPlanInfo::getPlanCode, bo.getPlanCode())
.eq(StringUtils.isNotBlank(bo.getDispatchCode()), ProdPlanInfo::getDispatchCode, bo.getDispatchCode())
.eq(bo.getMaterialId() != null, ProdPlanInfo::getMaterialId, bo.getMaterialId())
.eq(bo.getMaterialBomId() != null, ProdPlanInfo::getMaterialBomId, bo.getMaterialBomId())
.eq(bo.getProcessId() != null, ProdPlanInfo::getProcessId, bo.getProcessId())
.eq(bo.getProcessOrder() != null, ProdPlanInfo::getProcessOrder, bo.getProcessOrder())
.eq(bo.getLastProcessId() != null, ProdPlanInfo::getLastProcessId, bo.getLastProcessId())
.eq(StringUtils.isNotBlank(bo.getFinalProcessFlag()), ProdPlanInfo::getFinalProcessFlag, bo.getFinalProcessFlag())
.eq(StringUtils.isNotBlank(bo.getReleaseType()), ProdPlanInfo::getReleaseType, bo.getReleaseType())
.eq(bo.getReleaseId() != null, ProdPlanInfo::getReleaseId, bo.getReleaseId())
.eq(bo.getProductionTime() != null, ProdPlanInfo::getProductionTime, bo.getProductionTime())
.eq(bo.getPlanAmount() != null, ProdPlanInfo::getPlanAmount, bo.getPlanAmount())
.eq(bo.getDispatchAmount() != null, ProdPlanInfo::getDispatchAmount, bo.getDispatchAmount())
.eq(bo.getCompleteAmount() != null, ProdPlanInfo::getCompleteAmount, bo.getCompleteAmount())
.eq(bo.getPlanBeginTime() != null, ProdPlanInfo::getPlanBeginTime, bo.getPlanBeginTime())
.eq(bo.getPlanEndTime() != null, ProdPlanInfo::getPlanEndTime, bo.getPlanEndTime())
.eq(bo.getRealBeginTime() != null, ProdPlanInfo::getRealBeginTime, bo.getRealBeginTime())
.eq(bo.getRealEndTime() != null, ProdPlanInfo::getRealEndTime, bo.getRealEndTime())
.eq(StringUtils.isNotBlank(bo.getAttachId()), ProdPlanInfo::getAttachId, bo.getAttachId())
.eq(StringUtils.isNotBlank(bo.getPlanStatus()), ProdPlanInfo::getPlanStatus, bo.getPlanStatus())
.eq(StringUtils.isNotBlank(bo.getImportFlag()), ProdPlanInfo::getImportFlag, bo.getImportFlag())
.eq(StringUtils.isNotBlank(bo.getFinishFlag()), ProdPlanInfo::getFinishFlag, bo.getFinishFlag())
.eq(bo.getPriority() != null, ProdPlanInfo::getPriority, bo.getPriority())
.eq(bo.getShiftId() != null, ProdPlanInfo::getShiftId, bo.getShiftId())
.eq(bo.getClassTeamId() != null, ProdPlanInfo::getClassTeamId, bo.getClassTeamId())
.eq(StringUtils.isNotBlank(bo.getModelCode()), ProdPlanInfo::getModelCode, bo.getModelCode())
.orderByDesc(ProdPlanInfo::getCreateTime);
return lqw;
}
/**
*
*
* @param bo
* @return
*/
@Override
public Boolean insertByBo(ProdPlanInfoBo bo) {
ProdPlanInfo add = MapstructUtils.convert(bo, ProdPlanInfo.class);
validEntityBeforeSave(add);
boolean flag = baseMapper.insert(add) > 0;
if (flag) {
bo.setPlanId(add.getPlanId());
}
return flag;
}
/**
*
*
* @param bo
* @return
*/
@Override
public Boolean updateByBo(ProdPlanInfoBo bo) {
ProdPlanInfo update = MapstructUtils.convert(bo, ProdPlanInfo.class);
validEntityBeforeSave(update);
return baseMapper.updateById(update) > 0;
}
/**
*
*/
private void validEntityBeforeSave(ProdPlanInfo entity){
//TODO 做一些数据校验,如唯一约束
}
/**
*
*
* @param ids
* @param isValid
* @return
*/
@Override
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
if(isValid){
//TODO 做一些业务上的校验,判断是否需要校验
}
return baseMapper.deleteByIds(ids) > 0;
}
}

@ -0,0 +1,7 @@
<?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="org.dromara.mes.mapper.ProdOrderInfoMapper">
</mapper>

@ -0,0 +1,7 @@
<?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="org.dromara.mes.mapper.ProdPlanInfoMapper">
</mapper>
Loading…
Cancel
Save