订单管理模块(订单导出)

highway
wws 1 year ago
parent 4e176bc6ab
commit d624fa64a0

@ -24,24 +24,22 @@ public class ProOrder extends TreeEntity {
@Excel(name = "计划工厂编码") @Excel(name = "计划工厂编码")
private String planFactoryCode; private String planFactoryCode;
/** 计划工厂编码 */ /** 工厂编码 */
@Excel(name = "工厂编码")
private String factoryCode; private String factoryCode;
/** 订单类型 */ /** 订单类型 */
@Excel(name = "订单类型")
private String orderType; private String orderType;
/** 订单号 */ /** 订单号 */
@Excel(name = "订单号") @Excel(name = "订单号",width = 30)
private String orderCode; private String orderCode;
/** 物料号 */ /** 物料号 */
@Excel(name = "物料号") @Excel(name = "物料号",width = 30)
private String prodCode; private String prodCode;
/** 物料名称 */ /** 物料名称 */
@Excel(name = "物料名称") @Excel(name = "物料名称",width = 30)
private String prodDesc; private String prodDesc;
/** 订单数量 */ /** 订单数量 */
@ -57,7 +55,6 @@ public class ProOrder extends TreeEntity {
private String unit; private String unit;
/** 任务清单 */ /** 任务清单 */
@Excel(name = "任务清单")
private String workerOrder; private String workerOrder;
public Long getQuantitySplit() { public Long getQuantitySplit() {
@ -70,32 +67,28 @@ public class ProOrder extends TreeEntity {
/** 计划生产日期 */ /** 计划生产日期 */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "计划生产日期", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "计划生产日期", width = 20, dateFormat = "yyyy-MM-dd")
private Date planProDate; private Date planProDate;
/** 计划完成日期 */ /** 计划完成日期 */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "计划完成日期", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "计划完成日期", width = 20, dateFormat = "yyyy-MM-dd")
private Date planComplete; private Date planComplete;
/** $column.columnComment */ /** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String atrr1; private String atrr1;
/** $column.columnComment */ /** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String atrr2; private String atrr2;
/** $column.columnComment */ /** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String atrr3; private String atrr3;
/** 0未拆分 */ /** 0未拆分 */
@Excel(name = "0未拆分") @Excel(name = "订单状态", readConverterExp = "o0=拆分,o1=已拆分")
private String status; private String status;
/** 上级工单 */ /** 上级工单 */
@Excel(name = "上级工单")
private String parentOrder; private String parentOrder;
public String getPlanFactoryCode() { public String getPlanFactoryCode() {
@ -107,10 +100,10 @@ public class ProOrder extends TreeEntity {
} }
/** 产品类型 */ /** 产品类型 */
@Excel(name = "产品类型") @Excel(name = "产品类型", readConverterExp = "white=白坯,prod=成品")
private String prodType; private String prodType;
/** 物料型号 */ /** 物料型号 */
@Excel(name = "物料名称")
private String prodSpc; private String prodSpc;
// 计划生产日期开始 // 计划生产日期开始
@ -119,6 +112,36 @@ public class ProOrder extends TreeEntity {
// 计划生产日期结束 // 计划生产日期结束
private String planDateEnd; 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() { public String getPlanDateStart() {
return planDateStart; return planDateStart;
} }

@ -24,6 +24,10 @@ import org.springframework.stereotype.Service;
import com.op.plan.mapper.ProOrderMapper; import com.op.plan.mapper.ProOrderMapper;
import com.op.plan.service.IProOrderService; import com.op.plan.service.IProOrderService;
import org.springframework.transaction.annotation.Transactional; 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.error;
import static com.op.common.core.web.domain.AjaxResult.success; import static com.op.common.core.web.domain.AjaxResult.success;
@ -290,8 +294,12 @@ public class ProOrderServiceImpl implements IProOrderService {
@Override @Override
@DS("#header.poolName") @DS("#header.poolName")
public int insertProOrder(ProOrder proOrder) { public int insertProOrder(ProOrder proOrder) {
//获取当前所选工厂
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String key = "#header.poolName";
// 获取当前时间 // 获取当前时间
Date date = DateUtils.getNowDate(); Date date = DateUtils.getNowDate();
proOrder.setPlanFactoryCode(request.getHeader(key.substring(8)));
proOrder.setId(IdUtils.fastSimpleUUID()); proOrder.setId(IdUtils.fastSimpleUUID());
proOrder.setParentOrder("0"); proOrder.setParentOrder("0");
proOrder.setStatus("o0"); proOrder.setStatus("o0");

Loading…
Cancel
Save