Commit 5ce969f7 by 高鹏

Merge branch 'feat-saveClassify' into 'master'

修改编号

See merge request rays/pcloud-book!451
parents b231b044 92165c78
...@@ -99,4 +99,6 @@ public interface PcloudRobotBiz { ...@@ -99,4 +99,6 @@ public interface PcloudRobotBiz {
public String generateLinkbyAppProduct(String link, Long serveId, String serveType, String userWxId, String robotId); public String generateLinkbyAppProduct(String link, Long serveId, String serveType, String userWxId, String robotId);
List<String> getPcloudRobotByTypes(List<Integer> classifyIds); List<String> getPcloudRobotByTypes(List<Integer> classifyIds);
void updateUniqueNumber(Long id, String uniqueNumber);
} }
...@@ -636,6 +636,19 @@ public class PcloudRobotBizImpl implements PcloudRobotBiz { ...@@ -636,6 +636,19 @@ public class PcloudRobotBizImpl implements PcloudRobotBiz {
pcloudRobotDao.updateRobotType(paramMap); pcloudRobotDao.updateRobotType(paramMap);
} }
@Override
public void updateUniqueNumber(Long id, String uniqueNumber) {
//校验编号是否重复
PcloudRobot robot = pcloudRobotDao.getByUniqueNumber(uniqueNumber);
if (null != robot && !robot.getId().equals(id)){
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "编号重复,请重新输入");
}
PcloudRobot pcloudRobot = new PcloudRobot();
pcloudRobot.setId(id);
pcloudRobot.setUniqueNumber(uniqueNumber);
pcloudRobotDao.update(pcloudRobot);
}
private void sendTdReplyMessage(String ip, String robotWxId, String userWxId, List<PcloudTdReplyDTO> replyDTOS) { private void sendTdReplyMessage(String ip, String robotWxId, String userWxId, List<PcloudTdReplyDTO> replyDTOS) {
for (PcloudTdReplyDTO tdReplyDTO : replyDTOS) { for (PcloudTdReplyDTO tdReplyDTO : replyDTOS) {
Integer replyType = tdReplyDTO.getReplyType(); Integer replyType = tdReplyDTO.getReplyType();
......
...@@ -44,6 +44,7 @@ public class PcloudRobotClassifyBizImpl implements PcloudRobotClassifyBiz { ...@@ -44,6 +44,7 @@ public class PcloudRobotClassifyBizImpl implements PcloudRobotClassifyBiz {
} }
@Override @Override
@Transactional(rollbackFor = {Exception.class})
public void saveRobotClassify(String classifyName) { public void saveRobotClassify(String classifyName) {
PcloudRobotClassify classify = new PcloudRobotClassify(); PcloudRobotClassify classify = new PcloudRobotClassify();
classify.setClassifyName(classifyName); classify.setClassifyName(classifyName);
......
...@@ -280,4 +280,16 @@ public class PcloudRobotFacade { ...@@ -280,4 +280,16 @@ public class PcloudRobotFacade {
@RequestParam("robotId") @ApiParam("个人号id")String robotId){ @RequestParam("robotId") @ApiParam("个人号id")String robotId){
return new ResponseDto<>(pcloudRobotBiz.generateLinkbyAppProduct(link, serveId, serveType, userWxId, robotId)); return new ResponseDto<>(pcloudRobotBiz.generateLinkbyAppProduct(link, serveId, serveType, userWxId, robotId));
} }
@ApiOperation("修改机器人编码")
@GetMapping("/updateUniqueNumber")
ResponseDto<?> updateUniqueNumber(
@RequestHeader("token") @ApiParam("token信息") String token,
@RequestParam(value = "id") @ApiParam("ID") Long id,
@RequestParam(value = "uniqueNumber") @ApiParam("编码") String uniqueNumber
) throws BizException, PermissionException {
SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
pcloudRobotBiz.updateUniqueNumber(id, uniqueNumber);
return new ResponseDto<>();
}
} }
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
</insert> </insert>
<update id="update" parameterType="com.pcloud.book.pcloudkeyword.entity.PcloudRobotClassify"> <update id="update" parameterType="com.pcloud.book.pcloudkeyword.entity.PcloudRobotClassify">
update pcloud_robot update pcloud_robot_classify
<set> <set>
<if test="classifyName != null"> <if test="classifyName != null">
classify_name = #{classifyName}, classify_name = #{classifyName},
......
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