|
@@ -9,10 +9,11 @@ import com.minpay.common.util.CommonUtil;
|
|
import com.minpay.common.util.DateUtil;
|
|
import com.minpay.common.util.DateUtil;
|
|
import com.minpay.common.util.HttpPostUtil;
|
|
import com.minpay.common.util.HttpPostUtil;
|
|
import com.minpay.db.table.mapper.VmDeliveryInfMapper;
|
|
import com.minpay.db.table.mapper.VmDeliveryInfMapper;
|
|
|
|
+import com.minpay.db.table.mapper.VmEquipmentInfMapper;
|
|
import com.minpay.db.table.mapper.VmOrderDetailsMapper;
|
|
import com.minpay.db.table.mapper.VmOrderDetailsMapper;
|
|
-import com.minpay.db.table.model.VmDeliveryInf;
|
|
|
|
-import com.minpay.db.table.model.VmOrderDetails;
|
|
|
|
|
|
+import com.minpay.db.table.model.*;
|
|
import com.minpay.db.table.own.mapper.OrderManageMapper;
|
|
import com.minpay.db.table.own.mapper.OrderManageMapper;
|
|
|
|
+import com.minpay.db.table.own.mapper.ShOrderMapper;
|
|
import com.startup.minpay.frame.business.IMINAction;
|
|
import com.startup.minpay.frame.business.IMINAction;
|
|
import com.startup.minpay.frame.business.res.MINActionResult;
|
|
import com.startup.minpay.frame.business.res.MINActionResult;
|
|
import com.startup.minpay.frame.constant.IMINBusinessConstant;
|
|
import com.startup.minpay.frame.constant.IMINBusinessConstant;
|
|
@@ -58,6 +59,9 @@ public class InvCardManageAction implements IMINAction {
|
|
|
|
|
|
/** 时间轴查询销售金额、预估利润 **/
|
|
/** 时间轴查询销售金额、预估利润 **/
|
|
public final static String SELECT_INCOME_BYDATE = "selectIncomeBydate";
|
|
public final static String SELECT_INCOME_BYDATE = "selectIncomeBydate";
|
|
|
|
+ /** 时间轴查询销售金额、预估利润 (新)**/
|
|
|
|
+ public final static String SELECT_INCOME_BYDATE_NEW = "selectIncomeBydateNew";
|
|
|
|
+
|
|
|
|
|
|
/**
|
|
/**
|
|
* 时间轴查询销售金额、预估利润
|
|
* 时间轴查询销售金额、预估利润
|
|
@@ -384,7 +388,70 @@ public class InvCardManageAction implements IMINAction {
|
|
return res;
|
|
return res;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 时间轴查询销售金额、预估利润
|
|
|
|
+ * @param session
|
|
|
|
+ * @param dateFlag (时间轴 0)
|
|
|
|
+ * @return
|
|
|
|
+ * @throws Exception
|
|
|
|
+ */
|
|
|
|
+ @MINAction(value = SELECT_INCOME_BYDATE_NEW)
|
|
|
|
+ public MINActionResult selectIncomeBydateNew (
|
|
|
|
+ @MINParam(key = "dateFlag") String dateFlag,
|
|
|
|
+ @MINParam(key = "page", defaultValue = "1") int page,
|
|
|
|
+ @MINParam(key = "limit", defaultValue = "3") int limit,
|
|
|
|
+ MINSession session) throws Exception {
|
|
|
|
+ MINActionResult res = new MINActionResult();
|
|
|
|
+ MINRowBounds rows = new MINRowBounds(page, limit);
|
|
|
|
+ User user = session.getUser();
|
|
|
|
+ String dateString = "";
|
|
|
|
+ Map map = new HashMap();
|
|
|
|
+ if("0".equals(dateFlag)) { //当天
|
|
|
|
+ dateString = DateUtil.getCurrentDateString();
|
|
|
|
+ map.put("nowDate", dateString);
|
|
|
|
+ }else if("1".equals(dateFlag)) {//昨天
|
|
|
|
+ //昨天
|
|
|
|
+ dateString = DateUtil.getDifferentDate(-1).substring(0,8);
|
|
|
|
+ map.put("yesDate", dateString);
|
|
|
|
+ }else if("2".equals(dateFlag)) {//本周
|
|
|
|
+ dateString = DateUtil.getDifferentDate(-7).substring(0,8);
|
|
|
|
+ map.put("weekDate", dateString);
|
|
|
|
+ }
|
|
|
|
+ map.put("dateString", dateString);
|
|
|
|
+ /**查询商户机器*/
|
|
|
|
+ VmEquipmentInfExample vmEquipmentInfExample = new VmEquipmentInfExample();
|
|
|
|
+ vmEquipmentInfExample.createCriteria().andBranchidEqualTo(user.getBranchId());
|
|
|
|
+ List<VmEquipmentInf> equipmentInfList = Service.lookup(IMINDataBaseService.class)
|
|
|
|
+ .getMybatisMapper(VmEquipmentInfMapper.class)
|
|
|
|
+ .selectByExample(vmEquipmentInfExample,rows);
|
|
|
|
+ List<Map> reslist = new ArrayList<>();
|
|
|
|
+
|
|
|
|
+ for (int i = 0; i < equipmentInfList.size(); i++) {
|
|
|
|
+ Map resmap = new HashMap();
|
|
|
|
+ VmEquipmentInf equipmentInf = equipmentInfList.get(i);
|
|
|
|
+ map.put("equipmentId",equipmentInf.getId());
|
|
|
|
+ //查询订单总数
|
|
|
|
+ String num = Service.lookup(IMINDataBaseService.class).getMybatisMapper(OrderManageMapper.class).queryOrderNum(map);
|
|
|
|
+ //实际入账
|
|
|
|
+ String countIncome = Service.lookup(IMINDataBaseService.class)
|
|
|
|
+ .getMybatisMapper(OrderManageMapper.class).selectCountIncomeNew(map);
|
|
|
|
+ //查询总成本价
|
|
|
|
+ String predictIncome = Service.lookup(IMINDataBaseService.class)
|
|
|
|
+ .getMybatisMapper(OrderManageMapper.class).selectPredictIncomeNew(map);
|
|
|
|
+ resmap.put("imeiAddr",equipmentInf.getImeiAddr()); //机器号
|
|
|
|
+ resmap.put("orderNum",num); //订单总数
|
|
|
|
+ resmap.put("countIncome",countIncome); //总收入(微信支付宝 充值)
|
|
|
|
+ resmap.put("predictIncome",predictIncome); //成本
|
|
|
|
+ resmap.put("profit",CommonUtil.subtract(countIncome,predictIncome)); //预计利润
|
|
|
|
+ reslist.add(resmap);
|
|
|
|
+ }
|
|
|
|
+ res.set(IMINBusinessConstant.F_PAGING_LAY, reslist);
|
|
|
|
+ res.set(IMINBusinessConstant.F_PAGING_COUNT, rows.getMaxRows());
|
|
|
|
+ return res;
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ public static void main(String[] args) {
|
|
|
|
+ String yesDate = DateUtil.getDifferentDate(-1).substring(0,8);
|
|
|
|
|
|
-
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|