|
|
@@ -0,0 +1,89 @@
|
|
|
+package com.minpay.shouhuo.orderaction;
|
|
|
+
|
|
|
+import com.minpay.common.bean.User;
|
|
|
+import com.minpay.common.format.IFormatService;
|
|
|
+import com.minpay.db.table.own.mapper.ShOrderMapper;
|
|
|
+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.data.format.MINCopyFormat;
|
|
|
+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.HashMap;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 订单管理
|
|
|
+ * @author xbh
|
|
|
+ *
|
|
|
+ */
|
|
|
+@MINComponent
|
|
|
+public class ShOrderManageAction implements IMINAction {
|
|
|
+ public final static String QUERY_ORDER = "queryOrder";
|
|
|
+
|
|
|
+ /**
|
|
|
+ *查询订单
|
|
|
+ * @param session
|
|
|
+ * @param page
|
|
|
+ * @param limit
|
|
|
+ * @param equipmentId 机器编号
|
|
|
+ * @param equipmentName 机器名称
|
|
|
+ * @param freightwayId 货道编号
|
|
|
+ * @param payMode 支付方式
|
|
|
+ * @param dates 日期(区间)
|
|
|
+ * @param state 状态
|
|
|
+ * @param fapRequest
|
|
|
+ * @return
|
|
|
+ * @throws MINBusinessException
|
|
|
+ */
|
|
|
+ @MINAction(value = QUERY_ORDER)
|
|
|
+ public MINActionResult queryOrder(
|
|
|
+ MINSession session,
|
|
|
+ @MINParam(key = "page", defaultValue = "1") int page,
|
|
|
+ @MINParam(key = "limit", defaultValue = "3") int limit,
|
|
|
+ @MINParam(key = "equipmentId") String equipmentId,
|
|
|
+ @MINParam(key = "equipmentName") String equipmentName,
|
|
|
+ @MINParam(key = "freightwayId") String freightwayId,
|
|
|
+ @MINParam(key = "payMode") String payMode,
|
|
|
+ @MINParam(key = "dates") String dates,
|
|
|
+ @MINParam(key = "state") String state,
|
|
|
+ @MINParam(key = "orderNo") String orderNo,
|
|
|
+ MINHttpServletRequestContext fapRequest
|
|
|
+ ) throws MINBusinessException {
|
|
|
+ MINActionResult res = new MINActionResult();
|
|
|
+ MINRowBounds rows = new MINRowBounds(page, limit);
|
|
|
+ User user = session.getUser();
|
|
|
+
|
|
|
+ // 创建查询条件
|
|
|
+ Map<String, String> p = new HashMap<String, String>();
|
|
|
+ p.put("equipmentId",equipmentId);
|
|
|
+ p.put("equipmentName",equipmentName);
|
|
|
+ p.put("freightwayId",freightwayId);
|
|
|
+ p.put("payMode",payMode);
|
|
|
+ p.put("playerId",user.getUserId());
|
|
|
+ p.put("state",state);
|
|
|
+ p.put("dates", dates);
|
|
|
+ p.put("orderNo", orderNo);
|
|
|
+ // 查询OrderInfMapper.xml
|
|
|
+ List<Map<String, String>> ls = Service.lookup(IMINDataBaseService.class).getMybatisMapper(ShOrderMapper.class).queryOrder(p,rows);
|
|
|
+ // 格式化
|
|
|
+ ls = Service.lookup(IFormatService.class).formatDateTime(ls, "createTime");
|
|
|
+ ls = new MINCopyFormat("{isDraw:'isDrawdesc',payMode:'payModedesc','state':'statedesc','pickupStt':'pickupSttdesc'}").format(ls);
|
|
|
+ ls = Service.lookup(IFormatService.class).formatEnum(ls, "{isDrawdesc:'IS_DRAW',payModedesc:'PAY_TYPE',statedesc:'ORDER_STATE',pickupSttdesc:'ORDER_PICKUP_STT'}");
|
|
|
+ // 设置返回值
|
|
|
+ res.set(IMINBusinessConstant.F_PAGING_LAY, ls);
|
|
|
+ res.set(IMINBusinessConstant.F_PAGING_COUNT, rows.getCount());
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+}
|