From d624fa64a0fdade8b5917f856dd92ff5e910c5c9 Mon Sep 17 00:00:00 2001 From: wws <18630710203@163.com> Date: Wed, 2 Aug 2023 16:51:23 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E7=AE=A1=E7=90=86=E6=A8=A1?= =?UTF-8?q?=E5=9D=97(=E8=AE=A2=E5=8D=95=E5=AF=BC=E5=87=BA)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/op/plan/domain/ProOrder.java | 55 +++++++++++++------ .../service/impl/ProOrderServiceImpl.java | 8 +++ 2 files changed, 47 insertions(+), 16 deletions(-) diff --git a/op-modules/op-plan/src/main/java/com/op/plan/domain/ProOrder.java b/op-modules/op-plan/src/main/java/com/op/plan/domain/ProOrder.java index a19e0700..22457a17 100644 --- a/op-modules/op-plan/src/main/java/com/op/plan/domain/ProOrder.java +++ b/op-modules/op-plan/src/main/java/com/op/plan/domain/ProOrder.java @@ -24,24 +24,22 @@ public class ProOrder extends TreeEntity { @Excel(name = "计划工厂编码") private String planFactoryCode; - /** 计划工厂编码 */ - @Excel(name = "工厂编码") + /** 工厂编码 */ private String factoryCode; /** 订单类型 */ - @Excel(name = "订单类型") private String orderType; /** 订单号 */ - @Excel(name = "订单号") + @Excel(name = "订单号",width = 30) private String orderCode; /** 物料号 */ - @Excel(name = "物料号") + @Excel(name = "物料号",width = 30) private String prodCode; /** 物料名称 */ - @Excel(name = "物料名称") + @Excel(name = "物料名称",width = 30) private String prodDesc; /** 订单数量 */ @@ -57,7 +55,6 @@ public class ProOrder extends TreeEntity { private String unit; /** 任务清单 */ - @Excel(name = "任务清单") private String workerOrder; public Long getQuantitySplit() { @@ -70,32 +67,28 @@ public class ProOrder extends TreeEntity { /** 计划生产日期 */ @JsonFormat(pattern = "yyyy-MM-dd") - @Excel(name = "计划生产日期", width = 30, dateFormat = "yyyy-MM-dd") + @Excel(name = "计划生产日期", width = 20, dateFormat = "yyyy-MM-dd") private Date planProDate; /** 计划完成日期 */ @JsonFormat(pattern = "yyyy-MM-dd") - @Excel(name = "计划完成日期", width = 30, dateFormat = "yyyy-MM-dd") + @Excel(name = "计划完成日期", width = 20, dateFormat = "yyyy-MM-dd") private Date planComplete; /** $column.columnComment */ - @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") private String atrr1; /** $column.columnComment */ - @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") private String atrr2; /** $column.columnComment */ - @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") private String atrr3; /** 0未拆分 */ - @Excel(name = "0未拆分") + @Excel(name = "订单状态", readConverterExp = "o0=未拆分,o1=已拆分") private String status; /** 上级工单 */ - @Excel(name = "上级工单") private String parentOrder; public String getPlanFactoryCode() { @@ -107,10 +100,10 @@ public class ProOrder extends TreeEntity { } /** 产品类型 */ - @Excel(name = "产品类型") + @Excel(name = "产品类型", readConverterExp = "white=白坯,prod=成品") private String prodType; + /** 物料型号 */ - @Excel(name = "物料名称") private String prodSpc; // 计划生产日期开始 @@ -119,6 +112,36 @@ public class ProOrder extends TreeEntity { // 计划生产日期结束 private String planDateEnd; + /** 创建日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "创建日期", width = 20, dateFormat = "yyyy-MM-dd") + private Date createTime; + + /** 更新日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "更新日期", width = 20, dateFormat = "yyyy-MM-dd") + private Date updateTime; + + @Override + public Date getCreateTime() { + return createTime; + } + + @Override + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + @Override + public Date getUpdateTime() { + return updateTime; + } + + @Override + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + public String getPlanDateStart() { return planDateStart; } diff --git a/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderServiceImpl.java b/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderServiceImpl.java index c06f4c4e..d33be65e 100644 --- a/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderServiceImpl.java +++ b/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderServiceImpl.java @@ -24,6 +24,10 @@ import org.springframework.stereotype.Service; import com.op.plan.mapper.ProOrderMapper; import com.op.plan.service.IProOrderService; import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; import static com.op.common.core.web.domain.AjaxResult.error; import static com.op.common.core.web.domain.AjaxResult.success; @@ -290,8 +294,12 @@ public class ProOrderServiceImpl implements IProOrderService { @Override @DS("#header.poolName") public int insertProOrder(ProOrder proOrder) { + //获取当前所选工厂 + HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); + String key = "#header.poolName"; // 获取当前时间 Date date = DateUtils.getNowDate(); + proOrder.setPlanFactoryCode(request.getHeader(key.substring(8))); proOrder.setId(IdUtils.fastSimpleUUID()); proOrder.setParentOrder("0"); proOrder.setStatus("o0");