Browse Source

敏感词

master
陈裕财 3 years ago
parent
commit
0562bd3224
  1. 8
      xm-core/src/main/java/com/xm/core/ctrl/XmFuncController.java
  2. 11
      xm-core/src/main/java/com/xm/core/ctrl/XmIterationController.java
  3. 12
      xm-core/src/main/java/com/xm/core/ctrl/XmMenuController.java
  4. 12
      xm-core/src/main/java/com/xm/core/ctrl/XmProductController.java
  5. 16
      xm-core/src/main/java/com/xm/core/ctrl/XmProjectController.java
  6. 14
      xm-core/src/main/java/com/xm/core/ctrl/XmQuestionController.java
  7. 14
      xm-core/src/main/java/com/xm/core/ctrl/XmTaskController.java

8
xm-core/src/main/java/com/xm/core/ctrl/XmFuncController.java

@ -6,6 +6,7 @@ import com.mdp.core.utils.RequestUtils;
import com.mdp.mybatis.PageUtils; import com.mdp.mybatis.PageUtils;
import com.mdp.safe.client.entity.User; import com.mdp.safe.client.entity.User;
import com.mdp.safe.client.utils.LoginUtils; import com.mdp.safe.client.utils.LoginUtils;
import com.mdp.sensitive.SensitiveWordService;
import com.mdp.swagger.ApiEntityParams; import com.mdp.swagger.ApiEntityParams;
import com.xm.core.entity.XmFunc; import com.xm.core.entity.XmFunc;
import com.xm.core.service.XmFuncService; import com.xm.core.service.XmFuncService;
@ -38,6 +39,9 @@ public class XmFuncController {
@Autowired @Autowired
private XmFuncService xmFuncService; private XmFuncService xmFuncService;
@Autowired
SensitiveWordService sensitiveWordService;
Map<String,Object> fieldsMap = toMap(new XmFunc()); Map<String,Object> fieldsMap = toMap(new XmFunc());
@ -88,6 +92,10 @@ public class XmFuncController {
if(xmFuncService.selectOneObject(xmFunc) !=null ){ if(xmFuncService.selectOneObject(xmFunc) !=null ){
return failed("pk-exists","编号重复,请修改编号再提交"); return failed("pk-exists","编号重复,请修改编号再提交");
} }
}
Set<String> words=sensitiveWordService.getSensitiveWord(xmFunc.getName());
if(words!=null && words.size()>0){
return failed("name-sensitive-word","名字有敏感词"+words+",请修改后再提交");
} }
xmFuncService.parentIdPathsCalcBeforeSave(xmFunc); xmFuncService.parentIdPathsCalcBeforeSave(xmFunc);
xmFuncService.insert(xmFunc); xmFuncService.insert(xmFunc);

11
xm-core/src/main/java/com/xm/core/ctrl/XmIterationController.java

@ -10,6 +10,7 @@ import com.mdp.mybatis.PageUtils;
import com.mdp.qx.HasQx; import com.mdp.qx.HasQx;
import com.mdp.safe.client.entity.User; import com.mdp.safe.client.entity.User;
import com.mdp.safe.client.utils.LoginUtils; import com.mdp.safe.client.utils.LoginUtils;
import com.mdp.sensitive.SensitiveWordService;
import com.mdp.swagger.ApiEntityParams; import com.mdp.swagger.ApiEntityParams;
import com.xm.core.entity.XmIteration; import com.xm.core.entity.XmIteration;
import com.xm.core.service.*; import com.xm.core.service.*;
@ -67,6 +68,8 @@ public class XmIterationController {
@Autowired @Autowired
PushNotifyMsgService notifyMsgService; PushNotifyMsgService notifyMsgService;
@Autowired
SensitiveWordService sensitiveWordService;
Map<String,Object> fieldsMap = BaseUtils.toMap(new XmIteration()); Map<String,Object> fieldsMap = BaseUtils.toMap(new XmIteration());
@ -179,6 +182,14 @@ public class XmIterationController {
XmIteration q=new XmIteration(); XmIteration q=new XmIteration();
User user= LoginUtils.getCurrentUserInfo(); User user= LoginUtils.getCurrentUserInfo();
Set<String> words=sensitiveWordService.getSensitiveWord(xmIteration.getIterationName());
if(words!=null && words.size()>0){
return failed("name-sensitive-word","名字有敏感词"+words+",请修改后再提交");
}
words=sensitiveWordService.getSensitiveWord(xmIteration.getRemark());
if(words!=null && words.size()>0){
return failed("remark-sensitive-word","备注中有敏感词"+words+",请修改后再提交");
}
q.setBranchId(user.getBranchId()); q.setBranchId(user.getBranchId());
Long count=this.xmIterationService.countByWhere(q); Long count=this.xmIterationService.countByWhere(q);
xmIteration.setId(this.xmIterationService.createIterationId(count)); xmIteration.setId(this.xmIterationService.createIterationId(count));

12
xm-core/src/main/java/com/xm/core/ctrl/XmMenuController.java

@ -12,6 +12,7 @@ import com.mdp.mybatis.PageUtils;
import com.mdp.qx.HasQx; import com.mdp.qx.HasQx;
import com.mdp.safe.client.entity.User; import com.mdp.safe.client.entity.User;
import com.mdp.safe.client.utils.LoginUtils; import com.mdp.safe.client.utils.LoginUtils;
import com.mdp.sensitive.SensitiveWordService;
import com.xm.core.PubTool; import com.xm.core.PubTool;
import com.xm.core.entity.XmMenu; import com.xm.core.entity.XmMenu;
import com.xm.core.entity.XmProduct; import com.xm.core.entity.XmProduct;
@ -31,6 +32,7 @@ import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static com.mdp.core.utils.BaseUtils.map; import static com.mdp.core.utils.BaseUtils.map;
import static com.mdp.core.utils.ResponseHelper.failed;
/** /**
* url编制采用rest风格,如对XM.xm_menu 项目菜单表的操作有增删改查,对应的url分别为:<br> * url编制采用rest风格,如对XM.xm_menu 项目菜单表的操作有增删改查,对应的url分别为:<br>
@ -77,6 +79,8 @@ public class XmMenuController {
@Autowired @Autowired
XmMenuOperQxService menuOperQxService; XmMenuOperQxService menuOperQxService;
@Autowired
SensitiveWordService sensitiveWordService;
Map<String,Object> fieldsMap = BaseUtils.toMap(new XmMenu()); Map<String,Object> fieldsMap = BaseUtils.toMap(new XmMenu());
@ -255,6 +259,14 @@ public class XmMenuController {
return m; return m;
} }
} }
Set<String> words=sensitiveWordService.getSensitiveWord(xmMenu.getMenuName());
if(words!=null && words.size()>0){
return failed("name-sensitive-word","名字有敏感词"+words+",请修改后再提交");
}
words=sensitiveWordService.getSensitiveWord(xmMenu.getRemark());
if(words!=null && words.size()>0){
return failed("remark-sensitive-word","备注中有敏感词"+words+",请修改后再提交");
}
User user= LoginUtils.getCurrentUserInfo(); User user= LoginUtils.getCurrentUserInfo();
if(StringUtils.isEmpty(xmMenu.getMmUserid())) { if(StringUtils.isEmpty(xmMenu.getMmUserid())) {
xmMenu.setMmUserid(user.getUserid()); xmMenu.setMmUserid(user.getUserid());

12
xm-core/src/main/java/com/xm/core/ctrl/XmProductController.java

@ -9,6 +9,7 @@ import com.mdp.mybatis.PageUtils;
import com.mdp.qx.HasQx; import com.mdp.qx.HasQx;
import com.mdp.safe.client.entity.User; import com.mdp.safe.client.entity.User;
import com.mdp.safe.client.utils.LoginUtils; import com.mdp.safe.client.utils.LoginUtils;
import com.mdp.sensitive.SensitiveWordService;
import com.mdp.swagger.ApiEntityParams; import com.mdp.swagger.ApiEntityParams;
import com.xm.core.entity.XmProduct; import com.xm.core.entity.XmProduct;
import com.xm.core.entity.XmProductCopyVo; import com.xm.core.entity.XmProductCopyVo;
@ -65,6 +66,8 @@ public class XmProductController {
@Autowired @Autowired
PushNotifyMsgService notifyMsgService; PushNotifyMsgService notifyMsgService;
@Autowired
SensitiveWordService sensitiveWordService;
Map<String,Object> fieldsMap = toMap(new XmProduct()); Map<String,Object> fieldsMap = toMap(new XmProduct());
@ -263,6 +266,15 @@ public class XmProductController {
if(!StringUtils.hasText(xmProduct.getProductName())){ if(!StringUtils.hasText(xmProduct.getProductName())){
return failed("productName-0","","产品名称不能为空"); return failed("productName-0","","产品名称不能为空");
} }
Set<String> words=sensitiveWordService.getSensitiveWord(xmProduct.getProductName());
if(words!=null && words.size()>0){
return failed("name-sensitive-word","名字有敏感词"+words+",请修改后再提交");
}
words=sensitiveWordService.getSensitiveWord(xmProduct.getRemark());
if(words!=null && words.size()>0){
return failed("remark-sensitive-word","备注中有敏感词"+words+",请修改后再提交");
}
if(StringUtils.isEmpty(xmProduct.getPmUserid())) { if(StringUtils.isEmpty(xmProduct.getPmUserid())) {
xmProduct.setPmUserid(user.getUserid()); xmProduct.setPmUserid(user.getUserid());
xmProduct.setPmUsername(user.getUsername()); xmProduct.setPmUsername(user.getUsername());

16
xm-core/src/main/java/com/xm/core/ctrl/XmProjectController.java

@ -13,6 +13,7 @@ import com.mdp.mybatis.PageUtils;
import com.mdp.qx.HasQx; import com.mdp.qx.HasQx;
import com.mdp.safe.client.entity.User; import com.mdp.safe.client.entity.User;
import com.mdp.safe.client.utils.LoginUtils; import com.mdp.safe.client.utils.LoginUtils;
import com.mdp.sensitive.SensitiveWordService;
import com.mdp.swagger.ApiEntityParams; import com.mdp.swagger.ApiEntityParams;
import com.xm.core.entity.XmProductProjectLink; import com.xm.core.entity.XmProductProjectLink;
import com.xm.core.entity.XmProject; import com.xm.core.entity.XmProject;
@ -74,6 +75,8 @@ public class XmProjectController {
@Autowired @Autowired
private XmTaskService xmTaskService; private XmTaskService xmTaskService;
@Autowired
SensitiveWordService sensitiveWordService;
Map<String,Object> fieldsMap = BaseUtils.toMap(new XmProject()); Map<String,Object> fieldsMap = BaseUtils.toMap(new XmProject());
@ -224,6 +227,19 @@ public class XmProjectController {
} }
} }
} }
Set<String> words=sensitiveWordService.getSensitiveWord(xmProjectVo.getName());
if(words!=null && words.size()>0){
return failed("name-sensitive-word","名字有敏感词"+words+",请修改后再提交");
}
words=sensitiveWordService.getSensitiveWord(xmProjectVo.getBaseRemark());
if(words!=null && words.size()>0){
return failed("remark-sensitive-word","备注中有敏感词"+words+",请修改后再提交");
}
words=sensitiveWordService.getSensitiveWord(xmProjectVo.getAssessRemarks());
if(words!=null && words.size()>0){
return failed("assessRemarks-sensitive-word","备注中有敏感词"+words+",请修改后再提交");
}
User user = LoginUtils.getCurrentUserInfo(); User user = LoginUtils.getCurrentUserInfo();
xmProjectService.saveProject(xmProjectVo); xmProjectService.saveProject(xmProjectVo);
notifyMsgService.pushMsg(user,xmProjectVo.getPmUserid(),xmProjectVo.getPmUsername(),"1",xmProjectVo.getId(),xmProjectVo.getId(),"您成为项目【"+xmProjectVo.getName()+"】的项目经理,请及时跟进。"); notifyMsgService.pushMsg(user,xmProjectVo.getPmUserid(),xmProjectVo.getPmUsername(),"1",xmProjectVo.getId(),xmProjectVo.getId(),"您成为项目【"+xmProjectVo.getName()+"】的项目经理,请及时跟进。");

14
xm-core/src/main/java/com/xm/core/ctrl/XmQuestionController.java

@ -12,6 +12,7 @@ import com.mdp.mybatis.PageUtils;
import com.mdp.qx.HasQx; import com.mdp.qx.HasQx;
import com.mdp.safe.client.entity.User; import com.mdp.safe.client.entity.User;
import com.mdp.safe.client.utils.LoginUtils; import com.mdp.safe.client.utils.LoginUtils;
import com.mdp.sensitive.SensitiveWordService;
import com.xm.core.entity.XmMenu; import com.xm.core.entity.XmMenu;
import com.xm.core.entity.XmQuestion; import com.xm.core.entity.XmQuestion;
import com.xm.core.entity.XmQuestionHandle; import com.xm.core.entity.XmQuestionHandle;
@ -31,6 +32,8 @@ import springfox.documentation.annotations.ApiIgnore;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static com.mdp.core.utils.ResponseHelper.failed;
/** /**
* url编制采用rest风格,如对XM.xm_question xm_question的操作有增删改查,对应的url分别为:<br> * url编制采用rest风格,如对XM.xm_question xm_question的操作有增删改查,对应的url分别为:<br>
* 新增: xm/xmQuestion/add <br> * 新增: xm/xmQuestion/add <br>
@ -61,6 +64,9 @@ public class XmQuestionController {
@Autowired @Autowired
XmQuestionHandleService xmQuestionHandleService; XmQuestionHandleService xmQuestionHandleService;
@Autowired
SensitiveWordService sensitiveWordService;
@Autowired @Autowired
PushNotifyMsgService notifyMsgService; PushNotifyMsgService notifyMsgService;
@ -194,6 +200,14 @@ public class XmQuestionController {
xmQuestionVo.setHandlerUserid(user.getUserid()); xmQuestionVo.setHandlerUserid(user.getUserid());
xmQuestionVo.setHandlerUsername(user.getUsername()); xmQuestionVo.setHandlerUsername(user.getUsername());
} }
Set<String> words=sensitiveWordService.getSensitiveWord(xmQuestionVo.getName());
if(words!=null && words.size()>0){
return failed("name-sensitive-word","名字有敏感词"+words+",请修改后再提交");
}
words=sensitiveWordService.getSensitiveWord(xmQuestionVo.getRemarks());
if(words!=null && words.size()>0){
return failed("remark-sensitive-word","备注中有敏感词"+words+",请修改后再提交");
}
xmQuestionService.addQuestion(xmQuestionVo); xmQuestionService.addQuestion(xmQuestionVo);
if(!StringUtils.isEmpty(xmQuestionVo.getHandlerUserid())) { if(!StringUtils.isEmpty(xmQuestionVo.getHandlerUserid())) {
notifyMsgService.pushMsg(user,xmQuestionVo.getHandlerUserid(),xmQuestionVo.getHandlerUsername(),"5",xmQuestionVo.getProductId(),xmQuestionVo.getId(),"您有新的bug【"+xmQuestionVo.getName()+"】需要处理,请尽快修复!"); notifyMsgService.pushMsg(user,xmQuestionVo.getHandlerUserid(),xmQuestionVo.getHandlerUsername(),"5",xmQuestionVo.getProductId(),xmQuestionVo.getId(),"您有新的bug【"+xmQuestionVo.getName()+"】需要处理,请尽快修复!");

14
xm-core/src/main/java/com/xm/core/ctrl/XmTaskController.java

@ -14,6 +14,7 @@ import com.mdp.mybatis.PageUtils;
import com.mdp.qx.HasQx; import com.mdp.qx.HasQx;
import com.mdp.safe.client.entity.User; import com.mdp.safe.client.entity.User;
import com.mdp.safe.client.utils.LoginUtils; import com.mdp.safe.client.utils.LoginUtils;
import com.mdp.sensitive.SensitiveWordService;
import com.mdp.swagger.ApiEntityParams; import com.mdp.swagger.ApiEntityParams;
import com.xm.core.PubTool; import com.xm.core.PubTool;
import com.xm.core.entity.*; import com.xm.core.entity.*;
@ -35,6 +36,7 @@ import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static com.mdp.core.utils.BaseUtils.map; import static com.mdp.core.utils.BaseUtils.map;
import static com.mdp.core.utils.ResponseHelper.failed;
/** /**
* url编制采用rest风格,如对XM.xm_task xm_task的操作有增删改查,对应的url分别为:<br> * url编制采用rest风格,如对XM.xm_task xm_task的操作有增删改查,对应的url分别为:<br>
@ -86,6 +88,9 @@ public class XmTaskController {
@Autowired @Autowired
XmTaskExecuserController execuserController; XmTaskExecuserController execuserController;
@Autowired
SensitiveWordService sensitiveWordService;
@Autowired @Autowired
PushNotifyMsgService notifyMsgService; PushNotifyMsgService notifyMsgService;
@ -534,6 +539,15 @@ public class XmTaskController {
xmTaskVo.setCreateUserid(user.getUserid()); xmTaskVo.setCreateUserid(user.getUserid());
xmTaskVo.setCreateUsername(user.getUsername()); xmTaskVo.setCreateUsername(user.getUsername());
} }
Set<String> words=sensitiveWordService.getSensitiveWord(xmTaskVo.getName());
if(words!=null && words.size()>0){
return failed("name-sensitive-word","名字有敏感词"+words+",请修改后再提交");
}
words=sensitiveWordService.getSensitiveWord(xmTaskVo.getRemarks());
if(words!=null && words.size()>0){
return failed("remark-sensitive-word","备注中有敏感词"+words+",请修改后再提交");
}
xmTaskVo.setExecutorUserid(null); xmTaskVo.setExecutorUserid(null);
xmTaskVo.setExecutorUsername(null); xmTaskVo.setExecutorUsername(null);
xmTaskVo.setExeUserids(null); xmTaskVo.setExeUserids(null);

Loading…
Cancel
Save