新购通知接口优化

This commit is contained in:
sxu 2024-11-06 13:51:20 +08:00
parent 9a10576b8a
commit 42ee5fad1c
6 changed files with 96 additions and 7 deletions

View File

@ -52,6 +52,17 @@ public class PurchaseNoticePersonController extends BaseController {
return getDataTable(list);
}
/**
* 查询新购短信通知人员列表
*/
@ApiOperation(value = "查询等待选择的新购短信通知人员列表")
@RequiresPermissions("purchase:person:list")
@GetMapping("/listUnSelected")
public TableDataInfo listUnSelected() {
List<PurchaseNoticePerson> list = purchaseNoticePersonService.getUnSelectedUserList();
return getDataTable(list);
}
/**
* 导出新购短信通知人员列表
*/

View File

@ -32,15 +32,25 @@ public class PurchaseNoticePerson extends BaseEntity {
@ApiModelProperty(value = "用户名")
private String userName;
/** 用户名 */
@Excel(name = "昵称")
@ApiModelProperty(value = "昵称")
private String nickName;
/** 用户角色名 */
@ApiModelProperty(value = "用户角色名")
private String userRoleName;
private String roleName;
/** 联系电话 */
@Excel(name = "联系电话")
@ApiModelProperty(value = "联系电话")
private String telphone;
/** 所属机构名称 */
@Excel(name = "所属机构名称")
@ApiModelProperty(value = "所属机构名称")
private String deptName;
/** 任务id */
@ApiModelProperty("任务id")
private String taskId;

View File

@ -26,6 +26,13 @@ public interface PurchaseNoticePersonMapper {
*/
public List<PurchaseNoticePerson> selectPurchaseNoticePersonList(PurchaseNoticePerson purchaseNoticePerson);
/**
* 查询等待选择的新购短信通知人员列表
*
* @return 等待选择的新购短信通知人员列表
*/
public List<PurchaseNoticePerson> getUnSelectedUserList();
/**
* 新增新购短信通知人员
*

View File

@ -29,6 +29,13 @@ public interface IPurchaseNoticePersonService {
*/
public List<PurchaseNoticePerson> selectPurchaseNoticePersonList(PurchaseNoticePerson purchaseNoticePerson);
/**
* 查询等待选择的新购短信通知人员列表
*
* @return 等待选择的新购短信通知人员列表
*/
public List<PurchaseNoticePerson> getUnSelectedUserList();
/**
* 批量发送短信
* @param purchaseNoticePersonDto 短信发送信息dto

View File

@ -58,6 +58,16 @@ public class PurchaseNoticePersonServiceImpl implements IPurchaseNoticePersonSer
return purchaseNoticePersonMapper.selectPurchaseNoticePersonList(purchaseNoticePerson);
}
/**
* 查询等待选择的新购短信通知人员列表
*
* @return 等待选择的新购短信通知人员列表
*/
@Override
public List<PurchaseNoticePerson> getUnSelectedUserList() {
return purchaseNoticePersonMapper.getUnSelectedUserList();
}
@Override
@Transactional
public AjaxResult batchSendSms(PurchaseNoticePersonDto purchaseNoticePersonDto) {

View File

@ -7,7 +7,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="id" column="id" />
<result property="userId" column="user_id" />
<result property="userName" column="user_name" />
<result property="nickName" column="nick_name" />
<result property="telphone" column="telphone" />
<result property="roleName" column="role_name" />
<result property="deptName" column="dept_name" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
</resultMap>
@ -17,12 +20,53 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql>
<select id="selectPurchaseNoticePersonList" parameterType="com.bonus.material.purchase.domain.PurchaseNoticePerson" resultMap="PurchaseNoticePersonResult">
<include refid="selectPurchaseNoticePersonVo"/>
<where>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
<if test="telphone != null and telphone != ''"> and telphone = #{telphone}</if>
</where>
SELECT
pnp.id,
pnp.user_id,
pnp.user_name,
u.nick_name,
telphone,
GROUP_CONCAT(r.role_name SEPARATOR '/') as role_name,
concat( d2.dept_name, '/', d1.dept_name, '/', d.dept_name ) deptName
FROM
purchase_notice_person pnp
LEFT JOIN sys_user u ON pnp.user_id = u.user_id
LEFT JOIN sys_user_role sur ON u.user_id = sur.user_id
LEFT JOIN sys_role r ON sur.role_id = r.role_id
LEFT JOIN sys_dept d ON u.dept_id = d.dept_id
LEFT JOIN sys_dept d1 ON d.parent_id = d1.dept_id
LEFT JOIN sys_dept d2 ON d1.parent_id = d2.dept_id
WHERE
u.STATUS = '0'
GROUP BY pnp.user_id
</select>
<select id="getUnSelectedUserList" resultType="com.bonus.material.purchase.domain.PurchaseNoticePerson">
SELECT
u.user_id userId,
u.dept_id deptId,
u.nick_name nickName,
u.user_name userName,
u.avatar,
u.phonenumber telphone,
concat( d2.dept_name, '/', d1.dept_name, '/', d.dept_name ) deptName,
GROUP_CONCAT(r.role_name SEPARATOR '/') as roleName
FROM
sys_user u
LEFT JOIN sys_user_role sur ON u.user_id = sur.user_id
LEFT JOIN sys_role r ON sur.role_id = r.role_id
LEFT JOIN sys_dept d ON u.dept_id = d.dept_id
LEFT JOIN sys_dept d1 ON d.parent_id = d1.dept_id
LEFT JOIN sys_dept d2 ON d1.parent_id = d2.dept_id
WHERE
u.STATUS = '0'
AND u.del_flag = '0'
AND u.user_id NOT IN (
SELECT
user_id
FROM
purchase_notice_person)
GROUP BY u.user_id
</select>
<select id="selectPurchaseNoticePersonById" parameterType="Long" resultMap="PurchaseNoticePersonResult">