瀏覽代碼

update 考级报名,根据城市匹配分部

周箭河 5 年之前
父節點
當前提交
54cb836ec3

+ 19 - 16
mec-biz/src/main/java/com/ym/mec/biz/service/impl/DegreeRegistrationServiceImpl.java

@@ -7,15 +7,13 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import com.ym.mec.biz.dal.dao.StudentPaymentOrderDao;
+import com.ym.mec.biz.dal.dao.*;
+import com.ym.mec.biz.dal.entity.Organization;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
-import com.ym.mec.biz.dal.dao.DegreeRegistrationDao;
-import com.ym.mec.biz.dal.dao.SporadicChargeInfoDao;
-import com.ym.mec.biz.dal.dao.SysConfigDao;
 import com.ym.mec.biz.dal.dto.PageInfoDegree;
 import com.ym.mec.biz.dal.entity.DegreeRegistration;
 import com.ym.mec.biz.dal.entity.SporadicChargeInfo;
@@ -54,6 +52,9 @@ public class DegreeRegistrationServiceImpl extends BaseServiceImpl<Integer, Degr
     @Autowired
     private PayService payService;
 
+    @Autowired
+    private OrganizationDao organizationDao;
+
     @Override
     public BaseDAO<Integer, DegreeRegistration> getDAO() {
         return degreeRegistrationDao;
@@ -69,10 +70,10 @@ public class DegreeRegistrationServiceImpl extends BaseServiceImpl<Integer, Degr
             throw new BizException("你选的考试级别不存在");
         }
 
-		if (!chargeInfo.getTitle().equals("一级") && !chargeInfo.getTitle().equals("二级") && StringUtils.equals("免考", degreeRegistration.getTheoryLevel())
-				&& StringUtils.isBlank(degreeRegistration.getTheoryCert())) {
-			throw new BizException("报考级别为“" + chargeInfo.getTitle() + "”且乐理级别是“免考”时,必须上传证书");
-		}
+        if (!chargeInfo.getTitle().equals("一级") && !chargeInfo.getTitle().equals("二级") && StringUtils.equals("免考", degreeRegistration.getTheoryLevel())
+                && StringUtils.isBlank(degreeRegistration.getTheoryCert())) {
+            throw new BizException("报考级别为“" + chargeInfo.getTitle() + "”且乐理级别是“免考”时,必须上传证书");
+        }
 
         String orderNo = idGeneratorService.generatorId("payment") + "";
 
@@ -153,11 +154,13 @@ public class DegreeRegistrationServiceImpl extends BaseServiceImpl<Integer, Degr
 
         String baseApiUrl = sysConfigDao.findConfigValue("base_api_url");
 
-        Map<String, BigDecimal> classFee = new HashMap<>();
-        classFee.put("course", BigDecimal.ZERO);
-        classFee.put("instrument", BigDecimal.ZERO);
-        classFee.put("accessories", BigDecimal.ZERO);
-        classFee.put("other", amount);
+        List<Organization> organs = organizationDao.findAllOrgans();
+        Integer organId = chargeInfo.getOrganId();
+        for (Organization organ : organs) {
+            if (degreeRegistration.getCity().contains(organ.getName())) {
+                organId = organ.getId();
+            }
+        }
 
         String receiver = "kjRegister";
         Map payMap = payService.getPayMap(
@@ -168,11 +171,11 @@ public class DegreeRegistrationServiceImpl extends BaseServiceImpl<Integer, Degr
                 baseApiUrl + "/api-student/studentOrder/paymentResult?orderNo=" + orderNo,
                 chargeInfo.getDetail(),
                 chargeInfo.getDetail(),
-                chargeInfo.getOrganId(),
+                organId,
                 receiver
         );
 
-        studentPaymentOrder.setOrganId(chargeInfo.getOrganId());
+        studentPaymentOrder.setOrganId(organId);
         studentPaymentOrder.setMerNos((String) payMap.get("routingMerNos"));
         studentPaymentOrder.setPaymentChannel((String) payMap.get("type"));
         studentPaymentOrder.setUpdateTime(nowDate);
@@ -181,7 +184,7 @@ public class DegreeRegistrationServiceImpl extends BaseServiceImpl<Integer, Degr
     }
 
     @Override
-    public Boolean updateStatus(Integer id, Integer status,String orderNo) {
+    public Boolean updateStatus(Integer id, Integer status, String orderNo) {
         DegreeRegistration degree = degreeRegistrationDao.getLock(id);
         if (degree == null || degree.getStatus().equals(2)) {
             return true;

+ 1 - 1
mec-student/src/main/java/com/ym/mec/student/controller/DegreeController.java

@@ -32,7 +32,7 @@ import java.util.List;
 import java.util.Map;
 
 @RequestMapping("degree")
-@Api(tags = "级报名服务")
+@Api(tags = "级报名服务")
 @RestController
 public class DegreeController extends BaseController {