Selaa lähdekoodia

add 添加获取学生维修技师接口

周箭河 5 vuotta sitten
vanhempi
commit
2868edc738

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/PracticeGroupServiceImpl.java

@@ -3297,7 +3297,7 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
         practiceBuyResult.setStatus(order.getStatus());
         practiceBuyResult.setStatus(order.getStatus());
         practiceBuyResult.setCreateTime(order.getCreateTime());
         practiceBuyResult.setCreateTime(order.getCreateTime());
         practiceBuyResult.setPrice(order.getExpectAmount());
         practiceBuyResult.setPrice(order.getExpectAmount());
-        if(order.getStatus().equals(DealStatusEnum.FAILED)){
+        if(order.getStatus().equals(DealStatusEnum.FAILED) || order.getGroupType().equals(GroupType.REPAIR)){
             return practiceBuyResult;
             return practiceBuyResult;
         }
         }
         SysConfig practiceCourseMinutesConfig = sysConfigService.findByParamName(SysConfigService.PRACTICE_COURSE_MINUTES);
         SysConfig practiceCourseMinutesConfig = sysConfigService.findByParamName(SysConfigService.PRACTICE_COURSE_MINUTES);

+ 16 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRepairServiceImpl.java

@@ -2,6 +2,7 @@ package com.ym.mec.biz.service.impl;
 
 
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.dao.StudentDao;
 import com.ym.mec.biz.dal.dao.StudentRepairDao;
 import com.ym.mec.biz.dal.dao.StudentRepairDao;
 import com.ym.mec.biz.dal.dao.SysConfigDao;
 import com.ym.mec.biz.dal.dao.SysConfigDao;
 import com.ym.mec.biz.dal.dto.BasicUserDto;
 import com.ym.mec.biz.dal.dto.BasicUserDto;
@@ -49,6 +50,8 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
     private SysUserCashAccountDetailService sysUserCashAccountDetailService;
     private SysUserCashAccountDetailService sysUserCashAccountDetailService;
     @Autowired
     @Autowired
     private SysMessageService sysMessageService;
     private SysMessageService sysMessageService;
+    @Autowired
+    private StudentDao studentDao;
 
 
     @Override
     @Override
     public BaseDAO<Integer, StudentRepair> getDAO() {
     public BaseDAO<Integer, StudentRepair> getDAO() {
@@ -85,7 +88,14 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
     @Override
     @Override
     @Transactional(rollbackFor = Exception.class)
     @Transactional(rollbackFor = Exception.class)
     public Map addRepair(StudentRepair repairInfo) throws Exception {
     public Map addRepair(StudentRepair repairInfo) throws Exception {
-
+        studentDao.lockUser(repairInfo.getEmployeeId());
+        if (repairInfo.getSendType() != null && repairInfo.getSendType().equals(1) &&
+                (repairInfo.getContactName() == null || repairInfo.getContactName().isEmpty()) &&
+                (repairInfo.getContactMobile() == null || repairInfo.getContactMobile().isEmpty()) &&
+                (repairInfo.getAddress() == null || repairInfo.getAddress().isEmpty())
+        ) {
+            throw new BizException("邮寄信息必填");
+        }
         Date date = new Date();
         Date date = new Date();
         BigDecimal amount = repairInfo.getAmount();
         BigDecimal amount = repairInfo.getAmount();
         String orderNo = idGeneratorService.generatorId("payment") + "";
         String orderNo = idGeneratorService.generatorId("payment") + "";
@@ -146,7 +156,7 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
             return notifyMap;
             return notifyMap;
         }
         }
 
 
-        String baseApiUrl = sysConfigDao.findConfigValue(SysConfigService.EDU_TEACHER_BASE_URL);
+        String baseApiUrl = sysConfigDao.findConfigValue(SysConfigService.BASE_API_URL);
 
 
         Map<String, BigDecimal> classFee = new HashMap<>();
         Map<String, BigDecimal> classFee = new HashMap<>();
         classFee.put("course", BigDecimal.ZERO);
         classFee.put("course", BigDecimal.ZERO);
@@ -157,8 +167,8 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
         Map payMap = payService.getPayMap(
         Map payMap = payService.getPayMap(
                 amount,
                 amount,
                 orderNo,
                 orderNo,
-                baseApiUrl + "/api-web/studentOrder/notify",
-                baseApiUrl + "/api-web/studentOrder/paymentResult?orderNo=" + orderNo,
+                baseApiUrl + "/api-student/studentOrder/notify",
+                baseApiUrl + "/api-student/studentOrder/paymentResult?type=edu&orderNo=" + orderNo,
                 "乐器维修",
                 "乐器维修",
                 "乐器维修",
                 "乐器维修",
                 repairInfo.getStudentId(),
                 repairInfo.getStudentId(),
@@ -184,6 +194,7 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
         if (sysUser == null) {
         if (sysUser == null) {
             throw new BizException("用户信息获取失败");
             throw new BizException("用户信息获取失败");
         }
         }
+        studentDao.lockUser(sysUser.getId());
         StudentRepair studentRepair = studentRepairDao.getRepairInfo(id);
         StudentRepair studentRepair = studentRepairDao.getRepairInfo(id);
         if (studentRepair == null) {
         if (studentRepair == null) {
             throw new BizException("维修信息不存在");
             throw new BizException("维修信息不存在");
@@ -239,6 +250,7 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
         }
         }
         Date date = new Date();
         Date date = new Date();
         StudentRepair studentRepair = studentRepairDao.get(repairInfo.getId());
         StudentRepair studentRepair = studentRepairDao.get(repairInfo.getId());
+        studentDao.lockUser(repairInfo.getStudentId());
         BigDecimal amount = studentRepair.getAmount();
         BigDecimal amount = studentRepair.getAmount();
         String orderNo = idGeneratorService.generatorId("payment") + "";
         String orderNo = idGeneratorService.generatorId("payment") + "";
         studentRepair.setTransNo(orderNo);
         studentRepair.setTransNo(orderNo);

+ 6 - 8
mec-student/src/main/java/com/ym/mec/student/controller/StudentOrderController.java

@@ -3,6 +3,7 @@ package com.ym.mec.student.controller;
 import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.enums.OrderTypeEnum;
 import com.ym.mec.biz.dal.enums.OrderTypeEnum;
+import com.ym.mec.biz.service.*;
 import com.ym.mec.util.date.DateUtil;
 import com.ym.mec.util.date.DateUtil;
 import freemarker.template.utility.StringUtil;
 import freemarker.template.utility.StringUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.Api;
@@ -40,12 +41,6 @@ import com.ym.mec.biz.dal.dao.SysConfigDao;
 import com.ym.mec.biz.dal.dao.TeacherCourseStatisticsDao;
 import com.ym.mec.biz.dal.dao.TeacherCourseStatisticsDao;
 import com.ym.mec.biz.dal.enums.DealStatusEnum;
 import com.ym.mec.biz.dal.enums.DealStatusEnum;
 import com.ym.mec.biz.dal.enums.GroupType;
 import com.ym.mec.biz.dal.enums.GroupType;
-import com.ym.mec.biz.service.MusicGroupService;
-import com.ym.mec.biz.service.SporadicChargeInfoService;
-import com.ym.mec.biz.service.StudentPaymentOrderDetailService;
-import com.ym.mec.biz.service.StudentPaymentOrderService;
-import com.ym.mec.biz.service.StudentRegistrationService;
-import com.ym.mec.biz.service.VipGroupService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.thirdparty.adapay.NotifyEvent;
 import com.ym.mec.thirdparty.adapay.NotifyEvent;
@@ -295,9 +290,12 @@ public class StudentOrderController extends BaseController {
 
 
 
 
     @RequestMapping("paymentResult")
     @RequestMapping("paymentResult")
-    public void paymentResult(HttpServletResponse response, String orderNo) {
+    public void paymentResult(HttpServletResponse response, String orderNo,String type) {
         try {
         try {
-            String baseApiUrl = sysConfigDao.findConfigValue("base_api_url");
+            String baseApiUrl = sysConfigDao.findConfigValue(SysConfigService.BASE_API_URL);
+            if(type != null && type.equals("edu")){
+                baseApiUrl = sysConfigDao.findConfigValue(SysConfigService.EDU_TEACHER_BASE_URL);
+            }
             response.sendRedirect(baseApiUrl + "/#/paymentresult?orderNo=" + orderNo);
             response.sendRedirect(baseApiUrl + "/#/paymentresult?orderNo=" + orderNo);
         } catch (IOException e) {
         } catch (IOException e) {
             e.printStackTrace();
             e.printStackTrace();