| | |
| | |
|
| | | try {
|
| | | long count = 0;
|
| | | long todayTotal = 0;
|
| | | BigDecimal todayMoney = new BigDecimal(0.00);
|
| | | |
| | | // 查询列表
|
| | | List<CommonOrderVO> list = commonOrderService.getOrderByUid(page, uid, state, type, orderState,
|
| | | orderNo, startTime, endTime, dateType);
|
| | |
|
| | | if (list != null && list.size() > 0) {
|
| | | // 统计总数
|
| | | count = commonOrderService.countGroupOrderNoByUid(uid, state, type, orderState, orderNo,
|
| | | startTime, endTime, dateType);
|
| | | |
| | | // 需要统计信息
|
| | | if (needCount && page == 1) {
|
| | | Map<String, Object> countMap = commonOrderService.countMoneyGroupOrderNoByUid(uid, type,
|
| | | orderNo, startTime, endTime, dateType);
|
| | | if (countMap != null) {
|
| | | BigDecimal totalMoney = (BigDecimal) countMap.get("totalMoney");
|
| | | if (totalMoney != null) {
|
| | | todayMoney = totalMoney;// 当前查询所有订单已到账总金额
|
| | | }
|
| | | |
| | | //当前查询所有已到账订单数量
|
| | | todayTotal = (long) countMap.get("totalRow");
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | int totalValid = 0;
|
| | | int totalProces = 0;
|
| | | int totalInvite = 0;
|
| | | long todayTotal = 0;
|
| | | BigDecimal todayMoney = null;
|
| | | |
| | | // 需要统计信息
|
| | | if (needCount && page == 1) {
|
| | | Map<String, BigDecimal> countOrder = commonOrderService.countByUidAndOrderState(uid, type,
|
| | |
| | | if (countOrder.get("totalInvite") != null) {
|
| | | totalInvite = countOrder.get("totalInvite").intValue();
|
| | | }
|
| | | |
| | | todayTotal = commonOrderService.countOrder(uid, type, 1);
|
| | | todayMoney = commonOrderService.countOrderMoney(uid, type , 1); |
| | | }
|
| | | |
| | | if (todayMoney == null) {
|
| | | todayMoney = new BigDecimal(0);
|
| | | }
|
| | |
|
| | | String helpUrl = configService.get("order_list_help");
|
| | |
| | |
|
| | | if (type != null && type == 1) {
|
| | | data.put("todayMoney", "预估返利总额 ¥" + todayMoney.setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | } else {
|
| | | } else if (type != null &&(type == 2 || type == 3)) {
|
| | | data.put("todayMoney", "预估奖金总额 ¥" + todayMoney.setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | } else {
|
| | | data.put("todayMoney", "预估总额 ¥" + todayMoney.setScale(2, BigDecimal.ROUND_DOWN).toString());
|
| | | }
|
| | | |
| | | data.put("todayTotal", "共"+ todayTotal+ "笔");
|
| | | data.put("totalValid", totalValid); // 有效数量
|
| | | data.put("totalProces", totalProces); // 维权数量
|
| | |
| | | @Param("orderState") Integer orderState, @Param("orderNo") String orderNo, |
| | | @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("day") Integer day); |
| | | |
| | | |
| | | /** |
| | | * 统计已到账金额 以及订单数量 |
| | | * |
| | | * @param start |
| | | * @param count |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | |
| | | Map<String, Object> countMoneyGroupOrderNoByUid(@Param("uid") Long uid, @Param("type") Integer type, @Param("orderNo") String orderNo, |
| | | @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("day") Integer day); |
| | | /** |
| | | * 根据订单号、订单类型查询商品 |
| | | * |
| | |
| | |
|
| | | import java.io.PrintWriter;
|
| | |
|
| | | import javax.servlet.http.Cookie;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | | import javax.servlet.http.HttpServletResponse;
|
| | |
|
| | |
| | | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
|
| | | throws Exception {
|
| | |
|
| | | String id = request.getSession().getId();
|
| | | System.out.println("------start:" + id);
|
| | | |
| | | |
| | | String origin = request.getHeader("Origin");
|
| | | response.setHeader("Access-Control-Allow-Origin", origin);
|
| | | response.setHeader("Access-Control-Allow-Methods", "*");
|
| | | response.setHeader("Access-Control-Allow-Credentials","true");
|
| | | response.setHeader("Access-Control-Allow-Methods", "*"); // 任何方法
|
| | | response.setHeader("Access-Control-Allow-Credentials","true");// 允许传递cookie
|
| | | response.setHeader("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
|
| | |
|
| | | String method = request.getMethod();
|
| | | System.out.println("-----method--------" + method);
|
| | | if ("OPTIONS".equalsIgnoreCase(method)) {
|
| | | |
| | | System.out.println("------OPTIONS:");
|
| | | JSONObject object = new JSONObject();
|
| | | object.put("code", 200);
|
| | | object.put("msg", "OPTIONS成功");
|
| | | |
| | | object.put("msg", "OPTIONS连接成功");
|
| | | PrintWriter writer = response.getWriter();
|
| | | writer.print(object);
|
| | | return false;
|
| | |
| | | DESC |
| | | LIMIT ${start},${count} |
| | | </select> |
| | | |
| | | <select id="countMoneyGroupOrderNoByUid" resultType="java.util.Map"> |
| | | SELECT COALESCE(SUM(A.moneys),0)AS totalMoney,COUNT(*) AS totalRow FROM |
| | | (SELECT COALESCE(SUM(th.`hb_money`),0)AS moneys FROM yeshi_ec_common_order tc |
| | | LEFT JOIN |
| | | yeshi_ec_hongbao_order tr ON tr.`ho_order_id` = tc.`co_id` |
| | | LEFT JOIN |
| | | yeshi_ec_hongbao_v2 th ON (tr.`ho_hongbao_id` = th.`hb_id` OR |
| | | th.`hb_pid` = tr.`ho_hongbao_id` ) |
| | | WHERE th.`hb_uid` = #{uid} AND th.hb_state = 3 AND (tc.co_state = 1 or tc.co_state = 2) |
| | | <if test="type != null and type == 1"> <!-- 自购订单 --> |
| | | AND (th.hb_type =1 or th.hb_type =2) |
| | | </if> |
| | | <if test="type != null and type == 2"> <!-- 分享订单 --> |
| | | AND (th.`hb_type` = 20 OR th.`hb_type` = 21 OR th.`hb_type` = 22) |
| | | </if> |
| | | <if test="type != null and type == 3"> <!-- 邀请订单 --> |
| | | AND (th.`hb_type` = 5 OR th.`hb_type` = 6 OR th.`hb_type` = 7) |
| | | </if> |
| | | <if test="orderNo != null"> |
| | | AND tc.co_order_no = #{orderNo} |
| | | </if> |
| | | <if test="startTime != null"> |
| | | AND <![CDATA[tc.co_create_time >= #{startTime}]]> |
| | | </if> |
| | | <if test="endTime != null"> |
| | | AND <![CDATA[tc.co_create_time <= #{endTime}]]> |
| | | </if> |
| | | <if test="day != null and day == 1"> <!-- 今天 --> |
| | | AND TO_DAYS(tc.`co_create_time`) = TO_DAYS(NOW()) |
| | | </if> |
| | | <if test="day != null and day == 2"> <!-- 昨天 --> |
| | | AND TO_DAYS(NOW()) - TO_DAYS(tc.`co_create_time`) = 1 |
| | | </if> |
| | | <if test="day != null and day == 3"> <!-- 本月 --> |
| | | AND DATE_FORMAT(tc.`co_create_time`,'%Y%m') = |
| | | DATE_FORMAT(CURDATE(),'%Y%m') |
| | | </if> |
| | | <if test="day != null and day == 4"> <!-- 上月 --> |
| | | AND PERIOD_DIFF( DATE_FORMAT(NOW(), '%Y%m'), |
| | | DATE_FORMAT(tc.`co_create_time`, '%Y%m')) = 1 |
| | | </if> |
| | | GROUP BY tc.`co_order_no`,tc.co_source_type)A |
| | | </select> |
| | | |
| | | <select id="countGroupOrderNoByUid" resultType="java.lang.Long"> |
| | | SELECT IFNULL(COUNT(DISTINCT tc.`co_order_no`,tc.`co_source_type`),0) |
| | |
| | | import java.math.BigDecimal;
|
| | | import java.text.SimpleDateFormat;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Calendar;
|
| | | import java.util.Date;
|
| | | import java.util.HashMap;
|
| | | import java.util.List;
|
| | |
| | | orderStateContent = "已维权";
|
| | |
|
| | | /* 订单维权 判断是否全部维权 */
|
| | | List<TaoBaoWeiQuanOrder> listWQ = taoBaoWeiQuanOrderMapper
|
| | | .selectListByOrderIdAndState(order.getOrderNo(), "维权成功");
|
| | | List<TaoBaoWeiQuanOrder> listWQ = |
| | | taoBaoWeiQuanOrderMapper.selectListByOrderIdAndState(order.getOrderNo(), "维权成功");
|
| | |
|
| | | boolean isPart = false;// 默认失效
|
| | |
|
| | |
| | | return commonOrderMapper.selectByPrimaryKey(updateCommonOrder.getId());
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public Map<String, Object> countMoneyGroupOrderNoByUid(Long uid, Integer type, String orderNo, String startTime,
|
| | | String endTime, Integer day) {
|
| | | return commonOrderMapper.countMoneyGroupOrderNoByUid(uid, type, orderNo, startTime, endTime, day);
|
| | | }
|
| | | }
|
| | |
| | | import java.util.Map;
|
| | |
|
| | | import com.yeshi.fanli.entity.order.CommonOrder;
|
| | | import com.yeshi.fanli.entity.order.HongBaoOrder;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoOrder;
|
| | | import com.yeshi.fanli.exception.order.CommonOrderException;
|
| | | import com.yeshi.fanli.vo.order.CommonOrderVO;
|
| | |
| | | */
|
| | | public CommonOrder addTaoBaoOrder(TaoBaoOrder taoBaoOrder, Long uid) throws CommonOrderException;
|
| | |
|
| | | |
| | | |
| | | /**
|
| | | * 根据提条件统计已到账金额
|
| | | * @param uid
|
| | | * @param type
|
| | | * @param orderNo
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @param day
|
| | | * @return
|
| | | */
|
| | | public Map<String, Object> countMoneyGroupOrderNoByUid(Long uid, Integer type, String orderNo, String startTime, |
| | | String endTime, Integer day);
|
| | |
|
| | | }
|