Commit c490ed73 by YG8429

用户管理添加分配客服功能

parent 1bd2829f
......@@ -99,4 +99,19 @@ public class SCleanConsumerController extends BaseController
{
return toAjax(sConsumerService.deleteCleanConsumerByIds(ids));
}
/**
* 查询店员用户列表
*/
// @PreAuthorize("@ss.hasPermi('system:cleanConsumer:list')")
@GetMapping("/query")
public TableDataInfo query(SConsumer sConsumer)
{
// sConsumer.setRoleType(RoleTypeEnum.CLEANER.getCode());
startPage();
List<SConsumer> list = sConsumerService.selectSConsumerList(sConsumer);
return getDataTable(list);
}
}
......@@ -8,6 +8,7 @@ import share.common.core.controller.BaseController;
import share.common.core.domain.AjaxResult;
import share.common.core.page.TableDataInfo;
import share.common.enums.BusinessType;
import share.common.enums.RoleTypeEnum;
import share.common.utils.poi.ExcelUtil;
import share.system.domain.SConsumer;
import share.system.domain.vo.SConsumerVo;
......@@ -49,9 +50,11 @@ public class SConsumerController extends BaseController
*/
// @PreAuthorize("@ss.hasPermi('system:consumer:list')")
@GetMapping("/selectConsumernotById")
public TableDataInfo selectConsumernotById(SConsumerVo sConsumer)
public TableDataInfo selectConsumernotById(SConsumer sConsumer)
{
return sConsumerService.selectConsumernotById(sConsumer);
sConsumer.setRoleType(RoleTypeEnum.CLEANER.getCode());
List<SConsumer> list = sConsumerService.selectConsumerList(sConsumer);
return getDataTable(list);
}
......@@ -123,4 +126,24 @@ public class SConsumerController extends BaseController
public AjaxResult giveNumber(@RequestBody SConsumer sConsumer) {
return toAjax(sConsumerService.giveNumber(sConsumer));
}
/*
查询用户列表
*/
@GetMapping("/selectConsumerList")
public TableDataInfo selectConsumerList(SConsumer sConsumer) {
sConsumer.setRoleType(RoleTypeEnum.CLEANER.getCode());
List<SConsumer> list = sConsumerService.selectConsumerList(sConsumer);
return getDataTable(list);
}
/**
* 分配客服
*/
@PostMapping("/updateCustomerId")
public AjaxResult updateCustomerId(@RequestBody SConsumer sConsumer) {
return toAjax(sConsumerService.updateCustomerId(sConsumer));
}
}
......@@ -117,4 +117,15 @@ public class SConsumer implements Serializable
@TableField(exist = false)
private Integer officialAccount;
private String newNickName;
private Long customerId;
private Integer isRecharge;
private Integer isRights;
}
......@@ -69,4 +69,6 @@ public interface SConsumerMapper extends BaseMapper<SConsumer>
List<SConsumer> selectListByStoreId(Long storeId);
boolean unbind(SConsumer request);
List<SConsumer> selectConsumerList(SConsumer sConsumer);
}
......@@ -133,4 +133,8 @@ public interface SConsumerService extends IService<SConsumer>
TableDataInfo selectConsumernotById(SConsumerVo sConsumer);
int giveNumber(SConsumer sConsumer);
int updateCustomerId(SConsumer sConsumer);
List<SConsumer> selectConsumerList(SConsumer sConsumer);
}
......@@ -390,7 +390,7 @@ public class SConsumerServiceImpl extends ServiceImpl<SConsumerMapper, SConsumer
@Override
public int giveNumber(SConsumer sConsumer) {
SConsumer byId = sConsumerService.getById(sConsumer.getId());
SConsumer byId = sConsumerService.selectSConsumerById(sConsumer.getId());
byId.setPrizeDrawNumbr(byId.getPrizeDrawNumbr() + sConsumer.getPrizeDrawNumbr());
if (sConsumerService.updateById(byId)) {
return 1;
......@@ -398,6 +398,21 @@ public class SConsumerServiceImpl extends ServiceImpl<SConsumerMapper, SConsumer
return 0;
}
@Override
public List<SConsumer> selectConsumerList(SConsumer sConsumer) {
return baseMapper.selectConsumerList(sConsumer);
}
@Override
public int updateCustomerId(SConsumer sConsumer) {
SConsumer byId = sConsumerService.selectSConsumerById(sConsumer.getId());
byId.setCustomerId(sConsumer.getCustomerId());
if (sConsumerService.updateById(byId)) {
return 1;
}
return 0;
}
@Override
public int addCleanConsumer(SConsumer sConsumer) {
......
......@@ -29,6 +29,11 @@
<result property="position" column="position"/>
<result property="textMessage" column="text_message"/>
<result property="officialAccount" column="official_account"/>
<result property="newNickName" column="new_nick_name"/>
<result property="isRecharge" column="is_recharge"/>
<result property="isRights" column="is_rights"/>
<result property="customerId" column="customer_id"/>
</resultMap>
<sql id="selectSConsumerVo">
......@@ -225,4 +230,40 @@
#{id}
</foreach>
</delete>
<select id="selectConsumerList" parameterType="SConsumer" resultMap="SConsumerResult">
select t1.id,
t1.account,
t1.nick_name,
t1.avatar,
t1.phone,
t1.level,
t1.role_type,
t1.sex,
t1.prize_draw_numbr,
t1.addres,
t1.amount,
t1.free_amount,
t1.total_times,
t1.duration,
t1.status,
t1.pwd,
t1.create_time,
t1.last_login_time,
t1.numberplate,
t2.nick_name as new_nick_name,
t3.is_recharge,
t3.is_rights
from sharedb.s_consumer t1
left join sharedb.s_consumer t2 on t1.customer_id = t2.id
left join sharedb.s_consumer_member t3 on t1.id = t3.consumer_id
<where>
<if test="roleType != null "> and t1.role_type = #{roleType}</if>
<if test="nickName != null and nickName != ''"> and t1.nick_name like concat('%', #{nickName}, '%')</if>
<if test="phone != null "> and t1.phone = #{phone}</if>
<if test="sex != null "> and t1.sex = #{sex}</if>
<if test="isRecharge != null "> and t3.is_recharge = #{isRecharge}</if>
<if test="isRights != null "> and t3.is_rights = #{isRights}</if>
</where>
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment