|
@@ -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);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|