|
|
|
@ -2,10 +2,14 @@ package cn.chjyj.szwh.service.impl; |
|
|
|
|
|
|
|
import cn.chjyj.szwh.bean.GoodsSource; |
|
|
|
import cn.chjyj.szwh.bean.OrderGoodsDetail; |
|
|
|
import cn.chjyj.szwh.bean.OrderGoodsSource; |
|
|
|
import cn.chjyj.szwh.mapper.GoodsSourceMapper; |
|
|
|
import cn.chjyj.szwh.mapper.OrderGoodsDetailMapper; |
|
|
|
import cn.chjyj.szwh.mapper.OrderGoodsSourceMapper; |
|
|
|
import cn.chjyj.szwh.service.GoodsSourceService; |
|
|
|
import cn.chjyj.szwh.utils.SzFileUtils; |
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.alibaba.fastjson.JSONArray; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.fasterxml.jackson.databind.json.JsonMapper; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
@ -24,6 +28,8 @@ public class GoodsSourceServiceImpl implements GoodsSourceService { |
|
|
|
private GoodsSourceMapper goodsSourceMapper; |
|
|
|
@Autowired |
|
|
|
private OrderGoodsDetailMapper orderGoodsDetailMapper; |
|
|
|
@Autowired |
|
|
|
private OrderGoodsSourceMapper orderGoodsSourceMapper; |
|
|
|
|
|
|
|
/** |
|
|
|
* 商品来源详情 |
|
|
|
@ -35,12 +41,30 @@ public class GoodsSourceServiceImpl implements GoodsSourceService { |
|
|
|
@Override |
|
|
|
public Map<String, Object> getGoodsSourceDetail(String isli, String islicode, String batchcode) { |
|
|
|
Map query = new HashMap<>(); |
|
|
|
query.put("sourceIdentify", isli); |
|
|
|
//结果list
|
|
|
|
List<GoodsSource> gslist=new ArrayList<>(); |
|
|
|
if (StringUtils.isNotBlank(batchcode)) { |
|
|
|
query.put("batchcode", batchcode); |
|
|
|
Map somap = new HashMap(); |
|
|
|
somap.put("sourceIdentify",isli); |
|
|
|
somap.put("batchcode",batchcode); |
|
|
|
somap.put("datatype",1); |
|
|
|
// 订单商品资源
|
|
|
|
List<OrderGoodsSource> odgslist = orderGoodsSourceMapper.searchOrderGoodsSource(somap); |
|
|
|
for(OrderGoodsSource ogs:odgslist){ |
|
|
|
GoodsSource goodsSource = new GoodsSource(); |
|
|
|
goodsSource.setSourceData(ogs.getSourceData()); |
|
|
|
goodsSource.setTargetData(ogs.getTargetData()); |
|
|
|
goodsSource.setTargetName(ogs.getTargetName()); |
|
|
|
goodsSource.setLinkcode(ogs.getLinkcode()); |
|
|
|
// 暂时只用到上述属性
|
|
|
|
gslist.add(goodsSource); |
|
|
|
} |
|
|
|
}else{ |
|
|
|
query.put("sourceIdentify", isli); |
|
|
|
// 商品资源列表
|
|
|
|
gslist = goodsSourceMapper.getGoodsSourceByMap(query, 0, 10); |
|
|
|
} |
|
|
|
// 商品资源列表
|
|
|
|
List<GoodsSource> gslist = goodsSourceMapper.getGoodsSourceByMap(query, 0, 10); |
|
|
|
|
|
|
|
|
|
|
|
//返回map
|
|
|
|
Map<String, Object> retmap = new HashMap<>(); |
|
|
|
@ -103,11 +127,16 @@ public class GoodsSourceServiceImpl implements GoodsSourceService { |
|
|
|
//订单号 委托码 不为空的情况
|
|
|
|
if(StringUtils.isNotEmpty(batchcode) && StringUtils.isNotEmpty(islicode)){ |
|
|
|
String ogdstr = orderGoodsDetailMapper.getOrderGoodsDetailSourceDownload(batchcode,islicode); |
|
|
|
JSONObject ogdjson = JSONObject.parseObject(ogdstr); |
|
|
|
String sdstatus = ogdjson.getString("status"); |
|
|
|
String sdislicode = ogdjson.getString("islicode"); |
|
|
|
if(gs.getLinkcode().equals(sdislicode)){ |
|
|
|
gather.put("download_status",sdstatus); |
|
|
|
//JSONObject ogdjson = JSONObject.parseObject(ogdstr);
|
|
|
|
JSONArray jsarr = JSON.parseArray(ogdstr); |
|
|
|
//List<String> stlist = jsarr.toJavaList(String.class);
|
|
|
|
for(int x=0;x<jsarr.size();x++){ |
|
|
|
JSONObject ogdjson = (JSONObject) jsarr.get(x); |
|
|
|
String sdstatus = ogdjson.getString("status"); |
|
|
|
String sdislicode = ogdjson.getString("islicode"); |
|
|
|
if(gs.getLinkcode().equals(sdislicode)) { |
|
|
|
gather.put("download_status",sdstatus); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|