yangdamao 2 years ago
parent
commit
cd3d8c001e

+ 8 - 0
zhongzheng-api/src/main/java/com/zhongzheng/controller/wx/WxLoginController.java

@@ -1,6 +1,7 @@
 package com.zhongzheng.controller.wx;
 
 import cn.hutool.core.lang.Validator;
+import com.alibaba.fastjson.JSON;
 import com.github.xiaoymin.knife4j.annotations.ApiSupport;
 import com.zhongzheng.common.constant.Constants;
 import com.zhongzheng.common.core.domain.AjaxResult;
@@ -19,6 +20,8 @@ import com.zhongzheng.modules.wx.bo.WxLoginBody;
 import com.zhongzheng.modules.wx.bo.WxShareGoodsBo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
@@ -43,6 +46,7 @@ public class WxLoginController
     private  IUserService iUserService;
     @Autowired
     private  RedisCache redisCache;
+    private static final Logger log = LoggerFactory.getLogger(WxLoginController.class);
 
     /**
      * 登录方法
@@ -99,10 +103,14 @@ public class WxLoginController
     @PostMapping("/scan_login_check")
     public AjaxResult scanLoginCheck(@RequestBody WxLoginBody loginBody)
     {
+        log.info("loginBody:"+ JSON.toJSONString(loginBody));
         ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
+        log.info("loginUser:"+ JSON.toJSONString(loginUser));
         String scanCode = loginBody.getScanCode();
         String key = "SCAN_LOGIN_"+scanCode;
+        log.info("key:"+ key);
         String keyStatus = "SCAN_LOGIN_STATUS_"+scanCode; //0未扫码 1已扫码 2已登录
+        log.info("keyStatus:"+ keyStatus);
         Long status = redisCache.getCacheObject(keyStatus);
         if(Validator.isNotEmpty(status)&&status.equals(1L)){
             redisCache.setCacheObject(key, loginUser.getUser().getUserId(),60, TimeUnit.SECONDS);//60秒锁定

+ 16 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/impl/GoodsServiceImpl.java

@@ -40,6 +40,8 @@ import com.zhongzheng.modules.goods.domain.*;
 import com.zhongzheng.modules.goods.mapper.GoodsMapper;
 import com.zhongzheng.modules.goods.service.*;
 import com.zhongzheng.modules.goods.vo.*;
+import com.zhongzheng.modules.grade.domain.ClassGradeInterface;
+import com.zhongzheng.modules.grade.service.IClassGradeInterfaceService;
 import com.zhongzheng.modules.grade.vo.ClassGradeVo;
 import com.zhongzheng.modules.grade.vo.SyncGoodsExport;
 import com.zhongzheng.modules.inform.domain.InformRemind;
@@ -123,6 +125,8 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
 
     @Autowired
     private IOrderInputTemplateService iOrderInputTemplateService;
+    @Autowired
+    private IClassGradeInterfaceService iClassGradeInterfaceService;
 
     @Autowired
     private ICourseMenuService iCourseMenuService;
@@ -3392,6 +3396,18 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
             iOrderInputTemplateService.saveBatch(newTemplateList);
         }
 
+        //班级官方通知模板
+        List<ClassGradeInterface> gradeInterfaceList = iClassGradeInterfaceService.list();
+        if (CollectionUtils.isNotEmpty(gradeInterfaceList)){
+            List<ClassGradeInterface> newGradeInterfaceList = gradeInterfaceList.stream().map(x -> {
+                ClassGradeInterface gradeInterface = BeanUtil.toBean(x, ClassGradeInterface.class);
+                gradeInterface.setId(null);
+                gradeInterface.setTenantId(newTenantId);
+                return gradeInterface;
+            }).collect(Collectors.toList());
+            iClassGradeInterfaceService.saveBatch(newGradeInterfaceList);
+        }
+
         //保存记录
         iSysGoodsCopyRecordService.saveBatch(copyRecordList);
         return true;

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/domain/ClassGradeInterface.java

@@ -40,4 +40,6 @@ private static final long serialVersionUID=1L;
     /** 修改时间 */
     @TableField(fill = FieldFill.INSERT_UPDATE)
     private Long updateTime;
+
+    private Long tenantId;
 }

+ 2 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/domain/InformRemind.java

@@ -50,6 +50,7 @@ private static final long serialVersionUID=1L;
     private Integer gzhTpStatus;
     /** 1学员 2教务 */
     private Integer userType;
-
+    /** 类型:1,普通 2,订单初审 3,订单复审 */
+    private Integer type;
     private Long tenantId;
 }

+ 30 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/service/impl/InformSysUserServiceImpl.java

@@ -2,23 +2,31 @@ package com.zhongzheng.modules.inform.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.modules.inform.bo.InformSysUserAddBo;
 import com.zhongzheng.modules.inform.bo.InformSysUserEditBo;
 import com.zhongzheng.modules.inform.bo.InformSysUserQueryBo;
 import com.zhongzheng.modules.inform.bo.InformUserEditBo;
+import com.zhongzheng.modules.inform.domain.InformRemind;
 import com.zhongzheng.modules.inform.domain.InformSysUser;
 import com.zhongzheng.modules.inform.mapper.InformSysUserMapper;
+import com.zhongzheng.modules.inform.service.IInformRemindService;
 import com.zhongzheng.modules.inform.service.IInformSysUserService;
 import com.zhongzheng.modules.inform.vo.InformSysUserVo;
+import com.zhongzheng.modules.order.domain.OrderGoods;
+import com.zhongzheng.modules.order.service.IOrderGoodsService;
 import com.zhongzheng.modules.user.domain.User;
 import io.swagger.models.auth.In;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.github.pagehelper.Page;
 
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
@@ -33,6 +41,11 @@ import java.util.stream.Collectors;
 @Service
 public class InformSysUserServiceImpl extends ServiceImpl<InformSysUserMapper, InformSysUser> implements IInformSysUserService {
 
+    @Autowired
+    private IOrderGoodsService iOrderGoodsService;
+    @Autowired
+    private IInformRemindService iInformRemindService;
+
     @Override
     public InformSysUserVo queryById(Long id){
         InformSysUser db = this.baseMapper.selectById(id);
@@ -56,7 +69,23 @@ public class InformSysUserServiceImpl extends ServiceImpl<InformSysUserMapper, I
         lqw.eq(bo.getGradeId() != null, InformSysUser::getGradeId, bo.getGradeId());
         lqw.eq(bo.getOrderGoodsId() != null, InformSysUser::getOrderGoodsId, bo.getOrderGoodsId());
         lqw.eq(bo.getStatus() != null, InformSysUser::getStatus, bo.getStatus());
-        return entity2Vo(this.list(lqw));
+        List<InformSysUserVo> informSysUserVos = entity2Vo(this.list(lqw));
+        if (CollectionUtils.isEmpty(informSysUserVos)){
+            return new ArrayList<>();
+        }
+        informSysUserVos.forEach(item -> {
+            if (ObjectUtils.isNotNull(item.getOrderGoodsId())){
+                OrderGoods orderGoods = iOrderGoodsService.getById(item.getOrderGoodsId());
+                item.setOrderSn(orderGoods.getOrderSn());
+            }
+            if (ObjectUtils.isNotNull(item.getRemindId())){
+                InformRemind informRemind = iInformRemindService.getById(item.getRemindId());
+                item.setType(informRemind.getType());
+            }else {
+                item.setType(1);
+            }
+        });
+        return informSysUserVos;
     }
 
     /**

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/vo/InformSysUserVo.java

@@ -76,6 +76,10 @@ public class InformSysUserVo {
 	@Excel(name = "订单商品ID")
 	@ApiModelProperty("订单商品ID")
 	private Long orderGoodsId;
+	@ApiModelProperty("订单号")
+	private String orderSn;
+	@ApiModelProperty("消息类型:1,普通 2,订单初审 3,订单复审")
+	private Integer type;
 	/** 状态 1有效 0无效 */
 	@Excel(name = "状态 1有效 0无效")
 	@ApiModelProperty("状态 1有效 0无效")