|
|
|
@ -82,7 +82,7 @@ public class GoodsServiceImpl implements GoodsService { |
|
|
|
hmap.put("entrust_token", sign); |
|
|
|
// get 方式获取
|
|
|
|
JSONObject jsonObject = RequestUtils.GetData(apiurl, hmap, true); |
|
|
|
return opGoodsInfo(jsonObject, host, hmap); |
|
|
|
return opGoodsInfo(jsonObject); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
@ -476,22 +476,17 @@ public class GoodsServiceImpl implements GoodsService { |
|
|
|
String host = ProperUtils.getSzwhProp("ENTRUST_URL"); |
|
|
|
//创建签名
|
|
|
|
String sign = SignUtils.createSign("entrust"); |
|
|
|
// 请求头
|
|
|
|
Map<String, Object> hmap = new HashMap(); |
|
|
|
hmap.put("entrust_token", sign); |
|
|
|
//处理json数据
|
|
|
|
return opGoodsInfo(jsonObject, host, hmap); |
|
|
|
return opGoodsInfo(jsonObject); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 操作商品信息 |
|
|
|
* |
|
|
|
* @param jsonObject 待处理的json内容 |
|
|
|
* @param host 目标主机地址 |
|
|
|
* @param hmap 请求主机头集合 |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
private int opGoodsInfo(JSONObject jsonObject, String host, Map hmap) { |
|
|
|
private int opGoodsInfo(JSONObject jsonObject) { |
|
|
|
// 日期时间格式
|
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
|
|
|
int count = 0; //统计更新数量
|
|
|
|
@ -603,7 +598,7 @@ public class GoodsServiceImpl implements GoodsService { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
String ncend = cend + " 23:59:59"; |
|
|
|
String ncend = cend + "23:59:59"; |
|
|
|
//
|
|
|
|
try { |
|
|
|
//起止时间转为timestamp
|
|
|
|
@ -641,7 +636,7 @@ public class GoodsServiceImpl implements GoodsService { |
|
|
|
goods.setCreateTime(nowst); |
|
|
|
goods.setUpdateTime(nowst); |
|
|
|
// 添加,返回当前的编号
|
|
|
|
int ret_gid = goodsMapper.addGoods(goods); |
|
|
|
goodsMapper.addGoods(goods); |
|
|
|
//添加操作日志
|
|
|
|
OperationLog oplog = new OperationLog(); |
|
|
|
oplog.setLogid(goods.getId()); |
|
|
|
|