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

+ 5 - 4
src/main/java/org/springblade/bank/keypwd/controller/KeyPwdController.java

@@ -255,7 +255,8 @@ public class KeyPwdController extends BladeController {
 	public R submit(@Valid @RequestBody KeyPwd keyPwd) {
 	public R submit(@Valid @RequestBody KeyPwd keyPwd) {
 
 
 		if (keyPwd.getIsTurnIn() == 1){
 		if (keyPwd.getIsTurnIn() == 1){
-			keyPwd.setProcess(3); //已确认,直接完结流程
+//			keyPwd.setProcess(3); //已确认,直接完结流程
+			return R.status(keyPwdService.turnIn(keyPwd));
 		}else {
 		}else {
 			keyPwd.setProcess(2); //待确认
 			keyPwd.setProcess(2); //待确认
 		}
 		}
@@ -277,7 +278,7 @@ public class KeyPwdController extends BladeController {
 
 
 		if (keyPwdService.saveOrUpdate(keyPwd)){
 		if (keyPwdService.saveOrUpdate(keyPwd)){
 			User receiver = userService.getById(keyPwd.getReceiverId());
 			User receiver = userService.getById(keyPwd.getReceiverId());
-			if (!keyPwd.getCreateDept().equals(Long.valueOf(receiver.getDeptId()))){
+			if (receiver != null && !keyPwd.getCreateDept().equals(Long.valueOf(receiver.getDeptId()))){
 				keyPwd.setCreateDept(Long.valueOf(receiver.getDeptId()));
 				keyPwd.setCreateDept(Long.valueOf(receiver.getDeptId()));
 				keyPwdService.updateById(keyPwd);
 				keyPwdService.updateById(keyPwd);
 			}
 			}
@@ -294,10 +295,10 @@ public class KeyPwdController extends BladeController {
 				userLog.setOperationType("add");
 				userLog.setOperationType("add");
 				//發送通知
 				//發送通知
 				noticeService.sendKeyPwdNotice(keyPwd, false, keyPwd.getIsTurnIn().equals(1));
 				noticeService.sendKeyPwdNotice(keyPwd, false, keyPwd.getIsTurnIn().equals(1));
-			}else{
+			}else {
 				userLog.setOperationType("edit");
 				userLog.setOperationType("edit");
 				userLog.setOldData(JSONUtil.toJsonStr(old));
 				userLog.setOldData(JSONUtil.toJsonStr(old));
-				//發送通知
+				//發送通知 - 編輯
 				noticeService.sendKeyPwdNotice(keyPwd, true, false);
 				noticeService.sendKeyPwdNotice(keyPwd, true, false);
 			}
 			}
 			userLogService.save(userLog);
 			userLogService.save(userLog);

+ 5 - 0
src/main/java/org/springblade/bank/keypwd/entity/KeyPwd.java

@@ -16,6 +16,8 @@
  */
  */
 package org.springblade.bank.keypwd.entity;
 package org.springblade.bank.keypwd.entity;
 
 
+import com.baomidou.mybatisplus.annotation.FieldStrategy;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import org.springblade.core.mp.base.BaseEntity;
 import org.springblade.core.mp.base.BaseEntity;
@@ -98,11 +100,13 @@ public class KeyPwd extends BaseEntity {
 	* 接收人員工號
 	* 接收人員工號
 	*/
 	*/
 		@ApiModelProperty(value = "接收人員工號")
 		@ApiModelProperty(value = "接收人員工號")
+		@TableField(updateStrategy = FieldStrategy.IGNORED)
 		private String receiverNo;
 		private String receiverNo;
 	/**
 	/**
 	* 接收人姓名
 	* 接收人姓名
 	*/
 	*/
 		@ApiModelProperty(value = "接收人姓名")
 		@ApiModelProperty(value = "接收人姓名")
+		@TableField(updateStrategy = FieldStrategy.IGNORED)
 		private String receiverName;
 		private String receiverName;
 	/**
 	/**
 	* 備註
 	* 備註
@@ -140,6 +144,7 @@ public class KeyPwd extends BaseEntity {
 
 
 
 
 		@ApiModelProperty(value = "接收人Id")
 		@ApiModelProperty(value = "接收人Id")
+		@TableField(updateStrategy = FieldStrategy.IGNORED)
 		private Long receiverId;
 		private Long receiverId;
 		@ApiModelProperty(value = "交出人id")
 		@ApiModelProperty(value = "交出人id")
 		private Long handoverPersonId;
 		private Long handoverPersonId;

+ 2 - 0
src/main/java/org/springblade/bank/keypwd/service/IKeyPwdService.java

@@ -49,4 +49,6 @@ public interface IKeyPwdService extends BaseService<KeyPwd> {
     KeyPwd getKeepOneByOrgNoCategory(String bankNo, String orgNo, String category);
     KeyPwd getKeepOneByOrgNoCategory(String bankNo, String orgNo, String category);
 
 
 	List<KeyPwd> getList(KeyPwdVO keyPwd);
 	List<KeyPwd> getList(KeyPwdVO keyPwd);
+
+    boolean turnIn(KeyPwd keyPwd);
 }
 }

+ 64 - 0
src/main/java/org/springblade/bank/keypwd/service/impl/KeyPwdServiceImpl.java

@@ -16,19 +16,30 @@
  */
  */
 package org.springblade.bank.keypwd.service.impl;
 package org.springblade.bank.keypwd.service.impl;
 
 
+import cn.hutool.json.JSONUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import lombok.AllArgsConstructor;
 import org.springblade.bank.keypwd.entity.KeyPwd;
 import org.springblade.bank.keypwd.entity.KeyPwd;
 import org.springblade.bank.keypwd.vo.KeyPwdVO;
 import org.springblade.bank.keypwd.vo.KeyPwdVO;
 import org.springblade.bank.keypwd.mapper.KeyPwdMapper;
 import org.springblade.bank.keypwd.mapper.KeyPwdMapper;
 import org.springblade.bank.keypwd.service.IKeyPwdService;
 import org.springblade.bank.keypwd.service.IKeyPwdService;
+import org.springblade.bank.userlog.entity.UserLog;
+import org.springblade.bank.userlog.service.IUserLogService;
 import org.springblade.core.datascope.annotation.DataAuth;
 import org.springblade.core.datascope.annotation.DataAuth;
 import org.springblade.core.datascope.enums.DataScopeEnum;
 import org.springblade.core.datascope.enums.DataScopeEnum;
 import org.springblade.core.mp.base.BaseServiceImpl;
 import org.springblade.core.mp.base.BaseServiceImpl;
 import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.secure.utils.AuthUtil;
+import org.springblade.modules.desk.service.INoticeService;
+import org.springblade.modules.system.entity.Dept;
+import org.springblade.modules.system.entity.User;
+import org.springblade.modules.system.service.IDeptService;
+import org.springblade.modules.system.service.IUserService;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springframework.util.Assert;
 
 
+import java.util.ArrayList;
 import java.util.List;
 import java.util.List;
 
 
 /**
 /**
@@ -38,8 +49,14 @@ import java.util.List;
  * @since 2021-08-13
  * @since 2021-08-13
  */
  */
 @Service
 @Service
+@AllArgsConstructor
 public class KeyPwdServiceImpl extends BaseServiceImpl<KeyPwdMapper, KeyPwd> implements IKeyPwdService {
 public class KeyPwdServiceImpl extends BaseServiceImpl<KeyPwdMapper, KeyPwd> implements IKeyPwdService {
 
 
+	private final IUserLogService userLogService;
+	private final IUserService userService;
+	private final IDeptService deptService;
+	private final INoticeService noticeService;
+
 	@Override
 	@Override
 	public IPage<KeyPwdVO> selectKeyPwdPage(IPage<KeyPwdVO> page, KeyPwdVO keyPwd) {
 	public IPage<KeyPwdVO> selectKeyPwdPage(IPage<KeyPwdVO> page, KeyPwdVO keyPwd) {
 		keyPwd.setStatus(1);
 		keyPwd.setStatus(1);
@@ -72,4 +89,51 @@ public class KeyPwdServiceImpl extends BaseServiceImpl<KeyPwdMapper, KeyPwd> imp
 		return baseMapper.selectKeyPwdPage(keyPwd);
 		return baseMapper.selectKeyPwdPage(keyPwd);
 	}
 	}
 
 
+	@Override
+	public boolean turnIn(KeyPwd keyPwd) {
+		List<KeyPwd> updateList = new ArrayList<>();
+		String[] categorys = keyPwd.getCategory().split(",");
+
+		for (int i = 0; i < categorys.length; i++) {
+			String category = categorys[i];
+			KeyPwd keep = getKeepOneByOrgNoCategory(keyPwd.getBankNo(), keyPwd.getOrgNo(), category);
+			Assert.notNull(keep, "當前用戶不持有該類型鑰匙密碼或實物!");
+			keep.setReceiverId(keyPwd.getReceiverId());
+			keep.setReceiverNo(keyPwd.getReceiverNo());
+			keep.setReceiverName(keyPwd.getReceiverName());
+			keep.setProcess(3);
+			keep.setIsTurnIn(1);
+			keep.setStatus(1);
+			keep.setBankNo(keyPwd.getBankNo());
+			keep.setOrgNo(keyPwd.getOrgNo());
+			keep.setOrgName(keyPwd.getOrgName());
+			keep.setHandoverDate(keyPwd.getHandoverDate());
+			keep.setHandoverPersonId(keyPwd.getHandoverPersonId());
+			keep.setHandoverPersonNo(keyPwd.getHandoverPersonNo());
+			keep.setHandoverPersonName(keyPwd.getHandoverPersonName());
+			keep.setRemark(keyPwd.getRemark());
+			updateList.add(keep);
+//			this.updateById(keep);
+		}
+
+		if (updateList.size() > 0 && updateBatchById(updateList)){
+			User user = userService.getById(AuthUtil.getUserId());
+			Dept dept = deptService.getById(user.getDeptId());
+			UserLog userLog = new UserLog();
+			userLog.setTableName("keypwd");
+			userLog.setBankNo(dept.getBankNo());
+			userLog.setOrgNo(dept.getOrgNo());
+			userLog.setOrgName(dept.getDeptName());
+			userLog.setNewData(JSONUtil.toJsonStr(keyPwd));
+			userLog.setPersonNo(user.getEhr());
+			userLog.setPersonName(user.getName());
+			userLog.setOperationType("turnin");
+			userLogService.save(userLog);
+			//發送通知 - 上繳
+			noticeService.sendKeyPwdNotice(keyPwd, false, true);
+		}
+
+		return true;
+	}
+
 }
 }

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

@@ -108,6 +108,7 @@ public class MessageController extends BladeController {
 	@ApiOperationSupport(order = 3)
 	@ApiOperationSupport(order = 3)
 	@ApiOperation(value = "分页", notes = "传入message")
 	@ApiOperation(value = "分页", notes = "传入message")
 	public R<IPage<MessageVO>> page(MessageVO message, Query query) {
 	public R<IPage<MessageVO>> page(MessageVO message, Query query) {
+		message.setCreateUser(AuthUtil.getUserId());
 		message.setCurrentUserId(AuthUtil.getUserId());
 		message.setCurrentUserId(AuthUtil.getUserId());
 		IPage<Message> pages = messageService.selectMessagePage(Condition.getPage(query), message);
 		IPage<Message> pages = messageService.selectMessagePage(Condition.getPage(query), message);
 		return R.data(MessageWrapper.build().pageVO(pages));
 		return R.data(MessageWrapper.build().pageVO(pages));
@@ -141,12 +142,14 @@ public class MessageController extends BladeController {
 	@ApiOperation(value = "新增或修改", notes = "传入message")
 	@ApiOperation(value = "新增或修改", notes = "传入message")
 	public R submit(@Valid @RequestBody Message message) {
 	public R submit(@Valid @RequestBody Message message) {
 		Attach attach = attachService.getOne(new QueryWrapper<>(new Attach()).lambda().eq(Attach::getLink, message.getFile()));
 		Attach attach = attachService.getOne(new QueryWrapper<>(new Attach()).lambda().eq(Attach::getLink, message.getFile()));
-		Assert.notNull(attach, "找不到附件");
-		message.setName(attach.getName());
-		message.setDomain(attach.getDomain());
-		message.setOriginalName(attach.getOriginalName());
-		message.setExtension(attach.getExtension());
-		message.setAttachSize(attach.getAttachSize());
+//		Assert.notNull(attach, "找不到附件");
+		if (attach != null){
+			message.setName(attach.getName());
+			message.setDomain(attach.getDomain());
+			message.setOriginalName(attach.getOriginalName());
+			message.setExtension(attach.getExtension());
+			message.setAttachSize(attach.getAttachSize());
+		}
 
 
 		List<String> deptIds = Func.toStrList(message.getDeptId());
 		List<String> deptIds = Func.toStrList(message.getDeptId());
 		List<String> roleIds = Func.toStrList(message.getRoleId());
 		List<String> roleIds = Func.toStrList(message.getRoleId());

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

@@ -36,16 +36,14 @@
 
 
 
 
     <select id="selectMessagePage" resultMap="messageResultMap">
     <select id="selectMessagePage" resultMap="messageResultMap">
-        select * from zh_message where is_deleted = 0
+        select * from zh_message where is_deleted = 0 and create_user = #{message.createUser}
         <if test="message!=null">
         <if test="message!=null">
-            <if test="message.createUser!=null">
-                AND create_user like '%${message.createUser}%'
-            </if>
-            <if test="message.currentUserId!=null">
-                AND target_ids like '%${message.currentUserId}%'
+            <if test="message.title!=null">
+                AND title like '${message.title}'
             </if>
             </if>
         </if>
         </if>
         ORDER BY create_time DESC
         ORDER BY create_time DESC
+
     </select>
     </select>
 
 
 </mapper>
 </mapper>

+ 2 - 2
src/main/java/org/springblade/bank/returns/mapper/ReturnsMapper.xml

@@ -76,10 +76,10 @@
                 AND c.customer_name like '%${returns.customerName}%'
                 AND c.customer_name like '%${returns.customerName}%'
             </if>
             </if>
             <if test="returns.handlingBank!=null">
             <if test="returns.handlingBank!=null">
-                AND c.handling_bank = '${returns.handlingBank}'
+                AND c.handling_bank like '%${returns.handlingBank}%'
             </if>
             </if>
             <if test="returns.handlingBankReview!=null">
             <if test="returns.handlingBankReview!=null">
-                AND c.handling_bank_review = '${returns.handlingBankReview}'
+                AND c.handling_bank_review like '%${returns.handlingBankReview}%'
             </if>
             </if>
 
 
             <if test="returns.handlingDate_begin!=null and returns.handlingDate_end!=null">
             <if test="returns.handlingDate_begin!=null and returns.handlingDate_end!=null">

+ 19 - 4
src/main/java/org/springblade/bank/sealhandover/controller/SealHandoverController.java

@@ -261,18 +261,30 @@ public class SealHandoverController extends BladeController {
 		sealHandover.setSureTime(DateUtil.now());
 		sealHandover.setSureTime(DateUtil.now());
 		if (sealHandoverService.updateById(sealHandover)){
 		if (sealHandoverService.updateById(sealHandover)){
 			SealHandover keep = sealHandoverService.getKeyOneByOrgNoSealTypeNo(sealHandover.getBankNo(), sealHandover.getOrgNo(), sealHandover.getSealType(), sealHandover.getSealNo());
 			SealHandover keep = sealHandoverService.getKeyOneByOrgNoSealTypeNo(sealHandover.getBankNo(), sealHandover.getOrgNo(), sealHandover.getSealType(), sealHandover.getSealNo());
+			Long keepId = null;
 			if (keep == null){
 			if (keep == null){
 				keep = BeanUtil.clone(sealHandover);
 				keep = BeanUtil.clone(sealHandover);
 				keep.setId(null);
 				keep.setId(null);
 				keep.setStatus(2);
 				keep.setStatus(2);
 			}else{
 			}else{
+				keepId = keep.getId();
+
 				keep.setPid(sealHandover.getId());
 				keep.setPid(sealHandover.getId());
 				keep.setReceiverId(sealHandover.getReceiverId());
 				keep.setReceiverId(sealHandover.getReceiverId());
 				keep.setReceiverNo(sealHandover.getReceiverNo());
 				keep.setReceiverNo(sealHandover.getReceiverNo());
 				keep.setReceiverName(sealHandover.getReceiverName());
 				keep.setReceiverName(sealHandover.getReceiverName());
+				keep.setCreateDept(sealHandover.getCreateDept());
+			}
+
+			if (sealHandover.getIsTurnIn().equals(1) && keepId != null){
+				//上繳,刪除原持有人記錄
+				sealHandoverService.removeById(keepId);
+				sealHandoverService.saveOrUpdate(sealHandover);
+			}else{
+				//非上繳,更改印章持有人(接收人信息)
+				sealHandoverService.saveOrUpdate(keep);
 			}
 			}
 
 
-			sealHandoverService.saveOrUpdate(keep);
 
 
 			User user = userService.getById(AuthUtil.getUserId());
 			User user = userService.getById(AuthUtil.getUserId());
 			Dept dept = deptService.getById(user.getDeptId());
 			Dept dept = deptService.getById(user.getDeptId());
@@ -334,12 +346,11 @@ public class SealHandoverController extends BladeController {
 		}
 		}
 		if (sealHandoverService.saveOrUpdate(sealHandover)){
 		if (sealHandoverService.saveOrUpdate(sealHandover)){
 			User receiver = userService.getById(sealHandover.getReceiverId());
 			User receiver = userService.getById(sealHandover.getReceiverId());
-			if (!sealHandover.getCreateDept().equals(Long.valueOf(receiver.getDeptId()))){
+			if (sealHandover.getIsTurnIn().equals(0) && !sealHandover.getCreateDept().equals(Long.valueOf(receiver.getDeptId()))){
 				sealHandover.setCreateDept(Long.valueOf(receiver.getDeptId()));
 				sealHandover.setCreateDept(Long.valueOf(receiver.getDeptId()));
 				sealHandoverService.updateById(sealHandover);
 				sealHandoverService.updateById(sealHandover);
 			}
 			}
 
 
-
 			userLog.setTableName("sealhandover");
 			userLog.setTableName("sealhandover");
 			userLog.setBankNo(dept.getBankNo());
 			userLog.setBankNo(dept.getBankNo());
 			userLog.setOrgNo(dept.getOrgNo());
 			userLog.setOrgNo(dept.getOrgNo());
@@ -349,7 +360,11 @@ public class SealHandoverController extends BladeController {
 			userLog.setPersonName(user.getName());
 			userLog.setPersonName(user.getName());
 
 
 			if (isAdd){
 			if (isAdd){
-				userLog.setOperationType("add");
+				if (sealHandover.getIsTurnIn().equals(1)){
+					userLog.setOperationType("turnin");
+				}else{
+					userLog.setOperationType("add");
+				}
 
 
 				//發送通知
 				//發送通知
 				noticeService.sendSealNotice(sealHandover, false, false);
 				noticeService.sendSealNotice(sealHandover, false, false);

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

@@ -272,10 +272,9 @@ public class NoticeController extends BladeController {
 	@ApiOperationSupport(order = 10)
 	@ApiOperationSupport(order = 10)
 	@ApiOperation(value = "test", notes = "传入mocode")
 	@ApiOperation(value = "test", notes = "传入mocode")
 	public R testNotice(@ApiParam(value = "主键集合") @RequestParam String mocode) {
 	public R testNotice(@ApiParam(value = "主键集合") @RequestParam String mocode) {
-		List<String> ehrList = Func.toStrList("4661465,0150118");
+		List<String> ehrList = Func.toStrList(mocode);
 		String title = "test-有關 (副本認證章13) 的交接登記已於2021-10-22完成;交出人:張三;接收人:李4 業務印章交接登記表";
 		String title = "test-有關 (副本認證章13) 的交接登記已於2021-10-22完成;交出人:張三;接收人:李4 業務印章交接登記表";
 		HangxinResultBean hangxinResultBean = hangxinUtil.sendMsg(ehrList, "提示進度", title);
 		HangxinResultBean hangxinResultBean = hangxinUtil.sendMsg(ehrList, "提示進度", title);
-		System.out.println(JSONUtil.toJsonStr(hangxinResultBean));
 		return R.data(hangxinResultBean);
 		return R.data(hangxinResultBean);
 	}
 	}
 
 

+ 7 - 0
src/main/java/org/springblade/modules/desk/entity/Notice.java

@@ -25,6 +25,7 @@ import org.springblade.core.tenant.mp.TenantEntity;
 import org.springframework.format.annotation.DateTimeFormat;
 import org.springframework.format.annotation.DateTimeFormat;
 
 
 import java.util.Date;
 import java.util.Date;
+import java.util.List;
 
 
 /**
 /**
  * 实体类
  * 实体类
@@ -98,6 +99,12 @@ public class Notice extends TenantEntity {
 	@ApiModelProperty(value = "查閱人員id")
 	@ApiModelProperty(value = "查閱人員id")
 	private String targetIds;
 	private String targetIds;
 
 
+/*	*//**
+	 * 查閱人員EHR號(行信根據這個條件推送消息)
+	 *//*
+	@ApiModelProperty(value = "查閱人員EHR號")
+	private List<String> targetEhrs;*/
+
 	/**
 	/**
 	 * 已讀人員id
 	 * 已讀人員id
 	 */
 	 */

+ 44 - 2
src/main/java/org/springblade/modules/desk/service/impl/NoticeServiceImpl.java

@@ -103,6 +103,21 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeMapper, Notice> imp
 			String join = StringUtil.join(userIdList);
 			String join = StringUtil.join(userIdList);
 			notice.setTargetIds(join);
 			notice.setTargetIds(join);
 		}
 		}
+		/*if (notice.getTargetEhrs() == null){
+			String[] split = notice.getTargetIds().split(",");
+			List<String> userEhrList = new ArrayList<>();
+			for (int i = 0; i < split.length; i++) {
+				String userIdStr = split[i];
+				User user = userService.getById(userIdStr);
+				userEhrList.add(user.getEhr());
+			}
+			notice.setTargetEhrs(userEhrList);
+		}*/
+
+		/*// 發送行信通知
+		HangxinResultBean hangxinResultBean = hangxinUtil.sendMsg(notice.getTargetEhrs(), "提示進度", notice.getTitle());
+		System.out.println(JSONUtil.toJsonStr(hangxinResultBean));*/
+
 		return save(notice);
 		return save(notice);
 	}
 	}
 
 
@@ -127,17 +142,21 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeMapper, Notice> imp
 		User user2 = userService.getUserByEhr(keyPwd.getReceiverNo());
 		User user2 = userService.getUserByEhr(keyPwd.getReceiverNo());
 
 
 		List<Long> targetList = new ArrayList<>();
 		List<Long> targetList = new ArrayList<>();
+		List<String> userEhrtList = new ArrayList<>();
 		if (user1 != null){
 		if (user1 != null){
 			targetList.add(user1.getId());
 			targetList.add(user1.getId());
+			userEhrtList.add(user1.getEhr());
 		}
 		}
 		if (user2 != null){
 		if (user2 != null){
 			targetList.add(user2.getId());
 			targetList.add(user2.getId());
+			userEhrtList.add(user2.getEhr());
 		}
 		}
 
 
 		Notice notice = new Notice();
 		Notice notice = new Notice();
 		notice.setTitle(title);
 		notice.setTitle(title);
 		notice.setBusinessType("keypwd");
 		notice.setBusinessType("keypwd");
 		notice.setTargetIds(StringUtil.join(targetList));
 		notice.setTargetIds(StringUtil.join(targetList));
+//		notice.setTargetEhrs(userEhrtList);
 		return sendNotice(notice);
 		return sendNotice(notice);
 	}
 	}
 
 
@@ -188,6 +207,16 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeMapper, Notice> imp
 		notice.setDeptId(message.getDeptId());
 		notice.setDeptId(message.getDeptId());
 		notice.setRoleId(message.getRoleId());
 		notice.setRoleId(message.getRoleId());
 		notice.setTargetIds(message.getTargetIds());
 		notice.setTargetIds(message.getTargetIds());
+
+		String[] split = message.getTargetIds().split(",");
+		List<String> userEhrList = new ArrayList<>();
+		for (int i = 0; i < split.length; i++) {
+			String userIdStr = split[i];
+			User user = userService.getById(userIdStr);
+			userEhrList.add(user.getEhr());
+		}
+//		notice.setTargetEhrs(userEhrList);
+
 		return sendNotice(notice);
 		return sendNotice(notice);
 	}
 	}
 
 
@@ -199,11 +228,14 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeMapper, Notice> imp
 		User user1 = userService.getUserByEhr(sealHandover.getHandoverPersonNo());
 		User user1 = userService.getUserByEhr(sealHandover.getHandoverPersonNo());
 		User user2 = userService.getUserByEhr(sealHandover.getReceiverNo());
 		User user2 = userService.getUserByEhr(sealHandover.getReceiverNo());
 		List<Long> userList = new ArrayList<>();
 		List<Long> userList = new ArrayList<>();
+		List<String> userEhrList = new ArrayList<>();
 		if (user1 != null){
 		if (user1 != null){
 			userList.add(user1.getId());
 			userList.add(user1.getId());
+			userEhrList.add(user1.getEhr());
 		}
 		}
 		if (user2 != null){
 		if (user2 != null){
 			userList.add(user2.getId());
 			userList.add(user2.getId());
+			userEhrList.add(user2.getEhr());
 		}
 		}
 
 
 		String title = "";
 		String title = "";
@@ -219,6 +251,7 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeMapper, Notice> imp
 		notice.setTitle(title);
 		notice.setTitle(title);
 		notice.setBusinessType("sealhandover");
 		notice.setBusinessType("sealhandover");
 		notice.setTargetIds(StringUtil.join(userList));
 		notice.setTargetIds(StringUtil.join(userList));
+//		notice.setTargetEhrs(userEhrList);
 		return sendNotice(notice);
 		return sendNotice(notice);
 	}
 	}
 
 
@@ -235,6 +268,10 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeMapper, Notice> imp
 		notice.setTitle(title);
 		notice.setTitle(title);
 		notice.setBusinessType("postchange");
 		notice.setBusinessType("postchange");
 		notice.setTargetIds(postChange.getPersonId()+"");
 		notice.setTargetIds(postChange.getPersonId()+"");
+		User user = userService.getById(postChange.getPersonId());
+		List<String> userEhrList = new ArrayList<>();
+		userEhrList.add(user.getEhr());
+//		notice.setTargetEhrs(userEhrList);
 		return sendNotice(notice);
 		return sendNotice(notice);
 	}
 	}
 
 
@@ -251,6 +288,10 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeMapper, Notice> imp
 		notice.setTitle(title);
 		notice.setTitle(title);
 		notice.setBusinessType("goodsuse");
 		notice.setBusinessType("goodsuse");
 		notice.setTargetIds(goodsUse.getPersonId()+"");
 		notice.setTargetIds(goodsUse.getPersonId()+"");
+		User user = userService.getById(goodsUse.getPersonId());
+		List<String> userEhrList = new ArrayList<>();
+		userEhrList.add(user.getEhr());
+//		notice.setTargetEhrs(userEhrList);
 		return sendNotice(notice);
 		return sendNotice(notice);
 	}
 	}
 
 
@@ -286,10 +327,11 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeMapper, Notice> imp
 		notice.setDeptId(dept.getId() + "");
 		notice.setDeptId(dept.getId() + "");
 		notice.setRoleId(StringUtil.join(roleIds));
 		notice.setRoleId(StringUtil.join(roleIds));
 		notice.setTargetIds(StringUtil.join(userIds));
 		notice.setTargetIds(StringUtil.join(userIds));
+//		notice.setTargetEhrs(userEhrs);
 
 
-		// 發送行信通知
+		/*// 發送行信通知
 		HangxinResultBean hangxinResultBean = hangxinUtil.sendMsg(userEhrs, "提示進度", title);
 		HangxinResultBean hangxinResultBean = hangxinUtil.sendMsg(userEhrs, "提示進度", title);
-		System.out.println(JSONUtil.toJsonStr(hangxinResultBean));
+		System.out.println(JSONUtil.toJsonStr(hangxinResultBean));*/
 		return sendNotice(notice);
 		return sendNotice(notice);
 //		return true;
 //		return true;
 	}
 	}