Kaynağa Gözat

Merge branch 'dev'

yangdamao 1 yıl önce
ebeveyn
işleme
9f36bd5ad0

+ 1 - 2
zhongzheng-admin/src/main/java/com/zhongzheng/controller/user/DangAnController.java

@@ -195,8 +195,7 @@ public class DangAnController extends BaseController {
     public AjaxResult userDataDownload(@RequestBody UserDownloadBo bo) {
         LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
         bo.setCreateSysUserId(loginUser.getUser().getUserId());
-        iUserService.userDataDownload(bo);
-        return AjaxResult.success();
+        return AjaxResult.success(iUserService.userDataDownload(bo));
     }
 
     @ApiOperation("学员资料下载任务")

+ 1 - 1
zhongzheng-admin/src/main/resources/application-dev.yml

@@ -213,4 +213,4 @@ ZsBank:
     sm4key: VuAzSWQhsoNqzn0K
 
 record:
-    downloadPath: http://192.168.1.7:9090/common/user/data/download
+    downloadPath: http://192.168.1.34:9090/common/user/data/download

+ 53 - 4
zhongzheng-framework/src/main/java/com/zhongzheng/framework/web/service/UserServiceImpl.java

@@ -17,6 +17,8 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.github.pagehelper.Page;
 import com.google.common.base.Splitter;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonParser;
 import com.zhongzheng.common.constant.Constants;
 import com.zhongzheng.common.core.domain.model.LoginUser;
 import com.zhongzheng.common.core.redis.RedisCache;
@@ -2015,13 +2017,13 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
     }
 
     @Override
-    public void userDataDownload(UserDownloadBo bo) {
+    public String userDataDownload(UserDownloadBo bo) {
         if (CollectionUtils.isEmpty(bo.getUserIds())){
-            return;
+            return null;
         }
         //创建学员资料下载
         SysTask task = new SysTask();
-        task.setTaskName(String.format("学员资料下载:操作人ID(%s),时间:%s",bo.getCreateSysUserId(),DateUtils.getTime()));
+        task.setTaskName(String.format("<%s>下载:操作人ID(%s),时间:%s",getTaskName(bo.getTypes().get(0)),bo.getCreateSysUserId(),DateUtils.getTime()));
         String code = ServletUtils.getEncoded("DA");
         bo.setTaskCode(code);
         task.setTaskCode(code);
@@ -2039,7 +2041,8 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
         String tenantId = ServletUtils.getRequest().getHeader("TenantId");
         HashMap<String, String> map = new HashMap<>();
         map.put("TenantId", tenantId);
-       HttpUtils.sendPostJsonHeader(RECORD_DOWNLOAD, JSONObject.toJSONString(bo), map);
+        String s = HttpUtils.sendPostJsonHeader(RECORD_DOWNLOAD, JSONObject.toJSONString(bo), map);
+        return JSONObject.parseObject(s).get("msg").toString();
     }
 
     @Override
@@ -2055,6 +2058,13 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
         List<UserDownloadVo> collect = list.stream().map(item -> {
             UserDownloadVo vo = new UserDownloadVo();
             vo.setId(item.getId());
+            if (item.getTaskName().startsWith("<")){
+                int start = item.getTaskName().indexOf("<");
+                int end = item.getTaskName().indexOf(">");
+                vo.setFileName(item.getTaskName().substring(start+1,end));
+            }else {
+                vo.setFileName(item.getTaskName().substring(0,4));
+            }
             vo.setTaskCode(item.getTaskCode());
             vo.setTaskStatus(item.getTaskStatus());
             vo.setCreateSysUserId(item.getSysUserId());
@@ -2065,6 +2075,45 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
         return collect;
     }
 
+    public String getTaskName(Integer Type){
+        if (Type==1){
+            return "学员信息";
+        }
+        if (Type==2){
+            return "个人资料";
+        }
+        if (Type==3){
+            return "订单记录";
+        }
+        if (Type==4){
+            return "报名记录";
+        }
+        if (Type==5){
+            return "网课记录";
+        }
+        if (Type==6){
+            return "题库记录";
+        }
+        if (Type==7){
+            return "直播记录";
+        }
+        if (Type==8){
+            return "资料记录";
+        }
+        if (Type==9){
+            return "约考记录";
+        }
+        if (Type==10){
+            return "考试记录";
+        }
+        if (Type==11){
+            return "证书/证明";
+        }
+        if (Type==12){
+            return "承诺书";
+        }
+        return null;
+    }
     @Override
     public void userDataDownloadUp(UserDataDownloadUpBo bo) {
         SysTask task = iSysTaskService.getOne(new LambdaQueryWrapper<SysTask>()

+ 22 - 10
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseServiceImpl.java

@@ -816,17 +816,29 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
                         && classGradeVo.getPeriodStatus() == 1
                         && (DateUtils.getNowTime() >= goodsUserVo.getServiceStartTime() && DateUtils.getNowTime() <= goodsUserVo.getServiceEndTime())){
                     UserSubscribe userSubscribe = baseMapper.getUserSub(bo.getUserId(),goodsUserVo.getGoodsId());
-                    if (ObjectUtils.isNull(userSubscribe)){
+                    Long examTime = 0L;
+                    if (ObjectUtils.isNotNull(userSubscribe.getApplySiteEndTime())){
+                        Long examTime1 = userSubscribe.getApplySiteExamTime();
+                        String applySiteEndTime = userSubscribe.getApplySiteEndTime();
+                        String s = DateUtils.timestampToDateFormat(examTime1, "yyyy-MM-dd");
+                        String format = String.format("%s %s", s, applySiteEndTime);
+                        examTime = DateUtils.dateTimeSec("yyyy-MM-dd HH:mm", format);
+                    }
+                    if (examTime > 0 && DateUtils.getNowTime() > examTime && ObjectUtils.isNotNull(userSubscribe.getResult()) && userSubscribe.getResult() == 0){
                         goodsUserVo.setSubscribeSign(1);
-                    }else if (userSubscribe.getSubscribeStatus() == 1 && ObjectUtils.isNotNull(userSubscribe.getExamStatus())
-                            && userSubscribe.getExamStatus() == 1
-                            && ObjectUtils.isNull(userSubscribe.getResult())){
-                        goodsUserVo.setSubscribeSign(2);
-                    }else if (userSubscribe.getSubscribeStatus() == 1 && ObjectUtils.isNotNull(userSubscribe.getExamStatus())
-                            && userSubscribe.getExamStatus() == 0){
-                        goodsUserVo.setSubscribeSign(4);
-                    }else if (ObjectUtils.isNotNull(userSubscribe.getResult()) && userSubscribe.getResult() == 0){
-                        goodsUserVo.setSubscribeSign(3);
+                    }else {
+                        if (ObjectUtils.isNull(userSubscribe)){
+                            goodsUserVo.setSubscribeSign(1);
+                        }else if (userSubscribe.getSubscribeStatus() == 1 && ObjectUtils.isNotNull(userSubscribe.getExamStatus())
+                                && userSubscribe.getExamStatus() == 1
+                                && ObjectUtils.isNull(userSubscribe.getResult())){
+                            goodsUserVo.setSubscribeSign(2);
+                        }else if (userSubscribe.getSubscribeStatus() == 1 && ObjectUtils.isNotNull(userSubscribe.getExamStatus())
+                                && userSubscribe.getExamStatus() == 0){
+                            goodsUserVo.setSubscribeSign(4);
+                        }else if (ObjectUtils.isNotNull(userSubscribe.getResult()) && userSubscribe.getResult() == 0){
+                            goodsUserVo.setSubscribeSign(3);
+                        }
                     }
                 }
 

+ 11 - 3
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/impl/OrderServiceImpl.java

@@ -2174,11 +2174,19 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
     private Boolean validUserBeforeBuy(Goods goods, Long userId) {
         if (goods.getGoodsType() == 3 || goods.getGoodsType() == 4) {
             Long makeGoodsId = goods.getMakeGoodsId();
-            UserExamGoods entity = userExamGoodsService.getOne(new LambdaQueryWrapper<UserExamGoods>().eq(UserExamGoods::getUserId, userId).eq(UserExamGoods::getGoodsId, makeGoodsId).last("limit 1"));
-            if (Validator.isEmpty(entity)) {
-                throw new CustomException("请先购买此补考前培商品的绑定商品", 510);
+            String makeGoodsIds = goods.getMakeGoodsIds();
+            if(Validator.isNotEmpty(makeGoodsIds)){
+                List<String> makeGoodsIdList = Arrays.stream(makeGoodsIds.toString().split(",")).collect(Collectors.toList());
+                UserExamGoods entity = userExamGoodsService.getOne(new LambdaQueryWrapper<UserExamGoods>().eq(UserExamGoods::getUserId, userId)
+                        .in(UserExamGoods::getGoodsId,makeGoodsIdList).last("limit 1"));
+                if (Validator.isEmpty(entity)) {
+                    throw new CustomException("请先购买此补考前培商品的绑定商品", 510);
+                }
+            }else{
+                throw new CustomException("补考商品未关联商品", 510);
             }
 
+
         }
         return true;
     }

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/system/domain/SysTask.java

@@ -30,7 +30,7 @@ public class SysTask implements Serializable {
     private Integer taskType;
     /** 关联账号ID */
     private Long sysUserId;
-    /** 任务名称 */
+    /** 文件名称 */
     private String taskName;
     /** 任务名称 */
     private String taskCode;

+ 2 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/goods/service/impl/TopOldOrderServiceImpl.java

@@ -4521,7 +4521,7 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
         if (CollectionUtils.isEmpty(orderGoods)) {
             throw new CustomException("订单学员课程信息获取有误");
         }
-        if (orderGoods.stream().allMatch(x -> x.getRefundStatus() != 0 && x.getRefundStatus() != 3)) {
+        if (orderGoods.stream().allMatch(x -> x.getRefundStatus() != 0 && x.getRefundStatus() != 3 && x.getRefundStatus() != 4)) {
             throw new CustomException("订单申请退款学员有误,请检查");
         }
 
@@ -4651,6 +4651,7 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
         vo.setOrderSn(orderVo.getOrderSn());
         vo.setOrderUncollected(orderVo.getOrderUncollected());
         vo.setOrderReceived(orderVo.getOrderReceived());
+        vo.setPayType(orderVo.getPayType());
         BigDecimal decimal = orderVo.getPretaxBrokerage();
         if (ObjectUtils.isNotNull(decimal) && count > 0){
             decimal = orderVo.getPretaxBrokerage().divide(new BigDecimal(count), 2, RoundingMode.HALF_UP);

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/IUserService.java

@@ -159,7 +159,7 @@ public interface IUserService extends IService<User> {
 
     void userDataImgImport(MultipartFile file);
 
-    void userDataDownload(UserDownloadBo bo);
+	String userDataDownload(UserDownloadBo bo);
 
 	List<UserDownloadVo> userDataDownloadList(Long userId);
 

+ 19 - 14
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserSubscribeServiceImpl.java

@@ -1072,20 +1072,20 @@ public class UserSubscribeServiceImpl extends ServiceImpl<UserSubscribeMapper, U
                 userSubscribeImports.add(userSubscribeImport);
                 continue;
             }
-//            else {
-//                List<UserSubscribe> userSubscribes = this.list(new LambdaQueryWrapper<UserSubscribe>().eq(UserSubscribe::getUserId, userId).eq(UserSubscribe::getSubscribeStatus, 1).last("limit 1"));
-//                if (!userSubscribes.isEmpty()){
-//                    UserSubscribe userSubscribe = userSubscribes.get(0);
-//                    if (Validator.isNotEmpty(userSubscribeImport.getStudentType())){
-//                        String name = getName(userSubscribe.getStudentType().longValue());
-//                        if (!userSubscribeImport.getStudentType().equals(name)){
-//                            userSubscribeImport.setCause("学员类型错误");
-//                            userSubscribeImports.add(userSubscribeImport);
-//                            continue;
-//                        }
-//                    }
-//                }
-//            }
+            else {
+                List<UserSubscribe> userSubscribes = this.list(new LambdaQueryWrapper<UserSubscribe>().eq(UserSubscribe::getUserId, userId).eq(UserSubscribe::getSubscribeStatus, 1).last("limit 1"));
+                if (!userSubscribes.isEmpty()){
+                    UserSubscribe userSubscribe = userSubscribes.get(0);
+                    if (Validator.isNotEmpty(userSubscribeImport.getStudentType())){
+                        String name = getName(userSubscribe.getStudentType().longValue());
+                        if (!userSubscribeImport.getStudentType().equals(name)){
+                            userSubscribeImport.setCause("学员类型错误");
+                            userSubscribeImports.add(userSubscribeImport);
+                            continue;
+                        }
+                    }
+                }
+            }
             userSubscribeAddBo.setUserId(userId);
             //预约状态
             userSubscribeAddBo.setSubscribeStatus(1);
@@ -1148,6 +1148,11 @@ public class UserSubscribeServiceImpl extends ServiceImpl<UserSubscribeMapper, U
                 }
                 goodsId = item;
             }
+            if (ObjectUtils.isNull(goodsId)){
+                userSubscribeImport.setCause("该学员剩余考试次数不足或已存在相同考试场次");
+                userSubscribeImports.add(userSubscribeImport);
+                continue;
+            }
 
             userSubscribeAddBo.setGoodsId(goodsId);
             //获得当前所在班级

+ 1 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/vo/UserDownloadVo.java

@@ -28,5 +28,6 @@ public class UserDownloadVo implements Serializable {
     private Long taskTime;
 
     private Long createSysUserId;
+    private String fileName;
 
 }