瀏覽代碼

Merge remote-tracking branch 'origin/master'

Joburgess 4 年之前
父節點
當前提交
60903908fc

+ 8 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRegistrationServiceImpl.java

@@ -236,8 +236,10 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
                 ImResult register = imFeignService.register(new ImUserModel(userId.toString(), sysUser.getUsername(), sysUser.getAvatar()));
                 sysUser.setImToken(register.getToken());
             } else {
-                if(!sysUser.getUsername().equals(studentRegistration.getName())){
-                    throw new BizException("操作失败:账户已被注册");
+                if(StringUtils.isNotEmpty(sysUser.getUsername())){
+                    if(!sysUser.getUsername().equals(studentRegistration.getName())){
+                        throw new BizException("操作失败:账户已被注册");
+                    }
                 }
                 if (!sysUser.getUserType().contains("STUDENT")) {
                     sysUser.setUserType(sysUser.getUserType() + ",STUDENT");
@@ -590,8 +592,10 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
                 sysUser.setImToken(register.getToken());
                 teacherDao.updateUser(sysUser);
             } else {
-                if(!sysUser.getUsername().equals(studentRegistration.getName())){
-                    throw new BizException("操作失败:账户已被注册");
+                if(StringUtils.isNotEmpty(sysUser.getUsername())){
+                    if(!sysUser.getUsername().equals(studentRegistration.getName())){
+                        throw new BizException("操作失败:账户已被注册");
+                    }
                 }
                 if (!sysUser.getUserType().contains("STUDENT")) {
                     sysUser.setUserType(sysUser.getUserType() + ",STUDENT");

+ 20 - 0
mec-student/src/main/java/com/ym/mec/student/controller/RepairController.java

@@ -9,7 +9,11 @@ import com.ym.mec.biz.dal.entity.StudentRepair;
 import com.ym.mec.biz.dal.enums.DealStatusEnum;
 import com.ym.mec.biz.dal.enums.GroupType;
 import com.ym.mec.biz.dal.enums.OrderTypeEnum;
+import com.ym.mec.biz.dal.page.GoodsCategoryQueryInfo;
+import com.ym.mec.biz.dal.page.GoodsQueryInfo;
 import com.ym.mec.biz.dal.page.RepairStudentQueryInfo;
+import com.ym.mec.biz.service.GoodsCategoryService;
+import com.ym.mec.biz.service.GoodsService;
 import com.ym.mec.biz.service.StudentPaymentOrderService;
 import com.ym.mec.biz.service.StudentRepairService;
 import com.ym.mec.common.controller.BaseController;
@@ -38,6 +42,10 @@ public class RepairController extends BaseController {
     private StudentRepairService studentRepairService;
     @Autowired
     private StudentPaymentOrderService studentPaymentOrderService;
+    @Autowired
+    private GoodsService goodsService;
+    @Autowired
+    private GoodsCategoryService goodsCategoryService;
 
     @ApiOperation("添加商品销售订单")
     @PostMapping(value = "/addGoodsSellOrder")
@@ -108,4 +116,16 @@ public class RepairController extends BaseController {
         }
         return succeed(studentRepairService.getStudentRepairer(sysUser.getId(),sysUser.getOrganId()));
     }
+
+    @ApiOperation(value = "分页查询商品(教材、辅件)列表")
+    @GetMapping("/queryGoodsPage")
+    public Object queryPage(GoodsQueryInfo queryInfo){
+        return succeed(goodsService.queryPage(queryInfo));
+    }
+
+    @ApiOperation(value = "分页查询商品分类列表")
+    @GetMapping("/queryGoodsCategoryPage")
+    public Object queryGoodsCategoryPage(GoodsCategoryQueryInfo queryInfo) {
+        return succeed(goodsCategoryService.queryPage(queryInfo));
+    }
 }