Forráskód Böngészése

Merge branch 'master' of http://139.196.39.194:9021/chenc/sen-yu-new-service

chen 2 éve
szülő
commit
4cc47e43f8

+ 1 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/mapper/xml/SyShippingDetailsMapper.xml

@@ -5,7 +5,7 @@
     <select id="queryOrderData" resultType="org.jeecg.modules.documents.shippingDetails.entity.VO.OrderDataVo">
 
         select a.order_number as orderNumber,b.item_number as itemNumber,b.small_po as smallPo,b.pk_org as pkOrg,a.order_date as orderDate,b.inventory_name as inventoryName,
-         b.colour as colour,b.size as size,b.coding_rules as codingRules,b.quantity as quantity,a.business_type_text as businessTypeText,b.customer_order as customerOrder,
+         b.colour as colour,b.size as size,b.coding_rules as codingRules,b.quantity as quantity,a.business_type_text as businessTypeText,a.customer_order_number as customerOrderNumber,
            a.sales_type_text as salesTypeText,a.customer_abbreviation as customerAbbreviation,a.customer_name as customerName,
            a.brand_side as brandSide,a.exchange_rate as exchangeRate,b.specification_and_model as specificationAndModel,
            a.whole_order_total as wholeOrderTotal,a.sales_department as salesDepartment,a.salesman as salesman,a.currency_text as currencyText,a.third_party as thirdParty,

+ 13 - 12
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/util/JsonChangeUtils.java

@@ -30,7 +30,7 @@ public class JsonChangeUtils implements ApplicationContextAware{
 
     private static ISenYuDataSourceTwo senYuDataSourceTwo;
 
-    private static ISenYuDataSourceThree iSenYuDataSourceThree;
+    private static ISenYuDataSourceThree senYuDataSourceThree;
 
     /**
      * 原始通用转JSON方法
@@ -97,9 +97,9 @@ public class JsonChangeUtils implements ApplicationContextAware{
                         "'"+map.get("poNum")+"' as poNum,mo.cInvCode as 'customerItemCode',inv.cInvName as 'itemName',mo.dArriveDate as 'customerDemandDate', " +
                         "'' as 'poLineStatus',mo.cFree1 as cFree1,mo.cFree2 as cFree2,mo.cFree3 as cFree3,mo.cFree4 as cFree4," +
                         "mo.cFree5 as cFree5,mo.cFree6 as cFree6,mo.cFree7 as cFree7,mo.cFree8 as cFree8,mo.cFree9 as cFree9,mo.cFree10 as cFree10,mo.iQuantity as 'customerDemandQty',mo.cUnitID as 'customerUomCode'," +
-                        "mo.iMoney as 'iMoney'," +
+                        "case when mo.iMoney is null then '0' else mo.iMoney end as iMoney," +
                         "mo.iTax as lineAttributeDecimal1,mo.dbCloseDate as lineAttributeDatetime1,mo.cDefine24 as lineAttributeString9," +
-                        "mo.iTaxPrice as 'customerPrice',(mo.iPerTaxRate/100) as 'lineTaxRate',mo.iSum as 'amount',ex.cbdefine2 as lineAttributeString7,ex.cbdefine3 as lineAttributeString8," +
+                        "mo.iTaxPrice as 'customerPrice',(mo.iPerTaxRate/100) as 'lineTaxRate',case when mo.iSum is null then '0' else mo.iSum end as amount,ex.cbdefine2 as lineAttributeString7,ex.cbdefine3 as lineAttributeString8," +
                         "mo.cDefine28 as 'lineAttributeString1',mo.cDefine32 as 'lineAttributeString2',mo.cDefine29 as 'lineAttributeString3'," +
                         "mo.cDefine30 as 'lineAttributeString4',mo.cbMemo as 'lineAttributeString5',mo.cDefine22 as lineAttributeString6,'' as lineAttributeString7,'' as lineAttributeString8," +
                         "cFree1 as 'color','' as 'customerNumber',mo.iUnitPrice as supplierExTaxPrice,'"+map.get("dVerifyDate")+"' as lineAttributeDatetime2," +
@@ -125,9 +125,9 @@ public class JsonChangeUtils implements ApplicationContextAware{
                         "'"+map.get("poNum")+"' as poNum,mo.cInvCode as 'customerItemCode',inv.cInvName as 'itemName',mo.dArriveDate as 'customerDemandDate', " +
                         "'' as 'poLineStatus',mo.cFree1 as cFree1,mo.cFree2 as cFree2,mo.cFree3 as cFree3,mo.cFree4 as cFree4," +
                         "mo.cFree5 as cFree5,mo.cFree6 as cFree6,mo.cFree7 as cFree7,mo.cFree8 as cFree8,mo.cFree9 as cFree9,mo.cFree10 as cFree10,mo.iQuantity as 'customerDemandQty',mo.cUnitID as 'customerUomCode'," +
-                        "mo.iMoney as 'iMoney'," +
+                        "case when mo.iMoney is null then '0' else mo.iMoney end as iMoney," +
                         "mo.iTax as lineAttributeDecimal1,mo.dbCloseDate as lineAttributeDatetime1,mo.cDefine24 as lineAttributeString9," +
-                        "mo.iTaxPrice as 'customerPrice',(mo.iPerTaxRate/100) as 'lineTaxRate',mo.iSum as 'amount',ex.cbdefine2 as lineAttributeString7,ex.cbdefine3 as lineAttributeString8," +
+                        "mo.iTaxPrice as 'customerPrice',(mo.iPerTaxRate/100) as 'lineTaxRate',case when mo.iSum is null then '0' else mo.iSum end as amount,ex.cbdefine2 as lineAttributeString7,ex.cbdefine3 as lineAttributeString8," +
                         "mo.cDefine28 as 'lineAttributeString1',mo.cDefine32 as 'lineAttributeString2',mo.cDefine29 as 'lineAttributeString3'," +
                         "mo.cDefine30 as 'lineAttributeString4',mo.cbMemo as 'lineAttributeString5',mo.cDefine22 as lineAttributeString6,'' as lineAttributeString7,'' as lineAttributeString8," +
                         "cFree1 as 'color','' as 'customerNumber',mo.iUnitPrice as supplierExTaxPrice,'"+map.get("dVerifyDate")+"' as lineAttributeDatetime2," +
@@ -146,6 +146,7 @@ public class JsonChangeUtils implements ApplicationContextAware{
                 jf.put("totalAmount",totalAmount);
                 jf.put("exTaxAmount",exTaxAmount);
             }else if(map.get("pkorg").equals("three")){
+
                 BigDecimal totalAmount = BigDecimal.ZERO; //总金额
                 BigDecimal exTaxAmount = BigDecimal.ZERO;//总无税金额
                 String sql = "select mo.iVouchRowNo as 'poLineNum',mo.MODetailsID as MODetailsID,mo.MODetailsID as 'moDetailId','"+map.get("pkorg")+"' as pkorg," +
@@ -153,9 +154,9 @@ public class JsonChangeUtils implements ApplicationContextAware{
                         "'"+map.get("poNum")+"' as poNum,mo.cInvCode as 'customerItemCode',inv.cInvName as 'itemName',mo.dArriveDate as 'customerDemandDate', " +
                         "'' as 'poLineStatus',mo.cFree1 as cFree1,mo.cFree2 as cFree2,mo.cFree3 as cFree3,mo.cFree4 as cFree4," +
                         "mo.cFree5 as cFree5,mo.cFree6 as cFree6,mo.cFree7 as cFree7,mo.cFree8 as cFree8,mo.cFree9 as cFree9,mo.cFree10 as cFree10,mo.iQuantity as 'customerDemandQty',mo.cUnitID as 'customerUomCode'," +
-                        "mo.iMoney as 'iMoney'," +
+                        "case when mo.iMoney is null then '0' else mo.iMoney end as iMoney," +
                         "mo.iTax as lineAttributeDecimal1,mo.dbCloseDate as lineAttributeDatetime1,mo.cDefine24 as lineAttributeString9," +
-                        "mo.iTaxPrice as 'customerPrice',(mo.iPerTaxRate/100) as 'lineTaxRate',mo.iSum as 'amount',ex.cbdefine2 as lineAttributeString7,ex.cbdefine3 as lineAttributeString8," +
+                        "mo.iTaxPrice as 'customerPrice',(mo.iPerTaxRate/100) as 'lineTaxRate',case when mo.iSum is null then '0' else mo.iSum end as amount,ex.cbdefine2 as lineAttributeString7,ex.cbdefine3 as lineAttributeString8," +
                         "mo.cDefine28 as 'lineAttributeString1',mo.cDefine32 as 'lineAttributeString2',mo.cDefine29 as 'lineAttributeString3'," +
                         "mo.cDefine30 as 'lineAttributeString4',mo.cbMemo as 'lineAttributeString5',mo.cDefine22 as lineAttributeString6,'' as lineAttributeString7,'' as lineAttributeString8," +
                         "cFree1 as 'color','' as 'customerNumber',mo.iUnitPrice as supplierExTaxPrice,'"+map.get("dVerifyDate")+"' as lineAttributeDatetime2," +
@@ -163,10 +164,11 @@ public class JsonChangeUtils implements ApplicationContextAware{
                         "left join Inventory inv  on mo.cInvCode = inv.cInvCode "+
                         "left join OM_MOdetails_extradefine ex on mo.MODetailsID = ex.MODetailsID "+
                         " where mo.MOID = "+map.get("moId");
-                List<Map<String, Object>> list = iSenYuDataSourceThree.queryForList(sql);
+                List<Map<String, Object>> list = senYuDataSourceThree.queryForList(sql);
                 for(Map<String, Object> mapList:list){
                     totalAmount = totalAmount.add(new BigDecimal(mapList.get("amount").toString()));
                     exTaxAmount = exTaxAmount.add(new BigDecimal(mapList.get("iMoney").toString()));
+
                 }
                 //子表转JSON
                 List<JSONObject> json = toMOListJson(list);
@@ -285,7 +287,7 @@ public class JsonChangeUtils implements ApplicationContextAware{
                         "'' as 'externalLineNum',0 as 'itemAttrId' from PO_Podetails mo left join Inventory inv on mo.cInvCode = inv.cInvCode " +
                         "left join PO_Podetails_extradefine ex on mo.ID = ex.ID "+
                         " where mo.POID = '"+map.get("moId")+"'";
-                List<Map<String, Object>> list = iSenYuDataSourceThree.queryForList(sql);
+                List<Map<String, Object>> list = senYuDataSourceThree.queryForList(sql);
                 for(Map<String, Object> mapList:list){
                     totalAmount = totalAmount.add(new BigDecimal(mapList.get("amount").toString()));
                     exTaxAmount = exTaxAmount.add(new BigDecimal(mapList.get("iMoney").toString()));
@@ -509,7 +511,6 @@ public class JsonChangeUtils implements ApplicationContextAware{
                 List<JSONObject> json = toListJson(list);
                 jf.put("outSourceList",json);
             }else if(map.get("pkorg").equals("three")){
-
                 String sql1 = "select MOMaterialsID as moMaterialsId,'"+map.get("accId")+"' as accId,'"+map.get("MOID")+"' as poId,'"+map.get("poNum")+"' as poNum," +
                         "mo.cInvCode as 'customerItemCode','' as 'itemAttrId','' as customerItemId,mo.iUnitQuantity as 'bomUsage'," +
                         "mo.cFree1 as cFree1,mo.cFree2 as cFree2,mo.cFree3 as cFree3,mo.cFree4 as cFree4," +
@@ -517,7 +518,7 @@ public class JsonChangeUtils implements ApplicationContextAware{
                         "'' as poOutsourceId,''as poOutsourceNum,'' as 'customerUomId','' as customerUomCode,mo.iQuantity as customerPromiseQty, " +
                         "mo.cDefine25 as outsourceAttributeString1,mo.cDefine24 as 'outsourceAttributeString2',mo.cDefine27 as 'outsourceAttributeString3'" +
                         " from OM_MOMaterials mo where MODetailsID  = '"+map.get("MODetailsID")+"'";
-                List<Map<String, Object>> list = iSenYuDataSourceThree.queryForList(sql1);
+                List<Map<String, Object>> list = senYuDataSourceThree.queryForList(sql1);
                 //子表转JSON
                 List<JSONObject> json = toListJson(list);
                 jf.put("outSourceList",json);
@@ -554,6 +555,6 @@ public class JsonChangeUtils implements ApplicationContextAware{
 
         this.senYuDataSourceOne = applicationContext.getBean(ISenYuDataSourceOne.class);
         this.senYuDataSourceTwo = applicationContext.getBean(ISenYuDataSourceTwo.class);
-        this.iSenYuDataSourceThree = applicationContext.getBean(ISenYuDataSourceThree.class);
+        this.senYuDataSourceThree = applicationContext.getBean(ISenYuDataSourceThree.class);
     }
 }