Authored by mingdan.ge

cps马甲后台

@@ -21,6 +21,7 @@ public interface UnionShareOrdersMonthMapper { @@ -21,6 +21,7 @@ public interface UnionShareOrdersMonthMapper {
21 List<UnionShareOrdersMonth> selectMonthData(@Param("date") int date, @Param("promoteUid") Integer promoteUid, @Param("type") Integer type); 21 List<UnionShareOrdersMonth> selectMonthData(@Param("date") int date, @Param("promoteUid") Integer promoteUid, @Param("type") Integer type);
22 List<UninoShareIncomeBo> selectMonthRankList(@Param("date") int date, @Param("start") Integer start, @Param("size") Integer size); 22 List<UninoShareIncomeBo> selectMonthRankList(@Param("date") int date, @Param("start") Integer start, @Param("size") Integer size);
23 List<UninoShareIncomeBo> selectTotalRankList(@Param("start") Integer start, @Param("size") Integer size); 23 List<UninoShareIncomeBo> selectTotalRankList(@Param("start") Integer start, @Param("size") Integer size);
  24 + List<UnionShareOrdersMonth> selectSelective(UnionShareOrdersMonth record);
24 25
25 BigDecimal selectAmountByUid(@Param("date") Integer date, @Param("promoteUid") Integer promoteUid, @Param("type") Integer type); 26 BigDecimal selectAmountByUid(@Param("date") Integer date, @Param("promoteUid") Integer promoteUid, @Param("type") Integer type);
26 27
@@ -5,6 +5,7 @@ @@ -5,6 +5,7 @@
5 <id column="id" property="id" jdbcType="INTEGER" /> 5 <id column="id" property="id" jdbcType="INTEGER" />
6 <result column="uid" property="uid" jdbcType="INTEGER" /> 6 <result column="uid" property="uid" jdbcType="INTEGER" />
7 <result column="type" property="type" jdbcType="INTEGER" /> 7 <result column="type" property="type" jdbcType="INTEGER" />
  8 + <result column="alias" property="alias" jdbcType="VARCHAR" />
8 <result column="nickname" property="nickname" jdbcType="VARCHAR" /> 9 <result column="nickname" property="nickname" jdbcType="VARCHAR" />
9 <result column="image" property="image" jdbcType="VARCHAR" /> 10 <result column="image" property="image" jdbcType="VARCHAR" />
10 <result column="date" property="date" jdbcType="INTEGER" /> 11 <result column="date" property="date" jdbcType="INTEGER" />
@@ -16,7 +17,7 @@ @@ -16,7 +17,7 @@
16 <result column="update_time" property="updateTime" jdbcType="INTEGER" /> 17 <result column="update_time" property="updateTime" jdbcType="INTEGER" />
17 </resultMap> 18 </resultMap>
18 <sql id="Base_Column_List" > 19 <sql id="Base_Column_List" >
19 - id, uid, type, nickname, image, date, amount, order_amount, extra_amount, order_num, 20 + id, uid, type, alias, nickname, image, date, amount, order_amount, extra_amount, order_num,
20 create_time, update_time 21 create_time, update_time
21 </sql> 22 </sql>
22 <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" > 23 <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
@@ -40,19 +41,26 @@ @@ -40,19 +41,26 @@
40 limit 100 41 limit 100
41 </select> 42 </select>
42 <select id="selectMonthRankList" resultType="com.yoho.service.model.union.bo.UninoShareIncomeBo" > 43 <select id="selectMonthRankList" resultType="com.yoho.service.model.union.bo.UninoShareIncomeBo" >
43 - select amount ,uid,nickname,image,order_num as orderNum 44 + select amount ,uid,alias,nickname,image,order_num as orderNum
44 from union_share_orders_month 45 from union_share_orders_month
45 where date=#{date,jdbcType=INTEGER} 46 where date=#{date,jdbcType=INTEGER}
46 order by amount desc 47 order by amount desc
47 limit #{start},#{size} 48 limit #{start},#{size}
48 </select> 49 </select>
49 <select id="selectTotalRankList" resultType="com.yoho.service.model.union.bo.UninoShareIncomeBo" > 50 <select id="selectTotalRankList" resultType="com.yoho.service.model.union.bo.UninoShareIncomeBo" >
50 - select sum(amount) as amount ,uid,nickname,image,order_num as orderNum 51 + select sum(amount) as amount ,uid,alias,nickname,image,order_num as orderNum
51 from union_share_orders_month 52 from union_share_orders_month
52 group by uid 53 group by uid
53 order by sum(amount) desc 54 order by sum(amount) desc
54 limit #{start},#{size} 55 limit #{start},#{size}
55 </select> 56 </select>
  57 + <select id="selectSelective" resultMap="BaseResultMap" >
  58 + select
  59 + <include refid="Base_Column_List" />
  60 + from union_share_orders_month
  61 + where type = #{type,jdbcType=INTEGER} and alias = #{alias,jdbcType=VARCHAR} and date = #{date,jdbcType=INTEGER}
  62 + limit 10
  63 + </select>
56 <select id="selectAmountByUid" resultType="java.math.BigDecimal" > 64 <select id="selectAmountByUid" resultType="java.math.BigDecimal" >
57 select sum(amount) 65 select sum(amount)
58 from union_share_orders_month 66 from union_share_orders_month
@@ -67,12 +75,12 @@ @@ -67,12 +75,12 @@
67 </delete> 75 </delete>
68 <insert id="insert" parameterType="com.yoho.unions.dal.model.UnionShareOrdersMonth" > 76 <insert id="insert" parameterType="com.yoho.unions.dal.model.UnionShareOrdersMonth" >
69 insert into union_share_orders_month (id, uid, type, 77 insert into union_share_orders_month (id, uid, type,
70 - nickname, image, date, 78 + alias, nickname, image, date,
71 amount, order_amount, extra_amount, 79 amount, order_amount, extra_amount,
72 order_num, create_time, update_time 80 order_num, create_time, update_time
73 ) 81 )
74 values (#{id,jdbcType=INTEGER}, #{uid,jdbcType=INTEGER}, #{type,jdbcType=INTEGER}, 82 values (#{id,jdbcType=INTEGER}, #{uid,jdbcType=INTEGER}, #{type,jdbcType=INTEGER},
75 - #{nickname,jdbcType=INTEGER}, #{image,jdbcType=INTEGER}, #{date,jdbcType=INTEGER}, 83 + #{alias,jdbcType=VARCHAR}, #{nickname,jdbcType=VARCHAR}, #{image,jdbcType=VARCHAR}, #{date,jdbcType=INTEGER},
76 #{amount,jdbcType=DECIMAL}, #{orderAmount,jdbcType=DECIMAL}, #{extraAmount,jdbcType=DECIMAL}, 84 #{amount,jdbcType=DECIMAL}, #{orderAmount,jdbcType=DECIMAL}, #{extraAmount,jdbcType=DECIMAL},
77 #{orderNum,jdbcType=INTEGER}, #{createTime,jdbcType=INTEGER}, #{updateTime,jdbcType=INTEGER} 85 #{orderNum,jdbcType=INTEGER}, #{createTime,jdbcType=INTEGER}, #{updateTime,jdbcType=INTEGER}
78 ) 86 )
@@ -89,6 +97,9 @@ @@ -89,6 +97,9 @@
89 <if test="type != null" > 97 <if test="type != null" >
90 type, 98 type,
91 </if> 99 </if>
  100 + <if test="alias != null" >
  101 + alias,
  102 + </if>
92 <if test="nickname != null" > 103 <if test="nickname != null" >
93 nickname, 104 nickname,
94 </if> 105 </if>
@@ -127,11 +138,14 @@ @@ -127,11 +138,14 @@
127 <if test="type != null" > 138 <if test="type != null" >
128 #{type,jdbcType=INTEGER}, 139 #{type,jdbcType=INTEGER},
129 </if> 140 </if>
  141 + <if test="alias != null" >
  142 + #{alias,jdbcType=VARCHAR},
  143 + </if>
130 <if test="nickname != null" > 144 <if test="nickname != null" >
131 - #{nickname,jdbcType=INTEGER}, 145 + #{nickname,jdbcType=VARCHAR},
132 </if> 146 </if>
133 <if test="image != null" > 147 <if test="image != null" >
134 - #{image,jdbcType=INTEGER}, 148 + #{image,jdbcType=VARCHAR},
135 </if> 149 </if>
136 <if test="date != null" > 150 <if test="date != null" >
137 #{date,jdbcType=INTEGER}, 151 #{date,jdbcType=INTEGER},
@@ -159,8 +173,11 @@ @@ -159,8 +173,11 @@
159 <update id="updateByUidAndMonth" parameterType="com.yoho.unions.dal.model.UnionShareOrdersMonth" > 173 <update id="updateByUidAndMonth" parameterType="com.yoho.unions.dal.model.UnionShareOrdersMonth" >
160 update union_share_orders_month 174 update union_share_orders_month
161 <set > 175 <set >
  176 + <if test="alias != null" >
  177 + alias = #{alias,jdbcType=VARCHAR},
  178 + </if>
162 <if test="nickname != null" > 179 <if test="nickname != null" >
163 - nickname = #{nickname,jdbcType=INTEGER}, 180 + nickname = #{nickname,jdbcType=VARCHAR},
164 </if> 181 </if>
165 <if test="image != null" > 182 <if test="image != null" >
166 image = #{image,jdbcType=INTEGER}, 183 image = #{image,jdbcType=INTEGER},
@@ -193,11 +210,14 @@ @@ -193,11 +210,14 @@
193 <if test="type != null" > 210 <if test="type != null" >
194 type = #{type,jdbcType=INTEGER}, 211 type = #{type,jdbcType=INTEGER},
195 </if> 212 </if>
  213 + <if test="alias != null" >
  214 + alias = #{alias,jdbcType=VARCHAR},
  215 + </if>
196 <if test="nickname != null" > 216 <if test="nickname != null" >
197 - nickname = #{nickname,jdbcType=INTEGER}, 217 + nickname = #{nickname,jdbcType=VARCHAR},
198 </if> 218 </if>
199 <if test="image != null" > 219 <if test="image != null" >
200 - image = #{image,jdbcType=INTEGER}, 220 + image = #{image,jdbcType=VARCHAR},
201 </if> 221 </if>
202 <if test="date != null" > 222 <if test="date != null" >
203 date = #{date,jdbcType=INTEGER}, 223 date = #{date,jdbcType=INTEGER},
@@ -227,8 +247,9 @@ @@ -227,8 +247,9 @@
227 update union_share_orders_month 247 update union_share_orders_month
228 set uid = #{uid,jdbcType=INTEGER}, 248 set uid = #{uid,jdbcType=INTEGER},
229 type = #{type,jdbcType=INTEGER}, 249 type = #{type,jdbcType=INTEGER},
230 - nickname = #{nickname,jdbcType=INTEGER},  
231 - image = #{image,jdbcType=INTEGER}, 250 + alias = #{alias,jdbcType=VARCHAR},
  251 + nickname = #{nickname,jdbcType=VARCHAR},
  252 + image = #{image,jdbcType=VARCHAR},
232 date = #{date,jdbcType=INTEGER}, 253 date = #{date,jdbcType=INTEGER},
233 amount = #{amount,jdbcType=DECIMAL}, 254 amount = #{amount,jdbcType=DECIMAL},
234 order_amount = #{orderAmount,jdbcType=DECIMAL}, 255 order_amount = #{orderAmount,jdbcType=DECIMAL},
@@ -243,6 +264,9 @@ @@ -243,6 +264,9 @@
243 <if test="uid != null"> 264 <if test="uid != null">
244 and uid = #{uid} 265 and uid = #{uid}
245 </if> 266 </if>
  267 + <if test="alias != null">
  268 + and alias = #{alias}
  269 + </if>
246 <if test="type != null"> 270 <if test="type != null">
247 and type = #{type} 271 and type = #{type}
248 </if> 272 </if>
@@ -60,6 +60,13 @@ public class UnionShareOrdersMonthImportServiceImpl implements IBusinessImportSe @@ -60,6 +60,13 @@ public class UnionShareOrdersMonthImportServiceImpl implements IBusinessImportSe
60 unionShareOrdersMonth.setUpdateTime(unionShareOrdersMonth.getCreateTime()); 60 unionShareOrdersMonth.setUpdateTime(unionShareOrdersMonth.getCreateTime());
61 unionShareOrdersMonthList.add(unionShareOrdersMonth); 61 unionShareOrdersMonthList.add(unionShareOrdersMonth);
62 unionShareOrdersMonth.setId(null); 62 unionShareOrdersMonth.setId(null);
  63 + List<UnionShareOrdersMonth> list = unionShareOrdersMonthMapper.selectSelective(unionShareOrdersMonth);
  64 + if(CollectionUtils.isEmpty(list)) {
  65 + unionShareOrdersMonthMapper.insertSelective(unionShareOrdersMonth);
  66 + }else {
  67 + unionShareOrdersMonth.setId(list.get(0).getId());
  68 + unionShareOrdersMonthMapper.updateByPrimaryKeySelective(unionShareOrdersMonth);
  69 + }
63 } 70 }
64 71
65 // List<UnionShareOrdersMonth> vestList = new ArrayList<>(); 72 // List<UnionShareOrdersMonth> vestList = new ArrayList<>();
@@ -91,22 +98,22 @@ public class UnionShareOrdersMonthImportServiceImpl implements IBusinessImportSe @@ -91,22 +98,22 @@ public class UnionShareOrdersMonthImportServiceImpl implements IBusinessImportSe
91 // } 98 // }
92 99
93 //联盟用户查询数据库是否已经存在,存在则更新,不存在则增加 100 //联盟用户查询数据库是否已经存在,存在则更新,不存在则增加
94 - if(CollectionUtils.isNotEmpty(unionShareOrdersMonthList)) {  
95 - for(UnionShareOrdersMonth item : unionShareOrdersMonthList) {  
96 - UnionShareOrdersMonthReqBO req = new UnionShareOrdersMonthReqBO();  
97 - req.setUid(item.getUid());  
98 - req.setBeginDate(item.getDate());  
99 - req.setEndDate(item.getDate());  
100 - List<UnionShareOrdersMonth> list = unionShareOrdersMonthMapper.selectByCondition(req);  
101 - if(CollectionUtils.isEmpty(list)) {  
102 - unionShareOrdersMonthMapper.insertSelective(item);  
103 - }else {  
104 - unionShareOrdersMonthMapper.updateByPrimaryKeySelective(item);  
105 - }  
106 - }  
107 - } 101 +// if(CollectionUtils.isNotEmpty(unionShareOrdersMonthList)) {
  102 +// for(UnionShareOrdersMonth item : unionShareOrdersMonthList) {
  103 +// UnionShareOrdersMonthReqBO req = new UnionShareOrdersMonthReqBO();
  104 +// req.setUid(item.getUid());
  105 +// req.setBeginDate(item.getDate());
  106 +// req.setEndDate(item.getDate());
  107 +// List<UnionShareOrdersMonth> list = unionShareOrdersMonthMapper.selectByCondition(req);
  108 +// if(CollectionUtils.isEmpty(list)) {
  109 +// unionShareOrdersMonthMapper.insertSelective(item);
  110 +// }else {
  111 +// unionShareOrdersMonthMapper.updateByPrimaryKeySelective(item);
  112 +// }
  113 +// }
  114 +// }
108 115
109 - logger.debug("method batchImport(List<Object>) out."); 116 + logger.info("method batchImport(List<Object>) out.");
110 return null; 117 return null;
111 } 118 }
112 119
@@ -2244,6 +2244,9 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport @@ -2244,6 +2244,9 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport
2244 @Override 2244 @Override
2245 public PageResponseBO<UnionShareOrdersMonth> queryUnionShareOrdersMonthList(UnionShareOrdersMonthReqBO req) { 2245 public PageResponseBO<UnionShareOrdersMonth> queryUnionShareOrdersMonthList(UnionShareOrdersMonthReqBO req) {
2246 logger.info("queryUnionShareOrdersMonthList.req is {}",req); 2246 logger.info("queryUnionShareOrdersMonthList.req is {}",req);
  2247 + if (StringUtils.isBlank(req.getAlias())) {
  2248 + req.setAlias(null);
  2249 + }
2247 int total=this.unionShareOrdersMonthMapper.selectTotalByCondition(req); 2250 int total=this.unionShareOrdersMonthMapper.selectTotalByCondition(req);
2248 if(total==0){ 2251 if(total==0){
2249 logger.info("queryUnionShareOrdersMonthList end.req is {},total is 0",req); 2252 logger.info("queryUnionShareOrdersMonthList end.req is {},total is 0",req);
@@ -16,6 +16,7 @@ qiniu.secretkey=pyoJzPygXIkFWrc1BAsH6tAJ0yweTchpJwGKEwhm @@ -16,6 +16,7 @@ qiniu.secretkey=pyoJzPygXIkFWrc1BAsH6tAJ0yweTchpJwGKEwhm
16 qiniu.domain = test 16 qiniu.domain = test
17 qiniu.bucket = test 17 qiniu.bucket = test
18 18
  19 +#zkAddress=192.168.102.45:2181
19 zkAddress=127.0.0.1:2181 20 zkAddress=127.0.0.1:2181
20 # web context 21 # web context
21 web.context=union 22 web.context=union
@@ -11,6 +11,7 @@ @@ -11,6 +11,7 @@
11 <url-pattern>/downapp.jsp</url-pattern> 11 <url-pattern>/downapp.jsp</url-pattern>
12 <url-pattern>/index.jsp</url-pattern> 12 <url-pattern>/index.jsp</url-pattern>
13 <url-pattern>/common/ok.jsp</url-pattern> 13 <url-pattern>/common/ok.jsp</url-pattern>
  14 + <url-pattern>/common/unionShareOrdersMonth.xlsx</url-pattern>
14 <url-pattern>/downapp.html</url-pattern> 15 <url-pattern>/downapp.html</url-pattern>
15 <url-pattern>/downiosapp.html</url-pattern> 16 <url-pattern>/downiosapp.html</url-pattern>
16 <url-pattern>/download.html</url-pattern> 17 <url-pattern>/download.html</url-pattern>
@@ -11,7 +11,7 @@ @@ -11,7 +11,7 @@
11 <td style="font-size: large">批量导入:</td> 11 <td style="font-size: large">批量导入:</td>
12 <td style="font-size: large"> 12 <td style="font-size: large">
13 1、上传文件必须是<span style="color: red">.xlsx</span>文件<br> 13 1、上传文件必须是<span style="color: red">.xlsx</span>文件<br>
14 - 2、Excel表头为:<span style="color: blue">id、昵称、头像、年月、预估收入、订单数</span><br> 14 + 2、Excel表头为:<span style="color: blue">马甲用户代码、昵称、头像、年月、预估收入、订单数</span><br>
15 3、第一行为表头内容,第二行开始为正式内容<br> 15 3、第一行为表头内容,第二行开始为正式内容<br>
16 4、每个文件控制在1000行以内<br> 16 4、每个文件控制在1000行以内<br>
17 5、<a id="importA">样例下载</a> 17 5、<a id="importA">样例下载</a>
@@ -22,7 +22,7 @@ @@ -22,7 +22,7 @@
22 22
23 <script type="text/javascript"> 23 <script type="text/javascript">
24 $(function () { 24 $(function () {
25 - $("#importA").attr("href", contextPath + "/common/userShareOrdersMonth.xlsx"); 25 + $("#importA").attr("href", contextPath + "/common/unionShareOrdersMonth.xlsx");
26 26
27 $("#batchImportDiv").fileUpload({ 27 $("#batchImportDiv").fileUpload({
28 text: "请选择文件", //按钮文字 28 text: "请选择文件", //按钮文字
@@ -15,6 +15,8 @@ @@ -15,6 +15,8 @@
15 <div style="margin-left: 10px;margin-top: 10px"> 15 <div style="margin-left: 10px;margin-top: 10px">
16 <label>用户ID:</label> 16 <label>用户ID:</label>
17 <input class="easyui-textbox" id="uid" name="uid"/> 17 <input class="easyui-textbox" id="uid" name="uid"/>
  18 + <label>用户代码:</label>
  19 + <input class="easyui-textbox" id="alias" name="alias"/>
18 <label>用户类型:</label> 20 <label>用户类型:</label>
19 <input class="easyui-combobox" id="type" name="type" 21 <input class="easyui-combobox" id="type" name="type"
20 data-options="valueField: 'value', 22 data-options="valueField: 'value',
@@ -63,11 +65,16 @@ @@ -63,11 +65,16 @@
63 width: 200, 65 width: 200,
64 align: "center", 66 align: "center",
65 }, { 67 }, {
66 - title: "用户ID", 68 + title: "用户UID",
67 field: "uid", 69 field: "uid",
68 width: 200, 70 width: 200,
69 align: "center" 71 align: "center"
70 }, { 72 }, {
  73 + title: "用户代码",
  74 + field: "alias",
  75 + width: 200,
  76 + align: "center"
  77 + }, {
71 title: "昵称", 78 title: "昵称",
72 field: "nickname", 79 field: "nickname",
73 width: 200, 80 width: 200,
@@ -122,6 +129,7 @@ @@ -122,6 +129,7 @@
122 } 129 }
123 $("#userListTable").datagrid("load", { 130 $("#userListTable").datagrid("load", {
124 uid:$("#uid").val(), 131 uid:$("#uid").val(),
  132 + alias:$("#alias").val(),
125 beginDate: beginDate, 133 beginDate: beginDate,
126 endDate: endDate, 134 endDate: endDate,
127 type :$("#type").combobox('getValue'), 135 type :$("#type").combobox('getValue'),