|
@@ -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");
|