Authored by mingdan.ge

cps马甲后台

... ... @@ -21,6 +21,7 @@ public interface UnionShareOrdersMonthMapper {
List<UnionShareOrdersMonth> selectMonthData(@Param("date") int date, @Param("promoteUid") Integer promoteUid, @Param("type") Integer type);
List<UninoShareIncomeBo> selectMonthRankList(@Param("date") int date, @Param("start") Integer start, @Param("size") Integer size);
List<UninoShareIncomeBo> selectTotalRankList(@Param("start") Integer start, @Param("size") Integer size);
List<UnionShareOrdersMonth> selectSelective(UnionShareOrdersMonth record);
BigDecimal selectAmountByUid(@Param("date") Integer date, @Param("promoteUid") Integer promoteUid, @Param("type") Integer type);
... ...
... ... @@ -5,6 +5,7 @@
<id column="id" property="id" jdbcType="INTEGER" />
<result column="uid" property="uid" jdbcType="INTEGER" />
<result column="type" property="type" jdbcType="INTEGER" />
<result column="alias" property="alias" jdbcType="VARCHAR" />
<result column="nickname" property="nickname" jdbcType="VARCHAR" />
<result column="image" property="image" jdbcType="VARCHAR" />
<result column="date" property="date" jdbcType="INTEGER" />
... ... @@ -16,7 +17,7 @@
<result column="update_time" property="updateTime" jdbcType="INTEGER" />
</resultMap>
<sql id="Base_Column_List" >
id, uid, type, nickname, image, date, amount, order_amount, extra_amount, order_num,
id, uid, type, alias, nickname, image, date, amount, order_amount, extra_amount, order_num,
create_time, update_time
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
... ... @@ -40,19 +41,26 @@
limit 100
</select>
<select id="selectMonthRankList" resultType="com.yoho.service.model.union.bo.UninoShareIncomeBo" >
select amount ,uid,nickname,image,order_num as orderNum
select amount ,uid,alias,nickname,image,order_num as orderNum
from union_share_orders_month
where date=#{date,jdbcType=INTEGER}
order by amount desc
limit #{start},#{size}
</select>
<select id="selectTotalRankList" resultType="com.yoho.service.model.union.bo.UninoShareIncomeBo" >
select sum(amount) as amount ,uid,nickname,image,order_num as orderNum
select sum(amount) as amount ,uid,alias,nickname,image,order_num as orderNum
from union_share_orders_month
group by uid
order by sum(amount) desc
limit #{start},#{size}
</select>
<select id="selectSelective" resultMap="BaseResultMap" >
select
<include refid="Base_Column_List" />
from union_share_orders_month
where type = #{type,jdbcType=INTEGER} and alias = #{alias,jdbcType=VARCHAR} and date = #{date,jdbcType=INTEGER}
limit 10
</select>
<select id="selectAmountByUid" resultType="java.math.BigDecimal" >
select sum(amount)
from union_share_orders_month
... ... @@ -67,12 +75,12 @@
</delete>
<insert id="insert" parameterType="com.yoho.unions.dal.model.UnionShareOrdersMonth" >
insert into union_share_orders_month (id, uid, type,
nickname, image, date,
alias, nickname, image, date,
amount, order_amount, extra_amount,
order_num, create_time, update_time
)
values (#{id,jdbcType=INTEGER}, #{uid,jdbcType=INTEGER}, #{type,jdbcType=INTEGER},
#{nickname,jdbcType=INTEGER}, #{image,jdbcType=INTEGER}, #{date,jdbcType=INTEGER},
#{alias,jdbcType=VARCHAR}, #{nickname,jdbcType=VARCHAR}, #{image,jdbcType=VARCHAR}, #{date,jdbcType=INTEGER},
#{amount,jdbcType=DECIMAL}, #{orderAmount,jdbcType=DECIMAL}, #{extraAmount,jdbcType=DECIMAL},
#{orderNum,jdbcType=INTEGER}, #{createTime,jdbcType=INTEGER}, #{updateTime,jdbcType=INTEGER}
)
... ... @@ -89,6 +97,9 @@
<if test="type != null" >
type,
</if>
<if test="alias != null" >
alias,
</if>
<if test="nickname != null" >
nickname,
</if>
... ... @@ -127,11 +138,14 @@
<if test="type != null" >
#{type,jdbcType=INTEGER},
</if>
<if test="alias != null" >
#{alias,jdbcType=VARCHAR},
</if>
<if test="nickname != null" >
#{nickname,jdbcType=INTEGER},
#{nickname,jdbcType=VARCHAR},
</if>
<if test="image != null" >
#{image,jdbcType=INTEGER},
#{image,jdbcType=VARCHAR},
</if>
<if test="date != null" >
#{date,jdbcType=INTEGER},
... ... @@ -159,8 +173,11 @@
<update id="updateByUidAndMonth" parameterType="com.yoho.unions.dal.model.UnionShareOrdersMonth" >
update union_share_orders_month
<set >
<if test="alias != null" >
alias = #{alias,jdbcType=VARCHAR},
</if>
<if test="nickname != null" >
nickname = #{nickname,jdbcType=INTEGER},
nickname = #{nickname,jdbcType=VARCHAR},
</if>
<if test="image != null" >
image = #{image,jdbcType=INTEGER},
... ... @@ -193,11 +210,14 @@
<if test="type != null" >
type = #{type,jdbcType=INTEGER},
</if>
<if test="alias != null" >
alias = #{alias,jdbcType=VARCHAR},
</if>
<if test="nickname != null" >
nickname = #{nickname,jdbcType=INTEGER},
nickname = #{nickname,jdbcType=VARCHAR},
</if>
<if test="image != null" >
image = #{image,jdbcType=INTEGER},
image = #{image,jdbcType=VARCHAR},
</if>
<if test="date != null" >
date = #{date,jdbcType=INTEGER},
... ... @@ -227,8 +247,9 @@
update union_share_orders_month
set uid = #{uid,jdbcType=INTEGER},
type = #{type,jdbcType=INTEGER},
nickname = #{nickname,jdbcType=INTEGER},
image = #{image,jdbcType=INTEGER},
alias = #{alias,jdbcType=VARCHAR},
nickname = #{nickname,jdbcType=VARCHAR},
image = #{image,jdbcType=VARCHAR},
date = #{date,jdbcType=INTEGER},
amount = #{amount,jdbcType=DECIMAL},
order_amount = #{orderAmount,jdbcType=DECIMAL},
... ... @@ -243,6 +264,9 @@
<if test="uid != null">
and uid = #{uid}
</if>
<if test="alias != null">
and alias = #{alias}
</if>
<if test="type != null">
and type = #{type}
</if>
... ...
... ... @@ -60,6 +60,13 @@ public class UnionShareOrdersMonthImportServiceImpl implements IBusinessImportSe
unionShareOrdersMonth.setUpdateTime(unionShareOrdersMonth.getCreateTime());
unionShareOrdersMonthList.add(unionShareOrdersMonth);
unionShareOrdersMonth.setId(null);
List<UnionShareOrdersMonth> list = unionShareOrdersMonthMapper.selectSelective(unionShareOrdersMonth);
if(CollectionUtils.isEmpty(list)) {
unionShareOrdersMonthMapper.insertSelective(unionShareOrdersMonth);
}else {
unionShareOrdersMonth.setId(list.get(0).getId());
unionShareOrdersMonthMapper.updateByPrimaryKeySelective(unionShareOrdersMonth);
}
}
// List<UnionShareOrdersMonth> vestList = new ArrayList<>();
... ... @@ -91,22 +98,22 @@ public class UnionShareOrdersMonthImportServiceImpl implements IBusinessImportSe
// }
//联盟用户查询数据库是否已经存在,存在则更新,不存在则增加
if(CollectionUtils.isNotEmpty(unionShareOrdersMonthList)) {
for(UnionShareOrdersMonth item : unionShareOrdersMonthList) {
UnionShareOrdersMonthReqBO req = new UnionShareOrdersMonthReqBO();
req.setUid(item.getUid());
req.setBeginDate(item.getDate());
req.setEndDate(item.getDate());
List<UnionShareOrdersMonth> list = unionShareOrdersMonthMapper.selectByCondition(req);
if(CollectionUtils.isEmpty(list)) {
unionShareOrdersMonthMapper.insertSelective(item);
}else {
unionShareOrdersMonthMapper.updateByPrimaryKeySelective(item);
}
}
}
// if(CollectionUtils.isNotEmpty(unionShareOrdersMonthList)) {
// for(UnionShareOrdersMonth item : unionShareOrdersMonthList) {
// UnionShareOrdersMonthReqBO req = new UnionShareOrdersMonthReqBO();
// req.setUid(item.getUid());
// req.setBeginDate(item.getDate());
// req.setEndDate(item.getDate());
// List<UnionShareOrdersMonth> list = unionShareOrdersMonthMapper.selectByCondition(req);
// if(CollectionUtils.isEmpty(list)) {
// unionShareOrdersMonthMapper.insertSelective(item);
// }else {
// unionShareOrdersMonthMapper.updateByPrimaryKeySelective(item);
// }
// }
// }
logger.debug("method batchImport(List<Object>) out.");
logger.info("method batchImport(List<Object>) out.");
return null;
}
... ...
... ... @@ -2244,6 +2244,9 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport
@Override
public PageResponseBO<UnionShareOrdersMonth> queryUnionShareOrdersMonthList(UnionShareOrdersMonthReqBO req) {
logger.info("queryUnionShareOrdersMonthList.req is {}",req);
if (StringUtils.isBlank(req.getAlias())) {
req.setAlias(null);
}
int total=this.unionShareOrdersMonthMapper.selectTotalByCondition(req);
if(total==0){
logger.info("queryUnionShareOrdersMonthList end.req is {},total is 0",req);
... ...
... ... @@ -16,6 +16,7 @@ qiniu.secretkey=pyoJzPygXIkFWrc1BAsH6tAJ0yweTchpJwGKEwhm
qiniu.domain = test
qiniu.bucket = test
#zkAddress=192.168.102.45:2181
zkAddress=127.0.0.1:2181
# web context
web.context=union
... ...
... ... @@ -11,6 +11,7 @@
<url-pattern>/downapp.jsp</url-pattern>
<url-pattern>/index.jsp</url-pattern>
<url-pattern>/common/ok.jsp</url-pattern>
<url-pattern>/common/unionShareOrdersMonth.xlsx</url-pattern>
<url-pattern>/downapp.html</url-pattern>
<url-pattern>/downiosapp.html</url-pattern>
<url-pattern>/download.html</url-pattern>
... ...
... ... @@ -11,7 +11,7 @@
<td style="font-size: large">批量导入:</td>
<td style="font-size: large">
1、上传文件必须是<span style="color: red">.xlsx</span>文件<br>
2、Excel表头为:<span style="color: blue">id、昵称、头像、年月、预估收入、订单数</span><br>
2、Excel表头为:<span style="color: blue">马甲用户代码、昵称、头像、年月、预估收入、订单数</span><br>
3、第一行为表头内容,第二行开始为正式内容<br>
4、每个文件控制在1000行以内<br>
5、<a id="importA">样例下载</a>
... ... @@ -22,7 +22,7 @@
<script type="text/javascript">
$(function () {
$("#importA").attr("href", contextPath + "/common/userShareOrdersMonth.xlsx");
$("#importA").attr("href", contextPath + "/common/unionShareOrdersMonth.xlsx");
$("#batchImportDiv").fileUpload({
text: "请选择文件", //按钮文字
... ...
... ... @@ -15,6 +15,8 @@
<div style="margin-left: 10px;margin-top: 10px">
<label>用户ID:</label>
<input class="easyui-textbox" id="uid" name="uid"/>
<label>用户代码:</label>
<input class="easyui-textbox" id="alias" name="alias"/>
<label>用户类型:</label>
<input class="easyui-combobox" id="type" name="type"
data-options="valueField: 'value',
... ... @@ -63,11 +65,16 @@
width: 200,
align: "center",
}, {
title: "用户ID",
title: "用户UID",
field: "uid",
width: 200,
align: "center"
}, {
title: "用户代码",
field: "alias",
width: 200,
align: "center"
}, {
title: "昵称",
field: "nickname",
width: 200,
... ... @@ -122,6 +129,7 @@
}
$("#userListTable").datagrid("load", {
uid:$("#uid").val(),
alias:$("#alias").val(),
beginDate: beginDate,
endDate: endDate,
type :$("#type").combobox('getValue'),
... ...