|
@@ -0,0 +1,211 @@
|
|
|
|
|
+package com.minpay.shouhuo;
|
|
|
|
|
+
|
|
|
|
|
+import com.minpay.common.bean.User;
|
|
|
|
|
+import com.minpay.common.format.IFormatService;
|
|
|
|
|
+import com.minpay.db.table.own.mapper.OrderManageMapper;
|
|
|
|
|
+import com.startup.minpay.frame.business.IMINAction;
|
|
|
|
|
+import com.startup.minpay.frame.business.res.MINActionResult;
|
|
|
|
|
+import com.startup.minpay.frame.constant.IMINBusinessConstant;
|
|
|
|
|
+import com.startup.minpay.frame.data.format.MINCopyFormat;
|
|
|
|
|
+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.HashMap;
|
|
|
|
|
+import java.util.List;
|
|
|
|
|
+import java.util.Map;
|
|
|
|
|
+
|
|
|
|
|
+/**
|
|
|
|
|
+ * 财务管理
|
|
|
|
|
+ *
|
|
|
|
|
+ * @author wlm
|
|
|
|
|
+ */
|
|
|
|
|
+@MINComponent
|
|
|
|
|
+public class invCardManageAction implements IMINAction {
|
|
|
|
|
+
|
|
|
|
|
+ /**查询订单详情**/
|
|
|
|
|
+ public final static String SELECT_ORDER_DETAIL = "selectOrderDetail";
|
|
|
|
|
+
|
|
|
|
|
+ /**取货、作废**/
|
|
|
|
|
+ public final static String UPDATE_ORDER_STT = "updateOrderStt";
|
|
|
|
|
+
|
|
|
|
|
+ /**查询取货记录**/
|
|
|
|
|
+ public final static String SELECT_PICKUP_RECORD = "selectPickupRecord";
|
|
|
|
|
+
|
|
|
|
|
+ /** 收入统计 **/
|
|
|
|
|
+ public final static String SELECT_INCOME_STATISTICS = "selectIncomeStatistics";
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 收入统计
|
|
|
|
|
+ * @param page
|
|
|
|
|
+ * @param limit
|
|
|
|
|
+ * @param session
|
|
|
|
|
+ * @return
|
|
|
|
|
+ * @throws Exception
|
|
|
|
|
+ */
|
|
|
|
|
+ @MINAction(value = SELECT_INCOME_STATISTICS)
|
|
|
|
|
+ public MINActionResult selectIncomeStatistics (
|
|
|
|
|
+ @MINParam(key = "page", defaultValue = "1") int page,
|
|
|
|
|
+ @MINParam(key = "limit", defaultValue = "10") 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).selectIncomeDetail(rows);
|
|
|
|
|
+
|
|
|
|
|
+ detailList = Service.lookup(IFormatService.class).formatDate(detailList, "newTime");
|
|
|
|
|
+ detailList = Service.lookup(IFormatService.class).formatCurrency(detailList, "sellWxSum", "sellZfSum", "" +
|
|
|
|
|
+ "sellMfSum", "allSell");
|
|
|
|
|
+ //返回数据
|
|
|
|
|
+ res.set(IMINBusinessConstant.F_PAGING_LAY, detailList);
|
|
|
|
|
+ res.set(IMINBusinessConstant.F_PAGING_COUNT, rows.getCount());
|
|
|
|
|
+ return res;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 取货记录
|
|
|
|
|
+ * @param machineNo
|
|
|
|
|
+ * @param orderNo
|
|
|
|
|
+ * @param pickUpDates
|
|
|
|
|
+ * @param page
|
|
|
|
|
+ * @param limit
|
|
|
|
|
+ * @param session
|
|
|
|
|
+ * @return
|
|
|
|
|
+ * @throws Exception
|
|
|
|
|
+ */
|
|
|
|
|
+ @MINAction(value = SELECT_PICKUP_RECORD)
|
|
|
|
|
+ public MINActionResult selectPickupRecord (
|
|
|
|
|
+ @MINParam(key = "machineNo") String machineNo,
|
|
|
|
|
+ @MINParam(key = "orderNo") String orderNo,
|
|
|
|
|
+ @MINParam(key = "pickUpDates") String pickUpDates,
|
|
|
|
|
+ @MINParam(key = "page", defaultValue = "1") int page,
|
|
|
|
|
+ @MINParam(key = "limit", defaultValue = "3") int limit,
|
|
|
|
|
+ MINSession session) throws Exception {
|
|
|
|
|
+ MINActionResult res = new MINActionResult();
|
|
|
|
|
+ User user = session.getUser();
|
|
|
|
|
+ Map<String, String> m = new HashMap<String, String>();
|
|
|
|
|
+ m.put("machineNo", machineNo);
|
|
|
|
|
+ m.put("orderNo", orderNo);
|
|
|
|
|
+ m.put("pickUpDates", pickUpDates);
|
|
|
|
|
+ MINRowBounds rows = new MINRowBounds(page, limit);
|
|
|
|
|
+ List<Map<String, String>> detailList = Service.lookup(IMINDataBaseService.class)
|
|
|
|
|
+ .getMybatisMapper(OrderManageMapper.class).selectPickupRecord(m,rows);
|
|
|
|
|
+ detailList = new MINCopyFormat("{stt:'sttDesc'}").format(detailList);
|
|
|
|
|
+ detailList = Service.lookup(IFormatService.class).formatEnum(detailList,"{sttDesc:'PICKUP_STT'}");
|
|
|
|
|
+ //返回数据
|
|
|
|
|
+ res.set(IMINBusinessConstant.F_PAGING_LAY, detailList);
|
|
|
|
|
+ res.set(IMINBusinessConstant.F_PAGING_COUNT, rows.getCount());
|
|
|
|
|
+ return res;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 查询订单详情
|
|
|
|
|
+ * @param machineNo
|
|
|
|
|
+ * @param pickUpCode
|
|
|
|
|
+ * @param creatdDtes
|
|
|
|
|
+ * @param pickUpDates
|
|
|
|
|
+ * @param pickUpState
|
|
|
|
|
+ * @param page
|
|
|
|
|
+ * @param limit
|
|
|
|
|
+ * @param session
|
|
|
|
|
+ * @return
|
|
|
|
|
+ * @throws Exception
|
|
|
|
|
+ */
|
|
|
|
|
+ @MINAction(value = SELECT_ORDER_DETAIL)
|
|
|
|
|
+ public MINActionResult selectOrderDetail (
|
|
|
|
|
+ @MINParam(key = "machineNo") String machineNo,
|
|
|
|
|
+ @MINParam(key = "pickUpCode") String pickUpCode,
|
|
|
|
|
+ @MINParam(key = "creatdDtes") String creatdDtes,
|
|
|
|
|
+ @MINParam(key = "pickUpDates") String pickUpDates,
|
|
|
|
|
+ @MINParam(key = "pickUpState") String pickUpState,
|
|
|
|
|
+ @MINParam(key = "page", defaultValue = "1") int page,
|
|
|
|
|
+ @MINParam(key = "limit", defaultValue = "3") int limit,
|
|
|
|
|
+ MINSession session) throws Exception {
|
|
|
|
|
+ MINActionResult res = new MINActionResult();
|
|
|
|
|
+ User user = session.getUser();
|
|
|
|
|
+ Map<String, String> m = new HashMap<String, String>();
|
|
|
|
|
+ m.put("machineNo", machineNo);
|
|
|
|
|
+ m.put("pickUpCode", pickUpCode);
|
|
|
|
|
+ m.put("creatdDtes", creatdDtes);
|
|
|
|
|
+ m.put("pickUpDates", pickUpDates);
|
|
|
|
|
+ m.put("pickUpState", pickUpState);
|
|
|
|
|
+ MINRowBounds rows = new MINRowBounds(page, limit);
|
|
|
|
|
+ List<Map<String, String>> detailList = Service.lookup(IMINDataBaseService.class)
|
|
|
|
|
+ .getMybatisMapper(OrderManageMapper.class).selectOrderDetail(m,rows);
|
|
|
|
|
+ // 格式化数据
|
|
|
|
|
+ detailList = Service.lookup(IFormatService.class).formatDateTime(detailList, "pickUpTime");
|
|
|
|
|
+ detailList = Service.lookup(IFormatService.class).formatDateTime(detailList, "createTime");
|
|
|
|
|
+ detailList = new MINCopyFormat("{stt:'sttDesc'}").format(detailList);
|
|
|
|
|
+ detailList = Service.lookup(IFormatService.class).formatEnum(detailList,"{sttDesc:'PICKUP_STT'}");
|
|
|
|
|
+ //返回数据
|
|
|
|
|
+ res.set(IMINBusinessConstant.F_PAGING_LAY, detailList);
|
|
|
|
|
+ res.set(IMINBusinessConstant.F_PAGING_COUNT, rows.getMaxRows());
|
|
|
|
|
+ return res;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param orderNo
|
|
|
|
|
+ * @param deliveryNo
|
|
|
|
|
+ * @param session
|
|
|
|
|
+ * @return
|
|
|
|
|
+ * @throws Exception
|
|
|
|
|
+ */
|
|
|
|
|
+ @MINAction(value = UPDATE_ORDER_STT)
|
|
|
|
|
+ public MINActionResult updateOrderStt(
|
|
|
|
|
+ @MINParam ( key = "orderNo")String orderNo,
|
|
|
|
|
+ @MINParam ( key = "deliveryNo")String deliveryNo,
|
|
|
|
|
+ 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("没有提货信息!");
|
|
|
|
|
+// }
|
|
|
|
|
+ return res;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+}
|