|
@@ -165,10 +165,14 @@ public class OaNotifyService extends CrudService<OaNotifyDao, OaNotify> {
|
|
List<OaNotify> oaNotifyList = dao.findList(oaNotify);
|
|
List<OaNotify> oaNotifyList = dao.findList(oaNotify);
|
|
for (OaNotify notify:oaNotifyList){
|
|
for (OaNotify notify:oaNotifyList){
|
|
if (StringUtils.isBlank(notify.getRemarks())) {
|
|
if (StringUtils.isBlank(notify.getRemarks())) {
|
|
- Long endDate = notify.getEndDate().getTime();
|
|
|
|
- Long startDate = notify.getStartDate().getTime();
|
|
|
|
- Long now = new Date().getTime();
|
|
|
|
- if (startDate < now && endDate > now) {
|
|
|
|
|
|
+ if(0 == notify.getExt()){
|
|
|
|
+ Long startDate = notify.getStartDate().getTime();
|
|
|
|
+ Long endDate = notify.getEndDate().getTime();
|
|
|
|
+ Long now = new Date().getTime();
|
|
|
|
+ if (startDate < now && endDate > now){
|
|
|
|
+ notify.setCandel("yes");
|
|
|
|
+ }
|
|
|
|
+ }else{
|
|
notify.setCandel("yes");
|
|
notify.setCandel("yes");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -187,7 +191,7 @@ public class OaNotifyService extends CrudService<OaNotifyDao, OaNotify> {
|
|
public Page<OaNotify> findUnreadMyself(Page<OaNotify> page, OaNotify oaNotify) {
|
|
public Page<OaNotify> findUnreadMyself(Page<OaNotify> page, OaNotify oaNotify) {
|
|
User user = UserUtils.getUser();
|
|
User user = UserUtils.getUser();
|
|
oaNotify.setCurrentUser(user);
|
|
oaNotify.setCurrentUser(user);
|
|
-
|
|
|
|
|
|
+ oaNotify.setNowDate(new Date());
|
|
if(!user.isAdmin()){
|
|
if(!user.isAdmin()){
|
|
oaNotify.setCompany(user.getCompany());
|
|
oaNotify.setCompany(user.getCompany());
|
|
}
|
|
}
|
|
@@ -195,10 +199,14 @@ public class OaNotifyService extends CrudService<OaNotifyDao, OaNotify> {
|
|
List<OaNotify> oaNotifyList = dao.findUnReadList(oaNotify);
|
|
List<OaNotify> oaNotifyList = dao.findUnReadList(oaNotify);
|
|
for (OaNotify notify:oaNotifyList){
|
|
for (OaNotify notify:oaNotifyList){
|
|
if (StringUtils.isBlank(notify.getRemarks())) {
|
|
if (StringUtils.isBlank(notify.getRemarks())) {
|
|
- Long endDate = notify.getEndDate().getTime();
|
|
|
|
- Long startDate = notify.getStartDate().getTime();
|
|
|
|
- Long now = new Date().getTime();
|
|
|
|
- if (startDate < now && endDate > now) {
|
|
|
|
|
|
+ if(0 == notify.getExt()){
|
|
|
|
+ Long startDate = notify.getStartDate().getTime();
|
|
|
|
+ Long endDate = notify.getEndDate().getTime();
|
|
|
|
+ Long now = new Date().getTime();
|
|
|
|
+ if (startDate < now && endDate > now){
|
|
|
|
+ notify.setCandel("yes");
|
|
|
|
+ }
|
|
|
|
+ }else{
|
|
notify.setCandel("yes");
|
|
notify.setCandel("yes");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -220,10 +228,14 @@ public class OaNotifyService extends CrudService<OaNotifyDao, OaNotify> {
|
|
List<OaNotify> oaNotifyList = dao.findReadList(oaNotify);
|
|
List<OaNotify> oaNotifyList = dao.findReadList(oaNotify);
|
|
for (OaNotify notify:oaNotifyList){
|
|
for (OaNotify notify:oaNotifyList){
|
|
if (StringUtils.isBlank(notify.getRemarks())) {
|
|
if (StringUtils.isBlank(notify.getRemarks())) {
|
|
- Long endDate = notify.getEndDate().getTime();
|
|
|
|
- Long startDate = notify.getStartDate().getTime();
|
|
|
|
- Long now = new Date().getTime();
|
|
|
|
- if (startDate < now && endDate > now) {
|
|
|
|
|
|
+ if(0 == notify.getExt()){
|
|
|
|
+ Long startDate = notify.getStartDate().getTime();
|
|
|
|
+ Long endDate = notify.getEndDate().getTime();
|
|
|
|
+ Long now = new Date().getTime();
|
|
|
|
+ if (startDate < now && endDate > now){
|
|
|
|
+ notify.setCandel("yes");
|
|
|
|
+ }
|
|
|
|
+ }else{
|
|
notify.setCandel("yes");
|
|
notify.setCandel("yes");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -258,11 +270,17 @@ public class OaNotifyService extends CrudService<OaNotifyDao, OaNotify> {
|
|
List<OaNotify> oaNotifyList = dao.findListByPc(oaNotify);
|
|
List<OaNotify> oaNotifyList = dao.findListByPc(oaNotify);
|
|
for (OaNotify notify:oaNotifyList){
|
|
for (OaNotify notify:oaNotifyList){
|
|
if (StringUtils.isBlank(notify.getRemarks())) {
|
|
if (StringUtils.isBlank(notify.getRemarks())) {
|
|
- Long startDate = notify.getStartDate().getTime();
|
|
|
|
- Long endDate = notify.getEndDate().getTime();
|
|
|
|
- Long now = new Date().getTime();
|
|
|
|
- if ("5".equals(notify.getStatus()) && startDate<now && endDate>now){
|
|
|
|
- notify.setCandel("yes");
|
|
|
|
|
|
+ if(0 == notify.getExt()){
|
|
|
|
+ Long startDate = notify.getStartDate().getTime();
|
|
|
|
+ Long endDate = notify.getEndDate().getTime();
|
|
|
|
+ Long now = new Date().getTime();
|
|
|
|
+ if ("5".equals(notify.getStatus()) && startDate<now && endDate>now){
|
|
|
|
+ notify.setCandel("yes");
|
|
|
|
+ }
|
|
|
|
+ }else{
|
|
|
|
+ if ("5".equals(notify.getStatus())){
|
|
|
|
+ notify.setCandel("yes");
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (StringUtils.isNotBlank(notify.getContent())){
|
|
if (StringUtils.isNotBlank(notify.getContent())){
|
|
@@ -1597,4 +1615,36 @@ public class OaNotifyService extends CrudService<OaNotifyDao, OaNotify> {
|
|
public void delete(OaNotify oaNotify){
|
|
public void delete(OaNotify oaNotify){
|
|
super.delete(oaNotify);
|
|
super.delete(oaNotify);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @Transactional(readOnly = false)
|
|
|
|
+ public void cancellation(OaNotify oaNotify) {
|
|
|
|
+ if(oaNotify.getCompany()==null || StringUtils.isBlank(oaNotify.getCompany().getId())){
|
|
|
|
+ oaNotify.setCompany(UserUtils.getSelectCompany());
|
|
|
|
+ }
|
|
|
|
+ if (oaNotify.getOffice()==null || StringUtils.isBlank(oaNotify.getOffice().getId())){
|
|
|
|
+ oaNotify.setOffice(UserUtils.getSelectOffice());
|
|
|
|
+ }
|
|
|
|
+ String title = StringEscapeUtils.unescapeHtml4(oaNotify.getTitle());
|
|
|
|
+ String content = StringEscapeUtils.unescapeHtml4(oaNotify.getContent());
|
|
|
|
+ oaNotify.setTitle(title);
|
|
|
|
+ oaNotify.setContent(content);
|
|
|
|
+ String contents = "";
|
|
|
|
+ if (oaNotify!=null && oaNotify.getContents()!=null){
|
|
|
|
+ contents = StringEscapeUtils.unescapeHtml4(oaNotify.getContents());
|
|
|
|
+ oaNotify.setContents(contents);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (StringUtils.isBlank(oaNotify.getNumber())){
|
|
|
|
+ oaNotify.setNumber(serialNumTplService.genSerialNum(UserUtils.getSelectCompany(), "17"));
|
|
|
|
+ }
|
|
|
|
+ super.save(oaNotify);
|
|
|
|
+ //保存附件
|
|
|
|
+ this.saveAttachments(oaNotify);
|
|
|
|
+ // 更新通知人
|
|
|
|
+ saveDetailList(oaNotify,0);
|
|
|
|
+ // 更新通知部门
|
|
|
|
+ saveDetailList(oaNotify,1);
|
|
|
|
+
|
|
|
|
+ }
|
|
}
|
|
}
|