Merge remote-tracking branch 'origin/div' into div
New file |
| | |
| | | package com.yeshi.fanli.controller.admin.order;
|
| | |
|
| | | import java.io.PrintWriter;
|
| | | import java.lang.reflect.Type;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | | import com.google.gson.JsonElement;
|
| | | import com.google.gson.JsonPrimitive;
|
| | | import com.google.gson.JsonSerializationContext;
|
| | | import com.google.gson.JsonSerializer;
|
| | | import com.yeshi.fanli.entity.elme.ElmeOrder;
|
| | | import com.yeshi.fanli.service.inter.elme.ElmeOrderService;
|
| | | import com.yeshi.fanli.tag.PageEntity;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | @Controller
|
| | | @RequestMapping("admin/new/api/v1/elmeOrder")
|
| | | public class ElmeOrderController {
|
| | |
|
| | | @Resource
|
| | | private ElmeOrderService elmeOrderService;
|
| | |
|
| | |
|
| | | /**
|
| | | * 订单列表查询
|
| | | * @param callback
|
| | | * @param pageIndex
|
| | | * @param key
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "query")
|
| | | public void query(String callback, Integer pageIndex, String key, PrintWriter out) {
|
| | | try {
|
| | | if (pageIndex == null || pageIndex < 0) {
|
| | | pageIndex = 1;
|
| | | }
|
| | |
|
| | | int pageSize = Constant.PAGE_SIZE;
|
| | | List<ElmeOrder> list = elmeOrderService.query((pageIndex-1)* pageSize, pageSize, key);
|
| | | if (list == null || list.size() == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无数据"));
|
| | | return;
|
| | | }
|
| | | |
| | | long count = elmeOrderService.count(key);
|
| | | int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
|
| | | PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
|
| | |
|
| | | Gson gson = new GsonBuilder().registerTypeAdapter(Date.class, new JsonSerializer<Date>() {
|
| | | @Override
|
| | | public JsonElement serialize(Date value, Type theType, JsonSerializationContext context) {
|
| | | if (value == null) {
|
| | | return new JsonPrimitive("");
|
| | | } else {
|
| | | return new JsonPrimitive(TimeUtil.getGernalTime(value.getTime(), "yyyy-MM-dd HH:mm:ss"));
|
| | | }
|
| | | }
|
| | | }).create();
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("pe", pe);
|
| | | data.put("result_list", gson.toJson(list));
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("查询失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | */
|
| | | @RequestMapping(value = "getList", method = RequestMethod.POST)
|
| | | public void getList(AcceptData acceptData, Integer page, Long cid, Long uid, PrintWriter out) {
|
| | | if (VersionUtil.greaterThan_2_0_2(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | getListV3(acceptData, page, cid, uid, out);
|
| | | return;
|
| | | if ("ios".equalsIgnoreCase(acceptData.getPlatform())) {
|
| | | if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | getListV3(acceptData, page, cid, uid, out);
|
| | | return;
|
| | | }
|
| | | } else {
|
| | | if (VersionUtil.greaterThan_2_0_2(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | getListV3(acceptData, page, cid, uid, out);
|
| | | return;
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | if (page == null || page < 1) {
|
| | | out.print(JsonUtil.loadFalseResult("页码不正确"));
|
| | |
| | | */
|
| | | @RequestMapping(value = "getShopInfoV2", method = RequestMethod.POST)
|
| | | public void getShopInfoV2(AcceptData acceptData, Integer page, Long id, Long uid, PrintWriter out) {
|
| | | if (VersionUtil.greaterThan_2_0_2(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | getShopInfoV3(acceptData, page, id, uid, out);
|
| | | return;
|
| | | |
| | | if ("ios".equalsIgnoreCase(acceptData.getPlatform())) {
|
| | | if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | getShopInfoV3(acceptData, page, id, uid, out);
|
| | | return;
|
| | | }
|
| | | } else {
|
| | | if (VersionUtil.greaterThan_2_0_2(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | getShopInfoV3(acceptData, page, id, uid, out);
|
| | | return;
|
| | | }
|
| | | }
|
| | |
|
| | | if (id == null) {
|
| | |
| | | */
|
| | | @RequestMapping(value = "getHistoryV2", method = RequestMethod.POST)
|
| | | public void getHistoryV2(AcceptData acceptData, Integer page, Long uid, Integer type, PrintWriter out) {
|
| | | if (VersionUtil.greaterThan_2_0_2(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | getHistoryV3(acceptData, page, uid, type, out);
|
| | | return;
|
| | | if ("ios".equalsIgnoreCase(acceptData.getPlatform())) {
|
| | | if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | getHistoryV3(acceptData, page, uid, type, out);
|
| | | return;
|
| | | }
|
| | | } else {
|
| | | if (VersionUtil.greaterThan_2_0_2(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | getHistoryV3(acceptData, page, uid, type, out);
|
| | | return;
|
| | | }
|
| | | }
|
| | |
|
| | | if (type == null) {
|
| | |
| | | package com.yeshi.fanli.controller.client.v2;
|
| | |
|
| | | import java.io.PrintWriter;
|
| | | import java.math.BigDecimal;
|
| | | import java.util.ArrayList;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | |
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.user.SMSHistory;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserVIPInfo;
|
| | | import com.yeshi.fanli.entity.push.DeviceActive;
|
| | | import com.yeshi.fanli.entity.shop.BanLiShopOrder;
|
| | | import com.yeshi.fanli.entity.system.BusinessSystem;
|
| | | import com.yeshi.fanli.exception.user.UserAccountException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.config.BusinessSystemService;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.count.HongBaoV2CountService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.HomeNavbarUserService;
|
| | | import com.yeshi.fanli.service.inter.money.UserMoneyService;
|
| | | import com.yeshi.fanli.service.inter.order.LostOrderService;
|
| | |
| | | import com.yeshi.fanli.service.inter.push.DeviceTokenHWService;
|
| | | import com.yeshi.fanli.service.inter.push.DeviceTokenOPPOService;
|
| | | import com.yeshi.fanli.service.inter.push.DeviceTokenVIVOService;
|
| | | import com.yeshi.fanli.service.inter.shop.BanLiShopOrderService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
|
| | | import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinOriginService;
|
| | | import com.yeshi.fanli.service.inter.user.BindRemindService;
|
| | |
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.UserShareGoodsRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.UserSystemCouponService;
|
| | | import com.yeshi.fanli.service.inter.user.integral.IntegralDetailService;
|
| | | import com.yeshi.fanli.service.inter.user.invite.ThreeSaleSerivce;
|
| | | import com.yeshi.fanli.service.inter.user.vip.UserVIPInfoService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.ThreadUtil;
|
| | |
| | |
|
| | | @Resource
|
| | | private BindRemindService bindRemindService;
|
| | | |
| | | @Resource
|
| | | private UserVIPInfoService userVIPInfoService;
|
| | | |
| | | @Resource
|
| | | private HongBaoV2CountService hongBaoV2CountService;
|
| | | |
| | | @Resource
|
| | | private IntegralDetailService integralDetailService;
|
| | | |
| | | @Resource
|
| | | private BanLiShopOrderService banLiShopOrderService;
|
| | |
|
| | | @Resource
|
| | | private ConfigService configService;
|
| | | |
| | | /**
|
| | | * 新版登录 V1.5.3
|
| | | *
|
| | |
| | | out.print(JsonUtil.loadTrueResult("记录成功"));
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 获取vip信息
|
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getVIPInfo")
|
| | | public void getVIPInfo(AcceptData acceptData, Long uid, PrintWriter out) {
|
| | | if (uid == null || uid <= 0) {
|
| | | out.print(JsonUtil.loadFalseResult("用户id为空"));
|
| | | return;
|
| | | }
|
| | | |
| | | UserInfo userInfo = userInfoService.selectByPKey(uid);
|
| | | if (userInfo == null) {
|
| | | out.print(JsonUtil.loadFalseResult("该用户不存在"));
|
| | | return;
|
| | | }
|
| | | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("id", uid);
|
| | | data.put("nickName", userInfo.getNickName());
|
| | | data.put("portrait", userInfo.getPortrait());
|
| | | |
| | | UserVIPInfo userVIPInfo = userVIPInfoService.selectByUid(uid);
|
| | | boolean vip = false;
|
| | | if (userVIPInfo != null && userVIPInfo.getState() != null |
| | | && userVIPInfo.getState() == UserVIPInfo.STATE_SUCCESS) {
|
| | | vip = true;
|
| | | data.put("applyTime", userVIPInfo.getSuccessTime());
|
| | | } |
| | | data.put("vip", vip);
|
| | | |
| | | // 省钱 -自购产生返利 |
| | | BigDecimal rewardPurchase = hongBaoV2CountService.getRewardMoneyBySelf(uid);
|
| | | data.put("rurchaseReward", rewardPurchase.setScale(2));
|
| | | |
| | | BigDecimal conserveMoney = rewardPurchase;
|
| | | if (!vip) { // 少省钱: 自购产生返利 * 5/12
|
| | | BigDecimal rate1 = new BigDecimal(5);
|
| | | BigDecimal rate2 = new BigDecimal(12);
|
| | | conserveMoney = MoneyBigDecimalUtil.mul2(rewardPurchase, MoneyBigDecimalUtil.div(rate1, rate2));
|
| | | }
|
| | | data.put("conserveMoney", conserveMoney.setScale(2));
|
| | | |
| | | // 分享赚
|
| | | BigDecimal rewardShare = hongBaoV2CountService.getRewardMoneyByShare(uid);
|
| | | // 邀请赚
|
| | | BigDecimal rewardInvite = hongBaoV2CountService.getRewardMoneyByInvite(uid); |
| | | |
| | | BigDecimal earnMoney = rewardShare;
|
| | | if (vip) { // 赚钱=分享+邀请 |
| | | earnMoney = MoneyBigDecimalUtil.add(rewardShare, rewardInvite );
|
| | | } else { // 少赚钱: 分享赚* 5/12
|
| | | BigDecimal rate1 = new BigDecimal(5);
|
| | | BigDecimal rate2 = new BigDecimal(12);
|
| | | earnMoney = MoneyBigDecimalUtil.mul2(rewardShare, MoneyBigDecimalUtil.div(rate1, rate2));
|
| | | }
|
| | | data.put("earnMoney", earnMoney.setScale(2));
|
| | | |
| | | // 注:1.有效一级队员定义:2019年1月1日起,自购或分享1笔且付款总金额不小于1元(退款为失效);
|
| | | long teamNum = hongBaoV2CountService.countValidOrderTeamUserByUid(uid, "2019-01-01", new BigDecimal(1));
|
| | | data.put("teamNum", teamNum);
|
| | | |
| | | // 累计金币
|
| | | BigDecimal goldCoin = integralDetailService.getCumulativeMoney(uid);
|
| | | data.put("goldCoin", goldCoin.setScale(0));
|
| | | // 帮助链接
|
| | | data.put("helpLink", configService.get("help_link_vip_info"));
|
| | | |
| | | // 使用红包次数
|
| | | List<Integer> list = new ArrayList<Integer>();
|
| | | list.add(BanLiShopOrder.STATE_SUCCESS);
|
| | | data.put("shopNum", banLiShopOrderService.countByUidAndState(uid, list));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | | }
|
| | |
| | | * @return |
| | | */ |
| | | BigDecimal getRewardMoneyByUid(@Param("uid") Long uid, @Param("list") List<Integer> list); |
| | | |
| | | /** |
| | | * 注:1.有效一级队员定义:2019年1月1日起,自购或分享1笔且付款总金额不小于 payment 元(退款为失效 |
| | | * @param uid |
| | | * @param list 类型 |
| | | * @return |
| | | */ |
| | | long countValidOrderTeamUserByUid(@Param("uid") Long uid, @Param("date") String date, |
| | | @Param("payment") BigDecimal payment); |
| | | |
| | | } |
| | |
| | | package com.yeshi.fanli.dao.mybatis.elme;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import org.apache.ibatis.annotations.Param;
|
| | |
|
| | | import com.yeshi.fanli.dao.BaseMapper;
|
| | | import com.yeshi.fanli.entity.elme.ElmeOrder;
|
| | |
|
| | |
| | | */
|
| | | ElmeOrder selectByOrderId(String orderId);
|
| | |
|
| | | /**
|
| | | * 订单查询列表
|
| | | * @param start
|
| | | * @param count
|
| | | * @param key
|
| | | * @return
|
| | | */
|
| | | List<ElmeOrder> query(@Param("start") long start, @Param("count")int count, @Param("key")String key);
|
| | | |
| | | long count(@Param("key")String key);
|
| | | |
| | | } |
| | |
| | | package com.yeshi.fanli.dao.mybatis.integral;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | |
| | | */
|
| | | List<IntegralMonthVO> selectMonthMoneyByUid(@Param("uid") Long uid, @Param("dateFormat") List<String> dateFormat);
|
| | |
|
| | | |
| | | /**
|
| | | * 统计历史到账
|
| | | * @param uniqueKey
|
| | | * @return
|
| | | */
|
| | | BigDecimal getCumulativeMoney(@Param("uid") Long uid);
|
| | | |
| | | } |
| | |
| | | @Column(name = "eo_update_time")
|
| | | private Date updateTime;
|
| | |
|
| | | |
| | | private Long uid;
|
| | | private BigDecimal hongbao;
|
| | | private Integer hbState;
|
| | | |
| | | public Long getId() {
|
| | | return id;
|
| | | }
|
| | |
| | | this.updateTime = updateTime;
|
| | | }
|
| | |
|
| | | public Long getUid() {
|
| | | return uid;
|
| | | }
|
| | |
|
| | | public void setUid(Long uid) {
|
| | | this.uid = uid;
|
| | | }
|
| | |
|
| | | public BigDecimal getHongbao() {
|
| | | return hongbao;
|
| | | }
|
| | |
|
| | | public void setHongbao(BigDecimal hongbao) {
|
| | | this.hongbao = hongbao;
|
| | | }
|
| | |
|
| | | public Integer getHbState() {
|
| | | return hbState;
|
| | | }
|
| | |
|
| | | public void setHbState(Integer hbState) {
|
| | | this.hbState = hbState;
|
| | | }
|
| | | }
|
| | |
| | | <result column="eo_create_time" property="createTime" jdbcType="TIMESTAMP" />
|
| | | <result column="eo_update_time" property="updateTime" jdbcType="TIMESTAMP" />
|
| | | </resultMap>
|
| | | |
| | | <resultMap id="ResultMap" type="com.yeshi.fanli.entity.elme.ElmeOrder">
|
| | | <id column="eo_id" property="id" jdbcType="BIGINT" />
|
| | | <result column="eo_channel_id" property="channelId" jdbcType="VARCHAR" />
|
| | | <result column="eo_channel_name" property="channelName"
|
| | | jdbcType="VARCHAR" />
|
| | | <result column="eo_track_pid" property="trackPid" jdbcType="VARCHAR" />
|
| | | <result column="eo_rid" property="rid" jdbcType="VARCHAR" />
|
| | | <result column="eo_order_date" property="orderDate" jdbcType="TIMESTAMP" />
|
| | | <result column="eo_order_id" property="orderId" jdbcType="VARCHAR" />
|
| | | <result column="eo_pay_money" property="payMoney" jdbcType="DECIMAL" />
|
| | | <result column="eo_city" property="city" jdbcType="VARCHAR" />
|
| | | <result column="eo_coupon_money" property="couponMoney"
|
| | | jdbcType="DECIMAL" />
|
| | | <result column="eo_newer_first_order" property="newerFirstOrder"
|
| | | jdbcType="INTEGER" />
|
| | | <result column="eo_newer_repay_order" property="newerRepayOrder"
|
| | | jdbcType="INTEGER" />
|
| | | <result column="eo_taoke_hongbao" property="taokeHongBao"
|
| | | jdbcType="INTEGER" />
|
| | | <result column="eo_shop_click" property="shopClick" jdbcType="INTEGER" />
|
| | | <result column="eo_recieve_coupon_7day_first_order" property="recieveCoupon7DayFirstOrder"
|
| | | jdbcType="INTEGER" />
|
| | | <result column="eo_settle" property="isSettle" jdbcType="BOOLEAN" />
|
| | | <result column="eo_create_time" property="createTime" jdbcType="TIMESTAMP" />
|
| | | <result column="eo_update_time" property="updateTime" jdbcType="TIMESTAMP" />
|
| | | |
| | | <result column="hb_uid" property="uid" jdbcType="BIGINT" />
|
| | | <result column="hb_money" property="hongbao" jdbcType="DECIMAL" />
|
| | | <result column="hb_state" property="hbState" jdbcType="INTEGER" />
|
| | | </resultMap>
|
| | | |
| | | <sql id="Base_Column_List">eo_id,eo_channel_id,eo_channel_name,eo_track_pid,eo_rid,eo_order_date,eo_order_id,eo_pay_money,eo_city,eo_coupon_money,eo_newer_first_order,eo_newer_repay_order,eo_taoke_hongbao,eo_shop_click,eo_recieve_coupon_7day_first_order,eo_settle,eo_create_time,eo_update_time
|
| | | </sql>
|
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap"
|
| | |
| | | from yeshi_ec_elme_order where eo_order_id = #{0}
|
| | | </select>
|
| | |
|
| | | <select id="query" resultMap="ResultMap">
|
| | | SELECT d.*,v2.`hb_state`,v2.`hb_uid`,v2.`hb_money` FROM `yeshi_ec_elme_order` d
|
| | | LEFT JOIN `yeshi_ec_elme_order_hongbao` h ON d.`eo_id` = h.`eoh_order_id`
|
| | | LEFT JOIN `yeshi_ec_hongbao_v2` v2 ON v2.`hb_id` = h.`eoh_hongbao_id`
|
| | | WHERE d.`eo_order_id` LIKE '${key}%' OR v2.`hb_uid` LIKE '${key}%'
|
| | | ORDER BY d.`eo_create_time` DESC
|
| | | LIMIT #{start},#{count}
|
| | | </select>
|
| | | |
| | | <select id="count" resultType="java.lang.Long">
|
| | | SELECT IFNULL(COUNT(d.`eo_id`),0) FROM `yeshi_ec_elme_order` d
|
| | | LEFT JOIN `yeshi_ec_elme_order_hongbao` h ON d.`eo_id` = h.`eoh_order_id`
|
| | | LEFT JOIN `yeshi_ec_hongbao_v2` v2 ON v2.`hb_id` = h.`eoh_hongbao_id`
|
| | | WHERE d.`eo_order_id` LIKE '${key}%' OR v2.`hb_uid` LIKE '${key}%'
|
| | | </select>
|
| | | |
| | | |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
|
| | | yeshi_ec_elme_order where eo_id = #{id,jdbcType=BIGINT}</delete>
|
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.elme.ElmeOrder"
|
| | |
| | | |
| | | <select id="getRewardMoneyByUid" resultType="BigDecimal"> |
| | | SELECT IFNULL(SUM(v2.`hb_money`),0) FROM yeshi_ec_hongbao_v2 v2 |
| | | WHERE v2.`hb_uid` = #{uid} |
| | | WHERE v2.`hb_uid` = #{uid} AND v2.`hb_state` = 3 |
| | | <if test="list != null and list.size() > 0"> |
| | | AND |
| | | <foreach collection="list" item="item" open="(" separator="OR" close=")"> |
| | |
| | | </foreach> |
| | | </if> |
| | | </select> |
| | | |
| | | |
| | | <select id="countValidOrderTeamUserByUid" resultType="Long"> |
| | | SELECT IFNULL(COUNT(*),0) FROM (SELECT DISTINCT co.`co_uid` FROM `yeshi_ec_common_order` co |
| | | LEFT JOIN `yeshi_ec_hongbao_order` ho ON co.`co_id` = ho.`ho_order_id` |
| | | LEFT JOIN yeshi_ec_hongbao_v2 v2 ON v2.`hb_pid` = ho.`ho_hongbao_id` |
| | | LEFT JOIN yeshi_ec_hongbao_v2 t2 ON t2.`hb_id` = v2.`hb_pid` |
| | | WHERE v2.`hb_uid` = #{uid} AND co.`co_payment` <![CDATA[>=]]> #{payment} AND t2.`hb_state` = 3 |
| | | AND v2.`hb_create_time` > #{date} |
| | | AND (t2.`hb_type` = 1 OR t2.`hb_type` = 20))A |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | </foreach>
|
| | | </select>
|
| | |
|
| | | <select id="getCumulativeMoney" resultType="BigDecimal">
|
| | | SELECT IFNULL(SUM(d.`td_money`),0) FROM `yeshi_ec_integral_detail` d
|
| | | WHERE d.`td_uid` = #{uid} AND d.`td_money` > 0;
|
| | | </select>
|
| | | |
| | | </mapper>
|
| | |
| | | @Override
|
| | | public BigDecimal getRewardMoneyBySelf(Long uid) {
|
| | | List<Integer> list = new ArrayList<Integer>();
|
| | | list.add(HongBaoV2.STATE_YILINGQU);
|
| | | list.add(HongBaoV2.TYPE_ZIGOU);
|
| | | return hongBaoV2CountMapper.getRewardMoneyByUid(uid, list);
|
| | | }
|
| | | |
| | | @Override
|
| | | public BigDecimal getRewardMoneyByShare(Long uid) {
|
| | | List<Integer> list = new ArrayList<Integer>();
|
| | | list.add(HongBaoV2.TYPE_SHARE_GOODS);
|
| | | return hongBaoV2CountMapper.getRewardMoneyByUid(uid, list);
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public BigDecimal getRewardMoneyByInvite(Long uid) {
|
| | | List<Integer> list = new ArrayList<Integer>();
|
| | | list.add(HongBaoV2.TYPE_YIJI);
|
| | | list.add(HongBaoV2.TYPE_ERJI);
|
| | | list.add(HongBaoV2.TYPE_SHARE_YIJI);
|
| | | list.add(HongBaoV2.TYPE_SHARE_ERJI);
|
| | | return hongBaoV2CountMapper.getRewardMoneyByUid(uid, list);
|
| | | }
|
| | | |
| | | @Override
|
| | | public long countValidOrderTeamUserByUid(Long uid, String date, BigDecimal payment) {
|
| | | return hongBaoV2CountMapper.countValidOrderTeamUserByUid(uid, date, payment);
|
| | | }
|
| | | }
|
| | |
| | | package com.yeshi.fanli.service.impl.elme;
|
| | |
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | |
| | | public ElmeOrder selectByPrimaryKey(Long id) {
|
| | | return elmeOrderMapper.selectByPrimaryKey(id);
|
| | | }
|
| | | |
| | | @Override
|
| | | public List<ElmeOrder> query(long start, int count, String key) {
|
| | | return elmeOrderMapper.query(start, count, key);
|
| | | }
|
| | | |
| | | @Override
|
| | | public long count(String key) {
|
| | | return elmeOrderMapper.count(key);
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | return monthCount + detailCount;
|
| | | }
|
| | | |
| | | @Override
|
| | | public BigDecimal getCumulativeMoney(Long uid) {
|
| | | return integralDetailMapper.getCumulativeMoney(uid);
|
| | | }
|
| | | |
| | | }
|
| | |
|
| | |
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public BigDecimal getRewardMoneyBySelf(Long uid); |
| | | public BigDecimal getRewardMoneyBySelf(Long uid);
|
| | |
|
| | | /**
|
| | | * 分享奖励到账金额
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public BigDecimal getRewardMoneyByShare(Long uid);
|
| | |
|
| | | /**
|
| | | * 下级产生奖励到账金额
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public BigDecimal getRewardMoneyByInvite(Long uid);
|
| | |
|
| | | /**
|
| | | * 有效一级队员定义:2019年1月1日起(date),自购或分享1笔且付款总金额不小于 payment 元(退款为失效
|
| | | * @param uid
|
| | | * @param date
|
| | | * @param payment
|
| | | * @return
|
| | | */
|
| | | public long countValidOrderTeamUserByUid(Long uid, String date, BigDecimal payment); |
| | |
|
| | | }
|
| | |
| | | package com.yeshi.fanli.service.inter.elme;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import com.yeshi.fanli.entity.elme.ElmeOrder;
|
| | | import com.yeshi.fanli.exception.elme.ElmeOrderException;
|
| | |
|
| | |
| | |
|
| | | public ElmeOrder selectByPrimaryKey(Long id);
|
| | |
|
| | | /**
|
| | | * 订单列表查询
|
| | | * @param start
|
| | | * @param count
|
| | | * @param key
|
| | | * @return
|
| | | */
|
| | | public List<ElmeOrder> query(long start, int count, String key);
|
| | |
|
| | | public long count(String key);
|
| | |
|
| | | }
|
| | |
| | | package com.yeshi.fanli.service.inter.user.integral;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | |
| | | */
|
| | | public IntegralDetail getDetailByUniqueKey(String uniqueKey);
|
| | |
|
| | | /**
|
| | | * 查询历史到账金币
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public BigDecimal getCumulativeMoney(Long uid);
|
| | |
|
| | | }
|