浏览代码

调整回调接口

xubh 4 年之前
父节点
当前提交
cc93b2271a

+ 11 - 6
src/main/java/com/minpay/common/pay/ShouhuoPay.java

@@ -333,19 +333,24 @@ public class ShouhuoPay implements IMINAction{
 			HttpServletRequest request,
 			HttpServletResponse response
 			) throws Exception {
-		PrintWriter printWriter = response.getWriter();
-		printWriter.write("SUCCESS");
-		printWriter.flush();//没有该句也是报一样错.
-		printWriter.close();
+
 		MINActionResult res = new MINActionResult();
 		StringBuffer sb = new StringBuffer() ;
 		InputStream is = request.getInputStream();
-		InputStreamReader isr = new InputStreamReader(is);
-		BufferedReader br = new BufferedReader(isr);
+		InputStreamReader isr = new InputStreamReader(is, "UTF-8");
+		BufferedReader br = new BufferedReader(isr, 1024*1024);
 		String s = "" ;
 		while((s=br.readLine())!=null){
+			System.out.println("数据解析:" + s);
 			sb.append(s) ;
 		}
+		br.close();
+		is.close(); //第一次关闭inputStream
+		isr.close();
+		PrintWriter printWriter = response.getWriter();
+		printWriter.write("SUCCESS");
+		printWriter.flush();//没有该句也是报一样错.
+		printWriter.close();
 		String result = sb.toString();
 		XmlUtil xmlUtil = new XmlUtil();
 		Map<String, Object> resMap = xmlUtil.parseb(result, "ant.mybank.bkmerchanttrade.prePayNotice");

+ 2 - 2
src/main/java/com/minpay/common/service/impl/DrawServiceImpl.java

@@ -65,7 +65,7 @@ public class DrawServiceImpl implements IDrawService {
                 throw new MINBusinessException("售货机没有设置汇率");
             }
             String suijishu  = vmGameRuleList.get(0).getAlipayid();
-
+            payOrderId = payOrderId.substring(payOrderId.length()-10);
             useOrderId = CommonUtil.add(payOrderId, suijishu);
             BigDecimal bigUse = new BigDecimal(useOrderId);
             useOrderId = bigUse.setScale(0, BigDecimal.ROUND_HALF_DOWN).toString();
@@ -87,7 +87,7 @@ public class DrawServiceImpl implements IDrawService {
             BigDecimal bigChouJiangFen = new BigDecimal(chouJiangFen);
             chouJiangFen = bigChouJiangFen.setScale(0, BigDecimal.ROUND_HALF_DOWN).toString();
             // 余数
-            int yushu = Integer.parseInt(useOrderId) % Integer.parseInt(chouJiangFen);
+            long yushu = Long.parseLong(useOrderId) % Integer.parseInt(chouJiangFen);
             System.out.println("货到号:" + drawDto.getHuodaoNo() + ", 余数:" + yushu);
             if(yushu > 1 && yushu < jisuanAmtFen) {
                 drawDto.setDraw(true);

+ 60 - 0
src/main/java/com/minpay/shouhuo/orderaction/RechargeManageAction.java

@@ -0,0 +1,60 @@
+package com.minpay.shouhuo.orderaction;
+
+import com.minpay.common.bean.User;
+import com.minpay.common.format.IFormatService;
+import com.minpay.db.table.mapper.VmRechargeRuleMapper;
+import com.minpay.db.table.model.VmRechargeRule;
+import com.minpay.db.table.model.VmRechargeRuleExample;
+import com.mysql.cj.util.StringUtils;
+import com.startup.minpay.frame.business.IMINAction;
+import com.startup.minpay.frame.business.MINHttpServletRequestContext;
+import com.startup.minpay.frame.business.res.MINActionResult;
+import com.startup.minpay.frame.constant.IMINBusinessConstant;
+import com.startup.minpay.frame.exception.MINBusinessException;
+import com.startup.minpay.frame.jdbc.MINRowBounds;
+import com.startup.minpay.frame.service.base.IMINDataBaseService;
+import com.startup.minpay.frame.service.base.Service;
+import com.startup.minpay.frame.session.MINSession;
+import com.startup.minpay.frame.target.MINAction;
+import com.startup.minpay.frame.target.MINComponent;
+import com.startup.minpay.frame.target.MINParam;
+
+import java.util.List;
+
+/**
+ * 充值规则管理
+ * @author xbh
+ *
+ */
+@MINComponent
+public class RechargeManageAction implements IMINAction {
+	public final static String	QUERY_RECHARGE_RULE				= "queryRechargeRule";
+
+	/**
+	 * 查询充值规则
+	 * @param session
+	 * @param fapRequest
+	 * @return
+	 * @throws MINBusinessException
+	 */
+	@MINAction(value = QUERY_RECHARGE_RULE)
+	public MINActionResult queryRechargeRule(
+			MINSession session,
+			MINHttpServletRequestContext fapRequest
+			) throws MINBusinessException {
+		MINActionResult res = new MINActionResult();
+		User user = session.getUser();
+		String branchId = user.getBranchId();
+		VmRechargeRuleExample vmRechargeRuleExample = new VmRechargeRuleExample();
+		VmRechargeRuleExample.Criteria createCriteria = vmRechargeRuleExample.createCriteria();
+			createCriteria.andBranchEqualTo(branchId);
+		// 查询
+		List<VmRechargeRule> ls = Service.lookup(IMINDataBaseService.class).getMybatisMapper(VmRechargeRuleMapper.class).selectByExample(vmRechargeRuleExample);
+		// 格式化
+		ls = Service.lookup(IFormatService.class).formatDateTime(ls, "createTime");
+		// 设置返回值
+		res.set(IMINBusinessConstant.F_PAGING_LAY, ls);
+		return res;
+	}
+
+}