|
@@ -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,14 @@ 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();
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
String receiver = "kjRegister";
|
|
|
Map payMap = payService.getPayMap(
|
|
@@ -168,11 +172,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 +185,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;
|