|
@@ -33,13 +33,12 @@ public class JsonChangeUtils implements ApplicationContextAware{
|
|
|
* @param result
|
|
|
* @return
|
|
|
*/
|
|
|
- public static List<JSONObject> toMoMainJson(List<Map<String, Object>> result) {
|
|
|
+ public static List<JSONObject> toMoMainJson(Map<String, Object> result) {
|
|
|
List<JSONObject> pljf = new ArrayList<JSONObject>();
|
|
|
SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
-
|
|
|
JSONObject jf = new JSONObject();
|
|
|
- for (int i = 0; i < result.size(); i++) {
|
|
|
- Map<String, Object> map = result.get(i);
|
|
|
+
|
|
|
+ Map<String, Object> map = result;
|
|
|
Set<String> keys = map.keySet();
|
|
|
jf = new JSONObject();
|
|
|
for (String key : keys) {
|
|
@@ -65,12 +64,12 @@ public class JsonChangeUtils implements ApplicationContextAware{
|
|
|
|
|
|
|
|
|
|
|
|
- String sql = "select mo.iVouchRowNo as 'poLineNum',mo.MODetailsID as MODetailsID,mo.MODetailsID as ' moDetailId','"+map.get("headerAttributeString6")+"' as MOID,'"+map.get("accId")+"' as 'accId'" +
|
|
|
+ String sql = "select mo.iVouchRowNo as 'poLineNum',mo.MODetailsID as MODetailsID,mo.MODetailsID as 'moDetailId','"+map.get("headerAttributeString6")+"' as MOID,'"+map.get("accId")+"' as 'accId'" +
|
|
|
",'"+map.get("poNum")+"' as poNum,'N0201002142' as 'customerItemCode','35%棉65%涤 平纹汗布' 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','cfree4' as 'attributeCode4'," +
|
|
|
- "mo.iQuantity as 'customerDemandQty',mo.cUnitID as 'customerUomCode','"+map.get("customerDemandDate")+"' as 'customerDemandDate'," +
|
|
|
+ "mo.iQuantity as 'customerDemandQty',mo.cUnitID as 'customerUomCode','"+map.get("customerDemandDate")+"' as 'customerDemandDate',mo.dArriveDate as 'customerPromiseDate'," +
|
|
|
"mo.iUnitPrice as 'customerPrice',(mo.iPerTaxRate/100) as 'lineTaxRate',mo.iMoney as 'amount'," +
|
|
|
"mo.cDefine28 as 'lineAttributeString1',mo.cDefine32 as 'lineAttributeString2',mo.cDefine29 as 'lineAttributeString3'," +
|
|
|
"mo.cDefine30 as 'lineAttributeString4',mo.cbMemo as 'lineAttributeString5',cFree1 as 'color','' as 'customerNumber','' as externalLineNum," +
|
|
@@ -83,10 +82,11 @@ public class JsonChangeUtils implements ApplicationContextAware{
|
|
|
|
|
|
List<JSONObject> json = toMOListJson(list);
|
|
|
jf.put("poLineList",json);
|
|
|
- }
|
|
|
+ jf.remove("MODetailsID");
|
|
|
+ jf.remove("MOID");
|
|
|
+
|
|
|
+
|
|
|
|
|
|
- jf.remove("MODetailsID");
|
|
|
- jf.remove("MOID");
|
|
|
pljf.add(jf);
|
|
|
}
|
|
|
return pljf;
|
|
@@ -97,12 +97,12 @@ public class JsonChangeUtils implements ApplicationContextAware{
|
|
|
* @param result
|
|
|
* @return
|
|
|
*/
|
|
|
- public static List<JSONObject> toPoMainJson(List<Map<String, Object>> result) {
|
|
|
+ public static List<JSONObject> toPoMainJson(Map<String, Object> result) {
|
|
|
List<JSONObject> pljf = new ArrayList<JSONObject>();
|
|
|
SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
JSONObject jf = new JSONObject();
|
|
|
- for (int i = 0; i < result.size(); i++) {
|
|
|
- Map<String, Object> map = result.get(i);
|
|
|
+
|
|
|
+ Map<String, Object> map = result;
|
|
|
Set<String> keys = map.keySet();
|
|
|
jf = new JSONObject();
|
|
|
for (String key : keys) {
|
|
@@ -127,7 +127,7 @@ public class JsonChangeUtils implements ApplicationContextAware{
|
|
|
"'' 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("customerDemandDate")+"' as 'customerDemandDate'," +
|
|
|
+ "mo.iQuantity as 'customerDemandQty',mo.cUnitID as 'customerUomCode','"+map.get("customerDemandDate")+"' as 'customerDemandDate',mo.dArriveDate as 'customerPromiseDate'," +
|
|
|
"mo.iUnitPrice as 'customerPrice',(mo.iPerTaxRate/100) as 'lineTaxRate',mo.iMoney as 'amount'," +
|
|
|
"'' as 'lineAttributeString1','' as 'lineAttributeString2','' as 'lineAttributeString3','' as 'attributeString1'," +
|
|
|
"'' as 'lineAttributeString4','' as 'color','' as 'externalLineNum',0 as 'itemAttrId' " +
|
|
@@ -142,7 +142,7 @@ public class JsonChangeUtils implements ApplicationContextAware{
|
|
|
}
|
|
|
|
|
|
pljf.add(jf);
|
|
|
- }
|
|
|
+
|
|
|
return pljf;
|
|
|
}
|
|
|
|
|
@@ -221,6 +221,7 @@ public class JsonChangeUtils implements ApplicationContextAware{
|
|
|
*/
|
|
|
public static List<JSONObject> toMOListJson(List<Map<String, Object>> result) {
|
|
|
List<JSONObject> pljf = new ArrayList<JSONObject>();
|
|
|
+ SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
JSONObject jf = new JSONObject();
|
|
|
for (int i = 0; i < result.size(); i++) {
|
|
|
Map<String, Object> map = result.get(i);
|
|
@@ -233,6 +234,8 @@ public class JsonChangeUtils implements ApplicationContextAware{
|
|
|
jf.put(key, map.get(key));
|
|
|
}
|
|
|
}
|
|
|
+ String customerPromiseDate = sf.format(map.get("customerPromiseDate"));
|
|
|
+ jf.put("customerPromiseDate",customerPromiseDate+" 00:00:00");
|
|
|
|
|
|
if(map.get("accId").equals("903")){
|
|
|
|
|
@@ -253,7 +256,8 @@ public class JsonChangeUtils implements ApplicationContextAware{
|
|
|
List<JSONObject> json = toListJson(list);
|
|
|
jf.put("outSourceList",json);
|
|
|
}
|
|
|
-
|
|
|
+ jf.remove("MODetailsID");
|
|
|
+ jf.remove("MOID");
|
|
|
pljf.add(jf);
|
|
|
}
|
|
|
return pljf;
|