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

dev
袁野 5 days ago
parent e4b0e7ca3c
commit 5c3338b868
  1. 139
      bweb/src/main/java/com/bweb/controller/TestController.java
  2. 1
      bweb/src/main/java/com/bweb/controller/cms/CmsContentController.java
  3. 1
      bweb/src/main/java/com/bweb/controller/goods/GoodsController.java
  4. 50
      cweb/src/main/java/com/cweb/controller/cms/CmsContentController.java
  5. 7
      cweb/src/main/java/com/cweb/controller/goods/GoodsController.java
  6. 74
      schedule/src/main/java/com/hfkj/schedule/JdGoodsSchedule.java
  7. 24
      service/src/main/java/com/hfkj/dao/GoodsMsgMapperExt.java
  8. 3
      service/src/main/java/com/hfkj/service/cms/impl/CmsContentServiceImpl.java
  9. 1
      service/src/main/java/com/hfkj/service/goods/GoodsMsgService.java
  10. 6
      service/src/main/java/com/hfkj/service/goods/impl/GoodsMsgServiceImpl.java
  11. 2
      service/src/main/java/com/hfkj/service/order/OrderPaySuccessService.java
  12. 2
      service/src/main/java/com/hfkj/service/order/impl/OrderSettlementServiceImpl.java

@ -16,6 +16,7 @@ import com.hfkj.model.ResponseData;
import com.hfkj.model.goods.JdGoodsModel;
import com.hfkj.qianzhu.StarbucksService;
import com.hfkj.service.card.BsUserCardService;
import com.hfkj.service.cms.CmsContentService;
import com.hfkj.service.coupon.channel.YouTuCouponService;
import com.hfkj.service.goods.*;
import com.hfkj.service.goods.impl.BsOrderStarbucksServiceImpl;
@ -25,6 +26,7 @@ import com.hfkj.service.order.BsOrderRefundService;
import com.hfkj.service.order.BsOrderService;
import com.hfkj.service.order.OrderPayService;
import com.hfkj.service.pay.huift.TradeService;
import com.hfkj.sysenum.order.OrderLogisticsStatusEnum;
import com.jd.open.api.sdk.domain.vopsp.CategoryInfoGoodsProvider.response.getCategoryInfoList.GetCategoryInfoGoodsResp;
import com.jd.open.api.sdk.domain.vopsp.SkuInfoGoodsProvider.response.getSkuDetailInfo.GetSkuPoolInfoGoodsResp;
import com.jd.open.api.sdk.domain.vopxx.MsgRecordProvider.response.queryTransByVopNormal.VopBizTransMessage;
@ -45,6 +47,7 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;
@Controller
@ -65,6 +68,8 @@ public class TestController {
@Resource
private GoodsMsgService goodsMsgService;
@Resource
private CmsContentService cmsContentService;
@RequestMapping(value="/thirdPayResult",method = RequestMethod.GET)
@ResponseBody
@ -83,6 +88,48 @@ public class TestController {
}
@RequestMapping(value="/getLogisticsMsg",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "更新物流")
public ResponseData getLogisticsMsg() {
try {
Map<String , Object> objectMap = new HashMap<>();
objectMap.put("status" , 2);
objectMap.put("createTime" , "createTime");
List<BsOrderGoods> orderGoodsList = orderGoodsService.getList(objectMap);
orderGoodsList = orderGoodsList.stream().filter(order -> order.getLogisticsNo() != null).collect(Collectors.toList());
for (BsOrderGoods goods : orderGoodsList) {
if (goods.getLogisticsNo() != null) {
GoodsLogistics logistics = (GoodsLogistics) orderGoodsService.getLogisticsMsgSchedule(goods.getLogisticsNo() , goods.getUserPhone());
if (logistics.getLogisticsStatus() != null) {
goods.setLogisticsStatus(logistics.getLogisticsStatus());
goods.setLogisticsStatusDesc(logistics.getLogisticsStatusDesc());
} else {
goods.setLogisticsStatus(OrderLogisticsStatusEnum.statusWAIT_ACCEPT.getCode());
goods.setLogisticsStatusDesc(OrderLogisticsStatusEnum.statusWAIT_ACCEPT.getName());
}
goods.setUpdateTime(new Date());
orderGoodsService.update(goods);
}
}
return ResponseMsgUtil.success("成功");
} catch (Exception e) {
log.error("error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/refundMovieOrder",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "refundMovieOrder")
@ -224,23 +271,89 @@ public class TestController {
}
@RequestMapping(value="/automaticData",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "自动数据")
public ResponseData automaticData() {
try {
Map<String , Object> map = new HashMap<>();
map.put("automatic" , 1);
map.put("status" , 1);
List<CmsContent> list = cmsContentService.getList(map);
goodsMsgService.updateAutomatic();
for (CmsContent cmsContent : list) {
List<JdGoodsModel> goodsModels = new ArrayList<>();
if (cmsContent.getAutomatic() == 2) {
Map<String , Object> mapGoods = new HashMap<>();
mapGoods.put("automatic", 1);
mapGoods.put("status", 1);
mapGoods.put("rand", 1);
map.put("type", 1);
mapGoods.put("salePriceS", 10);
mapGoods.put("salePriceE", 50);
mapGoods.put("limit", 25);
// 查询10-50价格商品
goodsModels.addAll(goodsMsgService.getListCrest(mapGoods));
mapGoods.put("salePriceS", 50.01);
mapGoods.put("salePriceE", 100);
mapGoods.put("limit", 10);
// 查询50.01-100价格商品
goodsModels.addAll(goodsMsgService.getListCrest(mapGoods));
mapGoods.put("salePriceS", 100.01);
mapGoods.put("salePriceE", 300);
mapGoods.put("limit", 5);
// 查询100.01 -300价格商品
goodsModels.addAll(goodsMsgService.getListCrest(mapGoods));
mapGoods.put("salePriceS", 300.01);
mapGoods.put("salePriceE", 500);
mapGoods.put("limit", 5);
// 查询300.001-500以上价格商品
goodsModels.addAll(goodsMsgService.getListCrest(mapGoods));
mapGoods.put("salePriceS", 500);
mapGoods.put("salePriceE", 100000);
mapGoods.put("limit", 5);
// 查询500以上价格商品
goodsModels.addAll(goodsMsgService.getListCrest(mapGoods));
for (JdGoodsModel jdGoodsModel : goodsModels) {
GoodsMsg goodsMsg = goodsMsgService.queryDetail(Long.valueOf(jdGoodsModel.getId()));
goodsMsg.setAutomaticCode(cmsContent.getId());
goodsMsg.setUpdateTime(new Date());
goodsMsgService.update(goodsMsg);
}
}
}
return ResponseMsgUtil.success("成功");
} catch (Exception e) {
log.error("error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/getGoodsJd",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "更新商品")
public ResponseData getGoodsJd() {
try {
jdService.getGoodsJd();
return ResponseMsgUtil.success("");
// @RequestMapping(value="/getGoodsJd",method = RequestMethod.GET)
// @ResponseBody
// @ApiOperation(value = "更新商品")
// public ResponseData getGoodsJd() {
// try {
// jdService.getGoodsJd();
// return ResponseMsgUtil.success("");
//
// } catch (Exception e) {
// log.error("error!",e);
// return ResponseMsgUtil.exception(e);
// }
// }
} catch (Exception e) {
log.error("error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/confirmOrder",method = RequestMethod.GET)

@ -69,6 +69,7 @@ public class CmsContentController {
cmsContent.setStatus(1);
cmsContent.setName(body.getName());
cmsContent.setAppid(body.getAppid());
cmsContent.setAutomatic(body.getAutomatic());
cmsContent.setJumpType(body.getJumpType());
cmsContent.setShowType(body.getShowType());
cmsContent.setJumpUrl(body.getJumpUrl());

@ -137,6 +137,7 @@ public class GoodsController {
goodsMsg.setGoodsTypeParent(goodsType.getParentId());
goodsMsg.setGoodsTypeParentName(goodsTypeService.findGoodsType(goodsType.getParentId()));
goodsMsg.setType(body.getType());
goodsMsg.setSort(body.getSort());
goodsMsg.setShowType(body.getShowType());
goodsMsg.setGoodsBrand(body.getGoodsBrand());
goodsMsg.setStatus(body.getStatus());

@ -66,7 +66,7 @@ public class CmsContentController {
for (CmsContent cmsContent : list) {
List<JdGoodsModel> goodsModels = new ArrayList<>();
if (cmsContent.getShowType() != null) {
Map<String , Object> goodsMap = new HashMap<>();
goodsMap.put("status" , 1);
@ -74,27 +74,61 @@ public class CmsContentController {
List<JdGoodsModel> goodsMsgs = new ArrayList<>();
if (cmsContent.getShowType() == 1) {
goodsMap.put("goodsType", cmsContent.getShowDataId());
if ( cmsContent.getShowType() != null && cmsContent.getShowType() == 1) {
if (cmsContent.getAutomatic() == 1) {
goodsMap.put("goodsType", cmsContent.getShowDataId());
if (cmsContent.getShowDataId() != null) {
cmsContent.setJumpUrl(cmsContent.getJumpUrl() + "&goodsType=" + cmsContent.getShowDataId());
}
} else {
cmsContent.setJumpUrl(cmsContent.getJumpUrl() + "&automaticCode=" + cmsContent.getId());
goodsMap.put("automaticCode" , cmsContent.getId());
}
goodsMap.put("limit" , 2);
goodsMsgs = goodsMsgService.getListCrest(goodsMap);
}
if (cmsContent.getShowType() == 2) {
goodsMap.put("goodsType", cmsContent.getShowDataId());
if (cmsContent.getShowType() != null && cmsContent.getShowType() == 2) {
if (cmsContent.getAutomatic() == 1) {
goodsMap.put("goodsType", cmsContent.getShowDataId());
if (cmsContent.getShowDataId() != null) {
cmsContent.setJumpUrl(cmsContent.getJumpUrl() + "&goodsType=" + cmsContent.getShowDataId());
}
} else {
cmsContent.setJumpUrl(cmsContent.getJumpUrl() + "&automaticCode=" + cmsContent.getId());
goodsMap.put("automaticCode" , cmsContent.getId());
}
goodsMap.put("limit" , 4);
goodsMap.put("saleNum" , 2);
goodsMsgs = goodsMsgService.getListCrest(goodsMap);
}
if (cmsContent.getShowType() == 3) {
goodsMap.put("goodsType", cmsContent.getShowDataId());
if (cmsContent.getShowType() != null && cmsContent.getShowType() == 3) {
if (cmsContent.getAutomatic() == 1) {
goodsMap.put("goodsType", cmsContent.getShowDataId());
if (cmsContent.getShowDataId() != null) {
cmsContent.setJumpUrl(cmsContent.getJumpUrl() + "&goodsType=" + cmsContent.getShowDataId());
}
} else {
cmsContent.setJumpUrl(cmsContent.getJumpUrl() + "&automaticCode=" + cmsContent.getId());
goodsMap.put("automaticCode" , cmsContent.getId());
}
goodsMap.put("limit" , 10);
goodsMap.put("type" , 1);
goodsMsgs = goodsMsgService.getListCrest(goodsMap);
}
if (cmsContent.getAutomatic() == 1) {
goodsMap.put("goodsType", cmsContent.getShowDataId());
if (cmsContent.getShowDataId() != null) {
cmsContent.setJumpUrl(cmsContent.getJumpUrl() + "&goodsType=" + cmsContent.getShowDataId());
}
} else {
cmsContent.setJumpUrl(cmsContent.getJumpUrl() + "&automaticCode=" + cmsContent.getId());
goodsMap.put("automaticCode" , cmsContent.getId());
}
goodsModels.addAll(goodsMsgs);
}
CmsContentModel cmsContentModel = new CmsContentModel();
BeanUtils.copyProperties(cmsContent, cmsContentModel);

@ -113,6 +113,7 @@ public class GoodsController {
@RequestParam(value = "goodsTypeParent", required = false) Long goodsTypeParent,
@RequestParam(value = "goodsType", required = false) Long goodsType,
@RequestParam(value = "showType", required = false) Integer showType,
@RequestParam(value = "automaticCode", required = false) Long automaticCode,
@RequestParam(value = "discountId", required = false) Integer discountId,
@RequestParam(value = "goodsBrand", required = false) Long goodsBrand,
@RequestParam(value = "price", required = false) Integer price,
@ -134,8 +135,12 @@ public class GoodsController {
map.put("goodsType", goodsType);
map.put("showType", showType);
map.put("price", price);
if (time == null && saleNum == null && price == null) {
map.put("sort", 2);
}
map.put("goodsTypeParent", goodsTypeParent);
map.put("goodsBrand", goodsBrand);
map.put("automaticCode", automaticCode);
map.put("saleNum", saleNum);
map.put("salePriceS", salePriceS);
map.put("salePriceE", salePriceE);
@ -160,10 +165,10 @@ public class GoodsController {
List<Long> sp = couponDiscountGoodsRel.stream().map(CouponDiscountGoodsRel::getSpecsId).collect(Collectors.toList());
map.put("specsId", sp);
}
System.out.println("=========================参数+" + map);
List<JdGoodsModel> list = goodsMsgService.getListCrest(map);
// return ResponseMsgUtil.success(list);
return ResponseMsgUtil.success(PageUtil.initPageInfoObj(pageNum, list.size(), pageSize, new PageInfo<>(list)));
} catch (Exception e) {

@ -1,13 +1,16 @@
package com.hfkj.schedule;
import com.alibaba.fastjson.JSONObject;
import com.hfkj.entity.BsOrderCoupon;
import com.hfkj.entity.BsOrderCouponNo;
import com.hfkj.common.utils.DateUtil;
import com.hfkj.entity.*;
import com.hfkj.jd.JdService;
import com.hfkj.model.goods.JdGoodsModel;
import com.hfkj.service.cms.CmsContentService;
import com.hfkj.service.coupon.BsOrderCouponNoService;
import com.hfkj.service.coupon.BsOrderCouponService;
import com.hfkj.service.coupon.channel.HuiLianTongCouponService;
import com.hfkj.service.coupon.channel.YouTuCouponService;
import com.hfkj.service.goods.GoodsMsgService;
import com.hfkj.service.hlt.HuiLianTongUnionCardService;
import com.hfkj.service.order.BsOrderChildService;
import com.hfkj.service.order.BsOrderService;
@ -19,10 +22,7 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.Scheduled;
import javax.annotation.Resource;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* @Auther: 胡锐
@ -38,6 +38,12 @@ public class JdGoodsSchedule {
@Resource
private JdService jdService;
@Resource
private GoodsMsgService goodsMsgService;
@Resource
private CmsContentService cmsContentService;
//每10分钟执行一次
@Scheduled(cron = "0 0/10 * * * ?")
public void etcCarMsg() {
@ -50,4 +56,60 @@ public class JdGoodsSchedule {
}
}
//每日凌晨12点1秒执行一次
@Scheduled(cron = "1 0 0 * * ?")
public void automaticData() {
Map<String , Object> map = new HashMap<>();
map.put("automatic" , 1);
map.put("status" , 1);
List<CmsContent> list = cmsContentService.getList(map);
goodsMsgService.updateAutomatic();
for (CmsContent cmsContent : list) {
List<JdGoodsModel> goodsModels = new ArrayList<>();
if (cmsContent.getAutomatic() == 2) {
Map<String , Object> mapGoods = new HashMap<>();
mapGoods.put("automatic", 1);
mapGoods.put("status", 1);
mapGoods.put("rand", 1);
map.put("type", 1);
mapGoods.put("salePriceS", 10);
mapGoods.put("salePriceE", 50);
mapGoods.put("limit", 25);
// 查询10-50价格商品
goodsModels.addAll(goodsMsgService.getListCrest(mapGoods));
mapGoods.put("salePriceS", 50.01);
mapGoods.put("salePriceE", 100);
mapGoods.put("limit", 10);
// 查询50.01-100价格商品
goodsModels.addAll(goodsMsgService.getListCrest(mapGoods));
mapGoods.put("salePriceS", 100.01);
mapGoods.put("salePriceE", 300);
mapGoods.put("limit", 5);
// 查询100.01 -300价格商品
goodsModels.addAll(goodsMsgService.getListCrest(mapGoods));
mapGoods.put("salePriceS", 300.01);
mapGoods.put("salePriceE", 500);
mapGoods.put("limit", 5);
// 查询300.001-500以上价格商品
goodsModels.addAll(goodsMsgService.getListCrest(mapGoods));
mapGoods.put("salePriceS", 500);
mapGoods.put("salePriceE", 100000);
mapGoods.put("limit", 5);
// 查询500以上价格商品
goodsModels.addAll(goodsMsgService.getListCrest(mapGoods));
for (JdGoodsModel jdGoodsModel : goodsModels) {
GoodsMsg goodsMsg = goodsMsgService.queryDetail(Long.valueOf(jdGoodsModel.getId()));
goodsMsg.setAutomaticCode(cmsContent.getId());
goodsMsg.setUpdateTime(new Date());
goodsMsgService.update(goodsMsg);
}
}
}
}
}

@ -1,10 +1,13 @@
package com.hfkj.dao;
import com.hfkj.entity.GoodsMsg;
import com.hfkj.entity.GoodsSpecs;
import com.hfkj.entity.SecDictionary;
import com.hfkj.model.goods.JdGoodsModel;
import com.hfkj.model.order.OrderCouponModel;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import java.util.List;
import java.util.Map;
@ -67,6 +70,8 @@ public interface GoodsMsgMapperExt {
" a.goods_brand_name as goodsBrandName," +
" a.title as title," +
" a.list_img as listImg," +
" a.sort as sort," +
" a.automatic_code as automaticCode," +
" a.sale_num as saleNum," +
" b.third_price as thirdPrice," +
" b.original_price as originalPrice," +
@ -84,18 +89,27 @@ public interface GoodsMsgMapperExt {
" <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.type != null'> and a.third_id is not null </if>" +
" <if test='param.automatic != null'> and a.automatic_code is null </if>" +
" <if test='param.automaticCode != null'> and a.automatic_code = #{param.automaticCode} </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.salePriceS != null'><![CDATA[ and b.sale_price >= #{param.salePriceS} ]]></if>" +
" <if test='param.salePriceE != null'><![CDATA[ and b.sale_price <= #{param.salePriceE} ]]></if>" +
" group by a.id) c" +
" <if test='param.time == 1'>ORDER BY c.updateTime desc</if>" +
" <if test='param.time == 2'>ORDER BY c.createtime asc</if>" +
" <if test='param.price == 1'>ORDER BY c.salePrice asc</if>" +
" <if test='param.price == 2'>ORDER BY c.salePrice desc</if>" +
" <if test='param.saleNum == 2'>ORDER BY c.saleNum desc</if>" +
" <if test='param.time == 1'>ORDER BY c.sort asc , c.id</if>" +
" <if test='param.time == 2'>ORDER BY c.sort asc , c.id</if>" +
" <if test='param.price == 1'>ORDER BY c.salePrice asc , c.id</if>" +
" <if test='param.price == 2'>ORDER BY c.salePrice desc , c.id</if>" +
" <if test='param.saleNum == 2'>ORDER BY c.saleNum desc , c.id</if>" +
" <if test='param.sort == 2'>ORDER BY c.sort asc , c.id</if>" +
" <if test='param.rand == 1'>ORDER BY rand()</if>" +
" <if test='param.limit != null'>limit #{param.limit}</if>" +
"</script>")
List<JdGoodsModel> getGoodsListCrest(@Param("param") Map<String,Object> param);
@Update({
"update goods_msg set automatic_code = null where automatic_code is not null",
})
void updateAutomatic();
}

@ -60,6 +60,9 @@ public class CmsContentServiceImpl implements CmsContentService {
} else {
criteria.andStatusNotEqualTo(0);
}
if (MapUtils.getInteger(map, "automatic") != null) {
criteria.andAutomaticIsNotNull();
}
if (StringUtils.isNotBlank(MapUtils.getString(map, "platformCode"))) {
criteria.andPlatformCodeEqualTo(MapUtils.getString(map, "platformCode"));
}

@ -101,5 +101,6 @@ public interface GoodsMsgService {
* @return
*/
void editSaleNum(Long goodsId , Integer num , Integer type);
void updateAutomatic();
}

@ -162,6 +162,12 @@ public class GoodsMsgServiceImpl implements GoodsMsgService {
return goodsMsgMapper.selectByExample(example);
}
@Override
public void updateAutomatic() {
goodsMsgMapper.updateAutomatic();
}
@Override
public void editSaleNum(Long goodsId, Integer num , Integer type) {

@ -182,7 +182,7 @@ public class OrderPaySuccessService {
JSONArray dataArray = returnParam.getJSONObject("return_data").getJSONArray("codeList");
couponNo.setExpireTime(dataArray.getJSONObject(0).getDate("expirationDate"));
couponNo.setDeliverTime(new Date());
couponNo.setGoodsVpdSourceCouNo(vpd.getKey());
couponNo.setGoodsVpdSourceCouNo(returnParam.getJSONObject("return_data").getString("reqId"));
couponNo.setStatus(OrderCouponNoStatusEnum.status2.getCode());
orderCouponNoService.editData(couponNo);
}

@ -179,6 +179,8 @@ public class OrderSettlementServiceImpl implements OrderSettlementService {
List<BsOrderCoupon> orderCouponList = orderCouponService.getOrderCouponList(map);
Map<String , Object> mapCou = new HashMap<>();
mapCou.put("couStatus", 2);
mapCou.put("createTimeS", map.get("finishTimeS"));
mapCou.put("createTimeE", map.get("finishTimeE"));
// 查询卡券订单卡密
List<OrderCouponModel> orderCouponModelList = orderCouponService.getOrderList(mapCou);

Loading…
Cancel
Save