xubh 4 years ago
parent
commit
eb05f0d7e1

+ 0 - 22
src/main/java/com/minpay/common/pay/ShouhuoPay.java

@@ -248,28 +248,6 @@ public class ShouhuoPay implements IMINAction{
 			throw new MINBusinessException("调用支付失败");
 		}
 
-		// 抽奖订单
-		/*if("01".equals(ordInf.getProType())) {
-			// 减余额
-			// 创建用户基本账户
-			IAccountService accservice = Service.lookup(IAccountService.class);
-			// 41:消费
-			accservice.modfiyAccount(ordInf.getChannel(), ordInf.getPersonId(), "01",
-					CommonUtil.multiply(ordInf.getOrderAmt(), "-1"), "41", ordInf.getId(), "游戏消费");
-			//调用真实回调
-			backEx(ordInf.getId(), "0000000000", "TRADE_SUCCESS", ordInf.getOrderAmt(), "000000", "", "93");
-			
-		// 正常商品购买、但是选择的是钱包支付
-		} if("00".equals(ordInf.getProType()) && "09".equals(payType)) {
-			// 减余额
-			// 创建用户基本账户
-			IAccountService accservice = Service.lookup(IAccountService.class);
-			// 41:消费
-			accservice.modfiyAccount(ordInf.getChannel(), ordInf.getPersonId(), "01",
-					CommonUtil.multiply(ordInf.getOrderAmt(), "-1"), "41", ordInf.getId(), "购买商品");
-			//调用真实回调
-			backEx(ordInf.getId(), "0000000000", "TRADE_SUCCESS", ordInf.getOrderAmt(), "000000", "", "93");
-		}*/
 		res.set("payMap",resMap);
 		return res;
 

+ 0 - 4
src/main/java/com/minpay/common/service/impl/OrderServiceImpl.java

@@ -156,7 +156,6 @@ public class OrderServiceImpl implements IOrderService {
 							String testVel = Service.lookup(IPropertiesService.class)
 									.getSystemProperties().get("TEST").getKey();
 							if("00".equals(paymentType)){//随机
-								Random aa = new Random();
 								int randomNum = getRandom(85,115);
 								Log.info("=============详情编号:"+detailId+"随机数(比例):"+randomNum);
 								String bili = CommonUtil.divide(String.valueOf(randomNum),"100");
@@ -207,9 +206,6 @@ public class OrderServiceImpl implements IOrderService {
 				continue;
 			}
 		}
-		if(!CommonUtil.isEmpty(payType)){
-			orderAmt = CommonUtil.multiply(orderAmt, payType);
-		}
 		ordInf.setOrderAmt(orderAmt);		//订单总金额
 		ordInf.setBranchid(equInf.getBranchid());
 		//执行新增订单数据

+ 18 - 91
src/main/java/com/minpay/shouhuo/deliveryaction/DeliveryAction.java

@@ -138,7 +138,7 @@ public class DeliveryAction implements IMINAction{
 			MINSession session) throws Exception{
 		MINActionResult res = new MINActionResult();
 		User user = session.getUser();
-		//获取售货机推送地址
+		/**获取售货机推送地址*/
 		String url = Service.lookup(IPropertiesService.class)
 				.getSystemProperties().get(user.getChannel() + "_GET_MACHINE_ADDRESS").getKey();
 		String retUrl = Service.lookup(IPropertiesService.class)
@@ -146,8 +146,8 @@ public class DeliveryAction implements IMINAction{
 		//组装推送接口
 		String sendUrl = url.concat("/VendingMachineAction/pushGoods").concat("?MINView=JSON");
 		String returnUrl = retUrl.concat("/DeliveryAction/backDeliveryForMachine");
-		
-		//组装传送参数
+
+		/**查询数据(提货单号是否存在)*/
 		//初始化查询条件
 		Map<String,String> map = new HashMap<String,String>();
 		map.put("deliveryNo", deliveryNo);//提货编号
@@ -157,52 +157,29 @@ public class DeliveryAction implements IMINAction{
 		List<Map<String,String>> list = Service.lookup(IMINDataBaseService.class)
 												.getMybatisMapper(DeliveryMapper.class)
 												.queryDeliverys(map);
-		if(CommonUtil.isEmpty(deliveryNo)){
-		
-			VmOrderInf orderInf = Service.lookup(IMINDataBaseService.class)
-											.getMybatisMapper(VmOrderInfMapper.class)
-											.selectByPrimaryKey(orderNo);
-			//如果直接购买选择存入卡包则不进行推货
-			if(orderInf.getProState().equals("01")){
-				return res;
-			}
-		}
-//		//未创建提货信息的执行新增
-//		if(list == null || list.size() == 0){
-//			MINActionResult result = createDeliveryInfoTwo(orderNo);
-//			deliveryNo = result.get("dlId");
-//			map.put("deliveryNo", deliveryNo);//提货编号
-//			list = Service.lookup(IMINDataBaseService.class)
-//							.getMybatisMapper(DeliveryMapper.class)
-//							.queryDeliverys(map);
-//		}
-		
-		if(list == null || list.size() == 0){
+
+		if(list == null || list.size() != 1 ){
 			throw new MINBusinessException("没有提货信息!");
 		}
-		
-		if(CommonUtil.isEmpty(deliveryNo)){
-			deliveryNo = list.get(0).get("deliveryNo");
+		String equType = list.get(0).get("equType");
+		if(!"00".equals(equType) || !"01".equals(equType)){
+			throw new MINBusinessException("机器类型不支持推货!");
 		}
-		
-		VmDeliveryInf deliveryInf = Service.lookup(IMINDataBaseService.class)
-											.getMybatisMapper(VmDeliveryInfMapper.class)
-											.selectByPrimaryKey(deliveryNo);
-		if(deliveryInf == null){
+
+		VmDeliveryInf  delInf = Service.lookup(IMINDataBaseService.class)
+				.getMybatisMapper(VmDeliveryInfMapper.class).selectByPrimaryKey(deliveryNo);
+		if(delInf == null){
 			throw new MINBusinessException("没有提货信息!");
 		}
-		
-		if(deliveryInf.getProNums().equals(deliveryInf.getDeliveryNums())){
+
+		if(delInf.getProNums().equals(delInf.getDeliveryNums())){
 			throw new MINBusinessException("提货已完成!");
 		}
-		
-		if(!deliveryInf.getStatus().equals("0") 
-				&& !deliveryInf.getStatus().equals("1") && !deliveryInf.getStatus().equals("5")){
+
+		if(!delInf.getStatus().equals("0")
+				&& !delInf.getStatus().equals("1") && !delInf.getStatus().equals("5")){
 			throw new MINBusinessException("提货处理中,请稍后!");
 		}
-		
-		VmDeliveryInf  delInf = Service.lookup(IMINDataBaseService.class)
-				.getMybatisMapper(VmDeliveryInfMapper.class).selectByPrimaryKey(deliveryNo);
 
 		//改变提货状态为5处理中....
 		delInf.setStatus("5");
@@ -226,42 +203,6 @@ public class DeliveryAction implements IMINAction{
 		//数据加密
 		String	desDe = Base64.encode(DesUtils.getInstance().encrypt(Base64.encode(str).getBytes(),passwardKey.getBytes(),null));
 
-//		new Thread() {
-//            public void run() {
-//            	HttpPostUtil.sendPostFormachine(sendUrl, desDe);
-//            }
-//        }.start();
-
-//		//获取转义后响应信息
-//		JSONObject detail = JSONObject.fromObject(results);
-//		String code = String.valueOf(detail.get("code"));
-//
-//		if(!"0".equals(code)){
-//			Log.info("售货机退货失败:".concat(code));
-//			//改变提货状态为3卡货(提货失败)....
-//			delInf.setStatus("3");
-//			//处理提货状态
-//			Service.lookup(IMINDataBaseService.class)
-//					.getMybatisMapper(VmDeliveryInfMapper.class)
-//					.updateByPrimaryKeySelective(delInf);
-//			throw new BusinessCodeException("JINM0011");//操作失败!
-//		}
-//
-//		//获取处理状态
-//		String state = String.valueOf(detail.get("returnData"));
-//		JSONObject stateNew = JSONObject.fromObject(state);
-//		if(stateNew != null
-//				&& !"200".equals(String.valueOf(stateNew.get("code")))){
-//			Log.info("售货机退货卡货:".concat(CommonUtil.objToString(stateNew.get("msg"))));
-//			//改变提货状态为3卡货....
-//			delInf.setStatus("3");
-//			//处理提货状态
-//			Service.lookup(IMINDataBaseService.class)
-//					.getMybatisMapper(VmDeliveryInfMapper.class)
-//					.updateByPrimaryKeySelective(delInf);
-//			String msg = String.valueOf(stateNew.get("msg"));
-//			throw new MINBusinessException(msg);//操作失败!
-//		}
 
 		String results = HttpPostUtil.sendPostFormachine(sendUrl, desDe);
 		//		//获取转义后响应信息
@@ -278,14 +219,6 @@ public class DeliveryAction implements IMINAction{
 					.updateByPrimaryKeySelective(delInf);
 			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);
@@ -418,19 +351,13 @@ public class DeliveryAction implements IMINAction{
 
 				//更新订单详情
 				detInf.setDeliveryId(dlId);
-				ordInf.setIsDraw("01");
 				detInf.setIsWinning("01");
+				detInf.setIsDelivery("01");
 				Service.lookup(IMINDataBaseService.class)
 						.getMybatisMapper(VmOrderDetailsMapper.class)
 						.updateByPrimaryKeySelective(detInf);
-				if(!ordInf.equals("01") && !ordInf.equals("02")){
-					Service.lookup(IMINDataBaseService.class)
-							.getMybatisMapper(VmOrderInfMapper.class)
-							.updateByPrimaryKeySelective(ordInf);
-				}
 			/**没有中奖的*/
 			}else{
-				ordInf.setIsDraw("00");
 				detInf.setIsWinning("02");
 				Service.lookup(IMINDataBaseService.class)
 						.getMybatisMapper(VmOrderDetailsMapper.class)

+ 3 - 2
src/main/resources/com/minpay/db/table/own/mapper/DeliveryMapper.xml

@@ -70,9 +70,10 @@
   			d.VDI_CARGO_WAY 	 	'cargoWay',
   			d.VDI_PRO_NUMS 	 		'proNums',
 		  	d.VDI_STATUS 		  	'status',
-		  	d.VDI_DELIVERY_NUMS   	'deliveryNums'
+		  	d.VDI_DELIVERY_NUMS   	'deliveryNums',
+			e.VEQ_EQU_TYPE			'equType'
 		FROM vm_delivery_inf	d
-			LEFT JOIN  vm_equipment_inf	e ON	d.VDI_EQUIPMENT_ID = e.VEQ_ID
+			LEFT JOIN  vm_equipment_inf	e ON	d.. = e.VEQ_ID
 				  AND	d.VDI_CHANNEL = e.VEQ_CHANNEL
 			LEFT JOIN  vm_order_details	oD ON	oD.VOD_DETAILS_ID = d.VDI_ORD_DET_ID
 				  AND	d.VDI_CHANNEL = oD.VOD_CHANNEL