瀏覽代碼

Merge branch 'master' of http://git.dayaedu.com/yonge/mec

zouxuan 5 年之前
父節點
當前提交
ee527dbfa5

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/PracticeBuyResultDto.java

@@ -27,6 +27,8 @@ public class PracticeBuyResultDto {
 
     private String drillTimesJson;
 
+    private String type;
+
     public String getOrderNo() {
         return orderNo;
     }
@@ -90,4 +92,12 @@ public class PracticeBuyResultDto {
     public void setDrillTimesJson(String drillTimesJson) {
         this.drillTimesJson = drillTimesJson;
     }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
 }

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

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

+ 18 - 3
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.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.SysConfigDao;
 import com.ym.mec.biz.dal.dto.BasicUserDto;
@@ -49,6 +50,8 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
     private SysUserCashAccountDetailService sysUserCashAccountDetailService;
     @Autowired
     private SysMessageService sysMessageService;
+    @Autowired
+    private StudentDao studentDao;
 
     @Override
     public BaseDAO<Integer, StudentRepair> getDAO() {
@@ -85,6 +88,16 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
     @Override
     @Transactional(rollbackFor = Exception.class)
     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("邮寄信息必填");
+        }
+        SysUser student =  sysUserFeignService.queryUserById(repairInfo.getStudentId());
+        repairInfo.setOrganId(student.getOrganId());
 
         Date date = new Date();
         BigDecimal amount = repairInfo.getAmount();
@@ -146,7 +159,7 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
             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<>();
         classFee.put("course", BigDecimal.ZERO);
@@ -157,8 +170,8 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
         Map payMap = payService.getPayMap(
                 amount,
                 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(),
@@ -184,6 +197,7 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
         if (sysUser == null) {
             throw new BizException("用户信息获取失败");
         }
+        studentDao.lockUser(sysUser.getId());
         StudentRepair studentRepair = studentRepairDao.getRepairInfo(id);
         if (studentRepair == null) {
             throw new BizException("维修信息不存在");
@@ -239,6 +253,7 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
         }
         Date date = new Date();
         StudentRepair studentRepair = studentRepairDao.get(repairInfo.getId());
+        studentDao.lockUser(studentRepair.getStudentId());
         BigDecimal amount = studentRepair.getAmount();
         String orderNo = idGeneratorService.generatorId("payment") + "";
         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.entity.*;
 import com.ym.mec.biz.dal.enums.OrderTypeEnum;
+import com.ym.mec.biz.service.*;
 import com.ym.mec.util.date.DateUtil;
 import freemarker.template.utility.StringUtil;
 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.enums.DealStatusEnum;
 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.entity.HttpResponseResult;
 import com.ym.mec.thirdparty.adapay.NotifyEvent;
@@ -295,9 +290,12 @@ public class StudentOrderController extends BaseController {
 
 
     @RequestMapping("paymentResult")
-    public void paymentResult(HttpServletResponse response, String orderNo) {
+    public void paymentResult(HttpServletResponse response, String orderNo,String type) {
         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);
         } catch (IOException e) {
             e.printStackTrace();