Sfoglia il codice sorgente

Merge remote-tracking branch 'origin/dev' into dev

yangdamao 1 anno fa
parent
commit
064da8afee

+ 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>()

+ 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;

+ 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);
 

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

@@ -1798,7 +1798,7 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
             if(Validator.isEmpty(bo.getSimilarity())){
                 throw new CustomException("相似度缺失");
             }
-            if(bo.getSimilarity()<80){
+            if(bo.getSimilarity()<65){
                 throw new CustomException("相似度不达标");
             }
             UserStudyRecordPhotoAddBo userStudyRecordPhotoAddBo = new UserStudyRecordPhotoAddBo();

+ 14 - 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);

+ 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;
 
 }