孙镇亮 5 anni fa
parent
commit
f5a79a6909

+ 3 - 3
src/main/java/com/ym/mec/collectfee/controller/UserController.java

@@ -113,11 +113,11 @@ public class UserController extends BaseController {
     @PostMapping("/getClassDetail")
 //    @ApiImplicitParams({ @ApiImplicitParam(name = "clazzId", value = "乐团编号", required = true, dataType = "Integer"),
 //            @ApiImplicitParam(name = "schoolId", value = "学校编号", required = true, dataType = "Integer")})
-    public Object getSchoolDetail(Integer schoolId,Integer clazzId){
-        if(schoolId == null || clazzId == null){
+    public Object getSchoolDetail(Integer schoolId){
+        if(schoolId == null){
             return failed(Constants.PARAM_VERIFY_ERROR_MSG);
         }
-        return succeed(orderService.getSchoolDetail(schoolId,clazzId));
+        return succeed(orderService.getSchoolDetail(schoolId));
     }
 
     /**

+ 1 - 1
src/main/java/com/ym/mec/collectfee/controller/YqPayController.java

@@ -68,7 +68,7 @@ public class YqPayController extends BaseController {
         BigDecimal amount = new BigDecimal("0");
         School school = schoolService.get(order.getClassId());
         //计划招生人数有更新,更新
-        orderService.getSchoolDetail(school.getSchoolId(),order.getClassId());
+        orderService.getSchoolDetail(school.getSchoolId());
 
         //1、判断已报名人数
         CourseGroupInfo courseGroupInfo = CourseGroupInfoService.get(order.getCourseId());

+ 1 - 1
src/main/java/com/ym/mec/collectfee/dao/ApplyInfoDao.java

@@ -45,5 +45,5 @@ public interface ApplyInfoDao extends BaseDAO<Integer, ApplyInfo> {
      */
     int updateUserSub(@Param("userId") Integer userId, @Param("subId")Integer subId, @Param("courseId")Integer courseId, @Param("updateTime") Date updateTime);
 
-    List<String> findUserByClass(@Param("classId") Integer classId,@Param("status") Integer status);
+    List<ApplyInfo> findUserByClass(@Param("classId") Integer classId,@Param("status") Integer status);
 }

+ 1 - 1
src/main/java/com/ym/mec/collectfee/service/OrderService.java

@@ -51,7 +51,7 @@ public interface OrderService extends BaseService<Integer, Order> {
      * @param schoolId
      * @return
      */
-    Object getSchoolDetail(Integer schoolId,Integer clazzId);
+    Object getSchoolDetail(Integer schoolId);
 
 
     /**

+ 7 - 7
src/main/java/com/ym/mec/collectfee/service/impl/ApplyInfoServiceImpl.java

@@ -108,7 +108,7 @@ public class ApplyInfoServiceImpl extends BaseServiceImpl<Integer, ApplyInfo> im
 				String body = xs.toXML(applyInfo);
 				body = body.substring(body.indexOf("<user>")+6,body.indexOf("</user>"));
 				//推送mec注册接口
-				log.info("推送到用户数据到mec注册 body: " + body);
+//				log.info("推送到用户数据到mec注册 body: " + body);
 				body = getBody(body,121301);
 				Date date = new Date();
 				try {
@@ -121,7 +121,7 @@ public class ApplyInfoServiceImpl extends BaseServiceImpl<Integer, ApplyInfo> im
 					body = xs.toXML(applyClass);
 					body = body.substring(body.indexOf("<body>")+6,body.indexOf("</body>"));
 					//推送mec用户缴费
-					log.info("推送到用户数据到mec缴费 body: " + body);
+//					log.info("推送到用户数据到mec缴费 body: " + body);
 					getBody(body,125218);
 					applyInfoDao.update(applyInfo);
 					return true;
@@ -301,7 +301,7 @@ public class ApplyInfoServiceImpl extends BaseServiceImpl<Integer, ApplyInfo> im
 			MecUser mecUser = mecUserDao.get(userId);
 			if(mecUser == null){
 				String body = "<body><userId>" + userId + "</userId></body>";
-				log.info("获取学员信息mec body: " + body);
+//				log.info("获取学员信息mec body: " + body);
 				body = getBody(body, 121313);
 				if(!StringUtils.isEmpty(body)){
 					body = new String(Base64.getDecoder().decode(body));
@@ -324,7 +324,7 @@ public class ApplyInfoServiceImpl extends BaseServiceImpl<Integer, ApplyInfo> im
 			xs.autodetectAnnotations(true);
 			String body = xs.toXML(renewBean);
 			body = body.substring(body.indexOf("<body>")+6,body.indexOf("</body>"));
-			log.info("推送续费数据到mec body: " + body);
+//			log.info("推送续费数据到mec body: " + body);
 			body = CDesECB.encode(key,body);
 			RequestParamBean requestParamBean = new RequestParamBean();
 			requestParamBean.setBody(body);
@@ -335,7 +335,7 @@ public class ApplyInfoServiceImpl extends BaseServiceImpl<Integer, ApplyInfo> im
 			xs.autodetectAnnotations(true);
 			xs.toXML(requestParamBean,writer);
 			body = HttpUtil.postXmlData(writer.toString(), url);
-			log.info("mec响应的续费数据 body: " + body);
+//			log.info("mec响应的续费数据 body: " + body);
 			body = body.substring(body.indexOf("<errCode>") + 9, body.indexOf("</errCode>"));
 //			body = new String(CDesECB.decode(key,body.getBytes()));
 //			body = CDesECB.decodeValue(key,body);
@@ -362,7 +362,7 @@ public class ApplyInfoServiceImpl extends BaseServiceImpl<Integer, ApplyInfo> im
 	public boolean mecUserIsExist(String phone) {
 		try {
 			String body = "<body><uType>1</uType><uName>" + phone +"</uName></body>";
-			log.info("用户是否存在mec系统 body: " + body);
+//			log.info("用户是否存在mec系统 body: " + body);
 			body = getBody(body, 120431);
 			body = new String(Base64.getDecoder().decode(body));
 			if(StringUtils.isEmpty(body)){
@@ -400,7 +400,7 @@ public class ApplyInfoServiceImpl extends BaseServiceImpl<Integer, ApplyInfo> im
 		xs.autodetectAnnotations(true);
 		xs.toXML(requestParamBean,writer);
 		body = HttpUtil.postXmlData(writer.toString(), url);
-		log.info("mec响应参数 body: " + body + " ,cmd: " + cmd);
+//		log.info("mec响应参数 body: " + body + " ,cmd: " + cmd);
 		return body.substring(body.indexOf("<body>")+6,body.indexOf("</body>"));
 	}
 

+ 1 - 1
src/main/java/com/ym/mec/collectfee/service/impl/OrderServiceImpl.java

@@ -91,7 +91,7 @@ public class OrderServiceImpl extends BaseServiceImpl<Integer, Order> implements
 	}
 
 	@Override
-	public Object getSchoolDetail(Integer schoolId,Integer clazzId) {
+	public Object getSchoolDetail(Integer schoolId) {
 		try {
 			RequestParamBean requestParamBean = new RequestParamBean();
 			String body = "<status>1</status><schoolId>" + schoolId + "</schoolId>";

+ 11 - 6
src/main/java/com/ym/mec/collectfee/service/impl/SchoolServiceImpl.java

@@ -13,6 +13,7 @@ import com.ym.mec.collectfee.common.service.impl.BaseServiceImpl;
 import com.ym.mec.collectfee.common.sms.SmsExample;
 import com.ym.mec.collectfee.dao.ApplyInfoDao;
 import com.ym.mec.collectfee.dao.SchoolDao;
+import com.ym.mec.collectfee.entity.ApplyInfo;
 import com.ym.mec.collectfee.entity.Course;
 import com.ym.mec.collectfee.entity.ResponseCourseEntity;
 import com.ym.mec.collectfee.entity.School;
@@ -80,14 +81,18 @@ public class SchoolServiceImpl extends BaseServiceImpl<Integer, School> implemen
 			school.setUpdateTime(new Date());
 			school.setStatus(2);
 			schoolDao.update(school);
-			String url = sendUrl + "schoolId=" + school.getSchoolId() + "&classId=" + school.getId() + "&cityId=" + school.getCityId();
 			//发送短信
 			//获取所有用户手机号列表
-			List<String> userPhone = applyInfoDao.findUserByClass(classId,null);
-			String[] objects=userPhone.toArray(new String[userPhone.size()]);
-			SmsExample.setBatchOnlySms(appId,secretKey,host,algorithm,
-					String.format(Constants.SMS_TEMPLATE, DateUtils.getDayForAfter(new Date(), 2), ShortUrlUtil.sinaShortUrl(url)),
-					null,objects,isGizp,encode);
+			List<ApplyInfo> users = applyInfoDao.findUserByClass(classId,null);
+			String url = null;
+			if(users != null){
+				for(ApplyInfo info : users){
+					url = sendUrl + "branchId=" + info.getBranchId() + "&stuId=" + info.getId() + "&classId=" + info.getClassId();
+					SmsExample.setSingleSms(appId,secretKey,host,algorithm,
+							String.format(Constants.SMS_TEMPLATE, info.getName(),DateUtils.getDayForAfter(new Date(), 2), ShortUrlUtil.sinaShortUrl(url)),
+							null,null,info.getPatriarchPhone(),isGizp,encode);
+				}
+			}
 		}
 	}
 	

+ 1 - 1
src/main/java/com/ym/mec/collectfee/utils/Constants.java

@@ -4,5 +4,5 @@ public interface Constants {
     String PARAM_VERIFY_ERROR_MSG = "参数校验异常";
     String PARAM_EXIST_ERROR_MSG = "该用户已在其他乐团报名";
     
-    String SMS_TEMPLATE = "家长您好:恭喜您的孩子被管乐团录取!请您收到录取通知书后,于%s晚24:00前点此链接%s 或扫录取通知书上的二维码为学生完成入团注册缴费手续,专业以录取专业为准。完成后请关注深圳大雅乐盟(D-Y-M-E)点击菜单栏乐人进入乐团助手页面,查看课程安排。";
+    String SMS_TEMPLATE = "%s家长您好:恭喜您的孩子被管乐团录取!请您收到录取通知书后,于%s晚24:00前点此链接%s 或扫录取通知书上的二维码为学生完成入团注册缴费手续,专业以录取专业为准。完成后请关注深圳大雅乐盟(D-Y-M-E)点击菜单栏乐人进入乐团助手页面,查看课程安排。";
 }

+ 1 - 1
src/main/resources/application.yml

@@ -74,5 +74,5 @@ common:
     sms-appId: EUCP-EMY-SMS1-1AIHP
     sms-secretKey: CBA790799C876DAD
     sms-host-dev: http://bjksmtn.b2m.cn
-    sms-send-request-url: https://pay.dayaedu.com/#/?
+    sms-send-request-url: http://paytest.dayaedu.com/#/home?
 

+ 2 - 2
src/main/resources/config/mybatis/ApplyInfoMapper.xml

@@ -201,8 +201,8 @@
 	<select id="findByUserId" resultMap="ApplyInfo">
 		SELECT * FROM apply_info WHERE user_id_ = #{userId}
 	</select>
-	<select id="findUserByClass" resultType="java.lang.String">
-		SELECT patriarch_phone_ FROM apply_info
+	<select id="findUserByClass" resultMap="ApplyInfo">
+		SELECT * FROM apply_info
 		<where>
 			<if test="classId != null">
 				class_id_ = #{classId}