Browse Source

销售订单单证 森宇发运参照字段

liuchaohui 3 years ago
parent
commit
ac2ba0c6f3

+ 20 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/orderData/entity/SyOrderDataItem.java

@@ -164,4 +164,24 @@ public class SyOrderDataItem {
 	@Excel(name = "订单剩余数量", width = 15)
 	@ApiModelProperty(value = "订单剩余数量")
 	private java.math.BigDecimal surplusNum;
+
+	@Excel(name = "委外采购订单号", width = 15)
+	@ApiModelProperty(value = "委外采购订单号")
+	private java.lang.String ompoId;
+
+	@Excel(name = "供应商编码", width = 15)
+	@ApiModelProperty(value = "供应商编码")
+	private java.lang.String supplierCode;
+
+	@Excel(name = "供应商", width = 15)
+	@ApiModelProperty(value = "供应商")
+	private java.lang.String supplier;
+
+	@Excel(name = "委外采购单价", width = 15)
+	@ApiModelProperty(value = "委外采购单价")
+	private java.math.BigDecimal iTaxPrice;
+
+	@Excel(name = "佣金", width = 15)
+	@ApiModelProperty(value = "佣金")
+	private java.math.BigDecimal ymoney;
 }

+ 20 - 39
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/orderData/service/impl/SyOrderDataServiceImpl.java

@@ -97,36 +97,6 @@ public class SyOrderDataServiceImpl extends ServiceImpl<SyOrderDataMapper, SyOrd
                 SO_SODetails SO_SOMain
                  */
 
-                /*String sql = "SELECT " +
-                        "s.ID AS id," +
-                        "s.cSOCode AS orderNumber," +
-                        "s.dDate AS orderDate," +
-                        "s.cBusType AS businessTypeValue," +
-                        "s.cSTCode AS salesTypeValue," +
-                        "s.cCusCode AS customerAbbreviation," +
-                        "s.cCusName AS customerName," +
-                        "s.iExchRate AS exchangeRate," +
-                        "s.cDepCode AS salesDepartment," +
-                        "s.cCrmpersonName AS salesman," +
-                        "s.cexch_name AS currencyText," +
-                        "s.fbookratio AS depositRatio," +
-                        "s.iMoney AS deposit," +
-                        "s.cMemo AS orderRemarks," +
-                        "s.cDefine14 AS orderChangeDescription," +
-                        "s.cDefine12 AS garmentFactory," +
-                        "s.cMemo AS memo," +
-                        "f.chdefine4 as priceRemarks," +
-                        "f.chdefine1 as collaborativeRoute," +
-                        "t.cSTName as salesTypeText," +
-                        "y.cexch_code as currencyValue," +
-                        "p.cPayName as termOfPayment," +account+
-                        " as account" +
-                        " from SO_SOMain s" +
-                        " left join SO_SOMain_extradefine f on s.ID = f.ID" +
-                        " left join SaleType t on s.cSTCode = t.cSTCode" +
-                        " left join foreigncurrency y on s.cexch_name = y.cexch_name" +
-                        " left join PayCondition p on s.cPayCode = p.cPayCode where s.dDate > '"+lastTimeSf+"'";*/
-                
                 String sql = "SELECT " +
                         "s.ID AS id," +
                         "s.cSOCode AS orderNumber," +
@@ -186,14 +156,6 @@ public class SyOrderDataServiceImpl extends ServiceImpl<SyOrderDataMapper, SyOrd
             for (JSONObject jsonObject:jian) {
                 SyOrderData sy = JSONObject.toJavaObject(jsonObject,SyOrderData.class);
                 String ID = sy.getId();
-//                String sql = "SELECT " +
-//                        "AutoID as id,ID as syOrderDataId,cDefine22 as itemNumber,dPreDate as preDeliveryDate," +
-//                        "dPreMoDate as preCompletionDate,cDefine32 as packId,cDefine28 as smallPo,cDefine29 as distributionPoint," +
-//                        "cInvCode as inventoryCode,cInvName as inventoryName,cFree1 as colour,cFree2 as size,cFree3 as codingRules," +
-//                        "cFree4 as guangpeiGateWidth,cDefine35 as boxNumber,iQuantity as quantity,iQuantity as surplusNum," +
-//                        "iTaxUnitPrice as unitPriceIncludingTax,iSum as totalPriceAndTax,iTaxRate as taxRate," +
-//                        "cMemo as remarks" +
-//                        " FROM SO_SODetails where ID = "+ID;
                 String sql = "SELECT " +
                         "s.AutoID AS id," +
                         "s.ID AS syOrderDataId," +
@@ -218,11 +180,29 @@ public class SyOrderDataServiceImpl extends ServiceImpl<SyOrderDataMapper, SyOrd
                         "s.cMemo AS remarks ," +
                         "d.cComUnitName as masterMetering," +
                         "c.cInvStd as specificationAndModel," +
-                        "s.cSCloser as bankClosedBy" +
+                        "s.cSCloser as bankClosedBy," +
+                        "p.OMPO_Id as ompoId," +
+                        "p.cVenCode as supplierCode," +
+                        "v.cVenAbbName as supplier,"+
+                        "p.iTaxPrice as iTaxPrice," +
+                        "p.cbdefine2 as ymoney"+
                         " FROM" +
                         " SO_SODetails s" +
                         " left join Inventory c on c.cInvCode=s.cInvCode" +
                         " left join ComputationUnit d on d.cComunitCode=c.cComUnitCode"+
+                        " left join (" +
+                            " SELECT pm.cPOID as OMPO_Id,cVenCode,pd.iTaxPrice,pd.iorderdid,pe.cbdefine2,pd.cInvCode" +
+                            " FROM PO_Pomain pm " +
+                            " LEFT JOIN  PO_Podetails pd on pm.POID=pd.POID" +
+                            " LEFT JOIN  PO_Podetails_extradefine pe on pd.id=pe.id" +
+                            " where pm.cState = 1" +
+                            " UNION" +
+                            " SELECT om.cCode as OMPO_Id,om.cVenCode,od.iTaxPrice,od.isosid as iorderdid,oe.cbdefine2,od.cInvCode" +
+                            " FROM OM_MOMain om " +
+                            " LEFT JOIN  OM_MODetails  od on om.MOID =od.MOID" +
+                            " LEFT JOIN  OM_MODetails_extradefine oe on od.MODetailsID=oe.MODetailsID" +
+                        " ) p " +"on s.isosid  = p.iorderdid and s.cInvCode = p.cInvCode"+
+                        " left join Vendor v on p.cVenCode=v.cVenCode"+
                         " where s.ID = "+ID;
                 List<Map<String, Object>> listSon = new ArrayList<>();
                 if(sy.getAccount().equals("901")){
@@ -242,6 +222,7 @@ public class SyOrderDataServiceImpl extends ServiceImpl<SyOrderDataMapper, SyOrd
             }
             dxpDataPlanService.updateLastTime(day,"senYu_syOrder");
         } catch (Exception e) {
+            e.printStackTrace();
             log.error(e.getMessage());
         }
         return result;