Merge remote-tracking branch 'origin/master'
Conflicts:
fanli/src/main/java/com/yeshi/fanli/service/impl/user/TBPidServiceImpl.java
4个文件已删除
1 文件已重命名
12个文件已修改
12个文件已添加
New file |
| | |
| | | package com.yeshi.fanli.controller.admin.homemodule;
|
| | |
|
| | | import java.io.PrintWriter;
|
| | | import java.util.ArrayList;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | |
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.multipart.MultipartHttpServletRequest;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | | import com.google.gson.reflect.TypeToken;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.FloatAD;
|
| | | import com.yeshi.fanli.exception.FloatADException;
|
| | | import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
|
| | | import com.yeshi.fanli.service.inter.homemodule.FloatADService;
|
| | | import com.yeshi.fanli.tag.PageEntity;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | @Controller
|
| | | @RequestMapping("admin/new/api/v1/floatad")
|
| | | public class FloatADAdminController {
|
| | |
|
| | | @Resource
|
| | | private FloatADService floatADervice;
|
| | |
|
| | | @Resource
|
| | | private JumpDetailV2Service jumpDetailV2Service;
|
| | |
|
| | | /**
|
| | | * 保存信息
|
| | | * |
| | | * @param callback
|
| | | * @param special
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "save")
|
| | | public void save(String callback, FloatAD floatAD, String jumpType, HttpServletRequest request,PrintWriter out) {
|
| | | try {
|
| | | // 1. 先判断httpRequest 是否含有文件类型 |
| | | if (request instanceof MultipartHttpServletRequest) {
|
| | | MultipartHttpServletRequest fileRequest = (MultipartHttpServletRequest) request;
|
| | | floatADervice.saveObject(fileRequest.getFile("file"), floatAD, jumpType);
|
| | | }else{
|
| | | floatADervice.saveObject(null, floatAD, jumpType);
|
| | | }
|
| | | |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("保存成功"));
|
| | | } catch (FloatADException e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("保存失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | // /**
|
| | | // * 保存信息
|
| | | // * |
| | | // * @param callback
|
| | | // * @param special
|
| | | // * @param out
|
| | | // */
|
| | | // @RequestMapping(value = "save")
|
| | | // public void save(String callback, @RequestParam("file") CommonsMultipartFile[] file, FloatAD floatAD, |
| | | // String jumpType, PrintWriter out) {
|
| | | // try {
|
| | | // floatADervice.saveObject(file, floatAD, jumpType);
|
| | | // JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("保存成功"));
|
| | | // } catch (FloatADException e) {
|
| | | // JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
|
| | | // } catch (Exception e) {
|
| | | // JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("保存失败"));
|
| | | // e.printStackTrace();
|
| | | // }
|
| | | // }
|
| | |
|
| | | /**
|
| | | * 修改排序
|
| | | * |
| | | * @param callback
|
| | | * @param goodsClass
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "updateOrder")
|
| | | public void updateOrder(String callback, Long id, Integer moveType, PrintWriter out) {
|
| | | try {
|
| | | floatADervice.updateOrder(id, moveType);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("操作成功"));
|
| | | } catch (FloatADException e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 删除
|
| | | * |
| | | * @param callback
|
| | | * @param idArray
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "delete")
|
| | | public void delete(String callback, String idArray, PrintWriter out) {
|
| | | try {
|
| | | if (StringUtil.isNullOrEmpty(idArray)) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("请选择操作的数据"));
|
| | | return;
|
| | | }
|
| | |
|
| | | Gson gson = new Gson();
|
| | | List<Long> list = gson.fromJson(idArray, new TypeToken<ArrayList<Long>>() {
|
| | | }.getType());
|
| | |
|
| | | if (list == null || list.size() == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("未检测到删除的数据"));
|
| | | return;
|
| | | }
|
| | |
|
| | | int count = floatADervice.deleteByPrimaryKeyList(list);
|
| | |
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("成功删除[" + count + "]条数据"));
|
| | |
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("删除失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | /**
|
| | | * 查询
|
| | | * |
| | | * @param callback
|
| | | * @param pageIndex
|
| | | * @param pageSize
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "query")
|
| | | public void query(String callback, Integer pageIndex, Integer pageSize, String key, Integer state,
|
| | | PrintWriter out) {
|
| | |
|
| | | if (pageIndex == null || pageIndex < 1) {
|
| | | pageIndex = 1;
|
| | | }
|
| | |
|
| | | if (pageSize == null || pageSize < 1) {
|
| | | pageSize = Constant.PAGE_SIZE;
|
| | | }
|
| | |
|
| | | try {
|
| | | List<FloatAD> list = floatADervice.listQuery((pageIndex - 1) * pageSize, pageSize, key, state);
|
| | | if (list == null || list.size() == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无数据"));
|
| | | return;
|
| | | }
|
| | |
|
| | | long count = floatADervice.countQuery(key, state);
|
| | |
|
| | | int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
|
| | | PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
|
| | |
|
| | | GsonBuilder gsonBuilder = new GsonBuilder();
|
| | | gsonBuilder.serializeNulls();
|
| | | Gson gson = gsonBuilder.setDateFormat("yyyy-MM-dd'T'HH:mm").create();
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("pe", pe);
|
| | | data.put("result_list", gson.toJson(list));
|
| | |
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | |
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | import org.yeshi.utils.encrypt.DESUtil;
|
| | |
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.FloatAD;
|
| | | import com.yeshi.fanli.entity.config.AppHomeFloatImg;
|
| | | import com.yeshi.fanli.entity.taobao.ClientTBPid;
|
| | | import com.yeshi.fanli.entity.taobao.PidUser;
|
| | | import com.yeshi.fanli.entity.taobao.TBPid;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoUnionConfig;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.FloatADService;
|
| | | import com.yeshi.fanli.service.inter.order.CommonOrderCountService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
|
| | | import com.yeshi.fanli.service.inter.user.TBPidService;
|
| | |
| | |
|
| | | @Resource
|
| | | private CommonOrderCountService commonOrderCountService;
|
| | |
|
| | | |
| | | @Resource
|
| | | private FloatADService floatADService;
|
| | | |
| | | |
| | | /**
|
| | | * 首页配置信息
|
| | | *
|
| | |
| | | @RequestMapping(value = "getHomeConfig", method = RequestMethod.POST)
|
| | | public void getHomeConfig(AcceptData acceptData, Long uid, PrintWriter out) {
|
| | | AppHomeFloatImg appHomeFloatImg = configService.getAppHomeFloatImg();
|
| | | if ("ios".equalsIgnoreCase(acceptData.getPlatform()) && !Constant.IS_TEST)
|
| | | if ("ios".equalsIgnoreCase(acceptData.getPlatform()) && !Constant.IS_TEST) {
|
| | | appHomeFloatImg = null;
|
| | | }
|
| | | |
| | | JSONObject data = new JSONObject();
|
| | | if (appHomeFloatImg != null)
|
| | | if (appHomeFloatImg != null) {
|
| | | data.put("floatImg", appHomeFloatImg);
|
| | | }
|
| | | |
| | | String notifyImg = configService.getAppHomeFloatNotifyImg();
|
| | | if (!StringUtil.isNullOrEmpty(notifyImg)) {
|
| | | data.put("floatNotifyImg", notifyImg);
|
| | | }
|
| | | //
|
| | | String config = configService.get("home_float_img_new");
|
| | | if (!StringUtil.isNullOrEmpty(config)) {
|
| | | if (uid != null) {
|
| | | if (!commonOrderCountService.hasRebateAndShareOrder(uid))
|
| | | data.put("floatImgDetail", config);
|
| | | } else
|
| | | data.put("floatImgDetail", config);
|
| | | |
| | | // 悬浮大图 1.5.2 -2019.3.20
|
| | | FloatAD floatAD = floatADService.getEffectiveFloatAD(FloatAD.POSITION_INDEX);
|
| | | if (floatAD != null) {
|
| | | JSONObject detail = new JSONObject();
|
| | | detail.put("img", floatAD.getPicture());
|
| | | detail.put("jumpDetail", floatAD.getJumpDetail());
|
| | | detail.put("params", floatAD.getParams());
|
| | | detail.put("showTime", floatAD.getShowMode());
|
| | | detail.put("accountLogin", floatAD.isJumpNeedLogin());
|
| | | |
| | | if (uid != null && !commonOrderCountService.hasRebateAndShareOrder(uid)) {
|
| | | data.put("floatImgDetail", detail);
|
| | | } else {
|
| | | data.put("floatImgDetail", detail);
|
| | | }
|
| | | }
|
| | | |
| | | // 领券帮助链接,1.5.2后生效
|
| | | String couponHelp = configService.get("taobao_coupon_help");
|
| | | data.put("couponHelpUrl", couponHelp);
|
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.FloatAD; |
| | | |
| | | public interface FloatADMapper extends BaseMapper<FloatAD>{ |
| | | |
| | | /** |
| | | * 批量删除 |
| | | * @param list |
| | | * @return |
| | | */ |
| | | int deleteByPrimaryKeyList(List<Long> list); |
| | | |
| | | /** |
| | | * 根据主键查询 |
| | | * @param list |
| | | * @return |
| | | */ |
| | | List<FloatAD> ListByPrimaryKey(List<Long> list); |
| | | |
| | | |
| | | /** |
| | | * 后端列表查询 |
| | | * @param start |
| | | * @param count |
| | | * @param key |
| | | * @param state |
| | | * @return |
| | | */ |
| | | List<FloatAD> listQuery(@Param("start") long start, @Param("count") int count, @Param("key") String key, |
| | | @Param("state") Integer state); |
| | | |
| | | long countQuery(@Param("key") String key, @Param("state") Integer state); |
| | | |
| | | /** |
| | | * 获取相邻序号 |
| | | * @param position |
| | | * @param type |
| | | * @return |
| | | */ |
| | | FloatAD getByAdjoinOrder(@Param("position") String position, @Param("order") Integer order, |
| | | @Param("type") Integer type); |
| | | |
| | | /** |
| | | * 根据位置统计个数 |
| | | * @param position |
| | | * @return |
| | | */ |
| | | int countByPosition(@Param("position") String position); |
| | | |
| | | /** |
| | | * 查询有效弹出框 |
| | | * @param position |
| | | * @return |
| | | */ |
| | | FloatAD getEffectiveFloatAD(@Param("position") String position); |
| | | |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.yeshi.fanli.dao.mybatis.taobao; |
| | | |
| | | import com.yeshi.fanli.dao.BaseMapper; |
| | | import com.yeshi.fanli.entity.taobao.TBPid; |
| | | |
| | | public interface TBPidMapper extends BaseMapper<TBPid> { |
| | | |
| | | TBPid selectAvailablePid(String likeStr); |
| | | |
| | | Long count(); |
| | | } |
New file |
| | |
| | | package com.yeshi.fanli.dao.mybatis.taobao; |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.dao.BaseMapper; |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoCoupon; |
| | | |
| | | public interface TaoBaoCouponMapper extends BaseMapper<TaoBaoCoupon>{ |
| | | |
| | | void deleteBeforeCouponInfo(Long id); |
| | | |
| | | |
| | | List<TaoBaoCoupon> getTaoBaoCouponList(@Param("start") long start, @Param("count") int count, @Param("key") String key); |
| | | |
| | | int getCount(@Param("key")String key); |
| | | |
| | | |
| | | |
| | | List<TaoBaoCoupon> getTaoBaoCouponListBykeys(@Param("start") long start, @Param("count") int count, @Param("list")List<String> list); |
| | | |
| | | |
| | | |
| | | int countTaoBaoCouponListBykeys(@Param("list")List<String> list); |
| | | |
| | | |
| | | TaoBaoCoupon getTaoBaoCouponByActionId(@Param("auctionId") String auctionId); |
| | | } |
New file |
| | |
| | | package com.yeshi.fanli.dao.mybatis.taobao; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.dao.BaseMapper; |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoLink; |
| | | |
| | | public interface TaoBaoLinkMapper extends BaseMapper<TaoBaoLink>{ |
| | | |
| | | TaoBaoLink getTaoBaoLink(@Param("auctionId") Long auctionId, @Param("systemId") Long systemId); |
| | | |
| | | } |
New file |
| | |
| | | package com.yeshi.fanli.entity.bus.homemodule;
|
| | |
|
| | | import java.util.Date;
|
| | |
|
| | | import org.springframework.format.annotation.DateTimeFormat;
|
| | | import org.yeshi.utils.mybatis.Column;
|
| | | import org.yeshi.utils.mybatis.Table;
|
| | |
|
| | | import com.google.gson.annotations.Expose;
|
| | | import com.yeshi.fanli.entity.common.JumpDetailV2;
|
| | |
|
| | | /**
|
| | | * 活动弹出框
|
| | | * |
| | | * @author yj
|
| | | *
|
| | | */
|
| | | @Table("yeshi_ec_float_ad")
|
| | | public class FloatAD {
|
| | |
|
| | | // 每天展示一次
|
| | | public static String MODE_ONCE_DAY = "everyday";
|
| | | // 每次打开首页都展示
|
| | | public static String MODE_EVERY = "always";
|
| | | |
| | | |
| | | // 展示位置 -首页
|
| | | public static String POSITION_INDEX = "index";
|
| | | |
| | | |
| | | @Column(name = "fa_id")
|
| | | private Long id;
|
| | |
|
| | | // 名称
|
| | | @Expose
|
| | | @Column(name = "fa_name")
|
| | | private String name;
|
| | |
|
| | | // 图片
|
| | | @Expose
|
| | | @Column(name = "fa_picture")
|
| | | private String picture;
|
| | | |
| | | // 显示方式
|
| | | @Expose
|
| | | @Column(name = "fa_show_mode")
|
| | | private String showMode;
|
| | | |
| | | // 跳转方式
|
| | | @Expose
|
| | | @Column(name = "fa_jumpid")
|
| | | private JumpDetailV2 jumpDetail;
|
| | |
|
| | | // 跳转参数
|
| | | @Expose
|
| | | @Column(name = "fa_params")
|
| | | private String params;
|
| | |
|
| | | // 跳转界面是否需要登陆
|
| | | @Column(name = "fa_jump_need_login")
|
| | | private boolean jumpNeedLogin;
|
| | |
|
| | | // 起始时间
|
| | | @DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm")
|
| | | @Column(name = "fa_start_time")
|
| | | private Date startTime;
|
| | |
|
| | | // 结束日期
|
| | | @DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm")
|
| | | @Column(name = "fa_end_time")
|
| | | private Date endTime;
|
| | |
|
| | | // 使用位置
|
| | | @Column(name = "fa_position")
|
| | | private String position;
|
| | |
|
| | | // 排序-优先权
|
| | | @Column(name = "fa_order")
|
| | | private Integer order;
|
| | |
|
| | | // 启用状态
|
| | | @Column(name = "fa_state")
|
| | | private Integer state;
|
| | |
|
| | | // 创建时间
|
| | | @Column(name = "fa_create_time")
|
| | | private Date createTime;
|
| | |
|
| | | // 更新时间
|
| | | @Column(name = "fa_update_time")
|
| | | private Date updateTime;
|
| | |
|
| | | |
| | | |
| | | |
| | | public Long getId() {
|
| | | return id;
|
| | | }
|
| | |
|
| | | public void setId(Long id) {
|
| | | this.id = id;
|
| | | }
|
| | |
|
| | | public String getName() {
|
| | | return name;
|
| | | }
|
| | |
|
| | | public void setName(String name) {
|
| | | this.name = name;
|
| | | }
|
| | |
|
| | | public String getPicture() {
|
| | | return picture;
|
| | | }
|
| | |
|
| | | public void setPicture(String picture) {
|
| | | this.picture = picture;
|
| | | }
|
| | |
|
| | | public JumpDetailV2 getJumpDetail() {
|
| | | return jumpDetail;
|
| | | }
|
| | |
|
| | | public void setJumpDetail(JumpDetailV2 jumpDetail) {
|
| | | this.jumpDetail = jumpDetail;
|
| | | }
|
| | |
|
| | | public String getParams() {
|
| | | return params;
|
| | | }
|
| | |
|
| | | public void setParams(String params) {
|
| | | this.params = params;
|
| | | }
|
| | |
|
| | | public boolean isJumpNeedLogin() {
|
| | | return jumpNeedLogin;
|
| | | }
|
| | |
|
| | | public void setJumpNeedLogin(boolean jumpNeedLogin) {
|
| | | this.jumpNeedLogin = jumpNeedLogin;
|
| | | }
|
| | |
|
| | | public Date getStartTime() {
|
| | | return startTime;
|
| | | }
|
| | |
|
| | | public void setStartTime(Date startTime) {
|
| | | this.startTime = startTime;
|
| | | }
|
| | |
|
| | | public Date getEndTime() {
|
| | | return endTime;
|
| | | }
|
| | |
|
| | | public void setEndTime(Date endTime) {
|
| | | this.endTime = endTime;
|
| | | }
|
| | |
|
| | | public String getPosition() {
|
| | | return position;
|
| | | }
|
| | |
|
| | | public void setPosition(String position) {
|
| | | this.position = position;
|
| | | }
|
| | |
|
| | | public Integer getOrder() {
|
| | | return order;
|
| | | }
|
| | |
|
| | | public void setOrder(Integer order) {
|
| | | this.order = order;
|
| | | }
|
| | |
|
| | | public Integer getState() {
|
| | | return state;
|
| | | }
|
| | |
|
| | | public void setState(Integer state) {
|
| | | this.state = state;
|
| | | }
|
| | |
|
| | | 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 getShowMode() {
|
| | | return showMode;
|
| | | }
|
| | |
|
| | | public void setShowMode(String showMode) {
|
| | | this.showMode = showMode;
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | import java.math.BigDecimal;
|
| | |
|
| | | import javax.persistence.Column;
|
| | | import javax.persistence.Entity;
|
| | | import javax.persistence.GeneratedValue;
|
| | | import javax.persistence.GenerationType;
|
| | | import javax.persistence.Id;
|
| | | import javax.persistence.Table;
|
| | | import javax.persistence.Transient;
|
| | |
|
| | | import org.yeshi.utils.mybatis.Column;
|
| | | import org.yeshi.utils.mybatis.Table;
|
| | |
|
| | | import com.google.gson.annotations.Expose;
|
| | |
|
| | | @Table(name = "yeshi_ec_taobao_coupon")
|
| | | @Entity
|
| | |
|
| | | @Table("yeshi_ec_taobao_coupon")
|
| | | public class TaoBaoCoupon {
|
| | | @Id
|
| | | @GeneratedValue(strategy = GenerationType.AUTO)
|
| | | @Column(name = "id")
|
| | | @Expose
|
| | | private long id;
|
| | | @Column(name = "id")
|
| | | private Long id;
|
| | | |
| | | @Expose
|
| | | @Column(name = "auctionId")
|
| | | private String auctionId;
|
| | | @Column(name = "`title`")
|
| | | |
| | | @Expose
|
| | | @Column(name = "title")
|
| | | private String title;
|
| | | |
| | | @Expose
|
| | | @Column(name = "pictUrl")
|
| | | private String pictUrl;
|
| | | |
| | | @Expose
|
| | | @Column(name = "auctionUrl")
|
| | | private String auctionUrl;
|
| | | |
| | | @Column(name = "classNames")
|
| | | private String classNames; // 分类名称 多级分类/分开
|
| | | @Column(name = "`taobaokeUrl`", length = 1024)
|
| | | |
| | | @Column(name = "taobaokeUrl")
|
| | | private String taobaokeUrl;
|
| | | |
| | | @Expose
|
| | | @Column(name = "zkPrice")
|
| | | private BigDecimal zkPrice; // 无线价格
|
| | | |
| | | @Expose
|
| | | private int biz30day;
|
| | | @Column(name = "biz30day")
|
| | | private Integer biz30day;
|
| | | |
| | | @Expose
|
| | | private double tkRate; // 比例
|
| | | @Column(name = "tkRate")
|
| | | private Double tkRate; // 比例
|
| | | |
| | | @Column(name = "brokerage")
|
| | | private BigDecimal brokerage; // 佣金
|
| | | |
| | | @Column(name = "shopWangWang")
|
| | | private String shopWangWang; // 店铺旺旺
|
| | | private long sellerId;// 卖家Id
|
| | | |
| | | @Column(name = "sellerId")
|
| | | private Long sellerId;// 卖家Id
|
| | | |
| | | @Column(name = "shopTitle")
|
| | | private String shopTitle; // 店铺名称
|
| | | |
| | | @Expose
|
| | | private int shopType; // 平台类型 1-淘宝 2-天猫 0-其他
|
| | | @Column(name = "shopType")
|
| | | private Integer shopType; // 平台类型 1-淘宝 2-天猫 0-其他
|
| | | |
| | | @Column(name = "couponId")
|
| | | private String couponId; // 优惠券ID
|
| | | private int couponSum; // 优惠券总数
|
| | | private int couponCount; // 优惠券剩余量
|
| | | |
| | | @Column(name = "couponSum")
|
| | | private Integer couponSum; // 优惠券总数
|
| | | |
| | | @Column(name = "couponCount")
|
| | | private Integer couponCount; // 优惠券剩余量
|
| | | |
| | | @Expose
|
| | | @Column(name = "couponinfo")
|
| | | private String couponinfo; // 优惠券信息
|
| | | |
| | | @Column(name = "couponStartFee")
|
| | | private BigDecimal couponStartFee; // 优惠券起始金额
|
| | | |
| | | @Column(name = "couponAmount")
|
| | | private BigDecimal couponAmount; // 优惠券金额
|
| | | |
| | | @Expose
|
| | | @Column(name = "quanPrice")
|
| | | private BigDecimal quanPrice;
|
| | | |
| | | @Column(name = "couponBegin")
|
| | | private String couponBegin;
|
| | | |
| | | @Column(name = "couponEnd")
|
| | | private String couponEnd;
|
| | | @Column(name = "couponLink", length = 1024)
|
| | | |
| | | @Column(name = "couponLink")
|
| | | private String couponLink;
|
| | | @Column(name = "generalizeUrl", length = 1024)
|
| | | |
| | | @Column(name = "generalizeUrl")
|
| | | private String generalizeUrl; // 推广URl
|
| | | |
| | | @Expose
|
| | | private int orderby;
|
| | | @Column(name = "orderby")
|
| | | private Integer orderby;
|
| | | |
| | | @Expose
|
| | | private long createtime;
|
| | |
|
| | | @Column(name = "createtime")
|
| | | private Long createtime;
|
| | | |
| | | @Expose
|
| | | @Column(name = "showType")
|
| | | private Integer showType;
|
| | | |
| | | @Expose
|
| | | @Transient
|
| | | private BigDecimal hongbao;
|
| | |
|
| | | @Expose
|
| | | private int showType; //
|
| | |
|
| | | public TaoBaoCoupon() {
|
| | | }
|
| | | |
| | | |
| | | public TaoBaoCoupon() {}
|
| | |
|
| | | public TaoBaoCoupon(long id) {
|
| | | super();
|
| | | this.id = id;
|
| | | }
|
| | |
|
| | | public long getId() {
|
| | | |
| | | public Long getId() {
|
| | | return id;
|
| | | }
|
| | |
|
| | | public void setId(long id) {
|
| | | public void setId(Long id) {
|
| | | this.id = id;
|
| | | }
|
| | |
|
| | | public int getShowType() {
|
| | | return showType;
|
| | | }
|
| | |
|
| | | public void setShowType(int showType) {
|
| | | this.showType = showType;
|
| | | }
|
| | |
|
| | | public BigDecimal getHongbao() {
|
| | | return hongbao;
|
| | | }
|
| | |
|
| | | public void setHongbao(BigDecimal hongbao) {
|
| | | this.hongbao = hongbao;
|
| | | }
|
| | |
|
| | | public BigDecimal getQuanPrice() {
|
| | | return quanPrice;
|
| | | }
|
| | |
|
| | | public void setQuanPrice(BigDecimal quanPrice) {
|
| | | this.quanPrice = quanPrice;
|
| | | }
|
| | |
|
| | | public String getAuctionId() {
|
| | | return auctionId;
|
| | | }
|
| | |
|
| | | public BigDecimal getCouponStartFee() {
|
| | | return couponStartFee;
|
| | | }
|
| | |
|
| | | public int getOrderby() {
|
| | | return orderby;
|
| | | }
|
| | |
|
| | | public void setOrderby(int orderby) {
|
| | | this.orderby = orderby;
|
| | | }
|
| | |
|
| | | public void setCouponStartFee(BigDecimal couponStartFee) {
|
| | | this.couponStartFee = couponStartFee;
|
| | | }
|
| | |
|
| | | public BigDecimal getCouponAmount() {
|
| | | return couponAmount;
|
| | | }
|
| | |
|
| | | public void setCouponAmount(BigDecimal couponAmount) {
|
| | | this.couponAmount = couponAmount;
|
| | | }
|
| | |
|
| | | public void setAuctionId(String auctionId) {
|
| | |
| | | this.zkPrice = zkPrice;
|
| | | }
|
| | |
|
| | | public int getBiz30day() {
|
| | | public Integer getBiz30day() {
|
| | | return biz30day;
|
| | | }
|
| | |
|
| | | public void setBiz30day(int biz30day) {
|
| | | public void setBiz30day(Integer biz30day) {
|
| | | this.biz30day = biz30day;
|
| | | }
|
| | |
|
| | | public double getTkRate() {
|
| | | public Double getTkRate() {
|
| | | return tkRate;
|
| | | }
|
| | |
|
| | | public void setTkRate(double tkRate) {
|
| | | public void setTkRate(Double tkRate) {
|
| | | this.tkRate = tkRate;
|
| | | }
|
| | |
|
| | |
| | | this.shopWangWang = shopWangWang;
|
| | | }
|
| | |
|
| | | public long getSellerId() {
|
| | | public Long getSellerId() {
|
| | | return sellerId;
|
| | | }
|
| | |
|
| | | public void setSellerId(long sellerId) {
|
| | | public void setSellerId(Long sellerId) {
|
| | | this.sellerId = sellerId;
|
| | | }
|
| | |
|
| | |
| | | this.shopTitle = shopTitle;
|
| | | }
|
| | |
|
| | | public int getShopType() {
|
| | | public Integer getShopType() {
|
| | | return shopType;
|
| | | }
|
| | |
|
| | | public void setShopType(int shopType) {
|
| | | public void setShopType(Integer shopType) {
|
| | | this.shopType = shopType;
|
| | | }
|
| | |
|
| | |
| | | this.couponId = couponId;
|
| | | }
|
| | |
|
| | | public int getCouponSum() {
|
| | | public Integer getCouponSum() {
|
| | | return couponSum;
|
| | | }
|
| | |
|
| | | public void setCouponSum(int couponSum) {
|
| | | public void setCouponSum(Integer couponSum) {
|
| | | this.couponSum = couponSum;
|
| | | }
|
| | |
|
| | | public int getCouponCount() {
|
| | | public Integer getCouponCount() {
|
| | | return couponCount;
|
| | | }
|
| | |
|
| | | public void setCouponCount(int couponCount) {
|
| | | public void setCouponCount(Integer couponCount) {
|
| | | this.couponCount = couponCount;
|
| | | }
|
| | |
|
| | | public long getCreatetime() {
|
| | | return createtime;
|
| | | }
|
| | |
|
| | | public void setCreatetime(long createtime) {
|
| | | this.createtime = createtime;
|
| | | }
|
| | |
|
| | | public String getCouponinfo() {
|
| | |
| | |
|
| | | public void setCouponinfo(String couponinfo) {
|
| | | this.couponinfo = couponinfo;
|
| | | }
|
| | |
|
| | | public BigDecimal getCouponStartFee() {
|
| | | return couponStartFee;
|
| | | }
|
| | |
|
| | | public void setCouponStartFee(BigDecimal couponStartFee) {
|
| | | this.couponStartFee = couponStartFee;
|
| | | }
|
| | |
|
| | | public BigDecimal getCouponAmount() {
|
| | | return couponAmount;
|
| | | }
|
| | |
|
| | | public void setCouponAmount(BigDecimal couponAmount) {
|
| | | this.couponAmount = couponAmount;
|
| | | }
|
| | |
|
| | | public BigDecimal getQuanPrice() {
|
| | | return quanPrice;
|
| | | }
|
| | |
|
| | | public void setQuanPrice(BigDecimal quanPrice) {
|
| | | this.quanPrice = quanPrice;
|
| | | }
|
| | |
|
| | | public String getCouponBegin() {
|
| | |
| | | this.generalizeUrl = generalizeUrl;
|
| | | }
|
| | |
|
| | | public Integer getOrderby() {
|
| | | return orderby;
|
| | | }
|
| | |
|
| | | public void setOrderby(Integer orderby) {
|
| | | this.orderby = orderby;
|
| | | }
|
| | |
|
| | | public Long getCreatetime() {
|
| | | return createtime;
|
| | | }
|
| | |
|
| | | public void setCreatetime(Long createtime) {
|
| | | this.createtime = createtime;
|
| | | }
|
| | |
|
| | | public Integer getShowType() {
|
| | | return showType;
|
| | | }
|
| | |
|
| | | public void setShowType(Integer showType) {
|
| | | this.showType = showType;
|
| | | }
|
| | |
|
| | | public BigDecimal getHongbao() {
|
| | | return hongbao;
|
| | | }
|
| | |
|
| | | public void setHongbao(BigDecimal hongbao) {
|
| | | this.hongbao = hongbao;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public int hashCode() {
|
| | | final int prime = 31;
|
| | |
| | | package com.yeshi.fanli.entity.taobao;
|
| | |
|
| | | import javax.persistence.Column;
|
| | | import javax.persistence.Entity;
|
| | | import javax.persistence.GeneratedValue;
|
| | | import javax.persistence.GenerationType;
|
| | | import javax.persistence.Id;
|
| | | import javax.persistence.JoinColumn;
|
| | | import javax.persistence.ManyToOne;
|
| | | import javax.persistence.Table;
|
| | | import javax.persistence.Transient;
|
| | | import org.yeshi.utils.mybatis.Column;
|
| | | import org.yeshi.utils.mybatis.Table;
|
| | |
|
| | | import com.yeshi.fanli.entity.system.BusinessSystem;
|
| | |
|
| | | @Entity
|
| | | @Table(name="yeshi_ec_taobao_link")
|
| | | @Table("yeshi_ec_taobao_link")
|
| | | public class TaoBaoLink {
|
| | | /**
|
| | | * 淘宝ID
|
| | | */
|
| | | @Id
|
| | | @GeneratedValue(strategy=GenerationType.AUTO)
|
| | | @Column(name="id")
|
| | | private Long id;
|
| | |
|
| | | @Column(name="auctionId")
|
| | | private Long auctionId;
|
| | |
|
| | | @ManyToOne
|
| | | @JoinColumn(name="sid")
|
| | | @Column(name="sid")
|
| | | private BusinessSystem system;
|
| | |
|
| | | /**
|
| | | * 淘宝token
|
| | | */
|
| | | @Column(name="taoToken",length=50)
|
| | | @Column(name="taoToken")
|
| | | private String taoToken;
|
| | |
|
| | | /**
|
| | | * 淘宝券链�? |
| | | */
|
| | | @Column(name="couponLink",length=512,insertable=true)
|
| | | @Column(name="couponLink")
|
| | | private String couponLink;
|
| | |
|
| | | /**
|
| | | * 淘宝推广链接
|
| | | */
|
| | | @Column(name="clickUrl",length=512)
|
| | | @Column(name="clickUrl")
|
| | | private String clickUrl;
|
| | | |
| | |
|
| | | @Transient
|
| | |
|
| | | private TaoBaoGoodsBrief goods;
|
| | |
|
| | | public TaoBaoGoodsBrief getGoods() {
|
New file |
| | |
| | | package com.yeshi.fanli.exception; |
| | | |
| | | public class FloatADException 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 FloatADException(int code, String msg) { |
| | | this.code = code; |
| | | this.msg = msg; |
| | | } |
| | | |
| | | public FloatADException() { |
| | | } |
| | | |
| | | @Override |
| | | public String getMessage() { |
| | | return this.msg; |
| | | } |
| | | |
| | | } |
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.FloatADMapper"> |
| | | |
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.homemodule.FloatAD"> |
| | | <id column="fa_id" property="id" jdbcType="BIGINT"/> |
| | | <result column="fa_name" property="name" jdbcType="VARCHAR"/> |
| | | <result column="fa_picture" property="picture" jdbcType="VARCHAR"/> |
| | | <result column="fa_show_mode" property="showMode" jdbcType="VARCHAR"/> |
| | | <result column="fa_params" property="params" jdbcType="VARCHAR"/> |
| | | <result column="fa_jump_need_login" property="jumpNeedLogin" jdbcType="VARCHAR"/> |
| | | <result column="fa_start_time" property="startTime" jdbcType="TIMESTAMP"/> |
| | | <result column="fa_end_time" property="endTime" jdbcType="TIMESTAMP"/> |
| | | <result column="fa_position" property="position" jdbcType="VARCHAR"/> |
| | | <result column="fa_order" property="order" jdbcType="INTEGER"/> |
| | | <result column="fa_state" property="state" jdbcType="INTEGER"/> |
| | | <result column="fa_create_time" property="createTime" jdbcType="TIMESTAMP"/> |
| | | <result column="fa_update_time" property="updateTime" jdbcType="TIMESTAMP"/> |
| | | |
| | | <association property="jumpDetail" column="fa_jumpid" javaType="com.yeshi.fanli.entity.common.JumpDetailV2"> |
| | | <id column="fa_jumpid" property="id" jdbcType="BIGINT" /> |
| | | </association> |
| | | |
| | | </resultMap> |
| | | <sql id="Base_Column_List">fa_id,fa_name,fa_picture,fa_show_mode,fa_jumpid,fa_params,fa_jump_need_login,fa_start_time,fa_end_time,fa_position,fa_order,fa_state,fa_create_time,fa_update_time</sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select |
| | | <include refid="Base_Column_List"/>from yeshi_ec_float_ad where fa_id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_float_ad where fa_id = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.homemodule.FloatAD" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_float_ad (fa_id,fa_name,fa_picture,fa_show_mode,fa_jumpid,fa_params,fa_jump_need_login,fa_start_time,fa_end_time,fa_position,fa_order,fa_state,fa_create_time,fa_update_time) values (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{picture,jdbcType=VARCHAR},#{showMode,jdbcType=VARCHAR},#{jumpDetail.id,jdbcType=BIGINT},#{params,jdbcType=VARCHAR},#{jumpNeedLogin,jdbcType=VARCHAR},#{startTime,jdbcType=TIMESTAMP},#{endTime,jdbcType=TIMESTAMP},#{position,jdbcType=VARCHAR},#{order,jdbcType=INTEGER},#{state,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.FloatAD" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_float_ad |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">fa_id,</if> |
| | | <if test="name != null">fa_name,</if> |
| | | <if test="picture != null">fa_picture,</if> |
| | | <if test="showMode != null">fa_show_mode,</if> |
| | | <if test="jumpDetail != null">fa_jumpid,</if> |
| | | <if test="params != null">fa_params,</if> |
| | | <if test="jumpNeedLogin != null">fa_jump_need_login,</if> |
| | | <if test="startTime != null">fa_start_time,</if> |
| | | <if test="endTime != null">fa_end_time,</if> |
| | | <if test="position != null">fa_position,</if> |
| | | <if test="order != null">fa_order,</if> |
| | | <if test="state != null">fa_state,</if> |
| | | <if test="createTime != null">fa_create_time,</if> |
| | | <if test="updateTime != null">fa_update_time,</if> |
| | | </trim>values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="name != null">#{name,jdbcType=VARCHAR},</if> |
| | | <if test="picture != null">#{picture,jdbcType=VARCHAR},</if> |
| | | <if test="showMode != null">#{showMode,jdbcType=VARCHAR},</if> |
| | | <if test="jumpDetail != null">#{jumpDetail.id,jdbcType=BIGINT},</if> |
| | | <if test="params != null">#{params,jdbcType=VARCHAR},</if> |
| | | <if test="jumpNeedLogin != null">#{jumpNeedLogin,jdbcType=VARCHAR},</if> |
| | | <if test="startTime != null">#{startTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="endTime != null">#{endTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="position != null">#{position,jdbcType=VARCHAR},</if> |
| | | <if test="order != null">#{order,jdbcType=INTEGER},</if> |
| | | <if test="state != null">#{state,jdbcType=INTEGER},</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.FloatAD">update yeshi_ec_float_ad set fa_name = #{name,jdbcType=VARCHAR},fa_picture = #{picture,jdbcType=VARCHAR},fa_show_mode = #{showMode,jdbcType=VARCHAR},fa_jumpid = #{jumpDetail.id,jdbcType=BIGINT},fa_params = #{params,jdbcType=VARCHAR},fa_jump_need_login = #{jumpNeedLogin,jdbcType=VARCHAR},fa_start_time = #{startTime,jdbcType=TIMESTAMP},fa_end_time = #{endTime,jdbcType=TIMESTAMP},fa_position = #{position,jdbcType=VARCHAR},fa_order = #{order,jdbcType=INTEGER},fa_state = #{state,jdbcType=INTEGER},fa_create_time = #{createTime,jdbcType=TIMESTAMP},fa_update_time = #{updateTime,jdbcType=TIMESTAMP} where fa_id = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.FloatAD">update yeshi_ec_float_ad |
| | | <set> |
| | | <if test="name != null">fa_name=#{name,jdbcType=VARCHAR},</if> |
| | | <if test="picture != null">fa_picture=#{picture,jdbcType=VARCHAR},</if> |
| | | <if test="showMode != null">fa_show_mode=#{showMode,jdbcType=VARCHAR},</if> |
| | | <if test="jumpDetail != null">fa_jumpid=#{jumpDetail.id,jdbcType=BIGINT},</if> |
| | | <if test="params != null">fa_params=#{params,jdbcType=VARCHAR},</if> |
| | | <if test="jumpNeedLogin != null">fa_jump_need_login=#{jumpNeedLogin,jdbcType=VARCHAR},</if> |
| | | <if test="startTime != null">fa_start_time=#{startTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="endTime != null">fa_end_time=#{endTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="position != null">fa_position=#{position,jdbcType=VARCHAR},</if> |
| | | <if test="order != null">fa_order=#{order,jdbcType=INTEGER},</if> |
| | | <if test="state != null">fa_state=#{state,jdbcType=INTEGER},</if> |
| | | <if test="createTime != null">fa_create_time=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">fa_update_time=#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </set> where fa_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | <delete id="deleteByPrimaryKeyList" parameterType="java.util.List"> |
| | | delete from yeshi_ec_float_ad |
| | | WHERE fa_id in <foreach collection="list" item="item" open="(" separator="," close=")">#{item}</foreach> |
| | | </delete> |
| | | |
| | | |
| | | <select id="listQuery" resultMap="BaseResultMap"> |
| | | SELECT <include refid="Base_Column_List" /> FROM yeshi_ec_float_ad fd |
| | | WHERE 1=1 |
| | | <if test="key != null and key !='' "> |
| | | AND fd.`fa_name` LIKE '%${key}%' |
| | | </if> |
| | | <if test="state != null"> |
| | | AND fd.`fa_state` = #{state} |
| | | </if> |
| | | ORDER BY fd.`fa_position`,fd.`fa_order` |
| | | LIMIT ${start},${count} |
| | | </select> |
| | | |
| | | <select id="countQuery" resultType="java.lang.Long"> |
| | | SELECT IFNULL(COUNT(fd.`fa_id`),0) FROM yeshi_ec_float_ad fd |
| | | WHERE 1=1 |
| | | <if test="key != null and key !='' "> |
| | | AND fd.`fa_name` LIKE '%${key}%' |
| | | </if> |
| | | <if test="state != null"> |
| | | AND fd.`fa_state` = #{state} |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="getByAdjoinOrder" resultMap="BaseResultMap"> |
| | | SELECT <include refid="Base_Column_List" /> FROM yeshi_ec_float_ad fd |
| | | WHERE fd.`fa_position` = #{position} |
| | | <if test="type == -1"> |
| | | AND fd.`fa_order` <![CDATA[<]]> #{order} |
| | | ORDER BY fd.`fa_order` desc |
| | | </if> |
| | | |
| | | <if test="type == 1"> |
| | | AND fd.`fa_order` <![CDATA[>]]> #{order} |
| | | ORDER BY fd.`fa_order` |
| | | </if> |
| | | LIMIT 1 |
| | | </select> |
| | | |
| | | <select id="countByPosition" resultType="java.lang.Integer"> |
| | | SELECT IFNULL(COUNT(fd.`fa_id`),0) FROM yeshi_ec_float_ad fd |
| | | WHERE fd.`fa_position` = #{position} |
| | | </select> |
| | | |
| | | <select id="ListByPrimaryKey" parameterType="java.util.List" resultMap="BaseResultMap"> |
| | | SELECT <include refid="Base_Column_List" /> FROM yeshi_ec_float_ad |
| | | WHERE fa_id in <foreach collection="list" item="item" open="(" separator="," close=")">#{item}</foreach> |
| | | </select> |
| | | |
| | | <select id="getEffectiveFloatAD" resultMap="BaseResultMap"> |
| | | SELECT * FROM yeshi_ec_float_ad fd |
| | | WHERE fd.`fa_position` = 'index' AND fd.`fa_state` = 1 |
| | | AND IF(fd.`fa_start_time` IS NULL,TRUE,fd.`fa_start_time` <![CDATA[<=]]> NOW()) |
| | | AND IF(fd.`fa_end_time` IS NULL,TRUE,fd.`fa_end_time` <![CDATA[>=]]> NOW()) |
| | | ORDER BY fd.`fa_order` |
| | | LIMIT 1 |
| | | </select> |
| | | </mapper> |
File was renamed from fanli/src/main/java/com/yeshi/fanli/mapping/TBPidMapper.xml |
| | |
| | | <?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.TBPidMapper"> |
| | | <mapper namespace="com.yeshi.fanli.dao.mybatis.taobao.TBPidMapper"> |
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.taobao.TBPid"> |
| | | <id column="id" property="id" jdbcType="BIGINT" /> |
| | | <result column="name" property="name" jdbcType="VARCHAR" /> |
| | |
| | | from yeshi_ec_pid where pid like #{0} and used=0 limit 1 for update |
| | | </select> |
| | | |
| | | <select id="count" resultType="java.lang.Long"> |
| | | SELECT IFNULL(COUNT(id),0) FROM yeshi_ec_pid |
| | | </select> |
| | | |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from |
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.taobao.TaoBaoCouponMapper"> |
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.taobao.TaoBaoCoupon"> |
| | | <id column="id" property="id" jdbcType="BIGINT"/> |
| | | <result column="auctionId" property="auctionId" jdbcType="VARCHAR"/> |
| | | <result column="title" property="title" jdbcType="VARCHAR"/> |
| | | <result column="pictUrl" property="pictUrl" jdbcType="VARCHAR"/> |
| | | <result column="auctionUrl" property="auctionUrl" jdbcType="VARCHAR"/> |
| | | <result column="classNames" property="classNames" jdbcType="VARCHAR"/> |
| | | <result column="taobaokeUrl" property="taobaokeUrl" jdbcType="VARCHAR"/> |
| | | <result column="zkPrice" property="zkPrice" jdbcType="DECIMAL"/> |
| | | <result column="biz30day" property="biz30day" jdbcType="INTEGER"/> |
| | | <result column="tkRate" property="tkRate" jdbcType="VARCHAR"/> |
| | | <result column="brokerage" property="brokerage" jdbcType="DECIMAL"/> |
| | | <result column="shopWangWang" property="shopWangWang" jdbcType="VARCHAR"/> |
| | | <result column="sellerId" property="sellerId" jdbcType="BIGINT"/> |
| | | <result column="shopTitle" property="shopTitle" jdbcType="VARCHAR"/> |
| | | <result column="shopType" property="shopType" jdbcType="INTEGER"/> |
| | | <result column="couponId" property="couponId" jdbcType="VARCHAR"/> |
| | | <result column="couponSum" property="couponSum" jdbcType="INTEGER"/> |
| | | <result column="couponCount" property="couponCount" jdbcType="INTEGER"/> |
| | | <result column="couponinfo" property="couponinfo" jdbcType="VARCHAR"/> |
| | | <result column="couponStartFee" property="couponStartFee" jdbcType="DECIMAL"/> |
| | | <result column="couponAmount" property="couponAmount" jdbcType="DECIMAL"/> |
| | | <result column="quanPrice" property="quanPrice" jdbcType="DECIMAL"/> |
| | | <result column="couponBegin" property="couponBegin" jdbcType="VARCHAR"/> |
| | | <result column="couponEnd" property="couponEnd" jdbcType="VARCHAR"/> |
| | | <result column="couponLink" property="couponLink" jdbcType="VARCHAR"/> |
| | | <result column="generalizeUrl" property="generalizeUrl" jdbcType="VARCHAR"/> |
| | | <result column="orderby" property="orderby" jdbcType="INTEGER"/> |
| | | <result column="createtime" property="createtime" jdbcType="BIGINT"/> |
| | | <result column="showType" property="showType" jdbcType="INTEGER"/> |
| | | </resultMap> |
| | | <sql id="Base_Column_List">id,auctionId,title,pictUrl,auctionUrl,classNames,taobaokeUrl,zkPrice,biz30day,tkRate,brokerage,shopWangWang,sellerId,shopTitle,shopType,couponId,couponSum,couponCount,couponinfo,couponStartFee,couponAmount,quanPrice,couponBegin,couponEnd,couponLink,generalizeUrl,orderby,createtime,showType</sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select |
| | | <include refid="Base_Column_List"/>from yeshi_ec_taobao_coupon where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_taobao_coupon where id = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoCoupon" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_taobao_coupon (id,auctionId,title,pictUrl,auctionUrl,classNames,taobaokeUrl,zkPrice,biz30day,tkRate,brokerage,shopWangWang,sellerId,shopTitle,shopType,couponId,couponSum,couponCount,couponinfo,couponStartFee,couponAmount,quanPrice,couponBegin,couponEnd,couponLink,generalizeUrl,orderby,createtime,showType) values (#{id,jdbcType=BIGINT},#{auctionId,jdbcType=VARCHAR},#{title,jdbcType=VARCHAR},#{pictUrl,jdbcType=VARCHAR},#{auctionUrl,jdbcType=VARCHAR},#{classNames,jdbcType=VARCHAR},#{taobaokeUrl,jdbcType=VARCHAR},#{zkPrice,jdbcType=DECIMAL},#{biz30day,jdbcType=INTEGER},#{tkRate,jdbcType=VARCHAR},#{brokerage,jdbcType=DECIMAL},#{shopWangWang,jdbcType=VARCHAR},#{sellerId,jdbcType=BIGINT},#{shopTitle,jdbcType=VARCHAR},#{shopType,jdbcType=INTEGER},#{couponId,jdbcType=VARCHAR},#{couponSum,jdbcType=INTEGER},#{couponCount,jdbcType=INTEGER},#{couponinfo,jdbcType=VARCHAR},#{couponStartFee,jdbcType=DECIMAL},#{couponAmount,jdbcType=DECIMAL},#{quanPrice,jdbcType=DECIMAL},#{couponBegin,jdbcType=VARCHAR},#{couponEnd,jdbcType=VARCHAR},#{couponLink,jdbcType=VARCHAR},#{generalizeUrl,jdbcType=VARCHAR},#{orderby,jdbcType=INTEGER},#{createtime,jdbcType=BIGINT},#{showType,jdbcType=INTEGER})</insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoCoupon" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_taobao_coupon |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | | <if test="auctionId != null">auctionId,</if> |
| | | <if test="title != null">title,</if> |
| | | <if test="pictUrl != null">pictUrl,</if> |
| | | <if test="auctionUrl != null">auctionUrl,</if> |
| | | <if test="classNames != null">classNames,</if> |
| | | <if test="taobaokeUrl != null">taobaokeUrl,</if> |
| | | <if test="zkPrice != null">zkPrice,</if> |
| | | <if test="biz30day != null">biz30day,</if> |
| | | <if test="tkRate != null">tkRate,</if> |
| | | <if test="brokerage != null">brokerage,</if> |
| | | <if test="shopWangWang != null">shopWangWang,</if> |
| | | <if test="sellerId != null">sellerId,</if> |
| | | <if test="shopTitle != null">shopTitle,</if> |
| | | <if test="shopType != null">shopType,</if> |
| | | <if test="couponId != null">couponId,</if> |
| | | <if test="couponSum != null">couponSum,</if> |
| | | <if test="couponCount != null">couponCount,</if> |
| | | <if test="couponinfo != null">couponinfo,</if> |
| | | <if test="couponStartFee != null">couponStartFee,</if> |
| | | <if test="couponAmount != null">couponAmount,</if> |
| | | <if test="quanPrice != null">quanPrice,</if> |
| | | <if test="couponBegin != null">couponBegin,</if> |
| | | <if test="couponEnd != null">couponEnd,</if> |
| | | <if test="couponLink != null">couponLink,</if> |
| | | <if test="generalizeUrl != null">generalizeUrl,</if> |
| | | <if test="orderby != null">orderby,</if> |
| | | <if test="createtime != null">createtime,</if> |
| | | <if test="showType != null">showType,</if> |
| | | </trim>values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="auctionId != null">#{auctionId,jdbcType=VARCHAR},</if> |
| | | <if test="title != null">#{title,jdbcType=VARCHAR},</if> |
| | | <if test="pictUrl != null">#{pictUrl,jdbcType=VARCHAR},</if> |
| | | <if test="auctionUrl != null">#{auctionUrl,jdbcType=VARCHAR},</if> |
| | | <if test="classNames != null">#{classNames,jdbcType=VARCHAR},</if> |
| | | <if test="taobaokeUrl != null">#{taobaokeUrl,jdbcType=VARCHAR},</if> |
| | | <if test="zkPrice != null">#{zkPrice,jdbcType=DECIMAL},</if> |
| | | <if test="biz30day != null">#{biz30day,jdbcType=INTEGER},</if> |
| | | <if test="tkRate != null">#{tkRate,jdbcType=VARCHAR},</if> |
| | | <if test="brokerage != null">#{brokerage,jdbcType=DECIMAL},</if> |
| | | <if test="shopWangWang != null">#{shopWangWang,jdbcType=VARCHAR},</if> |
| | | <if test="sellerId != null">#{sellerId,jdbcType=BIGINT},</if> |
| | | <if test="shopTitle != null">#{shopTitle,jdbcType=VARCHAR},</if> |
| | | <if test="shopType != null">#{shopType,jdbcType=INTEGER},</if> |
| | | <if test="couponId != null">#{couponId,jdbcType=VARCHAR},</if> |
| | | <if test="couponSum != null">#{couponSum,jdbcType=INTEGER},</if> |
| | | <if test="couponCount != null">#{couponCount,jdbcType=INTEGER},</if> |
| | | <if test="couponinfo != null">#{couponinfo,jdbcType=VARCHAR},</if> |
| | | <if test="couponStartFee != null">#{couponStartFee,jdbcType=DECIMAL},</if> |
| | | <if test="couponAmount != null">#{couponAmount,jdbcType=DECIMAL},</if> |
| | | <if test="quanPrice != null">#{quanPrice,jdbcType=DECIMAL},</if> |
| | | <if test="couponBegin != null">#{couponBegin,jdbcType=VARCHAR},</if> |
| | | <if test="couponEnd != null">#{couponEnd,jdbcType=VARCHAR},</if> |
| | | <if test="couponLink != null">#{couponLink,jdbcType=VARCHAR},</if> |
| | | <if test="generalizeUrl != null">#{generalizeUrl,jdbcType=VARCHAR},</if> |
| | | <if test="orderby != null">#{orderby,jdbcType=INTEGER},</if> |
| | | <if test="createtime != null">#{createtime,jdbcType=BIGINT},</if> |
| | | <if test="showType != null">#{showType,jdbcType=INTEGER},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoCoupon">update yeshi_ec_taobao_coupon set auctionId = #{auctionId,jdbcType=VARCHAR},title = #{title,jdbcType=VARCHAR},pictUrl = #{pictUrl,jdbcType=VARCHAR},auctionUrl = #{auctionUrl,jdbcType=VARCHAR},classNames = #{classNames,jdbcType=VARCHAR},taobaokeUrl = #{taobaokeUrl,jdbcType=VARCHAR},zkPrice = #{zkPrice,jdbcType=DECIMAL},biz30day = #{biz30day,jdbcType=INTEGER},tkRate = #{tkRate,jdbcType=VARCHAR},brokerage = #{brokerage,jdbcType=DECIMAL},shopWangWang = #{shopWangWang,jdbcType=VARCHAR},sellerId = #{sellerId,jdbcType=BIGINT},shopTitle = #{shopTitle,jdbcType=VARCHAR},shopType = #{shopType,jdbcType=INTEGER},couponId = #{couponId,jdbcType=VARCHAR},couponSum = #{couponSum,jdbcType=INTEGER},couponCount = #{couponCount,jdbcType=INTEGER},couponinfo = #{couponinfo,jdbcType=VARCHAR},couponStartFee = #{couponStartFee,jdbcType=DECIMAL},couponAmount = #{couponAmount,jdbcType=DECIMAL},quanPrice = #{quanPrice,jdbcType=DECIMAL},couponBegin = #{couponBegin,jdbcType=VARCHAR},couponEnd = #{couponEnd,jdbcType=VARCHAR},couponLink = #{couponLink,jdbcType=VARCHAR},generalizeUrl = #{generalizeUrl,jdbcType=VARCHAR},orderby = #{orderby,jdbcType=INTEGER},createtime = #{createtime,jdbcType=BIGINT},showType = #{showType,jdbcType=INTEGER} where id = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoCoupon">update yeshi_ec_taobao_coupon |
| | | <set> |
| | | <if test="auctionId != null">auctionId=#{auctionId,jdbcType=VARCHAR},</if> |
| | | <if test="title != null">title=#{title,jdbcType=VARCHAR},</if> |
| | | <if test="pictUrl != null">pictUrl=#{pictUrl,jdbcType=VARCHAR},</if> |
| | | <if test="auctionUrl != null">auctionUrl=#{auctionUrl,jdbcType=VARCHAR},</if> |
| | | <if test="classNames != null">classNames=#{classNames,jdbcType=VARCHAR},</if> |
| | | <if test="taobaokeUrl != null">taobaokeUrl=#{taobaokeUrl,jdbcType=VARCHAR},</if> |
| | | <if test="zkPrice != null">zkPrice=#{zkPrice,jdbcType=DECIMAL},</if> |
| | | <if test="biz30day != null">biz30day=#{biz30day,jdbcType=INTEGER},</if> |
| | | <if test="tkRate != null">tkRate=#{tkRate,jdbcType=VARCHAR},</if> |
| | | <if test="brokerage != null">brokerage=#{brokerage,jdbcType=DECIMAL},</if> |
| | | <if test="shopWangWang != null">shopWangWang=#{shopWangWang,jdbcType=VARCHAR},</if> |
| | | <if test="sellerId != null">sellerId=#{sellerId,jdbcType=BIGINT},</if> |
| | | <if test="shopTitle != null">shopTitle=#{shopTitle,jdbcType=VARCHAR},</if> |
| | | <if test="shopType != null">shopType=#{shopType,jdbcType=INTEGER},</if> |
| | | <if test="couponId != null">couponId=#{couponId,jdbcType=VARCHAR},</if> |
| | | <if test="couponSum != null">couponSum=#{couponSum,jdbcType=INTEGER},</if> |
| | | <if test="couponCount != null">couponCount=#{couponCount,jdbcType=INTEGER},</if> |
| | | <if test="couponinfo != null">couponinfo=#{couponinfo,jdbcType=VARCHAR},</if> |
| | | <if test="couponStartFee != null">couponStartFee=#{couponStartFee,jdbcType=DECIMAL},</if> |
| | | <if test="couponAmount != null">couponAmount=#{couponAmount,jdbcType=DECIMAL},</if> |
| | | <if test="quanPrice != null">quanPrice=#{quanPrice,jdbcType=DECIMAL},</if> |
| | | <if test="couponBegin != null">couponBegin=#{couponBegin,jdbcType=VARCHAR},</if> |
| | | <if test="couponEnd != null">couponEnd=#{couponEnd,jdbcType=VARCHAR},</if> |
| | | <if test="couponLink != null">couponLink=#{couponLink,jdbcType=VARCHAR},</if> |
| | | <if test="generalizeUrl != null">generalizeUrl=#{generalizeUrl,jdbcType=VARCHAR},</if> |
| | | <if test="orderby != null">orderby=#{orderby,jdbcType=INTEGER},</if> |
| | | <if test="createtime != null">createtime=#{createtime,jdbcType=BIGINT},</if> |
| | | <if test="showType != null">showType=#{showType,jdbcType=INTEGER},</if> |
| | | </set> where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | <delete id="deleteBeforeCouponInfo"> |
| | | delete from yeshi_ec_taobao_coupon where id <![CDATA[<]]> #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | |
| | | <select id="getTaoBaoCouponList" resultMap="BaseResultMap"> |
| | | select * from yeshi_ec_taobao_coupon tbc |
| | | where tbc.title like '%#{key}%' |
| | | order by tbc.orderby,tbc.id |
| | | LIMIT ${start},${count} |
| | | </select> |
| | | |
| | | <select id="getCount" resultType="java.lang.Integer"> |
| | | select count(*) from TaoBaoCoupon tbc |
| | | where tbc.title like '%#{key}%' |
| | | </select> |
| | | |
| | | <select id="getTaoBaoCouponListBykeys" resultMap="BaseResultMap"> |
| | | select * from yeshi_ec_taobao_coupon tbc |
| | | where tbc.showType = 3 AND |
| | | <foreach collection="list" index="index" item="item" open="(" |
| | | separator="or" close=")"> |
| | | tbc.title LIKE '%${item}%' |
| | | </foreach> |
| | | LIMIT ${start},${count} |
| | | </select> |
| | | |
| | | <select id="countTaoBaoCouponListBykeys" resultType="java.lang.Integer"> |
| | | select count(tbc.id) from yeshi_ec_taobao_coupon tbc |
| | | where tbc.showType = 3 AND |
| | | <foreach collection="list" index="index" item="item" open="(" |
| | | separator="or" close=")"> |
| | | tbc.title LIKE '%${item}%' |
| | | </foreach> |
| | | </select> |
| | | |
| | | <select id="getTaoBaoCouponByActionId" resultMap="BaseResultMap"> |
| | | select * from yeshi_ec_taobao_coupon tbc |
| | | where tbc.auctionId = #{auctionId} |
| | | LIMIT 1 |
| | | </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.taobao.TaoBaoLinkMapper"> |
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.taobao.TaoBaoLink"> |
| | | <id column="id" property="id" jdbcType="BIGINT"/> |
| | | <result column="auctionId" property="auctionId" jdbcType="BIGINT"/> |
| | | <result column="taoToken" property="taoToken" jdbcType="VARCHAR"/> |
| | | <result column="couponLink" property="couponLink" jdbcType="VARCHAR"/> |
| | | <result column="clickUrl" property="clickUrl" jdbcType="VARCHAR"/> |
| | | |
| | | <association property="system" column="sid" javaType="com.yeshi.fanli.entity.system.BusinessSystem"> |
| | | <id column="sid" property="id" jdbcType="BIGINT"/> |
| | | </association> |
| | | |
| | | </resultMap> |
| | | <sql id="Base_Column_List">id,auctionId,sid,taoToken,couponLink,clickUrl</sql> |
| | | |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select |
| | | <include refid="Base_Column_List"/>from yeshi_ec_taobao_link where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | <select id="getTaoBaoLink"> |
| | | select <include refid="Base_Column_List"/> from yeshi_ec_taobao_link |
| | | where auctionId = #{auctionId} and sid = #{systemId} |
| | | </select> |
| | | |
| | | |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_taobao_link where id = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoLink" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_taobao_link (id,auctionId,sid,taoToken,couponLink,clickUrl) values (#{id,jdbcType=BIGINT},#{auctionId,jdbcType=BIGINT},#{system.id,jdbcType=BIGINT},#{taoToken,jdbcType=VARCHAR},#{couponLink,jdbcType=VARCHAR},#{clickUrl,jdbcType=VARCHAR})</insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoLink" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_taobao_link |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | | <if test="auctionId != null">auctionId,</if> |
| | | <if test="system != null">sid,</if> |
| | | <if test="taoToken != null">taoToken,</if> |
| | | <if test="couponLink != null">couponLink,</if> |
| | | <if test="clickUrl != null">clickUrl,</if> |
| | | </trim>values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="auctionId != null">#{auctionId,jdbcType=BIGINT},</if> |
| | | <if test="system != null">#{system.id,jdbcType=BIGINT},</if> |
| | | <if test="taoToken != null">#{taoToken,jdbcType=VARCHAR},</if> |
| | | <if test="couponLink != null">#{couponLink,jdbcType=VARCHAR},</if> |
| | | <if test="clickUrl != null">#{clickUrl,jdbcType=VARCHAR},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoLink">update yeshi_ec_taobao_link set auctionId = #{auctionId,jdbcType=BIGINT},sid = #{system.id,jdbcType=BIGINT},taoToken = #{taoToken,jdbcType=VARCHAR},couponLink = #{couponLink,jdbcType=VARCHAR},clickUrl = #{clickUrl,jdbcType=VARCHAR} where id = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoLink">update yeshi_ec_taobao_link |
| | | <set> |
| | | <if test="auctionId != null">auctionId=#{auctionId,jdbcType=BIGINT},</if> |
| | | <if test="system != null">sid=#{system.id,jdbcType=BIGINT},</if> |
| | | <if test="taoToken != null">taoToken=#{taoToken,jdbcType=VARCHAR},</if> |
| | | <if test="couponLink != null">couponLink=#{couponLink,jdbcType=VARCHAR},</if> |
| | | <if test="clickUrl != null">clickUrl=#{clickUrl,jdbcType=VARCHAR},</if> |
| | | </set> where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | </mapper> |
| | |
| | | package com.yeshi.fanli.service.impl.goods;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | |
| | |
|
| | | @Override
|
| | | public int deleteByPrimaryKey(Long id) {
|
| | | // TODO Auto-generated method stub
|
| | | return taoBaoClassRelationMapper.deleteByPrimaryKey(id);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public int insert(TaoBaoClassRelation record) {
|
| | | // TODO Auto-generated method stub
|
| | | return taoBaoClassRelationMapper.insert(record);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public int insertSelective(TaoBaoClassRelation record) {
|
| | | // TODO Auto-generated method stub
|
| | | return taoBaoClassRelationMapper.insertSelective(record);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public TaoBaoClassRelation selectByPrimaryKey(Long id) {
|
| | | // TODO Auto-generated method stub
|
| | | return taoBaoClassRelationMapper.selectByPrimaryKey(id);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public int updateByPrimaryKeySelective(TaoBaoClassRelation record) {
|
| | | // TODO Auto-generated method stub
|
| | | return taoBaoClassRelationMapper.updateByPrimaryKeySelective(record);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public int updateByPrimaryKey(TaoBaoClassRelation record) {
|
| | | // TODO Auto-generated method stub
|
| | | return taoBaoClassRelationMapper.updateByPrimaryKey(record);
|
| | | }
|
| | |
|
| | |
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.TaoBaoClassMapper;
|
| | | import com.yeshi.fanli.entity.bus.clazz.TaoBaoClass;
|
| | | import com.yeshi.fanli.entity.bus.clazz.TaoBaoClassRelation;
|
| | | import com.yeshi.fanli.service.inter.goods.TaoBaoClassService;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | @Service
|
| | | public class TaoBaoClassServiceImpl implements TaoBaoClassService {
|
| | |
| | |
|
| | | @Override
|
| | | public int deleteByPrimaryKey(Long id) {
|
| | | // TODO Auto-generated method stub
|
| | | return taoBaoClassMapper.deleteByPrimaryKey(id);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public int insert(TaoBaoClass record) {
|
| | | // TODO Auto-generated method stub
|
| | | return taoBaoClassMapper.insert(record);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public int insertSelective(TaoBaoClass record) {
|
| | | // TODO Auto-generated method stub
|
| | | return taoBaoClassMapper.insertSelective(record);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public TaoBaoClass selectByPrimaryKey(Long id) {
|
| | | // TODO Auto-generated method stub
|
| | | return taoBaoClassMapper.selectByPrimaryKey(id);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public int updateByPrimaryKeySelective(TaoBaoClass record) {
|
| | | // TODO Auto-generated method stub
|
| | | return taoBaoClassMapper.updateByPrimaryKeySelective(record);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public int updateByPrimaryKey(TaoBaoClass record) {
|
| | | // TODO Auto-generated method stub
|
| | | return taoBaoClassMapper.updateByPrimaryKey(record);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<TaoBaoClass> listBySystemCid(long start, int count, Long systemCid) {
|
| | | // TODO Auto-generated method stub
|
| | | return taoBaoClassMapper.listBySystemCid(start, count, systemCid);
|
| | | }
|
| | |
|
| | |
| | | package com.yeshi.fanli.service.impl.goods;
|
| | |
|
| | | import java.io.Serializable;
|
| | | import java.lang.reflect.Type;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Collections;
|
| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.hibernate.HibernateException;
|
| | | import org.hibernate.Query;
|
| | | import org.hibernate.Session;
|
| | | import org.springframework.cache.annotation.Cacheable;
|
| | | import org.springframework.orm.hibernate4.HibernateCallback;
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.reflect.TypeToken;
|
| | | import com.yeshi.fanli.dao.taobao.TaoBaoCouponDao;
|
| | | import com.yeshi.fanli.dao.mybatis.taobao.TaoBaoCouponMapper;
|
| | | import com.yeshi.fanli.entity.taobao.PidUser;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoCoupon;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | |
| | | public class TaoBaoCouponServiceImpl implements TaoBaoCouponService {
|
| | |
|
| | | @Resource
|
| | | private TaoBaoCouponDao taoBaoCouponDao;
|
| | | private TaoBaoCouponMapper taoBaoCouponMapper;
|
| | |
|
| | | @Resource
|
| | | private TaoBaoUnionConfigService taoBaoUnionConfigService;
|
| | |
| | | private RedisManager redisManager;
|
| | |
|
| | | @Transactional
|
| | | @Override
|
| | | public void updateTaoBaoCoupon() {
|
| | | List<TaoBaoUnionConfig> config = taoBaoUnionConfigService.getConfigByTypeCache(PidUser.TYPE_FANLI_ANDROID);
|
| | |
|
| | |
| | | int ii = 0;
|
| | | for (TaoBaoCoupon taoBaoCoupon : list) {
|
| | | if (ii == 0) {
|
| | | minId = (Long) taoBaoCouponDao.save(taoBaoCoupon);
|
| | | taoBaoCouponMapper.insert(taoBaoCoupon);
|
| | | minId = taoBaoCoupon.getId();
|
| | | } else {
|
| | | taoBaoCouponDao.save(taoBaoCoupon);
|
| | | taoBaoCouponMapper.insert(taoBaoCoupon);
|
| | | }
|
| | | ii++;
|
| | | }
|
| | |
|
| | | final long endId = minId;
|
| | | taoBaoCouponDao.excute(new HibernateCallback() {
|
| | |
|
| | | public Object doInHibernate(Session session) throws HibernateException {
|
| | | Query query = session.createSQLQuery("delete from yeshi_ec_taobao_coupon where id < ? ");
|
| | | query.setParameter(0, endId);
|
| | | return query.executeUpdate();
|
| | | }
|
| | | });
|
| | | |
| | | taoBaoCouponMapper.deleteBeforeCouponInfo(minId);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<TaoBaoCoupon> getTaoBaoCouponList(String key, int page) {
|
| | | int start = (page - 1) * Constant.PAGE_SIZE;
|
| | | List<TaoBaoCoupon> list = taoBaoCouponDao.list(
|
| | | "from TaoBaoCoupon tbc where tbc.title like ? order by tbc.orderby,tbc.id ", start, Constant.PAGE_SIZE,
|
| | | new Serializable[] { "%" + key + "%" });
|
| | | return list;
|
| | | return taoBaoCouponMapper.getTaoBaoCouponList((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, key);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public int getCount(String key) {
|
| | | Long count = taoBaoCouponDao.getCount("select count(*) from TaoBaoCoupon tbc where tbc.title like ? ",
|
| | | new Serializable[] { "%" + key + "%" });
|
| | | return count.intValue();
|
| | | return taoBaoCouponMapper.getCount(key);
|
| | | }
|
| | |
|
| | | public void deleteTaoBaoCoupons(long[] ids) {
|
| | | for (long id : ids) {
|
| | | taoBaoCouponDao.delete(new TaoBaoCoupon(id));
|
| | | }
|
| | | }
|
| | |
|
| | | public TaoBaoCoupon getaoBaoCoupon(long id) {
|
| | | TaoBaoCoupon find = taoBaoCouponDao.find(TaoBaoCoupon.class, id);
|
| | | return find;
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | public void updatetaoBaoCoupon(TaoBaoCoupon find) {
|
| | | taoBaoCouponDao.update(find);
|
| | | }
|
| | |
|
| | | public List<TaoBaoCoupon> getTaoBaoCouponListByClassKeys(String[] keys, int page) {
|
| | | int start = (page - 1) * Constant.PAGE_SIZE;
|
| | | StringBuffer sb = new StringBuffer("from TaoBaoCoupon tbc where tbc.classNames like ? ");
|
| | | int keyCount = keys.length;
|
| | | for (int i = 0; i < keyCount; i++) {
|
| | | if (i != 0) {
|
| | | sb.append(" or tbc.classNames like ? ");
|
| | | }
|
| | | keys[i] = "%" + keys[i] + "%";
|
| | | }
|
| | | sb.append(" order by tbc.biz30day desc ");
|
| | | List<TaoBaoCoupon> list = taoBaoCouponDao.list(sb.toString(), start, Constant.PAGE_SIZE, keys);
|
| | | // if(list.size() > 0){
|
| | | // String proportion =
|
| | | // hongBaoManageService.get(Constant.HONGBAO_GOODS_PROPORTION);
|
| | | // double pd=Double.parseDouble(proportion)/100;
|
| | | // for (TaoBaoCoupon taoBaoCoupon : list) {
|
| | | // double tk = (taoBaoCoupon.getTkRate()/100) * pd;
|
| | | // BigDecimal zkPrice = taoBaoCoupon.getZkPrice();
|
| | | // BigDecimal hb = BigDecimalUtil.mul2(zkPrice, new BigDecimal(tk));
|
| | | // taoBaoCoupon.setHongbao(hb);
|
| | | // }
|
| | | // }
|
| | | return list;
|
| | |
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<TaoBaoCoupon> getTaoBaoCouponListBykeys(List<String> searchKeys, int page) {
|
| | |
|
| | | if (searchKeys == null || searchKeys.size() == 0) {
|
| | | searchKeys = new ArrayList<String>();
|
| | | searchKeys.add("");
|
| | | }
|
| | |
|
| | | StringBuffer sb = new StringBuffer("from TaoBaoCoupon tbc where ");
|
| | | int ii = 0;
|
| | | for (String key : searchKeys) {
|
| | | key = key.replaceAll(" ", "%");
|
| | | if (ii == 0) {
|
| | | sb.append("( tbc.title like '%" + key + "%' ");
|
| | | } else {
|
| | | sb.append(" or tbc.title like '%" + key + "%' ");
|
| | | }
|
| | | ii++;
|
| | | }
|
| | | sb.append(") and tbc.showType = 3 ");
|
| | | // sb.append(" order by tbc.biz30day desc ");
|
| | | int start = (page - 1) * Constant.PAGE_SIZE;
|
| | | return taoBaoCouponDao.list(sb.toString(), start, Constant.PAGE_SIZE, new Serializable[] {});
|
| | | |
| | | return taoBaoCouponMapper.getTaoBaoCouponListBykeys((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE,searchKeys);
|
| | | }
|
| | |
|
| | | public TaoBaoCoupon getTaoBaoCouponByActionId(String id) {
|
| | | List<TaoBaoCoupon> list = taoBaoCouponDao.list("from TaoBaoCoupon tbc where tbc.auctionId = ? ",
|
| | | new Serializable[] { id });
|
| | | if (list.size() > 0) {
|
| | | return list.get(0);
|
| | | }
|
| | | return null;
|
| | | }
|
| | |
|
| | | public int getCount(List<String> searchKeys) {
|
| | |
|
| | | if (searchKeys == null || searchKeys.size() == 0) {
|
| | | return 0;
|
| | | }
|
| | |
|
| | | StringBuffer sb = new StringBuffer();
|
| | | sb.append("select count(tbc.id) from TaoBaoCoupon tbc where ");
|
| | | int ii = 0;
|
| | | for (String key : searchKeys) {
|
| | | key = key.replaceAll(" ", "%");
|
| | | if (ii == 0) {
|
| | | sb.append("( tbc.title like '%" + key + "%' ");
|
| | | } else {
|
| | | sb.append(" or tbc.title like '%" + key + "%' ");
|
| | | }
|
| | | ii++;
|
| | | }
|
| | | sb.append(") and tbc.showType = 3 ");
|
| | | Long count = taoBaoCouponDao.getCount(sb.toString());
|
| | | return count.intValue();
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public TaoBaoCoupon getTaoBaoCouponByAuctionId(long id) {
|
| | | List<TaoBaoCoupon> findList = taoBaoCouponDao.list("from TaoBaoCoupon coupon where coupon.auctionId=" + id);
|
| | | if (findList != null && findList.size() > 0)
|
| | | return findList.get(0);
|
| | | return null;
|
| | | public int getCount(List<String> searchKeys) {
|
| | | if (searchKeys == null || searchKeys.size() == 0) {
|
| | | searchKeys = new ArrayList<String>();
|
| | | searchKeys.add("");
|
| | | }
|
| | | |
| | | return taoBaoCouponMapper.countTaoBaoCouponListBykeys(searchKeys);
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public TaoBaoCoupon getTaoBaoCouponByActionId(String auctionId) {
|
| | | return taoBaoCouponMapper.getTaoBaoCouponByActionId(auctionId);
|
| | | }
|
| | |
|
| | |
|
| | | /**
|
| | | * 采用redis做缓存
|
| | |
| | | package com.yeshi.fanli.service.impl.goods;
|
| | |
|
| | | import java.io.Serializable;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.hibernate.HibernateException;
|
| | | import org.hibernate.Session;
|
| | | import org.springframework.orm.hibernate4.HibernateCallback;
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.dao.taobao.TaoBaoLinkDao;
|
| | | import com.yeshi.fanli.dao.mybatis.taobao.TaoBaoLinkMapper;
|
| | | import com.yeshi.fanli.entity.system.BusinessSystem;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoLink;
|
| | | import com.yeshi.fanli.service.inter.goods.TaoBaoLinkService;
|
| | |
| | | public class TaoBaoLinkServiceImpl implements TaoBaoLinkService {
|
| | |
|
| | | @Resource
|
| | | private TaoBaoLinkDao dao;
|
| | | private TaoBaoLinkMapper taoBaoLinkMapper;
|
| | | |
| | |
|
| | | public TaoBaoLink find(long auctionId, BusinessSystem system) {
|
| | | List<TaoBaoLink> list = dao.list("from TaoBaoLink tbk where tbk.auctionId = ? and tbk.system.id = ? ", new Serializable[]{auctionId,system.getId()});
|
| | | if(list.size() >0){
|
| | | return list.get(0);
|
| | | if (system == null) {
|
| | | return null;
|
| | | }
|
| | | return null;
|
| | | return taoBaoLinkMapper.getTaoBaoLink(auctionId, system.getId());
|
| | | }
|
| | |
|
| | | public void save(final TaoBaoLink tbk) {
|
| | | dao.excute(new HibernateCallback() {
|
| | |
|
| | | public Object doInHibernate(Session session)
|
| | | throws HibernateException {
|
| | | session.getTransaction().begin();
|
| | | session.save(tbk);
|
| | | session.getTransaction().commit();
|
| | | return null;
|
| | | }
|
| | | });
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.impl.homemodule;
|
| | |
|
| | | import java.io.InputStream;
|
| | | import java.text.ParseException;
|
| | | import java.text.SimpleDateFormat;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | | import java.util.UUID;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | | import javax.transaction.Transactional;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.web.multipart.MultipartFile;
|
| | | import org.yeshi.utils.tencentcloud.COSManager;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.homemodule.FloatADMapper;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.FloatAD;
|
| | | import com.yeshi.fanli.entity.common.JumpDetailV2;
|
| | | import com.yeshi.fanli.exception.FloatADException;
|
| | | import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
|
| | | import com.yeshi.fanli.service.inter.homemodule.FloatADService;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | | @Service
|
| | | public class FloatADServiceImpl implements FloatADService {
|
| | |
|
| | | @Resource
|
| | | private FloatADMapper floatADMapper;
|
| | | |
| | | @Resource
|
| | | private JumpDetailV2Service jumpDetailV2Service;
|
| | | |
| | | |
| | | @Override
|
| | | public void saveObject(MultipartFile file, FloatAD record, String jumpType) throws FloatADException, Exception{
|
| | | |
| | | String position = record.getPosition();
|
| | | if (position == null || position.trim().length() == 0) {
|
| | | throw new FloatADException(1, "使用位置不能为空");
|
| | | }
|
| | | |
| | | String showMode = record.getShowMode();
|
| | | if (showMode == null || showMode.trim().length() == 0) {
|
| | | throw new FloatADException(1, "显示方式不能为空");
|
| | | }
|
| | | |
| | | String params = record.getParams();
|
| | | if ((params != null && params.trim().length() == 0) || "null".equalsIgnoreCase(params) ) {
|
| | | record.setParams(null);
|
| | | }
|
| | | |
| | | if (!StringUtil.isNullOrEmpty(jumpType)) {
|
| | | List<JumpDetailV2> listByType = jumpDetailV2Service.listByType(jumpType);
|
| | | if (listByType !=null && listByType.size() > 0) {
|
| | | record.setJumpDetail(listByType.get(0));
|
| | | } |
| | | }
|
| | | |
| | | try {
|
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
| | | Date startTime = record.getStartTime();
|
| | | if (startTime != null) {
|
| | | record.setStartTime(format.parse(format.format(startTime)));
|
| | | }
|
| | | |
| | | Date endTime = record.getEndTime();
|
| | | if (endTime != null) {
|
| | | record.setEndTime(format.parse(format.format(endTime)));
|
| | | }
|
| | | |
| | | } catch (ParseException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | |
| | | String picture = null;
|
| | | if (file != null) {
|
| | | picture = uploadPicture(file);
|
| | | }
|
| | | |
| | | Long id = record.getId();
|
| | | if (id == null) {
|
| | | int maxOrder = floatADMapper.countByPosition(position);
|
| | | record.setPicture(picture);
|
| | | record.setState(0);
|
| | | record.setOrder(maxOrder + 1);
|
| | | record.setJumpNeedLogin(false);
|
| | | record.setCreateTime(new Date());
|
| | | record.setUpdateTime(new Date());
|
| | | floatADMapper.insert(record);
|
| | | } else {
|
| | | // 修改
|
| | | FloatAD resultObj = floatADMapper.selectByPrimaryKey(id);
|
| | | if (resultObj == null) {
|
| | | throw new FloatADException(1, "修改内容已不存在");
|
| | | }
|
| | | |
| | | if (picture != null && picture.trim().length() > 0) {
|
| | | record.setPicture(picture);
|
| | | // 删除已存在图片
|
| | | removePicture(resultObj);
|
| | | } else {
|
| | | record.setPicture(resultObj.getPicture());
|
| | | }
|
| | | |
| | | record.setOrder(resultObj.getOrder());
|
| | | record.setCreateTime(resultObj.getCreateTime());
|
| | | record.setUpdateTime(new Date());
|
| | | floatADMapper.updateByPrimaryKey(record);
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | @Transactional
|
| | | public void updateOrder(Long id, Integer moveType) throws FloatADException {
|
| | | |
| | | if (id == null || moveType == null || (!moveType.equals(1) && !moveType.equals(-1))) {
|
| | | throw new FloatADException(1, "请传递正确参数");
|
| | | }
|
| | | |
| | | FloatAD resultObj = floatADMapper.selectByPrimaryKey(id);
|
| | | if (resultObj == null) {
|
| | | throw new FloatADException(1, "此内容已不存在");
|
| | | }
|
| | | |
| | | Integer order = resultObj.getOrder();
|
| | | String position = resultObj.getPosition();
|
| | | |
| | | // 获取交换对象
|
| | | FloatAD exchangeObject = floatADMapper.getByAdjoinOrder(position, order, moveType);
|
| | | if (exchangeObject == null) {
|
| | | if (moveType == 1) {
|
| | | throw new FloatADException(1, "在相同使用地方中优先级已经最低了");
|
| | | } else {
|
| | | throw new FloatADException(1, "在相同使用地方中优先级已经最高了");
|
| | | }
|
| | | }
|
| | | |
| | | resultObj.setOrder(exchangeObject.getOrder());
|
| | | exchangeObject.setOrder(order);
|
| | | |
| | | floatADMapper.updateByPrimaryKey(resultObj);
|
| | | floatADMapper.updateByPrimaryKey(exchangeObject);
|
| | | }
|
| | | |
| | | @Override
|
| | | @Transactional
|
| | | public int deleteByPrimaryKeyList(List<Long> list) throws Exception{
|
| | | |
| | | List<FloatAD> listSwiper = floatADMapper.ListByPrimaryKey(list);
|
| | | if (listSwiper == null || listSwiper.size() == 0) {
|
| | | return 0;
|
| | | }
|
| | | |
| | | // 删除已存在图片
|
| | | for (FloatAD floatAD: listSwiper) {
|
| | | removePicture(floatAD);
|
| | | }
|
| | | |
| | | return floatADMapper.deleteByPrimaryKeyList(list);
|
| | | }
|
| | |
|
| | |
|
| | | /**
|
| | | * 上传图片
|
| | | * @param file
|
| | | * @return
|
| | | * @throws Exception
|
| | | */
|
| | | public String uploadPicture(MultipartFile file) throws Exception {
|
| | | |
| | | // 文件解析 |
| | | InputStream inputStream = file.getInputStream();
|
| | | String contentType = file.getContentType();
|
| | | String type = contentType.substring(contentType.indexOf("/") + 1);
|
| | | |
| | | // 文件路径
|
| | | String filePath="/img/FloatAD/"+UUID.randomUUID().toString().replace("-", "") + "." + type;
|
| | | // 执行上传
|
| | | String fileLink= COSManager.getInstance().uploadFile(inputStream, filePath).getUrl();
|
| | | |
| | | return fileLink;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 删除图片-不更新数据库
|
| | | * @param record
|
| | | * @throws Exception
|
| | | */
|
| | | public void removePicture(FloatAD record) throws Exception {
|
| | | String picture = record.getPicture();
|
| | | if (picture != null && picture.trim().length() > 0) {
|
| | | COSManager.getInstance().deleteFile(picture);
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | public List<FloatAD> listQuery(long start, int count, String key, Integer state) throws FloatADException {
|
| | | |
| | | List<FloatAD> listQuery = floatADMapper.listQuery(start, count, key, state);
|
| | | if (listQuery == null || listQuery.size() == 0) {
|
| | | return listQuery;
|
| | | }
|
| | | |
| | | for (FloatAD floatAD : listQuery) {
|
| | | |
| | | String params = floatAD.getParams();
|
| | | if (params == null) {
|
| | | floatAD.setParams("");
|
| | | }
|
| | | |
| | | JumpDetailV2 jumpDetail = floatAD.getJumpDetail();
|
| | | if (jumpDetail == null) {
|
| | | // 默认未选择
|
| | | jumpDetail = new JumpDetailV2();
|
| | | jumpDetail.setName("-未选择-");
|
| | | jumpDetail.setType("default");
|
| | | } else {
|
| | | jumpDetail = jumpDetailV2Service.selectByPrimaryKey(jumpDetail.getId());
|
| | | } |
| | | |
| | | floatAD.setJumpDetail(jumpDetail);
|
| | | }
|
| | | |
| | | return listQuery;
|
| | | }
|
| | |
|
| | |
|
| | | @Override
|
| | | public long countQuery(String key, Integer state) {
|
| | | return floatADMapper.countQuery(key, state);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public FloatAD getEffectiveFloatAD(String position) {
|
| | | FloatAD floatAD = floatADMapper.getEffectiveFloatAD(position);
|
| | | if (floatAD != null) {
|
| | | JumpDetailV2 jumpDetail = floatAD.getJumpDetail();
|
| | | |
| | | // 查询JumpDetailV2
|
| | | if (jumpDetail != null) {
|
| | | jumpDetail = jumpDetailV2Service.selectByPrimaryKey(jumpDetail.getId());
|
| | | if (jumpDetail != null) {
|
| | | // 跳转界面是否需要登录
|
| | | jumpDetail.setNeedLogin(floatAD.isJumpNeedLogin());
|
| | | }
|
| | | } |
| | | |
| | | floatAD.setJumpDetail(jumpDetail);
|
| | | }
|
| | | return floatAD;
|
| | | }
|
| | | |
| | | }
|
| | |
|
| | |
| | | import org.apache.commons.httpclient.HttpException;
|
| | | import org.apache.commons.httpclient.NameValuePair;
|
| | | import org.apache.commons.httpclient.methods.PostMethod;
|
| | | import org.hibernate.HibernateException;
|
| | | import org.hibernate.Session;
|
| | | import org.springframework.orm.hibernate4.HibernateCallback;
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | | import org.yeshi.utils.HttpUtil;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.TBPidMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.share.PidUserMapper;
|
| | | import com.yeshi.fanli.dao.taobao.TBPidDao;
|
| | | import com.yeshi.fanli.dao.mybatis.taobao.TBPidMapper;
|
| | | import com.yeshi.fanli.entity.taobao.ClientTBPid;
|
| | | import com.yeshi.fanli.entity.taobao.PidUser;
|
| | | import com.yeshi.fanli.entity.taobao.TBPid;
|
| | |
| | |
|
| | | @Service
|
| | | public class TBPidServiceImpl implements TBPidService {
|
| | |
|
| | | @Resource
|
| | | private TBPidDao tbPidDao;
|
| | |
|
| | | @Resource
|
| | | private TBPidMapper tbPidMapper;
|
| | |
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | Long count = (Long) tbPidDao.excute(new HibernateCallback<Long>() {
|
| | |
|
| | | @Override
|
| | | public Long doInHibernate(Session session) throws HibernateException {
|
| | | return Long.parseLong(session.createQuery("select count(*) from TBPid").uniqueResult().toString());
|
| | | }
|
| | | });
|
| | | Long count = tbPidMapper.count();
|
| | | |
| | | String name = "quanqudao_" + count;
|
| | |
|
| | | String cookies = getCookie();
|
| | |
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | Long count = (Long) tbPidDao.excute(new HibernateCallback<Long>() {
|
| | |
|
| | | @Override
|
| | | public Long doInHibernate(Session session) throws HibernateException {
|
| | | return Long.parseLong(session.createQuery("select count(*) from TBPid").uniqueResult().toString());
|
| | | }
|
| | | });
|
| | | Long count = tbPidMapper.count();
|
| | | |
| | | String name = "tuiguang_" + count;
|
| | |
|
| | | String cookies = getCookieBuXin();
|
| | |
| | | tbPid.setCreatetime(System.currentTimeMillis());
|
| | | tbPid.setName(name);
|
| | | tbPid.setPid(pid);
|
| | | tbPidDao.create(tbPid);
|
| | | tbPidMapper.insert(tbPid);
|
| | | return true;
|
| | | } else {
|
| | | System.out.println(result);
|
| | |
| | |
|
| | | public int getCount(String key);
|
| | |
|
| | | public void deleteTaoBaoCoupons(long[] ids);
|
| | |
|
| | | public TaoBaoCoupon getaoBaoCoupon(long id);
|
| | |
|
| | | public TaoBaoCoupon getTaoBaoCouponByAuctionId(long id);
|
| | |
|
| | | public void updatetaoBaoCoupon(TaoBaoCoupon find);
|
| | |
|
| | | public List<TaoBaoCoupon> getTaoBaoCouponListByClassKeys(String[] key, int page);
|
| | |
|
| | | public List<TaoBaoCoupon> getTaoBaoCouponListBykeys(List<String> searchKeys, int page);
|
| | |
|
| | |
| | |
|
| | | TaoBaoLink find(long auctionId, BusinessSystem system);
|
| | |
|
| | | void save(TaoBaoLink tbk);
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.inter.homemodule;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import org.apache.ibatis.annotations.Param;
|
| | | import org.springframework.web.multipart.MultipartFile;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.homemodule.FloatAD;
|
| | | import com.yeshi.fanli.exception.FloatADException;
|
| | | import com.yeshi.fanli.exception.banner.SwiperPictureException;
|
| | |
|
| | | public interface FloatADService {
|
| | |
|
| | |
|
| | | /**
|
| | | * 保存
|
| | | * @param record
|
| | | * @throws FloatADException
|
| | | */
|
| | | public void saveObject(MultipartFile file, FloatAD record, String jumpType) throws FloatADException, Exception;
|
| | |
|
| | | /**
|
| | | * 修改排序
|
| | | * @param id
|
| | | * @param moveType
|
| | | * @throws FloatADException
|
| | | */
|
| | | public void updateOrder(Long id, Integer moveType) throws FloatADException;
|
| | | |
| | | |
| | | /**
|
| | | * 批量删除
|
| | | * |
| | | * @param list 管理id
|
| | | * @return
|
| | | * @throws SwiperPictureException
|
| | | */
|
| | | public int deleteByPrimaryKeyList(List<Long> list) throws Exception;
|
| | |
|
| | |
|
| | | /**
|
| | | * 后端列表查询
|
| | | * |
| | | * @param start
|
| | | * @param count
|
| | | * @param key
|
| | | * @param state
|
| | | * @return
|
| | | */
|
| | | public List<FloatAD> listQuery(@Param("start") long start, @Param("count") int count, @Param("key") String key,
|
| | | @Param("state") Integer state) throws FloatADException;
|
| | |
|
| | | public long countQuery(@Param("key") String key, @Param("state") Integer state);
|
| | |
|
| | | /**
|
| | | * 查询有效的悬浮大图
|
| | | * @return
|
| | | */
|
| | | public FloatAD getEffectiveFloatAD(String position);
|
| | |
|
| | |
|
| | | }
|
| | |
| | | package org.fanli;
|
| | |
|
| | | import org.junit.Ignore;
|
| | | import org.junit.Test;
|
| | | import org.yeshi.utils.mybatis.ColumnParseUtil;
|
| | | import org.yeshi.utils.mybatis.MyBatisMapperUtil;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgOtherDetail;
|
| | | import com.yeshi.fanli.entity.bus.invite.SpreadUserImg;
|
| | | import com.yeshi.fanli.entity.bus.user.LostOrder;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoOrder;
|
| | |
|
| | | @Ignore
|
| | | //@Ignore
|
| | | public class MyBatisProduce {
|
| | |
|
| | | @Test
|
| | | public void test3() {
|
| | | |
| | | MyBatisMapperUtil.createMapper(MsgOtherDetail.class);
|
| | | MyBatisMapperUtil.createMapper(LostOrder.class);
|
| | | // MyBatisMapperUtil.createMapper(TaoBaoUnionAuthRecord.class);
|
| | | }
|
| | |
|
| | |
| | | import com.yeshi.fanli.util.taobao.TaoBaoOrderUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | |
|
| | | @Ignore
|
| | | //@Ignore
|
| | | public class TaoKeTest {
|
| | |
|
| | | public static int count = 0;
|
| | |
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | @Test
|
| | | public void test5() {
|
| | | try {
|
| | | TaoBaoGoodsBrief goods= TaoKeApiUtil.getSimpleGoodsInfo(566534626407L);
|
| | | System.out.println(goods);
|
| | | } catch (TaobaoGoodsDownException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | }
|