|
|
@@ -16,6 +16,7 @@ import com.usoftchina.smartschool.utils.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.util.Calendar;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
|
@@ -38,11 +39,17 @@ public class NoticeServiceImpl implements NoticeService{
|
|
|
//新增
|
|
|
if (StringUtils.isEmpty(formdata.getNotify_id()) || "0".equals(formdata.getNotify_id().toString())) {
|
|
|
formdata.setNotify_status(2);
|
|
|
+ //获取时间
|
|
|
+ Calendar calendar= Calendar.getInstance();
|
|
|
+ formdata.setCreate_date(calendar.getTime());
|
|
|
noticeMapper.insertSelective(formdata);
|
|
|
|
|
|
} else {
|
|
|
//更新
|
|
|
noticeMapper.updateByPrimaryKeySelective(formdata);
|
|
|
+ if(formdata.getNotify_status()==1){
|
|
|
+ publish(formdata.getNotify_id());
|
|
|
+ }
|
|
|
}
|
|
|
return new DocBaseDTO(formdata.getNotify_id());
|
|
|
}
|
|
|
@@ -75,6 +82,9 @@ public class NoticeServiceImpl implements NoticeService{
|
|
|
if (StringUtils.isEmpty(id) || "0".equals(id)) {
|
|
|
return;
|
|
|
}
|
|
|
+ if(noticeMapper.noticeStatus(id)>0){
|
|
|
+ throw new BizException(BizExceptionCode.NOTICE_RELEASE_STATUS);
|
|
|
+ }
|
|
|
noticeMapper.deleteByPrimaryKey(id);
|
|
|
}
|
|
|
|