| | |
| | | @Aspect
|
| | | @Order(2)
|
| | | public class SignValidateAspect {
|
| | | public static final String EDP = "execution(* com.yeshi.fanli.controller.client.v1.*.*(..))";
|
| | | public static final String EDP = "execution(* com.yeshi.fanli.controller.client.*.*.*(..))";
|
| | |
|
| | | public static String KEY = "";
|
| | |
|
| | |
| | | import com.yeshi.fanli.util.cache.TaoBaoGoodsCacheUtil;
|
| | | import com.yeshi.fanli.util.taobao.SearchFilterUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | | import com.yeshi.fanli.vo.brand.TaoBaoShopVO;
|
| | |
|
| | | import net.sf.ehcache.Element;
|
| | | import net.sf.json.JSONArray;
|
| | |
| | | if (listRecommendWords == null || listRecommendWords.size() == 0) {
|
| | | listRecommendWords = new ArrayList<String>();
|
| | | }
|
| | | |
| | | List<TaoBaoShopVO> listShop = taoBaoShopService.getShopByKey(kw);
|
| | | if (listShop != null && listShop.size() > 0) {
|
| | | data.put("shop", JsonUtil.getApiCommonGson().toJson(listShop.get(0)));
|
| | | }
|
| | | }
|
| | |
|
| | | Gson gson = new GsonBuilder().create();
|
New file |
| | |
| | | package com.yeshi.fanli.controller.client.v2;
|
| | |
|
| | | import java.io.PrintWriter;
|
| | | import java.util.ArrayList;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.core.task.TaskExecutor;
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RequestMethod;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.clazz.GoodsClass;
|
| | | import com.yeshi.fanli.service.inter.clazz.GoodsSubClassLabelService;
|
| | | import com.yeshi.fanli.service.inter.goods.GoodsClassService;
|
| | | import com.yeshi.fanli.vo.goods.GoodsSubClassLabelVO;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | @Controller
|
| | | @RequestMapping("api/v2/class")
|
| | | public class GoodsClassControllerV2 {
|
| | |
|
| | |
|
| | | @Resource
|
| | | private GoodsClassService goodsClassService;
|
| | |
|
| | | @Resource
|
| | | private GoodsSubClassLabelService goodsSubClassLabelService;
|
| | |
|
| | |
|
| | | @Resource(name = "taskExecutor")
|
| | | private TaskExecutor executor;
|
| | |
|
| | | /**
|
| | | * 一级分类
|
| | | * @param acceptData
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "listClass", method = RequestMethod.POST)
|
| | | public void listClass(AcceptData acceptData, PrintWriter out) {
|
| | | List<GoodsClass> list = goodsClassService.getEffectiveClassCache();
|
| | | if (list == null ) {
|
| | | list = new ArrayList<GoodsClass>();
|
| | | }
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("list", JsonUtil.getApiCommonGson().toJson(list));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 二级分类、标签
|
| | | * |
| | | * @param acceptData
|
| | | * @param gcid
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "listSubMap", method = RequestMethod.POST)
|
| | | public void listSubMap(AcceptData acceptData, Long cid, PrintWriter out) {
|
| | | if(cid == null) {
|
| | | out.print(JsonUtil.loadFalseResult("参数不能为空"));
|
| | | return;
|
| | | }
|
| | | |
| | | List<GoodsSubClassLabelVO> list = goodsSubClassLabelService.listSubMapCache(cid);
|
| | | if (list == null) {
|
| | | list = new ArrayList<GoodsSubClassLabelVO>();
|
| | | }
|
| | | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("list", JsonUtil.getApiCommonGson().toJson(list));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | |
|
| | | |
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.controller.client.v2;
|
| | |
|
| | | import java.io.PrintWriter;
|
| | | import java.util.ArrayList;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RequestMethod;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.reflect.TypeToken;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.HomeNavbar;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.HomeNavbar.NavbarTypeEnum;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.HomeNavbarUser;
|
| | | import com.yeshi.fanli.exception.homemodule.HomeNavbarUserException;
|
| | | import com.yeshi.fanli.service.inter.homemodule.HomeNavbarService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.HomeNavbarUserService;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | @Controller
|
| | | @RequestMapping("api/v2/navbar")
|
| | | public class HomeNavbarControllerV2 {
|
| | |
|
| | | @Resource
|
| | | private HomeNavbarService homeNavbarService;
|
| | |
|
| | | @Resource
|
| | | private HomeNavbarUserService homeNavbarUserService;
|
| | |
|
| | | /**
|
| | | * 获取导航栏内容
|
| | | * |
| | | * @param acceptData
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getHomeItems", method = RequestMethod.POST)
|
| | | public void getHomeItems(AcceptData acceptData, Long uid, PrintWriter out) {
|
| | | List<HomeNavbar> listNavbar = homeNavbarUserService.listEffectiveNavbar(uid, acceptData.getDevice());
|
| | | if (listNavbar == null) {
|
| | | listNavbar = new ArrayList<HomeNavbar>();
|
| | | }
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("count", listNavbar.size());
|
| | | data.put("listNavbar", JsonUtil.getApiCommonGson().toJson(listNavbar));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 获取导航栏编辑内容
|
| | | * |
| | | * @param acceptData
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getUserItems", method = RequestMethod.POST)
|
| | | public void getUserItems(AcceptData acceptData, Long uid, PrintWriter out) {
|
| | | try {
|
| | | List<HomeNavbar> listExist = new ArrayList<HomeNavbar>();
|
| | | List<HomeNavbar> listItems = new ArrayList<HomeNavbar>();
|
| | |
|
| | | // 系统默认导航栏
|
| | | List<HomeNavbar> listNavbar = homeNavbarService.listQueryEffectiveNavbar();
|
| | | if (listNavbar != null && listNavbar.size() > 0) {
|
| | | listItems.addAll(listNavbar);
|
| | | }
|
| | |
|
| | | int nonCount = 0;
|
| | | // 查询用户自定义导航
|
| | | List<HomeNavbarUser> listUser = homeNavbarUserService.listUserNavbar(uid, acceptData.getDevice());
|
| | |
|
| | | if (listUser == null || listUser.size() == 0) {
|
| | | for (int i = 0; i < listItems.size(); i++) {
|
| | | HomeNavbar homeNavbar = listItems.get(i);
|
| | | // 活动剔除
|
| | | if (!NavbarTypeEnum.category.equals(homeNavbar.getType())) {
|
| | | listItems.remove(homeNavbar);
|
| | | i--;
|
| | | continue;
|
| | | }
|
| | |
|
| | | if (homeNavbar.getIsDefault()) {
|
| | | listExist.add(homeNavbar);
|
| | |
|
| | | if (homeNavbar.getIsFixed()) {
|
| | | nonCount++;
|
| | | }
|
| | |
|
| | | listItems.remove(homeNavbar);
|
| | | i--;
|
| | | }
|
| | | }
|
| | |
|
| | | } else {
|
| | | // 获取固定不可编辑
|
| | | for (int i = 0; i < listItems.size(); i++) {
|
| | | HomeNavbar homeNavbar = listItems.get(i);
|
| | |
|
| | | // 活动剔除
|
| | | if (!NavbarTypeEnum.category.equals(homeNavbar.getType())) {
|
| | | listItems.remove(homeNavbar);
|
| | | i--;
|
| | | continue;
|
| | | }
|
| | |
|
| | | if (homeNavbar.getIsFixed()) {
|
| | | listExist.add(homeNavbar);
|
| | | nonCount++;
|
| | |
|
| | | listItems.remove(homeNavbar);
|
| | | i--;
|
| | | }
|
| | | }
|
| | |
|
| | | // 用户编辑的数据
|
| | | for (HomeNavbarUser homeNavbarUser : listUser) {
|
| | | HomeNavbar homeNavbar = homeNavbarUser.getHomeNavbar();
|
| | | if (homeNavbar == null) {
|
| | | continue;
|
| | | }
|
| | |
|
| | | // 活动剔除
|
| | | if (!NavbarTypeEnum.category.equals(homeNavbar.getType())) {
|
| | | continue;
|
| | | }
|
| | |
|
| | | long homeId = homeNavbar.getId();
|
| | | for (int i = 0; i < listItems.size(); i++) {
|
| | | HomeNavbar navbar = listItems.get(i);
|
| | | long id = navbar.getId();
|
| | | if (homeId == id) {
|
| | | // 加入用户已选
|
| | | listExist.add(navbar);
|
| | | // 移除用户已选
|
| | | listItems.remove(navbar);
|
| | | i--;
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("min", 6);
|
| | | data.put("max", 16);
|
| | | data.put("nonCount", nonCount);
|
| | | data.put("listExist", JsonUtil.getApiCommonGson().toJson(listExist));
|
| | | data.put("listItems", JsonUtil.getApiCommonGson().toJson(listItems));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | } catch (HomeNavbarUserException e) {
|
| | | out.print(JsonUtil.loadFalseResult(1, e.getMsg()));
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 设置自定义
|
| | | * |
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param list
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "saveUserItems", method = RequestMethod.POST)
|
| | | public void saveUserItems(AcceptData acceptData, Long uid, String barIds, PrintWriter out) {
|
| | | try {
|
| | | if (StringUtil.isNullOrEmpty(barIds)) {
|
| | | out.print(JsonUtil.loadFalseResult("Id参数不能为空"));
|
| | | return;
|
| | | }
|
| | |
|
| | | Gson gson = new Gson();
|
| | | List<Long> list = gson.fromJson(barIds, new TypeToken<ArrayList<Long>>() {
|
| | | }.getType());
|
| | | if (list == null || list.size() == 0) {
|
| | | out.print(JsonUtil.loadFalseResult("未检测到数据"));
|
| | | return;
|
| | | }
|
| | |
|
| | | homeNavbarUserService.addNavbarUser(uid, acceptData.getDevice(), list);
|
| | | out.print(JsonUtil.loadTrueResult("保存成功"));
|
| | | } catch (HomeNavbarUserException e) {
|
| | | out.print(JsonUtil.loadFalseResult(1, e.getMsg()));
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 还原默认
|
| | | * |
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "restoreDefault", method = RequestMethod.POST)
|
| | | public void restoreDefault(AcceptData acceptData, Long uid, PrintWriter out) {
|
| | | try {
|
| | | int nonCount = 0;
|
| | | List<HomeNavbar> listExist = new ArrayList<HomeNavbar>();
|
| | | List<HomeNavbar> listItems = new ArrayList<HomeNavbar>();
|
| | |
|
| | | List<HomeNavbar> listNavbar = homeNavbarUserService.restoreSystemDefault(uid, acceptData.getDevice());
|
| | | if (listNavbar != null && listNavbar.size() > 0) {
|
| | | listItems.addAll(listNavbar);
|
| | | }
|
| | |
|
| | | for (int i = 0; i < listItems.size(); i++) {
|
| | | HomeNavbar homeNavbar = listItems.get(i);
|
| | | // 活动剔除
|
| | | if (!NavbarTypeEnum.category.equals(homeNavbar.getType())) {
|
| | | listItems.remove(homeNavbar);
|
| | | i--;
|
| | | continue;
|
| | | }
|
| | | |
| | | // 筛选出默认项
|
| | | if (!homeNavbar.getIsDefault()) {
|
| | | break;
|
| | | } else {
|
| | | if (homeNavbar.getIsFixed()) {
|
| | | nonCount++;
|
| | | }
|
| | | listExist.add(homeNavbar);
|
| | |
|
| | | listItems.remove(homeNavbar);
|
| | | i--;
|
| | | }
|
| | | }
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("nonCount", nonCount);
|
| | | data.put("listExist", JsonUtil.getApiCommonGson().toJson(listExist));
|
| | | data.put("listItems", JsonUtil.getApiCommonGson().toJson(listItems));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | } catch (HomeNavbarUserException e) {
|
| | | out.print(JsonUtil.loadFalseResult(1, e.getMsg()));
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | * @return |
| | | */ |
| | | long countBySellerIdAndHasCoupon(@Param("sellerId") Long sellerId); |
| | | |
| | | |
| | | /** |
| | | * 批量商品id查询商品信息 |
| | | * @param list |
| | | * @return |
| | | */ |
| | | List<CommonGoods> getByListGoodsId(@Param("list") List<Long> list); |
| | | |
| | | |
| | | } |
| | |
| | | */ |
| | | List<HomeNavbar> listQueryEffective(); |
| | | |
| | | |
| | | /** |
| | | * 默认导航栏 |
| | | * @return |
| | | */ |
| | | List<HomeNavbar> listQueryDefaultNavbar(); |
| | | |
| | | |
| | | /** |
| | | * 固定导航栏 |
| | | * @return |
| | | */ |
| | | List<HomeNavbar> listQueryFixedNavbar(); |
| | | |
| | | |
| | | /** |
| | | * 根据分类查询有效导航栏 |
| | | * @param classId |
New file |
| | |
| | | package com.yeshi.fanli.dao.mybatis.homemodule; |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.dao.BaseMapper; |
| | | import com.yeshi.fanli.entity.bus.homemodule.HomeNavbarUser; |
| | | |
| | | public interface HomeNavbarUserMapper extends BaseMapper<HomeNavbarUser> { |
| | | |
| | | |
| | | /** |
| | | * 批量插入 |
| | | * @param list |
| | | */ |
| | | void insertBatch (List<HomeNavbarUser> list); |
| | | |
| | | /** |
| | | * 批量更新- 目前只更新排序 |
| | | * @param list |
| | | */ |
| | | void updateSelectiveBatch (List<HomeNavbarUser> list); |
| | | |
| | | /** |
| | | * 批量删除 |
| | | * |
| | | * @param list |
| | | * @return |
| | | */ |
| | | int deleteByPrimaryKeyBatch(List<Long> list); |
| | | |
| | | /** |
| | | * 删除用户自定义 |
| | | * |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | void deleteByUid(@Param("uid")Long uid); |
| | | |
| | | |
| | | /** |
| | | * 删除设备自定义 |
| | | * |
| | | * @param list |
| | | * @return |
| | | */ |
| | | void deleteByDevice(@Param("device")String device); |
| | | |
| | | |
| | | /** |
| | | * 查询自定义有效的导航栏 |
| | | */ |
| | | List<HomeNavbarUser> listEffectiveNavbars(@Param("uid")Long uid, @Param("device")String device); |
| | | |
| | | |
| | | /** |
| | | * 查询自定义导航栏 |
| | | */ |
| | | List<HomeNavbarUser> listMyNavbars(@Param("uid")Long uid, @Param("device")String device); |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.yeshi.fanli.dao.mybatis.user; |
| | | |
| | | import com.yeshi.fanli.dao.BaseMapper; |
| | | import com.yeshi.fanli.entity.bus.user.UserInfoDeleteRecord; |
| | | |
| | | public interface UserInfoDeleteRecordMapper extends BaseMapper<UserInfoDeleteRecord> { |
| | | |
| | | } |
| | |
| | |
|
| | | // 是否默认: 0 非默认 1 默认项
|
| | | @Column(name = "br_is_default")
|
| | | private Integer isDefault; |
| | | private Boolean isDefault; |
| | |
|
| | | // 编辑状态:0 可编辑 1 不可编辑
|
| | | @Expose
|
| | | @Column(name = "br_non_edit")
|
| | | private Integer nonEdit; |
| | | // 固定项:0 非固定 1 固定
|
| | | @Column(name = "br_is_fixed")
|
| | | private Boolean isFixed; |
| | |
|
| | | // 创建时间
|
| | | @Column(name = "br_createtime")
|
| | |
| | | this.className = className;
|
| | | }
|
| | |
|
| | | public Integer getIsDefault() {
|
| | | public Boolean getIsDefault() {
|
| | | return isDefault;
|
| | | }
|
| | |
|
| | | public void setIsDefault(Integer isDefault) {
|
| | | public void setIsDefault(Boolean isDefault) {
|
| | | this.isDefault = isDefault;
|
| | | }
|
| | |
|
| | | public Integer getNonEdit() {
|
| | | return nonEdit;
|
| | | public Boolean getIsFixed() {
|
| | | return isFixed;
|
| | | }
|
| | |
|
| | | public void setNonEdit(Integer nonEdit) {
|
| | | this.nonEdit = nonEdit;
|
| | | public void setIsFixed(Boolean isFixed) {
|
| | | this.isFixed = isFixed;
|
| | | }
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.entity.bus.homemodule;
|
| | |
|
| | | import java.util.Date;
|
| | |
|
| | | import org.yeshi.utils.mybatis.Column;
|
| | | import org.yeshi.utils.mybatis.Table;
|
| | |
|
| | | /**
|
| | | * 用户自定义导航
|
| | | *
|
| | | */
|
| | | @Table("yeshi_ec_home_navbar_user")
|
| | | public class HomeNavbarUser {
|
| | |
|
| | | @Column(name = "hnu_id")
|
| | | private Long id;
|
| | |
|
| | | @Column(name = "hnu_uid")
|
| | | private Long uid;
|
| | |
|
| | | @Column(name = "hnu_device")
|
| | | private String device;
|
| | |
|
| | | @Column(name = "hnu_order")
|
| | | private Integer order;
|
| | |
|
| | | @Column(name = "hnu_navbar_id")
|
| | | private HomeNavbar homeNavbar;
|
| | |
|
| | | // 创建时间
|
| | | @Column(name = "hnu_create_time")
|
| | | private Date createTime;
|
| | |
|
| | | public Long getId() {
|
| | | return id;
|
| | | }
|
| | |
|
| | | public void setId(Long id) {
|
| | | this.id = id;
|
| | | }
|
| | |
|
| | | public Long getUid() {
|
| | | return uid;
|
| | | }
|
| | |
|
| | | public void setUid(Long uid) {
|
| | | this.uid = uid;
|
| | | }
|
| | |
|
| | | public String getDevice() {
|
| | | return device;
|
| | | }
|
| | |
|
| | | public void setDevice(String device) {
|
| | | this.device = device;
|
| | | }
|
| | |
|
| | | public Integer getOrder() {
|
| | | return order;
|
| | | }
|
| | |
|
| | | public void setOrder(Integer order) {
|
| | | this.order = order;
|
| | | }
|
| | |
|
| | | public HomeNavbar getHomeNavbar() {
|
| | | return homeNavbar;
|
| | | }
|
| | |
|
| | | public void setHomeNavbar(HomeNavbar homeNavbar) {
|
| | | this.homeNavbar = homeNavbar;
|
| | | }
|
| | |
|
| | | public Date getCreateTime() {
|
| | | return createTime;
|
| | | }
|
| | |
|
| | | public void setCreateTime(Date createTime) {
|
| | | this.createTime = createTime;
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.entity.bus.user;
|
| | |
|
| | | import java.util.Date;
|
| | |
|
| | | import org.yeshi.utils.mybatis.Column;
|
| | | import org.yeshi.utils.mybatis.Table;
|
| | |
|
| | | /**
|
| | | * 用户删除、封禁记录
|
| | | * |
| | | */
|
| | | @Table("yeshi_ec_user_delete_record")
|
| | | public class UserInfoDeleteRecord {
|
| | |
|
| | | @Column(name = "udr_id")
|
| | | private Long id;
|
| | | // 用户id
|
| | | @Column(name = "udr_uid")
|
| | | private UserInfo userInfo;
|
| | | // 状态
|
| | | @Column(name = "udr_state")
|
| | | private Integer state;
|
| | | // 原因
|
| | | @Column(name = "udr_reason")
|
| | | private String reason;
|
| | | // 创建时间
|
| | | @Column(name = "udr_create_time")
|
| | | private Date createTime;
|
| | |
|
| | | public Long getId() {
|
| | | return id;
|
| | | }
|
| | |
|
| | | public void setId(Long id) {
|
| | | this.id = id;
|
| | | }
|
| | |
|
| | | public UserInfo getUserInfo() {
|
| | | return userInfo;
|
| | | }
|
| | |
|
| | | public void setUserInfo(UserInfo userInfo) {
|
| | | this.userInfo = userInfo;
|
| | | }
|
| | |
|
| | | public Integer getState() {
|
| | | return state;
|
| | | }
|
| | |
|
| | | public void setState(Integer state) {
|
| | | this.state = state;
|
| | | }
|
| | |
|
| | | public String getReason() {
|
| | | return reason;
|
| | | }
|
| | |
|
| | | public void setReason(String reason) {
|
| | | this.reason = reason;
|
| | | }
|
| | |
|
| | | public Date getCreateTime() {
|
| | | return createTime;
|
| | | }
|
| | |
|
| | | public void setCreateTime(Date createTime) {
|
| | | this.createTime = createTime;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | @Column(name = "uie_coupon_news")
|
| | | private Integer couponNews;
|
| | |
|
| | | // 是否同步导航栏
|
| | | @Column(name = "uie_synch_navbar")
|
| | | private Boolean synchNavbar;
|
| | | |
| | | // 首次登录时间
|
| | | @Column(name = "uie_first_login_time")
|
| | | private Date firstLoginTime;
|
| | |
| | | public void setFirstLoginTime(Date firstLoginTime) {
|
| | | this.firstLoginTime = firstLoginTime;
|
| | | }
|
| | |
|
| | | public Boolean getSynchNavbar() {
|
| | | return synchNavbar;
|
| | | }
|
| | |
|
| | | public void setSynchNavbar(Boolean synchNavbar) {
|
| | | this.synchNavbar = synchNavbar;
|
| | | }
|
| | | |
| | | }
|
| | |
| | | private boolean coupon; // 是否有券
|
| | |
|
| | | @Expose
|
| | | private boolean recommend; // 是否推荐
|
| | | private boolean recommend = true; // 是否推荐
|
| | |
|
| | |
|
| | | public int getMoneyType() {
|
New file |
| | |
| | | package com.yeshi.fanli.exception.homemodule; |
| | | |
| | | public class HomeNavbarUserException extends Exception { |
| | | /** |
| | | * |
| | | */ |
| | | private static final long serialVersionUID = 1L; |
| | | private int code; |
| | | private String msg; |
| | | |
| | | public int getCode() { |
| | | return code; |
| | | } |
| | | |
| | | public String getMsg() { |
| | | return msg; |
| | | } |
| | | |
| | | public HomeNavbarUserException(int code, String msg) { |
| | | this.code = code; |
| | | this.msg = msg; |
| | | } |
| | | |
| | | public HomeNavbarUserException() { |
| | | } |
| | | |
| | | @Override |
| | | public String getMessage() { |
| | | return this.msg; |
| | | } |
| | | |
| | | } |
| | |
| | | WHERE <![CDATA[cg_coupon_amount > 0 AND cg_coupon_left_count > 1]]> |
| | | AND cg_seller_id = #{sellerId} |
| | | </select> |
| | | |
| | | <select id="getByListGoodsId" resultMap="BaseResultMap"> |
| | | SELECT * FROM yeshi_ec_common_goods |
| | | WHERE cg_goods_id IN <foreach collection="list" item="item" open="(" separator="," close=")">#{item}</foreach> |
| | | </select> |
| | | </mapper> |
| | |
| | | <result column="br_start_time" property="startTime" jdbcType="TIMESTAMP"/> |
| | | <result column="br_end_time" property="endTime" jdbcType="TIMESTAMP"/> |
| | | <result column="br_state" property="state" jdbcType="INTEGER"/> |
| | | <result column="br_is_default" property="isDefault" jdbcType="INTEGER"/> |
| | | <result column="br_non_edit" property="nonEdit" jdbcType="INTEGER"/> |
| | | <result column="br_is_default" property="isDefault" jdbcType="VARCHAR"/> |
| | | <result column="br_is_fixed" property="isFixed" jdbcType="VARCHAR"/> |
| | | <result column="br_createtime" property="createtime" jdbcType="TIMESTAMP"/> |
| | | <result column="br_updatetime" property="updatetime" jdbcType="TIMESTAMP"/> |
| | | <result column="br_type" property="type" typeHandler="com.yeshi.fanli.util.mybatishandler.NavbarTypeEnumHandler"/> |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List">br_id,br_name,br_picture,br_class_id,br_swiper_banner_id,br_url,br_type,br_orderby,br_start_time,br_end_time,br_state,br_is_default,br_non_edit,br_createtime,br_updatetime</sql> |
| | | <sql id="Base_Column_List">br_id,br_name,br_picture,br_class_id,br_swiper_banner_id,br_url,br_type,br_orderby,br_start_time,br_end_time,br_state,br_is_default,br_is_fixed,br_createtime,br_updatetime</sql> |
| | | |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select |
| | | <include refid="Base_Column_List"/>from yeshi_ec_home_navbar where br_id = #{id,jdbcType=BIGINT} |
| | |
| | | WHERE br_state = 1 |
| | | AND IF(br_start_time IS NULL,TRUE, br_start_time<![CDATA[<=]]> NOW()) |
| | | AND IF(br_end_time IS NULL,TRUE, br_end_time <![CDATA[>=]]> NOW()) |
| | | ORDER BY br_orderby |
| | | </select> |
| | | |
| | | |
| | | <select id="listQueryDefaultNavbar" resultMap="BaseResultMap"> |
| | | SELECT * FROM yeshi_ec_home_navbar |
| | | WHERE br_state = 1 AND br_is_default = 1 |
| | | AND IF(br_start_time IS NULL,TRUE, br_start_time<![CDATA[<=]]> NOW()) |
| | | AND IF(br_end_time IS NULL,TRUE, br_end_time <![CDATA[>=]]> NOW()) |
| | | ORDER BY br_orderby |
| | | </select> |
| | | |
| | | <select id="getEffectiveByClassId" resultMap="BaseResultMap"> |
| | | <select id="listQueryFixedNavbar" resultMap="BaseResultMap"> |
| | | SELECT * FROM yeshi_ec_home_navbar |
| | | WHERE br_state = 1 AND br_is_default = 1 AND br_is_fixed = 1 |
| | | AND IF(br_start_time IS NULL,TRUE, br_start_time<![CDATA[<=]]> NOW()) |
| | | AND IF(br_end_time IS NULL,TRUE, br_end_time <![CDATA[>=]]> NOW()) |
| | | ORDER BY br_orderby |
| | | </select> |
| | | |
| | | <select id="getEffectiveByClassId" resultMap="BaseResultMap"> |
| | | SELECT * FROM yeshi_ec_home_navbar |
| | | WHERE br_state = 1 AND br_class_id = #{classId} |
| | | LIMIT 1 |
| | |
| | | delete from yeshi_ec_home_navbar where br_id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.homemodule.HomeNavbar" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_home_navbar (br_id,br_name,br_picture,br_class_id,br_swiper_banner_id,br_url,br_type,br_orderby,br_start_time,br_end_time,br_state,br_is_default,br_non_edit,br_createtime,br_updatetime) values (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{picture,jdbcType=VARCHAR},#{classId,jdbcType=BIGINT},#{swiperBannerId,jdbcType=BIGINT},#{url,jdbcType=VARCHAR},#{type,jdbcType=VARCHAR},#{orderby,jdbcType=INTEGER},#{startTime,jdbcType=TIMESTAMP},#{endTime,jdbcType=TIMESTAMP},#{state,jdbcType=INTEGER},#{isDefault,jdbcType=INTEGER},#{nonEdit,jdbcType=INTEGER},#{createtime,jdbcType=TIMESTAMP},#{updatetime,jdbcType=TIMESTAMP})</insert> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.homemodule.HomeNavbar" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_home_navbar (br_id,br_name,br_picture,br_class_id,br_swiper_banner_id,br_url,br_type,br_orderby,br_start_time,br_end_time,br_state,br_is_default,br_is_fixed,br_createtime,br_updatetime) values (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{picture,jdbcType=VARCHAR},#{classId,jdbcType=BIGINT},#{swiperBannerId,jdbcType=BIGINT},#{url,jdbcType=VARCHAR},#{type,jdbcType=VARCHAR},#{orderby,jdbcType=INTEGER},#{startTime,jdbcType=TIMESTAMP},#{endTime,jdbcType=TIMESTAMP},#{state,jdbcType=INTEGER},#{isDefault,jdbcType=VARCHAR},#{isFixed,jdbcType=VARCHAR},#{createtime,jdbcType=TIMESTAMP},#{updatetime,jdbcType=TIMESTAMP})</insert> |
| | | |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.HomeNavbar" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_home_navbar |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | |
| | | <if test="endTime != null">br_end_time,</if> |
| | | <if test="state != null">br_state,</if> |
| | | <if test="isDefault != null">br_is_default,</if> |
| | | <if test="nonEdit != null">br_non_edit,</if> |
| | | <if test="isFixed != null">br_is_fixed,</if> |
| | | <if test="createtime != null">br_createtime,</if> |
| | | <if test="updatetime != null">br_updatetime,</if> |
| | | </trim>values |
| | |
| | | <if test="startTime != null">#{startTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="endTime != null">#{endTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="state != null">#{state,jdbcType=INTEGER},</if> |
| | | <if test="isDefault != null">#{isDefault,jdbcType=INTEGER},</if> |
| | | <if test="nonEdit != null">#{nonEdit,jdbcType=INTEGER},</if> |
| | | <if test="isDefault != null">#{isDefault,jdbcType=VARCHAR},</if> |
| | | <if test="isFixed != null">#{isFixed,jdbcType=VARCHAR},</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.entity.bus.homemodule.HomeNavbar">update yeshi_ec_home_navbar set br_name = #{name,jdbcType=VARCHAR},br_picture = #{picture,jdbcType=VARCHAR},br_class_id = #{classId,jdbcType=BIGINT},br_swiper_banner_id = #{swiperBannerId,jdbcType=BIGINT},br_url = #{url,jdbcType=VARCHAR},br_type = #{type,jdbcType=VARCHAR},br_orderby = #{orderby,jdbcType=INTEGER},br_start_time = #{startTime,jdbcType=TIMESTAMP},br_end_time = #{endTime,jdbcType=TIMESTAMP},br_state = #{state,jdbcType=INTEGER},br_is_default = #{isDefault,jdbcType=INTEGER},br_non_edit = #{nonEdit,jdbcType=INTEGER},br_createtime = #{createtime,jdbcType=TIMESTAMP},br_updatetime = #{updatetime,jdbcType=TIMESTAMP} where br_id = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.homemodule.HomeNavbar">update yeshi_ec_home_navbar set br_name = #{name,jdbcType=VARCHAR},br_picture = #{picture,jdbcType=VARCHAR},br_class_id = #{classId,jdbcType=BIGINT},br_swiper_banner_id = #{swiperBannerId,jdbcType=BIGINT},br_url = #{url,jdbcType=VARCHAR},br_type = #{type,jdbcType=VARCHAR},br_orderby = #{orderby,jdbcType=INTEGER},br_start_time = #{startTime,jdbcType=TIMESTAMP},br_end_time = #{endTime,jdbcType=TIMESTAMP},br_state = #{state,jdbcType=INTEGER},br_is_default = #{isDefault,jdbcType=VARCHAR},br_is_fixed = #{isFixed,jdbcType=VARCHAR},br_createtime = #{createtime,jdbcType=TIMESTAMP},br_updatetime = #{updatetime,jdbcType=TIMESTAMP} where br_id = #{id,jdbcType=BIGINT}</update> |
| | | |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.HomeNavbar">update yeshi_ec_home_navbar |
| | | <set> |
| | |
| | | <if test="startTime != null">br_start_time=#{startTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="endTime != null">br_end_time=#{endTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="state != null">br_state=#{state,jdbcType=INTEGER},</if> |
| | | <if test="isDefault != null">br_is_default=#{isDefault,jdbcType=INTEGER},</if> |
| | | <if test="nonEdit != null">br_non_edit=#{nonEdit,jdbcType=INTEGER},</if> |
| | | <if test="isDefault != null">br_is_default=#{isDefault,jdbcType=VARCHAR},</if> |
| | | <if test="isFixed != null">br_is_fixed=#{isFixed,jdbcType=VARCHAR},</if> |
| | | <if test="createtime != null">br_createtime=#{createtime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updatetime != null">br_updatetime=#{updatetime,jdbcType=TIMESTAMP},</if> |
| | | </set> where br_id = #{id,jdbcType=BIGINT} |
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.dao.mybatis.homemodule.HomeNavbarUserMapper"> |
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.homemodule.HomeNavbarUser"> |
| | | <id column="hnu_id" property="id" jdbcType="BIGINT"/> |
| | | <result column="hnu_uid" property="uid" jdbcType="BIGINT"/> |
| | | <result column="hnu_device" property="device" jdbcType="VARCHAR"/> |
| | | <result column="hnu_order" property="order" jdbcType="INTEGER"/> |
| | | <result column="hnu_create_time" property="createTime" jdbcType="TIMESTAMP"/> |
| | | |
| | | <association property="homeNavbar" column="hnu_navbar_id" javaType="com.yeshi.fanli.entity.bus.homemodule.HomeNavbar"> |
| | | <id column="hnu_navbar_id" property="id" jdbcType="BIGINT" /> |
| | | </association> |
| | | </resultMap> |
| | | |
| | | <resultMap id="WholeResultMap" type="com.yeshi.fanli.entity.bus.homemodule.HomeNavbarUser"> |
| | | <id column="hnu_id" property="id" jdbcType="BIGINT"/> |
| | | <result column="hnu_uid" property="uid" jdbcType="BIGINT"/> |
| | | <result column="hnu_device" property="device" jdbcType="VARCHAR"/> |
| | | <result column="hnu_order" property="order" jdbcType="INTEGER"/> |
| | | <result column="hnu_create_time" property="createTime" jdbcType="TIMESTAMP"/> |
| | | <association property="homeNavbar" column="hnu_navbar_id" resultMap="com.yeshi.fanli.dao.mybatis.homemodule.HomeNavbarMapper.BaseResultMap"/> |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List">hnu_id,hnu_uid,hnu_device,hnu_order,hnu_navbar_id,hnu_create_time</sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select |
| | | <include refid="Base_Column_List"/>from yeshi_ec_home_navbar_user where hnu_id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_home_navbar_user where hnu_id = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.homemodule.HomeNavbarUser" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_home_navbar_user (hnu_id,hnu_uid,hnu_device,hnu_order,hnu_navbar_id,hnu_create_time) values (#{id,jdbcType=BIGINT},#{uid,jdbcType=BIGINT},#{device,jdbcType=VARCHAR},#{order,jdbcType=INTEGER},#{homeNavbar.id,jdbcType=BIGINT},#{createTime,jdbcType=TIMESTAMP})</insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.HomeNavbarUser" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_home_navbar_user |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">hnu_id,</if> |
| | | <if test="uid != null">hnu_uid,</if> |
| | | <if test="device != null">hnu_device,</if> |
| | | <if test="order != null">hnu_order,</if> |
| | | <if test="homeNavbar != null">hnu_navbar_id,</if> |
| | | <if test="createTime != null">hnu_create_time,</if> |
| | | </trim>values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="uid != null">#{uid,jdbcType=BIGINT},</if> |
| | | <if test="device != null">#{device,jdbcType=VARCHAR},</if> |
| | | <if test="order != null">#{order,jdbcType=INTEGER},</if> |
| | | <if test="homeNavbar != null">#{homeNavbar.id,jdbcType=BIGINT},</if> |
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.homemodule.HomeNavbarUser">update yeshi_ec_home_navbar_user set hnu_uid = #{uid,jdbcType=BIGINT},hnu_device = #{device,jdbcType=VARCHAR},hnu_order = #{order,jdbcType=INTEGER},hnu_navbar_id = #{homeNavbar.id,jdbcType=BIGINT},hnu_create_time = #{createTime,jdbcType=TIMESTAMP} where hnu_id = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.HomeNavbarUser">update yeshi_ec_home_navbar_user |
| | | <set> |
| | | <if test="uid != null">hnu_uid=#{uid,jdbcType=BIGINT},</if> |
| | | <if test="device != null">hnu_device=#{device,jdbcType=VARCHAR},</if> |
| | | <if test="order != null">hnu_order=#{order,jdbcType=INTEGER},</if> |
| | | <if test="homeNavbar != null">hnu_navbar_id=#{homeNavbar.id,jdbcType=BIGINT},</if> |
| | | <if test="createTime != null">hnu_create_time=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | </set> where hnu_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | <!-- 批量插入数据 --> |
| | | <insert id="insertBatch" keyProperty="id" parameterType="java.util.List"> |
| | | insert into yeshi_ec_home_navbar_user |
| | | (hnu_id,hnu_uid,hnu_device,hnu_order,hnu_navbar_id,hnu_create_time) |
| | | values |
| | | <foreach collection="list" item="item" separator=","> |
| | | ( |
| | | #{item.id,jdbcType=BIGINT}, |
| | | #{item.uid,jdbcType=BIGINT}, |
| | | #{item.device,jdbcType=VARCHAR}, |
| | | #{item.order,jdbcType=INTEGER}, |
| | | #{item.homeNavbar.id,jdbcType=BIGINT}, |
| | | #{item.createTime,jdbcType=TIMESTAMP} |
| | | ) |
| | | </foreach> |
| | | </insert> |
| | | |
| | | <!-- 批量更新排序 --> |
| | | <update id="updateSelectiveBatch" parameterType="java.util.List"> |
| | | update yeshi_ec_home_navbar_user |
| | | <trim prefix="set" suffixOverrides=","> |
| | | <trim prefix="hnu_order=case" suffix="end,"> |
| | | <foreach collection="list" item="item" index="index"> |
| | | <if test="item.order !=null"> |
| | | when hnu_id=#{item.id} then #{item.order} |
| | | </if> |
| | | </foreach> |
| | | </trim> |
| | | </trim> |
| | | where hnu_id in |
| | | <foreach collection="list" index="index" item="item" |
| | | separator="," open="(" close=")"> |
| | | #{item.id,jdbcType=BIGINT} |
| | | </foreach> |
| | | </update> |
| | | |
| | | <delete id="deleteByPrimaryKeyBatch" parameterType="java.util.List"> |
| | | DELETE FROM yeshi_ec_home_navbar_user WHERE hnu_id in |
| | | <foreach collection="list" item="item" open="(" close=")" |
| | | separator=",">#{item}</foreach> |
| | | </delete> |
| | | |
| | | <delete id="deleteByUid"> |
| | | DELETE FROM yeshi_ec_home_navbar_user |
| | | WHERE hnu_uid = #{uid} |
| | | </delete> |
| | | |
| | | <delete id="deleteByDevice"> |
| | | DELETE FROM yeshi_ec_home_navbar_user |
| | | WHERE hnu_device = #{device} |
| | | </delete> |
| | | |
| | | <select id="listEffectiveNavbars" resultMap="WholeResultMap"> |
| | | SELECT * FROM yeshi_ec_home_navbar_user u |
| | | LEFT JOIN yeshi_ec_home_navbar h ON u.`hnu_navbar_id` = h.`br_id` |
| | | WHERE h.br_state = 1 |
| | | AND IF(h.br_start_time IS NULL,TRUE, h.br_start_time<![CDATA[<=]]> NOW()) |
| | | AND IF(h.br_end_time IS NULL,TRUE, h.br_end_time <![CDATA[>=]]> NOW()) |
| | | <if test="uid != null"> AND u.`hnu_uid` = #{uid} </if> |
| | | <if test="device != null"> AND u.`hnu_device` = #{device}</if> |
| | | ORDER BY u.`hnu_order` |
| | | </select> |
| | | |
| | | <select id="listMyNavbars" resultMap="BaseResultMap"> |
| | | SELECT * FROM yeshi_ec_home_navbar_user u |
| | | WHERE 1=1 |
| | | <if test="uid != null"> AND u.`hnu_uid` = #{uid} </if> |
| | | <if test="device != null"> AND u.`hnu_device` = #{device}</if> |
| | | </select> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | </mapper> |
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.dao.mybatis.user.UserInfoDeleteRecordMapper"> |
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.user.UserInfoDeleteRecord"> |
| | | <id column="udr_id" property="id" jdbcType="BIGINT"/> |
| | | <result column="udr_state" property="state" jdbcType="INTEGER"/> |
| | | <result column="udr_reason" property="reason" jdbcType="VARCHAR"/> |
| | | <result column="udr_create_time" property="createTime" jdbcType="TIMESTAMP"/> |
| | | |
| | | <association property="userInfo" column="udr_uid" javaType="com.yeshi.fanli.entity.bus.user.UserInfo"> |
| | | <id column="udr_uid" property="id" jdbcType="BIGINT" /> |
| | | </association> |
| | | |
| | | </resultMap> |
| | | <sql id="Base_Column_List">udr_id,udr_uid,udr_state,udr_reason,udr_create_time</sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select |
| | | <include refid="Base_Column_List"/>from yeshi_ec_user_delete_record where udr_id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_user_delete_record where udr_id = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.user.UserInfoDeleteRecord" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_delete_record (udr_id,udr_uid,udr_state,udr_reason,udr_create_time) values (#{id,jdbcType=BIGINT},#{userInfo.id,jdbcType=BIGINT},#{state,jdbcType=INTEGER},#{reason,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP})</insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.user.UserInfoDeleteRecord" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_delete_record |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">udr_id,</if> |
| | | <if test="userInfo != null">udr_uid,</if> |
| | | <if test="state != null">udr_state,</if> |
| | | <if test="reason != null">udr_reason,</if> |
| | | <if test="createTime != null">udr_create_time,</if> |
| | | </trim>values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="userInfo != null">#{userInfo.id,jdbcType=BIGINT},</if> |
| | | <if test="state != null">#{state,jdbcType=INTEGER},</if> |
| | | <if test="reason != null">#{reason,jdbcType=VARCHAR},</if> |
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.user.UserInfoDeleteRecord">update yeshi_ec_user_delete_record set udr_uid = #{userInfo.id,jdbcType=BIGINT},udr_state = #{state,jdbcType=INTEGER},udr_reason = #{reason,jdbcType=VARCHAR},udr_create_time = #{createTime,jdbcType=TIMESTAMP} where udr_id = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.user.UserInfoDeleteRecord">update yeshi_ec_user_delete_record |
| | | <set> |
| | | <if test="userInfo != null">udr_uid=#{userInfo.id,jdbcType=BIGINT},</if> |
| | | <if test="state != null">udr_state=#{state,jdbcType=INTEGER},</if> |
| | | <if test="reason != null">udr_reason=#{reason,jdbcType=VARCHAR},</if> |
| | | <if test="createTime != null">udr_create_time=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | </set> where udr_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | </mapper> |
| | |
| | | <result column="uie_invite_code" property="inviteCode" jdbcType="VARCHAR"/> |
| | | <result column="uie_lottery_newbies" property="lotteryNewbies" jdbcType="INTEGER"/> |
| | | <result column="uie_coupon_news" property="couponNews" jdbcType="INTEGER"/> |
| | | <result column="uie_synch_navbar" property="synchNavbar" jdbcType="VARCHAR"/> |
| | | <result column="uie_first_login_time" property="firstLoginTime" jdbcType="TIMESTAMP"/> |
| | | <result column="uie_create_time" property="createTime" jdbcType="TIMESTAMP"/> |
| | | <result column="uie_update_time" property="updateTime" jdbcType="TIMESTAMP"/> |
| | |
| | | <result column="uie_invite_code" property="inviteCode" jdbcType="VARCHAR"/> |
| | | <result column="uie_lottery_newbies" property="lotteryNewbies" jdbcType="INTEGER"/> |
| | | <result column="uie_coupon_news" property="couponNews" jdbcType="INTEGER"/> |
| | | <result column="uie_synch_navbar" property="synchNavbar" jdbcType="VARCHAR"/> |
| | | <result column="uie_first_login_time" property="firstLoginTime" jdbcType="TIMESTAMP"/> |
| | | <result column="uie_create_time" property="createTime" jdbcType="TIMESTAMP"/> |
| | | <result column="uie_update_time" property="updateTime" jdbcType="TIMESTAMP"/> |
| | |
| | | |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List">uie_id,uie_uid,uie_rank_id,uie_rank_source,uie_rank_order_num,uie_rank_update_time,uie_invite_code,uie_lottery_newbies,uie_coupon_news,uie_first_login_time,uie_create_time,uie_update_time</sql> |
| | | <sql id="Base_Column_List">uie_id,uie_uid,uie_rank_id,uie_rank_source,uie_rank_order_num,uie_rank_update_time,uie_invite_code,uie_lottery_newbies,uie_coupon_news,uie_synch_navbar,uie_first_login_time,uie_create_time,uie_update_time</sql> |
| | | |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select |
| | | <include refid="Base_Column_List"/>from yeshi_ec_user_info_extra where uie_id = #{id,jdbcType=BIGINT} |
| | |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_user_info_extra where uie_id = #{id,jdbcType=BIGINT}</delete> |
| | | |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.user.UserInfoExtra" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_info_extra (uie_id,uie_uid,uie_rank_id,uie_rank_source,uie_rank_order_num,uie_rank_update_time,uie_invite_code,uie_lottery_newbies,uie_coupon_news,uie_first_login_time,uie_create_time,uie_update_time) values (#{id,jdbcType=BIGINT},#{userInfo.id,jdbcType=BIGINT},#{userRank.id,jdbcType=BIGINT},#{rankSource,jdbcType=INTEGER},#{rankOrderNum,jdbcType=INTEGER},#{rankUpdateTime,jdbcType=TIMESTAMP},#{inviteCode,jdbcType=VARCHAR},#{lotteryNewbies,jdbcType=INTEGER},#{couponNews,jdbcType=INTEGER},#{firstLoginTime,jdbcType=TIMESTAMP},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.user.UserInfoExtra" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_info_extra (uie_id,uie_uid,uie_rank_id,uie_rank_source,uie_rank_order_num,uie_rank_update_time,uie_invite_code,uie_lottery_newbies,uie_coupon_news,uie_synch_navbar,uie_first_login_time,uie_create_time,uie_update_time) values (#{id,jdbcType=BIGINT},#{userInfo.id,jdbcType=BIGINT},#{userRank.id,jdbcType=BIGINT},#{rankSource,jdbcType=INTEGER},#{rankOrderNum,jdbcType=INTEGER},#{rankUpdateTime,jdbcType=TIMESTAMP},#{inviteCode,jdbcType=VARCHAR},#{lotteryNewbies,jdbcType=INTEGER},#{couponNews,jdbcType=INTEGER},#{synchNavbar,jdbcType=VARCHAR},#{firstLoginTime,jdbcType=TIMESTAMP},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert> |
| | | |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.user.UserInfoExtra" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_info_extra |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | |
| | | <if test="inviteCode != null">uie_invite_code,</if> |
| | | <if test="lotteryNewbies != null">uie_lottery_newbies,</if> |
| | | <if test="couponNews != null">uie_coupon_news,</if> |
| | | <if test="synchNavbar != null">uie_synch_navbar,</if> |
| | | <if test="firstLoginTime != null">uie_first_login_time,</if> |
| | | <if test="createTime != null">uie_create_time,</if> |
| | | <if test="updateTime != null">uie_update_time,</if> |
| | |
| | | <if test="inviteCode != null">#{inviteCode,jdbcType=VARCHAR},</if> |
| | | <if test="lotteryNewbies != null">#{lotteryNewbies,jdbcType=INTEGER},</if> |
| | | <if test="couponNews != null">#{couponNews,jdbcType=INTEGER},</if> |
| | | <if test="synchNavbar != null">#{synchNavbar,jdbcType=VARCHAR},</if> |
| | | <if test="firstLoginTime != null">#{firstLoginTime,jdbcType=TIMESTAMP},</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.entity.bus.user.UserInfoExtra">update yeshi_ec_user_info_extra set uie_uid = #{userInfo.id,jdbcType=BIGINT},uie_rank_id = #{userRank.id,jdbcType=BIGINT},uie_rank_source = #{rankSource,jdbcType=INTEGER},uie_rank_order_num = #{rankOrderNum,jdbcType=INTEGER},uie_rank_update_time = #{rankUpdateTime,jdbcType=TIMESTAMP},uie_invite_code = #{inviteCode,jdbcType=VARCHAR},uie_lottery_newbies = #{lotteryNewbies,jdbcType=INTEGER},uie_coupon_news = #{couponNews,jdbcType=INTEGER},uie_first_login_time = #{firstLoginTime,jdbcType=TIMESTAMP},uie_create_time = #{createTime,jdbcType=TIMESTAMP},uie_update_time = #{updateTime,jdbcType=TIMESTAMP} where uie_id = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.user.UserInfoExtra">update yeshi_ec_user_info_extra set uie_uid = #{userInfo.id,jdbcType=BIGINT},uie_rank_id = #{userRank.id,jdbcType=BIGINT},uie_rank_source = #{rankSource,jdbcType=INTEGER},uie_rank_order_num = #{rankOrderNum,jdbcType=INTEGER},uie_rank_update_time = #{rankUpdateTime,jdbcType=TIMESTAMP},uie_invite_code = #{inviteCode,jdbcType=VARCHAR},uie_lottery_newbies = #{lotteryNewbies,jdbcType=INTEGER},uie_coupon_news = #{couponNews,jdbcType=INTEGER},uie_synch_navbar = #{synchNavbar,jdbcType=VARCHAR},uie_first_login_time = #{firstLoginTime,jdbcType=TIMESTAMP},uie_create_time = #{createTime,jdbcType=TIMESTAMP},uie_update_time = #{updateTime,jdbcType=TIMESTAMP} where uie_id = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.user.UserInfoExtra">update yeshi_ec_user_info_extra |
| | | <set> |
| | | <if test="userInfo != null">uie_uid=#{userInfo.id,jdbcType=BIGINT},</if> |
| | |
| | | <if test="inviteCode != null">uie_invite_code=#{inviteCode,jdbcType=VARCHAR},</if> |
| | | <if test="lotteryNewbies != null">uie_lottery_newbies=#{lotteryNewbies,jdbcType=INTEGER},</if> |
| | | <if test="couponNews != null">uie_coupon_news=#{couponNews,jdbcType=INTEGER},</if> |
| | | <if test="synchNavbar != null">uie_synch_navbar=#{synchNavbar,jdbcType=VARCHAR},</if> |
| | | <if test="firstLoginTime != null">uie_first_login_time=#{firstLoginTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="createTime != null">uie_create_time=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">uie_update_time=#{updateTime,jdbcType=TIMESTAMP},</if> |
| | |
| | | <if test="inviteCode != null">uie_invite_code=#{inviteCode,jdbcType=VARCHAR},</if> |
| | | <if test="lotteryNewbies != null">uie_lottery_newbies=#{lotteryNewbies,jdbcType=INTEGER},</if> |
| | | <if test="couponNews != null">uie_coupon_news=#{couponNews,jdbcType=INTEGER},</if> |
| | | <if test="synchNavbar != null">uie_synch_navbar=#{synchNavbar,jdbcType=VARCHAR},</if> |
| | | <if test="createTime != null">uie_create_time=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="firstLoginTime != null">uie_first_login_time=#{firstLoginTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">uie_update_time=#{updateTime,jdbcType=TIMESTAMP},</if> |
| | |
| | | return commonGoodsMapper.listBySellerId(sellerId);
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public long countBySellerIdAndHasCoupon(Long sellerId) {
|
| | | return commonGoodsMapper.countBySellerIdAndHasCoupon(sellerId);
|
| | | }
|
| | | |
| | | @Override
|
| | | public List<CommonGoods> getByListGoodsId(List<Long> list) {
|
| | | return commonGoodsMapper.getByListGoodsId(list);
|
| | | }
|
| | | |
| | | }
|
| | |
| | | public List<HomeNavbar> listQueryEffectiveNavbar() {
|
| | | return homeNavbarMapper.listQueryEffective();
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | @Cacheable(value = "configCache", key = "'listQueryDefaultNavbar'")
|
| | | public List<HomeNavbar> listQueryDefaultNavbar() {
|
| | | return homeNavbarMapper.listQueryDefaultNavbar();
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | @Cacheable(value = "configCache", key = "'listQueryFixedNavbar'")
|
| | | public List<HomeNavbar> listQueryFixedNavbar() {
|
| | | return homeNavbarMapper.listQueryFixedNavbar();
|
| | | }
|
| | |
|
| | | @Override
|
| | | public HomeNavbar getEffectiveByClassId(Long classId) {
|
New file |
| | |
| | | package com.yeshi.fanli.service.impl.homemodule;
|
| | |
|
| | | import java.util.ArrayList;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.homemodule.HomeNavbarUserMapper;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.HomeNavbar;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.HomeNavbarUser;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
|
| | | import com.yeshi.fanli.exception.homemodule.HomeNavbarUserException;
|
| | | import com.yeshi.fanli.exception.user.UserInfoExtraException;
|
| | | import com.yeshi.fanli.service.inter.homemodule.HomeNavbarService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.HomeNavbarUserService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | | @Service
|
| | | public class HomeNavbarUserServiceImpl implements HomeNavbarUserService {
|
| | |
|
| | | @Resource
|
| | | private HomeNavbarUserMapper homeNavbarUserMapper;
|
| | |
|
| | | @Resource
|
| | | private HomeNavbarService homeNavbarService;
|
| | |
|
| | | @Resource
|
| | | private UserInfoExtraService userInfoExtraService;
|
| | |
|
| | | @Override
|
| | | public List<HomeNavbar> listEffectiveNavbar(Long uid, String device) {
|
| | | List<HomeNavbar> list = new ArrayList<HomeNavbar>();
|
| | |
|
| | | if (uid != null || !StringUtil.isNullOrEmpty(device)) {
|
| | | if (uid != null) {
|
| | | device = null;
|
| | | }
|
| | |
|
| | | // 自定义导航
|
| | | List<HomeNavbarUser> listUserNavbar = homeNavbarUserMapper.listEffectiveNavbars(uid, device);
|
| | | |
| | | if (listUserNavbar != null && listUserNavbar.size() > 0) {
|
| | | // 固定导航
|
| | | List<HomeNavbar> listFixed = homeNavbarService.listQueryFixedNavbar();
|
| | | if (listFixed != null && listFixed.size() > 0) {
|
| | | list.addAll(listFixed);
|
| | | }
|
| | | |
| | | // 遍历用户自定义
|
| | | for (HomeNavbarUser uomeNavbarUser : listUserNavbar) {
|
| | | HomeNavbar homeNavbar = uomeNavbarUser.getHomeNavbar();
|
| | | if (homeNavbar == null) {
|
| | | continue;
|
| | | }
|
| | |
|
| | | // 是否是固定项
|
| | | boolean notExist = true;
|
| | | |
| | | if (listFixed != null && listFixed.size() > 0) {
|
| | | long id = homeNavbar.getId();
|
| | | for (HomeNavbar fixedbar : listFixed) {
|
| | | long fixedId = fixedbar.getId();
|
| | | if (fixedId == id) {
|
| | | notExist = false;
|
| | | listFixed.remove(fixedbar);
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | if (notExist) {
|
| | | list.add(homeNavbar);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | if (list.size() == 0) {
|
| | | list = homeNavbarService.listQueryDefaultNavbar();
|
| | | }
|
| | | return list;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<HomeNavbarUser> listUserNavbar(Long uid, String device) throws HomeNavbarUserException {
|
| | | if (uid == null && StringUtil.isNullOrEmpty(device)) {
|
| | | throw new HomeNavbarUserException(1, "参数不正确");
|
| | | }
|
| | |
|
| | | if (uid != null && !StringUtil.isNullOrEmpty(device)) {
|
| | | device = null;
|
| | | }
|
| | |
|
| | | return homeNavbarUserMapper.listEffectiveNavbars(uid, device);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void addNavbarUser(Long uid, String device, List<Long> list) throws HomeNavbarUserException {
|
| | | if (uid == null && StringUtil.isNullOrEmpty(device)) {
|
| | | throw new HomeNavbarUserException(1, "参数不正确");
|
| | | }
|
| | |
|
| | | if (list == null || list.size() < 6) {
|
| | | throw new HomeNavbarUserException(1, "至少保留6个分类");
|
| | | }
|
| | |
|
| | | if (list.size() > 16) {
|
| | | throw new HomeNavbarUserException(1, "最多显示16个分类");
|
| | | }
|
| | |
|
| | | // 登录之后 以uid为准
|
| | | if (uid != null && !StringUtil.isNullOrEmpty(device)) {
|
| | | device = null;
|
| | | }
|
| | |
|
| | | // 设置已同步
|
| | | UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
|
| | | if (userInfoExtra != null && !userInfoExtra.getSynchNavbar()) {
|
| | | try {
|
| | | UserInfoExtra updateExtra = new UserInfoExtra();
|
| | | updateExtra.setSynchNavbar(true);
|
| | | updateExtra.setId(userInfoExtra.getId());
|
| | | userInfoExtraService.saveUserInfoExtra(updateExtra);
|
| | | } catch (UserInfoExtraException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | List<HomeNavbarUser> listInsert = new ArrayList<HomeNavbarUser>();
|
| | | List<HomeNavbarUser> listUpdate = new ArrayList<HomeNavbarUser>();
|
| | |
|
| | | // 之前已经定义的导航数据
|
| | | List<HomeNavbarUser> listMyNavbars = homeNavbarUserMapper.listMyNavbars(uid, device);
|
| | |
|
| | | for (int i = 0; i < list.size(); i++) {
|
| | | HomeNavbarUser navbarUser = null;
|
| | | if (list.get(i) == null) {
|
| | | i--;
|
| | | continue;
|
| | | }
|
| | | long homeId = list.get(i);
|
| | |
|
| | | if (listMyNavbars != null && listMyNavbars.size() > 0) {
|
| | | for (int j = 0; j < listMyNavbars.size(); j++) {
|
| | | HomeNavbarUser homeNavbarUser = listMyNavbars.get(j);
|
| | | HomeNavbar homeNavbar = homeNavbarUser.getHomeNavbar();
|
| | |
|
| | | if (homeNavbar == null) {
|
| | | listMyNavbars.remove(homeNavbarUser);
|
| | | j--;
|
| | | continue;
|
| | | }
|
| | |
|
| | | long id = homeNavbar.getId();
|
| | | if (homeId == id) {
|
| | | navbarUser = new HomeNavbarUser();
|
| | | navbarUser.setId(homeNavbarUser.getId());
|
| | | navbarUser.setOrder(homeNavbarUser.getOrder());
|
| | | listMyNavbars.remove(homeNavbarUser);
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | if (navbarUser != null) {
|
| | | Integer order = navbarUser.getOrder();
|
| | | if (order != null && i + 1 == order.intValue()) {
|
| | | continue;
|
| | | }
|
| | | navbarUser.setOrder(i + 1);
|
| | | listUpdate.add(navbarUser);
|
| | | } else {
|
| | | navbarUser = new HomeNavbarUser();
|
| | | navbarUser.setOrder(i + 1);
|
| | | navbarUser.setUid(uid);
|
| | | navbarUser.setDevice(device);
|
| | | navbarUser.setHomeNavbar(new HomeNavbar(homeId));
|
| | | navbarUser.setCreateTime(new Date());
|
| | | listInsert.add(navbarUser);
|
| | | }
|
| | | }
|
| | |
|
| | | // 更新
|
| | | if (listUpdate.size() > 0) {
|
| | | homeNavbarUserMapper.updateSelectiveBatch(listUpdate);
|
| | | }
|
| | |
|
| | | // 新增
|
| | | if (listInsert.size() > 0) {
|
| | | homeNavbarUserMapper.insertBatch(listInsert);
|
| | | }
|
| | |
|
| | | // 删除
|
| | | if (listMyNavbars != null && listMyNavbars.size() > 0) {
|
| | | List<Long> listId = new ArrayList<Long>();
|
| | | for (HomeNavbarUser homeNavbarUser : listMyNavbars) {
|
| | | listId.add(homeNavbarUser.getId());
|
| | | }
|
| | | homeNavbarUserMapper.deleteByPrimaryKeyBatch(listId);
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<HomeNavbar> restoreSystemDefault(Long uid, String device) throws HomeNavbarUserException {
|
| | | if (uid == null && StringUtil.isNullOrEmpty(device)) {
|
| | | throw new HomeNavbarUserException(1, "参数不正确");
|
| | | }
|
| | |
|
| | | // 删除用户自定义导航
|
| | | if (uid != null) {
|
| | | homeNavbarUserMapper.deleteByUid(uid);
|
| | | } else {
|
| | | homeNavbarUserMapper.deleteByDevice(device);
|
| | | }
|
| | | // 返回有效的
|
| | | return homeNavbarService.listQueryEffectiveNavbar();
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void synchroDeviceToUser(Long uid, String device) {
|
| | | UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
|
| | | if (userInfoExtra == null) {
|
| | | userInfoExtra = new UserInfoExtra();
|
| | | } else if (userInfoExtra.getSynchNavbar()) {
|
| | | return;
|
| | | }
|
| | |
|
| | | List<HomeNavbarUser> listDevice = homeNavbarUserMapper.listMyNavbars(null, device);
|
| | | if (listDevice == null || listDevice.size() == 0) {
|
| | | return;
|
| | | }
|
| | |
|
| | | // 同步设备定义导航
|
| | | for (HomeNavbarUser homeNavbarUser : listDevice) {
|
| | | homeNavbarUser.setId(null);
|
| | | homeNavbarUser.setDevice(null);
|
| | | homeNavbarUser.setUid(uid);
|
| | | homeNavbarUser.setCreateTime(new Date());
|
| | | }
|
| | | homeNavbarUserMapper.insertBatch(listDevice);
|
| | |
|
| | | // 已同步
|
| | | try {
|
| | | UserInfoExtra updateExtra = new UserInfoExtra();
|
| | | updateExtra.setSynchNavbar(true);
|
| | | updateExtra.setId(userInfoExtra.getId());
|
| | | userInfoExtraService.saveUserInfoExtra(updateExtra);
|
| | | } catch (UserInfoExtraException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.impl.user;
|
| | |
|
| | | import java.util.Date;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.user.UserInfoDeleteRecordMapper;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfoDeleteRecord;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoDeleteRecordService;
|
| | |
|
| | |
|
| | | @Service
|
| | | public class UserInfoDeleteRecordServiceImpl implements UserInfoDeleteRecordService {
|
| | |
|
| | | @Resource
|
| | | private UserInfoDeleteRecordMapper userInfoDeleteRecordMapper;
|
| | | |
| | |
|
| | | @Override
|
| | | public void addDeleteRecord(Long uid, int state, String reason) {
|
| | | UserInfoDeleteRecord record = new UserInfoDeleteRecord();
|
| | | record.setState(state);
|
| | | record.setReason(reason);
|
| | | record.setUserInfo(new UserInfo(uid));
|
| | | record.setCreateTime(new Date());
|
| | | userInfoDeleteRecordMapper.insertSelective(record);
|
| | | }
|
| | | |
| | | }
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public UserInfoExtra updateUserRankByUid(Long uid) throws UserInfoExtraException{
|
| | | public void updateUserRankByUid(Long uid) throws UserInfoExtraException{
|
| | | if (uid == null || uid == 0) {
|
| | | return;
|
| | | }
|
| | |
|
| | | boolean isupdateRank = true;
|
| | |
|
| | |
| | | if (isupdateRank) {
|
| | | updateRank(userInfoExtra);
|
| | | }
|
| | | |
| | | return userInfoExtra;
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | | */
|
| | | public long countBySellerIdAndHasCoupon(Long sellerId);
|
| | |
|
| | |
|
| | | /**
|
| | | * 批量商品id查询商品信息
|
| | | * @param list
|
| | | * @return
|
| | | */
|
| | | public List<CommonGoods> getByListGoodsId(List<Long> list);
|
| | |
|
| | | }
|
| | |
| | | * @return
|
| | | */
|
| | | public HomeNavbar getEffectiveByClassId(@Param("classId") Long classId);
|
| | |
|
| | |
|
| | | /**
|
| | | * 默认导航栏
|
| | | * @return
|
| | | */
|
| | | public List<HomeNavbar> listQueryDefaultNavbar();
|
| | |
|
| | | /**
|
| | | * 固定的导航栏
|
| | | * @return
|
| | | */
|
| | | public List<HomeNavbar> listQueryFixedNavbar();
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.inter.homemodule;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.homemodule.HomeNavbar;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.HomeNavbarUser;
|
| | | import com.yeshi.fanli.exception.homemodule.HomeNavbarUserException;
|
| | |
|
| | | public interface HomeNavbarUserService {
|
| | |
|
| | | /**
|
| | | * 查询导航栏
|
| | | * @return
|
| | | */
|
| | | public List<HomeNavbar> listEffectiveNavbar(Long uid, String device);
|
| | |
|
| | | /**
|
| | | * 保存用户自定义
|
| | | * @param uid
|
| | | * @param device
|
| | | * @param list
|
| | | * @throws HomeNavbarUserException
|
| | | */
|
| | | public void addNavbarUser(Long uid, String device, List<Long> list) throws HomeNavbarUserException;
|
| | |
|
| | | /**
|
| | | * 还原默认导航栏
|
| | | * @param uid
|
| | | * @param device
|
| | | * @throws HomeNavbarUserException
|
| | | */
|
| | | public List<HomeNavbar> restoreSystemDefault(Long uid, String device) throws HomeNavbarUserException;
|
| | |
|
| | | /**
|
| | | * 查询用户已选导航栏
|
| | | * @param uid
|
| | | * @param device
|
| | | * @return
|
| | | * @throws HomeNavbarUserException
|
| | | */
|
| | | public List<HomeNavbarUser> listUserNavbar(Long uid, String device) throws HomeNavbarUserException;
|
| | |
|
| | | /**
|
| | | * 同步设备上的设置
|
| | | * @param uid
|
| | | * @param device
|
| | | */
|
| | | public void synchroDeviceToUser(Long uid, String device);
|
| | |
|
| | |
|
| | | |
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.inter.user;
|
| | |
|
| | | public interface UserInfoDeleteRecordService {
|
| | | |
| | | /**
|
| | | * 创建删除记录
|
| | | * @param record
|
| | | */
|
| | | public void addDeleteRecord(Long uid, int state, String reason);
|
| | |
|
| | | |
| | | }
|
| | |
| | | * @return
|
| | | * @throws UserInfoExtraException
|
| | | */
|
| | | public UserInfoExtra updateUserRankByUid(Long uid) throws UserInfoExtraException;
|
| | | public void updateUserRankByUid(Long uid) throws UserInfoExtraException;
|
| | |
|
| | | /**
|
| | | * 根据订单更新
|
| | |
| | | tg.setSalesType(1);
|
| | | // 测试使用
|
| | | // tg.setSalesType(Math.random() > 0.5 ? tg.getSalesType() : 3);
|
| | | // List<ClientTextStyleVO> labels = new ArrayList<>();
|
| | | // labels.add(new ClientTextStyleVO("标签内容", "#F14242"));
|
| | | // labels.add(new ClientTextStyleVO("标签内容", "#00FF00"));
|
| | | // tg.setLabels(labels);
|
| | | List<ClientTextStyleVO> labels = new ArrayList<>();
|
| | | labels.add(new ClientTextStyleVO("标签内容", "#F14242"));
|
| | | labels.add(new ClientTextStyleVO("标签内容", "#00FF00"));
|
| | | tg.setLabels(labels);
|
| | | return tg;
|
| | | }
|
| | |
|
New file |
| | |
| | | package com.yeshi.fanli.vo.goods;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import com.google.gson.annotations.Expose;
|
| | | import com.yeshi.fanli.entity.bus.clazz.GoodsSubClass;
|
| | | import com.yeshi.fanli.entity.bus.clazz.GoodsSubClassLabel;
|
| | |
|
| | | public class GoodsSubClassLabelVO extends GoodsSubClassLabel {
|
| | | @Expose
|
| | | private List<GoodsSubClass> listSub;
|
| | |
|
| | | public List<GoodsSubClass> getListSub() {
|
| | | return listSub;
|
| | | }
|
| | |
|
| | | public void setListSub(List<GoodsSubClass> listSub) {
|
| | | this.listSub = listSub;
|
| | | }
|
| | | |
| | | }
|