| | |
| | | import javax.servlet.http.HttpServletRequest;
|
| | | import javax.servlet.http.HttpSession;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | |
|
| | | import org.yeshi.utils.JsonUtil;
|
| | | import com.alipay.api.AlipayApiException;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.user.BindingAccount;
|
| | |
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.account.UserUtil;
|
| | | import com.yeshi.fanli.util.wx.WXLoginUtil;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | /**
|
| | | * 账户系统
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | if (loginType == 3)// 验证短信验证码
|
| | | if (loginType == 3 && !Constant.IS_TEST)// 验证短信验证码
|
| | | {
|
| | | String oldVcode = redisManager.getSMSVCode(phone, SMSHistory.TYPE_LOGIN);
|
| | | if (StringUtil.isNullOrEmpty(oldVcode) || !oldVcode.equalsIgnoreCase(vcode)) {
|
| | |
| | |
|
| | | try {
|
| | | long count = 0;
|
| | | List<CommonOrderVO> list = commonOrderService.getOrderByUid(page, uid, state, type, orderState, orderNo,
|
| | | startTime, endTime, dateType);
|
| | | 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);
|
| | | count = commonOrderService.countGroupOrderNoByUid(uid, state, type, orderState, orderNo, |
| | | startTime, endTime, dateType);
|
| | | }
|
| | |
|
| | | int totalValid = 0;
|
| | |
| | | BigDecimal todayMoney = null;
|
| | | // 需要统计信息
|
| | | if (needCount && page == 1) {
|
| | | Map<String, BigDecimal> countOrder = commonOrderService.countByUidAndOrderState(uid, type, startTime, endTime);
|
| | | Map<String, BigDecimal> countOrder = commonOrderService.countByUidAndOrderState(uid, type, |
| | | startTime, endTime, dateType);
|
| | |
|
| | | if (countOrder.get("totalValid") != null) {
|
| | | totalValid = countOrder.get("totalValid").intValue();
|
| | |
| | |
|
| | | data.put("helpUrl", helpUrl);
|
| | |
|
| | | data.put("todayTotal", todayTotal);
|
| | | data.put("todayMoney", todayMoney);
|
| | | if (type != null && type == 1) {
|
| | | data.put("todayMoney", "今日预估返利总额 ¥" + todayMoney);
|
| | | } else {
|
| | | data.put("todayMoney", "预估奖金总额 ¥" + todayMoney);
|
| | | }
|
| | | data.put("todayTotal", "共"+ todayTotal+ "笔");
|
| | | data.put("totalValid", totalValid); // 有效数量
|
| | | data.put("totalProces", totalProces); // 维权数量
|
| | | data.put("totalInvite", totalInvite); // 失效数量
|
| | |
| | | */ |
| | | Map<String, BigDecimal> countByUidAndOrderState(@Param("uid") Long uid, @Param("type") Integer type, |
| | | |
| | | @Param("startTime") String startTime, @Param("endTime") String endTime); |
| | | @Param("startTime") String startTime, @Param("endTime") String endTime,@Param("day") Integer day); |
| | | |
| | | /** |
| | | * 奖金订单数量 |
| | |
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | // 淘宝
|
| | | public final static int TYPE_TAOBAO = 1;
|
| | | // 京东
|
| | | public final static int TYPE_JINGDONG = 2;
|
| | | public final static String TYPE_TAOBAO = "TB";
|
| | | // 天猫
|
| | | public final static String TYPE_TMALL = "TM";
|
| | | |
| | |
|
| | | @Column(name = "cog_id")
|
| | | private Long id;
|
| | |
| | | <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> |
| | | |
| | | UNION |
| | | |
| | |
| | | <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> |
| | | UNION |
| | | |
| | | SELECT 0 AS valid,0 AS proces,IFNULL(COUNT(DISTINCT |
| | |
| | | <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> |
| | | )A |
| | | </select> |
| | | |
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public Map<String, BigDecimal> countByUidAndOrderState(Long uid, Integer type, String startTime,String endTime) {
|
| | | return commonOrderMapper.countByUidAndOrderState(uid, type, startTime, endTime);
|
| | | public Map<String, BigDecimal> countByUidAndOrderState(Long uid, Integer type, String startTime,
|
| | | String endTime, Integer day) {
|
| | | return commonOrderMapper.countByUidAndOrderState(uid, type, startTime, endTime, day);
|
| | | }
|
| | |
|
| | | public void listDataFactory (List<CommonOrderVO> listOrder, List<CommonOrderVO> listGoods ) {
|
| | |
| | | commonGoodsVO.setActualPay(commonOrder.getTotalSettlement());
|
| | |
|
| | | listOrderGoods.add(commonGoodsVO);
|
| | | |
| | | Integer orderType = commonOrder.getOrderType();
|
| | | if (orderType == null) {
|
| | | String shopType = commonGoodsVO.getShopType();
|
| | | if (CommonOrderGoodsVO.TYPE_TAOBAO.equalsIgnoreCase(shopType)) {
|
| | | commonOrder.setOrderType(1);
|
| | | } else if (CommonOrderGoodsVO.TYPE_TMALL.equalsIgnoreCase(shopType)) {
|
| | | commonOrder.setOrderType(2);
|
| | | } |
| | | }
|
| | |
|
| | | break;
|
| | | }
|
| | |
| | | String hongBaoState_Str = "";
|
| | | String hongbaoInfoFontColor = "#E5005C";
|
| | |
|
| | | |
| | | /* 红包状态 转换 */
|
| | | String stateContent = "";
|
| | | Integer orderHongBaoState = null;
|
| | |
| | | orderHongBaoState = 1;
|
| | | stateContent = "未到账";
|
| | | hongBaoState_Str = "预估";
|
| | | hongbaoInfoFontColor = "#888888";
|
| | |
|
| | | Date preAccountTime = order.getPreAccountTime();
|
| | | if (preAccountTime != null) {
|
| | |
| | | orderHongBaoState = 4;
|
| | | stateContent = "已失效";
|
| | | hongBaoDate = " ";
|
| | | hongbaoInfoFontColor = "#888888";
|
| | | }
|
| | | order.setHongBaoState(orderHongBaoState);
|
| | | order.setAccountState(stateContent);
|
| | |
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | public Map<String, BigDecimal> countByUidAndOrderState(Long uid, Integer type, String startTime, String endTime);
|
| | | public Map<String, BigDecimal> countByUidAndOrderState(Long uid, Integer type, String startTime,
|
| | | String endTime, Integer day);
|
| | |
|
| | | }
|
| | |
| | | // 订单总预估奖金
|
| | | private BigDecimal hongBao;
|
| | |
|
| | | |
| | | // 订单状态 1 淘宝 2 天猫
|
| | | @Expose
|
| | | private Integer orderType;
|
| | | // 红包状态
|
| | | @Expose
|
| | | private Integer hongBaoState;
|
| | |
| | | this.accountState = accountState;
|
| | | }
|
| | |
|
| | | public Integer getOrderType() {
|
| | | return orderType;
|
| | | }
|
| | |
|
| | | public void setOrderType(Integer orderType) {
|
| | | this.orderType = orderType;
|
| | | }
|
| | |
|
| | |
|
| | | }
|