Merge branch 'dev-moneydetail'
New file |
| | |
| | | package com.yeshi.fanli.controller.client;
|
| | |
|
| | | import java.io.IOException;
|
| | | 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.google.gson.TypeAdapter;
|
| | | import com.google.gson.stream.JsonReader;
|
| | | import com.google.gson.stream.JsonWriter;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.money.UserMoneyDetail.UserMoneyDetailTypeEnum;
|
| | | import com.yeshi.fanli.service.inter.user.UserMoneyDetailService;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.vo.money.UserMoneyDetailHistoryVO;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | /**
|
| | | * 账户系统
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | @Controller
|
| | | @RequestMapping("api/v1/usermoney")
|
| | | public class UserMoneyController {
|
| | |
|
| | | @Resource
|
| | | private UserMoneyDetailService userMoneyDetailService;
|
| | |
|
| | | /**
|
| | | * 新版资金详情(1.4.9)
|
| | | * |
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param index
|
| | | * List最末的主键ID
|
| | | * @param year
|
| | | * 年份
|
| | | * @param month
|
| | | * 月份
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getUserMoneyDetailList")
|
| | | public void getUserMoneyDetailList(AcceptData acceptData, Long uid, Long index, Integer year, Integer month,
|
| | | PrintWriter out) {
|
| | | if (uid == null || uid == 0) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
|
| | | return;
|
| | | }
|
| | |
|
| | | if ((year == null && month != null) || (year != null && month == null)) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "日期不完整"));
|
| | | return;
|
| | | }
|
| | |
|
| | | Date date = null;
|
| | |
|
| | | if (year != null && month != null) {
|
| | | date = new Date(TimeUtil.convertToTimeTemp(year + "-" + month, "yyyy-M"));
|
| | | }
|
| | | List<UserMoneyDetailHistoryVO> list = userMoneyDetailService.listUserMoneyDetailForClient(uid, index, date);
|
| | | long count = userMoneyDetailService.countUserMoneyDetailForClient(uid, index, date);
|
| | | GsonBuilder gsonBuilder = JsonUtil.getConvertBigDecimalToStringBuilder(new GsonBuilder())
|
| | | .excludeFieldsWithoutExposeAnnotation();
|
| | | gsonBuilder.registerTypeAdapter(UserMoneyDetailTypeEnum.class, new TypeAdapter<UserMoneyDetailTypeEnum>() {
|
| | | @Override
|
| | | public UserMoneyDetailTypeEnum read(JsonReader arg0) throws IOException {
|
| | | return null;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void write(JsonWriter out, UserMoneyDetailTypeEnum arg1) throws IOException {
|
| | | out.beginObject();
|
| | | out.name("portrait").value(arg1.getPicture());
|
| | | out.name("helpUrl").value(arg1.getHelpUrl());
|
| | | out.endObject();
|
| | | }
|
| | | }).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"));
|
| | | }
|
| | | }
|
| | | });
|
| | |
|
| | | Gson gson = gsonBuilder.create();
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("data", gson.toJson(list));
|
| | | data.put("count", count);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.dao.mybatis.money; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.dao.BaseMapper; |
| | | import com.yeshi.fanli.entity.money.UserMoneyDetail; |
| | | import com.yeshi.fanli.vo.money.UserMonthMoneyVO; |
| | | |
| | | public interface UserMoneyDetailMapper extends BaseMapper<UserMoneyDetail> { |
| | | /** |
| | | * 通过用户ID和返回的最大时间的详情ID来获取下一页的数据 |
| | | * |
| | | * @param uid |
| | | * @param id |
| | | * @param count |
| | | * @return |
| | | */ |
| | | List<UserMoneyDetail> selectByUidWithIndexId(@Param("uid") Long uid, @Param("id") Long id, |
| | | @Param("count") int count); |
| | | |
| | | /** |
| | | * 获取用户总共有多少记录数据 |
| | | * |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | Long selectCountByUid(@Param("uid") Long uid); |
| | | |
| | | /** |
| | | * 按最大的创建时间和用户ID检索列表 |
| | | * |
| | | * @param uid |
| | | * @param date |
| | | * @return |
| | | */ |
| | | List<UserMoneyDetail> selectByMaxCreateTime(@Param("uid") Long uid, @Param("date") Date date,@Param("count") int count); |
| | | |
| | | /** |
| | | * 按最大的创建时间和用户ID检索数量 |
| | | * |
| | | * @param uid |
| | | * @param date |
| | | * @return |
| | | */ |
| | | Long selectCountByUidAndMaxCreateTime(@Param("uid") Long uid, @Param("date") Date date); |
| | | |
| | | /** |
| | | * 按用户ID和最大时间检索月份的数量 |
| | | * |
| | | * @param uid |
| | | * @param maxDate |
| | | * @return |
| | | */ |
| | | int selectMonthCountByUid(@Param("uid") Long uid, @Param("date") Date maxDate); |
| | | |
| | | /** |
| | | * 统计某个月份的收入与支出 |
| | | * |
| | | * @param uid |
| | | * @param dateFormat |
| | | * @return |
| | | */ |
| | | List<UserMonthMoneyVO> selectMonthMoneyByUid(@Param("uid") Long uid, @Param("dateFormat") List<String> dateFormat); |
| | | |
| | | } |
| | |
| | | package com.yeshi.fanli.entity.bus.user;
|
| | |
|
| | | import javax.persistence.Entity;
|
| | | import javax.persistence.FetchType;
|
| | | import javax.persistence.GeneratedValue;
|
| | | import javax.persistence.GenerationType;
|
| | | import javax.persistence.Id;
|
| | |
| | | import javax.persistence.Transient;
|
| | |
|
| | | import com.google.gson.annotations.Expose;
|
| | |
|
| | | import org.hibernate.annotations.LazyToOne;
|
| | | import org.hibernate.metamodel.binding.CascadeType;
|
| | | import org.springframework.context.annotation.Lazy;
|
| | | import org.yeshi.utils.mybatis.Column;
|
| | |
|
| | | /**
|
| | |
| | | import java.math.BigDecimal;
|
| | |
|
| | | import javax.persistence.Entity;
|
| | | import javax.persistence.FetchType;
|
| | | import javax.persistence.GeneratedValue;
|
| | | import javax.persistence.GenerationType;
|
| | | import javax.persistence.Id;
|
| | |
| | | @Map("ticheng_order_statisticed_msg")
|
| | | private String tichengOrderStatisticedMsg;
|
| | |
|
| | | // 分享赚和邀请赚上月收入到账提示
|
| | | // 邀请赚上月收入到账提示
|
| | |
|
| | | @Map("share_invite_money_recieve_title")
|
| | | private String shareInviteMoneyRecieveTitle;
|
| | | @Map("share_invite_money_recieve_push")
|
| | | private String shareInviteMoneyRecievePush;
|
| | | @Map("share_invite_money_recieve_msg")
|
| | | private String shareInviteMoneyRecieveMsg;
|
| | | @Map("invite_money_recieve_title")
|
| | | private String inviteMoneyRecieveTitle;
|
| | | @Map("invite_money_recieve_push")
|
| | | private String inviteMoneyRecievePush;
|
| | | @Map("invite_money_recieve_msg")
|
| | | private String inviteMoneyRecieveMsg;
|
| | | |
| | | //分享赚商业收入到账提示
|
| | | @Map("share_money_recieve_title")
|
| | | private String shareMoneyRecieveTitle;
|
| | | @Map("share_money_recieve_push")
|
| | | private String shareMoneyRecievePush;
|
| | | @Map("share_money_recieve_msg")
|
| | | private String shareMoneyRecieveMsg;
|
| | | |
| | |
|
| | | // 售后维权订单扣款提示
|
| | |
|
| | |
| | | @Map("weiquan_drawback_fanli_push")
|
| | | private String weiquanDrawbackFanliPush;
|
| | |
|
| | | |
| | | //邀请赚维权
|
| | | @Map("weiquan_drawback_invite_title")
|
| | | private String weiquanDrawbackInviteTitle;
|
| | |
|
| | | @Map("weiquan_drawback_invite_msg")
|
| | | private String weiquanDrawbackInviteMsg;
|
| | |
|
| | | @Map("weiquan_drawback_invite_push")
|
| | | private String weiquanDrawbackInvitePush;
|
| | | |
| | | |
| | | //分享赚维权
|
| | | @Map("weiquan_drawback_share_title")
|
| | | private String weiquanDrawbackShareTitle;
|
| | |
|
| | |
| | | private String alipayAccountValidMsg;
|
| | |
|
| | |
|
| | |
|
| | | public String getInviteMoneyRecieveTitle() {
|
| | | return inviteMoneyRecieveTitle;
|
| | | }
|
| | |
|
| | | public void setInviteMoneyRecieveTitle(String inviteMoneyRecieveTitle) {
|
| | | this.inviteMoneyRecieveTitle = inviteMoneyRecieveTitle;
|
| | | }
|
| | |
|
| | | public String getInviteMoneyRecievePush() {
|
| | | return inviteMoneyRecievePush;
|
| | | }
|
| | |
|
| | | public void setInviteMoneyRecievePush(String inviteMoneyRecievePush) {
|
| | | this.inviteMoneyRecievePush = inviteMoneyRecievePush;
|
| | | }
|
| | |
|
| | | public String getInviteMoneyRecieveMsg() {
|
| | | return inviteMoneyRecieveMsg;
|
| | | }
|
| | |
|
| | | public void setInviteMoneyRecieveMsg(String inviteMoneyRecieveMsg) {
|
| | | this.inviteMoneyRecieveMsg = inviteMoneyRecieveMsg;
|
| | | }
|
| | |
|
| | | public String getShareMoneyRecieveTitle() {
|
| | | return shareMoneyRecieveTitle;
|
| | | }
|
| | |
|
| | | public void setShareMoneyRecieveTitle(String shareMoneyRecieveTitle) {
|
| | | this.shareMoneyRecieveTitle = shareMoneyRecieveTitle;
|
| | | }
|
| | |
|
| | | public String getShareMoneyRecievePush() {
|
| | | return shareMoneyRecievePush;
|
| | | }
|
| | |
|
| | | public void setShareMoneyRecievePush(String shareMoneyRecievePush) {
|
| | | this.shareMoneyRecievePush = shareMoneyRecievePush;
|
| | | }
|
| | |
|
| | | public String getShareMoneyRecieveMsg() {
|
| | | return shareMoneyRecieveMsg;
|
| | | }
|
| | |
|
| | | public void setShareMoneyRecieveMsg(String shareMoneyRecieveMsg) {
|
| | | this.shareMoneyRecieveMsg = shareMoneyRecieveMsg;
|
| | | }
|
| | |
|
| | | public String getWeiquanDrawbackInviteTitle() {
|
| | | return weiquanDrawbackInviteTitle;
|
| | | }
|
| | |
|
| | | public void setWeiquanDrawbackInviteTitle(String weiquanDrawbackInviteTitle) {
|
| | | this.weiquanDrawbackInviteTitle = weiquanDrawbackInviteTitle;
|
| | | }
|
| | |
|
| | | public String getWeiquanDrawbackInviteMsg() {
|
| | | return weiquanDrawbackInviteMsg;
|
| | | }
|
| | |
|
| | | public void setWeiquanDrawbackInviteMsg(String weiquanDrawbackInviteMsg) {
|
| | | this.weiquanDrawbackInviteMsg = weiquanDrawbackInviteMsg;
|
| | | }
|
| | |
|
| | | public String getWeiquanDrawbackInvitePush() {
|
| | | return weiquanDrawbackInvitePush;
|
| | | }
|
| | |
|
| | | public void setWeiquanDrawbackInvitePush(String weiquanDrawbackInvitePush) {
|
| | | this.weiquanDrawbackInvitePush = weiquanDrawbackInvitePush;
|
| | | }
|
| | |
|
| | | public String getAlipayAccountValidTitle() {
|
| | | return alipayAccountValidTitle;
|
| | |
| | | this.orderFanliRecieveTitle = orderFanliRecieveTitle;
|
| | | }
|
| | |
|
| | | public String getShareInviteMoneyRecieveTitle() {
|
| | | return shareInviteMoneyRecieveTitle;
|
| | | }
|
| | |
|
| | | public void setShareInviteMoneyRecieveTitle(String shareInviteMoneyRecieveTitle) {
|
| | | this.shareInviteMoneyRecieveTitle = shareInviteMoneyRecieveTitle;
|
| | | }
|
| | |
|
| | | public String getWeiquanDrawbackFanliTitle() {
|
| | | return weiquanDrawbackFanliTitle;
|
| | |
| | | this.orderFanliRecieveMsg = orderFanliRecieveMsg;
|
| | | }
|
| | |
|
| | | public String getShareInviteMoneyRecievePush() {
|
| | | return shareInviteMoneyRecievePush;
|
| | | }
|
| | |
|
| | | public void setShareInviteMoneyRecievePush(String shareInviteMoneyRecievePush) {
|
| | | this.shareInviteMoneyRecievePush = shareInviteMoneyRecievePush;
|
| | | }
|
| | |
|
| | | public String getShareInviteMoneyRecieveMsg() {
|
| | | return shareInviteMoneyRecieveMsg;
|
| | | }
|
| | |
|
| | | public void setShareInviteMoneyRecieveMsg(String shareInviteMoneyRecieveMsg) {
|
| | | this.shareInviteMoneyRecieveMsg = shareInviteMoneyRecieveMsg;
|
| | | }
|
| | |
|
| | | public String getWeiquanDrawbackFanliMsg() {
|
| | | return weiquanDrawbackFanliMsg;
|
| | |
| | | import java.math.BigDecimal;
|
| | | import java.util.Date;
|
| | |
|
| | | import org.yeshi.utils.mybatis.Column;
|
| | | import org.yeshi.utils.mybatis.Table;
|
| | |
|
| | | import com.google.gson.annotations.Expose;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | |
|
| | | /**
|
| | |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | @Table("yeshi_ec_user_money_detail")
|
| | | public class UserMoneyDetail {
|
| | |
|
| | | public enum UserMoneyDetailTypeEnum {
|
| | | share("分享奖金", "", ""), |
| | | invite("邀请奖金", "", ""), |
| | | fanli("返利到账", "", ""), |
| | | fanliWeiQuan("返利扣除", "",""), |
| | | inviteWeiQuan("邀请奖金扣除", "", ""), |
| | | shareWeiQuan("分享奖金扣除", "", ""),
|
| | | systemEqualize("系统补齐", "",""), |
| | | scoreConvert("积分兑换", "", ""),
|
| | | hongbao("官方红包", "", ""), |
| | | buyScore("购买积分", "",""),
|
| | | extract("提现", "", ""), |
| | | extractVerify("提现验证", "", ""), |
| | | extractReject("提现被拒", "", "");
|
| | | share("分享奖金", "", ""), invite("邀请奖金", "", ""), inviteAndShare("奖金收入", "", ""), fanli("返利到账", "",
|
| | | ""), fanliWeiQuan("返利扣除", "", ""), inviteWeiQuan("邀请奖金扣除", "", ""), shareWeiQuan("分享奖金扣除", "",
|
| | | ""), weiQuan("售后订单扣款", "", ""), systemEqualize("系统补齐", "", ""), scoreConvert("积分兑换", "",
|
| | | ""), hongbao("官方红包", "", ""), hongbaoDeduct("红包退款", "", ""), buyScore("购买积分", "",
|
| | | ""), extract("提现", "",
|
| | | ""), extractVerify("提现验证", "", ""), extractReject("提现被拒", "", "");
|
| | | private final String desc;
|
| | | private final String picture;
|
| | | private final String helpUrl;
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | @Expose
|
| | | @Column(name = "umd_id")
|
| | | private Long id;
|
| | | @Column(name = "umd_uid")
|
| | | private UserInfo userInfo;
|
| | | @Expose
|
| | | @Column(name = "umd_money")
|
| | | private BigDecimal money;
|
| | | @Column(name = "umd_type")
|
| | | private UserMoneyDetailTypeEnum type;
|
| | | @Expose
|
| | | @Column(name = "umd_title")
|
| | | private String title;// 标题
|
| | | @Expose
|
| | | @Column(name = "umd_sub_title")
|
| | | private String subTitle;// 子标题
|
| | | @Expose
|
| | | @Column(name = "umd_desc_info")
|
| | | private String descInfo;// 简要信息
|
| | | @Column(name = "umd_source_identify_id")
|
| | | private Long sourceIdentifyId;// 来源方唯一标识ID(返利,邀请赚与分享赚不存在该属性)
|
| | | @Column(name = "umd_identify_code")
|
| | | private String identifyCode;// 唯一标识
|
| | | @Column(name = "umd_beizhu")
|
| | | private String beiZhu;// 备注信息
|
| | | @Expose
|
| | | @Column(name = "umd_createtime")
|
| | | private Date createTime;
|
| | | @Column(name = "umd_updatetime")
|
| | | private Date updateTime;
|
| | |
|
| | | public Long getId() {
|
| | | return id;
|
| | | }
|
| | |
|
| | | public void setId(Long id) {
|
| | | this.id = id;
|
| | | }
|
| | |
|
| | | public UserInfo getUserInfo() {
|
| | | return userInfo;
|
| | | }
|
| | |
|
| | | public void setUserInfo(UserInfo userInfo) {
|
| | | this.userInfo = userInfo;
|
| | | }
|
| | |
|
| | | public BigDecimal getMoney() {
|
| | | return money;
|
| | | }
|
| | |
|
| | | public void setMoney(BigDecimal money) {
|
| | | this.money = money;
|
| | | }
|
| | |
|
| | | public UserMoneyDetailTypeEnum getType() {
|
| | | return type;
|
| | | }
|
| | |
|
| | | public void setType(UserMoneyDetailTypeEnum type) {
|
| | | this.type = type;
|
| | | }
|
| | |
|
| | | public String getTitle() {
|
| | | return title;
|
| | | }
|
| | |
|
| | | public void setTitle(String title) {
|
| | | this.title = title;
|
| | | }
|
| | |
|
| | | public String getSubTitle() {
|
| | | return subTitle;
|
| | | }
|
| | |
|
| | | public void setSubTitle(String subTitle) {
|
| | | this.subTitle = subTitle;
|
| | | }
|
| | |
|
| | | public String getDescInfo() {
|
| | | return descInfo;
|
| | | }
|
| | |
|
| | | public void setDescInfo(String descInfo) {
|
| | | this.descInfo = descInfo;
|
| | | }
|
| | |
|
| | | public Long getSourceIdentifyId() {
|
| | | return sourceIdentifyId;
|
| | | }
|
| | |
|
| | | public void setSourceIdentifyId(Long sourceIdentifyId) {
|
| | | this.sourceIdentifyId = sourceIdentifyId;
|
| | | }
|
| | |
|
| | | public String getIdentifyCode() {
|
| | | return identifyCode;
|
| | | }
|
| | |
|
| | | public void setIdentifyCode(String identifyCode) {
|
| | | this.identifyCode = identifyCode;
|
| | | }
|
| | |
|
| | | public String getBeiZhu() {
|
| | | return beiZhu;
|
| | | }
|
| | |
|
| | | public void setBeiZhu(String beiZhu) {
|
| | | this.beiZhu = beiZhu;
|
| | | }
|
| | |
|
| | | public Date getCreateTime() {
|
| | | return createTime;
|
| | | }
|
| | |
|
| | | public void setCreateTime(Date createTime) {
|
| | | this.createTime = createTime;
|
| | | }
|
| | |
|
| | | public Date getUpdateTime() {
|
| | | return updateTime;
|
| | | }
|
| | |
|
| | | public void setUpdateTime(Date updateTime) {
|
| | | this.updateTime = updateTime;
|
| | | }
|
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | |
| | | <mapper namespace="com.yeshi.fanli.dao.mybatis.money.UserMoneyDetailMapper"> |
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.money.UserMoneyDetail"> |
| | | <id column="umd_id" property="id" jdbcType="BIGINT" /> |
| | | <result column="umd_money" property="money" jdbcType="DECIMAL" /> |
| | | <result column="umd_type" property="type" |
| | | typeHandler="com.yeshi.fanli.util.mybatishandler.UserMoneyDetailTypeEnumHandler" /> |
| | | <result column="umd_title" property="title" jdbcType="VARCHAR" /> |
| | | <result column="umd_sub_title" property="subTitle" jdbcType="VARCHAR" /> |
| | | <result column="umd_desc_info" property="descInfo" jdbcType="VARCHAR" /> |
| | | <result column="umd_source_identify_id" property="sourceIdentifyId" |
| | | jdbcType="BIGINT" /> |
| | | <result column="umd_identify_code" property="identifyCode" |
| | | jdbcType="VARCHAR" /> |
| | | <result column="umd_beizhu" property="beiZhu" jdbcType="VARCHAR" /> |
| | | <result column="umd_createtime" property="createTime" jdbcType="TIMESTAMP" /> |
| | | <result column="umd_updatetime" property="updateTime" jdbcType="TIMESTAMP" /> |
| | | <association property="userInfo" column="umd_uid" |
| | | javaType="com.yeshi.fanli.entity.bus.user.UserInfo"> |
| | | <id column="umd_uid" property="id" jdbcType="BIGINT" /> |
| | | </association> |
| | | </resultMap> |
| | | |
| | | |
| | | <resultMap id="UserMonthMoneyMap" type="com.yeshi.fanli.vo.money.UserMonthMoneyVO"> |
| | | <result column="expend" property="expend" jdbcType="DECIMAL" /> |
| | | <result column="income" property="income" jdbcType="DECIMAL" /> |
| | | <result column="dateFormate" property="dateFormate" jdbcType="VARCHAR" /> |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List">umd_id,umd_uid,umd_money,umd_type,umd_title,umd_sub_title,umd_desc_info,umd_source_identify_id,umd_identify_code,umd_beizhu,umd_createtime,umd_updatetime |
| | | </sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" |
| | | parameterType="java.lang.Long"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_user_money_detail where umd_id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | |
| | | <select id="selectByUidWithIndexId" resultMap="BaseResultMap"> |
| | | SELECT |
| | | <include refid="Base_Column_List" /> |
| | | FROM yeshi_ec_user_money_detail d WHERE d.`umd_createtime` |
| | | <![CDATA[ |
| | | <= |
| | | ]]> |
| | | (SELECT |
| | | d.`umd_createtime` FROM yeshi_ec_user_money_detail d WHERE |
| | | d.`umd_id`=#{id}) and d.umd_uid=#{uid} order by d.`umd_createtime` |
| | | desc,d.umd_id desc limit #{count} |
| | | </select> |
| | | |
| | | <select id="selectCountByUid" resultType="java.lang.Long" |
| | | parameterType="java.lang.Long"> |
| | | SELECT count(umd_id) FROM yeshi_ec_user_money_detail |
| | | where umd_uid=#{uid} |
| | | </select> |
| | | |
| | | |
| | | |
| | | <select id="selectByMaxCreateTime" resultMap="BaseResultMap"> |
| | | SELECT |
| | | <include refid="Base_Column_List" /> |
| | | FROM yeshi_ec_user_money_detail d WHERE d.umd_uid=#{uid} and |
| | | d.`umd_createtime` |
| | | <![CDATA[ |
| | | <= |
| | | ]]> |
| | | #{date} |
| | | order by d.`umd_createtime` desc,d.umd_id desc limit #{count} |
| | | </select> |
| | | |
| | | <select id="selectCountByUidAndMaxCreateTime" resultType="java.lang.Long"> |
| | | SELECT count(umd_id) FROM yeshi_ec_user_money_detail |
| | | where |
| | | umd_uid=#{uid} and d.`umd_createtime` |
| | | <![CDATA[ |
| | | <= |
| | | ]]> |
| | | #{date} |
| | | </select> |
| | | |
| | | |
| | | <select id="selectMonthCountByUid" resultType="java.lang.Integer"> |
| | | SELECT COUNT(*) FROM (SELECT * FROM yeshi_ec_user_money_detail d WHERE |
| | | d.`umd_uid`=#{uid} and d.`umd_createtime` <![CDATA[<=]]> |
| | | #{date} group by DATE_FORMAT(d.`umd_createtime`,'%y-%m')) a |
| | | </select> |
| | | |
| | | <select id="selectMonthMoneyByUid" resultMap="UserMonthMoneyMap"> |
| | | <foreach collection="dateFormat" index="index" item="item" separator="UNION ALL" > |
| | | <trim prefix="(" suffix=")" > |
| | | SELECT |
| | | a.time as dateFormate , if(a.money is null,0,a.money) as income ,if(b.money is null,0,b.money) as expend |
| | | FROM |
| | | ( |
| | | SELECT DATE_FORMAT( |
| | | d.`umd_createtime`,'%Y-%m') AS |
| | | `time`,SUM(d.`umd_money`) AS money |
| | | FROM |
| | | `yeshi_ec_user_money_detail` |
| | | d |
| | | WHERE d.`umd_uid`=#{uid} AND |
| | | d.`umd_money`>=0 AND DATE_FORMAT( |
| | | d.`umd_createtime`,'%Y-%m')=#{item} GROUP BY DATE_FORMAT( |
| | | d.`umd_createtime`,'%Y-%m') |
| | | ) a |
| | | LEFT JOIN |
| | | ( |
| | | SELECT DATE_FORMAT( |
| | | d.`umd_createtime`,'%Y-%m') AS |
| | | `time`,SUM(d.`umd_money`) AS money |
| | | FROM |
| | | `yeshi_ec_user_money_detail` |
| | | d WHERE d.`umd_uid`=#{uid} AND |
| | | d.`umd_money` <![CDATA[<0]]> |
| | | AND DATE_FORMAT( |
| | | d.`umd_createtime`,'%Y-%m')=#{item} GROUP BY |
| | | DATE_FORMAT( |
| | | d.`umd_createtime`,'%Y-%m') |
| | | ) b ON a.time=b.time |
| | | </trim> |
| | | </foreach> |
| | | </select> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from |
| | | yeshi_ec_user_money_detail where umd_id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.money.UserMoneyDetail" |
| | | useGeneratedKeys="true" keyProperty="id">insert into |
| | | yeshi_ec_user_money_detail |
| | | (umd_id,umd_uid,umd_money,umd_type,umd_title,umd_sub_title,umd_desc_info,umd_source_identify_id,umd_identify_code,umd_beizhu,umd_createtime,umd_updatetime) |
| | | values |
| | | (#{id,jdbcType=BIGINT},#{userInfo.id,jdbcType=BIGINT},#{money,jdbcType=DECIMAL},#{type,jdbcType=VARCHAR},#{title,jdbcType=VARCHAR},#{subTitle,jdbcType=VARCHAR},#{descInfo,jdbcType=VARCHAR},#{sourceIdentifyId,jdbcType=BIGINT},#{identifyCode,jdbcType=VARCHAR},#{beiZhu,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.money.UserMoneyDetail" |
| | | useGeneratedKeys="true" keyProperty="id"> |
| | | insert into yeshi_ec_user_money_detail |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">umd_id,</if> |
| | | <if test="userInfo != null">umd_uid,</if> |
| | | <if test="money != null">umd_money,</if> |
| | | <if test="type != null">umd_type,</if> |
| | | <if test="title != null">umd_title,</if> |
| | | <if test="subTitle != null">umd_sub_title,</if> |
| | | <if test="descInfo != null">umd_desc_info,</if> |
| | | <if test="sourceIdentifyId != null">umd_source_identify_id,</if> |
| | | <if test="identifyCode != null">umd_identify_code,</if> |
| | | <if test="beiZhu != null">umd_beizhu,</if> |
| | | <if test="createTime != null">umd_createtime,</if> |
| | | <if test="updateTime != null">umd_updatetime,</if> |
| | | </trim> |
| | | values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="userInfo != null">#{userInfo.id,jdbcType=BIGINT},</if> |
| | | <if test="money != null">#{money,jdbcType=DECIMAL},</if> |
| | | <if test="type != null">#{type,jdbcType=VARCHAR},</if> |
| | | <if test="title != null">#{title,jdbcType=VARCHAR},</if> |
| | | <if test="subTitle != null">#{subTitle,jdbcType=VARCHAR},</if> |
| | | <if test="descInfo != null">#{descInfo,jdbcType=VARCHAR},</if> |
| | | <if test="sourceIdentifyId != null">#{sourceIdentifyId,jdbcType=BIGINT},</if> |
| | | <if test="identifyCode != null">#{identifyCode,jdbcType=VARCHAR},</if> |
| | | <if test="beiZhu != null">#{beiZhu,jdbcType=VARCHAR},</if> |
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.money.UserMoneyDetail">update |
| | | yeshi_ec_user_money_detail set umd_uid = |
| | | #{userInfo.id,jdbcType=BIGINT},umd_money = |
| | | #{money,jdbcType=DECIMAL},umd_type = |
| | | #{type,jdbcType=VARCHAR},umd_title = |
| | | #{title,jdbcType=VARCHAR},umd_sub_title = |
| | | #{subTitle,jdbcType=VARCHAR},umd_desc_info = |
| | | #{descInfo,jdbcType=VARCHAR},umd_source_identify_id = |
| | | #{sourceIdentifyId,jdbcType=BIGINT},umd_identify_code = |
| | | #{identifyCode,jdbcType=VARCHAR},umd_beizhu = |
| | | #{beiZhu,jdbcType=VARCHAR},umd_createtime = |
| | | #{createTime,jdbcType=TIMESTAMP},umd_updatetime = |
| | | #{updateTime,jdbcType=TIMESTAMP} where umd_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.money.UserMoneyDetail"> |
| | | update yeshi_ec_user_money_detail |
| | | <set> |
| | | <if test="userInfo != null">umd_uid=#{userInfo.id,jdbcType=BIGINT},</if> |
| | | <if test="money != null">umd_money=#{money,jdbcType=DECIMAL},</if> |
| | | <if test="type != null">umd_type=#{type,jdbcType=VARCHAR},</if> |
| | | <if test="title != null">umd_title=#{title,jdbcType=VARCHAR},</if> |
| | | <if test="subTitle != null">umd_sub_title=#{subTitle,jdbcType=VARCHAR},</if> |
| | | <if test="descInfo != null">umd_desc_info=#{descInfo,jdbcType=VARCHAR},</if> |
| | | <if test="sourceIdentifyId != null">umd_source_identify_id=#{sourceIdentifyId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="identifyCode != null">umd_identify_code=#{identifyCode,jdbcType=VARCHAR},</if> |
| | | <if test="beiZhu != null">umd_beizhu=#{beiZhu,jdbcType=VARCHAR},</if> |
| | | <if test="createTime != null">umd_createtime=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">umd_updatetime=#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </set> |
| | | where umd_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | </mapper> |
| | |
| | | import com.yeshi.fanli.dao.mybatis.ThreeSaleMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.UserInfoMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.hongbao.HongBaoMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.money.UserMoneyDetailMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.order.OrderItemMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.order.OrderMapper;
|
| | | import com.yeshi.fanli.entity.admin.OrderAdmin;
|
| | |
| | | import com.yeshi.fanli.entity.bus.user.ThreeSaleGift;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.common.Config;
|
| | | import com.yeshi.fanli.entity.money.UserMoneyDetail;
|
| | | import com.yeshi.fanli.entity.taobao.OrderVital;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoOrder;
|
| | | import com.yeshi.fanli.exception.money.UserMoneyDetailException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.config.SystemConfigService;
|
| | |
| | | import com.yeshi.fanli.util.factory.AccountDetailsFactory;
|
| | | import com.yeshi.fanli.util.factory.AccountMessageFactory;
|
| | | import com.yeshi.fanli.util.factory.HongBaoFactory;
|
| | | import com.yeshi.fanli.util.factory.UserMoneyDetailFactory;
|
| | | import com.yeshi.fanli.util.push.XiaoMiPushUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoOrderUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | |
| | |
|
| | | @Resource
|
| | | private UserNotificationService userNotificationService;
|
| | | |
| | | @Resource
|
| | | private UserMoneyDetailMapper userMoneyDetailMapper;
|
| | |
|
| | | private static final String NEW_USER_HONGBAO = "new_user_hongbao";
|
| | |
|
| | |
| | |
|
| | | AccountDetails ac = AccountDetailsFactory.create("+" + money, AccountDetailsFactory.XINREN, null, null, form);
|
| | | accountDetailsMapper.insertSelective(ac);
|
| | | // 新版资金明细
|
| | | try {
|
| | | UserMoneyDetail userMoneyDetail = UserMoneyDetailFactory.createNewerHongBao(hongBao);
|
| | | userMoneyDetail.setId(ac.getId());
|
| | | userMoneyDetailMapper.insert(userMoneyDetail);
|
| | | } catch (UserMoneyDetailException e) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | } catch (Exception e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | userInfoMapper.addHongBaoByUid(form.getId(), new BigDecimal(money));
|
| | | userNotificationService.newerHongBao(form.getId(), new BigDecimal(money));
|
| | |
| | | import com.yeshi.fanli.dao.mybatis.ThreeSaleGiftMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.UserInfoMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.hongbao.HongBaoMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.money.UserMoneyDetailMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.order.OrderItemMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.order.OrderMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.share.PidUserMapper;
|
| | |
| | | import com.yeshi.fanli.entity.bus.user.Order;
|
| | | import com.yeshi.fanli.entity.bus.user.OrderItem;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.money.UserMoneyDetail;
|
| | | import com.yeshi.fanli.entity.taobao.PidOrder;
|
| | | import com.yeshi.fanli.entity.taobao.PidUser;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoOrder;
|
| | |
| | | import com.yeshi.fanli.exception.ObjectStateException;
|
| | | import com.yeshi.fanli.exception.OrderItemException;
|
| | | import com.yeshi.fanli.exception.TaoBaoWeiQuanException;
|
| | | import com.yeshi.fanli.exception.money.UserMoneyDetailException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.hongbao.AccountDetailsHongBaoMapService;
|
| | | import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
|
| | |
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.factory.AccountDetailsFactory;
|
| | | import com.yeshi.fanli.util.factory.UserMoneyDetailFactory;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoOrderUtil;
|
| | |
|
| | | @Service
|
| | |
| | |
|
| | | @Resource
|
| | | private AccountDetailsHongBaoMapService accountDetailsHongBaoMapService;
|
| | |
|
| | | @Resource
|
| | | private UserMoneyDetailMapper userMoneyDetailMapper;
|
| | |
|
| | | @Override
|
| | | public void processOrder(Map<String, List<TaoBaoOrder>> orders) {
|
| | |
| | | AccountDetailsFactory.FANLI, orderItem, null, hb.getUserInfo());
|
| | | accountDetailsMapper.insertSelective(accountDetails);
|
| | |
|
| | | // 插入新版资金明细
|
| | | try {
|
| | | UserMoneyDetail userMoneyDetail = UserMoneyDetailFactory.createFanLi(hb.getUserInfo().getId(),
|
| | | hb.getOrderId(), 1,hb.getId(), hb.getMoney());
|
| | | userMoneyDetail.setId(accountDetails.getId());
|
| | | userMoneyDetailMapper.insert(userMoneyDetail);
|
| | | } catch (UserMoneyDetailException e1) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e1);
|
| | | } catch (Exception e2) {
|
| | | e2.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | // 添加资金明细与红包的映射关系
|
| | | accountDetailsHongBaoMapService.saveAccountDetailsHongBaoMap(hb.getId(), accountDetails.getId());
|
| | |
|
| | |
| | |
|
| | | List<Long> hbIdList = new ArrayList<>();
|
| | |
|
| | | BigDecimal money = new BigDecimal(0);
|
| | | BigDecimal invitemoney = new BigDecimal(0);
|
| | | // 需要判断退款的订单号
|
| | | Set<String> drawBackOrders = new HashSet<String>();
|
| | | for (HongBao hongBao : hongBaoList) {
|
| | |
| | |
|
| | | hongBao = hongBaoMapper.selectByPrimaryKeyForUpdate(hongBao.getId());
|
| | | if (hongBao.getState() == HongBao.STATE_BUKELINGQU || hongBao.getState() == HongBao.STATE_KELINGQU) {
|
| | | money = money.add(hongBao.getMoney());
|
| | | invitemoney = invitemoney.add(hongBao.getMoney());
|
| | | HongBao updateHongBao = new HongBao();
|
| | | updateHongBao.setId(hongBao.getId());
|
| | | updateHongBao.setGetTime(System.currentTimeMillis());
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | | |
| | | /**
|
| | | * 处理顶级分享赚
|
| | | * 处理一级二级分享赚(属于邀请赚类型)
|
| | | */
|
| | |
|
| | | List<HongBao> totalHongBaoList = new ArrayList<>();
|
| | | // 查询UID的二级或者三级分享赚订单
|
| | | // TODO 暂时查询10000条数据,后面再做分页
|
| | | List<HongBao> hbList = hongBaoMapper.selectCanBalanceHongBaoByTypeAndUid(HongBao.TYPE_SHARE_YIJI, uid, 10000);
|
| | |
|
| | | if (hbList != null && hbList.size() > 0)
|
| | | totalHongBaoList.addAll(hbList);
|
| | |
|
| | | hbList = hongBaoMapper.selectCanBalanceHongBaoByTypeAndUid(HongBao.TYPE_SHARE_ERJI, uid, 10000);
|
| | | if (hbList != null && hbList.size() > 0)
|
| | | totalHongBaoList.addAll(hbList);
|
| | |
|
| | | for (HongBao hb : totalHongBaoList) {
|
| | | if (hb.getState() == HongBao.STATE_BUKELINGQU || hb.getState() == HongBao.STATE_KELINGQU) {
|
| | | hb = filterWeiQuanINGHongBao(hb);
|
| | | if (hb == null)
|
| | | continue;
|
| | | invitemoney = invitemoney.add(hb.getMoney());
|
| | | HongBao updateHongBao = new HongBao();
|
| | | updateHongBao.setId(hb.getId());
|
| | | updateHongBao.setGetTime(System.currentTimeMillis());
|
| | | updateHongBao.setState(HongBao.STATE_YILINGQU);
|
| | | hongBaoMapper.updateByPrimaryKeySelective(updateHongBao);
|
| | | // 添加到红包返利记录集合
|
| | | hbIdList.add(hb.getId());
|
| | | if (!StringUtil.isNullOrEmpty(hb.getOrderId()))
|
| | | drawBackOrders.add(hb.getOrderId());
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | |
| | | // 邀请赚到账
|
| | | if (invitemoney.compareTo(new BigDecimal(0)) > 0) {
|
| | | userInfoMapper.addHongBaoByUid(uid, invitemoney);
|
| | | // 添加记录
|
| | | AccountDetails accountDetails = AccountDetailsFactory.create("+" + invitemoney,
|
| | | AccountDetailsFactory.TICHENG, null, null, new UserInfo(uid));
|
| | | accountDetailsMapper.insertSelective(accountDetails);
|
| | |
|
| | | // 添加新版详情记录
|
| | | try {
|
| | | UserMoneyDetail userMoneyDetail = UserMoneyDetailFactory.createInvite(uid, 0, 0, 0, invitemoney,
|
| | | new Date());
|
| | | userMoneyDetail.setId(accountDetails.getId());
|
| | | userMoneyDetailMapper.insert(userMoneyDetail);
|
| | | } catch (UserMoneyDetailException e) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | } catch (Exception e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | // 记录返利红包与资金详情的对应关系
|
| | |
|
| | | // 添加到红包返利记录集合
|
| | | accountDetailsHongBaoMapService.saveAccountDetailsHongBaoMap(hbIdList, accountDetails.getId());
|
| | |
|
| | | // 发送推送
|
| | | try {
|
| | | // 提成到账消息通知
|
| | | userNotificationService.tiChengInviteRecieved(uid, invitemoney);
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | for (String orderId : drawBackOrders)
|
| | | taoBaoWeiQuanDrawBackService.doWeiQuanInvite(orderId);
|
| | | }
|
| | |
|
| | | hbIdList.clear();
|
| | | drawBackOrders.clear();
|
| | |
|
| | | /**
|
| | | * 处理分享赚
|
| | | */
|
| | | BigDecimal sharemoney = new BigDecimal(0);
|
| | | // 查询UID的分享赚订单
|
| | | List<PidOrder> pidOrderList = pidOrderMapper.getCanBalanceListByUid(uid);
|
| | | for (PidOrder pidOrder : pidOrderList) {
|
| | |
| | | if (hongBao == null)
|
| | | continue;
|
| | | if (hongBao.getState() == HongBao.STATE_BUKELINGQU || hongBao.getState() == HongBao.STATE_KELINGQU) {
|
| | | money = money.add(hongBao.getMoney());
|
| | | sharemoney = sharemoney.add(hongBao.getMoney());
|
| | | HongBao updateHongBao = new HongBao();
|
| | | updateHongBao.setId(hongBao.getId());
|
| | | updateHongBao.setGetTime(System.currentTimeMillis());
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 处理一级二级分享赚
|
| | | */
|
| | |
|
| | | List<HongBao> totalHongBaoList = new ArrayList<>();
|
| | | // 查询UID的二级或者三级分享赚订单
|
| | | // TODO 暂时查询10000条数据,后面再做分页
|
| | | List<HongBao> hbList = hongBaoMapper.selectCanBalanceHongBaoByTypeAndUid(HongBao.TYPE_SHARE_YIJI, uid, 10000);
|
| | |
|
| | | if (hbList != null && hbList.size() > 0)
|
| | | totalHongBaoList.addAll(hbList);
|
| | |
|
| | | hbList = hongBaoMapper.selectCanBalanceHongBaoByTypeAndUid(HongBao.TYPE_SHARE_ERJI, uid, 10000);
|
| | | if (hbList != null && hbList.size() > 0)
|
| | | totalHongBaoList.addAll(hbList);
|
| | |
|
| | | for (HongBao hb : totalHongBaoList) {
|
| | | if (hb.getState() == HongBao.STATE_BUKELINGQU || hb.getState() == HongBao.STATE_KELINGQU) {
|
| | | hb = filterWeiQuanINGHongBao(hb);
|
| | | if (hb == null)
|
| | | continue;
|
| | | money = money.add(hb.getMoney());
|
| | | HongBao updateHongBao = new HongBao();
|
| | | updateHongBao.setId(hb.getId());
|
| | | updateHongBao.setGetTime(System.currentTimeMillis());
|
| | | updateHongBao.setState(HongBao.STATE_YILINGQU);
|
| | | hongBaoMapper.updateByPrimaryKeySelective(updateHongBao);
|
| | | // 添加到红包返利记录集合
|
| | | hbIdList.add(hb.getId());
|
| | | if (!StringUtil.isNullOrEmpty(hb.getOrderId()))
|
| | | drawBackOrders.add(hb.getOrderId());
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 增加用户资金记录
|
| | | * 分享赚到账
|
| | | */
|
| | |
|
| | | if (money.compareTo(new BigDecimal(0)) > 0) {
|
| | | userInfoMapper.addHongBaoByUid(uid, money);
|
| | | if (sharemoney.compareTo(new BigDecimal(0)) > 0) {
|
| | | userInfoMapper.addHongBaoByUid(uid, sharemoney);
|
| | | // 添加记录
|
| | | AccountDetails accountDetails = AccountDetailsFactory.create("+" + money, AccountDetailsFactory.TICHENG,
|
| | | null, null, new UserInfo(uid));
|
| | | AccountDetails accountDetails = AccountDetailsFactory.create("+" + sharemoney,
|
| | | AccountDetailsFactory.SHARE_GOODS, null, null, new UserInfo(uid));
|
| | | accountDetailsMapper.insertSelective(accountDetails);
|
| | |
|
| | | // 添加新版详情记录
|
| | | try {
|
| | | UserMoneyDetail userMoneyDetail = UserMoneyDetailFactory.createShare(uid, 0, 0, 0, sharemoney,
|
| | | new Date());
|
| | | userMoneyDetail.setId(accountDetails.getId());
|
| | | userMoneyDetailMapper.insert(userMoneyDetail);
|
| | | } catch (UserMoneyDetailException e) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | } catch (Exception e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | | }
|
| | | // 记录返利红包与资金详情的对应关系
|
| | |
|
| | | // 添加到红包返利记录集合
|
| | |
| | | // 发送推送
|
| | | try {
|
| | | // 提成到账消息通知
|
| | | userNotificationService.tiChengRecieved(uid, money);
|
| | | userNotificationService.tiChengShareRecieved(uid, sharemoney);
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | for (String orderId : drawBackOrders)
|
| | | taoBaoWeiQuanDrawBackService.doWeiQuanShare(orderId);
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.factory.AccountDetailsFactory;
|
| | | import com.yeshi.fanli.util.factory.HongBaoFactory;
|
| | | import com.yeshi.fanli.util.factory.UserMoneyDetailFactory;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoOrderUtil;
|
| | |
|
| | | @Service
|
| | |
| | | // 结算到账户
|
| | |
|
| | | @Override
|
| | | public void balanceOrder() {
|
| | | // 获取到该月25日可结算的订单
|
| | | List<PidOrder> list = pidOrderMapper.getCanBalanceList(1000);
|
| | | if (list != null) {
|
| | | Map<String, List<PidOrder>> map = parseOrderMap(list);
|
| | | Iterator<String> its = map.keySet().iterator();
|
| | | while (its.hasNext()) {
|
| | | String orderId = its.next();
|
| | | List<PidOrder> orders = map.get(orderId);
|
| | | for (int i = 0; i < orders.size(); i++)
|
| | | balanceOrder(orders.get(i));
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void compareOrderAndHongBao() {
|
| | | List<PidOrder> list = pidOrderMapper.selectByState("订单付款", 100);
|
| | | list.addAll(pidOrderMapper.selectByState("订单结算", 100));
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Override
|
| | | public void balanceOrder(PidOrder pidOrder) {
|
| | | if (pidOrder.getHongBao() == null)
|
| | | return;
|
| | | // 查找红包
|
| | | HongBao hongBao = hongBaoMapper.selectByPrimaryKey(pidOrder.getHongBao().getId());
|
| | | if (hongBao.getState() == HongBao.STATE_SHIXIAO || hongBao.getState() == HongBao.STATE_YILINGQU)
|
| | | return;
|
| | |
|
| | | HongBao updateHongBao = new HongBao();
|
| | | updateHongBao.setId(hongBao.getId());
|
| | | updateHongBao.setGetTime(System.currentTimeMillis());
|
| | | updateHongBao.setState(HongBao.STATE_YILINGQU);
|
| | | hongBaoMapper.updateByPrimaryKeySelective(updateHongBao);
|
| | |
|
| | | // 加入用户余额
|
| | | userInfoMapper.addHongBaoByUid(hongBao.getUserInfo().getId(), hongBao.getMoney());
|
| | | // 加入账户明细
|
| | | AccountDetails ad = AccountDetailsFactory.create("+" + hongBao.getMoney(), AccountDetailsFactory.SHARE_GOODS,
|
| | | null, null, hongBao.getUserInfo());
|
| | | accountDetailsMapper.insertSelective(ad);
|
| | | try {
|
| | | userNotificationService.tiChengRecieved(hongBao.getUserInfo().getId(), hongBao.getMoney());
|
| | | } catch (Exception e) {
|
| | | }
|
| | |
|
| | | PidOrder updatePidOrder = new PidOrder();
|
| | | updatePidOrder.setId(pidOrder.getId());
|
| | | updatePidOrder.setAccountBalance(true);
|
| | | updatePidOrder.setAccountBalanceTime(new Date());
|
| | | pidOrderMapper.updateByPrimaryKeySelective(updatePidOrder);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void weiQuan(String orderId) {
|
| | |
| | | AccountDetailsFactory.SHARE_GOODS_DRAWBACK, null, null, hongBao.getUserInfo());
|
| | | accountDetailsMapper.insertSelective(ad);
|
| | |
|
| | | |
| | | |
| | |
|
| | | // 维权通知
|
| | | try {
|
| | | userNotificationService.weiQuanTiCheng(hongBao.getUserInfo().getId(), orderId,
|
| | |
| | | @Override
|
| | | public void pushBaiChuanUrl(Long uid, String title, String content, String url) throws PushException {
|
| | | iosPushService.pushBaiChuanUrl(uid, title, content, url);
|
| | | xmPushService.pushBaiChuanUrl(uid, title, content, url);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | @Override
|
| | | public void pushWEEX(Long uid, String title, String content, String weexUrl) throws PushException {
|
| | | // TODO 推送weex页面
|
| | | JSONObject json = new JSONObject();
|
| | | json.put("url", weexUrl);
|
| | | json.put("type", "weex");
|
| | | MessageInfo info = new MessageInfo();
|
| | | info.setTitle(title);
|
| | | info.setContent(content);
|
| | | info.setDescription(content);
|
| | | // 小米推送网页
|
| | | info.setPackageName(Constant.systemCommonConfig.getAndroidPackageName());
|
| | | info.setActivty(String.format("%s.ui.mine.weex.WeexApplicationActivity",
|
| | | Constant.systemCommonConfig.getAndroidBaseactivityName()));
|
| | |
|
| | | PushRecord pushRecord = new PushRecord();
|
| | |
|
| | | // 小米 全推
|
| | | if (uid == null || uid == 0) {
|
| | | try {
|
| | | PushUtils.allPushXiaoMi(info, json, pushRecord);
|
| | | } catch (Exception e) {
|
| | | PushLogHelper.xmError(e);
|
| | | }
|
| | | } else {
|
| | | info.setAlias(uid + "");
|
| | | PushUtils.singlePushXiaoMi(info, json, pushRecord);
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void pushBaiChuanUrl(Long uid, String title, String content, String url) throws PushException {
|
| | | // TODO 推送百川的链接
|
| | | JSONObject json = new JSONObject();
|
| | | json.put("url", url);
|
| | | json.put("type", "baichuan");
|
| | | MessageInfo info = new MessageInfo();
|
| | | info.setTitle(title);
|
| | | info.setContent(content);
|
| | | info.setDescription(content);
|
| | | // 小米推送网页
|
| | | info.setPackageName(Constant.systemCommonConfig.getAndroidPackageName());
|
| | |
|
| | | PushRecord pushRecord = new PushRecord();
|
| | |
|
| | | // 小米 全推
|
| | | if (uid == null || uid == 0) {
|
| | | try {
|
| | | PushUtils.allPushXiaoMi(info, json, pushRecord);
|
| | | } catch (Exception e) {
|
| | | PushLogHelper.xmError(e);
|
| | | }
|
| | | } else {
|
| | | info.setAlias(uid + "");
|
| | | PushUtils.singlePushXiaoMi(info, json, pushRecord);
|
| | | }
|
| | | |
| | | }
|
| | |
|
| | | }
|
| | |
| | | import com.yeshi.fanli.dao.mybatis.AccountDetailsMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.UserInfoMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.hongbao.HongBaoMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.money.UserMoneyDetailMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.taobao.TaoBaoOrderMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.taobao.TaoBaoWeiQuanDrawBackMapper;
|
| | | import com.yeshi.fanli.entity.bus.user.AccountDetails;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBao;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.money.UserMoneyDetail;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoOrder;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoWeiQuanDrawBack;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoWeiQuanOrder;
|
| | | import com.yeshi.fanli.exception.TaoBaoWeiQuanException;
|
| | | import com.yeshi.fanli.exception.money.UserMoneyDetailException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoWeiQuanDrawBackService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoWeiQuanOrderService;
|
| | | import com.yeshi.fanli.service.inter.user.UserNotificationService;
|
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.factory.AccountDetailsFactory;
|
| | | import com.yeshi.fanli.util.factory.UserMoneyDetailFactory;
|
| | |
|
| | | @Service
|
| | | public class TaoBaoWeiQuanDrawBackServiceImpl implements TaoBaoWeiQuanDrawBackService {
|
| | |
| | |
|
| | | @Resource
|
| | | private UserInfoMapper userInfoMapper;
|
| | |
|
| | | @Resource
|
| | | private UserMoneyDetailMapper userMoneyDetailMapper;
|
| | |
|
| | | @Resource
|
| | | private AccountDetailsMapper accountDetailsMapper;
|
| | |
| | | BigDecimal userGetMoney = fanMoneyMap.get(uid);
|
| | | BigDecimal fanMoney = new BigDecimal("0");
|
| | | // 统计用户在这个单中需要扣除的资金
|
| | | TaoBaoWeiQuanDrawBack weiQuanDrawBack = null;
|
| | | for (TaoBaoWeiQuanOrder weiQuanOrder : list) {
|
| | | TaoBaoWeiQuanDrawBack weiQuanDrawBack = taoBaoWeiQuanDrawBackMapper
|
| | | .selectByOrderItemIdAndUid(weiQuanOrder.getOrderItemId(), uid);
|
| | | weiQuanDrawBack = taoBaoWeiQuanDrawBackMapper.selectByOrderItemIdAndUid(weiQuanOrder.getOrderItemId(),
|
| | | uid);
|
| | | if (weiQuanDrawBack != null)
|
| | | continue;
|
| | | // 退款的资金
|
| | |
| | | AccountDetails accountDetails = AccountDetailsFactory.create("-" + drawBackMoney,
|
| | | AccountDetailsFactory.SHARE_GOODS_DRAWBACK, null, null, new UserInfo(uid));
|
| | | accountDetailsMapper.insertSelective(accountDetails);
|
| | | // 新版资金记录
|
| | | try {
|
| | | UserMoneyDetail userMoneyDetail = UserMoneyDetailFactory.createFanLiWeiQuan(uid, weiQuanDrawBack,
|
| | | drawBackMoney);
|
| | | userMoneyDetail.setId(accountDetails.getId());
|
| | | userMoneyDetailMapper.insert(userMoneyDetail);
|
| | | } catch (UserMoneyDetailException e) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | } catch (Exception e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | userNotificationService.weiQuanFanli(uid, orderId, drawBackMoney);
|
| | | }
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Override
|
| | | public void doWeiQuanShare(String orderId) throws TaoBaoWeiQuanException {
|
| | | if (StringUtil.isNullOrEmpty(orderId))
|
| | |
| | | BigDecimal userGetMoney = fanMoneyMap.get(uid);
|
| | | BigDecimal fanMoney = new BigDecimal("0");
|
| | | // 统计用户在这个单中需要扣除的资金
|
| | | TaoBaoWeiQuanDrawBack weiQuanDrawBack = null;
|
| | | for (TaoBaoWeiQuanOrder weiQuanOrder : list) {
|
| | | TaoBaoWeiQuanDrawBack weiQuanDrawBack = taoBaoWeiQuanDrawBackMapper
|
| | | .selectByOrderItemIdAndUid(weiQuanOrder.getOrderItemId(), uid);
|
| | | weiQuanDrawBack = taoBaoWeiQuanDrawBackMapper.selectByOrderItemIdAndUid(weiQuanOrder.getOrderItemId(),
|
| | | uid);
|
| | | if (weiQuanDrawBack != null)
|
| | | continue;
|
| | | // 退款的资金
|
| | |
| | | AccountDetails accountDetails = AccountDetailsFactory.create("-" + drawBackMoney,
|
| | | AccountDetailsFactory.SHARE_GOODS_DRAWBACK, null, null, new UserInfo(uid));
|
| | | accountDetailsMapper.insertSelective(accountDetails);
|
| | | // 新版资金记录
|
| | | try {
|
| | | UserMoneyDetail userMoneyDetail = UserMoneyDetailFactory.createShareWeiQuan(uid, weiQuanDrawBack,
|
| | | drawBackMoney);
|
| | | userMoneyDetail.setId(accountDetails.getId());
|
| | | userMoneyDetailMapper.insert(userMoneyDetail);
|
| | | } catch (UserMoneyDetailException e) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | } catch (Exception e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | userNotificationService.weiQuanTiCheng(uid, orderId, drawBackMoney);
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Override
|
| | | public void doWeiQuanInvite(String orderId) throws TaoBaoWeiQuanException {
|
| | | if (StringUtil.isNullOrEmpty(orderId))
|
| | | throw new TaoBaoWeiQuanException(1, "订单号为空值");
|
| | | // 查询是否为维权订单
|
| | | List<TaoBaoWeiQuanOrder> list = taoBaoWeiQuanOrderService.getWeiQuanSuccessOrders(orderId);
|
| | | if (list == null || list.size() == 0)
|
| | | return;
|
| | | // 查询订单库
|
| | | List<TaoBaoOrder> orderList = taoBaoOrderMapper.selectTaoBaoOrderByOrderId(orderId);
|
| | | // 计算淘宝联盟返给平台的资金
|
| | | BigDecimal sumFee = new BigDecimal("0");
|
| | | for (TaoBaoOrder order : orderList)
|
| | | if (order.getOrderState().equalsIgnoreCase("订单结算"))
|
| | | sumFee = sumFee.add(order.geteIncome());
|
| | | // 获取和该订单号有关联的用户
|
| | | // 获取主红包(同一个订单号的单只会对应同一个用户)
|
| | | List<HongBao> mainHongBaoList = hongBaoMapper.selectByOrderIdWithoutChild(orderId);
|
| | | if (mainHongBaoList == null || mainHongBaoList.size() == 0)
|
| | | return;
|
| | |
|
| | | // 主用户ID
|
| | | Map<Long, BigDecimal> fanMoneyMap = new HashMap<>();
|
| | |
|
| | | if (mainHongBaoList != null)
|
| | | for (HongBao hongBao : mainHongBaoList) {
|
| | | if (hongBao.getState() == HongBao.STATE_SHIXIAO)
|
| | | continue;
|
| | | // 返利红包不计入
|
| | | if (hongBao.getType() != HongBao.TYPE_TAOBAO) {
|
| | | // 累计主红包的金额
|
| | | if (fanMoneyMap.get(hongBao.getUserInfo().getId()) == null) {
|
| | | fanMoneyMap.put(hongBao.getUserInfo().getId(), hongBao.getMoney());
|
| | | } else
|
| | | fanMoneyMap.put(hongBao.getUserInfo().getId(),
|
| | | fanMoneyMap.get(hongBao.getUserInfo().getId()).add(hongBao.getMoney()));
|
| | | }
|
| | | // 累计子红包的金额
|
| | | List<HongBao> childHongBaoList = hongBaoMapper.selectChildHongBaoByPid(hongBao.getId());
|
| | | if (childHongBaoList != null)
|
| | | for (HongBao child : childHongBaoList) {
|
| | | if (child.getState() == HongBao.STATE_SHIXIAO)
|
| | | continue;
|
| | | if (fanMoneyMap.get(child.getUserInfo().getId()) == null) {
|
| | | fanMoneyMap.put(child.getUserInfo().getId(), child.getMoney());
|
| | | } else
|
| | | fanMoneyMap.put(child.getUserInfo().getId(),
|
| | | fanMoneyMap.get(child.getUserInfo().getId()).add(child.getMoney()));
|
| | | }
|
| | | }
|
| | |
|
| | | // 计算每个用户的返利比例
|
| | | Iterator<Long> its = fanMoneyMap.keySet().iterator();
|
| | | while (its.hasNext()) {
|
| | | Long uid = its.next();
|
| | | BigDecimal userGetMoney = fanMoneyMap.get(uid);
|
| | | BigDecimal fanMoney = new BigDecimal("0");
|
| | | // 统计用户在这个单中需要扣除的资金
|
| | | TaoBaoWeiQuanDrawBack weiQuanDrawBack = null;
|
| | | for (TaoBaoWeiQuanOrder weiQuanOrder : list) {
|
| | | weiQuanDrawBack = taoBaoWeiQuanDrawBackMapper.selectByOrderItemIdAndUid(weiQuanOrder.getOrderItemId(),
|
| | | uid);
|
| | | if (weiQuanDrawBack != null)
|
| | | continue;
|
| | | // 退款的资金
|
| | | fanMoney = fanMoney.add(weiQuanOrder.getFanMoney());
|
| | | // 插入记录
|
| | | weiQuanDrawBack = new TaoBaoWeiQuanDrawBack();
|
| | | weiQuanDrawBack.setCreateTime(new Date());
|
| | | // TODO 暂时设为0
|
| | | weiQuanDrawBack.setDrawBackMoney(new BigDecimal(0));
|
| | | weiQuanDrawBack.setOrderId(weiQuanOrder.getOrderId());
|
| | | weiQuanDrawBack.setOrderItemId(weiQuanOrder.getOrderItemId());
|
| | | weiQuanDrawBack.setUser(new UserInfo(uid));
|
| | | taoBaoWeiQuanDrawBackMapper.insertSelective(weiQuanDrawBack);
|
| | | }
|
| | |
|
| | | if (fanMoney.compareTo(new BigDecimal("0")) <= 0)
|
| | | continue;
|
| | |
|
| | | // 退款金额
|
| | | BigDecimal drawBackMoney = MoneyBigDecimalUtil.div(userGetMoney.multiply(fanMoney), sumFee);
|
| | | userInfoMapper.subHongBaoByUid(uid, drawBackMoney);
|
| | | // 添加资金记录
|
| | | AccountDetails accountDetails = AccountDetailsFactory.create("-" + drawBackMoney,
|
| | | AccountDetailsFactory.SHARE_GOODS_DRAWBACK, null, null, new UserInfo(uid));
|
| | | accountDetailsMapper.insertSelective(accountDetails);
|
| | |
|
| | | // 新版资金记录
|
| | | try {
|
| | | UserMoneyDetail userMoneyDetail = UserMoneyDetailFactory.createInviteWeiQuan(uid, weiQuanDrawBack,
|
| | | drawBackMoney);
|
| | | userMoneyDetail.setId(accountDetails.getId());
|
| | | userMoneyDetailMapper.insert(userMoneyDetail);
|
| | | } catch (UserMoneyDetailException e) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | } catch (Exception e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | //
|
| | |
|
| | | userNotificationService.weiQuanTiCheng(uid, orderId, drawBackMoney);
|
| | | }
|
| | |
| | | package com.yeshi.fanli.service.impl.user;
|
| | |
|
| | | import java.io.Serializable;
|
| | | import java.math.BigDecimal;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
| | | import com.yeshi.fanli.dao.mybatis.AccountDetailsMapper;
|
| | | import com.yeshi.fanli.dao.user.AccountDetailsDao;
|
| | | import com.yeshi.fanli.entity.bus.user.AccountDetails;
|
| | | import com.yeshi.fanli.entity.money.UserMoneyDetail;
|
| | | import com.yeshi.fanli.exception.money.UserMoneyDetailException;
|
| | | import com.yeshi.fanli.service.inter.user.AccountDetailsService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.factory.AccountDetailsFactory;
|
| | | import com.yeshi.fanli.util.factory.UserMoneyDetailFactory;
|
| | |
|
| | | @Service
|
| | | public class AccountDetailsServiceImpl implements AccountDetailsService {
|
| | |
| | | return accountDetailsMapper.selectCountByUidWithState(uid);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public UserMoneyDetail convert(AccountDetails accountDetail) {
|
| | | UserMoneyDetail userMoneyDetail = null;
|
| | | switch (accountDetail.getType()) {
|
| | | case AccountDetailsFactory.FANLI:
|
| | | try {
|
| | | userMoneyDetail = UserMoneyDetailFactory.createOldFanLi(accountDetail.getUserInfo().getId(),
|
| | | accountDetail, new BigDecimal(accountDetail.getMoney().replace("+", "")));
|
| | | } catch (UserMoneyDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | break;
|
| | | case AccountDetailsFactory.HUIKUAN:
|
| | | try {
|
| | | userMoneyDetail = UserMoneyDetailFactory.createExtractReject(accountDetail.getExtract());
|
| | |
|
| | | } catch (UserMoneyDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | break;
|
| | | case AccountDetailsFactory.QITA:// 暂无数据
|
| | | break;
|
| | | case AccountDetailsFactory.SHARE_GOODS:// 暂无数据
|
| | | break;
|
| | | case AccountDetailsFactory.SHARE_GOODS_DRAWBACK:
|
| | | // 售后退款
|
| | | try {
|
| | | userMoneyDetail = UserMoneyDetailFactory.createOldWeiQuan(accountDetail);
|
| | |
|
| | | } catch (UserMoneyDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | break;
|
| | | case AccountDetailsFactory.TICHENG:
|
| | | try {
|
| | | userMoneyDetail = UserMoneyDetailFactory.createShareAndInvite(accountDetail);
|
| | |
|
| | | } catch (UserMoneyDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | break;
|
| | | case AccountDetailsFactory.TIXIAN:
|
| | | try {
|
| | | userMoneyDetail = UserMoneyDetailFactory.createExtract(accountDetail.getExtract());
|
| | |
|
| | | } catch (UserMoneyDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | break;
|
| | | case AccountDetailsFactory.TUIKUAN:
|
| | | if (accountDetail.getTitle().contains("账号合并")) {
|
| | | try {
|
| | | userMoneyDetail = UserMoneyDetailFactory.createOldNewerHongBaoDeduct(accountDetail);
|
| | |
|
| | | } catch (UserMoneyDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | } else {// 售后退款
|
| | | try {
|
| | | userMoneyDetail = UserMoneyDetailFactory.createOldWeiQuan(accountDetail);
|
| | |
|
| | | } catch (UserMoneyDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | break;
|
| | | case AccountDetailsFactory.VALID_ALIPAY_ACCOUNT:
|
| | | try {
|
| | | userMoneyDetail = UserMoneyDetailFactory.createOldExtractAccountValid(accountDetail);
|
| | | } catch (UserMoneyDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | break;
|
| | | case AccountDetailsFactory.XINREN:
|
| | | try {
|
| | | userMoneyDetail = UserMoneyDetailFactory.createOldNewerHongBao(accountDetail);
|
| | | } catch (UserMoneyDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | break;
|
| | | }
|
| | |
|
| | | if (userMoneyDetail != null) {
|
| | | userMoneyDetail.setCreateTime(
|
| | | new Date(TimeUtil.convertToTimeTemp(accountDetail.getCreateTime(), "yyyy-MM-dd HH:mm:ss")));
|
| | | userMoneyDetail.setUpdateTime(userMoneyDetail.getCreateTime());
|
| | | userMoneyDetail.setId(accountDetail.getId());
|
| | | }
|
| | | return userMoneyDetail;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | import com.yeshi.fanli.dao.mybatis.AlipayAccountValidNormalHistoryMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.BindingAccountMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.UserInfoMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.money.UserMoneyDetailMapper;
|
| | | import com.yeshi.fanli.dao.user.BindingAccountDao;
|
| | | import com.yeshi.fanli.entity.bus.user.AccountDetails;
|
| | | import com.yeshi.fanli.entity.bus.user.AlipayAccountValidNormalHistory;
|
| | | import com.yeshi.fanli.entity.bus.user.BindingAccount;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.money.UserMoneyDetail;
|
| | | import com.yeshi.fanli.exception.AlipayAccountException;
|
| | | import com.yeshi.fanli.exception.AlipayTransferException;
|
| | | import com.yeshi.fanli.exception.BindingAccountException;
|
| | | import com.yeshi.fanli.exception.money.UserMoneyDetailException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.user.BindingAccountService;
|
| | | import com.yeshi.fanli.service.inter.user.UserNotificationService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.factory.AccountDetailsFactory;
|
| | | import com.yeshi.fanli.util.factory.UserMoneyDetailFactory;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | |
| | | private AccountDetailsMapper accountDetailsMapper;
|
| | | @Resource
|
| | | private UserNotificationService userNotificationService;
|
| | | |
| | | @Resource
|
| | | private UserMoneyDetailMapper userMoneyDetailMapper;
|
| | |
|
| | | public List<BindingAccount> getBindingAccountByUid(long uid) {
|
| | | return bindingAccountDao.list("from BindingAccount ba where ba.userInfo.id=?", new Serializable[] { uid });
|
| | |
| | | AccountDetails accountDetails = AccountDetailsFactory.create("-" + money.toString(),
|
| | | AccountDetailsFactory.VALID_ALIPAY_ACCOUNT, null, null, new UserInfo(uid));
|
| | | accountDetailsMapper.insertSelective(accountDetails);
|
| | | // 新版资金
|
| | | try {
|
| | | UserMoneyDetail userMoneyDetail = UserMoneyDetailFactory.createExtractAccountValid(history, money);
|
| | | userMoneyDetail.setId(accountDetails.getId());
|
| | | userMoneyDetailMapper.insert(userMoneyDetail);
|
| | | } catch (UserMoneyDetailException e) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | } catch (Exception e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | userNotificationService.alipayAccountValidRight(uid, money, account);
|
| | |
|
| | | }
|
| | |
| | | import com.yeshi.fanli.dao.mybatis.SystemMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.UserInfoMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.hongbao.HongBaoMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.money.UserMoneyDetailMapper;
|
| | | import com.yeshi.fanli.dao.user.AccountDetailsDao;
|
| | | import com.yeshi.fanli.dao.user.AccountMessageDao;
|
| | | import com.yeshi.fanli.dao.user.ExtractDao;
|
| | |
| | | import com.yeshi.fanli.entity.bus.user.PayInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.common.AdminUser;
|
| | | import com.yeshi.fanli.entity.money.UserMoneyDetail;
|
| | | import com.yeshi.fanli.exception.ExtractException;
|
| | | import com.yeshi.fanli.exception.NotExistObjectException;
|
| | | import com.yeshi.fanli.exception.ObjectStateException;
|
| | | import com.yeshi.fanli.exception.money.UserMoneyDetailException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.config.SystemConfigService;
|
| | | import com.yeshi.fanli.service.inter.hongbao.HongBaoService;
|
| | | import com.yeshi.fanli.service.inter.push.PushService;
|
| | | import com.yeshi.fanli.service.inter.user.AccountDetailsService;
|
| | | import com.yeshi.fanli.service.inter.user.AccountMessageService;
|
| | |
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.factory.AccountDetailsFactory;
|
| | | import com.yeshi.fanli.util.factory.UserMoneyDetailFactory;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | |
| | |
|
| | | @Resource
|
| | | private UserNotificationService userNotificationService;
|
| | | |
| | | @Resource
|
| | | private UserMoneyDetailMapper userMoneyDetailMapper;
|
| | |
|
| | | @Resource
|
| | | private AlipayAccountValidNormalHistoryMapper alipayAccountValidNormalHistoryMapper;
|
| | |
| | | AccountDetails ad = AccountDetailsFactory.create("+" + find.getMoney(), AccountDetailsFactory.HUIKUAN, null,
|
| | | find, find.getUserInfo());
|
| | | accountDetailsMapper.insertSelective(ad);
|
| | | // 新版资金详情
|
| | | try {
|
| | | UserMoneyDetail userMoneyDetail = UserMoneyDetailFactory.createExtractReject(find);
|
| | | userMoneyDetail.setId(ad.getId());
|
| | | userMoneyDetailMapper.insert(userMoneyDetail);
|
| | | } catch (UserMoneyDetailException e2) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e2);
|
| | | } catch (Exception e3) {
|
| | | e3.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | try {
|
| | | userNotificationService.extractWrong(user.getId(), find,
|
| | | TimeUtil.getGernalTime(find.getExtractTime(), "yyyy-MM-dd HH:mm"));
|
| | |
| | | AccountDetails ad = AccountDetailsFactory.create("-" + extract.getMoney(), AccountDetailsFactory.TIXIAN, null,
|
| | | extract, user);
|
| | | accountDetailsMapper.insertSelective(ad);
|
| | | |
| | | // 新版资金详情
|
| | | try {
|
| | | UserMoneyDetail userMoneyDetail = UserMoneyDetailFactory.createExtract(extract);
|
| | | userMoneyDetail.setId(ad.getId());
|
| | | userMoneyDetailMapper.insert(userMoneyDetail);
|
| | | } catch (UserMoneyDetailException e2) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e2);
|
| | | } catch (Exception e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | userNotificationService.extractApply(extract.getUserInfo().getId());
|
| | |
|
| | |
| | | null, extract, extract.getUserInfo());
|
| | | accountDetailsMapper.insertSelective(ad);
|
| | |
|
| | | // 新版资金详情
|
| | | try {
|
| | | UserMoneyDetail userMoneyDetail = UserMoneyDetailFactory.createExtractReject(extract);
|
| | | userMoneyDetail.setId(ad.getId());
|
| | | userMoneyDetailMapper.insert(userMoneyDetail);
|
| | | } catch (UserMoneyDetailException e2) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e2);
|
| | | } catch (Exception e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | |
| | |
|
| | | try {
|
| | |
|
| | | userNotificationService.extractTransferFail(user.getId(),
|
New file |
| | |
| | | package com.yeshi.fanli.service.impl.user;
|
| | |
|
| | | import java.util.ArrayList;
|
| | | import java.util.Calendar;
|
| | | import java.util.Date;
|
| | | import java.util.HashSet;
|
| | | import java.util.Iterator;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | | import java.util.Set;
|
| | | import java.util.TreeMap;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.money.UserMoneyDetailMapper;
|
| | | import com.yeshi.fanli.entity.money.UserMoneyDetail;
|
| | | import com.yeshi.fanli.service.inter.user.UserMoneyDetailService;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.vo.money.UserMoneyDetailHistoryVO;
|
| | | import com.yeshi.fanli.vo.money.UserMonthMoneyVO;
|
| | |
|
| | | @Service
|
| | | public class UserMoneyDetailServiceImpl implements UserMoneyDetailService {
|
| | |
|
| | | @Resource
|
| | | private UserMoneyDetailMapper userMoneyDetailMapper;
|
| | |
|
| | | @Override
|
| | | public List<UserMoneyDetailHistoryVO> listUserMoneyDetailForClient(Long uid, Long userMoneyDetailId, Date maxTime) {
|
| | | List<UserMoneyDetailHistoryVO> finalList = new ArrayList<>();
|
| | | List<UserMoneyDetail> list = null;
|
| | | if (userMoneyDetailId == null) {// 首次请求
|
| | | if (maxTime == null)// 没有筛选时间
|
| | | {
|
| | | list = userMoneyDetailMapper.selectByMaxCreateTime(uid,
|
| | | new Date(System.currentTimeMillis() + 1000 * 60 * 60L), 20);
|
| | | } else {// 筛选了时间
|
| | | list = userMoneyDetailMapper.selectByMaxCreateTime(uid, maxTime, 20);
|
| | | }
|
| | | if (list != null && list.size() > 0) {
|
| | | Calendar calendar = Calendar.getInstance();
|
| | | calendar.setTimeInMillis(list.get(0).getCreateTime().getTime());
|
| | | UserMoneyDetailHistoryVO vo = new UserMoneyDetailHistoryVO();
|
| | | vo.setMonth(new UserMonthMoneyVO(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH)+1));
|
| | | finalList.add(vo);
|
| | | }
|
| | | } else {// 二次请求
|
| | |
|
| | | int size = 21;
|
| | | List<UserMoneyDetail> tempList = userMoneyDetailMapper.selectByUidWithIndexId(uid, userMoneyDetailId, size);
|
| | | Set<Date> dateSet = new HashSet<>();// 用于储存是否在同一时间上面(精确到秒)
|
| | | if (tempList.size() > 0) {
|
| | | for (UserMoneyDetail umd : tempList) {
|
| | | dateSet.add(umd.getCreateTime());
|
| | | }
|
| | |
|
| | | List<UserMoneyDetail> tempList2 = new ArrayList<>();
|
| | | while (dateSet.size() == 1 && tempList2.size() != tempList.size() && size < 40) {// 只有一个时间点的数据
|
| | | tempList = tempList2;
|
| | | size += 10;
|
| | | tempList2 = userMoneyDetailMapper.selectByUidWithIndexId(uid, userMoneyDetailId, size);
|
| | | dateSet.clear();
|
| | | for (UserMoneyDetail umd : tempList2) {
|
| | | dateSet.add(umd.getCreateTime());
|
| | | }
|
| | | }
|
| | | if (tempList2.size() > 0)
|
| | | tempList = tempList2;
|
| | | }
|
| | |
|
| | | for (int i = 0; i < tempList.size(); i++) {
|
| | | if (tempList.get(i).getId().longValue() == userMoneyDetailId) {
|
| | | tempList.remove(i);
|
| | | break;
|
| | | } else {
|
| | | tempList.remove(i);
|
| | | i--;
|
| | | }
|
| | | }
|
| | | list = tempList;
|
| | | }
|
| | |
|
| | | if (list != null)
|
| | | for (int i = 0; i < list.size(); i++) {
|
| | | if (i > 0 && !TimeUtil.getGernalTime(list.get(i - 1).getCreateTime().getTime(), "yyyy-MM")
|
| | | .equalsIgnoreCase(TimeUtil.getGernalTime(list.get(i).getCreateTime().getTime(), "yyyy-MM"))) {// 本条数据与上条数据不是同一月则插入月份
|
| | | Calendar calendar = Calendar.getInstance();
|
| | | calendar.setTimeInMillis(list.get(i).getCreateTime().getTime());
|
| | | UserMoneyDetailHistoryVO vo = new UserMoneyDetailHistoryVO();
|
| | | vo.setMonth(new UserMonthMoneyVO(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH)+1));
|
| | | finalList.add(vo);
|
| | | }
|
| | | UserMoneyDetailHistoryVO vo = new UserMoneyDetailHistoryVO();
|
| | | vo.setDetail(list.get(i));
|
| | | finalList.add(vo);
|
| | | }
|
| | |
|
| | | // 统计月资金
|
| | |
|
| | | Map<Integer, UserMoneyDetailHistoryVO> monthMap = new TreeMap<>();
|
| | | if(finalList.size()>1)
|
| | | for (int i = 0; i < finalList.size(); i++) {
|
| | | if (finalList.get(i).getMonth() != null)
|
| | | monthMap.put(i, finalList.get(i));
|
| | | }
|
| | |
|
| | | if (!monthMap.isEmpty()) {
|
| | | List<String> dateFormat = new ArrayList<>();
|
| | | Iterator<Integer> keys = monthMap.keySet().iterator();
|
| | | while (keys.hasNext()) {
|
| | | Integer key = keys.next();
|
| | | String date = "";
|
| | | date += monthMap.get(key).getMonth().getYear();
|
| | | date += "-";
|
| | | date += (monthMap.get(key).getMonth().getMonth() + "").length() < 2
|
| | | ? "0" + monthMap.get(key).getMonth().getMonth() : monthMap.get(key).getMonth().getMonth();
|
| | | dateFormat.add(date);
|
| | | }
|
| | | List<UserMonthMoneyVO> voList = userMoneyDetailMapper.selectMonthMoneyByUid(uid, dateFormat);
|
| | |
|
| | | int p = 0;
|
| | | keys = monthMap.keySet().iterator();
|
| | | while (keys.hasNext()) {
|
| | | Integer key = keys.next();
|
| | | finalList.get(key).getMonth().setExpend(voList.get(p).getExpend());
|
| | | finalList.get(key).getMonth().setIncome(voList.get(p).getIncome());
|
| | | p++;
|
| | | }
|
| | | }
|
| | | return finalList;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public long countUserMoneyDetailForClient(Long uid, Long userMoneyDetailId, Date maxTime) {
|
| | | long monthCount = 0L;
|
| | | long detailCount = 0L;
|
| | | // 未通过时间筛选,查询所有
|
| | | if (maxTime == null) {
|
| | | detailCount = userMoneyDetailMapper.selectCountByUid(uid);
|
| | | // 用于表示当前所有
|
| | | monthCount = userMoneyDetailMapper.selectMonthCountByUid(uid,
|
| | | new Date(System.currentTimeMillis() + 1000 * 60 * 60L));
|
| | | } else {// 通过时间筛选了的,需要查询所有
|
| | | detailCount = userMoneyDetailMapper.selectCountByUidAndMaxCreateTime(uid, maxTime);
|
| | | monthCount = userMoneyDetailMapper.selectMonthCountByUid(uid, maxTime);
|
| | | }
|
| | |
|
| | | return monthCount + detailCount;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | import com.yeshi.fanli.entity.bus.user.Extract;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.exception.PushException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.push.PushService;
|
| | | import com.yeshi.fanli.service.inter.user.SMSService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.UserNotificationService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | | @Service
|
| | | public class UserNotificationServiceImpl implements UserNotificationService {
|
| | |
| | |
|
| | | @Override
|
| | | public void newerHongBao(Long uid, BigDecimal money) {
|
| | | if(Constant.IS_TEST)
|
| | | return;
|
| | | try {
|
| | | pushService.pushZNX(uid, Constant.znxConfig.getNewerHongbaoTitle(),
|
| | | Constant.znxConfig.getNewerHongbaoMsg().replace("[金额]", money.toString()));
|
| | |
| | |
|
| | | @Override
|
| | | public void orderFanliRecieved(Long uid, String orderId, BigDecimal money) {
|
| | | if(Constant.IS_TEST)
|
| | | return;
|
| | | try {
|
| | | pushService.pushZNX(uid, Constant.znxConfig.getOrderFanliRecieveTitle(), Constant.znxConfig
|
| | | .getOrderFanliRecieveMsg().replace("[订单号]", orderId).replace("[金额]", money.toString()));
|
| | |
| | |
|
| | | @Override
|
| | | public void tiChengRecieved(Long uid, BigDecimal money) {
|
| | | if(Constant.IS_TEST)
|
| | | return;
|
| | | try {
|
| | | pushService.pushZNX(uid, Constant.znxConfig.getShareInviteMoneyRecieveTitle(),
|
| | | Constant.znxConfig.getShareInviteMoneyRecieveMsg().replace("[金额]", money.toString()));
|
| | | pushService.pushZNX(uid, Constant.znxConfig.getShareMoneyRecieveTitle(),
|
| | | Constant.znxConfig.getShareMoneyRecieveMsg().replace("[金额]", money.toString()));
|
| | | } catch (PushException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | |
|
| | | @Override
|
| | | public void orderFanliStatisticed(Long uid, String orderId) {
|
| | | if(Constant.IS_TEST)
|
| | | return;
|
| | | try {
|
| | | pushService.pushZNX(uid, Constant.znxConfig.getFanliOrderStatisticedTitle(),
|
| | | Constant.znxConfig.getFanliOrderStatisticedMsg().replace("[订单号]", orderId));
|
| | |
| | |
|
| | | @Override
|
| | | public void tiChengStatisticed(Long uid, String orderId, BigDecimal money) {
|
| | | if(Constant.IS_TEST)
|
| | | return;
|
| | | orderId = orderId.substring(0, orderId.length() - 6) + "******";
|
| | | try {
|
| | | pushService.pushZNX(uid, Constant.znxConfig.getTichengOrderStatisticedTitle(), Constant.znxConfig
|
| | |
| | |
|
| | | @Override
|
| | | public void weiQuanFanli(Long uid, String orderId, BigDecimal money) {
|
| | | if(Constant.IS_TEST)
|
| | | return;
|
| | | // 只发送站内信
|
| | | AccountMessage am = new AccountMessage();
|
| | | am.setContent(Constant.znxConfig.getWeiquanDrawbackFanliMsg().replace("[订单号]", orderId).replace("[金额]",
|
| | |
| | |
|
| | | @Override
|
| | | public void weiQuanTiCheng(Long uid, String orderId, BigDecimal money) {
|
| | | if(Constant.IS_TEST)
|
| | | return;
|
| | | orderId = orderId.substring(0, orderId.length() - 6) + "******";
|
| | | AccountMessage am = new AccountMessage();
|
| | | am.setContent(Constant.znxConfig.getWeiquanDrawbackShareMsg().replace("[订单号]", orderId).replace("[金额]",
|
| | |
| | |
|
| | | @Override
|
| | | public void extractApply(Long uid) {
|
| | | if(Constant.IS_TEST)
|
| | | return;
|
| | | try {
|
| | | pushService.pushZNX(uid, Constant.znxConfig.getExtractApplayTitle(),
|
| | | Constant.znxConfig.getExtractApplayMsg());
|
| | |
| | |
|
| | | @Override
|
| | | public void extractTransferFail(Long uid, String time) {
|
| | | if(Constant.IS_TEST)
|
| | | return;
|
| | | try {
|
| | | pushService.pushZNX(uid, Constant.znxConfig.getExtractTransferFailTitle(),
|
| | | Constant.znxConfig.getExtractTransferFailMsg().replace("[时间]", time));
|
| | |
| | |
|
| | | @Override
|
| | | public void extractWrong(Long uid, Extract extract, String time) {
|
| | | if(Constant.IS_TEST)
|
| | | return;
|
| | | // 提现失败短信通知
|
| | | // try {
|
| | | // UserInfo user = userInfoService.getUserById(uid);
|
| | |
| | |
|
| | | @Override
|
| | | public void extractSuccess(Long uid, Extract extract, String time) {
|
| | | if(Constant.IS_TEST)
|
| | | return;
|
| | | // 提现成功短信通知
|
| | | // try {
|
| | | // UserInfo user = userInfoService.getUserById(uid);
|
| | |
| | |
|
| | | @Override
|
| | | public void alipayAccountValidRight(Long uid, BigDecimal money, String account) {
|
| | | if(Constant.IS_TEST)
|
| | | return;
|
| | | BindingAccount ba = new BindingAccount();
|
| | | ba.setAccount(account);
|
| | | ba.setName("**");
|
| | |
| | | accountMessageMapper.insertSelective(am);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void tiChengInviteRecieved(Long uid, BigDecimal money) {
|
| | | if(Constant.IS_TEST)
|
| | | return;
|
| | | try {
|
| | | pushService.pushZNX(uid, Constant.znxConfig.getInviteMoneyRecieveTitle(),
|
| | | Constant.znxConfig.getInviteMoneyRecieveMsg().replace("[金额]", money.toString()));
|
| | | } catch (PushException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void tiChengShareRecieved(Long uid, BigDecimal money) {
|
| | | if(Constant.IS_TEST)
|
| | | return;
|
| | | try {
|
| | | pushService.pushZNX(uid, Constant.znxConfig.getShareMoneyRecieveTitle(),
|
| | | Constant.znxConfig.getShareMoneyRecieveMsg().replace("[金额]", money.toString()));
|
| | | } catch (PushException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | */
|
| | | public void doPidOrder(String orderId);
|
| | |
|
| | | /**
|
| | | * 结算订单,将订单中的余额结算
|
| | | */
|
| | | public void balanceOrder();
|
| | |
|
| | | /**
|
| | | * 按单个订单结算
|
| | | * |
| | | * @param pidOrder
|
| | | */
|
| | | public void balanceOrder(PidOrder pidOrder);
|
| | |
|
| | | /**
|
| | | * 对比分享赚订单与红包
|
| | |
| | | public void doWeiQuanFanli(String orderId) throws TaoBaoWeiQuanException;
|
| | |
|
| | | /**
|
| | | * 处理维权-子订单(分享赚与邀请赚)
|
| | | * 处理维权-子订单(分享赚)
|
| | | *
|
| | | * @param hongBao
|
| | | */
|
| | | public void doWeiQuanShare(String orderId) throws TaoBaoWeiQuanException;
|
| | |
|
| | | /**
|
| | | * 维权处理-子订单(邀请赚)
|
| | | * |
| | | * @param orderId
|
| | | * @throws TaoBaoWeiQuanException
|
| | | */
|
| | | public void doWeiQuanInvite(String orderId) throws TaoBaoWeiQuanException;
|
| | | }
|
| | |
| | | import java.util.List;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.user.AccountDetails;
|
| | | import com.yeshi.fanli.entity.money.UserMoneyDetail;
|
| | |
|
| | | public interface AccountDetailsService {
|
| | |
|
| | |
| | | * @return
|
| | | */
|
| | | int getCount(long uid);
|
| | |
|
| | | /**
|
| | | * 保存
|
| | | *
|
| | |
| | |
|
| | | void save(AccountDetails accountDetails);
|
| | |
|
| | | /**
|
| | | * 详情转换
|
| | | * |
| | | * @param accountDetail
|
| | | * @return
|
| | | */
|
| | | UserMoneyDetail convert(AccountDetails accountDetail);
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.inter.user;
|
| | |
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import com.yeshi.fanli.vo.money.UserMoneyDetailHistoryVO;
|
| | |
|
| | | /**
|
| | | * 用户账目明细记录
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | public interface UserMoneyDetailService {
|
| | |
|
| | | /**
|
| | | * 客户端查询用户的资金记录
|
| | | * |
| | | * @param uid
|
| | | * @param userMoneyDetailId
|
| | | * @param maxTime
|
| | | * @return
|
| | | */
|
| | | public List<UserMoneyDetailHistoryVO> listUserMoneyDetailForClient(Long uid, Long userMoneyDetailId, Date maxTime);
|
| | |
|
| | | /**
|
| | | * 客户端查询用户的资金记录的条数(计算月统计)
|
| | | * |
| | | * @param uid
|
| | | * @param userMoneyDetailId
|
| | | * @param maxTime
|
| | | * @return
|
| | | */
|
| | | public long countUserMoneyDetailForClient(Long uid, Long userMoneyDetailId, Date maxTime);
|
| | |
|
| | | }
|
| | |
| | | * @param money
|
| | | */
|
| | | public void tiChengRecieved(Long uid, BigDecimal money);
|
| | | |
| | | |
| | | /**
|
| | | * 邀请提成到账
|
| | | * @param uid
|
| | | * @param money
|
| | | */
|
| | | public void tiChengInviteRecieved(Long uid, BigDecimal money);
|
| | | |
| | | |
| | | /**
|
| | | * 分享提成到账
|
| | | * @param uid
|
| | | * @param money
|
| | | */
|
| | | public void tiChengShareRecieved(Long uid, BigDecimal money);
|
| | |
|
| | |
|
| | | /**
|
| | | * 订单被统计
|
| | |
| | | public static boolean IS_TASK = false;
|
| | |
|
| | | // 外网环境
|
| | | public static boolean IS_OUTNET = true;
|
| | | public static boolean IS_OUTNET = false;
|
| | |
|
| | | public static boolean IS_TEST = false;
|
| | | public static boolean IS_TEST = true;
|
| | |
|
| | | public static int PAGE_SIZE = 20;
|
| | | public static int[] TASK_TYPE = { 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008// 微信任务类型编号
|
| | |
| | | import java.util.Calendar;
|
| | | import java.util.Date;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.user.AccountDetails;
|
| | | import com.yeshi.fanli.entity.bus.user.AlipayAccountValidNormalHistory;
|
| | | import com.yeshi.fanli.entity.bus.user.Extract;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBao;
|
| | |
| | | * @param hongBaoList
|
| | | * @return
|
| | | */
|
| | | public static UserMoneyDetail createFanLi(Long uid, String orderId, BigDecimal money)
|
| | | public static UserMoneyDetail createFanLi(Long uid, String orderId, int orderType,Long hbId, BigDecimal money)
|
| | | throws UserMoneyDetailException {
|
| | |
|
| | | if (StringUtil.isNullOrEmpty(orderId))
|
| | | throw new UserMoneyDetailException(1, "订单号为空");
|
| | |
|
| | | if (money == null)
|
| | | throw new UserMoneyDetailException(1, "返利金额为空");
|
| | |
|
| | |
| | |
|
| | | UserMoneyDetail detail = new UserMoneyDetail();
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setIdentifyCode(StringUtil.Md5(UserMoneyDetailTypeEnum.fanli.name() + ":" + orderId));
|
| | | detail.setIdentifyCode(
|
| | | StringUtil.Md5(UserMoneyDetailTypeEnum.fanli.name() + "-" + uid + "-" + orderType + "-" + orderId+"-"+hbId));
|
| | | detail.setMoney(money);
|
| | | detail.setTitle(UserMoneyDetailTypeEnum.fanli.getDesc());
|
| | | detail.setType(UserMoneyDetailTypeEnum.fanli);
|
| | | detail.setDescInfo("订单号:" + orderId);
|
| | | detail.setUpdateTime(new Date());
|
| | | detail.setUserInfo(new UserInfo(uid));
|
| | | return detail;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 原有返利数据同步
|
| | | * |
| | | * @param uid
|
| | | * @param orderId
|
| | | * @param orderType
|
| | | * @param money
|
| | | * @return
|
| | | * @throws UserMoneyDetailException
|
| | | */
|
| | | public static UserMoneyDetail createOldFanLi(Long uid, AccountDetails accountDetails, BigDecimal money)
|
| | | throws UserMoneyDetailException {
|
| | | int orderType = 1;
|
| | | String orderId = null;
|
| | | if (accountDetails.getOrderItem() == null)
|
| | | orderId = accountDetails.getId() + "";
|
| | | else
|
| | | orderId = accountDetails.getId() + "-" + accountDetails.getOrderItem().getOrderId();
|
| | |
|
| | | if (money == null)
|
| | | throw new UserMoneyDetailException(1, "返利金额为空");
|
| | |
|
| | | if (uid == null)
|
| | | throw new UserMoneyDetailException(1, "UID为空");
|
| | |
|
| | | UserMoneyDetail detail = new UserMoneyDetail();
|
| | | detail.setCreateTime(
|
| | | new Date(TimeUtil.convertToTimeTemp(accountDetails.getCreateTime(), "yyyy-MM-dd HH:mm:ss")));
|
| | | detail.setIdentifyCode(
|
| | | StringUtil.Md5(UserMoneyDetailTypeEnum.fanli.name() + "-" + uid + "-" + orderType + "-" + orderId));
|
| | | detail.setMoney(money);
|
| | | detail.setTitle(UserMoneyDetailTypeEnum.fanli.getDesc());
|
| | | detail.setType(UserMoneyDetailTypeEnum.fanli);
|
| | | if (accountDetails.getOrderItem() != null)
|
| | | detail.setDescInfo("订单号:" + accountDetails.getOrderItem().getOrderId());
|
| | | detail.setUpdateTime(new Date());
|
| | | detail.setUserInfo(new UserInfo(uid));
|
| | | return detail;
|
| | |
| | | detail.setMoney(money);
|
| | | detail.setTitle(timeF + UserMoneyDetailTypeEnum.invite.getDesc());
|
| | | detail.setType(UserMoneyDetailTypeEnum.invite);
|
| | | if (validCount != 0 || weiQuanCount != 0 || invalidCount != 0)
|
| | | detail.setDescInfo(String.format("有效订单:%s笔 维权订单:%s笔 失效订单:%s笔", validCount, weiQuanCount, invalidCount));
|
| | | detail.setUpdateTime(new Date());
|
| | | detail.setUserInfo(new UserInfo(uid));
|
| | | return detail;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 老版本的分享和邀请赚到账记录
|
| | | * |
| | | * @param uid
|
| | | * @param money
|
| | | * @param time
|
| | | * @return
|
| | | * @throws UserMoneyDetailException
|
| | | */
|
| | | public static UserMoneyDetail createShareAndInvite(AccountDetails accountDetail) throws UserMoneyDetailException {
|
| | | if (accountDetail.getMoney() == null)
|
| | | throw new UserMoneyDetailException(1, "返利金额为空");
|
| | |
|
| | | if (accountDetail.getUserInfo() == null)
|
| | | throw new UserMoneyDetailException(1, "UID为空");
|
| | |
|
| | | if (accountDetail.getCreateTime() == null)
|
| | | throw new UserMoneyDetailException(1, "发生时间为空");
|
| | |
|
| | | Date time = new Date(TimeUtil.convertToTimeTemp(accountDetail.getCreateTime(), "yyyy-MM-dd HH:mm:ss"));
|
| | |
|
| | | Calendar ca = Calendar.getInstance();
|
| | | ca.setTime(time);
|
| | | ca.add(Calendar.MONTH, -1);
|
| | |
|
| | | String timeF = TimeUtil.getGernalTime(ca.getTimeInMillis(), "yyyy年MM月");
|
| | |
|
| | | UserMoneyDetail detail = new UserMoneyDetail();
|
| | | detail.setCreateTime(
|
| | | new Date(TimeUtil.convertToTimeTemp(accountDetail.getCreateTime(), "yyyy-MM-dd HH:mm:ss")));
|
| | | detail.setIdentifyCode(StringUtil.Md5(UserMoneyDetailTypeEnum.inviteAndShare.name() + "-"
|
| | | + accountDetail.getUserInfo().getId() + "-" + accountDetail.getId()));
|
| | | detail.setMoney(new BigDecimal(accountDetail.getMoney()));
|
| | | detail.setTitle(timeF + UserMoneyDetailTypeEnum.inviteAndShare.getDesc());
|
| | | detail.setType(UserMoneyDetailTypeEnum.inviteAndShare);
|
| | | detail.setUpdateTime(new Date());
|
| | | detail.setUserInfo(accountDetail.getUserInfo());
|
| | | return detail;
|
| | | }
|
| | |
|
| | |
| | |
|
| | | UserMoneyDetail detail = new UserMoneyDetail();
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setIdentifyCode(StringUtil.Md5(UserMoneyDetailTypeEnum.hongbao.name() + ":" + hb.getId()));
|
| | | detail.setIdentifyCode(
|
| | | StringUtil.Md5(UserMoneyDetailTypeEnum.hongbao.name() + "-" + subTitle + "-" + hb.getId()));
|
| | | detail.setMoney(hb.getMoney());
|
| | | detail.setSourceIdentifyId(hb.getId());
|
| | | detail.setTitle(UserMoneyDetailTypeEnum.hongbao.getDesc());
|
| | | detail.setSubTitle(subTitle);
|
| | | detail.setType(UserMoneyDetailTypeEnum.hongbao);
|
| | | detail.setUpdateTime(new Date());
|
| | | detail.setUserInfo(hb.getUserInfo());
|
| | | return detail;
|
| | | }
|
| | |
|
| | | private static UserMoneyDetail createHongBaoDeduct(HongBao hb, String subTitle) throws UserMoneyDetailException {
|
| | | if (hb == null)
|
| | | throw new UserMoneyDetailException(1, "红包不能为空");
|
| | | if (hb.getUserInfo() == null)
|
| | | throw new UserMoneyDetailException(1, "用户不能为空");
|
| | |
|
| | | UserMoneyDetail detail = new UserMoneyDetail();
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setIdentifyCode(StringUtil.Md5(UserMoneyDetailTypeEnum.hongbaoDeduct.name() + "-" + subTitle + "-"
|
| | | + hb.getBeizhu() + "-" + hb.getId()));
|
| | | detail.setMoney(hb.getMoney());
|
| | | detail.setSourceIdentifyId(hb.getId());
|
| | | detail.setTitle(UserMoneyDetailTypeEnum.hongbaoDeduct.getDesc());
|
| | | detail.setSubTitle(subTitle);
|
| | | detail.setType(UserMoneyDetailTypeEnum.hongbaoDeduct);
|
| | | detail.setUpdateTime(new Date());
|
| | | detail.setUserInfo(hb.getUserInfo());
|
| | | return detail;
|
| | |
| | |
|
| | | /**
|
| | | * 新人红包扣除
|
| | | * |
| | | * @param hb
|
| | | * @return
|
| | | * @throws UserMoneyDetailException
|
| | | */
|
| | |
|
| | | public static UserMoneyDetail createNewerHongBaoDeduct(HongBao hb) throws UserMoneyDetailException {
|
| | | return createHongBao(hb, "新人红包扣除");
|
| | | return createHongBaoDeduct(hb, "新人红包扣除");
|
| | | }
|
| | |
|
| | | /**
|
| | | * 老版本的新人红包退款
|
| | | * |
| | | * @param hb
|
| | | * @return
|
| | | * @throws UserMoneyDetailException
|
| | | */
|
| | | public static UserMoneyDetail createOldNewerHongBaoDeduct(AccountDetails accountDetails)
|
| | | throws UserMoneyDetailException {
|
| | | HongBao hb = new HongBao();
|
| | | hb.setId(accountDetails.getId());
|
| | | hb.setBeizhu("老版本");
|
| | | hb.setMoney(new BigDecimal(accountDetails.getMoney()));
|
| | | hb.setUserInfo(accountDetails.getUserInfo());
|
| | | UserMoneyDetail userMoneyDetail = createHongBaoDeduct(hb, "新人红包扣除");
|
| | | userMoneyDetail.setId(accountDetails.getId());
|
| | | return userMoneyDetail;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 老版本售后订单扣款
|
| | | * |
| | | * @param accountDetails
|
| | | * @return
|
| | | * @throws UserMoneyDetailException
|
| | | */
|
| | | public static UserMoneyDetail createOldWeiQuan(AccountDetails accountDetails) throws UserMoneyDetailException {
|
| | | if (accountDetails == null)
|
| | | throw new UserMoneyDetailException(1, "详情不能为空");
|
| | | if (accountDetails.getUserInfo() == null)
|
| | | throw new UserMoneyDetailException(1, "用户不能为空");
|
| | |
|
| | | UserMoneyDetail detail = new UserMoneyDetail();
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setIdentifyCode(StringUtil.Md5(UserMoneyDetailTypeEnum.weiQuan.name() + "-" + accountDetails.getId()));
|
| | | detail.setMoney(new BigDecimal(accountDetails.getMoney()));
|
| | | detail.setTitle(UserMoneyDetailTypeEnum.weiQuan.getDesc());
|
| | | detail.setType(UserMoneyDetailTypeEnum.weiQuan);
|
| | | detail.setUpdateTime(new Date());
|
| | | detail.setUserInfo(accountDetails.getUserInfo());
|
| | | detail.setId(accountDetails.getId());
|
| | | return detail;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 新人红包
|
| | | * |
| | | * @param accountDetails
|
| | | * @return
|
| | | * @throws UserMoneyDetailException
|
| | | */
|
| | |
|
| | | public static UserMoneyDetail createOldNewerHongBao(AccountDetails accountDetails) throws UserMoneyDetailException {
|
| | |
|
| | | if (accountDetails == null)
|
| | | throw new UserMoneyDetailException(1, "详情不能为空");
|
| | | if (accountDetails.getUserInfo() == null)
|
| | | throw new UserMoneyDetailException(1, "用户不能为空");
|
| | |
|
| | | UserMoneyDetail detail = new UserMoneyDetail();
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setIdentifyCode(StringUtil
|
| | | .Md5(UserMoneyDetailTypeEnum.hongbao.name() + "-" + "老版本新人红包" + "-" + accountDetails.getId()));
|
| | | detail.setMoney(new BigDecimal(accountDetails.getMoney()));
|
| | | detail.setTitle(UserMoneyDetailTypeEnum.hongbao.getDesc());
|
| | | detail.setSubTitle("新人红包");
|
| | | detail.setType(UserMoneyDetailTypeEnum.hongbao);
|
| | | detail.setUpdateTime(new Date());
|
| | | detail.setUserInfo(accountDetails.getUserInfo());
|
| | | detail.setId(accountDetails.getId());
|
| | | return detail;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 老版本提现账号验证
|
| | | * |
| | | * @param accountDetails
|
| | | * @return
|
| | | * @throws UserMoneyDetailException
|
| | | */
|
| | | public static UserMoneyDetail createOldExtractAccountValid(AccountDetails accountDetails)
|
| | | throws UserMoneyDetailException {
|
| | |
|
| | | if (accountDetails == null)
|
| | | throw new UserMoneyDetailException(1, "验证记录不能为空");
|
| | | if (accountDetails.getUserInfo() == null)
|
| | | throw new UserMoneyDetailException(1, "UID不能为空");
|
| | | if (accountDetails.getMoney() == null)
|
| | | throw new UserMoneyDetailException(1, "金额不能为空");
|
| | |
|
| | | UserMoneyDetail detail = new UserMoneyDetail();
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setIdentifyCode(StringUtil
|
| | | .Md5(UserMoneyDetailTypeEnum.extractVerify.name() + "-" + "老版本" + "-" + accountDetails.getId()));
|
| | | detail.setMoney(new BigDecimal(accountDetails.getMoney()));
|
| | | detail.setTitle(UserMoneyDetailTypeEnum.extractVerify.getDesc());
|
| | | detail.setType(UserMoneyDetailTypeEnum.extractVerify);
|
| | | detail.setUpdateTime(new Date());
|
| | | detail.setUserInfo(accountDetails.getUserInfo());
|
| | | detail.setId(accountDetails.getId());
|
| | | return detail;
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.util.mybatishandler;
|
| | |
|
| | | import java.sql.CallableStatement;
|
| | | import java.sql.PreparedStatement;
|
| | | import java.sql.ResultSet;
|
| | | import java.sql.SQLException;
|
| | |
|
| | | import org.apache.ibatis.type.BaseTypeHandler;
|
| | | import org.apache.ibatis.type.JdbcType;
|
| | |
|
| | | import com.yeshi.fanli.entity.money.UserMoneyDetail.UserMoneyDetailTypeEnum;
|
| | |
|
| | |
|
| | | public class UserMoneyDetailTypeEnumHandler extends BaseTypeHandler<UserMoneyDetailTypeEnum> {
|
| | |
|
| | | @Override
|
| | | public UserMoneyDetailTypeEnum getNullableResult(ResultSet arg0, String arg1) throws SQLException {
|
| | | String key = arg0.getString(arg1);
|
| | | if (arg0.wasNull()) {
|
| | | return null;
|
| | | } else {
|
| | | return UserMoneyDetailTypeEnum.valueOf(key);
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public UserMoneyDetailTypeEnum getNullableResult(ResultSet arg0, int arg1) throws SQLException {
|
| | | String key = arg0.getString(arg1);
|
| | | if (arg0.wasNull()) {
|
| | | return null;
|
| | | } else {
|
| | | // 根据数据库中的key值,定位SexEnum子类
|
| | | return UserMoneyDetailTypeEnum.valueOf(key);
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public UserMoneyDetailTypeEnum getNullableResult(CallableStatement arg0, int arg1) throws SQLException {
|
| | | String key = arg0.getString(arg1);
|
| | | if (arg0.wasNull()) {
|
| | | return null;
|
| | | } else {
|
| | | // 根据数据库中的key值,定位SexEnum子类
|
| | | return UserMoneyDetailTypeEnum.valueOf(key);
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void setNonNullParameter(PreparedStatement arg0, int arg1, UserMoneyDetailTypeEnum arg2, JdbcType arg3)
|
| | | throws SQLException {
|
| | | arg0.setString(arg1, arg2.name());
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.vo.money;
|
| | |
|
| | | import com.google.gson.annotations.Expose;
|
| | | import com.yeshi.fanli.entity.money.UserMoneyDetail;
|
| | |
|
| | | public class UserMoneyDetailHistoryVO {
|
| | | @Expose
|
| | | private UserMonthMoneyVO month;
|
| | | @Expose
|
| | | private UserMoneyDetail detail;
|
| | |
|
| | | public UserMonthMoneyVO getMonth() {
|
| | | return month;
|
| | | }
|
| | |
|
| | | public void setMonth(UserMonthMoneyVO month) {
|
| | | this.month = month;
|
| | | }
|
| | |
|
| | | public UserMoneyDetail getDetail() {
|
| | | return detail;
|
| | | }
|
| | |
|
| | | public void setDetail(UserMoneyDetail detail) {
|
| | | this.detail = detail;
|
| | | }
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.vo.money;
|
| | |
|
| | | import com.google.gson.annotations.Expose;
|
| | |
|
| | | public class UserMonthMoneyVO {
|
| | | @Expose
|
| | | private int year;// 年份
|
| | | @Expose
|
| | | private int month;// 月
|
| | | @Expose
|
| | | private String expend;// 支出
|
| | | @Expose
|
| | | private String income;// 收入
|
| | |
|
| | | private String dateFormate;
|
| | |
|
| | | public String getDateFormate() {
|
| | | return dateFormate;
|
| | | }
|
| | |
|
| | | public void setDateFormate(String dateFormate) {
|
| | | this.dateFormate = dateFormate;
|
| | | }
|
| | |
|
| | | public UserMonthMoneyVO(int year, int month) {
|
| | | this.year = year;
|
| | | this.month = month;
|
| | | }
|
| | |
|
| | | public UserMonthMoneyVO() {
|
| | |
|
| | | }
|
| | |
|
| | | public int getYear() {
|
| | | return year;
|
| | | }
|
| | |
|
| | | public void setYear(int year) {
|
| | | this.year = year;
|
| | | }
|
| | |
|
| | | public int getMonth() {
|
| | | return month;
|
| | | }
|
| | |
|
| | | public void setMonth(int month) {
|
| | | this.month = month;
|
| | | }
|
| | |
|
| | | public String getExpend() {
|
| | | return expend;
|
| | | }
|
| | |
|
| | | public void setExpend(String expend) {
|
| | | this.expend = expend;
|
| | | }
|
| | |
|
| | | public String getIncome() {
|
| | | return income;
|
| | | }
|
| | |
|
| | | public void setIncome(String income) {
|
| | | this.income = income;
|
| | | }
|
| | | }
|
| | |
| | | druid.driverClassName=com.mysql.jdbc.Driver
|
| | | #本地测试
|
| | | #druid.url=jdbc:mysql://192.168.1.122:3306/ec_quan
|
| | | #druid.username=root
|
| | | #druid.password=hexiaohui
|
| | | druid.url=jdbc:mysql://192.168.1.122:3306/ec_quan
|
| | | druid.username=root
|
| | | druid.password=hexiaohui
|
| | |
|
| | |
|
| | | #druid.url=jdbc:mysql://192.168.1.253:3306/ec_quan
|
| | |
| | |
|
| | |
|
| | | #外网正式
|
| | | druid.url=jdbc:mysql://172.16.16.17:3306/ec_quan
|
| | | druid.username=root
|
| | | druid.password=Yeshi2016@
|
| | | #druid.url=jdbc:mysql://172.16.16.17:3306/ec_quan
|
| | | #druid.username=root
|
| | | #druid.password=Yeshi2016@
|
| | |
|
| | | #外网本地测试
|
| | | #druid.url=jdbc:mysql://gz-cdb-r13d0yi9.sql.tencentcdb.com:62929/ec_quan
|
| | | #druid.url=jdbc:mysql://gz-cdb-r13d0yi9.sql.tencentcdb.com:62929/ec_quan_test
|
| | | #druid.username=root
|
| | | #druid.password=Yeshi2016@
|
| | |
|
| | |
| | |
|
| | |
|
| | |
|
| | | #分享赚和邀请赚上月收入到账提示
|
| | | share_invite_money_recieve_title=分享奖金和邀请奖金上月收入到账提示
|
| | | share_invite_money_recieve_push=来自你的分享奖金和邀请奖金上月提成收入总计:¥[金额]元已经转入到你的余额中
|
| | | share_invite_money_recieve_msg=来自你的分享奖金和邀请奖金上月提成收入总计:¥[金额]元已经转入到你的余额中
|
| | | #邀请赚上月收入到账提示
|
| | | invite_money_recieve_title=邀请奖金上月收入到账提示
|
| | | invite_money_recieve_push=来自你的邀请奖金上月收入总计:¥[金额]元已经转入到你的余额中
|
| | | invite_money_recieve_msg=来自你的邀请奖金上月收入总计:¥[金额]元已经转入到你的余额中
|
| | |
|
| | |
|
| | | #分享赚上月收入到账提示
|
| | | share_money_recieve_title=分享奖金上月收入到账提示
|
| | | share_money_recieve_push=来自你的分享奖金上月收入总计:¥[金额]元已经转入到你的余额中
|
| | | share_money_recieve_msg=来自你的分享奖金上月收入总计:¥[金额]元已经转入到你的余额中
|
| | |
|
| | |
|
| | |
|
| | | #售后维权订单扣款提示
|
| | | weiquan_drawback_fanli_title=售后维权订单扣款提示
|
| | |
| | | weiquan_drawback_fanli_msg=您有一个【订单号:[订单号]】 的返利订单,淘宝已维权成功退款,其 订单对应的提成 ¥[金额]元,将从你的余额中扣出。因为订单出现退款或售后,淘宝将会扣除相应返利,所以返利券也无法提供返利,非常遗憾。温馨提示:请勿恶意提交售后申请,淘宝会对其做相应的处罚;我们也倡导用户诚信网购。
|
| | |
|
| | |
|
| | | weiquan_drawback_invite_title=售后维权订单扣款提示
|
| | | weiquan_drawback_invite_push=您有一个【订单号:[订单号]】的邀请订单,淘宝已维权成功退款,其 订单对应的返利 ¥[金额]元,将从你的余额中扣出。因为订单出现退款或售后,淘宝将会扣除相应返利,所以返利券也无法提供奖金,非常遗憾。温馨提示:请勿恶意提交售后申请,淘宝会对其做相应的处罚;我们也倡导用户诚信网购。
|
| | | weiquan_drawback_invite_msg=您有一个【订单号:[订单号]】 的邀请订单,淘宝已维权成功退款,其 订单对应的提成 ¥[金额]元,将从你的余额中扣出。因为订单出现退款或售后,淘宝将会扣除相应返利,所以返利券也无法提供奖金,非常遗憾。温馨提示:请勿恶意提交售后申请,淘宝会对其做相应的处罚;我们也倡导用户诚信网购。
|
| | |
|
| | |
|
| | | weiquan_drawback_share_title=售后维权订单扣款提示
|
| | | weiquan_drawback_share_push=您有一个【订单号:[订单号]】的奖金订单,淘宝已维权成功退款,其 订单对应的返利 ¥[金额]元,将从你的余额中扣出。因为订单出现退款或售后,淘宝将会扣除相应返利,所以返利券也无法提供奖金,非常遗憾。温馨提示:请勿恶意提交售后申请,淘宝会对其做相应的处罚;我们也倡导用户诚信网购。
|
| | | weiquan_drawback_share_msg=您有一个【订单号:[订单号]】 的奖金订单,淘宝已维权成功退款,其 订单对应的提成 ¥[金额]元,将从你的余额中扣出。因为订单出现退款或售后,淘宝将会扣除相应返利,所以返利券也无法提供奖金,非常遗憾。温馨提示:请勿恶意提交售后申请,淘宝会对其做相应的处罚;我们也倡导用户诚信网购。
|
| | | weiquan_drawback_share_push=您有一个【订单号:[订单号]】的分享订单,淘宝已维权成功退款,其 订单对应的返利 ¥[金额]元,将从你的余额中扣出。因为订单出现退款或售后,淘宝将会扣除相应返利,所以返利券也无法提供奖金,非常遗憾。温馨提示:请勿恶意提交售后申请,淘宝会对其做相应的处罚;我们也倡导用户诚信网购。
|
| | | weiquan_drawback_share_msg=您有一个【订单号:[订单号]】 的分享订单,淘宝已维权成功退款,其 订单对应的提成 ¥[金额]元,将从你的余额中扣出。因为订单出现退款或售后,淘宝将会扣除相应返利,所以返利券也无法提供奖金,非常遗憾。温馨提示:请勿恶意提交售后申请,淘宝会对其做相应的处罚;我们也倡导用户诚信网购。
|
| | |
|
| | |
|
| | |
|