提交实物代码

new-dev
袁野 2 years ago
parent 76e47530dd
commit d9644e41da
  1. 4
      hai-bweb/src/main/java/com/bweb/controller/Goods/GoodsDetailController.java
  2. 4
      hai-cweb/src/main/java/com/cweb/controller/CmsContentController.java
  3. 4
      hai-cweb/src/main/java/com/cweb/controller/Goods/GoodsController.java
  4. 48
      hai-cweb/src/main/java/com/cweb/controller/Goods/ShoppingCartController.java
  5. 23
      hai-service/src/main/java/com/hai/config/RechargeConfig.java
  6. 4
      hai-service/src/main/java/com/hai/goods/service/GoodsPresentService.java
  7. 9
      hai-service/src/main/java/com/hai/goods/service/impl/GoodsDetailServiceImpl.java
  8. 68
      hai-service/src/main/java/com/hai/goods/service/impl/GoodsPresentServiceImpl.java
  9. 30
      hai-service/src/main/java/com/hai/order/service/impl/OrderCreateHandleServiceImpl.java
  10. 47
      hai-service/src/main/java/com/hai/order/service/impl/OrderPaySuccessServiceImpl.java
  11. 11
      hai-service/src/main/java/com/hai/order/service/impl/OrderServiceImpl.java
  12. 4
      hai-service/src/main/java/com/hai/service/impl/HighDiscountAgentCodeServiceImpl.java
  13. 26
      v1/src/main/java/com/v1/controller/WxMsgController.java

@ -60,6 +60,7 @@ public class GoodsDetailController {
public ResponseData getListGoodsDetail( public ResponseData getListGoodsDetail(
@RequestParam(value = "title", required = false) String title, @RequestParam(value = "title", required = false) String title,
@RequestParam(value = "status", required = false) Integer status, @RequestParam(value = "status", required = false) Integer status,
@RequestParam(value = "goodsLabel", required = false) String goodsLabel,
@RequestParam(name = "pageNum", required = true) Integer pageNum, @RequestParam(name = "pageNum", required = true) Integer pageNum,
@RequestParam(name = "pageSize", required = true) Integer pageSize @RequestParam(name = "pageSize", required = true) Integer pageSize
, HttpServletRequest request , HttpServletRequest request
@ -73,11 +74,14 @@ public class GoodsDetailController {
map.put("title", title); map.put("title", title);
map.put("status", status); map.put("status", status);
map.put("goodsLabel", goodsLabel);
map.put("companyId", userInfoModel.getBsCompany().getId());
if (userInfoModel.getSecUser().getExt3() != null) { if (userInfoModel.getSecUser().getExt3() != null) {
map.put("opId" , userInfoModel.getSecUser().getId()); map.put("opId" , userInfoModel.getSecUser().getId());
} }
PageHelper.startPage(pageNum,pageSize); PageHelper.startPage(pageNum,pageSize);
List<GoodsDetail> list = goodsDetailService.getGoodsDetailList(map); List<GoodsDetail> list = goodsDetailService.getGoodsDetailList(map);

@ -86,7 +86,6 @@ public class CmsContentController {
List<JSONObject> objectList = new ArrayList<>(); List<JSONObject> objectList = new ArrayList<>();
for (CmsCategory cmsCategory : categoryList) { for (CmsCategory cmsCategory : categoryList) {
JSONObject object = new JSONObject(); JSONObject object = new JSONObject();
// 1.小图一行四个 2.轮播图 3.消息通知 4.大图展示 5.一横图三小图 6.数据库数据 7.小图一行五个 // 1.小图一行四个 2.轮播图 3.消息通知 4.大图展示 5.一横图三小图 6.数据库数据 7.小图一行五个
@ -157,9 +156,10 @@ public class CmsContentController {
objectList.add(object); objectList.add(object);
} }
} else { } else {
if (object.getJSONArray("childCategory").size() >0 ) {
objectList.add(object); objectList.add(object);
} }
}
} }
return ResponseMsgUtil.success(dataWhetherNull ? null:objectList); return ResponseMsgUtil.success(dataWhetherNull ? null:objectList);

@ -64,6 +64,8 @@ public class GoodsController {
@RequestParam(value = "title", required = false) String title, @RequestParam(value = "title", required = false) String title,
@RequestParam(value = "goodsType", required = false) Long goodsType, @RequestParam(value = "goodsType", required = false) Long goodsType,
@RequestParam(value = "price", required = false) Integer price, @RequestParam(value = "price", required = false) Integer price,
@RequestParam(value = "companyId", required = false) Long companyId,
@RequestParam(value = "goodsLabel", required = false) String goodsLabel,
@RequestParam(name = "pageNum", required = true) Integer pageNum, @RequestParam(name = "pageNum", required = true) Integer pageNum,
@RequestParam(name = "pageSize", required = true) Integer pageSize @RequestParam(name = "pageSize", required = true) Integer pageSize
) { ) {
@ -74,6 +76,8 @@ public class GoodsController {
map.put("title", title); map.put("title", title);
map.put("goodsType", goodsType); map.put("goodsType", goodsType);
map.put("companyId", companyId);
map.put("goodsLabel", goodsLabel);
map.put("status", 1); map.put("status", 1);

@ -113,8 +113,7 @@ public class ShoppingCartController {
if (shoppingCart == null || if (shoppingCart == null ||
shoppingCart.getGoodsId() == null || shoppingCart.getGoodsId() == null ||
shoppingCart.getSku() == null || shoppingCart.getSku() == null ||
shoppingCart.getNum() == null || shoppingCart.getNum() == null
shoppingCart.getWhetherCheck() == null
) { ) {
log.error("GoodsDetailController -> insertProduct() error!"); log.error("GoodsDetailController -> insertProduct() error!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
@ -148,6 +147,7 @@ public class ShoppingCartController {
shoppingCart.setImg(sku.getShowImg()); shoppingCart.setImg(sku.getShowImg());
shoppingCart.setOriginalPrice(sku.getOriginalPrice()); shoppingCart.setOriginalPrice(sku.getOriginalPrice());
shoppingCart.setLoseEfficacy(false); shoppingCart.setLoseEfficacy(false);
shoppingCart.setWhetherCheck(true);
shoppingCart.setPrice(sku.getPrice()); shoppingCart.setPrice(sku.getPrice());
shoppingCart.setCreateTime(new Date()); shoppingCart.setCreateTime(new Date());
shoppingCart.setUpdateTime(new Date()); shoppingCart.setUpdateTime(new Date());
@ -249,4 +249,48 @@ public class ShoppingCartController {
} }
@RequestMapping(value = "/whetherCheck", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "是否选中")
public ResponseData whetherCheck(
@RequestParam(value = "ids", required = true) String ids,
@RequestParam(value = "whetherCheck", required = true) Boolean whetherCheck
, HttpServletRequest request
) {
try {
// 用户
SessionObject sessionObject = userCenter.getSessionObject(request);
HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject();
String[] idArray = ids.split(",");
for (String id : idArray) {
GoodsShoppingCart shoppingCart = shoppingCartService.findShoppingCartById(Long.valueOf(id));
if (!Objects.equals(userInfoModel.getHighUser().getId(), shoppingCart.getUserId())) {
log.error("GoodsDetailController -> findGoodsDetailById() error!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "用户信息错误");
}
if (shoppingCart == null) {
log.error("GoodsDetailController -> insertProduct() error!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到相关内容!");
}
shoppingCart.setWhetherCheck(whetherCheck);
shoppingCart.setUpdateTime(new Date());
shoppingCartService.updateShoppingCart(shoppingCart);
}
return ResponseMsgUtil.success("成功");
} catch (Exception e) {
log.error("GoodsDetailController --> findGoodsDetailById() error!", e);
return ResponseMsgUtil.exception(e);
}
}
} }

@ -56,7 +56,9 @@ public class RechargeConfig {
* @Param [com.alibaba.fastjson.JSONObject] * @Param [com.alibaba.fastjson.JSONObject]
* @return com.alibaba.fastjson.JSONObject * @return com.alibaba.fastjson.JSONObject
*/ */
public static JSONObject rechargeOrderByLy(JSONObject object) throws Exception { public static JSONObject rechargeOrderByLy(JSONObject object) {
try {
Map<String,Object> paramMap = new HashMap<>(); Map<String,Object> paramMap = new HashMap<>();
@ -75,6 +77,10 @@ public class RechargeConfig {
log.info("龙阅订单充值-响应参数: " + jsonObject.toJSONString()); log.info("龙阅订单充值-响应参数: " + jsonObject.toJSONString());
return jsonObject; return jsonObject;
} catch (Exception e) {
return null;
}
} }
@ -112,8 +118,9 @@ public class RechargeConfig {
* @Param [com.alibaba.fastjson.JSONObject] * @Param [com.alibaba.fastjson.JSONObject]
* @return com.alibaba.fastjson.JSONObject * @return com.alibaba.fastjson.JSONObject
*/ */
public static JSONObject rechargeOrderByJj(JSONObject object) throws Exception { public static JSONObject rechargeOrderByJj(JSONObject object) {
try {
String timestamp = String.valueOf(System.currentTimeMillis()); String timestamp = String.valueOf(System.currentTimeMillis());
Map<String , Object> map = new HashMap<>(); Map<String , Object> map = new HashMap<>();
@ -133,6 +140,11 @@ public class RechargeConfig {
log.info("尖椒订单充值-响应参数: " + jsonObject.toJSONString()); log.info("尖椒订单充值-响应参数: " + jsonObject.toJSONString());
return jsonObject; return jsonObject;
} catch (Exception e) {
return null;
}
} }
@ -175,7 +187,8 @@ public class RechargeConfig {
* @Param [object] * @Param [object]
* @Return com.alibaba.fastjson.JSONObject * @Return com.alibaba.fastjson.JSONObject
*/ */
public static JSONObject rechargeOrderByHg(JSONObject object) throws Exception { public static JSONObject rechargeOrderByHg(JSONObject object) {
try {
Map<String,Object> paramMap = new HashMap<>(); Map<String,Object> paramMap = new HashMap<>();
paramMap.put("mchid" , CommonSysConst.getSysConfig().getHgMemberId()); paramMap.put("mchid" , CommonSysConst.getSysConfig().getHgMemberId());
@ -194,6 +207,10 @@ public class RechargeConfig {
log.info("畅停话费查询订单-响应参数: " + repsObject.toJSONString()); log.info("畅停话费查询订单-响应参数: " + repsObject.toJSONString());
return repsObject; return repsObject;
}catch (Exception e) {
return null;
}
} }
/** /**

@ -2,6 +2,8 @@ package com.hai.goods.service;
import com.hai.entity.GoodsPresent; import com.hai.entity.GoodsPresent;
import com.hai.entity.GoodsPresentRecord; import com.hai.entity.GoodsPresentRecord;
import com.hai.entity.HighChildOrder;
import com.hai.entity.HighOrder;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -88,4 +90,6 @@ public interface GoodsPresentService {
* @Return java.util.List<com.hai.entity.GoodsPresentRecord> * @Return java.util.List<com.hai.entity.GoodsPresentRecord>
*/ */
List<GoodsPresentRecord> getPresentRecord(Map<String , Object> map); List<GoodsPresentRecord> getPresentRecord(Map<String , Object> map);
void presentUser(HighOrder order , HighChildOrder highChildOrder);
} }

@ -21,9 +21,6 @@ public class GoodsDetailServiceImpl implements GoodsDetailService {
@Resource @Resource
private GoodsDetailMapper goodsDetailMapper; private GoodsDetailMapper goodsDetailMapper;
@Resource
private GoodsLogisticsMapper logisticsMapper;
@Override @Override
public void insertGoodsDetail(GoodsDetail goodsDetail) { public void insertGoodsDetail(GoodsDetail goodsDetail) {
goodsDetailMapper.insert(goodsDetail); goodsDetailMapper.insert(goodsDetail);
@ -43,12 +40,18 @@ public class GoodsDetailServiceImpl implements GoodsDetailService {
if (MapUtils.getString(map, "title") != null) { if (MapUtils.getString(map, "title") != null) {
criteria.andNameLike("%" + MapUtils.getString(map, "title") + "%"); criteria.andNameLike("%" + MapUtils.getString(map, "title") + "%");
} }
if (MapUtils.getString(map, "goodsLabel") != null) {
criteria.andGoodsLabelLike("%" + MapUtils.getString(map, "goodsLabel") + "%");
}
if (MapUtils.getLong(map, "goodsType") != null) { if (MapUtils.getLong(map, "goodsType") != null) {
criteria.andGoodsTypeEqualTo(MapUtils.getLong(map, "goodsType") ); criteria.andGoodsTypeEqualTo(MapUtils.getLong(map, "goodsType") );
} }
if (MapUtils.getLong(map, "opId") != null) { if (MapUtils.getLong(map, "opId") != null) {
criteria.andOpIdEqualTo(MapUtils.getLong(map, "opId") ); criteria.andOpIdEqualTo(MapUtils.getLong(map, "opId") );
} }
if (MapUtils.getLong(map, "companyId") != null) {
criteria.andCompanyIdEqualTo(MapUtils.getLong(map, "companyId") );
}
if (MapUtils.getInteger(map, "status") != null) { if (MapUtils.getInteger(map, "status") != null) {
criteria.andStatusEqualTo(MapUtils.getInteger(map, "status") ); criteria.andStatusEqualTo(MapUtils.getInteger(map, "status") );
} else { } else {

@ -2,15 +2,17 @@ package com.hai.goods.service.impl;
import com.hai.dao.GoodsPresentMapper; import com.hai.dao.GoodsPresentMapper;
import com.hai.dao.GoodsPresentRecordMapper; import com.hai.dao.GoodsPresentRecordMapper;
import com.hai.entity.GoodsPresent; import com.hai.entity.*;
import com.hai.entity.GoodsPresentExample;
import com.hai.entity.GoodsPresentRecord;
import com.hai.entity.GoodsRegionFreight;
import com.hai.goods.service.GoodsPresentService; import com.hai.goods.service.GoodsPresentService;
import com.hai.service.HighCouponCodeService;
import com.hai.service.HighCouponService;
import com.hai.service.HighDiscountAgentCodeService;
import org.apache.commons.collections4.MapUtils; import org.apache.commons.collections4.MapUtils;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -23,6 +25,18 @@ public class GoodsPresentServiceImpl implements GoodsPresentService {
@Resource @Resource
private GoodsPresentRecordMapper goodsPresentRecordMapper; private GoodsPresentRecordMapper goodsPresentRecordMapper;
@Resource
private GoodsPresentService goodsPresentService;
@Resource
private HighCouponService highCouponService;
@Resource
private HighCouponCodeService couponCodeService;
@Resource
private HighDiscountAgentCodeService highDiscountAgentCodeService;
@Override @Override
public void insertPresent(GoodsPresent present) { public void insertPresent(GoodsPresent present) {
goodsPresentMapper.insert(present); goodsPresentMapper.insert(present);
@ -78,4 +92,50 @@ public class GoodsPresentServiceImpl implements GoodsPresentService {
public List<GoodsPresentRecord> getPresentRecord(Map<String, Object> map) { public List<GoodsPresentRecord> getPresentRecord(Map<String, Object> map) {
return null; return null;
} }
@Override
@Async
public void presentUser(HighOrder order, HighChildOrder highChildOrder) {
try {
// 赠送卡券or优惠券
List<GoodsPresent> goodsPresents = goodsPresentService.getPresentList(highChildOrder.getGoodsId());
if (goodsPresents.size() > 0) {
for (int j = 0; j < highChildOrder.getSaleCount(); j++) {
for (GoodsPresent present : goodsPresents) {
GoodsPresentRecord presentRecord = new GoodsPresentRecord();
presentRecord.setStatus("0");
if (present.getType() == 1) {
for (int i = 0; i < present.getNum(); i++) {
HighCoupon coupon = highCouponService.getCouponById(present.getSourceId());
// 支付购买卡券
couponCodeService.payCoupon(order,highChildOrder,coupon);
}
}
if (present.getType() == 2) {
highDiscountAgentCodeService.giveDiscount(present.getSourceId() , Long.valueOf(present.getNum()), order.getMemId());
}
presentRecord.setOrderNo(order.getOrderNo());
presentRecord.setOrderId(order.getId());
presentRecord.setChildOrderId(highChildOrder.getOrderId());
presentRecord.setCreateTime(new Date());
presentRecord.setNum(presentRecord.getNum());
presentRecord.setUpdateTime(new Date());
presentRecord.setType(present.getType());
presentRecord.setStatus("1");
presentRecord.setSourceId(present.getSourceId());
presentRecord.setSourceName(present.getSourceName());
presentRecord.setOpName("系统赠送");
presentRecord.setPresentId(present.getId());
goodsPresentService.insertPresentRecord(presentRecord);
}
}
}
} catch (Exception e) {
}
}
} }

@ -953,21 +953,21 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService {
goodsSkuService.decreaseStockNum(createOrderChild.getSkuId(), createOrderChild.getSaleCount()); goodsSkuService.decreaseStockNum(createOrderChild.getSkuId(), createOrderChild.getSaleCount());
List<GoodsPresent> goodsPresents = goodsPresentService.getPresentList(childOrder.getGoodsId()); // List<GoodsPresent> goodsPresents = goodsPresentService.getPresentList(childOrder.getGoodsId());
//
//
if (goodsPresents.size() > 0) { //// if (goodsPresents.size() > 0) {
for (GoodsPresent present : goodsPresents) { //// for (int j = 0; j < childOrder.getSaleCount(); j++) {
GoodsPresentRecord presentRecord = new GoodsPresentRecord(); //// for (GoodsPresent present : goodsPresents) {
presentRecord.setStatus("0"); //// if (present.getType() == 1) {
if (present.getType() == 1) { //// for (int i = 0; i < present.getNum(); i++) {
for (int i = 0; i < present.getNum(); i++) { //// couponService.assignOrderStock(present.getSourceId(), childOrder.getChildOrderNo());
couponService.assignOrderStock(present.getSourceId(), childOrder.getChildOrderNo()); //// }
} //// }
} ////
//// }
} //// }
} //// }
return childOrder; return childOrder;
} }

@ -74,8 +74,7 @@ public class OrderPaySuccessServiceImpl implements OrderPaySuccessService {
@Resource @Resource
private JinZhuJiaYouService jinZhuJiaYouService; private JinZhuJiaYouService jinZhuJiaYouService;
@Resource
private HighDiscountAgentCodeService highDiscountAgentCodeService;
@Resource @Resource
private PayloService payloService; private PayloService payloService;
@ -108,10 +107,9 @@ public class OrderPaySuccessServiceImpl implements OrderPaySuccessService {
private OutRechargeOrderService outRechargeOrderService; private OutRechargeOrderService outRechargeOrderService;
@Resource @Resource
private GoodsPresentService goodsPresentService; private GoodsPresentService presentService;
@Resource
private HighCouponService highCouponService;
@Override @Override
public HighOrder orderPaySuccessHandle(String orderNo, OrderPayType payType, String paySerialNo, BigDecimal payRealPrice, HighUserCard userCard) { public HighOrder orderPaySuccessHandle(String orderNo, OrderPayType payType, String paySerialNo, BigDecimal payRealPrice, HighUserCard userCard) {
@ -516,47 +514,12 @@ public class OrderPaySuccessServiceImpl implements OrderPaySuccessService {
* @Param [order] * @Param [order]
* @Return void * @Return void
*/ */
private void goodsRecharge(HighOrder order , HighChildOrder highChildOrder) throws Exception { private void goodsRecharge(HighOrder order , HighChildOrder highChildOrder) {
GoodsOrder goodsOrder = goodsOrderExtService.findGoodsOrder(order.getOrderNo()); GoodsOrder goodsOrder = goodsOrderExtService.findGoodsOrder(order.getOrderNo());
goodsOrder.setUpdateTime(new Date()); goodsOrder.setUpdateTime(new Date());
goodsOrder.setStatus("1"); goodsOrder.setStatus("1");
goodsOrderExtService.updateGoodsOrder(goodsOrder); goodsOrderExtService.updateGoodsOrder(goodsOrder);
presentService.presentUser(order , highChildOrder);
// 赠送卡券or优惠券
List<GoodsPresent> goodsPresents = goodsPresentService.getPresentList(highChildOrder.getGoodsId());
if (goodsPresents.size() > 0) {
for (GoodsPresent present : goodsPresents) {
GoodsPresentRecord presentRecord = new GoodsPresentRecord();
presentRecord.setStatus("0");
if (present.getType() == 1) {
for (int i = 0; i < present.getNum(); i++) {
HighCoupon coupon = highCouponService.getCouponById(present.getSourceId());
// 支付购买卡券
couponCodeService.payCoupon(order,highChildOrder,coupon);
}
}
if (present.getType() == 2) {
highDiscountAgentCodeService.giveDiscount(present.getSourceId() , Long.valueOf(present.getNum()), order.getMemId());
}
presentRecord.setOrderNo(order.getOrderNo());
presentRecord.setOrderId(order.getId());
presentRecord.setChildOrderId(highChildOrder.getOrderId());
presentRecord.setCreateTime(new Date());
presentRecord.setNum(presentRecord.getNum());
presentRecord.setUpdateTime(new Date());
presentRecord.setType(present.getType());
presentRecord.setStatus("1");
presentRecord.setSourceId(present.getSourceId());
presentRecord.setSourceName(present.getSourceName());
presentRecord.setOpName("系统赠送");
presentRecord.setPresentId(present.getId());
goodsPresentService.insertPresentRecord(presentRecord);
}
}
} }
} }

@ -127,7 +127,7 @@ public class OrderServiceImpl implements OrderService {
@Transactional( @Transactional(
propagation= Propagation.REQUIRES_NEW, propagation= Propagation.REQUIRES_NEW,
isolation = Isolation.READ_COMMITTED, isolation = Isolation.READ_COMMITTED,
timeout = 10, timeout = 20,
rollbackFor = Exception.class) rollbackFor = Exception.class)
@Cached(cacheType = CacheType.REMOTE, name="order:", key = "#createOrderModel.orderNo", expire = 3600*24*30) // 缓存一个月 @Cached(cacheType = CacheType.REMOTE, name="order:", key = "#createOrderModel.orderNo", expire = 3600*24*30) // 缓存一个月
public HighOrder createOrder(CreateOrderModel createOrderModel) throws Exception { public HighOrder createOrder(CreateOrderModel createOrderModel) throws Exception {
@ -604,7 +604,10 @@ public class OrderServiceImpl implements OrderService {
timeout = 25, timeout = 25,
rollbackFor = Exception.class) rollbackFor = Exception.class)
@CacheUpdate(name = "order:", key = "#order.orderNo", value = "#order") @CacheUpdate(name = "order:", key = "#order.orderNo", value = "#order")
public HighOrder refundOrder(HighOrder order, String remarks, OrderRefundOpUserType opUserType, Long opUserId, String opUserName) throws Exception { public HighOrder refundOrder(HighOrder order, String remarks, OrderRefundOpUserType opUserType, Long opUserId, String opUserName) {
try {
if (!order.getOrderStatus().equals(OrderStatus.STATUS2.getNumber()) if (!order.getOrderStatus().equals(OrderStatus.STATUS2.getNumber())
&& !order.getOrderStatus().equals(OrderStatus.STATUS3.getNumber())) { && !order.getOrderStatus().equals(OrderStatus.STATUS3.getNumber())) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "订单状态错误"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "订单状态错误");
@ -659,6 +662,10 @@ public class OrderServiceImpl implements OrderService {
rocketMQTemplate.syncSend(OrderTopic.ORDER_TOPIC_REFUND_SUCCESS.getTopic(), orderRefund); rocketMQTemplate.syncSend(OrderTopic.ORDER_TOPIC_REFUND_SUCCESS.getTopic(), orderRefund);
} }
return updateOrderData(order); return updateOrderData(order);
} catch (Exception e) {
return null;
}
} }
@Override @Override

@ -325,6 +325,10 @@ public class HighDiscountAgentCodeServiceImpl implements HighDiscountAgentCodeSe
highDiscountUserRel.setStatus(1); highDiscountUserRel.setStatus(1);
highDiscountUserRel.setCreateTime(new Date()); highDiscountUserRel.setCreateTime(new Date());
highDiscountUserRel.setDiscountCompanyId(discount.getCompanyId()); highDiscountUserRel.setDiscountCompanyId(discount.getCompanyId());
highDiscountUserRel.setDiscountUseScope(discount.getUseScope());
highDiscountUserRel.setDiscountUsingRange(discount.getUsingRange());
highDiscountUserRel.setDiscountCondition(discount.getDiscountCondition());
highDiscountUserRel.setDiscountType(discount.getDiscountType());
highDiscountUserRel.setDiscountImg(discount.getDiscountImg()); highDiscountUserRel.setDiscountImg(discount.getDiscountImg());
highDiscountUserRel.setDiscountName(discount.getDiscountName()); highDiscountUserRel.setDiscountName(discount.getDiscountName());
highDiscountUserRel.setDiscountCondition(discount.getDiscountCondition()); highDiscountUserRel.setDiscountCondition(discount.getDiscountCondition());

@ -535,6 +535,32 @@ public class WxMsgController {
} }
@RequestMapping(value = "/createMenu", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "创建菜单")
public ResponseData createMenu(@RequestBody JSONObject object) {
try {
Map<String, Object> params = new HashMap<>();
params.put("appid", SysConst.getSysConfig().getWxH5AppId());
params.put("secret", SysConst.getSysConfig().getWxH5AppSecret());
params.put("grant_type", "client_credential");
JSONObject accessTokenObject = HttpsUtils.doGet("https://api.weixin.qq.com/cgi-bin/token", params);
if (accessTokenObject == null) {
log.error("getH5UserInfo error!", "获取微信access_token失败" );
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "获取微信access_token失败");
}
JSONObject jsonObject = HttpsUtils.doPost("https://api.weixin.qq.com/cgi-bin/menu/create?access_token=" + accessTokenObject.getString("access_token"), object);
return ResponseMsgUtil.success(jsonObject);
} catch (Exception e) {
return ResponseMsgUtil.exception(e);
}
}
// @RequestMapping(value = "/verifyWx", method = RequestMethod.GET) // @RequestMapping(value = "/verifyWx", method = RequestMethod.GET)
// @ResponseBody // @ResponseBody

Loading…
Cancel
Save