|
@@ -98,6 +98,15 @@ public class OaNotifyController extends BaseController {
|
|
|
oaNotify.setCompany(user.getCompany());
|
|
|
}
|
|
|
Page<OaNotify> page = oaNotifyService.findByPc(new Page<OaNotify>(request, response), oaNotify);
|
|
|
+ List<OaNotify> list = page.getList();
|
|
|
+ for (OaNotify notify: list) {
|
|
|
+ //判断是否为管理员
|
|
|
+ if (UserUtils.isManager()){
|
|
|
+ notify.setFlagAdmin("1");
|
|
|
+ }else{
|
|
|
+ notify.setFlagAdmin("0");
|
|
|
+ }
|
|
|
+ }
|
|
|
model.addAttribute("page", page);
|
|
|
return "modules/oa/oaNotifyList";
|
|
|
}
|
|
@@ -130,6 +139,29 @@ public class OaNotifyController extends BaseController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * admin修改跳转
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "adminForm")
|
|
|
+ public String adminForm(@RequestParam(value = "view",required = false)String view, OaNotify oaNotify, Model model) {
|
|
|
+ if (StringUtils.isNotBlank(oaNotify.getId())){
|
|
|
+ oaNotify = oaNotifyService.getRecordList2(oaNotify);
|
|
|
+ oaNotifyService.queryDetails(oaNotify);
|
|
|
+ }
|
|
|
+ if (oaNotify.getCreateDate() == null){
|
|
|
+ oaNotify.setCreateDate(new Date());
|
|
|
+ }
|
|
|
+ if (oaNotify.getCreateBy() == null || StringUtils.isBlank(oaNotify.getCreateBy().getId())){
|
|
|
+ oaNotify.setCreateBy(UserUtils.getUser());
|
|
|
+ }
|
|
|
+ if(oaNotify.getOffice() == null || StringUtils.isBlank(oaNotify.getOffice().getId())){
|
|
|
+ oaNotify.setOffice(UserUtils.getSelectOffice());
|
|
|
+ }
|
|
|
+ oaNotify.setContent("");
|
|
|
+ model.addAttribute("oaNotify", oaNotify);
|
|
|
+ return "modules/oa/oaNotifyAdminForm";
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 删除附件
|
|
|
* @param request
|
|
|
* @param model
|
|
@@ -161,6 +193,11 @@ public class OaNotifyController extends BaseController {
|
|
|
if (!beanValidator(model, oaNotify)){
|
|
|
return form("",oaNotify, model);
|
|
|
}
|
|
|
+ //判断内容富文本中是否含有该字符串
|
|
|
+ while (oaNotify.getContent().contains("img{max-width:100%!important;}")){
|
|
|
+ oaNotify.setContent(oaNotify.getContent().replace("\r\n",""));
|
|
|
+ oaNotify.setContent(oaNotify.getContent().replace("img{max-width:100%!important;}",""));
|
|
|
+ }
|
|
|
oaNotify.setStatus(String.valueOf(ProjectStatusEnum.TSTORE.getValue()));
|
|
|
if(!oaNotify.getIsNewRecord()){//编辑表单保存
|
|
|
OaNotify t = oaNotifyService.get(oaNotify.getId());//从数据库取出记录的值
|
|
@@ -173,6 +210,32 @@ public class OaNotifyController extends BaseController {
|
|
|
return "redirect:"+ Global.getAdminPath()+"/oa/oaNotify/?repage";
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * admin修改
|
|
|
+ * @param oaNotify
|
|
|
+ * @param model
|
|
|
+ * @param redirectAttributes
|
|
|
+ * @return
|
|
|
+ * @throws Exception
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "adminUpdate")
|
|
|
+ public String adminUpdate(OaNotify oaNotify, Model model, RedirectAttributes redirectAttributes) throws Exception{
|
|
|
+ if (!beanValidator(model, oaNotify)){
|
|
|
+ return form("",oaNotify, model);
|
|
|
+ }
|
|
|
+ //判断内容富文本中是否含有该字符串
|
|
|
+ while (oaNotify.getContent().contains("img{max-width:100%!important;}")){
|
|
|
+ oaNotify.setContent(oaNotify.getContent().replace("\r\n",""));
|
|
|
+ oaNotify.setContent(oaNotify.getContent().replace("img{max-width:100%!important;}",""));
|
|
|
+ }
|
|
|
+ //编辑表单保存
|
|
|
+ OaNotify t = oaNotifyService.get(oaNotify.getId());//从数据库取出记录的值
|
|
|
+ MyBeanUtils.copyBeanNotNull2Bean(oaNotify, t);//将编辑表单中的非NULL值覆盖数据库记录中的值
|
|
|
+ oaNotifyService.adminUpdate(t);//修改
|
|
|
+ addMessage(redirectAttributes, "修改公告成功");
|
|
|
+ return "redirect:"+ Global.getAdminPath()+"/oa/oaNotify/?repage";
|
|
|
+ }
|
|
|
+
|
|
|
//添加操作只在"通告管理"页面完成;
|
|
|
@RequiresPermissions(value={"oa:oaNotify:add","oa:oaNotify:edit"},logical=Logical.OR)
|
|
|
@RequestMapping(value = "save")
|
|
@@ -180,7 +243,11 @@ public class OaNotifyController extends BaseController {
|
|
|
if (!beanValidator(model, oaNotify)){
|
|
|
return form("",oaNotify, model);
|
|
|
}
|
|
|
-
|
|
|
+ //判断内容富文本中是否含有该字符串
|
|
|
+ while (oaNotify.getContent().contains("img{max-width:100%!important;}")){
|
|
|
+ oaNotify.setContent(oaNotify.getContent().replace("\r\n",""));
|
|
|
+ oaNotify.setContent(oaNotify.getContent().replace("img{max-width:100%!important;}",""));
|
|
|
+ }
|
|
|
oaNotify.setState(String.valueOf(ProjectStatusEnum.IN_APRL.getValue()));
|
|
|
String str = "";
|
|
|
if(!oaNotify.getIsNewRecord()){//编辑表单保存
|
|
@@ -366,6 +433,11 @@ public class OaNotifyController extends BaseController {
|
|
|
public String saveAudit(OaNotify oaNotify, Model model,
|
|
|
RedirectAttributes redirectAttributes) {
|
|
|
try {
|
|
|
+ //判断内容富文本中是否含有该字符串
|
|
|
+ while (oaNotify.getContent().contains("img{max-width:100%!important;}")){
|
|
|
+ oaNotify.setContent(oaNotify.getContent().replace("\r\n",""));
|
|
|
+ oaNotify.setContent(oaNotify.getContent().replace("img{max-width:100%!important;}",""));
|
|
|
+ }
|
|
|
List<User> users = UserUtils.getByProssType(oaNotify.getProcessInstanceId(),1);
|
|
|
String flag = oaNotify.getAct().getFlag();
|
|
|
if ("yes".equals(flag) && (users==null || users.size()==0)){
|