Browse Source

[feat] 销售管理

修复原客户报价按照业务搜索没有效果的问题:
修改 查询客户报价信息列表后端接口,新增在分页查询之前从前端传入的业务员名字进行名字转换操作
新增 客户报价通过用户名找到业务登录名,重新给业务员赋值后端方法
新增 用户管理通过用户名查询登录名后端方法
dev
liuxiaoxu 3 months ago
parent
commit
49e80197bc
  1. 5
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysCustomerQuoteController.java
  2. 5
      ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysCustomerQuoteService.java
  3. 18
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerQuoteServiceImpl.java
  4. 6
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java
  5. 5
      ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml

5
ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysCustomerQuoteController.java

@ -98,6 +98,11 @@ public class SysCustomerQuoteController extends BaseController
SysUser curUser = ShiroUtils.getSysUser(); SysUser curUser = ShiroUtils.getSysUser();
Long userId = curUser.getUserId(); Long userId = curUser.getUserId();
Set<String> roleKeys = roleService.selectRoleKeys(userId); Set<String> roleKeys = roleService.selectRoleKeys(userId);
//通过用户名找到业务登录名,重新给业务员赋值
String tempLoginName = sysCustomerQuoteService.convertName(sysCustomerQuoteVo);
sysCustomerQuoteVo.setBusinessMembers(tempLoginName);
startPage(); startPage();
List<SysCustomerQuoteVo> list = sysCustomerQuoteService.selectSysCustomerQuoteList(sysCustomerQuoteVo); List<SysCustomerQuoteVo> list = sysCustomerQuoteService.selectSysCustomerQuoteList(sysCustomerQuoteVo);
String loginName = ShiroUtils.getLoginName(); String loginName = ShiroUtils.getLoginName();

5
ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysCustomerQuoteService.java

@ -112,4 +112,9 @@ public interface ISysCustomerQuoteService
* 根据供应商编码数组查询客户报价信息集合 * 根据供应商编码数组查询客户报价信息集合
* */ * */
List<SysCustomerQuote> selectCustomerQuoteOneBySupplierCodes(String[] supplierCodes); List<SysCustomerQuote> selectCustomerQuoteOneBySupplierCodes(String[] supplierCodes);
/**
* 通过用户名找到业务登录名重新给业务员赋值
* */
String convertName(SysCustomerQuoteVo sysCustomerQuoteVo);
} }

18
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerQuoteServiceImpl.java

@ -104,10 +104,12 @@ public class SysCustomerQuoteServiceImpl implements ISysCustomerQuoteService {
@Override @Override
public List<SysCustomerQuoteVo> selectSysCustomerQuoteList(SysCustomerQuoteVo sysCustomerQuoteVo) public List<SysCustomerQuoteVo> selectSysCustomerQuoteList(SysCustomerQuoteVo sysCustomerQuoteVo)
{ {
PageDomain pageDomain = TableSupport.buildPageRequest(); PageDomain pageDomain = TableSupport.buildPageRequest();
Integer pageNum = pageDomain.getPageNum(); Integer pageNum = pageDomain.getPageNum();
Integer pageSize = pageDomain.getPageSize(); Integer pageSize = pageDomain.getPageSize();
//PageHelper 仅对第一List分页有效 //PageHelper 仅对第一List分页有效
Page<SysCustomerQuoteVo> list = (Page<SysCustomerQuoteVo>) sysCustomerQuoteMapper.selectSysCustomerQuoteList(sysCustomerQuoteVo); Page<SysCustomerQuoteVo> list = (Page<SysCustomerQuoteVo>) sysCustomerQuoteMapper.selectSysCustomerQuoteList(sysCustomerQuoteVo);
Page<SysCustomerQuoteVo> returnList = new Page<>(); Page<SysCustomerQuoteVo> returnList = new Page<>();
@ -167,6 +169,20 @@ public class SysCustomerQuoteServiceImpl implements ISysCustomerQuoteService {
} }
/**
* 通过用户名找到业务登录名重新给业务员赋值
* */
@Override
public String convertName(SysCustomerQuoteVo sysCustomerQuoteVo) {
String businessMembers = sysCustomerQuoteVo.getBusinessMembers();
if (StringUtils.isNotEmpty(businessMembers)){
String loginName = userMapper.selectLoginNameByUserName(businessMembers);
return loginName;
}
return businessMembers;
}
@Override @Override
@Transactional @Transactional
public int insertSysCustomerQuote(SysCustomerQuote sysCustomerQuote) { public int insertSysCustomerQuote(SysCustomerQuote sysCustomerQuote) {

6
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java

@ -164,4 +164,10 @@ public interface SysUserMapper
*/ */
@Select("select login_name from sys_user a,sys_user_role b,sys_role c where a.user_id = b.user_id and b.role_id = c.role_id and a.dept_id=#{deptId} and c.role_key= #{roleKey} and a.del_flag = 0 and a.status = 0") @Select("select login_name from sys_user a,sys_user_role b,sys_role c where a.user_id = b.user_id and b.role_id = c.role_id and a.dept_id=#{deptId} and c.role_key= #{roleKey} and a.del_flag = 0 and a.status = 0")
public String selectDeptLeaderId(@Param(value = "roleKey") String roleKey, @Param(value = "deptId") Long deptId); public String selectDeptLeaderId(@Param(value = "roleKey") String roleKey, @Param(value = "deptId") Long deptId);
/**
* 通过用户名查询登录名
* */
String selectLoginNameByUserName(String businessMembers);
} }

5
ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml

@ -264,4 +264,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{roleKey} #{roleKey}
</foreach> </foreach>
</select> </select>
<select id="selectLoginNameByUserName" parameterType="String" resultType="String">
select login_name from sys_user where del_flag = '0' and user_name = #{userName}
</select>
</mapper> </mapper>
Loading…
Cancel
Save