|
@@ -24,6 +24,8 @@ import com.zhongzheng.common.utils.ToolsUtils;
|
|
|
import com.zhongzheng.common.utils.http.HttpUtils;
|
|
|
import com.zhongzheng.modules.course.domain.CourseSubject;
|
|
|
import com.zhongzheng.modules.course.service.ICourseSubjectService;
|
|
|
+import com.zhongzheng.modules.goods.domain.Goods;
|
|
|
+import com.zhongzheng.modules.goods.service.IGoodsService;
|
|
|
import com.zhongzheng.modules.grade.domain.ClassGradeUser;
|
|
|
import com.zhongzheng.modules.grade.domain.UserPeriod;
|
|
|
import com.zhongzheng.modules.grade.service.IClassGradeUserService;
|
|
@@ -147,6 +149,9 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
|
|
|
@Autowired
|
|
|
private IUserService userService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IGoodsService goodsService;
|
|
|
+
|
|
|
@Autowired
|
|
|
private ITopOldOrderCheckService topOldOrderCheckService;
|
|
|
|
|
@@ -1040,46 +1045,48 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
|
|
|
if (CollectionUtils.isNotEmpty(goodsList)) {
|
|
|
userCount = goodsList.stream().map(TopOldOrderGoods::getUserCard).collect(Collectors.toSet()).size();
|
|
|
}
|
|
|
- // 老系统查询学习状态
|
|
|
- TopOldOrder order = getOne(new LambdaQueryWrapper<TopOldOrder>().eq(TopOldOrder::getOrderSn, query.getOrderSn()));
|
|
|
- Map<String, String> params = new HashMap<>();
|
|
|
- Long nowTime = DateUtils.getNowTime();
|
|
|
- String sign = ToolsUtils.EncoderByMd5(query.getOrderSn() + nowTime.toString() + "pubilc2022");
|
|
|
- params.put("stamp", nowTime.toString());
|
|
|
- params.put("sign", sign);
|
|
|
- params.put("orderSn", query.getOrderSn());
|
|
|
- params.put("type", order.getOrderType().toString());
|
|
|
- String respone = "";
|
|
|
- try {
|
|
|
- respone = HttpUtils.postFormBody(ORDER_STUDY, params);
|
|
|
- if (!respone.contains("\"Status\":true")) {
|
|
|
- throw new CustomException("旧系统订单学员学习情况接口请求错误");
|
|
|
- }
|
|
|
- JSONObject jsonObject = JSONObject.parseObject(respone);
|
|
|
- Object data = jsonObject.get("Data");
|
|
|
- if (ObjectUtils.isNull(data)) {
|
|
|
- //data 为空
|
|
|
- list.forEach(x -> x.setStudyStatus("未开始"));
|
|
|
- } else {
|
|
|
- List<TopOldOrderStudyVo> studyVos = JSONArray.parseArray(JSONObject.toJSONString(data), TopOldOrderStudyVo.class);
|
|
|
- list.forEach(item -> {
|
|
|
- item.setStudyStatus("未开始");
|
|
|
- TopOldOrderStudyVo studyVo = studyVos.stream().filter(x -> x.getUnderOrdeEnrollItemId().equals(item.getSignId())
|
|
|
- && x.getIdNum().equals(item.getUserCard())).findFirst().orElse(null);
|
|
|
- if (ObjectUtils.isNotNull(studyVo) && ObjectUtils.isNotNull(studyVo.getStudyHours())) {
|
|
|
- if (ObjectUtils.isNull(studyVo.getStudyHours()) && studyVo.getStudyHours() == 0) {
|
|
|
- item.setStudyStatus("未开始");
|
|
|
- } else if (studyVo.getStudyHours() < studyVo.getTotalHours()) {
|
|
|
- item.setStudyStatus("学习中");
|
|
|
- } else {
|
|
|
- item.setStudyStatus("已结束");
|
|
|
+ if (query.getOrderFrom() != 4){
|
|
|
+ // 老系统查询学习状态
|
|
|
+ TopOldOrder order = getOne(new LambdaQueryWrapper<TopOldOrder>().eq(TopOldOrder::getOrderSn, query.getOrderSn()));
|
|
|
+ Map<String, String> params = new HashMap<>();
|
|
|
+ Long nowTime = DateUtils.getNowTime();
|
|
|
+ String sign = ToolsUtils.EncoderByMd5(query.getOrderSn() + nowTime.toString() + "pubilc2022");
|
|
|
+ params.put("stamp", nowTime.toString());
|
|
|
+ params.put("sign", sign);
|
|
|
+ params.put("orderSn", query.getOrderSn());
|
|
|
+ params.put("type", order.getOrderType().toString());
|
|
|
+ String respone = "";
|
|
|
+ try {
|
|
|
+ respone = HttpUtils.postFormBody(ORDER_STUDY, params);
|
|
|
+ if (!respone.contains("\"Status\":true")) {
|
|
|
+ throw new CustomException("旧系统订单学员学习情况接口请求错误");
|
|
|
+ }
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(respone);
|
|
|
+ Object data = jsonObject.get("Data");
|
|
|
+ if (ObjectUtils.isNull(data)) {
|
|
|
+ //data 为空
|
|
|
+ list.forEach(x -> x.setStudyStatus("未开始"));
|
|
|
+ } else {
|
|
|
+ List<TopOldOrderStudyVo> studyVos = JSONArray.parseArray(JSONObject.toJSONString(data), TopOldOrderStudyVo.class);
|
|
|
+ list.forEach(item -> {
|
|
|
+ item.setStudyStatus("未开始");
|
|
|
+ TopOldOrderStudyVo studyVo = studyVos.stream().filter(x -> x.getUnderOrdeEnrollItemId().equals(item.getSignId())
|
|
|
+ && x.getIdNum().equals(item.getUserCard())).findFirst().orElse(null);
|
|
|
+ if (ObjectUtils.isNotNull(studyVo) && ObjectUtils.isNotNull(studyVo.getStudyHours())) {
|
|
|
+ if (ObjectUtils.isNull(studyVo.getStudyHours()) && studyVo.getStudyHours() == 0) {
|
|
|
+ item.setStudyStatus("未开始");
|
|
|
+ } else if (studyVo.getStudyHours() < studyVo.getTotalHours()) {
|
|
|
+ item.setStudyStatus("学习中");
|
|
|
+ } else {
|
|
|
+ item.setStudyStatus("已结束");
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- });
|
|
|
+ });
|
|
|
+ }
|
|
|
+ } catch (IOException e) {
|
|
|
+ log.error("旧系统订单学员学习情况接口请求错误" + respone);
|
|
|
+ throw new CustomException("旧系统订单学员学习情况接口请求错误");
|
|
|
}
|
|
|
- } catch (IOException e) {
|
|
|
- log.error("旧系统订单学员学习情况接口请求错误" + respone);
|
|
|
- throw new CustomException("旧系统订单学员学习情况接口请求错误");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -2074,6 +2081,9 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
|
|
|
}
|
|
|
vo.setOrderId(orderVo.getOrderId());
|
|
|
vo.setOrderSn(orderVo.getOrderSn());
|
|
|
+ vo.setOrderUncollected(orderVo.getOrderUncollected());
|
|
|
+ vo.setOrderReceived(orderVo.getOrderReceived());
|
|
|
+ vo.setBrokerage(orderVo.getBrokerage());
|
|
|
Map<String, List<TopOldOrderRefundVo>> map = refunds.stream().collect(Collectors.groupingBy(TopOldOrderRefundVo::getRefundSn));
|
|
|
if (map.keySet().size() > 1) {
|
|
|
//订单多次提交申请
|
|
@@ -2084,6 +2094,34 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
|
|
|
vo.setRefundFee(reduce);
|
|
|
vo.setRefundReason(v.get(0).getApplyReason());
|
|
|
vo.setApplyTime(v.get(0).getCreateTime());
|
|
|
+
|
|
|
+ List<TopRefundUserVo> collect = v.stream().map(item -> {
|
|
|
+ TopRefundUserVo topRefundUserVo = new TopRefundUserVo();
|
|
|
+ topRefundUserVo.setRefundFee(item.getRefundFee());
|
|
|
+ topRefundUserVo.setRefundReason(item.getApplyReason());
|
|
|
+ topRefundUserVo.setOrderSn(orderSn);
|
|
|
+ if (item.getRefundType() == 1) {
|
|
|
+ //学员信息
|
|
|
+ Order one = orderService.getOne(new LambdaQueryWrapper<Order>().eq(Order::getOrderSn, item.getOrderSn()));
|
|
|
+ User user = userService.getById(one.getUserId());
|
|
|
+ topRefundUserVo.setUserCard(EncryptHandler.decrypt(user.getIdCard()));
|
|
|
+ topRefundUserVo.setUserName(user.getRealname());
|
|
|
+ Goods g = goodsService.getById(item.getGoodsId());
|
|
|
+ topRefundUserVo.setGoodsName(g.getGoodsName());
|
|
|
+ //业务名称
|
|
|
+ String businessName = goodsService.getBusinessName(item.getGoodsId());
|
|
|
+ topRefundUserVo.setBusinessName(businessName);
|
|
|
+ } else {
|
|
|
+ TopOldOrderGoods orderGoods = topOrderGoodsService.getById(item.getOrderGoodsId());
|
|
|
+ topRefundUserVo.setUserName(orderGoods.getUserName());
|
|
|
+ topRefundUserVo.setUserCard(EncryptHandler.decrypt(orderGoods.getUserCard()));
|
|
|
+ topRefundUserVo.setBusinessName(orderGoods.getBusinessFullName());
|
|
|
+ topRefundUserVo.setGoodsName(orderGoods.getGoodsName());
|
|
|
+ }
|
|
|
+ topRefundUserVo.setRefundSn(item.getRefundSn());
|
|
|
+ return topRefundUserVo;
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+ vo.setRefundUserList(collect);
|
|
|
}
|
|
|
});
|
|
|
} else {
|
|
@@ -2092,6 +2130,34 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
|
|
|
vo.setRefundFee(reduce);
|
|
|
vo.setRefundReason(refunds.get(0).getApplyReason());
|
|
|
vo.setApplyTime(refunds.get(0).getCreateTime());
|
|
|
+
|
|
|
+ List<TopRefundUserVo> collect = refunds.stream().map(item -> {
|
|
|
+ TopRefundUserVo topRefundUserVo = new TopRefundUserVo();
|
|
|
+ topRefundUserVo.setRefundFee(item.getRefundFee());
|
|
|
+ topRefundUserVo.setRefundReason(item.getApplyReason());
|
|
|
+ topRefundUserVo.setOrderSn(orderSn);
|
|
|
+ if (item.getRefundType() == 1) {
|
|
|
+ //学员信息
|
|
|
+ Order one = orderService.getOne(new LambdaQueryWrapper<Order>().eq(Order::getOrderSn, item.getOrderSn()));
|
|
|
+ User user = userService.getById(one.getUserId());
|
|
|
+ topRefundUserVo.setUserCard(EncryptHandler.decrypt(user.getIdCard()));
|
|
|
+ topRefundUserVo.setUserName(user.getRealname());
|
|
|
+ Goods g = goodsService.getById(item.getGoodsId());
|
|
|
+ topRefundUserVo.setGoodsName(g.getGoodsName());
|
|
|
+ //业务名称
|
|
|
+ String businessName = goodsService.getBusinessName(item.getGoodsId());
|
|
|
+ topRefundUserVo.setBusinessName(businessName);
|
|
|
+ } else {
|
|
|
+ TopOldOrderGoods orderGoods = topOrderGoodsService.getById(item.getOrderGoodsId());
|
|
|
+ topRefundUserVo.setUserName(orderGoods.getUserName());
|
|
|
+ topRefundUserVo.setUserCard(EncryptHandler.decrypt(orderGoods.getUserCard()));
|
|
|
+ topRefundUserVo.setBusinessName(orderGoods.getBusinessFullName());
|
|
|
+ topRefundUserVo.setGoodsName(orderGoods.getGoodsName());
|
|
|
+ }
|
|
|
+ topRefundUserVo.setRefundSn(item.getRefundSn());
|
|
|
+ return topRefundUserVo;
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+ vo.setRefundUserList(collect);
|
|
|
}
|
|
|
// 申请退款审核人
|
|
|
SysTenant tenant = sysTenantService.getById(orderVo.getTenantId());
|