fanli/src/main/java/com/yeshi/fanli/controller/client/UserInfoController.java
@@ -216,7 +216,6 @@ @Resource private UserInfoExtraService userInfoExtraService; private static final String PASSWORD_MAX_ERROR = "password_max_error"; private static final String EXTRACT_MIN_MONEY = "extract_min_money"; private static final String EXTRACT_MAX_MONEY = "extract_max_money"; @@ -1991,9 +1990,9 @@ } } /** * 设置界面开关状态 * * @param acceptData * @param uid * @param params @@ -2030,9 +2029,9 @@ } } /** * 获取等级信息 * * @param acceptData * @param uid * @param out @@ -2046,9 +2045,7 @@ } try { UserInfoExtraVO rankInfo = userInfoExtraService.getRankInfo(uid); GsonBuilder gsonBuilder = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()); gsonBuilder.excludeFieldsWithoutExposeAnnotation(); Gson gson = gsonBuilder.setDateFormat("yyyy.MM.dd").create(); @@ -2066,9 +2063,9 @@ } } /** * 获取等级信息 * * @param acceptData * @param uid * @param out fanli/src/main/java/com/yeshi/fanli/controller/client/UserMsgController.java
@@ -40,6 +40,7 @@ import com.yeshi.fanli.exception.goods.CommonGoodsException; import com.yeshi.fanli.exception.goods.RecommendUserGoodsException; import com.yeshi.fanli.exception.msg.UserSystemMsgException; import com.yeshi.fanli.exception.user.UserCustomSettingsException; import com.yeshi.fanli.service.inter.goods.CommonGoodsService; import com.yeshi.fanli.service.inter.goods.RecommendUserGoodsService; import com.yeshi.fanli.service.inter.lable.QualityFactoryService; @@ -49,6 +50,7 @@ import com.yeshi.fanli.service.inter.msg.MsgOrderDetailService; import com.yeshi.fanli.service.inter.msg.UserMsgReadStateService; import com.yeshi.fanli.service.inter.msg.UserSystemMsgService; import com.yeshi.fanli.service.inter.user.UserCustomSettingsService; import com.yeshi.fanli.service.inter.user.UserInfoService; import com.yeshi.fanli.util.Constant; import com.yeshi.fanli.util.StringUtil; @@ -59,6 +61,7 @@ import com.yeshi.fanli.vo.msg.UserHomeMsgVO; import com.yeshi.fanli.vo.msg.UserMsgVO; import com.yeshi.fanli.vo.msg.UserSystemMsgVO; import com.yeshi.fanli.vo.user.UserSettingsVO; import net.sf.json.JSONObject; @@ -95,6 +98,9 @@ @Resource private QualityFactoryService qualityFactoryService; @Resource private UserCustomSettingsService userCustomSettingsService; // 消息的类型 final static String MSG_TYPE_ORDER = "order"; @@ -186,6 +192,16 @@ JSONObject data = JSONObject.fromObject(JsonUtil.getApiCommonGson().toJson(num)); data.put("totalCount", num.getTypeAccount() + num.getTypeInvite() + num.getTypeMoney() + num.getTypeOrder() + num.getTypeScore() + num.getTypeSystem()); try { UserSettingsVO vo = userCustomSettingsService.getMySettings(uid); if (vo != null && vo.getNoNewsRedDot() == 1) { data.put("totalCount", 0); } } catch (UserCustomSettingsException e) { e.printStackTrace(); } out.print(JsonUtil.loadTrueResult(data)); } @@ -398,8 +414,8 @@ UserSystemMsg usm = userSystemMsgService.getLatestUserSystemMsg(uid); if (usm != null) root.put("systemMsg", new UserSystemMsgVO(usm.getId(), usm.getType().name(), usm.getSolved(), usm.getTitle(), usm.getContent(), new UserSystemMsgVO(usm.getId(), usm.getType().name(), usm.getSolved(), "系统消息", usm.getTitle(), usm.getTimeTag() == 1 ? "http://img.flqapp.com/resource/msg/icon_emergent.png" : "", "http://img.flqapp.com/resource/msg/icon_msg_system.png", getTimeDesc(now, usm.getCreateTime()), num.getTypeSystem())); fanli/src/main/java/com/yeshi/fanli/mapping/goods/ScanHistoryV2Mapper.xml
@@ -29,7 +29,7 @@ <!-- 根据UID或者设备号获取浏览记录 --> <select id="selectByDeviceOrUid" resultMap="BaseResultMap"> SELECT s.*,MAX(s.`s_id`) AS orderid FROM yeshi_ec_scanhistory_v2 s SELECT s.*,MAX(s.`s_createtime`) AS orderid FROM yeshi_ec_scanhistory_v2 s WHERE <trim prefix="(" suffix=")" suffixOverrides="or"> <if test="uid != null"> s.`s_uid`=#{uid,jdbcType=BIGINT} or</if> fanli/src/main/java/com/yeshi/fanli/service/impl/msg/UserSystemMsgServiceImpl.java
@@ -7,6 +7,8 @@ import org.springframework.stereotype.Service; import com.yeshi.fanli.dao.config.SystemZnxDao; 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; @@ -25,6 +27,12 @@ @Resource private UserMsgReadStateService userMsgReadStateService; @Resource private UserInfoMapper userInfoMapper; @Resource private SystemZnxDao systemZnxDao; @Override public void addUserSystemMsg(Long uid, UserSystemMsgTypeEnum type, String title, String content, int timeTag, @@ -104,4 +112,25 @@ userSystemMsgMapper.setMsgReadByUid(uid); } @Override public void syncSystemZNX(Long uid) { UserInfo user = userInfoMapper.selectByPrimaryKey(uid); if (user == null) return; long createtTime = user.getCreatetime(); List<SystemZnx> list = systemZnxDao.list("from SystemZnx s where s.createTime>=" + createtTime); 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(); } } } } } fanli/src/main/java/com/yeshi/fanli/service/inter/msg/UserSystemMsgService.java
@@ -29,6 +29,13 @@ SystemZnx sz) throws UserSystemMsgException; /** * 同步系统站内信 * * @param uid */ public void syncSystemZNX(Long uid); /** * 获取最近一次的系统消息 * * @param uid fanli/src/main/java/com/yeshi/fanli/util/factory/msg/UserMsgVOFactory.java
@@ -250,7 +250,7 @@ date + msg.getMsgType().getDesc(), msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items); else return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_msg_invite_money.png.png", return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_msg_invite_money.png", date + msg.getMsgType().getDesc(), msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);