Commit 4cf3181f by 1244575290@qq.com

主账号添加小睿

parent 0e77cbfa
......@@ -74,4 +74,10 @@ public interface PcloudRobotBiz {
* @return
*/
PageBeanNew<PcloudRobotResponseVO> listSelfRobotByClassify(Integer largeTemplet, Long classifyId, String keyword, Integer currentPage, Integer numPerPage);
PageBeanNew<PcloudRobot> listNoClassifyRobot(Integer currentPage, Integer numPerPage);
void setClassifyRobot(String wxId, Integer classifyId);
void removeClassifyRobot(String wxId, Integer classifyId);
}
......@@ -593,6 +593,27 @@ public class PcloudRobotBizImpl implements PcloudRobotBiz {
return new PageBeanNew<>(currentPage, numPerPage, pageBeanNew.getTotalCount(), vos);
}
@Override
public PageBeanNew<PcloudRobot> listNoClassifyRobot(Integer currentPage, Integer numPerPage) {
return pcloudRobotDao.listPageNew(new PageParam(currentPage, numPerPage), new HashMap<>(), "listNoClassifyRobot");
}
@Override
public void setClassifyRobot(String wxId, Integer classifyId) {
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("wxId", wxId);
paramMap.put("classifyId", classifyId);
pcloudRobotDao.updateRobotType(paramMap);
}
@Override
public void removeClassifyRobot(String wxId, Integer classifyId) {
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("wxId", wxId);
paramMap.put("classifyId", null);
pcloudRobotDao.updateRobotType(paramMap);
}
private void sendTdReplyMessage(String ip, String robotWxId, String userWxId, List<PcloudTdReplyDTO> replyDTOS) {
for (PcloudTdReplyDTO tdReplyDTO : replyDTOS) {
Integer replyType = tdReplyDTO.getReplyType();
......
......@@ -40,4 +40,6 @@ public interface PcloudRobotDao extends BaseDao<PcloudRobot> {
void updateRobotState(Map<String, Object> map);
List<RobotClassifyDTO> listSelfRobotByClassify(Map<String, Object> paramMap);
void updateRobotType(Map<String, Object> paramMap);
}
......@@ -79,4 +79,9 @@ public class PcloudRobotDaoImpl extends BaseDaoImpl<PcloudRobot> implements Pclo
return this.getSessionTemplate().selectList(this.getStatement("listSelfRobotByClassify"), paramMap);
}
@Override
public void updateRobotType(Map<String, Object> paramMap) {
this.getSessionTemplate().update(this.getStatement("updateRobotType"), paramMap);
}
}
......@@ -207,4 +207,36 @@ public class PcloudRobotFacade {
return new ResponseDto<>(pcloudRobotBiz.listSelfRobotByClassify(largeTemplet, classifyId, keyword, currentPage, numPerPage));
}
@ApiOperation("获取未分类的小号")
@GetMapping("/listNoClassifyRobot")
ResponseDto<?> listNoClassifyRobot(
@RequestHeader("token") @ApiParam("token信息") String token,
@RequestParam(value = "currentPage") Integer currentPage,
@RequestParam(value = "numPerPage") Integer numPerPage) throws BizException, PermissionException{
SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
return new ResponseDto<>(pcloudRobotBiz.listNoClassifyRobot(currentPage, numPerPage));
}
@ApiOperation("设置分类小号")
@GetMapping("/setClassifyRobot")
ResponseDto<?> setClassifyRobot(
@RequestHeader("token") @ApiParam("token信息") String token,
@RequestParam(value = "wxId") @ApiParam("小号wxid") String wxId,
@RequestParam(value = "classifyId") @ApiParam("分类ID") Integer classifyId) throws BizException, PermissionException{
SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
pcloudRobotBiz.setClassifyRobot(wxId, classifyId);
return new ResponseDto<>();
}
@ApiOperation("移除分类小号")
@GetMapping("/removeClassifyRobot")
ResponseDto<?> removeClassifyRobot(
@RequestHeader("token") @ApiParam("token信息") String token,
@RequestParam(value = "wxId") @ApiParam("小号wxid") String wxId,
@RequestParam(value = "classifyId") @ApiParam("分类ID") Integer classifyId) throws BizException, PermissionException{
SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
pcloudRobotBiz.removeClassifyRobot(wxId, classifyId);
return new ResponseDto<>();
}
}
......@@ -308,4 +308,15 @@
</foreach>
</if>
</select>
<select id="listNoClassifyRobot" resultMap="BaseResultMap">
select id, wx_id, unique_number
from pcloud_robot where robot_type is null
</select>
<update id="updateRobotType" parameterType="map">
update pcloud_robot set
robot_type = #{classifyId}
where wx_id = #{wxId}
</update>
</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