Authored by mingdan.ge

cps三期

... ... @@ -16,46 +16,21 @@ public enum BankEnum {
gs("gs","中国工商银行"),
ny("ny","中国农业银行"),
zh("zh","中国银行"),
js("js","中国建设银行");
// c("","中国工商银行"),
// c("","中国农业银行"),
// c("","中国银行"),
// c("","中国建设银行"),
// c("","中国邮政储蓄银行"),
// c("","招商银行"),
// c("","中信银行"),
// c("","中国民生银行"),
// c("","兴业银行"),
// c("","浦发银行"),
// c("","中国光大银行"),
// c("","平安银行"),
// c("","华夏银行"),
// c("","广发银行"),
// c("","北京银行"),
// c("","上海银行"),
// c("","江苏银行"),
// c("","恒丰银行"),
// c("","浙商银行"),
// c("","南京银行"),
// c("","北京农村商业银行"),
// c("","北京银行"),
// c("","创兴银行"),
// c("","城市信用合作社"),
// c("","重庆三峡银行"),
// c("","村镇银行"),
// c("","城市商业银行"),
// c("","重庆农村商业银行"),
// c("","大华银行"),
// d("","大新银行(中国)有限公司"),
// d("","国泰世华上海分行"),
// d("","国家开发银行"),
// d("","广州农村商业银行"),
// d("","广发银行"),
// d("","华一银行"),
// d("","华商银行"),
// d("","恒生银行"),
// d("","恒生银行"),
js("js","中国建设银行"),
jt("jt","交通银行"),
yzcx("yzcx","中国邮政储蓄银行"),
zs("zs","招商银行"),
pdfz("pdfz","上海浦东发展银行"),
zx("zx","中信银行"),
gd("gd","中国光大银行"),
hx("hx","华夏银行"),
ms("ms","中国民生银行"),
gf("gf","广发银行"),
xy("xy","兴业银行"),
pa("pa","平安银行"),
hf("hf","恒丰银行"),
zhes("zhes","浙商银行"),
bh("bh","渤海银行");
private String code;
private String bankName;
... ...
package com.yoho.unions.common.enums;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import java.util.HashMap;
import java.util.Map;
... ... @@ -8,7 +11,8 @@ import java.util.Map;
*/
public enum SocialMediaSectionEnum {
one(1,1,10000),
two(2,10001,20000);
two(2,10001,20000),
three(3,20001,30000);
private int no;
private int start;
... ... @@ -27,6 +31,16 @@ public enum SocialMediaSectionEnum {
}
return map;
}
public static JSONArray getAllSectionArray(String separator) {
JSONArray jsonArray = new JSONArray();
for (SocialMediaSectionEnum e : values()) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("no",e.getNo());
jsonObject.put("desc", e.getStart() + separator + e.getEnd());
jsonArray.add(jsonObject);
}
return jsonArray;
}
public static String getSectionByNo(int no,String separator) {
for (SocialMediaSectionEnum e : values()) {
... ...
package com.yoho.unions.common.enums;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import java.util.HashMap;
import java.util.Map;
... ... @@ -10,7 +13,8 @@ public enum SocialMediaTypeEnum {
//社交媒体:1-微信公众号,2-抖音
wechat(1,"微信公众号"),
douyin(2,"抖音");
douyin(2,"抖音"),
weibo(3,"微博");
private int type;
private String name;
... ... @@ -27,6 +31,16 @@ public enum SocialMediaTypeEnum {
}
return map;
}
public static JSONArray getAllTypeArray() {
JSONArray jsonArray = new JSONArray();
for (SocialMediaTypeEnum e : values()) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("type",e.getType());
jsonObject.put("name", e.getName());
jsonArray.add(jsonObject);
}
return jsonArray;
}
public static String getNameByType(int type) {
for (SocialMediaTypeEnum e : values()) {
... ...
... ... @@ -92,6 +92,12 @@
<value>/UnionShareRest/getBankList</value>
<value>/UnionShareRest/getBankCard</value>
<value>/UnionShareRest/checkBankCard</value>
<value>/UnionShareRest/queryUnionShareUserBanks</value>
<value>/UnionShareRest/queryUnionShareUserApplys</value>
<value>/UnionShareRest/getSocialMediaBasicParams</value>
<value>/UnionShareRest/cancelUserBanks</value>
<value>/UnionShareRest/refuseApply</value>
<value>/UnionShareRest/agreeApply</value>
</list>
</property>
... ...
... ... @@ -13,11 +13,16 @@ public interface IMktMarketingUrlDAO {
MktMarketingUrl selectByPrimaryKey(Long unionType);
int insertSelective(MktMarketingUrl mktMarketingUrl);
Long selectMaxPersonalUnionType();
@MapKey("unionType")
Map<Long,MktMarketingUrl> selectByUnionTypes(List<String> unionTypes);
MktMarketingUrl selectByName(String name);
int selectByNameAndUnionType(String name,String unionType);
List<Long> selectUnionTypes(@Param("unionType") Long unionType, @Param("name") String name, @Param("channelType") String channelType);
Long selectUnionTypeByNameAndUnionType(@Param("name")String name, @Param("unionType")Long unionType);
... ...
... ... @@ -3,8 +3,10 @@ package com.yoho.unions.dal;
import com.yoho.service.model.union.request.UnionShareUserApplyListReqBo;
import com.yoho.service.model.union.response.UnionShareUserApplyListBo;
import com.yoho.unions.dal.model.UnionShareUserApply;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Set;
public interface UnionShareUserApplyMapper {
int deleteByPrimaryKey(Integer id);
... ... @@ -14,9 +16,12 @@ public interface UnionShareUserApplyMapper {
int insertSelective(UnionShareUserApply record);
UnionShareUserApply selectByPrimaryKey(Integer id);
List<UnionShareUserApply> selectByIds(List<Integer> id);
int updateByPrimaryKeySelective(UnionShareUserApply record);
int updateStatus(@Param("ids")List<Integer> ids,@Param("oldState")Integer oldState,@Param("newState")Integer newState,@Param("time")Integer time);
int updateByPrimaryKey(UnionShareUserApply record);
List<UnionShareUserApplyListBo> selectByCondition(UnionShareUserApplyListReqBo parm);
... ...
... ... @@ -26,11 +26,18 @@ public class MktMarketingUrl {
private Integer createTime;
private String mktActivityCode;
private String mktDesc;
private String landingPageUrl;
private Integer landingPageTypeCode;
private Integer channelType;
private Integer realtimeShow;
private Integer payChannel;
private Integer marketingUrlType;
private Integer businessCode;
public Integer getChannelType() {
return channelType;
}
... ... @@ -95,6 +102,14 @@ public class MktMarketingUrl {
this.deptId = deptId == null ? null : deptId.trim();
}
public String getMktDesc() {
return mktDesc;
}
public void setMktDesc(String mktDesc) {
this.mktDesc = mktDesc;
}
public String getCreateId() {
return createId;
}
... ... @@ -150,4 +165,44 @@ public class MktMarketingUrl {
public void setLandingPageUrl(String landingPageUrl) {
this.landingPageUrl = landingPageUrl;
}
public Integer getRealtimeShow() {
return realtimeShow;
}
public void setRealtimeShow(Integer realtimeShow) {
this.realtimeShow = realtimeShow;
}
public Integer getPayChannel() {
return payChannel;
}
public void setPayChannel(Integer payChannel) {
this.payChannel = payChannel;
}
public Integer getMarketingUrlType() {
return marketingUrlType;
}
public void setMarketingUrlType(Integer marketingUrlType) {
this.marketingUrlType = marketingUrlType;
}
public Integer getLandingPageTypeCode() {
return landingPageTypeCode;
}
public void setLandingPageTypeCode(Integer landingPageTypeCode) {
this.landingPageTypeCode = landingPageTypeCode;
}
public Integer getBusinessCode() {
return businessCode;
}
public void setBusinessCode(Integer businessCode) {
this.businessCode = businessCode;
}
}
\ No newline at end of file
... ...
... ... @@ -6,6 +6,7 @@ public class UnionShareUserApply {
private Integer uid;
private String name;
private String mobile;
private Byte socialMediaType;
... ... @@ -45,6 +46,14 @@ public class UnionShareUserApply {
this.name = name == null ? null : name.trim();
}
public String getMobile() {
return mobile;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
public Byte getSocialMediaType() {
return socialMediaType;
}
... ...
... ... @@ -17,10 +17,15 @@
<result column="mkt_activity_code" property="mktActivityCode" jdbcType="VARCHAR" />
<result column="landing_page_url" property="landingPageUrl" jdbcType="VARCHAR" />
<result column="channel_type" property="channelType" jdbcType="INTEGER" />
<result column="realtime_show" property="realtimeShow" jdbcType="INTEGER" />
<result column="pay_channel" property="payChannel" jdbcType="INTEGER" />
<result column="marketing_url_type" property="marketingUrlType" jdbcType="INTEGER" />
<result column="business_code" property="businessCode" jdbcType="INTEGER" />
<result column="mkt_desc" property="mktDesc" jdbcType="VARCHAR" />
</resultMap>
<sql id="Base_Column_List" >
union_type, division_code, class_code, channel_code, device_code, dept_id, create_id,
name, src_url, dest_url, status, create_time,mkt_activity_code,landing_page_url,channel_type
union_type, division_code, class_code, channel_code, device_code, dept_id, create_id, mkt_desc,
name, src_url, dest_url, status, create_time,mkt_activity_code,landing_page_url,channel_type,realtime_show,pay_channel,marketing_url_type,business_code
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
select
... ... @@ -34,6 +39,10 @@
from mkt_marketing_url
where name = #{name} limit 1
</select>
<select id="selectByNameAndUnionType" resultType="java.lang.Integer" >
select count(1) from mkt_marketing_url
where name = #{name} and union_type = #{unionType,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
delete from mkt_marketing_url
where union_type = #{unionType,jdbcType=BIGINT}
... ... @@ -70,4 +79,134 @@
#{unionType}
</foreach>
</select>
<insert id="insertSelective" useGeneratedKeys="true" keyProperty="unionType" parameterType="com.yoho.unions.dal.model.MktMarketingUrl" >
insert into mkt_marketing_url
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="unionType != null" >
union_type,
</if>
<if test="divisionCode != null" >
division_code,
</if>
<if test="businessCode != null" >
business_code,
</if>
<if test="classCode != null" >
class_code,
</if>
<if test="channelCode != null" >
channel_code,
</if>
<if test="deptId != null" >
dept_id,
</if>
<if test="createId != null" >
create_id,
</if>
<if test="name != null" >
name,
</if>
<if test="srcUrl != null" >
src_url,
</if>
<if test="destUrl != null" >
dest_url,
</if>
<if test="status != null" >
status,
</if>
<if test="createTime != null" >
create_time,
</if>
<if test="mktDesc != null" >
mkt_desc,
</if>
<if test="mktActivityCode != null" >
mkt_activity_code,
</if>
<if test="marketingUrlType != null" >
marketing_url_type,
</if>
<if test="landingPageTypeCode != null" >
landing_page_type_code,
</if>
<if test="landingPageUrl != null" >
landing_page_url,
</if>
<if test="channelType != null" >
channel_type,
</if>
<if test="realtimeShow != null" >
realtime_show,
</if>
<if test="payChannel != null" >
pay_channel,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="unionType != null" >
#{unionType,jdbcType=BIGINT},
</if>
<if test="divisionCode != null" >
#{divisionCode,jdbcType=INTEGER},
</if>
<if test="businessCode != null" >
#{businessCode,jdbcType=INTEGER},
</if>
<if test="classCode != null" >
#{classCode,jdbcType=INTEGER},
</if>
<if test="channelCode != null" >
#{channelCode,jdbcType=INTEGER},
</if>
<if test="deptId != null" >
#{deptId,jdbcType=VARCHAR},
</if>
<if test="createId != null" >
#{createId,jdbcType=VARCHAR},
</if>
<if test="name != null" >
#{name,jdbcType=VARCHAR},
</if>
<if test="srcUrl != null" >
#{srcUrl,jdbcType=VARCHAR},
</if>
<if test="destUrl != null" >
#{destUrl,jdbcType=VARCHAR},
</if>
<if test="status != null" >
#{status,jdbcType=INTEGER},
</if>
<if test="createTime != null" >
#{createTime,jdbcType=INTEGER},
</if>
<if test="mktDesc != null" >
#{mktDesc,jdbcType=VARCHAR},
</if>
<if test="mktActivityCode != null" >
#{mktActivityCode,jdbcType=VARCHAR},
</if>
<if test="marketingUrlType != null" >
#{marketingUrlType,jdbcType=INTEGER},
</if>
<if test="landingPageTypeCode != null" >
#{landingPageTypeCode,jdbcType=INTEGER},
</if>
<if test="landingPageUrl != null" >
#{landingPageUrl,jdbcType=VARCHAR},
</if>
<if test="channelType != null" >
#{channelType,jdbcType=INTEGER},
</if>
<if test="realtimeShow != null" >
#{realtimeShow,jdbcType=INTEGER},
</if>
<if test="payChannel != null" >
#{payChannel,jdbcType=INTEGER},
</if>
</trim>
</insert>
<select id="selectMaxPersonalUnionType" resultType="java.lang.Long">
select max(union_type) from mkt_marketing_url where channel_type=1
</select>
</mapper>
\ No newline at end of file
... ...
... ... @@ -5,6 +5,7 @@
<id column="id" property="id" jdbcType="INTEGER" />
<result column="uid" property="uid" jdbcType="INTEGER" />
<result column="name" property="name" jdbcType="VARCHAR" />
<result column="mobile" property="mobile" jdbcType="VARCHAR" />
<result column="social_media_type" property="socialMediaType" jdbcType="TINYINT" />
<result column="social_media_account" property="socialMediaAccount" jdbcType="VARCHAR" />
<result column="social_media_fans" property="socialMediaFans" jdbcType="INTEGER" />
... ... @@ -14,7 +15,7 @@
<result column="check_time" property="checkTime" jdbcType="INTEGER" />
</resultMap>
<sql id="Base_Column_List" >
id, uid, name, social_media_type, social_media_account, social_media_fans, status,
id, uid, name, mobile, social_media_type, social_media_account, social_media_fans, status,
del_flag, create_time, check_time
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
... ... @@ -26,16 +27,19 @@
<select id="selectByCondition"
resultType="com.yoho.service.model.union.response.UnionShareUserApplyListBo"
parameterType="com.yoho.service.model.union.request.UnionShareUserApplyListReqBo">
select id, uid, name, social_media_type socialMediaType, social_media_account socialMediaAccount, social_media_fans socialMediaFans, status,
select id, uid, name,mobile, social_media_type socialMediaType, social_media_account socialMediaAccount, social_media_fans socialMediaFans, status,
del_flag delFlag, create_time createTime, check_time checkTime
from union_share_user_apply
where 1=1
where del_flag=1
<if test="uid != null">
and uid = #{uid}
</if>
<if test="name != null">
and name = #{name}
</if>
<if test="mobile != null">
and mobile = #{mobile}
</if>
<if test="socialMediaType != null">
and social_media_type = #{socialMediaType}
</if>
... ... @@ -48,23 +52,23 @@
<if test="status != null">
and status = #{status}
</if>
<if test="delFlag != null">
and del_flag = #{delFlag}
</if>
order by id desc
limit #{start},#{size}
</select>
<select id="selectTotalByCondition" resultType="java.lang.Integer"
parameterType="com.yoho.service.model.union.request.UnionShareUserApplyListReqBo">
select count(*)
select count(id)
from union_share_user_apply
where 1=1
where del_flag=1
<if test="uid != null">
and uid = #{uid}
</if>
<if test="name != null">
and name = #{name}
</if>
<if test="mobile != null">
and mobile = #{mobile}
</if>
<if test="socialMediaType != null">
and social_media_type = #{socialMediaType}
</if>
... ... @@ -77,20 +81,17 @@
<if test="status != null">
and status = #{status}
</if>
<if test="delFlag != null">
and del_flag = #{delFlag}
</if>
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
delete from union_share_user_apply
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.yoho.unions.dal.model.UnionShareUserApply" >
insert into union_share_user_apply (id, uid, name,
insert into union_share_user_apply (id, uid, name, mobile,
social_media_type, social_media_account, social_media_fans,
status, del_flag, create_time,
check_time)
values (#{id,jdbcType=INTEGER}, #{uid,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR},
values (#{id,jdbcType=INTEGER}, #{uid,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{mobile,jdbcType=VARCHAR},
#{socialMediaType,jdbcType=TINYINT}, #{socialMediaAccount,jdbcType=VARCHAR}, #{socialMediaFans,jdbcType=INTEGER},
#{status,jdbcType=TINYINT}, #{delFlag,jdbcType=TINYINT}, #{createTime,jdbcType=INTEGER},
#{checkTime,jdbcType=INTEGER})
... ... @@ -107,6 +108,9 @@
<if test="name != null" >
name,
</if>
<if test="mobile != null" >
mobile,
</if>
<if test="socialMediaType != null" >
social_media_type,
</if>
... ... @@ -139,6 +143,9 @@
<if test="name != null" >
#{name,jdbcType=VARCHAR},
</if>
<if test="mobile != null" >
#{mobile,jdbcType=VARCHAR},
</if>
<if test="socialMediaType != null" >
#{socialMediaType,jdbcType=TINYINT},
</if>
... ... @@ -171,6 +178,9 @@
<if test="name != null" >
name = #{name,jdbcType=VARCHAR},
</if>
<if test="mobile != null" >
mobile = #{mobile,jdbcType=VARCHAR},
</if>
<if test="socialMediaType != null" >
social_media_type = #{socialMediaType,jdbcType=TINYINT},
</if>
... ... @@ -199,6 +209,7 @@
update union_share_user_apply
set uid = #{uid,jdbcType=INTEGER},
name = #{name,jdbcType=VARCHAR},
mobile = #{mobile,jdbcType=VARCHAR},
social_media_type = #{socialMediaType,jdbcType=TINYINT},
social_media_account = #{socialMediaAccount,jdbcType=VARCHAR},
social_media_fans = #{socialMediaFans,jdbcType=INTEGER},
... ...
... ... @@ -56,11 +56,14 @@
<if test="bankCardNo != null">
and bank_card_no=#{bankCardNo}
</if>
<if test="status != null">
and status = #{status,jdbcType=INTEGER}
</if>
order by id desc limit #{start},#{size}
</select>
<select id="selectTotalByCondition" resultType="java.lang.Integer"
parameterType="com.yoho.service.model.union.request.UnionShareUserBankListReqBo">
select count(*)
select count(id)
from union_share_user_bank
where 1=1
<if test="uid != null">
... ... @@ -81,6 +84,9 @@
<if test="bankCardNo != null">
and bank_card_no=#{bankCardNo}
</if>
<if test="status != null">
and status = #{status,jdbcType=INTEGER}
</if>
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
delete from union_share_user_bank
... ...
... ... @@ -86,6 +86,15 @@
<if test="updateTime != null" >
#{updateTime,jdbcType=INTEGER},
</if>
<if test="createTime != null" >
#{createTime,jdbcType=INTEGER},
</if>
<if test="status != null" >
#{status,jdbcType=INTEGER},
</if>
<if test="contractStatus != null" >
#{contractStatus,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yoho.unions.dal.model.UnionShareUser" >
... ...
package com.yoho.unions.server.restapi;
import com.alibaba.fastjson.JSONArray;
import com.yoho.core.common.utils.JsonUtil;
import com.yoho.service.model.union.bo.*;
import com.yoho.service.model.union.request.UnionShareOrderReqBO;
... ... @@ -21,6 +22,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
/**
* Created by mingdan.ge on 2018/5/14.
... ... @@ -169,6 +171,19 @@ public class UnionShareRest {
}
/**
* 作废用户绑定的银行卡
* @param req
* @return
*/
@RequestMapping("/cancelUserBanks")
@ResponseBody
public UnionResponse cancelUserBanks(IdOrIdsBo req){
log.info("cancelUserBanks req is {}", req);
int result = unionShareService.cancelUserBanks(req);
return new UnionResponse(200, "cancelUserBanks success",result);
}
/**
* 查询申请记录
* @param parm
* @return
... ... @@ -234,6 +249,44 @@ public class UnionShareRest {
}
/**
* 查询社交媒体基本参数
* @return
*/
@RequestMapping("/getSocialMediaBasicParams")
@ResponseBody
public UnionResponse getSocialMediaBasicParams(){
log.info("UnionShareRest.getSocialMediaBasicParams");
Map<String,JSONArray> result = unionShareService.getSocialMediaBasicParams();
return new UnionResponse(200, "getSocialMediaBasicParams success",result);
}
/**
* 拒绝用户申请
* @param req
* @return
*/
@RequestMapping("/refuseApply")
@ResponseBody
public UnionResponse refuseApply(IdOrIdsBo req){
log.info("refuseApply req is {}", req);
int result = unionShareService.refuseApply(req);
return new UnionResponse(200, "refuseApply success",result);
}
/**
* 通过用户申请
* @param req
* @return
*/
@RequestMapping("/agreeApply")
@ResponseBody
public UnionResponse agreeApply(IdOrIdsBo req){
log.info("agreeApply req is {}", req);
int result = unionShareService.agreeApply(req);
return new UnionResponse(200, "agreeApply success",result);
}
@RequestMapping("/mqUnionShareOrder")
@ResponseBody
public UnionResponse mqUnionShareOrder(@RequestBody List<ShareOrderBo> list){
... ...
package com.yoho.unions.server.service;
import com.alibaba.fastjson.JSONArray;
import com.yoho.service.model.union.bo.*;
import com.yoho.service.model.union.request.UnionShareOrderReqBO;
import com.yoho.service.model.union.request.UnionShareOrderSearchReqBO;
... ... @@ -14,6 +15,7 @@ import com.yoho.unions.dal.model.UnionShareSettlement;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
/**
* 联盟红人推广返利
... ... @@ -70,6 +72,12 @@ public interface IUnionShareService {
List<UnionShareBankBo> getBankList();
/**
* 获取银行列表
* @return
*/
Map<String,JSONArray> getSocialMediaBasicParams();
/**
* 绑定银行卡
* @param bo
* @return
... ... @@ -119,6 +127,27 @@ public interface IUnionShareService {
PageResponseBO<UnionShareUserBankListBO> queryUnionShareUserBanks(UnionShareUserBankListReqBo parm);
/**
* 作废用户绑定的银行卡
* @param req
* @return
*/
int cancelUserBanks(IdOrIdsBo req);
/**
* 拒绝用户申请
* @param req
* @return
*/
int refuseApply(IdOrIdsBo req);
/**
* 通过用户申请
* @param req
* @return
*/
int agreeApply(IdOrIdsBo req);
/**
* 查询申请记录
* @param parm
* @return
... ...
package com.yoho.unions.server.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONException;
import com.alibaba.fastjson.JSONObject;
import com.yoho.core.config.ConfigReader;
... ... @@ -85,6 +86,7 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport
private String OLD_USER_REBATES_RATIO_KEY = "union.oldUserRebatesRatio";
private String UNION_SHAREID = "union.shareId";
private String UNION_CPS_IMAGEURL = "union.cps.ImageUrl";
private String UNION_CPS_APPLY_IMAGEURL = "union.cps.applyImageUrl";
//USER_SETTLEMENT下hashkey
private String USER_SETTLEMENT_SETTLEAMOUNT = "settleAmount";
... ... @@ -250,7 +252,34 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport
result.setTotal(total);
return result;
}
/**
* 作废用户绑定的银行卡
* @param req
* @return
*/
@Override
public int cancelUserBanks(IdOrIdsBo req){
logger.info("cancelUserBanks.req is {}",req);
UnionShareUserBank unionShareUserBank = unionShareUserBankMapper.selectByPrimaryKey(req.getId());
if (unionShareUserBank == null) {
logger.info("cancelUserBanks end.id do not exist.req is {}",req);
return 0;
}
UnionShareUserBank updateReq = new UnionShareUserBank();
updateReq.setId(req.getId());
updateReq.setStatus((byte) 0);
updateReq.setUpdateTime(DateUtil.getCurrentTimeSecond());
int result = unionShareUserBankMapper.updateByPrimaryKeySelective(updateReq);
redisHashCache.delete(ShareOrdersKeyEnum.USER_SETTLEMENT.getPreKey(),unionShareUserBank.getUid());
return result;
}
/**
* 查询申请记录
* @param parm
* @return
*/
@Override
public PageResponseBO<UnionShareUserApplyListBo> queryUnionShareUserApplys(UnionShareUserApplyListReqBo parm) {
int total=this.unionShareUserApplyMapper.selectTotalByCondition(parm);
... ... @@ -269,6 +298,122 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport
result.setTotal(total);
return result;
}
/**
* 拒绝用户申请
* @param req
* @return
*/
@Override
public int refuseApply(IdOrIdsBo req){
if (req.getId() != null) {
//单个操作
UnionShareUserApply unionShareUserApply = unionShareUserApplyMapper.selectByPrimaryKey(req.getId());
if (unionShareUserApply == null || unionShareUserApply.getStatus() > 1) {
return 0;
}
UnionShareUserApply updateReq = new UnionShareUserApply();
updateReq.setId(req.getId());
updateReq.setStatus((byte) 3);//状态:1-申请中,2-通过,3-拒绝
updateReq.setCheckTime(DateUtil.getCurrentTimeSecond());
int result=unionShareUserApplyMapper.updateByPrimaryKeySelective(updateReq);
redisHashCache.delete(ShareOrdersKeyEnum.UNION_TYPE.getPreKey(),unionShareUserApply.getUid());
return result;
} else {
//批量操作
List<UnionShareUserApply> unionShareUserApplies = unionShareUserApplyMapper.selectByIds(Arrays.asList(req.getIdArray()));
if (CollectionUtils.isEmpty(unionShareUserApplies)) {
return 0;
}
List<Integer> ids = new ArrayList<>();
unionShareUserApplies.forEach(u->{
ids.add(u.getId());
});
int result=unionShareUserApplyMapper.updateStatus(ids,1,3,DateUtil.getCurrentTimeSecond());
unionShareUserApplies.forEach(u->{
redisHashCache.delete(ShareOrdersKeyEnum.UNION_TYPE.getPreKey(),u.getUid());
});
return result;
}
}
/**
* 通过用户申请
* @param req
* @return
*/
@Override
public int agreeApply(IdOrIdsBo req){
if (req.getId() != null) {
//单个操作
UnionShareUserApply unionShareUserApply = unionShareUserApplyMapper.selectByPrimaryKey(req.getId());
if (unionShareUserApply == null || unionShareUserApply.getStatus() > 1) {
return 0;
}
UnionShareUserApply updateReq = new UnionShareUserApply();
updateReq.setId(req.getId());
updateReq.setStatus((byte) 2);//状态:1-申请中,2-通过,3-拒绝
updateReq.setCheckTime(DateUtil.getCurrentTimeSecond());
int result=unionShareUserApplyMapper.updateByPrimaryKeySelective(updateReq);
if (result > 0) {
//todo 绑定unionType
relateUnionType(unionShareUserApply.getUid());
}
redisHashCache.delete(ShareOrdersKeyEnum.UNION_TYPE.getPreKey(),unionShareUserApply.getUid());
return result;
} else {
//批量操作
List<UnionShareUserApply> unionShareUserApplies = unionShareUserApplyMapper.selectByIds(Arrays.asList(req.getIdArray()));
if (CollectionUtils.isEmpty(unionShareUserApplies)) {
return 0;
}
List<Integer> ids = new ArrayList<>();
unionShareUserApplies.forEach(u->{
ids.add(u.getId());
});
int result=unionShareUserApplyMapper.updateStatus(ids,1,2,DateUtil.getCurrentTimeSecond());
unionShareUserApplies.forEach(u->{
relateUnionType(u.getUid());
redisHashCache.delete(ShareOrdersKeyEnum.UNION_TYPE.getPreKey(),u.getUid());
});
return result;
}
}
public void relateUnionType(int uid) {
//生成unionType
MktMarketingUrl unionDepartmentUrl = buildMktMarketingUrl(uid);
mktMarketingUrlDAO.insertSelective(unionDepartmentUrl);
//绑定uid和unionType
UnionShareUser unionShareUser = new UnionShareUser();
unionShareUser.setUid(uid);
unionShareUser.setUnionType(unionDepartmentUrl.getUnionType().toString());
unionShareUser.setCreateTime(DateUtil.getCurrentTimeSecond());
unionShareUser.setUpdateTime(unionShareUser.getCreateTime());
unionShareUserMapper.insertSelective(unionShareUser);
}
public MktMarketingUrl buildMktMarketingUrl(int uid) {
MktMarketingUrl mktMarketingUrl = new MktMarketingUrl();
mktMarketingUrl.setChannelType(1);//渠道类型:0-机构 1-个人
mktMarketingUrl.setPayChannel(1);
mktMarketingUrl.setMarketingUrlType(1);
mktMarketingUrl.setLandingPageTypeCode(1000);
mktMarketingUrl.setRealtimeShow(0);
mktMarketingUrl.setDivisionCode(11);
mktMarketingUrl.setClassCode(1121);
mktMarketingUrl.setChannelCode(1462);
mktMarketingUrl.setBusinessCode(1033);
mktMarketingUrl.setCreateId("0");
mktMarketingUrl.setName("cps" + uid);
mktMarketingUrl.setCreateTime(DateUtil.getCurrentTimeSecond());
//对于渠道类型是个人的话,则uniontType手动赋值,最小值从10000开始 -- platform的逻辑copy过来
Long maxUnionType = this.mktMarketingUrlDAO.selectMaxPersonalUnionType();
maxUnionType = (null == maxUnionType) ? 10000 : maxUnionType+1;
mktMarketingUrl.setUnionType(maxUnionType);
return mktMarketingUrl;
}
/**
* 用户登录时获取对应的渠道号
... ... @@ -296,6 +441,7 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport
//设置返回文案
bo.setShareId(configReader.getString(UNION_SHAREID, ""));
bo.setImageUrl(configReader.getString(UNION_CPS_IMAGEURL, ""));
bo.setApplyImageUrl(configReader.getString(UNION_CPS_APPLY_IMAGEURL, ""));
//设置缓存
addToRedis(ShareOrdersKeyEnum.UNION_TYPE, uid, bo, key);
... ... @@ -330,6 +476,20 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport
logger.info("getBankList");
return BankEnum.getAllBank();
}
/**
* 获取银行列表
* @return
*/
@Override
public Map<String,JSONArray> getSocialMediaBasicParams(){
logger.info("getBankList");
Map<String, JSONArray> result = new HashMap<>();
result.put("section", SocialMediaSectionEnum.getAllSectionArray("-"));
result.put("mediaType", SocialMediaTypeEnum.getAllTypeArray());
return result;
}
/**
* 绑定银行卡
* @param bo
... ...
union.newUserRebatesRatio=10
union.oldUserRebatesRatio=3
union.shareId = 4649
union.cps.ImageUrl = http://img12.static.yhbimg.com/article/2018/05/29/20/02044ae38a825a2faee5fcbd84eeab20a5.jpg
\ No newline at end of file
union.cps.ImageUrl = http://img12.static.yhbimg.com/article/2018/05/29/20/02044ae38a825a2faee5fcbd84eeab20a5.jpg
union.cps.applyImageUrl = http://img10.static.yhbimg.com/article/2018/05/23/16/017c0037ac8304c204686f5045c5eb9769.jpeg
\ No newline at end of file
... ...
... ... @@ -14,37 +14,19 @@
<form id="searchForm" method="post" accept-charset="utf-8">
<div style="margin-left: 10px;margin-top: 10px">
<label>用户ID:</label>
<input class="easyui-textbox" id="uid" name="uid">
</input>
<input class="easyui-textbox" id="uid" name="uid"/>
<label>姓名:</label>
<input class="easyui-textbox" id="name" name="name">
</input>
<input class="easyui-textbox" id="name" name="name"/>
<label>手机:</label>
<input class="easyui-textbox" id="mobile" name="mobile"/>
<label>社交媒体:</label>
<input class="easyui-combobox" id="socialMediaType" name="socialMediaType"
data-options="valueField: 'value',
textField: 'label',
data: [{
label: '微信公众号',
value: '1'
},{
label: '抖音',
value: '2'
}]">
<input class="easyui-combobox" id="socialMediaType" name="socialMediaType">
</input>
<label>社交媒体账号:</label>
<input class="easyui-textbox" id="socialMediaAccount" name="socialMediaAccount">
</input>
<label>社交媒体粉丝数:</label>
<input class="easyui-combobox" id="socialMediaFans" name="socialMediaFans"
data-options="valueField: 'value',
textField: 'label',
data: [{
label: '1-10000',
value: '1'
},{
label: '10001-20000',
value: '2'
}]">
<input class="easyui-combobox" id="socialMediaFans" name="socialMediaFans">
</input>
<label>状态:</label>
<input class="easyui-combobox" id="status" name="status"
... ... @@ -61,31 +43,50 @@
value: '3'
}]">
</input>
<label>是否已删除:</label>
<input class="easyui-combobox" id="delFlag" name="delFlag"
data-options="valueField: 'value',
textField: 'label',
data: [{
label: '已删除',
value: '0'
},{
label: '未删除',
value: '1'
}]">
</input>
<a id="searchBtn" style="margin-left: 20px" class="easyui-linkbutton btn-primary" data-options="iconCls:'icon-more'">查询</a>
</div>
</form>
</div>
<div region="center">
<div style="margin-left: 30px;margin-top: 20px; height: 500px;">
<table id="userOrdersTable"></table>
<table id="userApplyTable"></table>
</div>
</div>
<script type="text/javascript">
var checkedItems = [];
$(function () {
$("#userOrdersTable").myDatagrid({
var _socialMediaTypeSelector = $("#socialMediaType");
var _socialMediaFansSelector = $("#socialMediaFans");
$.ajax({
type: 'POST',
url: contextPath + "/UnionShareRest/getSocialMediaBasicParams",
//data: JSON.stringify(formData),
async: true,
dataType: 'json',
contentType: "application/json; charset=utf-8",
success: function(res) {
//$.messager.progress("close");
if (res.code == 200) {
if(res.data){
_socialMediaTypeSelector.combobox({valueField: 'type',
textField: 'name',
data:res.data.mediaType});
_socialMediaFansSelector.combobox({valueField: 'no',
textField: 'desc',
data:res.data.section});
}
} else {
$.messager.alert("失败", res.message, "error");
}
},
error:function(res){
$.messager.alert("失败", "加载所属业务,请刷新页面重试", "error");
return false;
}
});
$("#userApplyTable").myDatagrid({
fit: true,
fitColumns: true,
<!-- idField: "id",-->
... ... @@ -121,6 +122,11 @@
width: 200,
align: "center"
}, {
title: "手机号",
field: "mobile",
width: 200,
align: "center"
}, {
title: "社交媒体",
field: "socialMediaType",
width: 200,
... ... @@ -139,14 +145,19 @@
title: "状态",
field: "status",
width: 200,
align: "center"
}, {
title: "是否已删除",
field: "delFlag",
width: 200,
align: "center"
align: "center",
formatter: function (value, rowData, rowIndex) {
//状态:1-申请中,2-通过,3-拒绝
if(rowData.status == 1) {
return "申请中";
}else if(rowData.status == 2) {
return "通过";
}else if(rowData.status == 3) {
return "拒绝";
}
}
}, {
title: "创建时间",
title: "申请时间",
field: "createTime",
width: 200,
align: "center"
... ... @@ -155,6 +166,19 @@
field: "checkTime",
width: 200,
align: "center"
}, {
title: "操作",
field: "asdf",
width: 200,
align: "center",
formatter: function (value, rowData, rowIndex) {
//状态:1-申请中,2-通过,3-拒绝
if(rowData.status == 1) {
var str = "<a role='pass' dataId='" + rowData.id + "' style='margin-left:10px'>通过</a>";
str += "<a role='refuse' dataId='" + rowData.id + "' style='margin-left:10px'>拒绝</a>";
return str;
}
}
}
]],
cache: false,
... ... @@ -166,9 +190,79 @@
checkOnSelect: false,
onLoadSuccess: function (data) {
resetSelectedCheckBox(data);
$(this).myDatagrid("getPanel").find("a[role='pass']").linkbutton({
iconCls: "icon-more",
onClick: function () {
var cancleId=$(this).attr("dataId");
pass(cancleId);
}
});
$(this).myDatagrid("getPanel").find("a[role='refuse']").linkbutton({
iconCls: "icon-more",
onClick: function () {
var cancleId=$(this).attr("dataId");
refuse(cancleId);
}
});
}
});
function pass(id) {
var paramObj={};
if(id==null) {
paramObj.idArray = checkedItems;
}else {
paramObj.id = id;
}
$.post(contextPath + "/UnionShareRest/agreeApply", paramObj, function (res) {
$.messager.progress("close");
if (res.code == 200) {
if(res.data > 0) {
$.messager.show({
title: "提示",
msg: "通过成功!",
height: 120
});
}else {
$.messager.alert("失败", "操作失败,请重新操作", "error");
}
$("#searchBtn").click();
} else {
$.messager.alert("失败", res.message, "error");
}
}, "json");
}
function refuse(id) {
var paramObj={};
if(id==null) {
paramObj.idArray = checkedItems;
}else {
paramObj.id = id;
}
$.post(contextPath + "/UnionShareRest/refuseApply", paramObj, function (res) {
$.messager.progress("close");
if (res.code == 200) {
if(res.data > 0) {
$.messager.show({
title: "提示",
msg: "拒绝成功!",
height: 120
});
}else {
$.messager.alert("失败", "操作失败,请重新操作", "error");
}
$("#searchBtn").click();
} else {
$.messager.alert("失败", res.message, "error");
}
}, "json");
}
function resetSelectedCheckBox(data){
$("input[type='checkbox'][name='id']").each(function () {
var cb=$(this);
... ... @@ -192,9 +286,9 @@
socialMediaAccount:$("#socialMediaAccount").val(),
socialMediaFans:$("#socialMediaFans").combobox('getValue'),
status:$("#status").combobox('getValue'),
delFlag:$("#delFlag").combobox('getValue')
mobile:$("#mobile").val()
};
$("#userOrdersTable").myDatagrid("load", param);
$("#userApplyTable").myDatagrid("load", param);
}
});
... ...
... ... @@ -17,20 +17,29 @@
<label>分享人ID:</label>
<input class="easyui-textbox" id="uid" name="uid">
</input>
<label>身份证号:</label>
<input class="easyui-textbox" id="idCardNo" name="idCardNo">
</input>
<label>持卡人姓名:</label>
<input class="easyui-textbox" id="name" name="name">
</input>
<label>身份证号:</label>
<input class="easyui-textbox" id="idCardNo" name="idCardNo" style="width:300px">
</input>
<label>银行卡号:</label>
<input class="easyui-textbox" id="bankCardNo" name="bankCardNo">
<input class="easyui-textbox" id="bankCardNo" name="bankCardNo" style="width:300px">
</input>
<label>银行:</label>
<input class="easyui-textbox" id="bankName" name="bankName">
<input class="easyui-combobox" id="bankCode" name="bankCode">
</input>
<label>银行代码:</label>
<input class="easyui-textbox" id="bankCode" name="bankCode">
<label>状态:</label>
<input class="easyui-combobox" id="status" name="status"
data-options="valueField: 'value',
textField: 'label',
data: [{
label: '正常',
value: '1'
},{
label: '作废',
value: '0'
}]">
</input>
<a id="searchBtn" style="margin-left: 20px" class="easyui-linkbutton btn-primary" data-options="iconCls:'icon-more'">查询</a>
... ... @@ -45,6 +54,33 @@
<script type="text/javascript">
var checkedItems = [];
$(function () {
var _bankCodeSelector = $("#bankCode");
$.ajax({
type: 'POST',
url: contextPath + "/UnionShareRest/getBankList",
//data: JSON.stringify(formData),
async: true,
dataType: 'json',
contentType: "application/json; charset=utf-8",
success: function(res) {
//$.messager.progress("close");
debugger;
if (res.code == 200) {
if(res.data){
_bankCodeSelector.combobox({valueField: 'bankCode',
textField: 'bankName',
data:res.data});
}
} else {
$.messager.alert("失败", res.message, "error");
}
},
error:function(res){
$.messager.alert("失败", "加载所属业务,请刷新页面重试", "error");
return false;
}
});
$("#userOrdersTable").myDatagrid({
fit: true,
fitColumns: true,
... ... @@ -96,15 +132,17 @@
width: 200,
align: "center"
}, {
title: "银行代码",
field: "bankCode",
width: 200,
align: "center"
}, {
title: "状态",
field: "status",
width: 200,
align: "center"
align: "center",
formatter: function (value, rowData, rowIndex) {
if(rowData.status == 1) {
return "正常";
}else if(rowData.status == 0) {
return "作废";
}
}
}, {
title: "创建时间",
field: "createTime",
... ... @@ -115,6 +153,17 @@
field: "updateTime",
width: 200,
align: "center"
}, {
title: "操作",
field: "asdf",
width: 200,
align: "center",
formatter: function (value, rowData, rowIndex) {
if(rowData.status == 1) {
var str = "<a role='cancel' dataId='" + rowData.id + "' style='margin-left:10px'>作废</a>";
return str;
}
}
}
]],
cache: false,
... ... @@ -126,6 +175,30 @@
checkOnSelect: false,
onLoadSuccess: function (data) {
resetSelectedCheckBox(data);
$(this).myDatagrid("getPanel").find("a[role='cancel']").linkbutton({
iconCls: "icon-more",
onClick: function () {
var cancleId=$(this).attr("dataId");
$.post(contextPath + "/UnionShareRest/cancelUserBanks", {id: cancleId}, function (res) {
$.messager.progress("close");
if (res.code == 200) {
if(res.data > 0) {
$.messager.show({
title: "提示",
msg: "操作成功!",
height: 120
});
}else {
$.messager.alert("失败", "操作失败,请重新操作", "error");
}
$("#searchBtn").click();
} else {
$.messager.alert("失败", res.message, "error");
}
}, "json");
}
});
}
});
... ... @@ -150,8 +223,8 @@
name:$("#name").val(),
idCardNo:$("#idCardNo").val(),
bankCardNo:$("#bankCardNo").val(),
bankName:$("#bankName").val(),
bankCode:$("#bankCode").val()
status:$("#status").combobox('getValue'),
bankCode:$("#bankCode").combobox('getValue')
};
$("#userOrdersTable").myDatagrid("load", param);
}
... ...