瀏覽代碼

订单接口调整

zengtx 3 年之前
父節點
當前提交
31af6ba6ec

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

@@ -88,9 +88,9 @@ public class MOMainController implements ApplicationContextAware {
                 String pkorgValue[] = pkorgStr.split(":");
                 String ac = pkorgValue[1];
                 if (pkorgValue[0].equals("one")) {//mo.cPersonCode as 'salerId',hr.cPsn_Num as 'buyerId',
-                    String sql = "select mo.MOID as 'headerAttributeString6',mo.MOID as 'moId','"+ac+"' as accId,'"+pkorgValue[0]+"' as pkorg,mo.cState as 'poStatus'," +
+                    String sql = "select mo.MOID as 'moId',mo.MOID as 'moId','"+ac+"' as accId,'"+pkorgValue[0]+"' as pkorg,mo.cState as 'poStatus'," +
                             "mo.cCode as 'poNum','SUBCONTRACTOR_PO' as 'poType','0085' as 'supplierNumber','森鑫' as 'supplierName'," +
-                            "ven.cVenPerson as 'supplierContacts',ven.cVenBranchPhone as 'supplierContactsPhone'," +
+                            "ven.cVenPerson as 'supplierContacts',ven.cVenBranchPhone as 'supplierContactsPhone',mo.cPersonCode as 'headerAttributeString10',hr.cPsn_Num as 'headerAttributeString9'," +
                             "hr1.cPsn_Name as 'salerCode',mo.cVenPerson as 'customerContacts','采购业务实体名称' as poBusinessUnitCode," +
                             "'' as 'customerContactsPhone','0.00' as 'totalAmount','0.00' as 'exTaxAmount', curr.cexch_code as 'currencyCode'," +
                             "mo.iTaxRate as 'headerTaxRate',mo.dDate as 'customerDemandDate','' as 'supplierPromiseDate', mo.cMemo as 'remark'," +
@@ -103,7 +103,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.dCreateTime>'"+lasttimeSf+"'  order by mo.dCreateTime desc";
+                            " 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 " +
@@ -114,9 +114,9 @@ public class MOMainController implements ApplicationContextAware {
                         sumlist.add(map);
                     }//mo.cPersonCode as 'salerId',hr.cPsn_Num as 'buyerId',
                 }else if(pkorgValue[0].equals("two")){
-                    String sql = "select mo.MOID as 'headerAttributeString6',mo.MOID as 'moId','"+ac+"' as accId,'"+pkorgValue[0]+"' as pkorg,mo.cState as 'poStatus'," +
+                    String sql = "select mo.MOID as 'moId',mo.MOID as 'moId','"+ac+"' as accId,'"+pkorgValue[0]+"' as pkorg,mo.cState as 'poStatus'," +
                             "mo.cCode as 'poNum','SUBCONTRACTOR_PO' as 'poType','0085' as 'supplierNumber','森鑫' as 'supplierName'," +
-                            "ven.cVenPerson as 'supplierContacts',ven.cVenBranchPhone as 'supplierContactsPhone'," +
+                            "ven.cVenPerson as 'supplierContacts',ven.cVenBranchPhone as 'supplierContactsPhone',mo.cPersonCode as 'headerAttributeString10',hr.cPsn_Num as 'headerAttributeString9'," +
                             "hr1.cPsn_Name as 'salerCode',mo.cVenPerson as 'customerContacts','采购业务实体名称' as poBusinessUnitCode," +
                             "'' as 'customerContactsPhone','0.00' as 'totalAmount','0.00' as 'exTaxAmount', curr.cexch_code as 'currencyCode'," +
                             "mo.iTaxRate as 'headerTaxRate',mo.dDate as 'customerDemandDate','' as 'supplierPromiseDate', mo.cMemo as 'remark'," +
@@ -129,16 +129,16 @@ 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.dCreateTime>'"+lasttimeSf+"'  order by mo.dCreateTime desc";
+                            " 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";
 
                     List<Map<String, Object>> list = senYuDataSourceTwo.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("three")){
-                    String sql = "select mo.MOID as 'headerAttributeString6',mo.MOID as 'moId','"+ac+"' as accId,'"+pkorgValue[0]+"' as pkorg,mo.cState as 'poStatus'," +
+                    String sql = "select mo.MOID as 'moId',mo.MOID as 'moId','"+ac+"' as accId,'"+pkorgValue[0]+"' as pkorg,mo.cState as 'poStatus'," +
                             "mo.cCode as 'poNum','SUBCONTRACTOR_PO' as 'poType','0085' as 'supplierNumber','森鑫' as 'supplierName'," +
-                            "ven.cVenPerson as 'supplierContacts',ven.cVenBranchPhone as 'supplierContactsPhone'," +
+                            "ven.cVenPerson as 'supplierContacts',ven.cVenBranchPhone as 'supplierContactsPhone',mo.cPersonCode as 'headerAttributeString10',hr.cPsn_Num as 'headerAttributeString9'," +
                             "hr1.cPsn_Name as 'salerCode',mo.cVenPerson as 'customerContacts','采购业务实体名称' as poBusinessUnitCode," +
                             "'' as 'customerContactsPhone','0.00' as 'totalAmount','0.00' as 'exTaxAmount', curr.cexch_code as 'currencyCode'," +
                             "mo.iTaxRate as 'headerTaxRate',mo.dDate as 'customerDemandDate','' as 'supplierPromiseDate', mo.cMemo as 'remark'," +
@@ -151,7 +151,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.dCreateTime>'"+lasttimeSf+"'  order by mo.dCreateTime desc";
+                            " 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";
 
                     List<Map<String, Object>> list = iSenYuDataSourceThree.queryForList(sql);
                     for(Map<String, Object> map:list){
@@ -177,7 +177,7 @@ public class MOMainController implements ApplicationContextAware {
                     //处理返回信息
                     JSONObject informationJson = interfaceConnUtils.doPostToBearer(result, url,tokenUrl, "委外订单接口-");
 
-                    JSONArray jsonArray = informationJson.getJSONArray("head");
+                    JSONArray jsonArray = informationJson.getJSONArray("payload");
                     if (jsonArray.size() != 0) {
                         //获取4个账套值
                         String yi = "";
@@ -209,30 +209,38 @@ public class MOMainController implements ApplicationContextAware {
                             String moId = jo.getString("moId");
                             //账套号
                             String accId = jo.getString("accId");
+                            //订单类型
+                            String type = jo.getString("type");
                             //账套666
                             if (accId.equals(yi)) {
-                                if (code.equals("S")) {
-                                    String sql1 = "update HY_MOMain set cDefine10 = ? where cCode = ?";
-                                    senYuDataSourceOne.updateMOMain(sql1, "true," + message, moId);
-                                } else {
-                                    String sql1 = "update HY_MOMain set cDefine10 = ? where cCode = ?";
-                                    senYuDataSourceOne.updateMOMain(sql1, "false," + message, moId);
+                                if(type.equals("SUBCONTRACTOR_PO")) {
+                                    if (code.equals("S")) {
+                                        String sql1 = "update OM_MOMain set cDefine10 = ? where MOID = ?";
+                                        senYuDataSourceOne.updateMOMain(sql1, "true," + message, moId);
+                                    } else {
+                                        String sql1 = "update OM_MOMain set cDefine10 = ? where MOID = ?";
+                                        senYuDataSourceOne.updateMOMain(sql1, "false," + message, moId);
+                                    }
                                 }
                             }else if (accId.equals(er)) {
-                                if (code.equals("S")) {
-                                    String sql1 = "update HY_MOMain set cDefine10 = ? where cCode = ?";
-                                    senYuDataSourceOne.updateMOMain(sql1, "true," + message, moId);
-                                } else {
-                                    String sql1 = "update HY_MOMain set cDefine10 = ? where cCode = ?";
-                                    senYuDataSourceOne.updateMOMain(sql1, "false," + message, moId);
+                                if(type.equals("SUBCONTRACTOR_PO")) {
+                                    if (code.equals("S")) {
+                                        String sql1 = "update OM_MOMain set cDefine10 = ? where MOID = ?";
+                                        senYuDataSourceTwo.updateMOMain(sql1, "true," + message, moId);
+                                    } else {
+                                        String sql1 = "update OM_MOMain set cDefine10 = ? where MOID = ?";
+                                        senYuDataSourceTwo.updateMOMain(sql1, "false," + message, moId);
+                                    }
                                 }
                             }else if (accId.equals(san)) {
-                                if (code.equals("S")) {
-                                    String sql1 = "update HY_MOMain set cDefine10 = ? where cCode = ?";
-                                    senYuDataSourceOne.updateMOMain(sql1, "true," + message, moId);
-                                } else {
-                                    String sql1 = "update HY_MOMain set cDefine10 = ? where cCode = ?";
-                                    senYuDataSourceOne.updateMOMain(sql1, "false," + message, moId);
+                                if(type.equals("SUBCONTRACTOR_PO")) {
+                                    if (code.equals("S")) {
+                                        String sql1 = "update OM_MOMain set cDefine10 = ? where MOID = ?";
+                                        iSenYuDataSourceThree.updateMOMain(sql1, "true," + message, moId);
+                                    } else {
+                                        String sql1 = "update OM_MOMain set cDefine10 = ? where MOID = ?";
+                                        iSenYuDataSourceThree.updateMOMain(sql1, "false," + message, moId);
+                                    }
                                 }
                             }
 

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

@@ -82,8 +82,8 @@ public class POPomainController implements ApplicationContextAware {
                 if (pkorgValue[0].equals("one")) {
                     //ven.cVenName,mo.cVenCode mo.cPersonCode as salerId,hr.cPsn_Num as 'buyerId',
                     //cAuditTime>'"+lasttimeSf+"' and mo.iverifystateex = 2
-                    String sql = "select mo.POID as 'headerAttributeString6','"+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'," +
+                    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.cVenPerson as 'customerContacts'," +
                             "mo.cPOID as headerAttributeString2,'' as 'customerContactsPhone','0.00' as 'totalAmount','0.00' as 'exTotalAmount'," +
                             "'0.00' as 'exTaxAmount', curr.cexch_code as 'currencyCode',mo.iTaxRate as 'headerTaxRate'," +
@@ -96,15 +96,15 @@ 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 order by mo.cAuditTime desc";
+                            "where cAuditTime>'"+lasttimeSf+"' and mo.iverifystateex = 2  and cDefine10 is null or CHARINDEX('false',cDefine10) =1  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")){
-                    String sql = "select mo.POID as 'headerAttributeString6','"+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'," +
+                    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.cVenPerson as 'customerContacts'," +
                             "mo.cPOID as headerAttributeString2,'' as 'customerContactsPhone','0.00' as 'totalAmount','0.00' as 'exTotalAmount'," +
                             "'0.00' as 'exTaxAmount', curr.cexch_code as 'currencyCode',mo.iTaxRate as 'headerTaxRate'," +
@@ -117,15 +117,15 @@ 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 order by mo.cAuditTime desc";
+                            "where cAuditTime>'"+lasttimeSf+"' and mo.iverifystateex = 2  and cDefine10 is null or CHARINDEX('false',cDefine10) =1 order by mo.cAuditTime desc";
                     List<Map<String, Object>> list = senYuDataSourceTwo.queryForList(sql);
                     for(Map<String, Object> map:list){
                         sumlist.add(map);
                     }
 //hr.cPsn_Num as 'buyerId',mo.cPersonCode as salerId,
                 }else if(pkorgValue[0].equals("three")){
-                    String sql = "select mo.POID as 'headerAttributeString6','"+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'," +
+                    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.cVenPerson as 'customerContacts'," +
                             "mo.cPOID as headerAttributeString2,'' as 'customerContactsPhone','0.00' as 'totalAmount','0.00' as 'exTotalAmount'," +
                             "'0.00' as 'exTaxAmount', curr.cexch_code as 'currencyCode',mo.iTaxRate as 'headerTaxRate'," +
@@ -138,7 +138,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 order by mo.cAuditTime desc";
+                            "where cAuditTime>'"+lasttimeSf+"' and mo.iverifystateex = 2  and cDefine10 is null or CHARINDEX('false',cDefine10) =1 order by mo.cAuditTime desc";
                     List<Map<String, Object>> list = iSenYuDataSourceThree.queryForList(sql);
                     for(Map<String, Object> map:list){
                         sumlist.add(map);
@@ -167,7 +167,7 @@ public class POPomainController implements ApplicationContextAware {
                     //处理返回信息
                     JSONObject informationJson = interfaceConnUtils.doPostToBearer(result, url,tokenUrl, "采购订单接口-");
 
-                    JSONArray jsonArray = informationJson.getJSONArray("headers");
+                    JSONArray jsonArray = informationJson.getJSONArray("payload");
                     if (jsonArray.size() != 0) {
                         //获取4个账套值
                         String yi = "";
@@ -199,36 +199,44 @@ public class POPomainController implements ApplicationContextAware {
                             String moId = jo.getString("moId");
                             //账套号
                             String accId = jo.getString("accId");
+                            //订单类型
+                            String type = jo.getString("type");
                             //账套1
                             if (accId.equals(yi)) {
-                                if (code.equals("S")) {
-                                    //普通采购回写
-                                    String sql = "update PO_Pomain set cDefine10 = ? where POID = ?";
-                                    senYuDataSourceOne.updatePOMain(sql, "true," + message, moId);
-                                } else {
-                                    //普通采购回写
-                                    String sql = "update PO_Pomain set cDefine10 = ? where POID = ?";
-                                    senYuDataSourceOne.updatePOMain(sql, "false," + message, moId);
+                                if(type.equals("STANDARD_PO")){
+                                    if (code.equals("S")) {
+                                        //普通采购回写
+                                        String sql = "update PO_Pomain set cDefine10 = ? where POID = ?";
+                                        senYuDataSourceOne.updatePOMain(sql, "true," + message, moId);
+                                    } else {
+                                        //普通采购回写
+                                        String sql = "update PO_Pomain set cDefine10 = ? where POID = ?";
+                                        senYuDataSourceOne.updatePOMain(sql, "false," + message, moId);
+                                    }
                                 }
                             }else if(accId.equals(er)){
-                                if (code.equals("S")) {
-                                    //普通采购回写
-                                    String sql = "update PO_Pomain set cDefine10 = ? where POID = ?";
-                                    senYuDataSourceTwo.updatePOMain(sql, "true," + message, moId);
-                                } else {
-                                    //普通采购回写
-                                    String sql = "update PO_Pomain set cDefine10 = ? where POID = ?";
-                                    senYuDataSourceTwo.updatePOMain(sql, "false," + message, moId);
+                                if(type.equals("STANDARD_PO")) {
+                                    if (code.equals("S")) {
+                                        //普通采购回写
+                                        String sql = "update PO_Pomain set cDefine10 = ? where POID = ?";
+                                        senYuDataSourceTwo.updatePOMain(sql, "true," + message, moId);
+                                    } else {
+                                        //普通采购回写
+                                        String sql = "update PO_Pomain set cDefine10 = ? where POID = ?";
+                                        senYuDataSourceTwo.updatePOMain(sql, "false," + message, moId);
+                                    }
                                 }
                             }else if(accId.equals(san)) {
-                                if (code.equals("S")) {
-                                    //普通采购回写
-                                    String sql = "update PO_Pomain set cDefine10 = ? where POID = ?";
-                                    iSenYuDataSourceThree.updatePOMain(sql, "true," + message, moId);
-                                } else {
-                                    //普通采购回写
-                                    String sql = "update PO_Pomain set cDefine10 = ? where POID = ?";
-                                    iSenYuDataSourceThree.updatePOMain(sql, "false," + message, moId);
+                                if(type.equals("STANDARD_PO")) {
+                                    if (code.equals("S")) {
+                                        //普通采购回写
+                                        String sql = "update PO_Pomain set cDefine10 = ? where POID = ?";
+                                        iSenYuDataSourceThree.updatePOMain(sql, "true," + message, moId);
+                                    } else {
+                                        //普通采购回写
+                                        String sql = "update PO_Pomain set cDefine10 = ? where POID = ?";
+                                        iSenYuDataSourceThree.updatePOMain(sql, "false," + message, moId);
+                                    }
                                 }
                             }
                         }

+ 1 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/util/InterfaceConnUtils.java

@@ -97,6 +97,7 @@ public class InterfaceConnUtils {
             HttpResponse response = httpClient.execute(httpPost);
             //返回信息
             String resultStr = EntityUtils.toString(response.getEntity());
+            System.out.println(type+"String返回信息:"+resultStr);
             onejb=JSONObject.parseObject(resultStr);
             System.out.println(type+"返回信息:"+onejb);
 

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

@@ -70,7 +70,7 @@ public class JsonChangeUtils implements ApplicationContextAware{
 //                        "from OM_MODetails where MOID = "+map.get("MOID");
                 //mo.cInvCode,inv.cInvName
                 String sql = "select mo.iVouchRowNo as 'poLineNum',mo.MODetailsID as MODetailsID,mo.MODetailsID as 'moDetailId','"+map.get("pkorg")+"' as pkorg," +
-                        "'' as receivingInventoryOrgCode,'"+map.get("headerAttributeString6")+"' as MOID,'"+map.get("accId")+"' as 'accId'," +
+                        "'' 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'," +
                         "'' 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'," +
@@ -80,9 +80,9 @@ public class JsonChangeUtils implements ApplicationContextAware{
                         "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'," +
-                        "'' as externalLineNum,'' as itemAttrId,'"+map.get("headerAttributeString6")+"' as poId  from OM_MODetails mo  " +
+                        "'' as externalLineNum,'' as itemAttrId,'"+map.get("moId")+"' as poId  from OM_MODetails mo  " +
                         "left join Inventory inv  on mo.cInvCode = inv.cInvCode"+
-                        " where mo.MOID = "+map.get("headerAttributeString6");
+                        " where mo.MOID = "+map.get("moId");
                 List<Map<String, Object>> list = senYuDataSourceOne.queryForList(sql);
                 //子表转JSON
                 List<JSONObject> json = toMOListJson(list);
@@ -90,7 +90,7 @@ public class JsonChangeUtils implements ApplicationContextAware{
 
             }else if(map.get("pkorg").equals("two")){
                 String sql = "select mo.iVouchRowNo as 'poLineNum',mo.MODetailsID as MODetailsID,mo.MODetailsID as 'moDetailId','"+map.get("pkorg")+"' as pkorg," +
-                        "'' as receivingInventoryOrgCode,'"+map.get("headerAttributeString6")+"' as MOID,'"+map.get("accId")+"' as 'accId'," +
+                        "'' 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'," +
                         "'' 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'," +
@@ -100,9 +100,9 @@ public class JsonChangeUtils implements ApplicationContextAware{
                         "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'," +
-                        "'' as externalLineNum,'' as itemAttrId,'"+map.get("headerAttributeString6")+"' as poId  from OM_MODetails mo  " +
+                        "'' as externalLineNum,'' as itemAttrId,'"+map.get("moId")+"' as poId  from OM_MODetails mo  " +
                         "left join Inventory inv  on mo.cInvCode = inv.cInvCode"+
-                        " where mo.MOID = "+map.get("headerAttributeString6");
+                        " where mo.MOID = "+map.get("moId");
                 List<Map<String, Object>> list = senYuDataSourceTwo.queryForList(sql);
                 //子表转JSON
                 List<JSONObject> json = toMOListJson(list);
@@ -110,7 +110,7 @@ public class JsonChangeUtils implements ApplicationContextAware{
 
             }else if(map.get("pkorg").equals("three")){
                 String sql = "select mo.iVouchRowNo as 'poLineNum',mo.MODetailsID as MODetailsID,mo.MODetailsID as 'moDetailId','"+map.get("pkorg")+"' as pkorg," +
-                        "'' as receivingInventoryOrgCode,'"+map.get("headerAttributeString6")+"' as MOID,'"+map.get("accId")+"' as 'accId'," +
+                        "'' 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'," +
                         "'' 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'," +
@@ -120,9 +120,9 @@ public class JsonChangeUtils implements ApplicationContextAware{
                         "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'," +
-                        "'' as externalLineNum,'' as itemAttrId,'"+map.get("headerAttributeString6")+"' as poId  from OM_MODetails mo  " +
+                        "'' as externalLineNum,'' as itemAttrId,'"+map.get("moId")+"' as poId  from OM_MODetails mo  " +
                         "left join Inventory inv  on mo.cInvCode = inv.cInvCode"+
-                        " where mo.MOID = "+map.get("headerAttributeString6");
+                        " where mo.MOID = "+map.get("moId");
                 List<Map<String, Object>> list = iSenYuDataSourceThree.queryForList(sql);
                 //子表转JSON
                 List<JSONObject> json = toMOListJson(list);
@@ -180,7 +180,7 @@ public class JsonChangeUtils implements ApplicationContextAware{
                         "'' as 'lineAttributeString2','' as 'lineAttributeString3','' as 'attributeString1','' as 'lineAttributeString4'," +
                         "mo.cbMemo as 'lineAttributeString5',mo.cDefine22 as lineAttributeString6,'' as lineAttributeString7,'' as lineAttributeString8,'' as 'color'," +
                         "'' as 'externalLineNum',0 as 'itemAttrId' from PO_Podetails mo left join Inventory inv on mo.cInvCode = inv.cInvCode"+
-                        " where mo.POID = '"+map.get("headerAttributeString6")+"'";
+                        " where mo.POID = '"+map.get("moId")+"'";
                 List<Map<String, Object>> list = senYuDataSourceOne.queryForList(sql);
                 //子表转JSON
                 List<JSONObject> json = toListJson(list);
@@ -196,7 +196,7 @@ public class JsonChangeUtils implements ApplicationContextAware{
                         "'' as 'lineAttributeString2','' as 'lineAttributeString3','' as 'attributeString1','' as 'lineAttributeString4'," +
                         "mo.cbMemo as 'lineAttributeString5',mo.cDefine22 as lineAttributeString6,'' as lineAttributeString7,'' as lineAttributeString8,'' as 'color'," +
                         "'' as 'externalLineNum',0 as 'itemAttrId' from PO_Podetails mo left join Inventory inv on mo.cInvCode = inv.cInvCode"+
-                        " where mo.POID = '"+map.get("headerAttributeString6")+"'";
+                        " where mo.POID = '"+map.get("moId")+"'";
                 List<Map<String, Object>> list = senYuDataSourceTwo.queryForList(sql);
                 //子表转JSON
                 List<JSONObject> json = toListJson(list);
@@ -213,7 +213,7 @@ public class JsonChangeUtils implements ApplicationContextAware{
                         "'' as 'lineAttributeString2','' as 'lineAttributeString3','' as 'attributeString1','' as 'lineAttributeString4'," +
                         "mo.cbMemo as 'lineAttributeString5',mo.cDefine22 as lineAttributeString6,'' as lineAttributeString7,'' as lineAttributeString8,'' as 'color'," +
                         "'' as 'externalLineNum',0 as 'itemAttrId' from PO_Podetails mo left join Inventory inv on mo.cInvCode = inv.cInvCode"+
-                        " where mo.POID = '"+map.get("headerAttributeString6")+"'";
+                        " where mo.POID = '"+map.get("moId")+"'";
                 List<Map<String, Object>> list = iSenYuDataSourceThree.queryForList(sql);
                 //子表转JSON
                 List<JSONObject> json = toListJson(list);