|
@@ -67,6 +67,8 @@ import com.zhongzheng.modules.top.goods.domain.*;
|
|
import com.zhongzheng.modules.top.goods.service.*;
|
|
import com.zhongzheng.modules.top.goods.service.*;
|
|
import com.zhongzheng.modules.top.settle.domian.TopInstSettle;
|
|
import com.zhongzheng.modules.top.settle.domian.TopInstSettle;
|
|
import com.zhongzheng.modules.top.settle.service.ITopInstSettleService;
|
|
import com.zhongzheng.modules.top.settle.service.ITopInstSettleService;
|
|
|
|
+import com.zhongzheng.modules.user.bo.AddExamApplyNumBo;
|
|
|
|
+import com.zhongzheng.modules.user.bo.CdExamSubscribeBo;
|
|
import com.zhongzheng.modules.user.bo.UserExamGoodsQueryBo;
|
|
import com.zhongzheng.modules.user.bo.UserExamGoodsQueryBo;
|
|
import com.zhongzheng.modules.user.bo.UserExamGoodsSupplementAddBo;
|
|
import com.zhongzheng.modules.user.bo.UserExamGoodsSupplementAddBo;
|
|
import com.zhongzheng.modules.user.domain.UserExamGoods;
|
|
import com.zhongzheng.modules.user.domain.UserExamGoods;
|
|
@@ -242,6 +244,8 @@ public class WxPayServiceImpl implements IWxPayService {
|
|
private String gzh_tokenUrl = "https://api.weixin.qq.com/cgi-bin/token";
|
|
private String gzh_tokenUrl = "https://api.weixin.qq.com/cgi-bin/token";
|
|
|
|
|
|
private String gzh_tokenParam = "grant_type=client_credential&appid=%s&secret=%s";
|
|
private String gzh_tokenParam = "grant_type=client_credential&appid=%s&secret=%s";
|
|
|
|
+ @Value("${exam.subscribeAddExamNum}")
|
|
|
|
+ private String EXAM_SUBSCRIBE_ADD_EXAM_NUM;
|
|
|
|
|
|
|
|
|
|
public void initData(){
|
|
public void initData(){
|
|
@@ -1077,23 +1081,53 @@ public class WxPayServiceImpl implements IWxPayService {
|
|
}
|
|
}
|
|
//增加考试次数
|
|
//增加考试次数
|
|
if (goodsVo.getGoodsType().equals(3)) {
|
|
if (goodsVo.getGoodsType().equals(3)) {
|
|
- UserExamGoodsQueryBo userExamGoodsQueryBo = new UserExamGoodsQueryBo();
|
|
|
|
- userExamGoodsQueryBo.setUserId(order.getUserId());
|
|
|
|
- userExamGoodsQueryBo.setGoodsId(goodsVo.getMakeGoodsId());
|
|
|
|
- List<UserExamGoodsVo> userExamGoodsVos = userExamGoodsService.queryList(userExamGoodsQueryBo);
|
|
|
|
- if (!CollectionUtils.isEmpty(userExamGoodsVos)) {
|
|
|
|
- UserExamGoodsVo userExamGoodsVo = userExamGoodsVos.get(0);//取最后即最新一条
|
|
|
|
- UserExamGoodsSupplementAddBo userExamGoodsSupplementAddBo = new UserExamGoodsSupplementAddBo();
|
|
|
|
- userExamGoodsSupplementAddBo.setGoodsId(goodsVo.getGoodsId());
|
|
|
|
- userExamGoodsSupplementAddBo.setUserExamGoodsId(userExamGoodsVo.getUserExamGoodsId());
|
|
|
|
- userExamGoodsSupplementAddBo.setExamNumber(goodsVo.getStudyCount());
|
|
|
|
- userExamGoodsSupplementAddBo.setStatus(1);
|
|
|
|
- userExamGoodsSupplementAddBo.setOrderGoodsId(g.getOrderGoodsId());
|
|
|
|
- userExamGoodsSupplementService.insertByAddBo(userExamGoodsSupplementAddBo);
|
|
|
|
- UserExamGoods userExamGoods = new UserExamGoods();
|
|
|
|
- userExamGoods.setUserExamGoodsId(userExamGoodsVo.getUserExamGoodsId());
|
|
|
|
- userExamGoods.setExamNumber(userExamGoodsVo.getExamNumber() + goodsVo.getStudyCount());
|
|
|
|
- userExamGoodsService.updateById(userExamGoods);
|
|
|
|
|
|
+ if (ObjectUtils.isNotNull(goodsVo.getUnifySign()) && goodsVo.getUnifySign() == 1 && ObjectUtils.isNotNull(g.getSubOrderGoodsId())){
|
|
|
|
+ //统一补考商品标识 补充考试次数
|
|
|
|
+ UserExamGoods examGoods = userExamGoodsService
|
|
|
|
+ .getOne(new LambdaQueryWrapper<UserExamGoods>()
|
|
|
|
+ .eq(UserExamGoods::getOrderGoodsId, g.getSubOrderGoodsId())
|
|
|
|
+ .last("limit 1"));
|
|
|
|
+ if (ObjectUtils.isNotNull(examGoods)){
|
|
|
|
+ //补充一次机会
|
|
|
|
+ examGoods.setExamNumber(examGoods.getExamNumber() + 1);
|
|
|
|
+ //添加记录
|
|
|
|
+ OrderGoods orderGoods = iOrderGoodsService.getById(g.getSubOrderGoodsId());
|
|
|
|
+ UserExamGoodsSupplementAddBo userExamGoodsSupplementAddBo = new UserExamGoodsSupplementAddBo();
|
|
|
|
+ userExamGoodsSupplementAddBo.setGoodsId(goodsVo.getGoodsId());
|
|
|
|
+ userExamGoodsSupplementAddBo.setUserExamGoodsId(orderGoods.getGoodsId());
|
|
|
|
+ userExamGoodsSupplementAddBo.setExamNumber(1L);
|
|
|
|
+ userExamGoodsSupplementAddBo.setStatus(1);
|
|
|
|
+ userExamGoodsSupplementAddBo.setOrderGoodsId(g.getOrderGoodsId());
|
|
|
|
+ userExamGoodsSupplementService.insertByAddBo(userExamGoodsSupplementAddBo);
|
|
|
|
+ userExamGoodsService.updateById(examGoods);
|
|
|
|
+ //新B端同步考试次数
|
|
|
|
+ AddExamApplyNumBo addExamApplyNum = new AddExamApplyNumBo();
|
|
|
|
+ addExamApplyNum.setUserId(order.getUserId());
|
|
|
|
+ addExamApplyNum.setOrderGoodsId(orderGoods.getOrderGoodsId());
|
|
|
|
+ addExamApplyNum.setNum(1);
|
|
|
|
+ String param = JSONObject.toJSONString(addExamApplyNum);
|
|
|
|
+ Map<String, String> headersMap = new HashMap<>();
|
|
|
|
+ HttpUtils.sendPostJsonHeaderAsync(EXAM_SUBSCRIBE_ADD_EXAM_NUM, param, headersMap);
|
|
|
|
+ }
|
|
|
|
+ }else {
|
|
|
|
+ UserExamGoodsQueryBo userExamGoodsQueryBo = new UserExamGoodsQueryBo();
|
|
|
|
+ userExamGoodsQueryBo.setUserId(order.getUserId());
|
|
|
|
+ userExamGoodsQueryBo.setGoodsId(goodsVo.getMakeGoodsId());
|
|
|
|
+ List<UserExamGoodsVo> userExamGoodsVos = userExamGoodsService.queryList(userExamGoodsQueryBo);
|
|
|
|
+ if (!CollectionUtils.isEmpty(userExamGoodsVos)) {
|
|
|
|
+ UserExamGoodsVo userExamGoodsVo = userExamGoodsVos.get(0);//取最后即最新一条
|
|
|
|
+ UserExamGoodsSupplementAddBo userExamGoodsSupplementAddBo = new UserExamGoodsSupplementAddBo();
|
|
|
|
+ userExamGoodsSupplementAddBo.setGoodsId(goodsVo.getGoodsId());
|
|
|
|
+ userExamGoodsSupplementAddBo.setUserExamGoodsId(userExamGoodsVo.getUserExamGoodsId());
|
|
|
|
+ userExamGoodsSupplementAddBo.setExamNumber(goodsVo.getStudyCount());
|
|
|
|
+ userExamGoodsSupplementAddBo.setStatus(1);
|
|
|
|
+ userExamGoodsSupplementAddBo.setOrderGoodsId(g.getOrderGoodsId());
|
|
|
|
+ userExamGoodsSupplementService.insertByAddBo(userExamGoodsSupplementAddBo);
|
|
|
|
+ UserExamGoods userExamGoods = new UserExamGoods();
|
|
|
|
+ userExamGoods.setUserExamGoodsId(userExamGoodsVo.getUserExamGoodsId());
|
|
|
|
+ userExamGoods.setExamNumber(userExamGoodsVo.getExamNumber() + goodsVo.getStudyCount());
|
|
|
|
+ userExamGoodsService.updateById(userExamGoods);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|