浏览代码

Merge branch 'dev'

yangdamao 1 月之前
父节点
当前提交
e2f15ce248
共有 15 个文件被更改,包括 269 次插入9 次删除
  1. 7 0
      zhongzheng-api/src/main/java/com/zhongzheng/controller/user/LoginController.java
  2. 15 0
      zhongzheng-api/src/main/java/com/zhongzheng/controller/wx/WxLoginController.java
  3. 113 0
      zhongzheng-framework/src/main/java/com/zhongzheng/framework/web/service/UserServiceImpl.java
  4. 75 0
      zhongzheng-framework/src/main/java/com/zhongzheng/framework/web/service/WxLoginService.java
  5. 9 9
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/QuestionServiceImpl.java
  6. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/mapper/OrderMapper.java
  7. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/IOrderService.java
  8. 5 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/impl/OrderGoodsRefundServiceImpl.java
  9. 5 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/impl/OrderServiceImpl.java
  10. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/mapper/UserMapper.java
  11. 5 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/IUserService.java
  12. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/wx/service/IWxLoginService.java
  13. 3 0
      zhongzheng-system/src/main/resources/mapper/modules/goods/GoodsMapper.xml
  14. 13 0
      zhongzheng-system/src/main/resources/mapper/modules/order/OrderMapper.xml
  15. 10 0
      zhongzheng-system/src/main/resources/mapper/modules/user/UserMapper.xml

+ 7 - 0
zhongzheng-api/src/main/java/com/zhongzheng/controller/user/LoginController.java

@@ -80,4 +80,11 @@ public class LoginController extends BaseController {
         iUserService.account_loginOutRecord(bo);
         iUserService.account_loginOutRecord(bo);
         return AjaxResult.success();
         return AjaxResult.success();
     }
     }
+
+    @ApiOperation("直播账号登录")
+    @PostMapping("/livetwo/account_login")
+    public AjaxResult liveAccount_login(@RequestBody ActivityExamApplyBo bo) {
+        Map<String,Object> map = iUserService.liveAccount_login(bo);
+        return AjaxResult.success(map);
+    }
 }
 }

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

@@ -210,4 +210,19 @@ public class WxLoginController
         Map<String,String> map = wxLoginService.checkGzh_openId(loginBody);
         Map<String,String> map = wxLoginService.checkGzh_openId(loginBody);
         return AjaxResult.success(map);
         return AjaxResult.success(map);
     }
     }
+
+
+    /**
+     * 一建扫码直播公众号登录
+     *
+     * @param loginBody 一建扫码直播公众号登录
+     * @return 结果
+     */
+    @ApiOperation("一建扫码直播公众号登录")
+    @PostMapping("/app/common/live/gzh_login")
+    public AjaxResult live_login(@RequestBody WxLoginBody loginBody)
+    {
+        Map<String,String> map = wxLoginService.liveGzh_login(loginBody);
+        return AjaxResult.success(map);
+    }
 }
 }

+ 113 - 0
zhongzheng-framework/src/main/java/com/zhongzheng/framework/web/service/UserServiceImpl.java

@@ -59,6 +59,10 @@ import com.zhongzheng.modules.grade.service.IClassGradeUserService;
 import com.zhongzheng.modules.grade.service.impl.ClassGradeServiceImpl;
 import com.zhongzheng.modules.grade.service.impl.ClassGradeServiceImpl;
 import com.zhongzheng.modules.grade.vo.ClassGradeUserGoodsVo;
 import com.zhongzheng.modules.grade.vo.ClassGradeUserGoodsVo;
 import com.zhongzheng.modules.mock.service.IMockApplyService;
 import com.zhongzheng.modules.mock.service.IMockApplyService;
+import com.zhongzheng.modules.order.domain.Order;
+import com.zhongzheng.modules.order.domain.OrderGoods;
+import com.zhongzheng.modules.order.service.IOrderGoodsService;
+import com.zhongzheng.modules.order.service.IOrderService;
 import com.zhongzheng.modules.order.vo.OrderListVo;
 import com.zhongzheng.modules.order.vo.OrderListVo;
 import com.zhongzheng.modules.system.domain.SysTask;
 import com.zhongzheng.modules.system.domain.SysTask;
 import com.zhongzheng.modules.system.domain.SysTenant;
 import com.zhongzheng.modules.system.domain.SysTenant;
@@ -192,6 +196,10 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
     private ICourseProjectTypeService iCourseProjectTypeService;
     private ICourseProjectTypeService iCourseProjectTypeService;
     @Autowired
     @Autowired
     private ICourseBusinessService iCourseBusinessService;
     private ICourseBusinessService iCourseBusinessService;
+    @Autowired
+    private IOrderService iOrderService;
+    @Autowired
+    private IOrderGoodsService iOrderGoodsService;
     @Value("${liveGotoURL}")
     @Value("${liveGotoURL}")
     private String liveGotoURL;
     private String liveGotoURL;
     @Value("${oldSys.goods}")
     @Value("${oldSys.goods}")
@@ -2566,6 +2574,111 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
         return map;
         return map;
     }
     }
 
 
+    @Override
+    public User queryByOpenId(String openId) {
+        return baseMapper.queryByOpenId(openId);
+    }
+
+    @Override
+    public Map<String, Object> liveAccount_login(ActivityExamApplyBo bo) {
+        if(Validator.isEmpty(bo.getUserCard())){
+            throw new CustomException("账号不能为空");
+        }
+        //根据身份证查询账号
+        User user = getOne(new LambdaQueryWrapper<User>()
+                .eq(User::getIdCard, EncryptHandler.encrypt(bo.getUserCard())).eq(User::getStatus, 1).last("limit 1"));
+        if (ObjectUtils.isNull(user)){
+            //新增
+            //检测手机号是否重复
+            User user1 = getOne(new LambdaQueryWrapper<User>()
+                    .eq(User::getTelphone, EncryptHandler.encrypt(bo.getUserPhone())).eq(User::getStatus, 1).last("limit 1"));
+            if (ObjectUtils.isNotNull(user1)){
+                //手机号码重复
+                bo.setUserPhone(TelPhoneUtils.createMobile());
+            }
+            User inertData = new User();
+            inertData.setTelphone(bo.getUserPhone());
+            //隐藏手机号作为初始昵称
+            inertData.setNickname(TelPhoneUtils.hideTelPhone(bo.getUserPhone(),1));
+            //雪花算法产生账号ID
+            SnowflakeIdUtils idWorker = new SnowflakeIdUtils(3, 1);
+            inertData.setUserAccount(String.valueOf(idWorker.nextId()));
+            inertData.setSex(1);
+            inertData.setEduLevel("本科");
+            inertData.setSex(getGenderByIdCard(bo.getUserCard()));
+            inertData.setIdCard(bo.getUserCard());
+            inertData.setRealname(bo.getUserName());
+            inertData.setStatus(1);
+            inertData.setRegisterPlat("6");
+            inertData.setAvatar(Constants.DEFAULT_AVATAR);
+            inertData.setLastLoginIp(IpUtils.getIpAddr(ServletUtils.getRequest()));
+            inertData.setLastLoginTime(DateUtils.getNowTime());
+            inertData.setCreateTime(DateUtils.getNowTime());
+            inertData.setUpdateTime(DateUtils.getNowTime());
+            String pwd = "";
+            if (ObjectUtils.isNotNull(bo.getUserCard())){
+                pwd =  bo.getUserCard().substring(bo.getUserCard().length() - 6);
+            }else {
+                pwd =  bo.getUserPhone().substring(bo.getUserPhone().length() - 6);
+            }
+            inertData.setPasswordAes(EncryptHandler.encrypt(pwd));
+            inertData.setPassword(SecurityUtils.encryptPassword(pwd));
+            if(!save(inertData)){
+                throw new CustomException("注册失败");
+            }
+            user = inertData;
+        }
+
+        //是否领取直播课程
+        String goodsId = configService.selectConfigByKey("live.gzh.goodsid");
+        if (StringUtils.isNotBlank(goodsId)){
+            Long number = iOrderService.countByGoodsId(user.getUserId(),Long.valueOf(goodsId));
+            if (number <= 0){
+                //没有领取,创建订单
+                Goods goods = iGoodsService.getById(goodsId);
+                //生成订单号
+                String out_trade_no = DateUtils.getDateOrderSn();
+                Order order = new Order();
+                order.setOrderSn(out_trade_no);
+                order.setUserId(user.getUserId());
+                order.setOrderPrice(goods.getStandPrice());
+                order.setOrderStatus(1);
+                order.setCreateTime(DateUtils.getNowTime());
+                order.setUpdateTime(DateUtils.getNowTime());
+                order.setPayType(1);
+                order.setStatus(1);
+                order.setOrderType(2);
+                order.setPayPrice(goods.getStandPrice());
+                order.setOrderFrom(3);
+                order.setPayStatus(3);
+                order.setCheckStatus(1);
+                order.setOrderRefundStatus(1);
+                order.setFinishStatus(1);
+
+                //订单商品
+                OrderGoods orderGoods = new OrderGoods();
+                orderGoods.setOrderSn(out_trade_no);
+                orderGoods.setGoodsYear("2026");
+                orderGoods.setStatus(1);
+                orderGoods.setPayStatus(4);
+                orderGoods.setCreateTime(DateUtils.getNowTime());
+                orderGoods.setUpdateTime(DateUtils.getNowTime());
+                orderGoods.setGoodsId(Long.valueOf(goodsId));
+
+                iOrderGoodsService.save(orderGoods);
+                iOrderService.save(order);
+            }
+        }
+
+        ClientLoginUser loginUser = new ClientLoginUser();
+        loginUser.setUser(user);
+        Map<String,Object> map = new HashMap<>();
+        map.put(Constants.TOKEN,wxTokenService.createToken(loginUser));
+        map.put("user_account",user.getUserAccount());
+        map.put("full_info",Validator.isEmpty(user.getIdCard())?false:true); //是否完善身份信息
+        return map;
+    }
+
     /**
     /**
      * 根据身份证号码判断性别
      * 根据身份证号码判断性别
      *
      *

+ 75 - 0
zhongzheng-framework/src/main/java/com/zhongzheng/framework/web/service/WxLoginService.java

@@ -31,6 +31,10 @@ import com.zhongzheng.modules.goods.domain.Goods;
 import com.zhongzheng.modules.goods.service.IGoodsService;
 import com.zhongzheng.modules.goods.service.IGoodsService;
 import com.zhongzheng.modules.goods.vo.GoodsVo;
 import com.zhongzheng.modules.goods.vo.GoodsVo;
 import com.zhongzheng.modules.grade.domain.ClassGradeUser;
 import com.zhongzheng.modules.grade.domain.ClassGradeUser;
+import com.zhongzheng.modules.order.domain.Order;
+import com.zhongzheng.modules.order.domain.OrderGoods;
+import com.zhongzheng.modules.order.service.IOrderGoodsService;
+import com.zhongzheng.modules.order.service.IOrderService;
 import com.zhongzheng.modules.system.domain.SysConfig;
 import com.zhongzheng.modules.system.domain.SysConfig;
 import com.zhongzheng.modules.system.domain.SysTenant;
 import com.zhongzheng.modules.system.domain.SysTenant;
 import com.zhongzheng.modules.system.service.ISysConfigService;
 import com.zhongzheng.modules.system.service.ISysConfigService;
@@ -162,6 +166,9 @@ public class WxLoginService implements IWxLoginService {
     @Autowired
     @Autowired
     private IGoodsService iGoodsService;
     private IGoodsService iGoodsService;
 
 
+    @Autowired
+    private IOrderGoodsService iOrderGoodsService;
+
     @Autowired
     @Autowired
     private ISysConfigService configService;
     private ISysConfigService configService;
 
 
@@ -174,6 +181,9 @@ public class WxLoginService implements IWxLoginService {
     @Autowired
     @Autowired
     private ISysConfigService iSysConfigService;
     private ISysConfigService iSysConfigService;
 
 
+    @Autowired
+    private IOrderService iOrderService;
+
     private final String KEY_PREFIX = "GOODS_SHARE";
     private final String KEY_PREFIX = "GOODS_SHARE";
 
 
     public void initData(){
     public void initData(){
@@ -1280,6 +1290,71 @@ public class WxLoginService implements IWxLoginService {
         return jsonObject.get("url_link").toString();
         return jsonObject.get("url_link").toString();
     }
     }
 
 
+    @Override
+    public Map<String, String> liveGzh_login(WxLoginBody loginBody) {
+        initData();
+        String param = String.format(gzh_wxAuthParam, gzh_appid, gzh_appsrcret, loginBody.getCode());
+        String resultString = HttpUtils.sendGet(gzh_wxAuthUrl, param);
+        //解析json
+        JSONObject jsonObject = (JSONObject) JSONObject.parse(resultString);
+        String openId = String.valueOf(jsonObject.get("openid"));
+        User user = iUserService.queryByOpenId(openId);;
+        Map<String, String> map = new HashMap<>();
+        if (user == null) {
+            map.put("isUser","1");
+            map.put("openId",openId);
+            return map;
+        }
+        //是否领取直播课程
+        String goodsId = iSysConfigService.selectConfigByKey("live.gzh.goodsid");
+        if (StringUtils.isNotBlank(goodsId)){
+            Long number = iOrderService.countByGoodsId(user.getUserId(),Long.valueOf(goodsId));
+            if (number <= 0){
+                //没有领取,创建订单
+                Goods goods = iGoodsService.getById(goodsId);
+                //生成订单号
+                String out_trade_no = DateUtils.getDateOrderSn();
+                Order order = new Order();
+                order.setOrderSn(out_trade_no);
+                order.setUserId(user.getUserId());
+                order.setOrderPrice(goods.getStandPrice());
+                order.setOrderStatus(1);
+                order.setCreateTime(DateUtils.getNowTime());
+                order.setUpdateTime(DateUtils.getNowTime());
+                order.setPayType(1);
+                order.setStatus(1);
+                order.setOrderType(2);
+                order.setPayPrice(goods.getStandPrice());
+                order.setOrderFrom(3);
+                order.setPayStatus(3);
+                order.setCheckStatus(1);
+                order.setOrderRefundStatus(1);
+                order.setFinishStatus(1);
+
+                //订单商品
+                OrderGoods orderGoods = new OrderGoods();
+                orderGoods.setOrderSn(out_trade_no);
+                orderGoods.setGoodsYear("2026");
+                orderGoods.setStatus(1);
+                orderGoods.setPayStatus(4);
+                orderGoods.setCreateTime(DateUtils.getNowTime());
+                orderGoods.setUpdateTime(DateUtils.getNowTime());
+                orderGoods.setGoodsId(Long.valueOf(goodsId));
+
+                iOrderGoodsService.save(orderGoods);
+                iOrderService.save(order);
+            }
+        }
+
+        ClientLoginUser loginUser = new ClientLoginUser();
+        loginUser.setUser(user);
+        map.put("openId",openId);
+        map.put("user_account",user.getUserAccount());
+        map.put("isUser","0");
+        map.put(Constants.TOKEN, wxTokenService.createToken(loginUser));
+        return map;
+    }
+
     public Boolean subGzh(String openId) {
     public Boolean subGzh(String openId) {
         String unionId = getWxGzhUserCgiInfo(openId);
         String unionId = getWxGzhUserCgiInfo(openId);
         if (Validator.isNotEmpty(unionId)) {
         if (Validator.isNotEmpty(unionId)) {

+ 9 - 9
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/QuestionServiceImpl.java

@@ -4326,9 +4326,9 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
                 List<QuestionImportV4> questionImportV = questionList2.subList(i, i + a);
                 List<QuestionImportV4> questionImportV = questionList2.subList(i, i + a);
                 //第一个是内容
                 //第一个是内容
                 QuestionImportV4 v4 = questionImportV.get(0);
                 QuestionImportV4 v4 = questionImportV.get(0);
-                question.setContent(questionImage(v4.getQuestionName()));
+                question.setContent(replaceImagePaths(v4.getQuestionName()));
                 question.setType(1);
                 question.setType(1);
-                question.setAnalysisContent(v4.getDescribe());
+                question.setAnalysisContent(replaceImagePaths(v4.getDescribe()));
                 question.setCode(ServletUtils.getEncoded("TM"));
                 question.setCode(ServletUtils.getEncoded("TM"));
                 //正确选项
                 //正确选项
                 Integer index = 0;
                 Integer index = 0;
@@ -4351,9 +4351,9 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
                 List<QuestionImportV4> questionImportV1 = questionList2.subList(i, i + a);
                 List<QuestionImportV4> questionImportV1 = questionList2.subList(i, i + a);
                 //第一个是内容
                 //第一个是内容
                 QuestionImportV4 v41 = questionImportV1.get(0);
                 QuestionImportV4 v41 = questionImportV1.get(0);
-                question.setContent(questionImage(v41.getQuestionName()));
+                question.setContent(replaceImagePaths(v41.getQuestionName()));
                 question.setType(2);
                 question.setType(2);
-                question.setAnalysisContent(v41.getDescribe());
+                question.setAnalysisContent(replaceImagePaths(v41.getDescribe()));
                 //正确选项
                 //正确选项
                 List<Integer> index1 = new ArrayList<>();
                 List<Integer> index1 = new ArrayList<>();
                 //转换单选选项
                 //转换单选选项
@@ -4375,9 +4375,9 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
                 List<QuestionImportV4> questionImportV2 = questionList2.subList(i, i + a);
                 List<QuestionImportV4> questionImportV2 = questionList2.subList(i, i + a);
                 //第一个是内容
                 //第一个是内容
                 QuestionImportV4 v42 = questionImportV2.get(0);
                 QuestionImportV4 v42 = questionImportV2.get(0);
-                question.setContent(questionImage(v42.getQuestionName()));
+                question.setContent(replaceImagePaths(v42.getQuestionName()));
                 question.setType(3);
                 question.setType(3);
-                question.setAnalysisContent(v42.getDescribe());
+                question.setAnalysisContent(replaceImagePaths(v42.getDescribe()));
                 //正确选项
                 //正确选项
                 Integer index2 = 0;
                 Integer index2 = 0;
                 //转换单选选项
                 //转换单选选项
@@ -4417,7 +4417,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
                             List<QuestionImportV4> questionImportV5 = vv.subList(i1, i1 + y);
                             List<QuestionImportV4> questionImportV5 = vv.subList(i1, i1 + y);
                             QuestionImportV4 questionImportV42 = questionImportV5.get(0);
                             QuestionImportV4 questionImportV42 = questionImportV5.get(0);
                             QuestionInfoVo questionInfoVo = new QuestionInfoVo();
                             QuestionInfoVo questionInfoVo = new QuestionInfoVo();
-                            questionInfoVo.setContent(questionImage(questionImportV42.getQuestionName()));
+                            questionInfoVo.setContent(replaceImagePaths(questionImportV42.getQuestionName()));
                             questionInfoVo.setType(1);
                             questionInfoVo.setType(1);
                             //正确选项
                             //正确选项
                             Integer index = 0;
                             Integer index = 0;
@@ -4443,7 +4443,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
                             List<QuestionImportV4> questionImportV6 = vv.subList(i1, i1 + y);
                             List<QuestionImportV4> questionImportV6 = vv.subList(i1, i1 + y);
                             QuestionImportV4 questionImportV42 = questionImportV6.get(0);
                             QuestionImportV4 questionImportV42 = questionImportV6.get(0);
                             QuestionInfoVo questionInfoVo = new QuestionInfoVo();
                             QuestionInfoVo questionInfoVo = new QuestionInfoVo();
-                            questionInfoVo.setContent(questionImage(questionImportV42.getQuestionName()));
+                            questionInfoVo.setContent(replaceImagePaths(questionImportV42.getQuestionName()));
                             questionInfoVo.setType(2);
                             questionInfoVo.setType(2);
                             //正确选项
                             //正确选项
                             List<Integer> index = new ArrayList<>();
                             List<Integer> index = new ArrayList<>();
@@ -4469,7 +4469,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
                             List<QuestionImportV4> questionImportV7 = vv.subList(i1, i1 + y);
                             List<QuestionImportV4> questionImportV7 = vv.subList(i1, i1 + y);
                             QuestionImportV4 questionImportV42 = questionImportV7.get(0);
                             QuestionImportV4 questionImportV42 = questionImportV7.get(0);
                             QuestionInfoVo questionInfoVo = new QuestionInfoVo();
                             QuestionInfoVo questionInfoVo = new QuestionInfoVo();
-                            questionInfoVo.setContent(questionImage(questionImportV42.getQuestionName()));
+                            questionInfoVo.setContent(replaceImagePaths(questionImportV42.getQuestionName()));
                             questionInfoVo.setType(3);
                             questionInfoVo.setType(3);
                             //正确选项
                             //正确选项
                             Integer index2 = 0;
                             Integer index2 = 0;

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/mapper/OrderMapper.java

@@ -96,4 +96,6 @@ public interface OrderMapper extends BaseMapper<Order> {
     String getOrderSnByYW(String orderSn);
     String getOrderSnByYW(String orderSn);
 
 
     OrderGoods getOrderByUser(@Param("userId") Long userId,@Param("year") String year,@Param("majorName") String majorName);
     OrderGoods getOrderByUser(@Param("userId") Long userId,@Param("year") String year,@Param("majorName") String majorName);
+
+    Long countByGoodsId(@Param("userId")Long userId,@Param("goodsId") Long goodsId);
 }
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/IOrderService.java

@@ -156,4 +156,6 @@ public interface IOrderService extends IService<Order> {
     String closeOrderImport(List<CloseOrderImport> importList);
     String closeOrderImport(List<CloseOrderImport> importList);
 
 
 	List<OrderKaoQianListExportVo> exportKaoqianList(OrderQueryBo bo);
 	List<OrderKaoQianListExportVo> exportKaoqianList(OrderQueryBo bo);
+
+    Long countByGoodsId(Long userId, Long goodsId);
 }
 }

+ 5 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/impl/OrderGoodsRefundServiceImpl.java

@@ -199,6 +199,11 @@ public class OrderGoodsRefundServiceImpl extends ServiceImpl<OrderGoodsRefundMap
         OrderGoods orderGoods = iOrderGoodsService.getOne(new LambdaQueryWrapper<OrderGoods>().eq(OrderGoods::getOrderSn,bo.getOrderSn())
         OrderGoods orderGoods = iOrderGoodsService.getOne(new LambdaQueryWrapper<OrderGoods>().eq(OrderGoods::getOrderSn,bo.getOrderSn())
                 .eq(OrderGoods::getGoodsId, bo.getGoodsId()).eq(OrderGoods::getOrderGoodsId, bo.getOrderGoodsId()));
                 .eq(OrderGoods::getGoodsId, bo.getGoodsId()).eq(OrderGoods::getOrderGoodsId, bo.getOrderGoodsId()));
         Order order = iOrderService.getOne(new LambdaQueryWrapper<Order>().eq(Order::getOrderSn, bo.getOrderSn()).last("limit 1"));
         Order order = iOrderService.getOne(new LambdaQueryWrapper<Order>().eq(Order::getOrderSn, bo.getOrderSn()).last("limit 1"));
+
+        Long dayAfter = DateUtils.getDayAfter(orderGoods.getCreateTime(), 200);
+        if (orderGoods.getCreateTime() > dayAfter){
+            throw new CustomException("当前订单已超过半年时间,退款请联系管理员!");
+        }
         if (order.getOrderType() != 3 && order.getOrderFrom() != 7){
         if (order.getOrderType() != 3 && order.getOrderFrom() != 7){
             if(orderGoods.getPayStatus()!=3){
             if(orderGoods.getPayStatus()!=3){
                 throw new CustomException("订单商品尚未完全收费");
                 throw new CustomException("订单商品尚未完全收费");

+ 5 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/impl/OrderServiceImpl.java

@@ -3953,6 +3953,11 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
         return list;
         return list;
     }
     }
 
 
+    @Override
+    public Long countByGoodsId(Long userId, Long goodsId) {
+        return baseMapper.countByGoodsId(userId,goodsId);
+    }
+
     /**
     /**
      * 根据身份证号码判断性别
      * 根据身份证号码判断性别
      *
      *

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/mapper/UserMapper.java

@@ -105,4 +105,6 @@ public interface UserMapper extends BaseMapper<User> {
 
 
     Integer getBusinessPhotoSign(@Param("orderGoodsId")Long orderGoodsId);
     Integer getBusinessPhotoSign(@Param("orderGoodsId")Long orderGoodsId);
 
 
+    @InterceptorIgnore(tenantLine = "true")
+    User queryByOpenId(String openId);
 }
 }

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

@@ -189,4 +189,9 @@ public interface IUserService extends IService<User> {
     void synchronizationUser(Integer orgId);
     void synchronizationUser(Integer orgId);
 
 
 	Map<String, Object> getActivityExamApply(ActivityExamApplyBo bo);
 	Map<String, Object> getActivityExamApply(ActivityExamApplyBo bo);
+
+    User queryByOpenId(String openId);
+
+	Map<String, Object> liveAccount_login(ActivityExamApplyBo bo);
+
 }
 }

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/wx/service/IWxLoginService.java

@@ -4,6 +4,7 @@ package com.zhongzheng.modules.wx.service;
 import com.zhongzheng.modules.course.bo.SectionWatchPerBo;
 import com.zhongzheng.modules.course.bo.SectionWatchPerBo;
 import com.zhongzheng.modules.wx.bo.WxInfoBo;
 import com.zhongzheng.modules.wx.bo.WxInfoBo;
 import com.zhongzheng.modules.wx.bo.WxInfoQuery;
 import com.zhongzheng.modules.wx.bo.WxInfoQuery;
+import com.zhongzheng.modules.wx.bo.WxLoginBody;
 import com.zhongzheng.modules.wx.bo.WxShareGoodsBo;
 import com.zhongzheng.modules.wx.bo.WxShareGoodsBo;
 
 
 import java.util.Map;
 import java.util.Map;
@@ -40,4 +41,6 @@ public interface IWxLoginService
     String getWxSmallLink();
     String getWxSmallLink();
 
 
     String getWxSmallStudyCentreLink();
     String getWxSmallStudyCentreLink();
+
+    Map<String, String> liveGzh_login(WxLoginBody loginBody);
 }
 }

+ 3 - 0
zhongzheng-system/src/main/resources/mapper/modules/goods/GoodsMapper.xml

@@ -325,6 +325,9 @@
         <if test="projectId != null and projectId != ''">
         <if test="projectId != null and projectId != ''">
             AND g.project_id = #{projectId}
             AND g.project_id = #{projectId}
         </if>
         </if>
+        <if test="goodsId != null and goodsId != ''">
+            AND g.goods_id = #{goodsId}
+        </if>
         <if test="schoolId != null and schoolId != ''">
         <if test="schoolId != null and schoolId != ''">
             AND g.school_id = #{schoolId}
             AND g.school_id = #{schoolId}
         </if>
         </if>

+ 13 - 0
zhongzheng-system/src/main/resources/mapper/modules/order/OrderMapper.xml

@@ -1334,4 +1334,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 	        LIMIT 1
 	        LIMIT 1
     </select>
     </select>
 
 
+    <select id="countByGoodsId" parameterType="java.lang.Long" resultType="java.lang.Long">
+        SELECT
+            COUNT(*)
+        FROM
+            `order` o
+                LEFT JOIN order_goods og ON o.order_sn = og.order_sn
+        WHERE
+            o.`status` = 1
+          AND o.user_id = #{userId}
+          AND og.goods_id = #{goodsId}
+          AND og.`status` = 1
+    </select>
+
 </mapper>
 </mapper>

+ 10 - 0
zhongzheng-system/src/main/resources/mapper/modules/user/UserMapper.xml

@@ -846,5 +846,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </if>
         </if>
         order by u.user_id desc
         order by u.user_id desc
     </select>
     </select>
+    <select id="queryByOpenId" resultType="com.zhongzheng.modules.user.domain.User">
+        SELECT
+            u.*
+        FROM
+            `user` u
+        WHERE
+            u.`status` = 1
+          AND u.gzh_open_id = #{openId}
+            LIMIT 1
+    </select>
 
 
 </mapper>
 </mapper>