10个文件已添加
31个文件已修改
2 文件已重命名
| | |
| | | <dependency> |
| | | <groupId>com.ks</groupId> |
| | | <artifactId>facade-vip</artifactId> |
| | | <version>0.0.5</version> |
| | | <version>0.0.6</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.ks</groupId> |
| | | <artifactId>facade-lijin</artifactId> |
| | | <version>0.0.3</version> |
| | | <version>0.0.4</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
New file |
| | |
| | | package com.yeshi.fanli.controller.client.v2; |
| | | |
| | | import com.google.gson.*; |
| | | import com.yeshi.fanli.dto.msg.MsgCommonDTO; |
| | | import com.yeshi.fanli.entity.SystemEnum; |
| | | import com.yeshi.fanli.entity.accept.AcceptData; |
| | | import com.yeshi.fanli.entity.bus.homemodule.Special; |
| | | import com.yeshi.fanli.entity.bus.lable.QualityFactory; |
| | | import com.yeshi.fanli.entity.bus.msg.*; |
| | | import com.yeshi.fanli.entity.bus.msg.MsgOrderDetail.MsgTypeOrderTypeEnum; |
| | | import com.yeshi.fanli.entity.bus.user.UserInfoExtra; |
| | | import com.yeshi.fanli.entity.common.JumpDetailV2; |
| | | import com.yeshi.fanli.entity.goods.CommonGoods; |
| | | import com.yeshi.fanli.entity.goods.RecommendUserGoods; |
| | | import com.yeshi.fanli.entity.push.DeviceActive; |
| | | import com.yeshi.fanli.entity.push.PushGoods; |
| | | import com.yeshi.fanli.entity.system.ConfigKeyEnum; |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoSearchResult; |
| | | 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.lijin.entity.MsgLijinVIPDetail; |
| | | import com.yeshi.fanli.service.inter.common.JumpDetailV2Service; |
| | | import com.yeshi.fanli.service.inter.config.ConfigService; |
| | | import com.yeshi.fanli.service.inter.goods.CommonGoodsService; |
| | | import com.yeshi.fanli.service.inter.goods.RecommendUserGoodsService; |
| | | import com.yeshi.fanli.service.inter.homemodule.SpecialService; |
| | | import com.yeshi.fanli.service.inter.lable.QualityFactoryService; |
| | | import com.yeshi.fanli.service.inter.money.msg.MsgMoneyDetailService; |
| | | import com.yeshi.fanli.service.inter.msg.*; |
| | | import com.yeshi.fanli.service.inter.order.msg.MsgOrderDetailService; |
| | | import com.yeshi.fanli.service.inter.push.DeviceActiveService; |
| | | import com.yeshi.fanli.service.inter.push.PushGoodsService; |
| | | import com.yeshi.fanli.service.inter.user.UserCustomSettingsService; |
| | | import com.yeshi.fanli.service.inter.user.UserInfoExtraService; |
| | | import com.yeshi.fanli.service.inter.user.UserInfoService; |
| | | import com.yeshi.fanli.service.inter.user.invite.MsgInviteDetailService; |
| | | import com.yeshi.fanli.service.inter.user.msg.MsgAccountDetailService; |
| | | import com.yeshi.fanli.util.*; |
| | | import com.yeshi.fanli.util.account.UserUtil; |
| | | import com.yeshi.fanli.util.annotation.RequestSerializableByKey; |
| | | import com.yeshi.fanli.util.factory.CommonGoodsFactory; |
| | | import com.yeshi.fanli.util.factory.msg.UserMsgVOFactory; |
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil; |
| | | import com.yeshi.fanli.vo.msg.*; |
| | | import com.yeshi.fanli.vo.user.UserSettingsVO; |
| | | import com.yeshi.goods.facade.entity.taobao.TaoBaoGoodsBrief; |
| | | import net.sf.json.JSONObject; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | import org.yeshi.utils.BigDecimalUtil; |
| | | import org.yeshi.utils.JsonUtil; |
| | | import org.yeshi.utils.TimeUtil; |
| | | import org.yeshi.utils.taobao.TbImgUtil; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpSession; |
| | | import java.io.PrintWriter; |
| | | import java.lang.reflect.Type; |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | |
| | | @Controller |
| | | @RequestMapping("api/v2/user/msg") |
| | | public class UserMsgControllerV2 { |
| | | |
| | | @Resource |
| | | private UserMsgReadStateService userMsgReadStateService; |
| | | |
| | | @Resource |
| | | private JumpDetailV2Service jumpDetailV2Service; |
| | | |
| | | @Resource |
| | | private MsgOverViewsService msgOverViewsService; |
| | | |
| | | @Resource |
| | | private ConfigService configService; |
| | | |
| | | |
| | | /** |
| | | * 获取消息列表 |
| | | * |
| | | * @param acceptData |
| | | * @param uid |
| | | * @param page |
| | | * @param type |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getMsgList", method = RequestMethod.POST) |
| | | public void getMsgList(AcceptData acceptData, Long uid, int page, String type, PrintWriter out) { |
| | | if (uid == null) { |
| | | out.print(JsonUtil.loadFalseResult(1, "用户未登录")); |
| | | return; |
| | | } |
| | | |
| | | List<MsgOverViews> list1 = msgOverViewsService.listByUid(uid, page, Constant.PAGE_SIZE); |
| | | long count = msgOverViewsService.countByUid(uid); |
| | | List<Object> msgList = msgOverViewsService.listDetail(list1); |
| | | userMsgReadStateService.setAllMsgRead(uid); |
| | | //检索overviews下的消息 |
| | | List<UserMsgVO> list = new ArrayList<>(); |
| | | |
| | | for (Object obj : msgList) { |
| | | |
| | | if (obj instanceof MsgOrderDetail) { |
| | | MsgOrderDetail detail = (MsgOrderDetail) obj; |
| | | JSONObject params = new JSONObject(); |
| | | params.put("orderNo", detail.getOrderId()); |
| | | if (detail.getType() == MsgTypeOrderTypeEnum.invite || detail.getType() == MsgTypeOrderTypeEnum.orderInvite) |
| | | params.put("orderHideNo", UserUtil.filterOrderId(detail.getOrderId())); |
| | | UserMsgVO msgVO = UserMsgVOFactory.create(detail, jumpDetailV2Service.getByTypeCache("order_search"), params); |
| | | msgVO.setType(MsgExtra.MSG_TYPE_ORDER); |
| | | list.add(msgVO); |
| | | } else if (obj instanceof MsgMoneyDetail) { |
| | | MsgMoneyDetail detail = (MsgMoneyDetail) obj; |
| | | UserMsgVO msgVO = UserMsgVOFactory.create(detail); |
| | | msgVO.setType(MsgExtra.MSG_TYPE_MONEY); |
| | | list.add(msgVO); |
| | | } else if (obj instanceof MsgAccountDetail) { |
| | | MsgAccountDetail detail = (MsgAccountDetail) obj; |
| | | UserMsgVO msgVO = UserMsgVOFactory.create(detail); |
| | | msgVO.setType(MsgExtra.MSG_TYPE_ACCOUNT); |
| | | list.add(msgVO); |
| | | } else if (obj instanceof MsgInviteDetail) { |
| | | MsgInviteDetail detail = (MsgInviteDetail) obj; |
| | | UserMsgVO vo = UserMsgVOFactory.create(detail); |
| | | if (vo != null) { |
| | | vo.setType(MsgExtra.MSG_TYPE_INVITE); |
| | | list.add(vo); |
| | | } else { |
| | | count--; |
| | | } |
| | | } else if (obj instanceof MsgOtherDetail) { |
| | | MsgOtherDetail detail = (MsgOtherDetail) obj; |
| | | UserMsgVO vo = UserMsgVOFactory.create(detail); |
| | | if (vo != null) { |
| | | vo.setType(MsgExtra.MSG_TYPE_OTHER); |
| | | list.add(vo); |
| | | } else { |
| | | count--; |
| | | } |
| | | } else if (obj instanceof MsgLijinVIPDetail) { |
| | | MsgLijinVIPDetail detail = (MsgLijinVIPDetail) obj; |
| | | JSONObject params = new JSONObject(); |
| | | params.put("url", configService.getValue(ConfigKeyEnum.lijinVIPLink, acceptData.getSystem())); |
| | | UserMsgVO vo = UserMsgVOFactory.create(detail, jumpDetailV2Service.getByTypeCache("web"), params); |
| | | vo.setType(MsgExtra.MSG_TYPE_LIJIN_VIP); |
| | | list.add(vo); |
| | | } else if (obj instanceof UserSystemMsg) { |
| | | UserSystemMsg detail = (UserSystemMsg) obj; |
| | | UserMsgVO vo = UserMsgVOFactory.create(detail); |
| | | vo.setType(MsgExtra.MSG_TYPE_SYSTEM); |
| | | list.add(vo); |
| | | } |
| | | } |
| | | |
| | | GsonBuilder builder = new GsonBuilder(); |
| | | builder = getTimeDescJsonBuilder(builder); |
| | | JSONObject root = new JSONObject(); |
| | | root.put("data", builder.create().toJson(list)); |
| | | root.put("count", count); |
| | | out.print(JsonUtil.loadTrueResult(root)); |
| | | } |
| | | |
| | | |
| | | private String getTimeDesc(Date nowDate, Date targetDate) { |
| | | Calendar now = Calendar.getInstance(); |
| | | now.setTime(nowDate); |
| | | if (TimeUtil.getGernalTime(targetDate.getTime(), "yyyy-MM-dd") |
| | | .equalsIgnoreCase(TimeUtil.getGernalTime(now.getTimeInMillis(), "yyyy-MM-dd"))) { |
| | | return "今天 " + TimeUtil.getGernalTime(targetDate.getTime(), "HH:mm"); |
| | | } else if (TimeUtil.getGernalTime(targetDate.getTime(), "yyyy-MM-dd") |
| | | .equalsIgnoreCase(TimeUtil.getGernalTime(now.getTimeInMillis() - 1000 * 60 * 60 * 24L, "yyyy-MM-dd"))) { |
| | | return "昨天 " + TimeUtil.getGernalTime(targetDate.getTime(), "HH:mm"); |
| | | } else { |
| | | return TimeUtil.getGernalTime(targetDate.getTime(), "yyyy.MM.dd HH:mm"); |
| | | } |
| | | } |
| | | |
| | | private GsonBuilder getTimeDescJsonBuilder(GsonBuilder builder) { |
| | | builder = builder.registerTypeAdapter(Date.class, new JsonSerializer<Date>() { |
| | | @Override |
| | | public JsonElement serialize(Date value, Type theType, JsonSerializationContext context) { |
| | | if (value == null) { |
| | | return new JsonPrimitive(""); |
| | | } else { |
| | | Calendar now = Calendar.getInstance(); |
| | | return new JsonPrimitive(getTimeDesc(new Date(now.getTimeInMillis()), value)); |
| | | } |
| | | } |
| | | }).registerTypeAdapter(BigDecimal.class, new JsonSerializer<BigDecimal>() { |
| | | @Override |
| | | public JsonElement serialize(BigDecimal value, Type theType, JsonSerializationContext context) { |
| | | if (value == null) { |
| | | return new JsonPrimitive("0"); |
| | | } else { |
| | | return new JsonPrimitive(BigDecimalUtil.getWithNoZera(value).toString()); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | return builder; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.yeshi.fanli.entity.bus.msg.MsgOrderDetail; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.dao.BaseMapper; |
| | |
| | | */ |
| | | List<MsgAccountDetail> listByUid(@Param("uid") Long uid, @Param("start") long start, @Param("count") int count); |
| | | |
| | | List<MsgAccountDetail> listByPrimaryKeys(@Param("ids") List<Long> ids); |
| | | |
| | | /** |
| | | * 根据用户查询数量 |
| | | * |
| | |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.yeshi.fanli.entity.bus.msg.MsgOrderDetail; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.dao.BaseMapper; |
| | |
| | | */ |
| | | List<MsgInviteDetail> listByUid(@Param("uid") Long uid, @Param("start") long start, @Param("count") int count); |
| | | |
| | | List<MsgInviteDetail> listByPrimaryKeys(@Param("ids") List<Long> ids); |
| | | |
| | | /** |
| | | * 根据用户查询数量 |
| | | * |
| | |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.yeshi.fanli.entity.bus.msg.MsgOrderDetail; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.dao.BaseMapper; |
| | |
| | | |
| | | List<MsgMoneyDetail> listByUid(@Param("uid") Long uid, @Param("start") long start, @Param("count") int count); |
| | | |
| | | List<MsgMoneyDetail> listByPrimaryKeys(@Param("ids") List<Long> ids); |
| | | |
| | | Long countByUid(@Param("uid") Long uid); |
| | | |
| | | /** |
| | |
| | | |
| | | List<MsgOrderDetail> listByUid(@Param("uid") Long uid, @Param("start") long start, @Param("count") int count); |
| | | |
| | | List<MsgOrderDetail> listByPrimaryKeys(@Param("ids") List<Long> ids); |
| | | |
| | | List<MsgOrderDetail> listByOrderId(@Param("orderId") String orderId); |
| | | |
| | | Long countByUid(@Param("uid") Long uid); |
| | |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.yeshi.fanli.entity.bus.msg.MsgOrderDetail; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.dao.BaseMapper; |
| | |
| | | */ |
| | | List<MsgOtherDetail> listByUid(@Param("uid") Long uid, @Param("start") long start, @Param("count") int count); |
| | | |
| | | List<MsgOtherDetail> listByPrimaryKeys(@Param("ids") List<Long> ids); |
| | | |
| | | /** |
| | | * 查询用户的消息数量 |
| | | * |
| | |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.yeshi.fanli.entity.bus.msg.MsgOrderDetail; |
| | | import com.yeshi.fanli.entity.bus.msg.MsgOtherDetail; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.beust.jcommander.Parameter; |
| | |
| | | */ |
| | | List<UserSystemMsg> listByUid(@Param("uid") Long uid, @Param("start") long start, @Param("count") int count); |
| | | |
| | | List<UserSystemMsg> listByPrimaryKeys(@Param("ids") List<Long> ids); |
| | | |
| | | /** |
| | | * 用户系统消息数量 |
| | | * |
| | |
| | | public final static String MSG_TYPE_ACCOUNT = "account"; |
| | | public final static String MSG_TYPE_INVITE = "invite"; |
| | | public final static String MSG_TYPE_OTHER = "other"; |
| | | public final static String MSG_TYPE_LIJIN_VIP = "lijinVip"; |
| | | public final static String MSG_TYPE_SYSTEM = "system"; |
| | | |
| | | @Column(name = "mea_id") |
| | | private Long id; |
New file |
| | |
| | | package com.yeshi.fanli.exception.msg; |
| | | |
| | | import com.yeshi.fanli.exception.BaseException; |
| | | |
| | | public class MsgLijinVIPDetailException extends BaseException { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | public MsgLijinVIPDetailException(int code, String msg) { |
| | | super(code, msg); |
| | | } |
| | | |
| | | public MsgLijinVIPDetailException() { |
| | | super(); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.yeshi.fanli.lijin.dao; |
| | | |
| | | import com.ks.lib.common.dao.BaseMapper; |
| | | import com.yeshi.fanli.lijin.entity.MsgLijinVIPDetail; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Repository |
| | | public interface MsgLijinVIPDetailMapper extends BaseMapper<MsgLijinVIPDetail> { |
| | | |
| | | |
| | | List<MsgLijinVIPDetail> listByPrimaryKeys(@Param("ids") List<Long> ids); |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.yeshi.fanli.lijin.entity; |
| | | |
| | | import com.yeshi.fanli.entity.bus.user.UserInfo; |
| | | import org.springframework.data.annotation.Transient; |
| | | import org.yeshi.utils.mybatis.Column; |
| | | import org.yeshi.utils.mybatis.Table; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 礼金会员 |
| | | */ |
| | | @Table("yeshi_ec_msg_lijin_vip") |
| | | public class MsgLijinVIPDetail implements Serializable { |
| | | |
| | | public enum MsgTypeLijinVIPTypeEnum { |
| | | vipNotify("会员提醒", "http://img.flqapp.com/resource/msg/icon_msg_order.png"), |
| | | vipDown("会员降级", "http://img.flqapp.com/resource/msg/icon_msg_order.png"); |
| | | |
| | | private final String desc; |
| | | private final String icon; |
| | | |
| | | private MsgTypeLijinVIPTypeEnum(String desc, String icon) { |
| | | this.desc = desc; |
| | | this.icon = icon; |
| | | } |
| | | |
| | | public String getDesc() { |
| | | return desc; |
| | | } |
| | | |
| | | public String getIcon() { |
| | | return icon; |
| | | } |
| | | } |
| | | |
| | | @Column(name = "mlv_id") |
| | | private Long id; |
| | | @Column(name = "mlv_uid") |
| | | private UserInfo user; |
| | | @Column(name = "mlv_type") |
| | | private MsgLijinVIPDetail.MsgTypeLijinVIPTypeEnum type;// 消息类型 |
| | | @Column(name = "mlv_remark") |
| | | private String remark; |
| | | @Column(name = "mlv_read") |
| | | private Boolean read;// 是否已读 |
| | | @Column(name = "mlv_create_time") |
| | | private Date createTime; |
| | | @Column(name = "mlv_update_time") |
| | | private Date updateTime; |
| | | |
| | | @Transient |
| | | |
| | | private String extraInfo;// 新版消息内容 |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Long id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public UserInfo getUser() { |
| | | return user; |
| | | } |
| | | |
| | | public void setUser(UserInfo user) { |
| | | this.user = user; |
| | | } |
| | | |
| | | public MsgTypeLijinVIPTypeEnum getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(MsgTypeLijinVIPTypeEnum type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public String getRemark() { |
| | | return remark; |
| | | } |
| | | |
| | | public void setRemark(String remark) { |
| | | this.remark = remark; |
| | | } |
| | | |
| | | public Boolean getRead() { |
| | | return read; |
| | | } |
| | | |
| | | public void setRead(Boolean read) { |
| | | this.read = read; |
| | | } |
| | | |
| | | public Date getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(Date createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public Date getUpdateTime() { |
| | | return updateTime; |
| | | } |
| | | |
| | | public void setUpdateTime(Date updateTime) { |
| | | this.updateTime = updateTime; |
| | | } |
| | | |
| | | public String getExtraInfo() { |
| | | return extraInfo; |
| | | } |
| | | |
| | | public void setExtraInfo(String extraInfo) { |
| | | this.extraInfo = extraInfo; |
| | | } |
| | | } |
New file |
| | |
| | | package com.yeshi.fanli.lijin.service; |
| | | |
| | | import com.yeshi.fanli.entity.bus.msg.MsgOtherDetail; |
| | | import com.yeshi.fanli.exception.msg.MsgLijinVIPDetailException; |
| | | import com.yeshi.fanli.lijin.entity.MsgLijinVIPDetail; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface MsgLijinVIPService { |
| | | |
| | | |
| | | /** |
| | | * 添加礼金会员消息 |
| | | * @param detail |
| | | * @param needNotify |
| | | * @throws MsgLijinVIPDetailException |
| | | */ |
| | | public void addMsgLijinVIPDetail(MsgLijinVIPDetail detail, boolean needNotify) throws MsgLijinVIPDetailException; |
| | | |
| | | public List<MsgLijinVIPDetail> listDetail(List<Long> ids); |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.yeshi.fanli.lijin.service.impl; |
| | | |
| | | import com.yeshi.fanli.entity.bus.msg.MsgExtra; |
| | | import com.yeshi.fanli.exception.msg.MsgLijinVIPDetailException; |
| | | import com.yeshi.fanli.lijin.dao.MsgLijinVIPDetailMapper; |
| | | import com.yeshi.fanli.lijin.entity.MsgLijinVIPDetail; |
| | | import com.yeshi.fanli.lijin.service.MsgLijinVIPService; |
| | | import com.yeshi.fanli.service.inter.msg.MsgExtraService; |
| | | import com.yeshi.fanli.service.inter.msg.MsgOverViewsService; |
| | | import com.yeshi.fanli.util.factory.msg.MsgOverViewsFactory; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class MsgLijinVIPServiceImpl implements MsgLijinVIPService { |
| | | @Resource |
| | | private MsgLijinVIPDetailMapper msgLijinVIPDetailMapper; |
| | | @Resource |
| | | private MsgOverViewsService msgOverViewsService; |
| | | @Resource |
| | | private MsgExtraService msgExtraService; |
| | | |
| | | |
| | | @Override |
| | | public void addMsgLijinVIPDetail(MsgLijinVIPDetail detail, boolean needNotify) throws MsgLijinVIPDetailException { |
| | | if (detail.getType() == null || detail.getType() == null) { |
| | | throw new MsgLijinVIPDetailException(1, "参数不完整"); |
| | | } |
| | | detail.setCreateTime(new Date()); |
| | | detail.setUpdateTime(new Date()); |
| | | detail.setRead(false); |
| | | msgLijinVIPDetailMapper.insertSelective(detail); |
| | | //加入消息索引 |
| | | msgOverViewsService.save(MsgOverViewsFactory.create(detail)); |
| | | // 消息内容 |
| | | msgExtraService.addMsgExtra(detail.getId(), detail.getExtraInfo(), MsgExtra.MSG_TYPE_LIJIN_VIP); |
| | | } |
| | | |
| | | @Override |
| | | public List<MsgLijinVIPDetail> listDetail(List<Long> ids) { |
| | | return msgLijinVIPDetailMapper.listByPrimaryKeys(ids); |
| | | } |
| | | } |
| | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.yeshi.fanli.service.inter.msg.MsgOverViewsService; |
| | | import com.yeshi.fanli.util.factory.msg.MsgOverViewsFactory; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.yeshi.fanli.dao.mybatis.msg.MsgMoneyDetailMapper; |
| | |
| | | detail.setUpdateTime(new Date()); |
| | | detail.setRead(false); |
| | | msgMoneyDetailMapper.insertSelective(detail); |
| | | / |
| | | //加入消息索引 |
| | | msgOverViewsService.save(MsgOverViewsFactory.create(detail)); |
| | | msgExtraService.addMsgExtra(detail.getId(), detail.getExtraInfo(), MsgExtra.MSG_TYPE_MONEY); |
| | | } else { |
| | | MsgMoneyDetail update = new MsgMoneyDetail(); |
| | |
| | | update.setRead(false); |
| | | update.setStateDesc(detail.getStateDesc()); |
| | | msgMoneyDetailMapper.updateByPrimaryKeySelective(update); |
| | | / |
| | | //更新消息索引时间 |
| | | msgOverViewsService.updateTime(MsgOverViewsFactory.create(detail).getId(), update.getUpdateTime()); |
| | | msgExtraService.addMsgExtra(update.getId(), detail.getExtraInfo(), MsgExtra.MSG_TYPE_MONEY); |
| | | } |
| | | } else if (detail.getMsgType() == MsgTypeMoneyTypeEnum.extractValid) { |
| | |
| | | detail.setUpdateTime(new Date()); |
| | | detail.setRead(false); |
| | | msgMoneyDetailMapper.insertSelective(detail); |
| | | / |
| | | //加入消息索引 |
| | | msgOverViewsService.save(MsgOverViewsFactory.create(detail)); |
| | | msgExtraService.addMsgExtra(detail.getId(), detail.getExtraInfo(), MsgExtra.MSG_TYPE_MONEY); |
| | | } else { |
| | | MsgMoneyDetail update = new MsgMoneyDetail(); |
| | |
| | | update.setRead(false); |
| | | update.setStateDesc(detail.getStateDesc()); |
| | | msgMoneyDetailMapper.updateByPrimaryKeySelective(update); |
| | | / |
| | | //更新消息索引时间 |
| | | msgOverViewsService.updateTime(MsgOverViewsFactory.create(detail).getId(), update.getUpdateTime()); |
| | | msgExtraService.addMsgExtra(update.getId(), detail.getExtraInfo(), MsgExtra.MSG_TYPE_MONEY); |
| | | } |
| | | } else { |
| | |
| | | detail.setUpdateTime(new Date()); |
| | | detail.setRead(false); |
| | | msgMoneyDetailMapper.insertSelective(detail); |
| | | / |
| | | //加入消息索引 |
| | | msgOverViewsService.save(MsgOverViewsFactory.create(detail)); |
| | | msgExtraService.addMsgExtra(detail.getId(), detail.getExtraInfo(), MsgExtra.MSG_TYPE_MONEY); |
| | | } |
| | | userMsgReadStateService.addMoneyMsgUnReadCount(detail.getUser().getId(), 1); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<MsgMoneyDetail> listDetail(List<Long> ids) { |
| | | return msgMoneyDetailMapper.listByPrimaryKeys(ids); |
| | | } |
| | | |
| | | @Override |
| | | public long countMsgMoneyDetail(Long uid) { |
| | | return msgMoneyDetailMapper.countByUid(uid); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<MsgOtherDetail> listDetail(List<Long> ids) { |
| | | return msgOtherDetailMapper.listByPrimaryKeys(ids); |
| | | } |
| | | |
| | | @Override |
| | | public long countMsgOtherDetail(Long uid) { |
| | | return msgOtherDetailMapper.countByUid(uid); |
| | | } |
| | |
| | | package com.yeshi.fanli.service.impl.msg; |
| | | |
| | | import com.yeshi.fanli.dao.user.msg.MsgOverViewsDao; |
| | | import com.yeshi.fanli.entity.bus.msg.MsgOverViews; |
| | | import com.yeshi.fanli.entity.bus.msg.*; |
| | | import com.yeshi.fanli.lijin.entity.MsgLijinVIPDetail; |
| | | import com.yeshi.fanli.lijin.service.MsgLijinVIPService; |
| | | import com.yeshi.fanli.lijin.service.impl.MsgLijinVIPServiceImpl; |
| | | import com.yeshi.fanli.service.inter.money.msg.MsgMoneyDetailService; |
| | | import com.yeshi.fanli.service.inter.msg.MsgOtherDetailService; |
| | | import com.yeshi.fanli.service.inter.msg.MsgOverViewsService; |
| | | import com.yeshi.fanli.service.inter.msg.UserSystemMsgService; |
| | | import com.yeshi.fanli.service.inter.order.msg.MsgOrderDetailService; |
| | | import com.yeshi.fanli.service.inter.user.invite.MsgInviteDetailService; |
| | | import com.yeshi.fanli.service.inter.user.msg.MsgAccountDetailService; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.data.mongodb.core.query.Update; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.io.Serializable; |
| | | import java.util.*; |
| | | |
| | | @Service |
| | | public class MsgOverViewsServiceImpl implements MsgOverViewsService { |
| | | |
| | | @Resource |
| | | private MsgOverViewsDao msgOverViewsDao; |
| | | @Resource |
| | | private MsgAccountDetailService msgAccountDetailService; |
| | | @Resource |
| | | private MsgInviteDetailService msgInviteDetailService; |
| | | @Resource |
| | | private MsgMoneyDetailService msgMoneyDetailService; |
| | | @Resource |
| | | private MsgOrderDetailService msgOrderDetailService; |
| | | @Resource |
| | | private MsgOtherDetailService msgOtherDetailService; |
| | | @Resource |
| | | private MsgLijinVIPService msgLijinVIPService; |
| | | @Resource |
| | | private UserSystemMsgService userSystemMsgService; |
| | | |
| | | @Override |
| | | public void save(MsgOverViews msgOverViews) { |
| | |
| | | } |
| | | |
| | | msgOverViewsDao.save(msgOverViews); |
| | | } |
| | | |
| | | @Override |
| | | public void updateTime(String id, Date updateTime) { |
| | | Update update = new Update(); |
| | | update.set("updateTime", updateTime); |
| | | Query query = new Query(); |
| | | query.addCriteria(Criteria.where("id").is(id)); |
| | | msgOverViewsDao.update(query, update); |
| | | } |
| | | |
| | | @Override |
| | |
| | | daoQuery.uid = uid; |
| | | return msgOverViewsDao.count(daoQuery); |
| | | } |
| | | |
| | | @Override |
| | | public List<Object> listDetail(List<MsgOverViews> msgList) { |
| | | Object[] objs = new Object[msgList.size()]; |
| | | //分类型查询详情 |
| | | Map<MsgTypeEnum, List<Long>> map = new HashMap<>(); |
| | | Map<String, Integer> positionMap = new HashMap<>(); |
| | | int p = 0; |
| | | for (MsgOverViews views : msgList) { |
| | | positionMap.put(views.getMsgType().name() + "#" + views.getIdentityCode(), p++); |
| | | if (map.get(views.getMsgType()) == null) { |
| | | map.put(views.getMsgType(), new ArrayList<>()); |
| | | } |
| | | map.get(views.getMsgType()).add(views.getIdentityCode()); |
| | | } |
| | | |
| | | for (Iterator<MsgTypeEnum> its = map.keySet().iterator(); its.hasNext(); ) { |
| | | MsgTypeEnum type = its.next(); |
| | | List<Long> ids = map.get(type); |
| | | if (type == MsgTypeEnum.lijinVip) { |
| | | List<MsgLijinVIPDetail> list = (msgLijinVIPService.listDetail(ids)); |
| | | for (MsgLijinVIPDetail detail : list) { |
| | | objs[positionMap.get(type.name() + "#" + detail.getId())] = detail; |
| | | } |
| | | } else if (type == MsgTypeEnum.money) { |
| | | List<MsgMoneyDetail> list = (msgMoneyDetailService.listDetail(ids)); |
| | | for (MsgMoneyDetail detail : list) { |
| | | objs[positionMap.get(type.name() + "#" + detail.getId())] = detail; |
| | | } |
| | | } else if (type == MsgTypeEnum.order) { |
| | | List<MsgOrderDetail> list = (msgOrderDetailService.listDetail(ids)); |
| | | for (MsgOrderDetail detail : list) { |
| | | objs[positionMap.get(type.name() + "#" + detail.getId())] = detail; |
| | | } |
| | | } else if (type == MsgTypeEnum.other) { |
| | | List<MsgOtherDetail> list = (msgOtherDetailService.listDetail(ids)); |
| | | for (MsgOtherDetail detail : list) { |
| | | objs[positionMap.get(type.name() + "#" + detail.getId())] = detail; |
| | | } |
| | | } else if (type == MsgTypeEnum.account) { |
| | | List<MsgAccountDetail> list = (msgAccountDetailService.listDetail(ids)); |
| | | for (MsgAccountDetail detail : list) { |
| | | objs[positionMap.get(type.name() + "#" + detail.getId())] = detail; |
| | | } |
| | | } else if (type == MsgTypeEnum.invite) { |
| | | List<MsgInviteDetail> list = (msgInviteDetailService.listDetail(ids)); |
| | | for (MsgInviteDetail detail : list) { |
| | | objs[positionMap.get(type.name() + "#" + detail.getId())] = detail; |
| | | } |
| | | } else if (type == MsgTypeEnum.system) { |
| | | List<UserSystemMsg> list = (userSystemMsgService.listDetail(ids)); |
| | | for (UserSystemMsg detail : list) { |
| | | objs[positionMap.get(type.name() + "#" + detail.getId())] = detail; |
| | | } |
| | | } |
| | | } |
| | | return Arrays.asList(objs); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.yeshi.fanli.entity.bus.msg.MsgOtherDetail; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<UserSystemMsg> listDetail(List<Long> ids) { |
| | | return userSystemMsgMapper.listByPrimaryKeys(ids); |
| | | } |
| | | |
| | | @Override |
| | | public long countUserSystemMsg(Long uid) { |
| | | return userSystemMsgMapper.countByUid(uid); |
| | | } |
| | |
| | | |
| | | import com.yeshi.fanli.service.inter.msg.MsgOverViewsService; |
| | | import com.yeshi.fanli.util.RedisManager; |
| | | import com.yeshi.fanli.util.factory.msg.MsgOverViewsFactory; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.yeshi.fanli.dao.mybatis.msg.MsgOrderDetailMapper; |
| | |
| | | detail.setUpdateTime(new Date()); |
| | | detail.setRead(false); |
| | | msgOrderDetailMapper.insertSelective(detail); |
| | | / |
| | | //加入消息索引 |
| | | msgOverViewsService.save(MsgOverViewsFactory.create(detail)); |
| | | // 消息内容 |
| | | msgExtraService.addMsgExtra(detail.getId(), detail.getExtraInfo(), MsgExtra.MSG_TYPE_ORDER); |
| | | } else { |
| | |
| | | update.setRead(false); |
| | | update.setBeiZhu(detail.getBeiZhu()); |
| | | msgOrderDetailMapper.updateByPrimaryKeySelective(update); |
| | | / |
| | | //更新消息索引时间 |
| | | msgOverViewsService.updateTime(MsgOverViewsFactory.create(detail).getId(), update.getUpdateTime()); |
| | | msgExtraService.addMsgExtra(update.getId(), detail.getExtraInfo(), MsgExtra.MSG_TYPE_ORDER); |
| | | } |
| | | if (needNotify) |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<MsgOrderDetail> listDetail(List<Long> ids) { |
| | | return msgOrderDetailMapper.listByPrimaryKeys(ids); |
| | | } |
| | | |
| | | @Override |
| | | public long countMsgOrderDetail(Long uid) { |
| | | return msgOrderDetailMapper.countByUid(uid); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<MsgInviteDetail> listDetail(List<Long> ids) { |
| | | return msgInviteDetailMapper.listByPrimaryKeys(ids); |
| | | } |
| | | |
| | | @Override |
| | | public long countMsgInviteDetail(Long uid) { |
| | | return msgInviteDetailMapper.countByUid(uid); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<MsgAccountDetail> listDetail(List<Long> ids) { |
| | | return msgAccountDetailMapper.listByPrimaryKeys(ids); |
| | | } |
| | | |
| | | @Override |
| | | public long countMsgAccountDetail(Long uid) { |
| | | return msgAccountDetailMapper.countByUid(uid); |
| | | } |
| | |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.yeshi.fanli.entity.bus.msg.MsgInviteDetail; |
| | | import com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail; |
| | | import com.yeshi.fanli.exception.msg.MsgMoneyDetailException; |
| | | |
| | |
| | | */ |
| | | public List<MsgMoneyDetail> listMsgMoneyDetail(Long uid, int page); |
| | | |
| | | public List<MsgMoneyDetail> listDetail(List<Long> ids); |
| | | |
| | | /** |
| | | * 资金消息数 |
| | | * |
| | |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.yeshi.fanli.entity.bus.msg.MsgOrderDetail; |
| | | import com.yeshi.fanli.entity.bus.msg.MsgOtherDetail; |
| | | import com.yeshi.fanli.exception.msg.MsgOtherDetailException; |
| | | |
| | |
| | | */ |
| | | public List<MsgOtherDetail> listMsgOtherDetail(Long uid, int page); |
| | | |
| | | public List<MsgOtherDetail> listDetail(List<Long> ids); |
| | | |
| | | /** |
| | | * 其他消息数 |
| | | * |
| | |
| | | |
| | | import com.yeshi.fanli.entity.bus.msg.MsgOverViews; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | public interface MsgOverViewsService { |
| | |
| | | public void save(MsgOverViews msgOverViews); |
| | | |
| | | |
| | | /** |
| | | * 更新更新时间 |
| | | * |
| | | * @param id |
| | | * @param updateTime |
| | | */ |
| | | public void updateTime(String id, Date updateTime); |
| | | |
| | | |
| | | public List<MsgOverViews> listByUid(Long uid, int page, int pageSize); |
| | | |
| | | |
| | | public long countByUid(Long uid); |
| | | |
| | | public List<Object> listDetail(List<MsgOverViews> msgList); |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.yeshi.fanli.entity.bus.msg.MsgOtherDetail; |
| | | import com.yeshi.fanli.entity.bus.msg.UserSystemMsg; |
| | | import com.yeshi.fanli.entity.bus.msg.UserSystemMsgTypeEnum; |
| | | import com.yeshi.fanli.entity.system.SystemZnx; |
| | |
| | | */ |
| | | public List<UserSystemMsg> listUserSystemMsg(Long uid, int page, int pageSize); |
| | | |
| | | public List<UserSystemMsg> listDetail(List<Long> ids); |
| | | |
| | | /** |
| | | * 用户系统消息数 |
| | | * |
| | |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail; |
| | | import com.yeshi.fanli.entity.bus.msg.MsgOrderDetail; |
| | | import com.yeshi.fanli.exception.msg.MsgOrderDetailException; |
| | | |
| | |
| | | */ |
| | | public List<MsgOrderDetail> listMsgOrderDetail(Long uid, int page); |
| | | |
| | | public List<MsgOrderDetail> listDetail(List<Long> ids); |
| | | |
| | | /** |
| | | * 根据订单号获取 |
| | | * @return |
| | |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.yeshi.fanli.entity.bus.msg.MsgAccountDetail; |
| | | import com.yeshi.fanli.entity.bus.msg.MsgInviteDetail; |
| | | import com.yeshi.fanli.entity.bus.user.ThreeSale; |
| | | import com.yeshi.fanli.exception.msg.MsgInviteDetailException; |
| | |
| | | */ |
| | | public List<MsgInviteDetail> listMsgInviteDetail(Long uid, int page); |
| | | |
| | | public List<MsgInviteDetail> listDetail(List<Long> ids); |
| | | |
| | | /** |
| | | * 账户消息数 |
| | | * |
| | |
| | | */ |
| | | public List<MsgAccountDetail> listMsgAccountDetail(Long uid, int page); |
| | | |
| | | |
| | | public List<MsgAccountDetail> listDetail(List<Long> ids); |
| | | |
| | | /** |
| | | * 账户消息数 |
| | | * |
File was renamed from fanli/src/main/java/com/yeshi/fanli/service/inter/vipshop/JDGoodsClassService.java |
| | |
| | | |
| | | import com.yeshi.fanli.entity.jd.JDGoodsClass; |
| | | |
| | | public interface JDGoodsClassService { |
| | | public interface VIPShopClassService { |
| | | |
| | | public void insertSelective(JDGoodsClass record); |
| | | |
File was renamed from fanli/src/main/java/com/yeshi/fanli/service/inter/vipshop/JDGoodsService.java |
| | |
| | | import com.yeshi.fanli.entity.jd.JDGoods; |
| | | import com.yeshi.fanli.exception.jd.JDGoodsException; |
| | | |
| | | public interface JDGoodsService { |
| | | public interface VIPShopGoodsService { |
| | | |
| | | /** |
| | | * 专题分类 |
New file |
| | |
| | | package com.yeshi.fanli.util.factory.msg; |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.ks.vip.pojo.Enums.VIPEnum; |
| | | import com.yeshi.common.vo.ClientTextStyleVO; |
| | | import com.yeshi.fanli.entity.bus.msg.MsgOrderDetail; |
| | | import com.yeshi.fanli.entity.bus.msg.MsgOrderDetail.MsgTypeOrderTypeEnum; |
| | | import com.yeshi.fanli.entity.bus.user.UserInfo; |
| | | import com.yeshi.fanli.lijin.entity.MsgLijinVIPDetail; |
| | | import com.yeshi.fanli.util.Constant; |
| | | import com.yeshi.fanli.util.StringUtil; |
| | | import com.yeshi.fanli.vo.msg.CommonMsgItemVO; |
| | | import com.yeshi.fanli.vo.msg.CommonMsgItemVOFactory; |
| | | import org.yeshi.utils.TimeUtil; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | public class MsgLijinVIPDetailFactory { |
| | | |
| | | |
| | | /** |
| | | * 会员即将到期 |
| | | * |
| | | * @param uid |
| | | * @param outOfDateTime |
| | | * @param remark |
| | | * @return |
| | | */ |
| | | public static MsgLijinVIPDetail createVIPWillOutOfDate(Long uid, Date outOfDateTime, VIPEnum vipLevel, String remark) { |
| | | if (uid == null || outOfDateTime == null) |
| | | return null; |
| | | |
| | | long time = outOfDateTime.getTime() - System.currentTimeMillis(); |
| | | time = time < 0 ? 0L : time; |
| | | time = time / 1000; |
| | | String timeDesc = ""; |
| | | if (time < 60) { |
| | | timeDesc += time + "秒"; |
| | | } else if (time < 60 * 60) { |
| | | timeDesc += time / 60 + "分"; |
| | | } else if (time < 60 * 60 * 24L) { |
| | | timeDesc += time / (60 * 60) + "小时"; |
| | | } else { |
| | | timeDesc += time / (60 * 60 * 24) + "天"; |
| | | } |
| | | |
| | | |
| | | // 添加内容 |
| | | List<CommonMsgItemVO> listMsg = new ArrayList<>(); |
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("有效期", ClientTextStyleVO.COLOR_TITLE), |
| | | new ClientTextStyleVO(vipLevel.getDesc() + "会员" + timeDesc, ClientTextStyleVO.COLOR_CONTENT))); |
| | | |
| | | |
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("备注", ClientTextStyleVO.COLOR_TITLE), |
| | | new ClientTextStyleVO(StringUtil.isNullOrEmpty(remark) ? "无" : remark, |
| | | ClientTextStyleVO.COLOR_CONTENT))); |
| | | |
| | | MsgLijinVIPDetail detail = new MsgLijinVIPDetail(); |
| | | detail.setRemark(remark); |
| | | detail.setCreateTime(new Date()); |
| | | detail.setRead(false); |
| | | detail.setType(MsgLijinVIPDetail.MsgTypeLijinVIPTypeEnum.vipNotify); |
| | | detail.setUser(new UserInfo(uid)); |
| | | detail.setExtraInfo(new Gson().toJson(listMsg)); |
| | | return detail; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 会员降级 |
| | | * |
| | | * @param uid |
| | | * @param nowVIPLevel |
| | | * @param originVIPLevel |
| | | * @param remark |
| | | * @return |
| | | */ |
| | | public static MsgLijinVIPDetail createVIPLevelDown(Long uid, VIPEnum nowVIPLevel, VIPEnum originVIPLevel, String remark) { |
| | | if (uid == null || nowVIPLevel == null) |
| | | return null; |
| | | |
| | | // 添加内容 |
| | | List<CommonMsgItemVO> listMsg = new ArrayList<>(); |
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("当前会员", ClientTextStyleVO.COLOR_TITLE), |
| | | new ClientTextStyleVO(nowVIPLevel.getDesc(), ClientTextStyleVO.COLOR_CONTENT))); |
| | | |
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("备注", ClientTextStyleVO.COLOR_TITLE), |
| | | new ClientTextStyleVO(StringUtil.isNullOrEmpty(remark) ? "无" : remark, |
| | | ClientTextStyleVO.COLOR_CONTENT))); |
| | | |
| | | MsgLijinVIPDetail detail = new MsgLijinVIPDetail(); |
| | | detail.setRemark(remark); |
| | | detail.setCreateTime(new Date()); |
| | | detail.setRead(false); |
| | | detail.setType(MsgLijinVIPDetail.MsgTypeLijinVIPTypeEnum.vipDown); |
| | | detail.setUser(new UserInfo(uid)); |
| | | detail.setExtraInfo(new Gson().toJson(listMsg)); |
| | | return detail; |
| | | } |
| | | |
| | | } |
| | |
| | | * @param beiZhu 备注信息 - 非必填 |
| | | * @return |
| | | */ |
| | | @Transactional |
| | | public static MsgOrderDetail createOrderStatistics(Long uid, String orderId, int source, int type, int goodsCount, |
| | | BigDecimal payMoney, BigDecimal money, Date downTime, String beiZhu) { |
| | | if (uid == null || StringUtil.isNullOrEmpty(orderId) || downTime == null) |
New file |
| | |
| | | package com.yeshi.fanli.util.factory.msg; |
| | | |
| | | import com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail; |
| | | import com.yeshi.fanli.entity.bus.msg.MsgOrderDetail; |
| | | import com.yeshi.fanli.entity.bus.msg.MsgOverViews; |
| | | import com.yeshi.fanli.entity.bus.msg.MsgTypeEnum; |
| | | import com.yeshi.fanli.lijin.entity.MsgLijinVIPDetail; |
| | | |
| | | import java.util.Date; |
| | | |
| | | public class MsgOverViewsFactory { |
| | | |
| | | public static MsgOverViews create(MsgOrderDetail msgOrderDetail) { |
| | | MsgOverViews overViews = new MsgOverViews(); |
| | | overViews.setIdentityCode(msgOrderDetail.getId()); |
| | | overViews.setMsgType(MsgTypeEnum.order); |
| | | overViews.setUid(msgOrderDetail.getUser().getId()); |
| | | overViews.setCreateTime(msgOrderDetail.getCreateTime()); |
| | | overViews.setUpdateTime(msgOrderDetail.getUpdateTime()); |
| | | overViews.setId(MsgOverViews.createId(overViews.getMsgType(), overViews.getIdentityCode())); |
| | | return overViews; |
| | | } |
| | | |
| | | |
| | | public static MsgOverViews create(MsgMoneyDetail msgMoneyDetail) { |
| | | MsgOverViews overViews = new MsgOverViews(); |
| | | overViews.setIdentityCode(msgMoneyDetail.getId()); |
| | | overViews.setMsgType(MsgTypeEnum.money); |
| | | overViews.setUid(msgMoneyDetail.getUser().getId()); |
| | | overViews.setCreateTime(msgMoneyDetail.getCreateTime()); |
| | | overViews.setUpdateTime(msgMoneyDetail.getUpdateTime()); |
| | | overViews.setId(MsgOverViews.createId(overViews.getMsgType(), overViews.getIdentityCode())); |
| | | return overViews; |
| | | } |
| | | |
| | | public static MsgOverViews create(MsgLijinVIPDetail msgLijinVIPetail) { |
| | | MsgOverViews overViews = new MsgOverViews(); |
| | | overViews.setIdentityCode(msgLijinVIPetail.getId()); |
| | | overViews.setMsgType(MsgTypeEnum.lijinVip); |
| | | overViews.setUid(msgLijinVIPetail.getUser().getId()); |
| | | overViews.setCreateTime(msgLijinVIPetail.getCreateTime()); |
| | | overViews.setUpdateTime(msgLijinVIPetail.getUpdateTime()); |
| | | overViews.setId(MsgOverViews.createId(overViews.getMsgType(), overViews.getIdentityCode())); |
| | | return overViews; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | import com.yeshi.fanli.dto.msg.MsgRedPackGiveContentDTO; |
| | | import com.yeshi.fanli.dto.msg.MsgRedPackTeamRewardContentDTO; |
| | | import com.yeshi.fanli.dto.msg.MsgRedPackUseContentDTO; |
| | | import com.yeshi.fanli.entity.bus.msg.MsgAccountDetail; |
| | | import com.yeshi.fanli.entity.bus.msg.*; |
| | | import com.yeshi.fanli.entity.bus.msg.MsgAccountDetail.MsgTypeAccountTypeEnum; |
| | | import com.yeshi.fanli.entity.bus.msg.MsgInviteDetail; |
| | | import com.yeshi.fanli.entity.bus.msg.MsgInviteDetail.MsgTypeInviteTypeEnum; |
| | | import com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail; |
| | | import com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail.MsgTypeMoneyTypeEnum; |
| | | import com.yeshi.fanli.entity.bus.msg.MsgOrderDetail; |
| | | import com.yeshi.fanli.entity.bus.msg.MsgOrderDetail.MsgTypeOrderTypeEnum; |
| | | import com.yeshi.fanli.entity.bus.msg.MsgOtherDetail; |
| | | import com.yeshi.fanli.entity.bus.msg.MsgOtherDetail.MsgTypeOtherTypeEnum; |
| | | import com.yeshi.fanli.entity.bus.user.BindingAccount; |
| | | import com.yeshi.fanli.entity.bus.user.Extract; |
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2; |
| | | import com.yeshi.fanli.entity.common.JumpDetailV2; |
| | | import com.yeshi.fanli.lijin.entity.MsgLijinVIPDetail; |
| | | import com.yeshi.fanli.log.LogHelper; |
| | | import com.yeshi.fanli.util.Constant; |
| | | import com.yeshi.fanli.util.StringUtil; |
| | |
| | | // 新版消息 |
| | | if (!StringUtil.isNullOrEmpty(msg.getExtraInfo())) { |
| | | Gson gson = new Gson(); |
| | | items.addAll(gson.fromJson(msg.getExtraInfo(), new TypeToken<ArrayList<CommonMsgItemVO>>() {}.getType())); |
| | | items.addAll(gson.fromJson(msg.getExtraInfo(), new TypeToken<ArrayList<CommonMsgItemVO>>() { |
| | | }.getType())); |
| | | |
| | | UserMsgVO userMsgVO = new UserMsgVO(); |
| | | userMsgVO.setId(msg.getId()); |
| | |
| | | // 新版消息 |
| | | if (!StringUtil.isNullOrEmpty(msg.getExtraInfo())) { |
| | | Gson gson = new Gson(); |
| | | items.addAll(gson.fromJson(msg.getExtraInfo(), new TypeToken<ArrayList<CommonMsgItemVO>>() {}.getType())); |
| | | items.addAll(gson.fromJson(msg.getExtraInfo(), new TypeToken<ArrayList<CommonMsgItemVO>>() { |
| | | }.getType())); |
| | | |
| | | UserMsgVO userMsgVO = new UserMsgVO(); |
| | | userMsgVO.setId(msg.getId()); |
| | |
| | | // 新版消息 |
| | | if (!StringUtil.isNullOrEmpty(msg.getExtraInfo())) { |
| | | Gson gson = new Gson(); |
| | | items.addAll(gson.fromJson(msg.getExtraInfo(), new TypeToken<ArrayList<CommonMsgItemVO>>() {}.getType())); |
| | | items.addAll(gson.fromJson(msg.getExtraInfo(), new TypeToken<ArrayList<CommonMsgItemVO>>() { |
| | | }.getType())); |
| | | |
| | | UserMsgVO userMsgVO = new UserMsgVO(); |
| | | userMsgVO.setId(msg.getId()); |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | contentList.add(new ClientTextStyleVO(msg.getTitle() + "", COLOR_CONTENT)); |
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("事项", COLOR_TITLE), contentList)); |
| | | |
| | |
| | | if (!StringUtil.isNullOrEmpty(msg.getExtraInfo())) { |
| | | Gson gson = new Gson(); |
| | | List<CommonMsgItemVO> items = new ArrayList<>(); |
| | | items.addAll(gson.fromJson(msg.getExtraInfo(), new TypeToken<ArrayList<CommonMsgItemVO>>() {}.getType())); |
| | | items.addAll(gson.fromJson(msg.getExtraInfo(), new TypeToken<ArrayList<CommonMsgItemVO>>() { |
| | | }.getType())); |
| | | |
| | | UserMsgVO userMsgVO = new UserMsgVO(); |
| | | userMsgVO.setId(msg.getId()); |
| | |
| | | // 新版消息 |
| | | if (!StringUtil.isNullOrEmpty(msg.getExtraInfo())) { |
| | | Gson gson = new Gson(); |
| | | items.addAll(gson.fromJson(msg.getExtraInfo(), new TypeToken<ArrayList<CommonMsgItemVO>>() {}.getType())); |
| | | items.addAll(gson.fromJson(msg.getExtraInfo(), new TypeToken<ArrayList<CommonMsgItemVO>>() { |
| | | }.getType())); |
| | | |
| | | UserMsgVO userMsgVO = new UserMsgVO(); |
| | | userMsgVO.setId(msg.getId()); |
| | |
| | | return null; |
| | | |
| | | Gson gson = new Gson(); |
| | | items.addAll(gson.fromJson(msg.getContent(), new TypeToken<ArrayList<CommonMsgItemVO>>() {}.getType())); |
| | | items.addAll(gson.fromJson(msg.getContent(), new TypeToken<ArrayList<CommonMsgItemVO>>() { |
| | | }.getType())); |
| | | |
| | | UserMsgVO userMsgVO = new UserMsgVO(); |
| | | userMsgVO.setId(msg.getId()); |
| | |
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 礼金消息 |
| | | * |
| | | * @param msg |
| | | * @return |
| | | */ |
| | | public static UserMsgVO create(MsgLijinVIPDetail msg, JumpDetailV2 jumpDetail, JSONObject params) { |
| | | List<CommonMsgItemVO> items = new ArrayList<>(); |
| | | |
| | | // 新版消息 |
| | | if (!StringUtil.isNullOrEmpty(msg.getExtraInfo())) { |
| | | Gson gson = new Gson(); |
| | | items.addAll(gson.fromJson(msg.getExtraInfo(), new TypeToken<ArrayList<CommonMsgItemVO>>() { |
| | | }.getType())); |
| | | |
| | | UserMsgVO userMsgVO = new UserMsgVO(); |
| | | userMsgVO.setId(msg.getId()); |
| | | userMsgVO.setIcon(msg.getType().getIcon()); |
| | | userMsgVO.setTitle(msg.getType().getDesc()); |
| | | userMsgVO.setTime(msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime()); |
| | | userMsgVO.setContentItems(items); |
| | | |
| | | userMsgVO.setJumpDetail(jumpDetail); |
| | | if (params != null) |
| | | userMsgVO.setParams(params.toString()); |
| | | |
| | | return userMsgVO; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | //TODO 系统消息 |
| | | public static UserMsgVO create(UserSystemMsg msg) { |
| | | List<CommonMsgItemVO> items = new ArrayList<>(); |
| | | |
| | | List<ClientTextStyleVO> contentList = null; |
| | | |
| | | contentList = new ArrayList<>(); |
| | | contentList.add(new ClientTextStyleVO(msg.getTitle(), COLOR_CONTENT)); |
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("标题", COLOR_TITLE), contentList)); |
| | | |
| | | |
| | | contentList = new ArrayList<>(); |
| | | contentList.add(new ClientTextStyleVO(msg.getContent(), COLOR_CONTENT)); |
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("内容", COLOR_TITLE), contentList)); |
| | | |
| | | |
| | | UserMsgVO userMsgVO = new UserMsgVO(); |
| | | userMsgVO.setId(msg.getId()); |
| | | userMsgVO.setIcon(""); |
| | | userMsgVO.setTitle(msg.getType().getDesc()); |
| | | userMsgVO.setTime(msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime()); |
| | | userMsgVO.setContentItems(items); |
| | | return userMsgVO; |
| | | } |
| | | } |
New file |
| | |
| | | package com.yeshi.fanli.util.mybatishandler.msg; |
| | | |
| | | import com.yeshi.fanli.lijin.entity.MsgLijinVIPDetail; |
| | | import org.apache.ibatis.type.BaseTypeHandler; |
| | | import org.apache.ibatis.type.JdbcType; |
| | | |
| | | import java.sql.CallableStatement; |
| | | import java.sql.PreparedStatement; |
| | | import java.sql.ResultSet; |
| | | import java.sql.SQLException; |
| | | |
| | | public class MsgTypeLijinVIPTypeEnumHandler extends BaseTypeHandler<MsgLijinVIPDetail.MsgTypeLijinVIPTypeEnum> { |
| | | |
| | | @Override |
| | | public MsgLijinVIPDetail.MsgTypeLijinVIPTypeEnum getNullableResult(ResultSet arg0, String arg1) throws SQLException { |
| | | String key = arg0.getString(arg1); |
| | | if (arg0.wasNull()) { |
| | | return null; |
| | | } else { |
| | | return MsgLijinVIPDetail.MsgTypeLijinVIPTypeEnum.valueOf(key); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public MsgLijinVIPDetail.MsgTypeLijinVIPTypeEnum getNullableResult(ResultSet arg0, int arg1) throws SQLException { |
| | | String key = arg0.getString(arg1); |
| | | if (arg0.wasNull()) { |
| | | return null; |
| | | } else { |
| | | // 根据数据库中的key值,定位SexEnum子类 |
| | | return MsgLijinVIPDetail.MsgTypeLijinVIPTypeEnum.valueOf(key); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public MsgLijinVIPDetail.MsgTypeLijinVIPTypeEnum getNullableResult(CallableStatement arg0, int arg1) throws SQLException { |
| | | String key = arg0.getString(arg1); |
| | | if (arg0.wasNull()) { |
| | | return null; |
| | | } else { |
| | | // 根据数据库中的key值,定位SexEnum子类 |
| | | return MsgLijinVIPDetail.MsgTypeLijinVIPTypeEnum.valueOf(key); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void setNonNullParameter(PreparedStatement arg0, int arg1, MsgLijinVIPDetail.MsgTypeLijinVIPTypeEnum arg2, JdbcType arg3) |
| | | throws SQLException { |
| | | arg0.setString(arg1, arg2.name()); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | |
| | | <mapper namespace="com.yeshi.fanli.lijin.dao.MsgLijinVIPDetailMapper"> |
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.lijin.entity.MsgLijinVIPDetail"> |
| | | <id column="mlv_id" property="id" jdbcType="BIGINT"/> |
| | | <result column="mlv_type" property="type" |
| | | typeHandler="com.yeshi.fanli.util.mybatishandler.msg.MsgTypeLijinVIPTypeEnumHandler"/> |
| | | <result column="mlv_remark" property="remark" jdbcType="VARCHAR"/> |
| | | <result column="mlv_read" property="read" jdbcType="BOOLEAN"/> |
| | | <result column="mlv_create_time" property="createTime" jdbcType="TIMESTAMP"/> |
| | | <result column="mlv_update_time" property="updateTime" jdbcType="TIMESTAMP"/> |
| | | <result column="extraInfo" property="extraInfo" jdbcType="VARCHAR"/> |
| | | <association property="user" column="mlv_uid" |
| | | javaType="com.yeshi.fanli.entity.bus.user.UserInfo"> |
| | | <id column="mlv_uid" property="id" jdbcType="BIGINT"/> |
| | | </association> |
| | | </resultMap> |
| | | <sql id="Base_Column_List">mlv_id,mlv_uid,mlv_type,mlv_remark,mlv_read,mlv_create_time,mlv_update_time</sql> |
| | | |
| | | <select id="listByPrimaryKeys" resultMap="BaseResultMap"> |
| | | SELECT d.*, t.`mea_content` AS extraInfo FROM yeshi_ec_msg_lijin_vip d |
| | | LEFT JOIN `yeshi_ec_msg_extra` t ON (t.`mea_rid` = d.`mlv_id` AND t.`mea_type` = 'lijinVip') |
| | | WHERE |
| | | <foreach collection="ids" separator=" or " open="(" close=")" item="id"> |
| | | mlv_id=#{id} |
| | | </foreach> |
| | | </select> |
| | | |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select |
| | | <include refid="Base_Column_List"/>from yeshi_ec_msg_lijin_vip where mlv_id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" |
| | | parameterType="java.lang.Long">delete from yeshi_ec_msg_lijin_vip where mlv_id = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.lijin.entity.MsgLijinVIPDetail" useGeneratedKeys="true" |
| | | keyProperty="id">insert into yeshi_ec_msg_lijin_vip (mlv_id,mlv_uid,mlv_type,mlv_remark,mlv_read,mlv_create_time,mlv_update_time) values (#{id,jdbcType=BIGINT},#{user.id,jdbcType=BIGINT},#{type,jdbcType=VARCHAR},#{remark,jdbcType=VARCHAR},#{read,jdbcType=BOOLEAN},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.lijin.entity.MsgLijinVIPDetail" useGeneratedKeys="true" |
| | | keyProperty="id">insert into yeshi_ec_msg_lijin_vip |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">mlv_id,</if> |
| | | <if test="user != null">mlv_uid,</if> |
| | | <if test="type != null">mlv_type,</if> |
| | | <if test="remark != null">mlv_remark,</if> |
| | | <if test="read != null">mlv_read,</if> |
| | | <if test="createTime != null">mlv_create_time,</if> |
| | | <if test="updateTime != null">mlv_update_time,</if> |
| | | </trim> |
| | | values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="user != null">#{user.id,jdbcType=BIGINT},</if> |
| | | <if test="type != null">#{type,jdbcType=VARCHAR},</if> |
| | | <if test="remark != null">#{remark,jdbcType=VARCHAR},</if> |
| | | <if test="read != null">#{read,jdbcType=BOOLEAN},</if> |
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" |
| | | parameterType="com.yeshi.fanli.lijin.entity.MsgLijinVIPDetail">update yeshi_ec_msg_lijin_vip set mlv_uid = #{user.id,jdbcType=BIGINT},mlv_type = #{type,jdbcType=VARCHAR},mlv_remark = #{remark,jdbcType=VARCHAR},mlv_read = #{read,jdbcType=BOOLEAN},mlv_create_time = #{createTime,jdbcType=TIMESTAMP},mlv_update_time = #{updateTime,jdbcType=TIMESTAMP} where mlv_id = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.lijin.entity.MsgLijinVIPDetail">update |
| | | yeshi_ec_msg_lijin_vip |
| | | <set> |
| | | <if test="user != null">mlv_uid=#{user.id,jdbcType=BIGINT},</if> |
| | | <if test="type != null">mlv_type=#{type,jdbcType=VARCHAR},</if> |
| | | <if test="remark != null">mlv_remark=#{remark,jdbcType=VARCHAR},</if> |
| | | <if test="read != null">mlv_read=#{read,jdbcType=BOOLEAN},</if> |
| | | <if test="createTime != null">mlv_create_time=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">mlv_update_time=#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </set> |
| | | where mlv_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | </mapper> |
| | |
| | | limit #{start},#{count} |
| | | </select> |
| | | |
| | | |
| | | <select id="listByPrimaryKeys" resultMap="BaseResultMap"> |
| | | select d.*,t.`mea_content` AS extraInfo from yeshi_ec_msg_account d |
| | | LEFT JOIN `yeshi_ec_msg_extra` t ON (t.`mea_rid` = d.`ma_id` AND t.`mea_type` = 'account') |
| | | where |
| | | <foreach collection="ids" separator=" or " open="(" close=")" item="id"> |
| | | ma_id=#{id} |
| | | </foreach> |
| | | </select> |
| | | |
| | | |
| | | <select id="countByUid" resultType="java.lang.Long" |
| | | parameterType="java.lang.Long"> |
| | | select |
| | |
| | | </set> |
| | | where ma_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | |
| | | |
| | | <update id="setMsgReadByUid" parameterType="java.lang.Long"> |
| | |
| | | </select> |
| | | |
| | | |
| | | |
| | | <select id="listByPrimaryKeys" resultMap="BaseResultMap"> |
| | | select <include refid="Base_Column_List" />,u.`id`,u.`nick_name`,u.`portrait`, |
| | | te.`mea_content` AS extraInfo FROM yeshi_ec_msg_invite i |
| | | LEFT JOIN yeshi_ec_threesale t ON t.`id`=i.`mi_invite_id` |
| | | LEFT JOIN yeshi_ec_user u ON u.`id`=t.`worker_id` |
| | | LEFT JOIN `yeshi_ec_msg_extra` te ON (te.`mea_rid` = i.`mi_id` AND te.`mea_type` = 'invite') |
| | | where |
| | | <foreach collection="ids" separator=" or " open="(" close=")" item="id"> |
| | | mi_id=#{id} |
| | | </foreach> |
| | | </select> |
| | | |
| | | |
| | | <select id="countByUid" resultType="java.lang.Long" |
| | | parameterType="java.lang.Long"> |
| | | select |
| | |
| | | where d.mm_uid =#{uid,jdbcType=BIGINT} order by d.mm_update_time desc |
| | | limit #{start},#{count} |
| | | </select> |
| | | |
| | | |
| | | |
| | | <select id="listByPrimaryKeys" resultMap="BaseResultMap"> |
| | | select d.*, d.mm_source_id as mm_source_id_extract, d.mm_source_id as mm_source_id_alipayvalid |
| | | ,t.`mea_content` AS extraInfo from yeshi_ec_msg_money d |
| | | LEFT JOIN `yeshi_ec_msg_extra` t ON (t.`mea_rid` = d.`mm_id` AND t.`mea_type` = 'money') |
| | | where |
| | | <foreach collection="ids" separator=" or " open="(" close=")" item="id"> |
| | | mm_id=#{id} |
| | | </foreach> |
| | | </select> |
| | | |
| | | <select id="countByUid" resultType="java.lang.Long" |
| | | parameterType="java.lang.Long">select count(mm_id) from yeshi_ec_msg_money where mm_uid |
| | | = #{uid,jdbcType=BIGINT} |
| | |
| | | ORDER BY d.mo_update_time DESC |
| | | LIMIT #{start},#{count} |
| | | </select> |
| | | |
| | | |
| | | |
| | | <select id="listByPrimaryKeys" resultMap="BaseResultMap"> |
| | | SELECT d.*, t.`mea_content` AS extraInfo FROM yeshi_ec_msg_order d |
| | | LEFT JOIN `yeshi_ec_msg_extra` t ON (t.`mea_rid` = d.`mo_id` AND t.`mea_type` = 'order') |
| | | WHERE |
| | | <foreach collection="ids" separator=" or " open="(" close=")" item="id"> |
| | | mo_id=#{id} |
| | | </foreach> |
| | | </select> |
| | | |
| | | |
| | | <select id="countByUid" resultType="java.lang.Long" |
| | | parameterType="java.lang.Long">select count(mo_id) from yeshi_ec_msg_order where mo_uid |
| | | = #{uid,jdbcType=BIGINT} |
| | |
| | | order by mo_create_time desc |
| | | limit #{start},#{count} |
| | | </select> |
| | | |
| | | |
| | | |
| | | <select id="listByPrimaryKeys" resultMap="BaseResultMap"> |
| | | SELECT d.*, t.`mea_content` AS extraInfo FROM yeshi_ec_msg_order d |
| | | LEFT JOIN `yeshi_ec_msg_extra` t ON (t.`mea_rid` = d.`mo_id` AND t.`mea_type` = 'order') |
| | | WHERE |
| | | <foreach collection="ids" separator=" or " open="(" close=")" item="id"> |
| | | mo_id=#{id} |
| | | </foreach> |
| | | </select> |
| | | |
| | | <select id="countByUid" resultType="java.lang.Long" |
| | | parameterType="java.lang.Long">select count(mo_id) from yeshi_ec_msg_other where mo_uid |
| | | = #{uid,jdbcType=BIGINT}</select> |
| | |
| | | order by ms_create_time desc limit #{start},#{count} |
| | | </select> |
| | | |
| | | |
| | | |
| | | <select id="listByPrimaryKeys" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_user_msg_system where |
| | | <foreach collection="ids" separator=" or " open="(" close=")" item="id"> |
| | | ms_id=#{id} |
| | | </foreach> |
| | | </select> |
| | | |
| | | <select id="countByUid" resultType="java.lang.Long" |
| | | parameterType="java.lang.Long"> |
| | | select |
| | |
| | | |
| | | <!-- DAO接口所在包名,Spring会自动查找其下的类 --> |
| | | <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer"> |
| | | <property name="basePackage" value="com.yeshi.fanli.dao.mybatis" /> |
| | | <property name="basePackage" value="com.yeshi.fanli.dao.mybatis,com.yeshi.fanli.lijin.dao" /> |
| | | <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"></property> |
| | | </bean> |
| | | |