孙镇亮 6 gadi atpakaļ
vecāks
revīzija
6e08415a6a

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

@@ -22,7 +22,6 @@ import org.springframework.web.bind.annotation.ModelAttribute;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
-import sun.plugin2.util.NativeLibLoader;
 
 import java.io.InputStreamReader;
 import java.math.BigDecimal;
@@ -69,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());

+ 2 - 1
src/main/java/com/ym/mec/collectfee/entity/RequestHead.java

@@ -17,7 +17,8 @@ public class RequestHead {
     private Integer cmd;
 
     //调用接口的用户id
-    private Integer uid = 1490;
+    private Integer uid = 1048;
+//    private Integer uid = 102;
 
     //请求时间戳,yyyymmddhhmmss
     private String ts;

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

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

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

@@ -90,7 +90,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 {
@@ -103,7 +103,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;
@@ -211,7 +211,7 @@ public class ApplyInfoServiceImpl extends BaseServiceImpl<Integer, ApplyInfo> im
 	public Map<String, Object> getUserRegisterViewDetail(Integer stuId) {
 		Map<String, Object> vIewDetail = applyInfoDao.getUserRegisterVIewDetail(stuId);
 		String subName = vIewDetail.get("sub_name_").toString();
-		if(subName.contains("圆号") || subName.contains("上低音") ||subName.contains("长号") ||subName.contains("大号")){
+		if(subName.contains("圆号") || subName.contains("上低音") ||subName.contains("长号") ||subName.contains("大号") || subName.contains("次中音号")){
 			vIewDetail.put("isCopperPipe",true);
 		}else {
 			vIewDetail.put("isCopperPipe",false);
@@ -279,7 +279,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));
@@ -302,7 +302,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);
@@ -313,7 +313,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);
@@ -340,7 +340,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)){
@@ -398,7 +398,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>"));
 	}
 

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

@@ -152,7 +152,8 @@ public class OrderServiceImpl extends BaseServiceImpl<Integer, Order> implements
         if (routingAccount.getBranchId().equals(0)) {
             Map<String, Object> routingList = new HashMap<>();
             routingList.put("routingMerNo", routingAccount.getSellerNo());//分佣账户
-            routingList.put("routingFee", order.getAmount()); //分佣金额
+//            routingList.put("routingFee", order.getAmount()); //分佣金额
+            routingList.put("routingFee", order.getAmount().subtract((order.getAmount().multiply(new BigDecimal(0.28)).divide(new BigDecimal(100))).setScale(2,BigDecimal.ROUND_HALF_UP))); //分佣金额
             tempRoutingList.add(routingList);
         }
 
@@ -178,6 +179,18 @@ public class OrderServiceImpl extends BaseServiceImpl<Integer, Order> implements
         rqMap.put("host", payUrl);
         return rqMap;
     }
+    
+    @Override
+    public List<Order> getOrderByClassId(Integer classId,Integer type) {
+		return orderDao.getOrderByClassId(classId,type);
+	}
+    
+    public static void main(String[] args) {
+		BigDecimal temp = new BigDecimal(1440);
+		BigDecimal feelv = new BigDecimal(0.28);
+		BigDecimal result = temp.subtract((temp.multiply(feelv).divide(new BigDecimal(100))).setScale(2,BigDecimal.ROUND_HALF_UP));
+		System.out.println(result);
+	}
 
 
 }

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

@@ -87,9 +87,10 @@ public class SchoolServiceImpl extends BaseServiceImpl<Integer, School> implemen
 			String url = null;
 			if(users != null){
 				for(ApplyInfo info : users){
+					//String.format(Constants.SMS_TEMPLATE, info.getName(),DateUtils.getDayForAfter(new Date(), 2), ShortUrlUtil.sinaShortUrl(url))
 					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)),
+							smsMsg,
 							null,null,info.getPatriarchPhone(),isGizp,encode);
 				}
 			}

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

@@ -1,5 +1,5 @@
 server:
-  port: 8088
+  port: 9000
   servlet:
     contextPath: /api
 
@@ -13,9 +13,9 @@ spring:
 
   datasource:
     name: test
-    url: jdbc:mysql://47.99.212.176:3306/daya_pay?useUnicode=true&characterEncoding=UTF8&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai
-    username: daya
-    password: dayapayonline2019
+    url: jdbc:mysql://47.99.212.176:3306/mec_pay?useUnicode=true&characterEncoding=UTF8&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai
+    username: mec_dev
+    password: mec_dev
     # 使用druid数据源
     type: com.alibaba.druid.pool.DruidDataSource
     driver-class-name: com.mysql.cj.jdbc.Driver
@@ -63,18 +63,18 @@ logging:
 yq-pay:
   pay-host: https://qyfapi.95epay.com
   query-host: https://qyfquery.95epay.com
-  notify-url: http://47.99.212.176:9000/yqpay/notify #通知
-  return-host: http://pay.dayaedu.com #支付返回
+  notify-url: http://testpay.dayaedu.com/api/yqpay/notify #通知
+  return-host: http://testpay.dayaedu.com #支付返回
   merno: 0021677
 
 common:
   properties:
-    mec-publicKey: 96e021bdc8c20c5afe238bf2ba12c171
-    mec-url: http://101.200.3.78:9001/api/sys
-    key: 96e021bdc8c20c5afe238bf2ba12c171
-    keyId: 1490
+    mec-publicKey: e99a18c428cb38d5f260853678922e03
+    mec-url: http://101.200.2.249:9001/api/sys
+    key: e99a18c428cb38d5f260853678922e03
+    keyId: 1048
     sms-appId: EUCP-EMY-SMS1-1AIHP
     sms-secretKey: CBA790799C876DAD
     sms-host-dev: http://bjksmtn.b2m.cn
-    sms-send-request-url: https://pay.dayaedu.com/#/home?
+    sms-send-request-url: http://testpay.dayaedu.com/#/home?