|
|
|
@ -2,10 +2,12 @@ package cn.chjyj.szwh.service.impl; |
|
|
|
|
|
|
|
import cn.chjyj.szwh.bean.Goods; |
|
|
|
import cn.chjyj.szwh.bean.GoodsDetail; |
|
|
|
import cn.chjyj.szwh.bean.GoodsSource; |
|
|
|
import cn.chjyj.szwh.constant.ChConstant; |
|
|
|
import cn.chjyj.szwh.exception.ChException; |
|
|
|
import cn.chjyj.szwh.mapper.GoodsDetailMapper; |
|
|
|
import cn.chjyj.szwh.mapper.GoodsMapper; |
|
|
|
import cn.chjyj.szwh.mapper.GoodsSourceMapper; |
|
|
|
import cn.chjyj.szwh.service.GoodsService; |
|
|
|
import cn.chjyj.szwh.utils.ProperUtils; |
|
|
|
import cn.chjyj.szwh.utils.RequestUtils; |
|
|
|
@ -32,6 +34,8 @@ public class GoodsServiceImpl implements GoodsService { |
|
|
|
private GoodsMapper goodsMapper; |
|
|
|
@Autowired |
|
|
|
private GoodsDetailMapper goodsDetailMapper; |
|
|
|
@Autowired |
|
|
|
private GoodsSourceMapper goodsSourceMapper; |
|
|
|
|
|
|
|
@Override |
|
|
|
public List<Goods> getGoodsList(int page) { |
|
|
|
@ -184,6 +188,8 @@ public class GoodsServiceImpl implements GoodsService { |
|
|
|
|
|
|
|
@Override |
|
|
|
public Map<String, Object> getGoodsDetail(String islicode) { |
|
|
|
//时间格式化
|
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
|
|
|
Map retmap= new HashMap(); |
|
|
|
/** |
|
|
|
* 联合查询的结果 |
|
|
|
@ -198,12 +204,42 @@ public class GoodsServiceImpl implements GoodsService { |
|
|
|
// 返回后远程获取用户信息 userinfo
|
|
|
|
retmap.put("user_isli",gdv.getUser_islicode()); |
|
|
|
|
|
|
|
// 商品来源
|
|
|
|
|
|
|
|
// 商品资源
|
|
|
|
List gatherarr=new ArrayList(); |
|
|
|
List oneSource=new ArrayList(); |
|
|
|
List<GoodsSource> goodsSourceList = goodsSourceMapper.getGoodsSourceByIsli(gdv.getGoods_islicode()); |
|
|
|
if(goodsSourceList!=null){ //not null
|
|
|
|
for(GoodsSource gs:goodsSourceList){ |
|
|
|
// 解析json
|
|
|
|
JSONObject sdjson = JSONObject.parseObject(gs.getSourceData()); |
|
|
|
Integer datatype=sdjson.getInteger("datatype"); |
|
|
|
Map info = new HashMap(); |
|
|
|
if(datatype==1){ //机构数据
|
|
|
|
info.put("name",gs.getSourceName()); |
|
|
|
info.put("class",gs.getSourceType()); |
|
|
|
// 从json data 中获取
|
|
|
|
info.put("registerDate",sdf.format(sdjson.getString("registerDate"))); |
|
|
|
info.put("identifier",sdjson.getString("identifier")); |
|
|
|
|
|
|
|
//符合条件的数量
|
|
|
|
int count = goodsSourceMapper.countGoodSource(gdv.getGoods_islicode(),1,gs.getSourceidentify()); |
|
|
|
info.put("count",count); |
|
|
|
gatherarr.add(info); |
|
|
|
}else{ |
|
|
|
Long filesize= sdjson.getLongValue("metadataFileSize"); |
|
|
|
info.put("name",gs.getSourceName()); |
|
|
|
info.put("class",gs.getSourceType()); |
|
|
|
info.put("registerDate",sdf.format(sdjson.getString("registerDate"))); |
|
|
|
info.put("filesize",filesize); |
|
|
|
info.put("metadataFileFormat",sdjson.getString("metadataFileFormat")); |
|
|
|
oneSource.add(info); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//
|
|
|
|
retmap.put("gather_arr",""); |
|
|
|
retmap.put("oneSource",""); |
|
|
|
retmap.put("gather_arr",gatherarr); |
|
|
|
retmap.put("oneSource",oneSource); |
|
|
|
|
|
|
|
return retmap; |
|
|
|
} |
|
|
|
|