New file |
| | |
| | | package com.yeshi.fanli.dao.mybatis.user; |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.dao.BaseMapper; |
| | | import com.yeshi.fanli.entity.bus.user.ForbiddenUserIdentifyCode; |
| | | import com.yeshi.fanli.entity.bus.user.ForbiddenUserIdentifyCode.ForbiddenUserIdentifyCodeTypeEnum; |
| | | |
| | | public interface ForbiddenUserIdentifyCodeMapper extends BaseMapper<ForbiddenUserIdentifyCode> { |
| | | |
| | | /** |
| | | * 通过类型与唯一标识获取 |
| | | * |
| | | * @param type |
| | | * @param identifyCode |
| | | * @return |
| | | */ |
| | | List<ForbiddenUserIdentifyCode> listByTypeAndIdentifyCode(@Param("type") ForbiddenUserIdentifyCodeTypeEnum type, |
| | | @Param("identifyCode") String identifyCode); |
| | | |
| | | } |
| | |
| | |
|
| | | @Entity
|
| | | @Table(name = "yeshi_ec_spread_img")
|
| | | @org.yeshi.utils.mybatis.Table("yeshi_ec_spread_img")
|
| | | public class SpreadImg {
|
| | |
|
| | | @Id
|
| | | @GeneratedValue(strategy = GenerationType.AUTO)
|
| | | @Column(name = "si_id")
|
| | | @Expose
|
| | | @org.yeshi.utils.mybatis.Column(name="si_id")
|
| | | private long id;
|
| | |
|
| | | @org.yeshi.utils.mybatis.Column(name="si_url")
|
| | | @Expose
|
| | | @Column(name="si_url")
|
| | | private String url;
|
| | |
|
| | | @org.yeshi.utils.mybatis.Column(name="si_createtime")
|
| | | @Expose
|
| | | @Column(name="si_createtime")
|
| | | private Date createtime;
|
| | |
| | |
|
| | | @Entity
|
| | | @Table(name = "yeshi_ec_spread_user_img")
|
| | | @org.yeshi.utils.mybatis.Table("yeshi_ec_spread_user_img")
|
| | | public class SpreadUserImg {
|
| | |
|
| | | @Id
|
| | | @GeneratedValue(strategy = GenerationType.AUTO)
|
| | | @Column(name = "si_id")
|
| | | @org.yeshi.utils.mybatis.Column(name="si_id")
|
| | | @Expose
|
| | | private long id;
|
| | | private Long id;
|
| | |
|
| | | @org.yeshi.utils.mybatis.Column(name="si_uid")
|
| | | @Column(name = "si_uid")
|
| | | @Expose
|
| | | private Long uid;
|
| | |
|
| | | @org.yeshi.utils.mybatis.Column(name="si_type")
|
| | | @Column(name = "si_type")
|
| | | @Expose
|
| | | private Integer type;
|
| | |
|
| | | @org.yeshi.utils.mybatis.Column(name="si_url")
|
| | | @Expose
|
| | | @Column(name="si_url")
|
| | | private String url;
|
| | |
|
| | | @org.yeshi.utils.mybatis.Column(name="si_createtime")
|
| | | @Expose
|
| | | @Column(name="si_createtime")
|
| | | private Date createtime;
|
| | |
| | | this.md5 = md5;
|
| | | }
|
| | |
|
| | | public long getId() {
|
| | | public Long getId() {
|
| | | return id;
|
| | | }
|
| | |
|
| | | public void setId(long id) {
|
| | | public void setId(Long id) {
|
| | | this.id = id;
|
| | | }
|
| | |
|
New file |
| | |
| | | package com.yeshi.fanli.entity.bus.user;
|
| | |
|
| | | import java.util.Date;
|
| | |
|
| | | import org.yeshi.utils.mybatis.Column;
|
| | | import org.yeshi.utils.mybatis.Table;
|
| | |
|
| | | /**
|
| | | * 禁止用户的标识
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | @Table("yeshi_ec_forbidden_user_identify_code")
|
| | | public class ForbiddenUserIdentifyCode {
|
| | |
|
| | | public enum ForbiddenUserIdentifyCodeTypeEnum {
|
| | | wxUnionId("微信unionId"), taobaoUid("淘宝ID"), phone("手机号"), alipayAccount("支付宝账号");
|
| | | private final String desc;
|
| | |
|
| | | private ForbiddenUserIdentifyCodeTypeEnum(String desc) {
|
| | | this.desc = desc;
|
| | | }
|
| | |
|
| | | public String getDesc() {
|
| | | return desc;
|
| | | }
|
| | | }
|
| | |
|
| | | @Column(name = "fuc_id")
|
| | | private Long id;
|
| | | @Column(name = "fuc_type")
|
| | | private ForbiddenUserIdentifyCodeTypeEnum type;
|
| | | @Column(name = "fuc_identify_code")
|
| | | private String identifyCode;
|
| | | @Column(name = "fuc_effective")
|
| | | private Boolean effective;// 是否生效
|
| | | @Column(name = "fuc_beizhu")
|
| | | private String beiZhu;
|
| | | @Column(name = "fuc_create_time")
|
| | | private Date createTime;
|
| | | @Column(name = "fuc_update_time")
|
| | | private Date updateTime;
|
| | |
|
| | | public Long getId() {
|
| | | return id;
|
| | | }
|
| | |
|
| | | public void setId(Long id) {
|
| | | this.id = id;
|
| | | }
|
| | |
|
| | | public ForbiddenUserIdentifyCodeTypeEnum getType() {
|
| | | return type;
|
| | | }
|
| | |
|
| | | public void setType(ForbiddenUserIdentifyCodeTypeEnum type) {
|
| | | this.type = type;
|
| | | }
|
| | |
|
| | | public String getIdentifyCode() {
|
| | | return identifyCode;
|
| | | }
|
| | |
|
| | | public void setIdentifyCode(String identifyCode) {
|
| | | this.identifyCode = identifyCode;
|
| | | }
|
| | |
|
| | | public Boolean getEffective() {
|
| | | return effective;
|
| | | }
|
| | |
|
| | | public void setEffective(Boolean effective) {
|
| | | this.effective = effective;
|
| | | }
|
| | |
|
| | | 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;
|
| | | }
|
| | |
|
| | | public String getBeiZhu() {
|
| | | return beiZhu;
|
| | | }
|
| | |
|
| | | public void setBeiZhu(String beiZhu) {
|
| | | this.beiZhu = beiZhu;
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.exception.user; |
| | | |
| | | public class ForbiddenUserIdentifyCodeException extends Exception { |
| | | /** |
| | | * |
| | | */ |
| | | private static final long serialVersionUID = 1L; |
| | | private int code; |
| | | private String msg; |
| | | |
| | | public int getCode() { |
| | | return code; |
| | | } |
| | | |
| | | public String getMsg() { |
| | | return msg; |
| | | } |
| | | |
| | | public ForbiddenUserIdentifyCodeException(int code, String msg) { |
| | | this.code = code; |
| | | this.msg = msg; |
| | | } |
| | | |
| | | public ForbiddenUserIdentifyCodeException() { |
| | | } |
| | | |
| | | @Override |
| | | public String getMessage() { |
| | | return this.msg; |
| | | } |
| | | |
| | | } |
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.user.ForbiddenUserIdentifyCodeMapper"> |
| | | <resultMap id="BaseResultMap" |
| | | type="com.yeshi.fanli.entity.bus.user.ForbiddenUserIdentifyCode"> |
| | | <id column="fuc_id" property="id" jdbcType="BIGINT" /> |
| | | <result column="fuc_type" property="type" |
| | | typeHandler="com.yeshi.fanli.util.mybatishandler.ForbiddenUserIdentifyCodeTypeEnumHandler" /> |
| | | <result column="fuc_uid" property="user" jdbcType="VARCHAR" /> |
| | | <result column="fuc_identify_code" property="identifyCode" |
| | | jdbcType="VARCHAR" /> |
| | | <result column="fuc_effective" property="effective" jdbcType="BOOLEAN" /> |
| | | <result column="fuc_create_time" property="createTime" |
| | | jdbcType="TIMESTAMP" /> |
| | | <result column="fuc_update_time" property="updateTime" |
| | | jdbcType="TIMESTAMP" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List">fuc_id,fuc_type,fuc_identify_code,fuc_effective,fuc_create_time,fuc_update_time,fuc_beizhu |
| | | </sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" |
| | | parameterType="java.lang.Long"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_forbidden_user_identify_code where fuc_id = |
| | | #{id,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | <select id="listByTypeAndIdentifyCode" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_forbidden_user_identify_code where fuc_type = |
| | | #{type} and |
| | | fuc_identify_code=#{identifyCode} |
| | | </select> |
| | | |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from |
| | | yeshi_ec_forbidden_user_identify_code where fuc_id = |
| | | #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" |
| | | parameterType="com.yeshi.fanli.entity.bus.user.ForbiddenUserIdentifyCode" |
| | | useGeneratedKeys="true" keyProperty="id">insert into |
| | | yeshi_ec_forbidden_user_identify_code |
| | | (fuc_id,fuc_type,fuc_identify_code,fuc_effective,fuc_create_time,fuc_update_time,fuc_beizhu) |
| | | values |
| | | (#{id,jdbcType=BIGINT},#{type,jdbcType=VARCHAR},#{identifyCode,jdbcType=VARCHAR},#{effective,jdbcType=BOOLEAN},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{beiZhu,jdbcType=VARCHAR}) |
| | | </insert> |
| | | <insert id="insertSelective" |
| | | parameterType="com.yeshi.fanli.entity.bus.user.ForbiddenUserIdentifyCode" |
| | | useGeneratedKeys="true" keyProperty="id"> |
| | | insert into yeshi_ec_forbidden_user_identify_code |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">fuc_id,</if> |
| | | <if test="type != null">fuc_type,</if> |
| | | <if test="identifyCode != null">fuc_identify_code,</if> |
| | | <if test="effective != null">fuc_effective,</if> |
| | | <if test="createTime != null">fuc_create_time,</if> |
| | | <if test="updateTime != null">fuc_update_time,</if> |
| | | <if test="beiZhu != null">fuc_beizhu,</if> |
| | | </trim> |
| | | values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="type != null">#{type,jdbcType=VARCHAR},</if> |
| | | <if test="identifyCode != null">#{identifyCode,jdbcType=VARCHAR},</if> |
| | | <if test="effective != null">#{effective,jdbcType=BOOLEAN},</if> |
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="beiZhu != null">#{beiZhu,jdbcType=VARCHAR},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" |
| | | parameterType="com.yeshi.fanli.entity.bus.user.ForbiddenUserIdentifyCode">update yeshi_ec_forbidden_user_identify_code set |
| | | fuc_type = #{type,jdbcType=VARCHAR},fuc_identify_code = |
| | | #{identifyCode,jdbcType=VARCHAR},fuc_effective = |
| | | #{effective,jdbcType=BOOLEAN},fuc_create_time = |
| | | #{createTime,jdbcType=TIMESTAMP},fuc_update_time = |
| | | #{updateTime,jdbcType=TIMESTAMP},fuc_beizhu= |
| | | #{beiZhu,jdbcType=VARCHAR} |
| | | where fuc_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKeySelective" |
| | | parameterType="com.yeshi.fanli.entity.bus.user.ForbiddenUserIdentifyCode"> |
| | | update yeshi_ec_forbidden_user_identify_code |
| | | <set> |
| | | <if test="type != null">fuc_type=#{type,jdbcType=VARCHAR},</if> |
| | | <if test="identifyCode != null">fuc_identify_code=#{identifyCode,jdbcType=VARCHAR},</if> |
| | | <if test="effective != null">fuc_effective=#{effective,jdbcType=BOOLEAN},</if> |
| | | <if test="createTime != null">fuc_create_time=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">fuc_update_time=#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="beiZhu != null">fuc_beizhu=#{beiZhu,jdbcType=VARCHAR},</if> |
| | | </set> |
| | | where fuc_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | </mapper> |
| | |
| | |
|
| | | @Resource
|
| | | private ThreeSaleMapper threeSaleMapper;
|
| | | |
| | |
|
| | | @Resource
|
| | | private UserInviteMsgNotificationService userInviteMsgNotificationService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private MsgInviteDetailService msgInviteDetailService;
|
| | | |
| | | |
| | | private MsgInviteDetailService msgInviteDetailService;
|
| | |
|
| | | public UserInfo getBoss(final long uid) {
|
| | | return (UserInfo) dao.excute(new HibernateCallback<UserInfo>() {
|
| | |
| | | threeSale.setUpdateTime(java.lang.System.currentTimeMillis());
|
| | | threeSale.setWorker(inviteeUser);
|
| | | threeSaleMapper.insertSelective(threeSale);
|
| | | |
| | |
|
| | | List<ThreeSale> listExpire = threeSaleMapper.getExpireRecord(inviter.getId(), inviteeUser.getId());
|
| | | if (listExpire != null && listExpire.size() > 0) {
|
| | | // 删除失效
|
| | | for (ThreeSale saleExpire: listExpire) {
|
| | | for (ThreeSale saleExpire : listExpire) {
|
| | | msgInviteDetailService.deleteByThreeSale(saleExpire);
|
| | | }
|
| | | // 删除已失效关系
|
| | | threeSaleMapper.deleteExpireRecord(inviter.getId(), inviteeUser.getId());
|
| | | }
|
| | | |
| | | //创建通知
|
| | |
|
| | | // 创建通知
|
| | | userInviteMsgNotificationService.inviteScan(inviter.getId(), threeSale);
|
| | | |
| | | |
| | |
|
| | | } else {// 是已经存在的用户
|
| | |
|
| | | // 用户已经存在我们的用户库中
|
| | |
| | | threeSale.setUpdateTime(java.lang.System.currentTimeMillis());
|
| | | threeSale.setWorker(invitee);
|
| | | threeSaleMapper.insertSelective(threeSale);
|
| | | |
| | |
|
| | | // 删除已失效关系
|
| | | threeSaleMapper.deleteExpireRecord(inviter.getId(), invitee.getId());
|
| | | |
| | |
|
| | | List<ThreeSale> listExpire = threeSaleMapper.getExpireRecord(inviter.getId(), invitee.getId());
|
| | | if (listExpire != null && listExpire.size() > 0) {
|
| | | // 删除历史通知
|
| | | for (ThreeSale saleExpire: listExpire) {
|
| | | for (ThreeSale saleExpire : listExpire) {
|
| | | msgInviteDetailService.deleteByThreeSale(saleExpire);
|
| | | }
|
| | | // 删除已失效关系
|
| | | threeSaleMapper.deleteExpireRecord(inviter.getId(), invitee.getId());
|
| | | }
|
| | | |
| | |
|
| | | userInviteMsgNotificationService.inviteScan(inviter.getId(), threeSale);
|
| | | // threeSaleSerivce.bind(invitee, inviter);
|
| | |
|
| | |
| | | dao.update(threeSale);
|
| | | if (inviter != null)
|
| | | reComputeUserRank(inviter.getId());
|
| | | //通知
|
| | | // 通知
|
| | | userInviteMsgNotificationService.inviteSuccess(inviter.getId(), threeSale);
|
| | | // }
|
| | | // });
|
| | |
| | | public List<ThreeSale> listByWorkerId(Long workerId) {
|
| | | return threeSaleMapper.listByWorkerId(workerId);
|
| | | }
|
| | | |
| | | |
| | |
|
| | | @Override
|
| | | public int getSuccessRelationshipNum(Long uid) {
|
| | | return threeSaleMapper.getSuccessRelationshipNum(uid);
|
| | |
| | | @Override
|
| | | @Transactional
|
| | | public void bindRelationshipByInviteCode(UserInfo invitee, UserInfo inviter) throws ThreeSaleException {
|
| | | |
| | |
|
| | | if (invitee == null || inviter == null)
|
| | | throw new ThreeSaleException(1, "用户信息为空");
|
| | | |
| | |
|
| | | // 获取有效的邀请关系
|
| | | ThreeSale threeSale = |
| | | threeSaleMapper.getRelationshipByBossIdAndWorkerId(inviter.getId(), invitee.getId());
|
| | | |
| | | ThreeSale threeSale = threeSaleMapper.getRelationshipByBossIdAndWorkerId(inviter.getId(), invitee.getId());
|
| | |
|
| | | if (threeSale != null) {
|
| | | // 有效关系--生效
|
| | | threeSale.setState(true);
|
| | |
| | | threeSale.setCreateTime(java.lang.System.currentTimeMillis());
|
| | | threeSale.setUpdateTime(java.lang.System.currentTimeMillis());
|
| | | threeSaleMapper.insertSelective(threeSale);
|
| | | |
| | | |
| | |
|
| | | }
|
| | | |
| | |
|
| | | List<ThreeSale> listExpire = threeSaleMapper.getExpireRecord(inviter.getId(), invitee.getId());
|
| | | if (listExpire != null && listExpire.size() > 0) {
|
| | | // 删除历史通知
|
| | | for (ThreeSale saleExpire: listExpire) {
|
| | | for (ThreeSale saleExpire : listExpire) {
|
| | | msgInviteDetailService.deleteByThreeSale(saleExpire);
|
| | | }
|
| | | // 删除已失效关系
|
| | | threeSaleMapper.deleteExpireRecord(inviter.getId(), invitee.getId());
|
| | | }
|
| | | |
| | |
|
| | | // 邀请消息
|
| | | userInviteMsgNotificationService.inviteSuccess(inviter.getId(), threeSale);
|
| | |
|
| | | }
|
| | | |
| | |
|
| | | }
|
| | |
| | | return getUserMsgUnReadNum(uid);
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Override
|
| | | public void readOrderMsg(Long uid) {
|
| | | msgOrderDetailService.readMsgByUid(uid);
|
| | |
| | |
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Override
|
| | | public void readAccountMsg(Long uid) {
|
| | | msgAccountDetailService.readMsgByUid(uid);
|
| | |
| | | userMsgUnReadNumMapper.updateByPrimaryKeySelective(update);
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Override
|
| | | public void readMoneyMsg(Long uid) {
|
| | | msgMoneyDetailService.readMsgByUid(uid);
|
| | |
| | | userMsgUnReadNumMapper.updateByPrimaryKeySelective(update);
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Override
|
| | | public void readInviteMsg(Long uid) {
|
| | | msgInviteDetailService.readMsgByUid(uid);
|
| | |
| | | userMsgUnReadNumMapper.updateByPrimaryKeySelective(update);
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Override
|
| | | public void readUserSystemMsg(Long uid) {
|
| | | userSystemMsgService.readMsgByUid(uid);
|
New file |
| | |
| | | package com.yeshi.fanli.service.impl.user;
|
| | |
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.user.ForbiddenUserIdentifyCodeMapper;
|
| | | import com.yeshi.fanli.entity.bus.user.ForbiddenUserIdentifyCode;
|
| | | import com.yeshi.fanli.entity.bus.user.ForbiddenUserIdentifyCode.ForbiddenUserIdentifyCodeTypeEnum;
|
| | | import com.yeshi.fanli.exception.user.ForbiddenUserIdentifyCodeException;
|
| | | import com.yeshi.fanli.service.inter.user.ForbiddenUserIdentifyCodeService;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | | @Service
|
| | | public class ForbiddenUserIdentifyCodeServiceImpl implements ForbiddenUserIdentifyCodeService {
|
| | |
|
| | | @Resource
|
| | | private ForbiddenUserIdentifyCodeMapper forbiddenUserIdentifyCodeMapper;
|
| | |
|
| | | @Override
|
| | | public void addIdentifyCode(ForbiddenUserIdentifyCode identifyCode) throws ForbiddenUserIdentifyCodeException {
|
| | | if (identifyCode == null || identifyCode.getType() == null
|
| | | || StringUtil.isNullOrEmpty(identifyCode.getIdentifyCode()))
|
| | | throw new ForbiddenUserIdentifyCodeException(1, "信息不完整");
|
| | |
|
| | | ForbiddenUserIdentifyCode old = listByTypeAndIdentifyCode(identifyCode.getType(),
|
| | | identifyCode.getIdentifyCode());
|
| | | if (old != null)
|
| | | throw new ForbiddenUserIdentifyCodeException(2, "信息已存在");
|
| | |
|
| | | identifyCode.setCreateTime(new Date());
|
| | | identifyCode.setEffective(true);
|
| | | forbiddenUserIdentifyCodeMapper.insertSelective(identifyCode);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public ForbiddenUserIdentifyCode listByTypeAndIdentifyCode(ForbiddenUserIdentifyCodeTypeEnum type,
|
| | | String identifyCode) {
|
| | | List<ForbiddenUserIdentifyCode> list = forbiddenUserIdentifyCodeMapper.listByTypeAndIdentifyCode(type,
|
| | | identifyCode);
|
| | | if (list != null && list.size() > 0)
|
| | | return list.get(0);
|
| | | else
|
| | | return null;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void update(ForbiddenUserIdentifyCode identifyCode) {
|
| | | if (identifyCode == null)
|
| | | return;
|
| | | identifyCode.setUpdateTime(new Date());
|
| | | forbiddenUserIdentifyCodeMapper.updateByPrimaryKeySelective(identifyCode);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void delete(ForbiddenUserIdentifyCode identifyCode) {
|
| | | if (identifyCode == null || identifyCode.getId() == null)
|
| | | return;
|
| | | forbiddenUserIdentifyCodeMapper.deleteByPrimaryKey(identifyCode.getId());
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.inter.user;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.user.ForbiddenUserIdentifyCode;
|
| | | import com.yeshi.fanli.entity.bus.user.ForbiddenUserIdentifyCode.ForbiddenUserIdentifyCodeTypeEnum;
|
| | | import com.yeshi.fanli.exception.user.ForbiddenUserIdentifyCodeException;
|
| | |
|
| | | public interface ForbiddenUserIdentifyCodeService {
|
| | |
|
| | | /**
|
| | | * 添加禁止标识
|
| | | * |
| | | * @param identifyCode
|
| | | * @throws ForbiddenUserIdentifyCodeException
|
| | | */
|
| | | public void addIdentifyCode(ForbiddenUserIdentifyCode identifyCode) throws ForbiddenUserIdentifyCodeException;
|
| | |
|
| | | /**
|
| | | * 通过类型与唯一标识获取列表
|
| | | * |
| | | * @param type
|
| | | * @param identifyCode
|
| | | * @return
|
| | | */
|
| | | public ForbiddenUserIdentifyCode listByTypeAndIdentifyCode(ForbiddenUserIdentifyCodeTypeEnum type,
|
| | | String identifyCode);
|
| | |
|
| | | /**
|
| | | * |
| | | * @param identifyCode
|
| | | */
|
| | | public void update(ForbiddenUserIdentifyCode identifyCode);
|
| | |
|
| | | /**
|
| | | * |
| | | * @param identifyCode
|
| | | */
|
| | | public void delete(ForbiddenUserIdentifyCode identifyCode);
|
| | |
|
| | | }
|
| | |
| | | font = font.deriveFont(50.0f);
|
| | | g2d.setFont(font);
|
| | | g2d.setColor(new Color(229, 0, 93));
|
| | | // g2d.drawString("返利券提醒您", 312, 1118 + 40);
|
| | | // g2d.drawString("返利券提醒您", 312, 1118 + 40);
|
| | |
|
| | | g2d.setColor(new Color(102, 102, 102));
|
| | | g2d.drawString("长按识别二维码领取优惠券", 312, 1118 + 77);
|
| | |
| | |
|
| | | return null;
|
| | | }
|
| | | |
| | |
|
| | | /**
|
| | | * 绘制大的商品动态分享图
|
| | | *
|
| | |
| | | }
|
| | | g2d.setFont(font);
|
| | | try {
|
| | | // g2d.setColor(new Color(153, 153, 153));
|
| | | // g2d.setColor(new Color(153, 153, 153));
|
| | | // 画第一张
|
| | | for (int i = 0; i < goodsList.size(); i++) {
|
| | | TaoBaoGoodsBrief goods = goodsList.get(i);
|
| | |
| | | g2d.drawString("¥", 70, 650);
|
| | | boldFont = boldFont.deriveFont(42.0f);
|
| | | g2d.setFont(boldFont);
|
| | | g2d.drawString(couplePrice+"", 90, 650);
|
| | | g2d.drawString(couplePrice + "", 90, 650);
|
| | |
|
| | | // 画原价
|
| | | g2d.setColor(new Color(102, 102, 102));
|
| | | font = font.deriveFont(24.0f);
|
| | | g2d.setFont(font);
|
| | |
|
| | | String zkPrice = new BigDecimal((couplePrice+"").replace("¥", "")).add(goods.getCouponAmount())
|
| | | String zkPrice = new BigDecimal((couplePrice + "").replace("¥", "")).add(goods.getCouponAmount())
|
| | | .toString();
|
| | | g2d.drawString("¥ " + zkPrice, 70, 650 + 33);
|
| | |
|
| | |
| | |
|
| | | String quanString = "";
|
| | | BigDecimal withNoZera = MoneyBigDecimalUtil.getWithNoZera(goods.getCouponAmount());
|
| | | |
| | |
|
| | | if (!withNoZera.toString().endsWith("0")) {
|
| | | |
| | |
|
| | | // 画券右侧
|
| | | BufferedImage quanRight = ImageIO
|
| | | .read(ImageUtil.class.getClassLoader().getResourceAsStream("image/fanli_quan_right.png"));
|
| | | BufferedImage quanRight = ImageIO.read(
|
| | | ImageUtil.class.getClassLoader().getResourceAsStream("image/fanli_quan_right.png"));
|
| | | quanRight = zoomInImage(quanRight, 12, 60);
|
| | | g2d.setColor(new Color(241, 66, 66));
|
| | | g2d.drawImage(quanRight, topX + 630 - quanRight.getWidth(), topY + 630 - quanRight.getHeight(),
|
| | |
| | | topY + 630 + 42 - quanRight.getHeight());
|
| | |
|
| | | // 画券左侧
|
| | | BufferedImage quanLeft = ImageIO
|
| | | .read(ImageUtil.class.getClassLoader().getResourceAsStream("image/fanli_quan_left.png"));
|
| | | BufferedImage quanLeft = ImageIO.read(
|
| | | ImageUtil.class.getClassLoader().getResourceAsStream("image/fanli_quan_left.png"));
|
| | | quanLeft = zoomInImage(quanLeft, 12, 60);
|
| | | g2d.drawImage(quanLeft, topX + 630 - quanRight.getWidth() - textLength - quanLeft.getWidth(),
|
| | | topY + 630 - quanRight.getHeight(), null);
|
| | |
| | |
|
| | | String quanString = "";
|
| | | BigDecimal withNoZera = MoneyBigDecimalUtil.getWithNoZera(goods.getCouponAmount());
|
| | | |
| | |
|
| | | if (!withNoZera.toString().endsWith("0")) {
|
| | | |
| | |
|
| | | // 画券右侧
|
| | | BufferedImage quanRight = ImageIO
|
| | | .read(ImageUtil.class.getClassLoader().getResourceAsStream("image/fanli_quan_right.png"));
|
| | | BufferedImage quanRight = ImageIO.read(
|
| | | ImageUtil.class.getClassLoader().getResourceAsStream("image/fanli_quan_right.png"));
|
| | | quanRight = zoomInImage(quanRight, 8, 40);
|
| | | g2d.setColor(new Color(241, 66, 66));
|
| | | g2d.drawImage(quanRight, topX + 315 - quanRight.getWidth(), topY + 315 - quanRight.getHeight(),
|
| | |
| | |
|
| | | // 画券的内容
|
| | | g2d.setColor(new Color(229, 0, 93));
|
| | | |
| | |
|
| | | quanString = " " + withNoZera + "元券 ";
|
| | | |
| | |
|
| | | font = font.deriveFont(24.0f);
|
| | | g2d.setFont(font);
|
| | | FontMetrics fm = g2d.getFontMetrics(font);
|
| | |
| | | topY + 315 + 28 - quanRight.getHeight());
|
| | |
|
| | | // 画券左侧
|
| | | BufferedImage quanLeft = ImageIO
|
| | | .read(ImageUtil.class.getClassLoader().getResourceAsStream("image/fanli_quan_left.png"));
|
| | | BufferedImage quanLeft = ImageIO.read(
|
| | | ImageUtil.class.getClassLoader().getResourceAsStream("image/fanli_quan_left.png"));
|
| | | quanLeft = zoomInImage(quanLeft, 8, 40);
|
| | | g2d.drawImage(quanLeft, topX + 315 - quanRight.getWidth() - textLength - quanLeft.getWidth(),
|
| | | topY + 315 - quanRight.getHeight(), null);
|
| | | }
|
| | | |
| | |
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | if (portrait != null) {
|
| | | BufferedImage portraitImg = ImageIO.read(portrait);
|
| | | // 放缩大小
|
| | | portraitImg = zoomInImage(portraitImg, 40,40);
|
| | | portraitImg = zoomInImage(portraitImg, 40, 40);
|
| | | // 圆角
|
| | | portraitImg = roundImage(portraitImg, 10);
|
| | | |
| | |
|
| | | g2d.drawImage(portraitImg, 70 + (qrcodeImage.getWidth() - portraitImg.getWidth()) / 2,
|
| | | 1092 + (qrcodeImage.getHeight() - portraitImg.getHeight()) / 2, null);
|
| | | }
|
| | |
| | | font = font.deriveFont(50.0f);
|
| | | g2d.setFont(font);
|
| | | g2d.setColor(new Color(229, 0, 93));
|
| | | // g2d.drawString("返利券提醒您", 312, 1118 + 40);
|
| | | // g2d.drawString("返利券提醒您", 312, 1118 + 40);
|
| | |
|
| | | g2d.setColor(new Color(102, 102, 102));
|
| | | g2d.drawString("长按识别二维码免费领券", 312, 1150);
|
| | | |
| | |
|
| | | g2d.setColor(new Color(102, 102, 102));
|
| | | g2d.drawString("共", 1000, 1150);
|
| | | |
| | | |
| | |
|
| | | g2d.setColor(new Color(229, 0, 93));
|
| | | g2d.drawString(goodsList.size()+"", 1055, 1150);
|
| | | |
| | | |
| | | g2d.drawString(goodsList.size() + "", 1055, 1150);
|
| | |
|
| | | g2d.setColor(new Color(102, 102, 102));
|
| | | g2d.drawString("个商品", 1090, 1150);
|
| | | |
| | |
|
| | | // 提示语
|
| | | BufferedImage tips = ImageIO
|
| | | .read(ImageUtil.class.getClassLoader().getResourceAsStream("image/share/tips1.png"));
|
| | | tips = zoomInImage(tips,850, 65);
|
| | | g2d.drawImage(tips, 312,1190, null);
|
| | | tips = zoomInImage(tips, 850, 65);
|
| | | g2d.drawImage(tips, 312, 1190, null);
|
| | |
|
| | | g2d.dispose();
|
| | |
|
| | |
| | |
|
| | | return null;
|
| | | }
|
| | |
|
| | |
|
| | | // 画商品分享图
|
| | | public static InputStream drawGoodsShareImgHCJ(InputStream qrcodeStream, InputStream portrait,
|
| | |
| | | gs.dispose();
|
| | | return image;
|
| | | }
|
| | | |
| | |
|
| | | public static int saveToImgByInputStream(InputStream inputStream, String imgPath, String imgName) {
|
| | | int stateInt = 1;
|
| | | try {
|
| | |
| | | import org.yeshi.utils.tencentcloud.entity.COSInitParams;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.user.AlipayTransferResultInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBao;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2;
|
| | | import com.yeshi.fanli.entity.push.PushQueueRecord;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoOrder;
|
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.bus.user.ForbiddenUserIdentifyCode.ForbiddenUserIdentifyCodeTypeEnum;
|
| | |
|
| | | public class ForbiddenUserIdentifyCodeTypeEnumHandler extends BaseTypeHandler<ForbiddenUserIdentifyCodeTypeEnum> {
|
| | |
|
| | | @Override
|
| | | public ForbiddenUserIdentifyCodeTypeEnum getNullableResult(ResultSet arg0, String arg1) throws SQLException {
|
| | | String key = arg0.getString(arg1);
|
| | | if (arg0.wasNull()) {
|
| | | return null;
|
| | | } else {
|
| | | return ForbiddenUserIdentifyCodeTypeEnum.valueOf(key);
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public ForbiddenUserIdentifyCodeTypeEnum getNullableResult(ResultSet arg0, int arg1) throws SQLException {
|
| | | String key = arg0.getString(arg1);
|
| | | if (arg0.wasNull()) {
|
| | | return null;
|
| | | } else {
|
| | | // 根据数据库中的key值,定位SexEnum子类
|
| | | return ForbiddenUserIdentifyCodeTypeEnum.valueOf(key);
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public ForbiddenUserIdentifyCodeTypeEnum getNullableResult(CallableStatement arg0, int arg1) throws SQLException {
|
| | | String key = arg0.getString(arg1);
|
| | | if (arg0.wasNull()) {
|
| | | return null;
|
| | | } else {
|
| | | // 根据数据库中的key值,定位SexEnum子类
|
| | | return ForbiddenUserIdentifyCodeTypeEnum.valueOf(key);
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void setNonNullParameter(PreparedStatement arg0, int arg1, ForbiddenUserIdentifyCodeTypeEnum arg2, JdbcType arg3)
|
| | | throws SQLException {
|
| | | arg0.setString(arg1, arg2.name());
|
| | | }
|
| | |
|
| | | }
|