|
|
@@ -55,6 +55,7 @@ public class StockServiceImpl implements StockService{
|
|
|
Map<String,Object> res = new HashMap<>();
|
|
|
String jsonData = JacksonUtil.toSortJson(data);
|
|
|
try{
|
|
|
+
|
|
|
HttpUtil.Response response = HttpUtil.doPostToYunding(sendStockToYundingUrl,jsonData,timestamp);
|
|
|
|
|
|
String responseText = response.getResponseText();
|
|
|
@@ -79,7 +80,7 @@ public class StockServiceImpl implements StockService{
|
|
|
ediLogDao.save(LogUtil.getSendSuccessLog(outerNo,jsonData,"send success"));
|
|
|
}else{
|
|
|
res.put("success",false);
|
|
|
- res.put("remark","云顶处理失败!");
|
|
|
+ res.put("remark","云顶数据中心处理失败!");
|
|
|
}
|
|
|
}
|
|
|
}catch (Exception e){
|
|
|
@@ -225,21 +226,46 @@ public class StockServiceImpl implements StockService{
|
|
|
private List<Map<String,Object>> getDetailData(Integer id){
|
|
|
List<Map<String,Object>> datas = new LinkedList<>();
|
|
|
Map<String,Object> data = new HashMap<>();
|
|
|
- SqlRowList rs = baseDao.queryForRowSet("select pd_piclass,pd_id,pd_ordercode,pd_orderdetno,pd_batchcode,pd_prodcode,pd_inqty,pd_outqty,pd_description from prodiodetail where pd_piid=" + id);
|
|
|
+ SqlRowList rs = baseDao.queryForRowSet("select pd_piclass,pd_id,pd_ordercode,pd_orderdetno,pd_batchcode,pd_prodcode,pd_inqty,pd_outqty,pd_description,pd_whcode,pd_inwhcode from prodiodetail where pd_piid=" + id);
|
|
|
+ String piClass = null;
|
|
|
+ String whCode = null;
|
|
|
+ String pdinWhCode = null;
|
|
|
while (rs.next()){
|
|
|
data = new HashMap<>();
|
|
|
+ piClass = rs.getString("pd_piclass");
|
|
|
+ whCode = rs.getString("pd_whcode");
|
|
|
+ pdinWhCode = rs.getString("pd_inwhcode");
|
|
|
data.put("child_no",rs.getString("pd_id"));
|
|
|
data.put("purchase_no",rs.getString("pd_ordercode"));
|
|
|
data.put("purchase_detno",rs.getString("pd_orderdetno"));
|
|
|
data.put("batch_no",rs.getString("pd_batchcode"));
|
|
|
- data.put("stockin_num",getQty(rs.getString("pd_piclass"),rs.getInt("pd_inqty"),rs.getInt("pd_outqty")));
|
|
|
+ data.put("stockin_num",getQty(piClass,rs.getInt("pd_inqty"),rs.getInt("pd_outqty")));
|
|
|
data.put("spec_no",rs.getString("pd_prodcode"));
|
|
|
data.put("remark",rs.getString("pd_description"));
|
|
|
+ data.put("warehouse_no",getInWarehouseNo(piClass,whCode,pdinWhCode));
|
|
|
+ data.put("out_warehouse_no",getOutWarehouseNo(piClass,whCode));
|
|
|
+
|
|
|
datas.add(data);
|
|
|
}
|
|
|
return datas;
|
|
|
}
|
|
|
|
|
|
+ private String getInWarehouseNo(String piClass,String whcode,String pdinwhcode){
|
|
|
+ String code = whcode;
|
|
|
+ if("拨出单".equals(piClass)){
|
|
|
+ code = pdinwhcode;
|
|
|
+ }
|
|
|
+ return code;
|
|
|
+ }
|
|
|
+
|
|
|
+ private String getOutWarehouseNo(String piClass,String whcode){
|
|
|
+ String code = null;
|
|
|
+ if("拨出单".equals(piClass)){
|
|
|
+ code = whcode;
|
|
|
+ }
|
|
|
+ return code;
|
|
|
+ }
|
|
|
+
|
|
|
private int getQty(String piClass,int inQty,int outQty){
|
|
|
int correctQty = 0;
|
|
|
switch (piClass){
|