wanglm 4 anni fa
parent
commit
5c33a03c67
1 ha cambiato i file con 52 aggiunte e 43 eliminazioni
  1. 52 43
      src/main/java/com/minpay/shouhuo/invCardManageAction.java

+ 52 - 43
src/main/java/com/minpay/shouhuo/invCardManageAction.java

@@ -2,6 +2,10 @@ package com.minpay.shouhuo;
 
 import com.minpay.common.bean.User;
 import com.minpay.common.format.IFormatService;
+import com.minpay.common.service.ILogService;
+import com.minpay.db.table.mapper.VmGameRuleMapper;
+import com.minpay.db.table.mapper.VmOrderInfMapper;
+import com.minpay.db.table.model.VmOrderInf;
 import com.minpay.db.table.own.mapper.OrderManageMapper;
 import com.startup.minpay.frame.business.IMINAction;
 import com.startup.minpay.frame.business.res.MINActionResult;
@@ -39,6 +43,34 @@ public class invCardManageAction implements IMINAction {
 	/**  收入统计 **/
 	public final static String SELECT_INCOME_STATISTICS = "selectIncomeStatistics";
 
+	/**  销售数据 **/
+	public final static String SELECT_SALES_DATA = "selectSalesData";
+
+	/**
+	 * 销售数据
+	 * @param page
+	 * @param limit
+	 * @param session
+	 * @return
+	 * @throws Exception
+	 */
+	@MINAction(value = SELECT_SALES_DATA)
+	public MINActionResult selectSalesData (
+			@MINParam(key = "page", defaultValue = "1") int page,
+			@MINParam(key = "limit", defaultValue = "7") int limit,
+			MINSession session) throws Exception {
+		MINActionResult res = new MINActionResult();
+		User user = session.getUser();
+		MINRowBounds rows = new MINRowBounds(page, limit);
+		List<Map<String, String>> detailList = Service.lookup(IMINDataBaseService.class)
+				.getMybatisMapper(OrderManageMapper.class).selectProductInfo(rows);
+
+		//返回数据
+		res.set(IMINBusinessConstant.F_PAGING_LAY, detailList);
+		res.set(IMINBusinessConstant.F_PAGING_COUNT, rows.getCount());
+		return res;
+	}
+
 	/**
 	 * 收入统计
 	 * @param page
@@ -50,7 +82,7 @@ public class invCardManageAction implements IMINAction {
 	@MINAction(value = SELECT_INCOME_STATISTICS)
 	public MINActionResult selectIncomeStatistics (
 			@MINParam(key = "page", defaultValue = "1") int page,
-			@MINParam(key = "limit", defaultValue = "10") int limit,
+			@MINParam(key = "limit", defaultValue = "7") int limit,
 			MINSession session) throws Exception {
 		MINActionResult res = new MINActionResult();
 		User user = session.getUser();
@@ -151,9 +183,9 @@ public class invCardManageAction implements IMINAction {
 
 
 	/**
-	 *
+	 *卡卷管理、取货、作废
 	 * @param orderNo
-	 * @param deliveryNo
+	 * @param temp	操作0:作废,1:取货
 	 * @param session
 	 * @return
 	 * @throws Exception
@@ -161,49 +193,26 @@ public class invCardManageAction implements IMINAction {
 	@MINAction(value = UPDATE_ORDER_STT)
 	public MINActionResult updateOrderStt(
 			@MINParam ( key = "orderNo")String orderNo,
-			@MINParam ( key = "deliveryNo")String deliveryNo,
+			@MINParam ( key = "temp")String temp,
 			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)
-//				.getSystemProperties().get(user.getChannel() + "_RETURN_MACHINE_ADDRESS").getKey();
-//		//组装推送接口
-//		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);//提货编号
-//		map.put("orderNo", orderNo);//订单编号
-//		//传入渠道验证
-//		map.put("channel", user.getChannel());
-//		List<Map<String,String>> list = Service.lookup(IMINDataBaseService.class)
-//				.getMybatisMapper(OrderManageMapper.class)
-//				.queryDeliverys(map);
-//		if(list != null && list.size() > 0){
-//			//SortedMap<Object, Object> mapNew = new TreeMap<Object, Object>();
-//			Map<String,String> mapNew = new HashMap<String,String>();
-//			mapNew.put("imeiAddr", list.get(0).get("equIMEI"));
-//			mapNew.put("cargoNo", list.get(0).get("cargoWay"));
-//			mapNew.put("deliveryNo", deliveryNo);
-//			mapNew.put("channel", user.getChannel());
-//			mapNew.put("returnUrl", returnUrl);
-//			mapNew.put("MINView", "JSON");
-//			JSONObject jsonOb = JSONObject.fromObject(mapNew);
-//			String str = jsonOb.toString();
-//			String passwardKey = Service.lookup(IPropertiesService.class)
-//					.getSystemProperties().get(user.getChannel() +"_TO_MACHINE_PASSWORD_KEY").getKey();
-//			//数据加密
-//			String	desDe = Base64.encode(DesUtils.getInstance().encrypt(Base64.encode(str).getBytes(),passwardKey.getBytes(),null));
-//			//调用通用通讯接口
-//			String results = HttpPostUtil.sendPostFormachine(sendUrl,desDe);
-//		}else{
-//			throw new MINBusinessException("没有提货信息!");
-//		}
+		String info = "";
+		//更新订单状态
+		VmOrderInf vd = new VmOrderInf();
+		vd.setId(orderNo);
+		if ("0".equals(temp)) {
+			vd.setPickupStt("02");
+			info = "废止";
+		}else if("1".equals(temp)) {
+			vd.setPickupStt("01");
+			info = "发货";
+		}
+		Service.lookup(IMINDataBaseService.class)
+				.updateByPrimaryKeySelective(VmOrderInfMapper.class, vd);
+		//日志
+		String logInfo = user.getName()+"-更新订单状态:" +info+ ",订单号"+orderNo;
+		Service.lookup(ILogService.class).logging(session, logInfo);
 		return res;
 	}