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

采购订单调整

zengtx 3 éve
szülő
commit
bd7a81e56f

+ 3 - 7
jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/controller/MOMainController.java

@@ -104,11 +104,7 @@ public class MOMainController implements ApplicationContextAware {
                             " on mo.cPersonCode = hr1.cPsn_Num " +
                             " left join foreigncurrency curr " +
                             " on mo.cexch_name = curr.cexch_name " +
-                            " where ( mo.iVerifyStateNew = 2 or mo.cState = 2) and mo.dVerifyTime>'"+lasttimeSf+"' and cDefine10 is null or CHARINDEX('false',cDefine10) =1 order by mo.dCreateTime desc";
-
-//            String sql1 = "select top 2 '903' as accId,MOID as MOID,cPersonCode as buyerCode,cexch_name as currencyCode,cVenPerson as customerContacts,'联系人电话' as customerContactsPhone,'123' as customerNumber,cVenAccount as headerAttributeString1," +
-//                    "'合同号' as headerAttributeString2,'0097' as headerAttributeString3,'' as headerAttributeString4,'3' as headerTaxRate,cCode as poNum,'01' as poType,'0085' as supplierNumber " +
-//                    " from OM_MOMain where iVerifyStateNew = 2 or cState = 2 order by dCreateTime desc";
+                            " where  mo.iVerifyStateNew = 2 and (mo.dVerifyTime>'"+lasttimeSf+"' or mo.dChangeVerifyTime >'"+lasttimeSf+"')  order by mo.dCreateTime desc";
 
                     List<Map<String, Object>> list = senYuDataSourceOne.queryForList(sql);
                     for(Map<String, Object> map:list){
@@ -130,7 +126,7 @@ public class MOMainController implements ApplicationContextAware {
                             " on mo.cPersonCode = hr1.cPsn_Num " +
                             " left join foreigncurrency curr " +
                             " on mo.cexch_name = curr.cexch_name " +
-                            " where ( mo.iVerifyStateNew = 2 or mo.cState = 2) and mo.dVerifyTime>'"+lasttimeSf+"' and cDefine10 is null or CHARINDEX('false',cDefine10) =1 order by mo.dCreateTime desc";
+                            " where  mo.iVerifyStateNew = 2 and (mo.dVerifyTime>'"+lasttimeSf+"' or mo.dChangeVerifyTime >'"+lasttimeSf+"')  order by mo.dCreateTime desc";
 
                     List<Map<String, Object>> list = senYuDataSourceTwo.queryForList(sql);
                     for(Map<String, Object> map:list){
@@ -152,7 +148,7 @@ public class MOMainController implements ApplicationContextAware {
                             " on mo.cPersonCode = hr1.cPsn_Num " +
                             " left join foreigncurrency curr " +
                             " on mo.cexch_name = curr.cexch_name " +
-                            " where (mo.iVerifyStateNew = 2 or mo.cState = 2) and mo.dVerifyTime>'"+lasttimeSf+"' and cDefine10 is null or CHARINDEX('false',cDefine10) =1 order by mo.dCreateTime desc";
+                            " where  mo.iVerifyStateNew = 2 and (mo.dVerifyTime>'"+lasttimeSf+"' or mo.dChangeVerifyTime >'"+lasttimeSf+"')  order by mo.dCreateTime desc";
 
                     List<Map<String, Object>> list = iSenYuDataSourceThree.queryForList(sql);
                     for(Map<String, Object> map:list){

+ 8 - 7
jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/controller/POPomainController.java

@@ -85,7 +85,7 @@ public class POPomainController implements ApplicationContextAware {
                     //cAuditTime>'"+lasttimeSf+"' and mo.iverifystateex = 2
                     String sql = "select mo.POID as 'moId','"+ac+"' as accId,'"+pkorgValue[0]+"' as pkorg,mo.cState as 'poStatus',mo.cPOID as 'poNum','STANDARD_PO' as 'poType'," +
                             "'0085' as 'supplierNumber','采购业务实体名称' as 'poBusinessUnitCode','森鑫' as 'supplierName',mo.cPersonCode as headerAttributeString10,hr.cPsn_Num as 'headerAttributeString9'," +
-                            "ven.cVenPerson as 'supplierContacts',ven.cVenBranchPhone as 'supplierContactsPhone',mo.cMaker as 'customerContacts'," +
+                            "ven.cVenPerson as 'supplierContacts',ven.cVenBranchPhone as 'supplierContactsPhone'," +
                             "mo.cPOID as headerAttributeString2,'' as 'customerContactsPhone','0.00' as 'totalAmount'," +
                             "'0.00' as 'exTaxAmount', curr.cexch_code as 'currencyCode',mo.iTaxRate as 'headerTaxRate'," +
                             "mo.dPODate as 'customerDemandDate', mo.cMemo as 'remark','' as 'sourceDocNum'," +
@@ -97,16 +97,17 @@ public class POPomainController implements ApplicationContextAware {
                             "on mo.cPersonCode = hr1.cPsn_Num " +
                             "left join foreigncurrency curr " +
                             "on mo.cexch_name = curr.cexch_name " +
-                            "where cAuditTime>'"+lasttimeSf+"' and mo.iverifystateex = 2  and cDefine10 is null or CHARINDEX('false',cDefine10) =1  order by mo.cAuditTime desc";
+                            "where (cAuditTime>'"+lasttimeSf+"' or cChangAuditTime >'"+lasttimeSf+"') and mo.iverifystateex = 2 order by mo.cAuditTime desc";
                     List<Map<String, Object>> list = senYuDataSourceOne.queryForList(sql);
                     for(Map<String, Object> map:list){
                         sumlist.add(map);
                     }
 //mo.cPersonCode as salerId,hr.cPsn_Num as 'buyerId',
-                }else if(pkorgValue[0].equals("two")){
+                }
+                else if(pkorgValue[0].equals("two")){
                     String sql = "select mo.POID as 'moId','"+ac+"' as accId,'"+pkorgValue[0]+"' as pkorg,mo.cState as 'poStatus',mo.cPOID as 'poNum','STANDARD_PO' as 'poType'," +
                             "'0085' as 'supplierNumber','采购业务实体名称' as 'poBusinessUnitCode','森鑫' as 'supplierName',mo.cPersonCode as headerAttributeString10,hr.cPsn_Num as 'headerAttributeString9'," +
-                            "ven.cVenPerson as 'supplierContacts',ven.cVenBranchPhone as 'supplierContactsPhone',mo.cMaker as 'customerContacts'," +
+                            "ven.cVenPerson as 'supplierContacts',ven.cVenBranchPhone as 'supplierContactsPhone'," +
                             "mo.cPOID as headerAttributeString2,'' as 'customerContactsPhone','0.00' as 'totalAmount'," +
                             "'0.00' as 'exTaxAmount', curr.cexch_code as 'currencyCode',mo.iTaxRate as 'headerTaxRate'," +
                             "mo.dPODate as 'customerDemandDate',mo.cMemo as 'remark','' as 'sourceDocNum'," +
@@ -118,7 +119,7 @@ public class POPomainController implements ApplicationContextAware {
                             "on mo.cPersonCode = hr1.cPsn_Num " +
                             "left join foreigncurrency curr " +
                             "on mo.cexch_name = curr.cexch_name " +
-                            "where cAuditTime>'"+lasttimeSf+"' and mo.iverifystateex = 2  and cDefine10 is null or CHARINDEX('false',cDefine10) =1 order by mo.cAuditTime desc";
+                            "where (cAuditTime>'"+lasttimeSf+"' or cChangAuditTime >'"+lasttimeSf+"') and mo.iverifystateex = 2 order by mo.cAuditTime desc";
                     List<Map<String, Object>> list = senYuDataSourceTwo.queryForList(sql);
                     for(Map<String, Object> map:list){
                         sumlist.add(map);
@@ -127,7 +128,7 @@ public class POPomainController implements ApplicationContextAware {
                 }else if(pkorgValue[0].equals("three")){
                     String sql = "select mo.POID as 'moId','"+ac+"' as accId,'"+pkorgValue[0]+"' as pkorg,mo.cState as 'poStatus',mo.cPOID as 'poNum','STANDARD_PO' as 'poType'," +
                             "'0085' as 'supplierNumber','采购业务实体名称' as 'poBusinessUnitCode','森鑫' as 'supplierName',mo.cPersonCode as headerAttributeString10,hr.cPsn_Num as 'headerAttributeString9'," +
-                            "ven.cVenPerson as 'supplierContacts',ven.cVenBranchPhone as 'supplierContactsPhone',mo.cMaker as 'customerContacts'," +
+                            "ven.cVenPerson as 'supplierContacts',ven.cVenBranchPhone as 'supplierContactsPhone'," +
                             "mo.cPOID as headerAttributeString2,'' as 'customerContactsPhone','0.00' as 'totalAmount'," +
                             "'0.00' as 'exTaxAmount', curr.cexch_code as 'currencyCode',mo.iTaxRate as 'headerTaxRate'," +
                             "mo.dPODate as 'customerDemandDate', mo.cMemo as 'remark','' as 'sourceDocNum'," +
@@ -139,7 +140,7 @@ public class POPomainController implements ApplicationContextAware {
                             "on mo.cPersonCode = hr1.cPsn_Num " +
                             "left join foreigncurrency curr " +
                             "on mo.cexch_name = curr.cexch_name " +
-                            "where cAuditTime>'"+lasttimeSf+"' and mo.iverifystateex = 2  and cDefine10 is null or CHARINDEX('false',cDefine10) =1 order by mo.cAuditTime desc";
+                            "where (cAuditTime>'"+lasttimeSf+"' or cChangAuditTime >'"+lasttimeSf+"') and mo.iverifystateex = 2 order by mo.cAuditTime desc";
                     List<Map<String, Object>> list = iSenYuDataSourceThree.queryForList(sql);
                     for(Map<String, Object> map:list){
                         sumlist.add(map);

+ 108 - 34
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/util/JsonChangeUtils.java

@@ -65,10 +65,9 @@ public class JsonChangeUtils implements ApplicationContextAware{
                 BigDecimal exTaxAmount = BigDecimal.ZERO;//总无税金额
                 String sql = "select mo.iVouchRowNo as 'poLineNum',mo.MODetailsID as MODetailsID,mo.MODetailsID as 'moDetailId','"+map.get("pkorg")+"' as pkorg," +
                         "'' as receivingInventoryOrgCode,'"+map.get("moId")+"' as MOID,'"+map.get("accId")+"' as 'accId'," +
-                        "'"+map.get("poNum")+"' as poNum,mo.cInvCode as 'customerItemCode',inv.cInvName as 'itemName',mo.dArriveDate as 'supplierPromiseDate'," +
-                        "'' as 'poLineStatus',mo.cFree1 as 'attributeValue1',mo.cFree2 as 'attributeValue2',mo.cFree3 as 'attributeValue3'," +
-                        "mo.cFree4 as 'attributeValue4','cfree1' as 'attributeCode1','cfree2'  as 'attributeCode2','cfree3'  as 'attributeCode3'," +
-                        "'cfree4'  as 'attributeCode4',mo.iQuantity as 'customerDemandQty',mo.cUnitID as 'customerUomCode'," +
+                        "'"+map.get("poNum")+"' as poNum,mo.cInvCode as 'customerItemCode',inv.cInvName as 'itemName',mo.dArriveDate as 'supplierPromiseDate', " +
+                        "'' 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'," +
                         "'"+map.get("customerDemandDate")+"' as 'customerDemandDate',mo.iMoney as 'iMoney'," +
                         "mo.iTaxPrice as 'customerPrice',(mo.iPerTaxRate/100) as 'lineTaxRate',mo.iSum as 'amount'," +
                         "mo.cDefine28 as 'lineAttributeString1',mo.cDefine32 as 'lineAttributeString2',mo.cDefine29 as 'lineAttributeString3'," +
@@ -92,10 +91,9 @@ public class JsonChangeUtils implements ApplicationContextAware{
                 BigDecimal exTaxAmount = BigDecimal.ZERO;//总无税金额
                 String sql = "select mo.iVouchRowNo as 'poLineNum',mo.MODetailsID as MODetailsID,mo.MODetailsID as 'moDetailId','"+map.get("pkorg")+"' as pkorg," +
                         "'' as receivingInventoryOrgCode,'"+map.get("moId")+"' as MOID,'"+map.get("accId")+"' as 'accId'," +
-                        "'"+map.get("poNum")+"' as poNum,mo.cInvCode as 'customerItemCode',inv.cInvName as 'itemName',mo.dArriveDate as 'supplierPromiseDate'," +
-                        "'' as 'poLineStatus',mo.cFree1 as 'attributeValue1',mo.cFree2 as 'attributeValue2',mo.cFree3 as 'attributeValue3'," +
-                        "mo.cFree4 as 'attributeValue4','cfree1' as 'attributeCode1','cfree2'  as 'attributeCode2','cfree3'  as 'attributeCode3'," +
-                        "'cfree4'  as 'attributeCode4',mo.iQuantity as 'customerDemandQty',mo.cUnitID as 'customerUomCode'," +
+                        "'"+map.get("poNum")+"' as poNum,mo.cInvCode as 'customerItemCode',inv.cInvName as 'itemName',mo.dArriveDate as 'supplierPromiseDate', " +
+                        "'' 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'," +
                         "'"+map.get("customerDemandDate")+"' as 'customerDemandDate',mo.iMoney as 'iMoney'," +
                         "mo.iTaxPrice as 'customerPrice',(mo.iPerTaxRate/100) as 'lineTaxRate',mo.iSum as 'amount'," +
                         "mo.cDefine28 as 'lineAttributeString1',mo.cDefine32 as 'lineAttributeString2',mo.cDefine29 as 'lineAttributeString3'," +
@@ -120,9 +118,8 @@ public class JsonChangeUtils implements ApplicationContextAware{
                 String sql = "select mo.iVouchRowNo as 'poLineNum',mo.MODetailsID as MODetailsID,mo.MODetailsID as 'moDetailId','"+map.get("pkorg")+"' as pkorg," +
                         "'' as receivingInventoryOrgCode,'"+map.get("moId")+"' as MOID,'"+map.get("accId")+"' as 'accId'," +
                         "'"+map.get("poNum")+"' as poNum,mo.cInvCode as 'customerItemCode',inv.cInvName as 'itemName',mo.dArriveDate as 'supplierPromiseDate', " +
-                        "'' as 'poLineStatus',mo.cFree1 as 'attributeValue1',mo.cFree2 as 'attributeValue2',mo.cFree3 as 'attributeValue3'," +
-                        "mo.cFree4 as 'attributeValue4','cfree1' as 'attributeCode1','cfree2'  as 'attributeCode2','cfree3'  as 'attributeCode3'," +
-                        "'cfree4'  as 'attributeCode4',mo.iQuantity as 'customerDemandQty',mo.cUnitID as 'customerUomCode'," +
+                        "'' 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'," +
                         "'"+map.get("customerDemandDate")+"' as 'customerDemandDate',mo.iMoney as 'iMoney'," +
                         "mo.iTaxPrice as 'customerPrice',(mo.iPerTaxRate/100) as 'lineTaxRate',mo.iSum as 'amount'," +
                         "mo.cDefine28 as 'lineAttributeString1',mo.cDefine32 as 'lineAttributeString2',mo.cDefine29 as 'lineAttributeString3'," +
@@ -184,9 +181,8 @@ public class JsonChangeUtils implements ApplicationContextAware{
 
                 String sql ="select '"+map.get("accId")+"' as 'accId',mo.iVouchRowNo as 'poLineNum',ID as 'moDetailId','"+map.get("poNum")+"' as poNum," +
                         "mo.cInvCode as 'customerItemCode',inv.cInvName as 'itemName','' as 'poLineStatus',mo.dArriveDate as 'supplierPromiseDate'," +
-                        "'' as receivingInventoryOrgCode,mo.cFree1 as 'attributeValue1',mo.cFree2 as 'attributeValue2'," +
-                        "mo.cFree3 as 'attributeValue3',mo.cFree4 as 'attributeValue4','cfree1' as 'attributeCode1','cfree2'  as 'attributeCode2'," +
-                        "'cfree3'  as 'attributeCode3','cfree4'  as 'attributeCode4',mo.iQuantity as 'customerDemandQty',mo.cUnitID as 'customerUomCode'," +
+                        "'' as receivingInventoryOrgCode,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'," +
                         "'"+map.get("customerDemandDate")+"' as 'customerDemandDate',mo.iMoney as 'iMoney'," +
                         "mo.iTaxPrice as 'customerPrice',(mo.iPerTaxRate/100) as 'lineTaxRate',mo.iSum as 'amount',mo.cDefine28 as 'lineAttributeString1'," +
                         "mo.cDefine32 as 'lineAttributeString2',mo.cDefine29 as 'lineAttributeString3','' as 'attributeString1',mo.cDefine30 as 'lineAttributeString4'," +
@@ -203,14 +199,14 @@ public class JsonChangeUtils implements ApplicationContextAware{
                 jf.put("poLineList",json);
                 jf.put("totalAmount",totalAmount);
                 jf.put("exTaxAmount",exTaxAmount);
-            }else if(map.get("pkorg").equals("two")){
+            }
+            else if(map.get("pkorg").equals("two")){
                 BigDecimal totalAmount = BigDecimal.ZERO; //总金额
                 BigDecimal exTaxAmount = BigDecimal.ZERO;//总无税金额
                 String sql ="select '"+map.get("accId")+"' as 'accId',mo.iVouchRowNo as 'poLineNum',ID as 'moDetailId','"+map.get("poNum")+"' as poNum," +
                         "mo.cInvCode as 'customerItemCode',inv.cInvName as 'itemName','' as 'poLineStatus',mo.dArriveDate as 'supplierPromiseDate'," +
-                        "'' as receivingInventoryOrgCode,mo.cFree1 as 'attributeValue1',mo.cFree2 as 'attributeValue2'," +
-                        "mo.cFree3 as 'attributeValue3',mo.cFree4 as 'attributeValue4','cfree1' as 'attributeCode1','cfree2'  as 'attributeCode2'," +
-                        "'cfree3'  as 'attributeCode3','cfree4'  as 'attributeCode4',mo.iQuantity as 'customerDemandQty',mo.cUnitID as 'customerUomCode'," +
+                        "'' as receivingInventoryOrgCode,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'," +
                         "'"+map.get("customerDemandDate")+"' as 'customerDemandDate',mo.iMoney as 'iMoney'," +
                         "mo.iTaxPrice as 'customerPrice',(mo.iPerTaxRate/100) as 'lineTaxRate',mo.iSum as 'amount',mo.cDefine28 as 'lineAttributeString1'," +
                         "mo.cDefine32 as 'lineAttributeString2',mo.cDefine29 as 'lineAttributeString3','' as 'attributeString1',mo.cDefine30 as 'lineAttributeString4'," +
@@ -232,9 +228,8 @@ public class JsonChangeUtils implements ApplicationContextAware{
                 BigDecimal exTaxAmount = BigDecimal.ZERO;//总无税金额
                 String sql ="select '"+map.get("accId")+"' as 'accId',mo.iVouchRowNo as 'poLineNum',ID as 'moDetailId','"+map.get("poNum")+"' as poNum," +
                         "mo.cInvCode as 'customerItemCode',inv.cInvName as 'itemName','' as 'poLineStatus',mo.dArriveDate as 'supplierPromiseDate'," +
-                        "'' as receivingInventoryOrgCode,mo.cFree1 as 'attributeValue1',mo.cFree2 as 'attributeValue2'," +
-                        "mo.cFree3 as 'attributeValue3',mo.cFree4 as 'attributeValue4','cfree1' as 'attributeCode1','cfree2'  as 'attributeCode2'," +
-                        "'cfree3'  as 'attributeCode3','cfree4'  as 'attributeCode4',mo.iQuantity as 'customerDemandQty',mo.cUnitID as 'customerUomCode'," +
+                        "'' as receivingInventoryOrgCode,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'," +
                         "'"+map.get("customerDemandDate")+"' as 'customerDemandDate',mo.iMoney as 'iMoney'," +
                         "mo.iTaxPrice as 'customerPrice',(mo.iPerTaxRate/100) as 'lineTaxRate',mo.iSum as 'amount',mo.cDefine28 as 'lineAttributeString1'," +
                         "mo.cDefine32 as 'lineAttributeString2',mo.cDefine29 as 'lineAttributeString3','' as 'attributeString1',mo.cDefine30 as 'lineAttributeString4'," +
@@ -310,6 +305,8 @@ public class JsonChangeUtils implements ApplicationContextAware{
      */
     public static List<JSONObject> toListJson(List<Map<String, Object>> result) {
         List<JSONObject> pljf = new ArrayList<JSONObject>();// 表数据json集合
+        Map<String, Object> mapCfree = new HashMap<>();//处理物料属性
+        int ii = 1;
         SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd");
         JSONObject jf = new JSONObject();
         for (int i = 0; i < result.size(); i++) {
@@ -320,12 +317,50 @@ public class JsonChangeUtils implements ApplicationContextAware{
                 if(null==map.get(key)){
                     jf.put(key, "");
                 }else{
+                    if(key.equals("cFree1")&&oConvertUtils.isNotEmpty(map.get(key))){
+                        mapCfree.put(key,map.get(key));
+                    }else if(key.equals("cFree2")&&oConvertUtils.isNotEmpty(map.get(key))){
+                        mapCfree.put(key,map.get(key));
+                    }else if(key.equals("cFree3")&&oConvertUtils.isNotEmpty(map.get(key))){
+                        mapCfree.put(key,map.get(key));
+                    }else if(key.equals("cFree4")&&oConvertUtils.isNotEmpty(map.get(key))){
+                        mapCfree.put(key,map.get(key));
+                    }else if(key.equals("cFree5")&&oConvertUtils.isNotEmpty(map.get(key))){
+                        mapCfree.put(key,map.get(key));
+                    }else if(key.equals("cFree6")&&oConvertUtils.isNotEmpty(map.get(key))){
+                        mapCfree.put(key,map.get(key));
+                    }else if(key.equals("cFree7")&&oConvertUtils.isNotEmpty(map.get(key))){
+                        mapCfree.put(key,map.get(key));
+                    }else if(key.equals("cFree8")&&oConvertUtils.isNotEmpty(map.get(key))){
+                        mapCfree.put(key,map.get(key));
+                    }else if(key.equals("cFree9")&&oConvertUtils.isNotEmpty(map.get(key))){
+                        mapCfree.put(key,map.get(key));
+                    }else if(key.equals("cFree10")&&oConvertUtils.isNotEmpty(map.get(key))){
+                        mapCfree.put(key,map.get(key));
+                    }
                     jf.put(key, map.get(key));
                 }
             }
             String supplierPromiseDate = sf.format(map.get("supplierPromiseDate"));
             jf.put("supplierPromiseDate",supplierPromiseDate+" 00:00:00");
+            Set<String> keysCfree = mapCfree.keySet();
+            for (String key : keysCfree) {
+                jf.put("attributeCode"+ii, key);
+                jf.put("attributeValue"+ii, map.get(key));
+                ii++;
+            }
+            ii = 1;
             jf.remove("iMoney");
+            jf.remove("cFree1");
+            jf.remove("cFree2");
+            jf.remove("cFree3");
+            jf.remove("cFree4");
+            jf.remove("cFree5");
+            jf.remove("cFree6");
+            jf.remove("cFree7");
+            jf.remove("cFree8");
+            jf.remove("cFree9");
+            jf.remove("cFree10");
             pljf.add(jf);
         }
         return pljf;
@@ -338,6 +373,8 @@ public class JsonChangeUtils implements ApplicationContextAware{
      */
     public static List<JSONObject> toMOListJson(List<Map<String, Object>> result) {
         List<JSONObject> pljf = new ArrayList<JSONObject>();// 表数据json集合
+        Map<String, Object> mapCfree = new HashMap<>();//处理物料属性
+        int ii = 1;
         SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd");
         JSONObject jf = new JSONObject();
         for (int i = 0; i < result.size(); i++) {
@@ -348,6 +385,27 @@ public class JsonChangeUtils implements ApplicationContextAware{
                 if(null==map.get(key)){
                     jf.put(key, "");
                 }else{
+                    if(key.equals("cFree1")&&oConvertUtils.isNotEmpty(map.get(key))){
+                        mapCfree.put(key,map.get(key));
+                    }else if(key.equals("cFree2")&&oConvertUtils.isNotEmpty(map.get(key))){
+                        mapCfree.put(key,map.get(key));
+                    }else if(key.equals("cFree3")&&oConvertUtils.isNotEmpty(map.get(key))){
+                        mapCfree.put(key,map.get(key));
+                    }else if(key.equals("cFree4")&&oConvertUtils.isNotEmpty(map.get(key))){
+                        mapCfree.put(key,map.get(key));
+                    }else if(key.equals("cFree5")&&oConvertUtils.isNotEmpty(map.get(key))){
+                        mapCfree.put(key,map.get(key));
+                    }else if(key.equals("cFree6")&&oConvertUtils.isNotEmpty(map.get(key))){
+                        mapCfree.put(key,map.get(key));
+                    }else if(key.equals("cFree7")&&oConvertUtils.isNotEmpty(map.get(key))){
+                        mapCfree.put(key,map.get(key));
+                    }else if(key.equals("cFree8")&&oConvertUtils.isNotEmpty(map.get(key))){
+                        mapCfree.put(key,map.get(key));
+                    }else if(key.equals("cFree9")&&oConvertUtils.isNotEmpty(map.get(key))){
+                        mapCfree.put(key,map.get(key));
+                    }else if(key.equals("cFree10")&&oConvertUtils.isNotEmpty(map.get(key))){
+                        mapCfree.put(key,map.get(key));
+                    }
                     jf.put(key, map.get(key));
                 }
             }
@@ -357,10 +415,10 @@ public class JsonChangeUtils implements ApplicationContextAware{
             if(map.get("pkorg").equals("one")){
 
                 String sql1 = "select '"+map.get("accId")+"' as accId,'"+map.get("MOID")+"' as poId,'"+map.get("poNum")+"' as poNum," +
-                        "'N0201002142' as 'customerItemCode','' as 'itemAttrId','cfree1' as attributeCode1,'' as customerItemId," +
-                        "'cfree2' as attributeCode2,'cfree3' as attributeCode3,'cfree4' as attributeCode4,'' as poOutsourceId," +
-                        "''as poOutsourceNum,cFree1 as attributeValue1,cFree2 as attributeValue2,cFree3 as attributeValue3," +
-                        "cFree4 as attributeValue4,'' as 'customerUomId','' as customerUomCode,0 as customerPromiseQty, " +
+                        "'N0201002142' as 'customerItemCode','' as 'itemAttrId','' as customerItemId," +
+                        "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," +
+                        "'' as poOutsourceId,''as poOutsourceNum,'' as 'customerUomId','' as customerUomCode,0 as customerPromiseQty, " +
                         "cDefine25 as outsourceAttributeString1,cDefine24 as 'outsourceAttributeString2',cDefine27 as 'outsourceAttributeString3'" +
                         " from OM_MOMaterials where MODetailsID  = '"+map.get("MODetailsID")+"'";
                 List<Map<String, Object>> list = senYuDataSourceOne.queryForList(sql1);
@@ -370,10 +428,10 @@ public class JsonChangeUtils implements ApplicationContextAware{
             }else if(map.get("pkorg").equals("two")){
 
                 String sql1 = "select '"+map.get("accId")+"' as accId,'"+map.get("MOID")+"' as poId,'"+map.get("poNum")+"' as poNum," +
-                        "'N0201002142' as 'customerItemCode','' as 'itemAttrId','cfree1' as attributeCode1,'' as customerItemId," +
-                        "'cfree2' as attributeCode2,'cfree3' as attributeCode3,'cfree4' as attributeCode4,'' as poOutsourceId," +
-                        "''as poOutsourceNum,cFree1 as attributeValue1,cFree2 as attributeValue2,cFree3 as attributeValue3," +
-                        "cFree4 as attributeValue4,'' as 'customerUomId','' as customerUomCode,0 as customerPromiseQty, " +
+                        "'N0201002142' as 'customerItemCode','' as 'itemAttrId','' as customerItemId," +
+                        "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," +
+                        "'' as poOutsourceId,''as poOutsourceNum,'' as 'customerUomId','' as customerUomCode,0 as customerPromiseQty, " +
                         "cDefine25 as outsourceAttributeString1,cDefine24 as 'outsourceAttributeString2',cDefine27 as 'outsourceAttributeString3'" +
                         " from OM_MOMaterials where MODetailsID  = '"+map.get("MODetailsID")+"'";
                 List<Map<String, Object>> list = senYuDataSourceTwo.queryForList(sql1);
@@ -383,10 +441,10 @@ public class JsonChangeUtils implements ApplicationContextAware{
             }else if(map.get("pkorg").equals("three")){
 
                 String sql1 = "select '"+map.get("accId")+"' as accId,'"+map.get("MOID")+"' as poId,'"+map.get("poNum")+"' as poNum," +
-                        "'N0201002142' as 'customerItemCode','' as 'itemAttrId','cfree1' as attributeCode1,'' as customerItemId," +
-                        "'cfree2' as attributeCode2,'cfree3' as attributeCode3,'cfree4' as attributeCode4,'' as poOutsourceId," +
-                        "''as poOutsourceNum,cFree1 as attributeValue1,cFree2 as attributeValue2,cFree3 as attributeValue3," +
-                        "cFree4 as attributeValue4,'' as 'customerUomId','' as customerUomCode,0 as customerPromiseQty, " +
+                        "'N0201002142' as 'customerItemCode','' as 'itemAttrId','' as customerItemId," +
+                        "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," +
+                        "'' as poOutsourceId,''as poOutsourceNum,'' as 'customerUomId','' as customerUomCode,0 as customerPromiseQty, " +
                         "cDefine25 as outsourceAttributeString1,cDefine24 as 'outsourceAttributeString2',cDefine27 as 'outsourceAttributeString3'" +
                         " from OM_MOMaterials where MODetailsID  = '"+map.get("MODetailsID")+"'";
                 List<Map<String, Object>> list = iSenYuDataSourceThree.queryForList(sql1);
@@ -394,7 +452,23 @@ public class JsonChangeUtils implements ApplicationContextAware{
                 List<JSONObject> json = toListJson(list);
                 jf.put("outSourceList",json);
             }
-
+            Set<String> keysCfree = mapCfree.keySet();
+            for (String key : keysCfree) {
+                jf.put("attributeCode"+ii, key);
+                jf.put("attributeValue"+ii, map.get(key));
+                ii++;
+            }
+            ii = 1;
+            jf.remove("cFree1");
+            jf.remove("cFree2");
+            jf.remove("cFree3");
+            jf.remove("cFree4");
+            jf.remove("cFree5");
+            jf.remove("cFree6");
+            jf.remove("cFree7");
+            jf.remove("cFree8");
+            jf.remove("cFree9");
+            jf.remove("cFree10");
                 jf.remove("MODetailsID");
                 jf.remove("MOID");
                 jf.remove("pkorg");