修改汇联通distributorId 原参数aNId4A3X修改为orjuOND7

cpupon-dev
袁野 3 weeks ago
parent 8e20bb270d
commit d60d1ab65f
  1. 38
      cweb/src/main/java/com/cweb/controller/discount/DiscountController.java
  2. 32
      order/src/main/java/com/order/controller/OrderController.java
  3. 14
      service/src/main/java/com/hfkj/dao/GoodsMsgMapperExt.java
  4. 1
      service/src/main/java/com/hfkj/jd/Impl/JdServiceImpl.java

@ -138,6 +138,44 @@ public class DiscountController {
}
}
@RequestMapping(value = "/userDiscountNum", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "获取券数量")
public ResponseData userDiscountNum() {
try {
// 用户session
UserSessionObject userSession = userCenter.getSessionModel(UserSessionObject.class);
Map<String , Object> map = new HashMap<>();
map.put("status" , 1);
map.put("phone" , userSession.getUser().getPhone());
JSONObject object = HaiOilService.queryListByPhone(map);
int num = 0;
if (object.getString("return_code").equals("000000")) {
JSONArray array = object.getJSONObject("return_data").getJSONArray("dataList");
num += array.size();
}
map.put("userId", userSession.getUser().getId());
map.put("status", 1);
List<CouponDiscountUserRel> list = discountUserRelService.getList(map);
num += list.size();
return ResponseMsgUtil.success(num);
} catch (Exception e) {
log.error("GoodsDetailController --> getListUser() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/getGoodsDiscount", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "获取商品可用优惠券")

@ -364,22 +364,22 @@ public class OrderController {
GoodsUserAddress userAddress = goodsUserAddressService.queryDetail(body.getLong("addressId"));
if (userAddress.getProvinceId() == null) {
VopAddressConvertFourAreaByDetailStrResponse response = JdPostService.convertFourAreaByDetailStr(jdService.getToken() , userAddress.getRegionName() + userAddress.getAddress());
if (response != null && response.getOpenRpcResult().getSuccess()) {
userAddress.setProvinceId(response.getOpenRpcResult().getResult().getProvinceId());
userAddress.setProvinceName(response.getOpenRpcResult().getResult().getProvinceName());
userAddress.setCityId(response.getOpenRpcResult().getResult().getCityId());
userAddress.setCityName(response.getOpenRpcResult().getResult().getCityName());
userAddress.setCountyId(response.getOpenRpcResult().getResult().getCountyId());
userAddress.setCountyName(response.getOpenRpcResult().getResult().getCountyName());
userAddress.setTownId(response.getOpenRpcResult().getResult().getTownId());
userAddress.setTownName(response.getOpenRpcResult().getResult().getTownName());
userAddress.setUpdateTime(new Date());
deliveryAddressService.update(userAddress);
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, response.getOpenRpcResult().getResultMessage());
}
// VopAddressConvertFourAreaByDetailStrResponse response = JdPostService.convertFourAreaByDetailStr(jdService.getToken() , userAddress.getRegionName() + userAddress.getAddress());
//
// if (response != null && response.getOpenRpcResult().getSuccess()) {
// userAddress.setProvinceId(response.getOpenRpcResult().getResult().getProvinceId());
// userAddress.setProvinceName(response.getOpenRpcResult().getResult().getProvinceName());
// userAddress.setCityId(response.getOpenRpcResult().getResult().getCityId());
// userAddress.setCityName(response.getOpenRpcResult().getResult().getCityName());
// userAddress.setCountyId(response.getOpenRpcResult().getResult().getCountyId());
// userAddress.setCountyName(response.getOpenRpcResult().getResult().getCountyName());
// userAddress.setTownId(response.getOpenRpcResult().getResult().getTownId());
// userAddress.setTownName(response.getOpenRpcResult().getResult().getTownName());
// userAddress.setUpdateTime(new Date());
// deliveryAddressService.update(userAddress);
// } else {
// throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, response.getOpenRpcResult().getResultMessage());
// }
}
List<com.jd.open.api.sdk.domain.vopdd.QueryOrderOpenProvider.request.querySkuFreight.SkuInfoOrderOpenReq> skuInfoList = new ArrayList<>();

@ -60,11 +60,11 @@ public interface GoodsMsgMapperExt {
// List<GoodsMsg> getGoodsListCrest(@Param("param") Map<String,Object> param);
@Select("<script>" +
" SELECT * from (" +
" SELECT" +
" a.goods_type_parent_name as goodsTypeParentName," +
" a.goods_type_name as goodsTypeName," +
" a.goods_brand_name as goodsBrandName," +
" a.id as id," +
" a.title as title," +
" a.list_img as listImg," +
" b.sale_price as salePrice, " +
@ -72,19 +72,25 @@ public interface GoodsMsgMapperExt {
" b.third_price as thirdPrice," +
" b.original_price as originalPrice," +
" a.third_id as thirdId," +
" b.id as specsId" +
" b.id as specsId ," +
" a.id as id," +
" MIN(b.sale_price) , " +
"a.create_time as createtime ," +
"a.update_time as updateTime" +
" FROM" +
" goods_msg a join goods_specs b on a.id = b.goods_id where a.status = 1" +
" <if test='param.goodsTypeParent != null'> and a.goods_type_parent = #{param.goodsTypeParent} </if>" +
" <if test='param.title != null'> and a.title like concat('%',#{param.title},'%') </if>" +
" <if test='param.goodsType != null'> and a.goods_type = #{param.goodsType} </if>" +
" <if test='param.showType != null'> and a.show_type = #{param.showType} </if>" +
" <if test='param.specsId != null'> and b.id in <foreach collection='param.specsId' item='item' index='index' open='(' separator=',' close=')'>#{item}</foreach> </if>" +
" <if test='param.goodsBrand != null'> and a.goods_brand = #{param.goodsBrand} </if>" +
" <if test='param.time != 1'>ORDER BY a.update_time desc</if>" +
" <if test='param.time == 1'>ORDER BY a.create_time desc</if>" +
" <if test='param.price == 1'>b.sale_price asc</if>" +
" <if test='param.price == 2'> b.sale_price desc</if>" +
" <if test='param.saleNum == 2'>, a.sale_num desc</if>" +
" group by a.id) c" +
" <if test='param.time != 1'>ORDER BY c.updateTime desc</if>" +
" <if test='param.time == 1'>ORDER BY c.createtime desc</if>" +
" <if test='param.limit != null'>limit #{param.limit}</if>" +
"</script>")
List<JdGoodsModel> getGoodsListCrest(@Param("param") Map<String,Object> param);

@ -95,7 +95,6 @@ public class JdServiceImpl implements JdService {
if (token == null) {
// 请求回调 会在回调存入参数
JdPostService.getAccessToken();
getToken();
}
return token.toString();
}

Loading…
Cancel
Save