From 2fc66774335bfc603aa36b1ca41e5f1be19442b0 Mon Sep 17 00:00:00 2001 From: bfwms <1> Date: 星期一, 07 七月 2025 16:27:05 +0800 Subject: [PATCH] ERP对接 --- src/main/java/com/zy/asrs/entity/OrderDetl.java | 132 ++++++++++++++++++++++++-------------------- 1 files changed, 72 insertions(+), 60 deletions(-) diff --git a/src/main/java/com/zy/asrs/entity/OrderDetl.java b/src/main/java/com/zy/asrs/entity/OrderDetl.java index 2ab47e1..3cc397c 100644 --- a/src/main/java/com/zy/asrs/entity/OrderDetl.java +++ b/src/main/java/com/zy/asrs/entity/OrderDetl.java @@ -6,17 +6,17 @@ import com.baomidou.mybatisplus.enums.IdType; import com.core.common.Cools; import com.core.common.SpringUtils; -import com.core.exception.CoolException; +import com.zy.asrs.service.LocDetlService; +import com.zy.asrs.service.LocOwnerService; +import com.zy.asrs.service.OrderDetlService; import com.zy.asrs.service.OrderService; +import com.zy.common.utils.Synchro; import com.zy.system.entity.User; import com.zy.system.service.UserService; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; -import java.beans.BeanInfo; -import java.beans.Introspector; -import java.beans.PropertyDescriptor; import java.io.Serializable; import java.text.SimpleDateFormat; import java.util.Date; @@ -89,28 +89,59 @@ private String specs; /** - * 鍨嬪彿 + * 缁勭粐缂栫爜 */ - @ApiModelProperty(value= "鍨嬪彿") + @ApiModelProperty(value= "缁勭粐缂栫爜") + private String manu; + + /** + * 椤规 + */ + @ApiModelProperty(value= "椤规") private String model; /** - * 棰滆壊 + * 浠诲姟浠撳簱 */ - @ApiModelProperty(value= "棰滆壊") + @ApiModelProperty(value= "浠诲姟浠撳簱") private String color; /** - * 鍝佺墝 + * 浠诲姟鍌ㄤ綅 */ - @ApiModelProperty(value= "鍝佺墝") + @ApiModelProperty(value= "浠诲姟鍌ㄤ綅") private String brand; /** - * 鍗曚綅 + * 鍗曚綅缂栫爜 */ - @ApiModelProperty(value= "鍗曚綅") + @ApiModelProperty(value= "鍗曚綅缂栫爜") private String unit; + + /** + * 鍗曚綅鍚嶇О + */ + @ApiModelProperty(value= "鍗曚綅鍚嶇О") + private String sku; + + /** + * 渚涘簲鍟嗙紪鐮� + */ + @ApiModelProperty(value= "渚涘簲鍟嗙紪鐮�") + @TableField("item_num") + private String itemNum; + + /** + * 鎵樼洏鐮� + */ + @ApiModelProperty(value= "鎵樼洏鐮�") + private String barcode; + + /** + * 渚涘簲鍟嗗悕绉� + */ + @ApiModelProperty(value= "渚涘簲鍟嗗悕绉�") + private String origin; /** * 鍗曚环 @@ -119,34 +150,11 @@ private Double price; /** - * sku - */ - @ApiModelProperty(value= "sku") - private String sku; - - /** * 鍗曚綅閲� */ @ApiModelProperty(value= "鍗曚綅閲�") private Double units; - /** - * 鏉$爜 - */ - @ApiModelProperty(value= "鏉$爜") - private String barcode; - - /** - * 浜у湴 - */ - @ApiModelProperty(value= "浜у湴") - private String origin; - - /** - * 鍘傚 - */ - @ApiModelProperty(value= "鍘傚") - private String manu; /** * 鐢熶骇鏃ユ湡 @@ -154,13 +162,6 @@ @ApiModelProperty(value= "鐢熶骇鏃ユ湡") @TableField("manu_date") private String manuDate; - - /** - * 鍝侀」鏁� - */ - @ApiModelProperty(value= "鍝侀」鏁�") - @TableField("item_num") - private String itemNum; /** * 瀹夊叏搴撳瓨閲� @@ -288,6 +289,15 @@ @ApiModelProperty(value= "澶囨敞") private String memo; + /** + * 搴撳瓨姹囨�绘暟閲� + */ + @TableField(exist=false) + private Double sum; + + @ApiModelProperty(value= "瀹㈡埛淇℃伅ID") + private Long owner; + public OrderDetl() {} public OrderDetl(Long orderId, String orderNo, Double anfme, Double qty, String matnr, String maktx, String batch, String specs, String model, String color, String brand, String unit, Double price, String sku, Double units, String barcode, String origin, String manu, String manuDate, String itemNum, Double safeQty, Double weight, Double length, Double volume, String threeCode, String supp, String suppCode, Integer beBatch, String deadTime, Integer deadWarn, Integer source, Integer inspect, Integer danger, Integer status, Long createBy, Date createTime, Long updateBy, Date updateTime, String memo) { @@ -331,6 +341,16 @@ this.updateTime = updateTime; this.memo = memo; } + + public String getOwner$(){ + LocOwnerService service = SpringUtils.getBean(LocOwnerService.class); + LocOwner locOwner = service.selectById(this.owner); + if (!Cools.isEmpty(locOwner)){ + return String.valueOf(locOwner.getOwner()); + } + return null; + } + public String getOrderId$(){ OrderService service = SpringUtils.getBean(OrderService.class); @@ -442,24 +462,16 @@ return null; } - public void sync(Object dest) { - try { - BeanInfo sourceBean = Introspector.getBeanInfo(this.getClass(),Object.class); - PropertyDescriptor[] sourceProperty = sourceBean.getPropertyDescriptors(); - BeanInfo destBean = Introspector.getBeanInfo(dest.getClass(),Object.class); - PropertyDescriptor[] destProperty = destBean.getPropertyDescriptors(); - for (PropertyDescriptor propertyDescriptor : sourceProperty) { - for (PropertyDescriptor descriptor : destProperty) { - if (propertyDescriptor.getName().equals(descriptor.getName()) && propertyDescriptor.getPropertyType() == descriptor.getPropertyType()) { - descriptor.getWriteMethod().invoke(dest, propertyDescriptor.getReadMethod().invoke(this)); - break; - } - } - } - } catch (Exception e) { - throw new CoolException("灞炴�у鍒跺け璐�:" + e.getMessage()); - } + public void sync(Object source) { + Synchro.Copy(source, this); } - + public Double getSum(){ + LocDetlService service = SpringUtils.getBean(LocDetlService.class); + if (!Cools.isEmpty(this.getMatnr())) { + return service.selectSumByMatnr(this.getMatnr()); + } else { + return null; + } + } } -- Gitblit v1.9.1