Browse Source

代码调整

master
xyiege 3 years ago
parent
commit
bd462b5264
  1. 9
      src/main/java/cn/chjyj/szwh/service/impl/GoodsServiceImpl.java
  2. 4
      src/main/java/cn/chjyj/szwh/utils/RequestUtils.java
  3. 14
      src/main/resources/mapper/szwh/GoodsMapper.xml

9
src/main/java/cn/chjyj/szwh/service/impl/GoodsServiceImpl.java

@ -82,11 +82,14 @@ public class GoodsServiceImpl implements GoodsService {
hmap.put("entrust_token", sign);
// get 方式获取
JSONObject jsonObject = RequestUtils.GetData(apiurl, hmap, true);
// 产品详情地址
String gdurl = host + "/consign/exchange/v1/selectEntrustDetails";
return opGoodsInfo(jsonObject, host, hmap);
}
/**
* 根据类型查找用户信息
* @param type
* @return
*/
@Override
public List getMapDataByTyep(int type) {
Map retmap = new HashMap();
@ -483,7 +486,7 @@ public class GoodsServiceImpl implements GoodsService {
* 操作商品信息
*
* @param jsonObject 待处理的json内容
* @param host 目标
* @param host 目标主机地
* @param hmap 请求主机头集合
* @return
*/

4
src/main/java/cn/chjyj/szwh/utils/RequestUtils.java

@ -60,7 +60,11 @@ public class RequestUtils {
result = EntityUtils.toString(responseEntity, "UTF-8");
logger.info("api Request结果:"+result);
jsonObject = JSONObject.parseObject(result);
}else{
// 打印非200的返回
logger.error(response.toString());
}
// 转换为jsonobject
logger.info("httpGet状态:"+status);
} catch (ClientProtocolException e) {

14
src/main/resources/mapper/szwh/GoodsMapper.xml

@ -261,4 +261,18 @@
where goods_islicode=#{islicode}
</update>
<!--更新商品信息-->
<update id="updateGoods">
update
<include refid="tbName"/>
<set>
<foreach collection="map" item="v" index="k" separator="and">
<if test="v != null and v != ''">
${k} = #{v}
</if>
</foreach>
</set>
where id=#{gid}
</update>
</mapper>
Loading…
Cancel
Save