fangq 4 лет назад
Родитель
Сommit
46a5c939fa

+ 1 - 1
src/main/java/org/springblade/bank/message/controller/MessageController.java

@@ -108,7 +108,7 @@ public class MessageController extends BladeController {
 	@ApiOperationSupport(order = 3)
 	@ApiOperation(value = "分页", notes = "传入message")
 	public R<IPage<MessageVO>> page(MessageVO message, Query query) {
-		message.setCreateUser(AuthUtil.getUserId());
+//		message.setCreateUser(AuthUtil.getUserId());
 		message.setCurrentUserId(AuthUtil.getUserId());
 		IPage<Message> pages = messageService.selectMessagePage(Condition.getPage(query), message);
 		return R.data(MessageWrapper.build().pageVO(pages));

+ 1 - 1
src/main/java/org/springblade/bank/message/mapper/MessageMapper.xml

@@ -37,7 +37,7 @@
 
     <select id="selectMessagePage" resultMap="messageResultMap">
         SELECT c.* FROM
-        (select * from zh_message where is_deleted = 0 and create_user = #{message.createUser}
+        (select * from zh_message where is_deleted = 0 and create_user = #{message.currentUserId}
 
         UNION
         select * from zh_message where is_deleted = 0

+ 3 - 3
src/main/java/org/springblade/bank/postchange/controller/PostChangeController.java

@@ -83,9 +83,9 @@ public class PostChangeController extends BladeController {
 	@GetMapping("/detail")
 	@ApiOperationSupport(order = 1)
 	@ApiOperation(value = "详情", notes = "传入postChange")
-	public R<PostChangeVO> detail(PostChange postChange) {
-		PostChange detail = postChangeService.getOne(Condition.getQueryWrapper(postChange));
-		return R.data(PostChangeWrapper.build().entityVO(detail));
+	public R<PostChange> detail(PostChange postChange) {
+		PostChange detail = postChangeService.getById(postChange.getId());
+		return R.data(detail);
 	}
 
 	/**

+ 2 - 2
src/main/java/org/springblade/modules/desk/controller/NoticeController.java

@@ -113,7 +113,7 @@ public class NoticeController extends BladeController {
 	@ApiOperationSupport(order = 3)
 	@ApiOperation(value = "分页", notes = "传入notice")
 	public R<IPage<NoticeVO>> page(@ApiIgnore NoticeVO notice, Query query) {
-		notice.setCreateUser(AuthUtil.getUserId());
+//		notice.setCreateUser(AuthUtil.getUserId());
 		notice.setCurrentUserId(AuthUtil.getUserId());
 		IPage<NoticeVO> pages = noticeService.selectNoticePage(Condition.getPage(query), notice);
 
@@ -141,7 +141,7 @@ public class NoticeController extends BladeController {
 	@ApiOperationSupport(order = 3)
 	@ApiOperation(value = "分页", notes = "传入notice")
 	public R<IPage<NoticeVO>> myNoticePage(@ApiIgnore NoticeVO notice, Query query) {
-		notice.setCreateUser(AuthUtil.getUserId());
+//		notice.setCreateUser(AuthUtil.getUserId());
 		notice.setCurrentUserId(AuthUtil.getUserId());
 		IPage<NoticeVO> pages = noticeService.selectMyNoticePage(Condition.getPage(query), notice);
 

+ 1 - 1
src/main/java/org/springblade/modules/desk/mapper/NoticeMapper.xml

@@ -75,7 +75,7 @@
     </select>
 
     <select id="selectNoticePage" resultMap="noticeVOResultMap">
-        select n.* from blade_notice n where n.is_deleted = 0 and n.create_user = #{notice.createUser}
+        select n.* from blade_notice n where n.is_deleted = 0 and n.create_user = #{notice.currentUserId}
         <if test="notice.title!=null">
             and n.title like concat(concat('%', #{notice.title}), '%')
         </if>

+ 1 - 1
src/main/java/org/springblade/modules/desk/service/INoticeService.java

@@ -50,7 +50,7 @@ public interface INoticeService extends BaseService<Notice> {
 
     List<Notice> selectMyNoticeAll();
 
-	boolean sendNotice(Notice notice);
+	boolean sendNotice(NoticeVO notice);
 
 	boolean sendKeyPwdNotice(KeyPwd keyPwd, boolean isEdit, boolean isComplete);
 

+ 19 - 16
src/main/java/org/springblade/modules/desk/service/impl/NoticeServiceImpl.java

@@ -39,10 +39,7 @@ import org.springblade.modules.publishevent.event.HangxinNoticeEvent;
 import org.springblade.modules.system.entity.Dept;
 import org.springblade.modules.system.entity.Role;
 import org.springblade.modules.system.entity.User;
-import org.springblade.modules.system.service.IDeptService;
-import org.springblade.modules.system.service.IDictService;
-import org.springblade.modules.system.service.IRoleService;
-import org.springblade.modules.system.service.IUserService;
+import org.springblade.modules.system.service.*;
 import org.springframework.context.ApplicationEventPublisher;
 import org.springframework.stereotype.Service;
 
@@ -63,6 +60,7 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeMapper, Notice> imp
 	private final IDictService dictService;
 	private final IDeptService deptService;
 	private final IRoleService roleService;
+	private final IParamService paramService;
 
 	private final ApplicationEventPublisher eventPublisher;
 
@@ -91,7 +89,7 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeMapper, Notice> imp
 	}
 
 	@Override
-	public boolean sendNotice(Notice notice) {
+	public boolean sendNotice(NoticeVO notice) {
 		notice.setType("0"); //系統
 		if (StringUtil.isBlank(notice.getTargetIds())){
 			List<String> deptIds = Func.toStrList(notice.getDeptId());
@@ -112,9 +110,11 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeMapper, Notice> imp
 			notice.setTargetEhrs(StringUtil.join(userEhrList, "|"));
 		}
 
-		// 發送行信通知
-		HangxinNoticeEvent hangxinNoticeEvent = new HangxinNoticeEvent(notice);
-		eventPublisher.publishEvent(hangxinNoticeEvent);
+		if (notice.getSendHangxin() == null || notice.getSendHangxin().equals(true)){
+			HangxinNoticeEvent hangxinNoticeEvent = new HangxinNoticeEvent(notice);
+			eventPublisher.publishEvent(hangxinNoticeEvent);
+		}
+
 		return save(notice);
 	}
 
@@ -161,7 +161,7 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeMapper, Notice> imp
 			userEhrtList.add(user2.getEhr());
 		}
 
-		Notice notice = new Notice();
+		NoticeVO notice = new NoticeVO();
 		notice.setTitle(title);
 		notice.setBusinessType("keypwd");
 		notice.setTargetIds(StringUtil.join(targetList));
@@ -179,7 +179,7 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeMapper, Notice> imp
 		title += "營運部已發佈新消息,請查閱";
 		Dept dept = deptService.getByOrgNo(cardSwallow.getSendOrgNo());
 
-		Notice notice = new Notice();
+		NoticeVO notice = new NoticeVO();
 		notice.setTitle(title);
 		notice.setBusinessType("cardswallow");
 		notice.setDeptId(dept.getId()+"");
@@ -196,7 +196,7 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeMapper, Notice> imp
 		title += "營運部已發佈新消息,請查閱";
 		Dept dept = deptService.getByOrgNo(returns.getSubOrgNo());
 
-		Notice notice = new Notice();
+		NoticeVO notice = new NoticeVO();
 		notice.setTitle(title);
 		notice.setBusinessType("returns");
 		notice.setDeptId(dept.getId()+"");
@@ -211,7 +211,7 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeMapper, Notice> imp
 			title += "更正:";
 		}
 		title += "營運部已發佈新消息,請查閱";
-		Notice notice = new Notice();
+		NoticeVO notice = new NoticeVO();
 		notice.setTitle(title);
 		notice.setBusinessType("message");
 		notice.setDeptId(message.getDeptId());
@@ -268,7 +268,7 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeMapper, Notice> imp
 			}
 		}
 
-		Notice notice = new Notice();
+		NoticeVO notice = new NoticeVO();
 		notice.setTitle(title);
 		notice.setBusinessType("sealhandover");
 		notice.setTargetIds(StringUtil.join(userList));
@@ -290,7 +290,7 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeMapper, Notice> imp
 			title += user.getName() + "已提交網點出納主管及專管員崗位變更記錄表,請登陸系統查詢";
 		}
 
-		Notice notice = new Notice();
+		NoticeVO notice = new NoticeVO();
 		notice.setTitle(title);
 		notice.setBusinessType("postchange");
 		notice.setTargetIds(postChange.getPersonId()+"");
@@ -310,7 +310,7 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeMapper, Notice> imp
 		}
 		title += goodsUse.getFillingName() + "提交了使用及出入庫登記表,請登入系統進行確認。";
 
-		Notice notice = new Notice();
+		NoticeVO notice = new NoticeVO();
 		notice.setTitle(title);
 		notice.setBusinessType("goodsuse");
 		notice.setTargetIds(goodsUse.getPersonId()+"");
@@ -346,8 +346,11 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeMapper, Notice> imp
 			checkType = "每週";
 		}
 
+		String hangxinSend = paramService.getValue("notice." + cycle);
+
 		String title = "ORM-通知【核對記錄表】" + dept.getDeptName() + "尚未完成" + checkType + "核對工作";
-		Notice notice = new Notice();
+		NoticeVO notice = new NoticeVO();
+		notice.setSendHangxin("true".equals(hangxinSend));
 		notice.setTitle(title);
 		notice.setBusinessType("checklist");
 		notice.setDeptId(dept.getId() + "");

+ 1 - 0
src/main/java/org/springblade/modules/desk/vo/NoticeVO.java

@@ -34,4 +34,5 @@ public class NoticeVO extends Notice {
 	private String createUserName;
 
 	private Integer hadRead;
+	private Boolean sendHangxin;
 }