| | |
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.UserInfoMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.msg.UserSystemMsgMapper;
|
| | | import com.yeshi.fanli.entity.bus.msg.UserSystemMsg;
|
| | | import com.yeshi.fanli.entity.bus.msg.UserSystemMsgTypeEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.system.SystemZnx;
|
| | | import com.yeshi.fanli.exception.msg.UserSystemMsgException;
|
| | | import com.yeshi.fanli.service.inter.msg.UserMsgReadStateService;
|
| | | import com.yeshi.fanli.service.inter.msg.UserSystemMsgService;
|
| | | import com.yeshi.fanli.service.inter.user.SystemZnxService;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | | @Service
|
| | |
| | |
|
| | | @Resource
|
| | | private UserSystemMsgMapper userSystemMsgMapper;
|
| | |
|
| | | @Resource
|
| | | private UserMsgReadStateService userMsgReadStateService;
|
| | |
|
| | | @Resource
|
| | | private UserInfoMapper userInfoMapper;
|
| | |
|
| | | @Resource
|
| | | private SystemZnxService systemZnxService;
|
| | |
|
| | | @Override
|
| | | public void addUserSystemMsg(Long uid, UserSystemMsgTypeEnum type, String title, String content, int timeTag,
|
| | |
| | | msg.setTimeTag(timeTag);
|
| | | }
|
| | | userSystemMsgMapper.insertSelective(msg);
|
| | | userMsgReadStateService.addSystemMsgUnReadCount(uid, 1);
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | | userSystemMsgMapper.setMsgReadByUid(uid);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void syncSystemZNX(Long uid) {
|
| | | UserInfo user = userInfoMapper.selectByPrimaryKey(uid);
|
| | | if (user == null)
|
| | | return;
|
| | | long createTime = user.getCreatetime();
|
| | | List<SystemZnx> list = systemZnxService.listbyCreateTime(createTime);
|
| | | if (list != null && list.size() > 0) {
|
| | | for (SystemZnx znx : list) {
|
| | | UserSystemMsg msg = userSystemMsgMapper.selectBySystemZNXId(znx.getId());
|
| | | if (msg == null)
|
| | | try {
|
| | | addUserSystemMsg(uid, UserSystemMsgTypeEnum.common, null, null, UserSystemMsg.TIME_TAG_COMMON, znx);
|
| | | } catch (UserSystemMsgException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | | }
|
| | |
|
| | | }
|