xubh 4 gadi atpakaļ
vecāks
revīzija
e6efe2b68b

+ 9 - 2
src/main/java/com/minpay/common/pay/ShouhuoPay.java

@@ -354,7 +354,7 @@ public class ShouhuoPay implements IMINAction{
 			) throws Exception {
 
 		MINActionResult res = new MINActionResult();
-		StringBuffer sb = new StringBuffer() ;
+		/*StringBuffer sb = new StringBuffer() ;
 		InputStream is = request.getInputStream();
 		InputStreamReader isr = new InputStreamReader(is, "UTF-8");
 		BufferedReader br = new BufferedReader(isr, 1024*1024);
@@ -383,7 +383,14 @@ public class ShouhuoPay implements IMINAction{
 		amt = CommonUtil.divide(amt,"100");
 		//第三方订单号 OrderNo
 		String sysorderno = resMap.get("OrderNo").toString();
-		//查询订单如果已支付状态表示已经回调过
+		//查询订单如果已支付状态表示已经回调过*/
+		String payOrderno = "123";
+		String orderno = "1000000543";
+		//实付金额  BuyerPayAmount   TotalAmount
+		String amt = "0.02";
+		amt = CommonUtil.divide(amt,"100");
+		//第三方订单号 OrderNo
+		String sysorderno = "1233";
         //调用真实回调
         IDrawService drawService = new DrawServiceImpl();
         drawService.backEx(orderno, sysorderno, "TRADE_SUCCESS", amt,payOrderno, "", "");

+ 9 - 41
src/main/java/com/minpay/shouhuo/deliveryaction/DeliveryAction.java

@@ -141,8 +141,10 @@ public class DeliveryAction implements IMINAction{
 		//获取售货机推送地址
 		String url = Service.lookup(IPropertiesService.class)
 				.getSystemProperties().get(user.getChannel() + "_GET_MACHINE_ADDRESS").getKey();
+        url = "http://127.0.0.1:9999/machine";
 		String retUrl = Service.lookup(IPropertiesService.class)
 				.getSystemProperties().get(user.getChannel() + "_RETURN_MACHINE_ADDRESS").getKey();
+        retUrl = "http://127.0.0.1:9998/services";
 		//组装推送接口
 		String sendUrl = url.concat("/VendingMachineAction/pushGoods").concat("?MINView=JSON");
 		String returnUrl = retUrl.concat("/DeliveryAction/backDeliveryForMachine");
@@ -279,6 +281,13 @@ public class DeliveryAction implements IMINAction{
 			throw new BusinessCodeException("JINM0011");//操作失败!
 		}
 
+        //改变提货状态为2成功....
+        delInf.setStatus("5");
+        //处理提货状态
+        Service.lookup(IMINDataBaseService.class)
+                .getMybatisMapper(VmDeliveryInfMapper.class)
+                .updateByPrimaryKeySelective(delInf);
+
 		//获取处理状态
 		String state = String.valueOf(detail.get("returnData"));
 		JSONObject stateNew = JSONObject.fromObject(state);
@@ -294,48 +303,7 @@ public class DeliveryAction implements IMINAction{
 			String msg = String.valueOf(stateNew.get("msg"));
 			throw new MINBusinessException(msg);//操作失败!
 		}else if("200".equals(String.valueOf(stateNew.get("code")))){
-			//改变提货状态为2成功....
-			delInf.setStatus("5");
-			//处理提货状态
-			Service.lookup(IMINDataBaseService.class)
-					.getMybatisMapper(VmDeliveryInfMapper.class)
-					.updateByPrimaryKeySelective(delInf);
-
-
-			//修改货道商品数量
-			String proEquRelId = delInf.getProEquRelId();
-			VmProEquRel vmProEquRel = Service.lookup(IMINDataBaseService.class)
-											.getMybatisMapper(VmProEquRelMapper.class)
-											.selectByPrimaryKey(proEquRelId);
-			String nums = vmProEquRel.getProductNums();
-			nums = CommonUtil.add(nums,delInf.getDeliveryNums());
-			vmProEquRel.setProductNums(nums);
-			Service.lookup(IMINDataBaseService.class)
-					.getMybatisMapper(VmProEquRelMapper.class)
-					.updateByPrimaryKeySelective(vmProEquRel);
-
-			VmOrderDetails vmOrderDetails = new VmOrderDetails();
-			vmOrderDetails.setDetailsId(delInf.getOrdDetId());
-			vmOrderDetails.setIsDelivery("03");
-			Service.lookup(IMINDataBaseService.class)
-					.getMybatisMapper(VmOrderDetailsMapper.class)
-					.updateByPrimaryKeySelective(vmOrderDetails);
 
-			//查询订单是否都提货
-			VmOrderDetailsExample  vmOrderDetailsExample = new VmOrderDetailsExample();
-			vmOrderDetailsExample.createCriteria().andOrderIdEqualTo(orderNo).andDeliveryIdIsNotNull().andIsDeliveryEqualTo("00");
-			List<VmOrderDetails> vmOrderDetailsList = Service.lookup(IMINDataBaseService.class)
-											.getMybatisMapper(VmOrderDetailsMapper.class)
-											.selectByExample(vmOrderDetailsExample);
-			if(vmOrderDetailsList.size() == 0){
-				VmOrderInf vmOrderInf = new VmOrderInf();
-				vmOrderInf.setId(orderNo);
-				vmOrderInf.setPickupStt("03");
-				Service.lookup(IMINDataBaseService.class)
-						.getMybatisMapper(VmOrderInfMapper.class)
-						.updateByPrimaryKeySelective(vmOrderInf);
-
-			}
 
 		}
 		return res;