Merge remote-tracking branch 'origin/div' into div
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "newHotSearchList")
|
| | | public void newHotSearchList(String callback, Integer pageIndex, String key, Long systemId,
|
| | | public void newHotSearchList(String callback, Integer pageIndex, String key, Long systemId, Integer useType, |
| | | PrintWriter out) {
|
| | |
|
| | | if (pageIndex == null || pageIndex < 1) {
|
| | |
| | | int pageSize = Constant.PAGE_SIZE;
|
| | |
|
| | | try {
|
| | | List<HotSearch> list = hotSearchService.listQuery(pageIndex - 1, pageSize, key, systemId);
|
| | | List<HotSearch> list = hotSearchService.listQuery(pageIndex - 1, pageSize, key, systemId, useType);
|
| | | if (list == null || list.size() == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无更多数据"));
|
| | | return;
|
| | | }
|
| | |
|
| | | int count = hotSearchService.countList(key, systemId);
|
| | | int count = hotSearchService.countList(key, systemId, useType);
|
| | |
|
| | | int totalPage = count % pageSize == 0 ? count / pageSize : count / pageSize + 1;
|
| | | PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
|
| | |
| | | @RequestMapping(value = "getUserOrderList")
|
| | | public void getUserOrderList(String callback, Integer pageIndex, Integer pageSize, Integer keyType,
|
| | | String key, Integer state, Integer type, Integer orderState, String startTime, String endTime,
|
| | | Integer source, PrintWriter out) {
|
| | | Integer sourceType, PrintWriter out) {
|
| | |
|
| | | if (pageIndex == null || pageIndex < 1) {
|
| | | pageIndex = 1;
|
| | |
| | | }
|
| | |
|
| | | try {
|
| | | long count = 0;
|
| | |
|
| | | // 查询列表
|
| | | List<CommonOrderVO> list = commonOrderService.listQuery((pageIndex - 1) * pageSize, pageSize, keyType, key,
|
| | | state, type, orderState, startTime, endTime, source);
|
| | | state, type, orderState, startTime, endTime, sourceType);
|
| | |
|
| | | if (list != null && list.size() > 0) {
|
| | | // 统计总数
|
| | | count = commonOrderService.countQuery(keyType, key, state, type, orderState, startTime, endTime, source);
|
| | | }
|
| | | long count = commonOrderService.countQuery(keyType, key, state, type, orderState, startTime, endTime, sourceType);
|
| | |
|
| | | // 查询是否维权
|
| | | for (CommonOrderVO order : list) {
|
| | |
| | |
|
| | | try {
|
| | | ShareGoodsRecordDTO shareRecord = userShareGoodsRecordService.addRecordGoodsDetail(uid, goodsId,
|
| | | Constant.SOURCE_TYPE_JD);
|
| | | Constant.SOURCE_TYPE_PDD);
|
| | | shareInfo.setShareId(shareRecord.getRedisKey());
|
| | | } catch (Exception e) {
|
| | | try {
|
| | |
| | | history.setUser(new UserInfo(uid));
|
| | | history.setHongbao(shareMoney);
|
| | | history.setCreateTime(new Date());
|
| | | history.setGoodsType(Constant.SOURCE_TYPE_JD);
|
| | | history.setGoodsType(Constant.SOURCE_TYPE_PDD);
|
| | | history.setTkCode(null);
|
| | | history.setLink(null);
|
| | | history.setQuanLink(null);
|
| | |
| | | package com.yeshi.fanli.dao.mybatis.goods; |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.dao.BaseMapper; |
| | | import com.yeshi.fanli.entity.bus.search.HotSearch; |
| | | |
| | | public interface HotSearchMapper extends BaseMapper<HotSearch>{ |
| | | |
| | | /** |
| | | * 查询 |
| | | * @param start |
| | | * @param count |
| | | * @param key |
| | | * @param systemId |
| | | * @return |
| | | */ |
| | | List<HotSearch> listQuery(@Param("start") long start, @Param("count") int count, |
| | | @Param("key") String key, @Param("systemId")Long systemId); |
| | | /** |
| | | * 查询统计 |
| | | * @param key |
| | | * @param systemId |
| | | * @return |
| | | */ |
| | | int countQuery(@Param("key") String key, @Param("systemId")Long systemId); |
| | | package com.yeshi.fanli.dao.mybatis.goods;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import org.apache.ibatis.annotations.Param;
|
| | |
|
| | | import com.yeshi.fanli.dao.BaseMapper;
|
| | | import com.yeshi.fanli.entity.bus.search.HotSearch;
|
| | |
|
| | | public interface HotSearchMapper extends BaseMapper<HotSearch>{
|
| | |
|
| | | /**
|
| | | * 查询
|
| | | * @param start
|
| | | * @param count
|
| | | * @param key
|
| | | * @param systemId
|
| | | * @return
|
| | | */
|
| | | List<HotSearch> listQuery(@Param("start") long start, @Param("count") int count, |
| | | @Param("key") String key, @Param("systemId")Long systemId, @Param("useType")Integer useType);
|
| | | /**
|
| | | * 查询统计
|
| | | * @param key
|
| | | * @param systemId
|
| | | * @return
|
| | | */
|
| | | int countQuery(@Param("key") String key, @Param("systemId")Long systemId, @Param("useType")Integer useType);
|
| | | } |
| | |
| | | package com.yeshi.fanli.dto.jd;
|
| | |
|
| | | public class JDCategoryInfo {
|
| | | private Long cid1;
|
| | | private Long cid2;
|
| | | private Long cid3;
|
| | | private String cid1Name;
|
| | | private String cid2Name;
|
| | | private String cid3Name;
|
| | | public Long getCid1() {
|
| | | return cid1;
|
| | | }
|
| | | public void setCid1(Long cid1) {
|
| | | this.cid1 = cid1;
|
| | | }
|
| | | public Long getCid2() {
|
| | | return cid2;
|
| | | }
|
| | | public void setCid2(Long cid2) {
|
| | | this.cid2 = cid2;
|
| | | }
|
| | | public Long getCid3() {
|
| | | return cid3;
|
| | | }
|
| | | public void setCid3(Long cid3) {
|
| | | this.cid3 = cid3;
|
| | | }
|
| | | public String getCid1Name() {
|
| | | return cid1Name;
|
| | | }
|
| | | public void setCid1Name(String cid1Name) {
|
| | | this.cid1Name = cid1Name;
|
| | | }
|
| | | public String getCid2Name() {
|
| | | return cid2Name;
|
| | | }
|
| | | public void setCid2Name(String cid2Name) {
|
| | | this.cid2Name = cid2Name;
|
| | | }
|
| | | public String getCid3Name() {
|
| | | return cid3Name;
|
| | | }
|
| | | public void setCid3Name(String cid3Name) {
|
| | | this.cid3Name = cid3Name;
|
| | | }
|
| | | import java.io.Serializable;
|
| | |
|
| | | public class JDCategoryInfo implements Serializable {
|
| | | /**
|
| | | * |
| | | */
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | private Long cid1;
|
| | | private Long cid2;
|
| | | private Long cid3;
|
| | | private String cid1Name;
|
| | | private String cid2Name;
|
| | | private String cid3Name;
|
| | |
|
| | | public Long getCid1() {
|
| | | return cid1;
|
| | | }
|
| | |
|
| | | public void setCid1(Long cid1) {
|
| | | this.cid1 = cid1;
|
| | | }
|
| | |
|
| | | public Long getCid2() {
|
| | | return cid2;
|
| | | }
|
| | |
|
| | | public void setCid2(Long cid2) {
|
| | | this.cid2 = cid2;
|
| | | }
|
| | |
|
| | | public Long getCid3() {
|
| | | return cid3;
|
| | | }
|
| | |
|
| | | public void setCid3(Long cid3) {
|
| | | this.cid3 = cid3;
|
| | | }
|
| | |
|
| | | public String getCid1Name() {
|
| | | return cid1Name;
|
| | | }
|
| | |
|
| | | public void setCid1Name(String cid1Name) {
|
| | | this.cid1Name = cid1Name;
|
| | | }
|
| | |
|
| | | public String getCid2Name() {
|
| | | return cid2Name;
|
| | | }
|
| | |
|
| | | public void setCid2Name(String cid2Name) {
|
| | | this.cid2Name = cid2Name;
|
| | | }
|
| | |
|
| | | public String getCid3Name() {
|
| | | return cid3Name;
|
| | | }
|
| | |
|
| | | public void setCid3Name(String cid3Name) {
|
| | | this.cid3Name = cid3Name;
|
| | | }
|
| | | }
|
| | |
| | | package com.yeshi.fanli.dto.jd;
|
| | |
|
| | | import java.io.Serializable;
|
| | | import java.math.BigDecimal;
|
| | |
|
| | | public class JDCouponInfo {
|
| | | public class JDCouponInfo implements Serializable {
|
| | | |
| | | private static final long serialVersionUID = 1L;
|
| | | |
| | | |
| | | private Integer bindType;//券种类 (优惠券种类:0 - 全品类,1 - 限品类(自营商品),2 - 限店铺,3 - 店铺限商品券)
|
| | | private BigDecimal discount;//券面额
|
| | | private String link;//券链接
|
| | |
| | | package com.yeshi.fanli.dto.jd;
|
| | |
|
| | | import java.io.Serializable;
|
| | | import java.util.List;
|
| | |
|
| | | public class JDFilter {
|
| | | public class JDFilter implements Serializable{
|
| | |
|
| | | /**
|
| | | * |
| | | */
|
| | | private static final long serialVersionUID = 1L;
|
| | | |
| | | |
| | | // 佣金
|
| | | public final static String SORTNAME_COMMISSION = "commission";
|
| | | // 佣金比例
|
| | |
| | | package com.yeshi.fanli.dto.jd;
|
| | |
|
| | | public class JDShopInfo {
|
| | | import java.io.Serializable;
|
| | |
|
| | | public class JDShopInfo implements Serializable{
|
| | | /**
|
| | | * |
| | | */
|
| | | private static final long serialVersionUID = 1L;
|
| | | |
| | | private Integer shopId;
|
| | | private String shopName;
|
| | | public Integer getShopId() {
|
| | |
| | | WHERE 1=1 |
| | | <if test="systemId != null">AND sp.`system_id` = #{systemId}</if> |
| | | <if test="key != null and key != ''">AND hc.`name` LIKE '%#{key}%'</if> |
| | | <if test="useType != null">AND hc.`use_type` = #{useType}</if> |
| | | )A |
| | | LEFT JOIN yeshi_ec_hot_search h ON A.hid = h.`id` |
| | | ORDER BY h.`orderby` DESC |
| | |
| | | <if test="key != null and key != ''"> |
| | | AND hc.`name` LIKE '%#{key}%' |
| | | </if> |
| | | <if test="useType != null">AND hc.`use_type` = #{useType}</if> |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | |
|
| | |
|
| | | @Override
|
| | | public List<HotSearch> listQuery(int start, int count, String key, Long systemId) throws Exception {
|
| | | public List<HotSearch> listQuery(int start, int count, String key, Long systemId, Integer useType) throws Exception {
|
| | |
|
| | | List<HotSearch> listObj = hotSearchMapper.listQuery(start, count, key, systemId);
|
| | | List<HotSearch> listObj = hotSearchMapper.listQuery(start, count, key, systemId, useType);
|
| | |
|
| | | if (listObj == null || listObj.size() == 0) {
|
| | | return null;
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public int countList(String key, Long systemId) {
|
| | | return hotSearchMapper.countQuery(key, systemId);
|
| | | public int countList(String key, Long systemId, Integer useType) {
|
| | | return hotSearchMapper.countQuery(key, systemId, useType);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | |
|
| | | @Override
|
| | | public void isCommonTemplateRightPDD(String template) throws ShareGoodsTextTemplateException {
|
| | | String[] keys = new String[] { "{标题}", "{商品原价}", "{月销量}", "{短链接}", "{多多口令}" };
|
| | | String[] keys = new String[] { "{标题}", "{商品原价}", "{月销量}", "{短链接}"};
|
| | | int keysCount = 0;
|
| | | for (String key : keys)
|
| | | if (template != null && template.contains(key))
|
| | |
| | | if (!hasCoupon) {
|
| | | template = template.replace("{标题}", goods.getGoodsName()).replace("{商品原价}", BigDecimalUtil.getWithNoZera(price).toString())
|
| | | .replace("{总销量}", goods.getSalesTip()).replace("{短链接}", shortLink);
|
| | | if (StringUtil.isNullOrEmpty(token)) {
|
| | | template = template.replace("复制本条信息,{多多口令}打开拼多多", "点击链接,打开拼多多");
|
| | | } else {
|
| | | template = template.replace("{多多口令}", token);
|
| | | }
|
| | | } else {
|
| | | BigDecimal amount = MoneyBigDecimalUtil.div(new BigDecimal(goods.getCouponDiscount()), hundred);
|
| | | template = template.replace("{标题}", goods.getGoodsName()).replace("{商品原价}", BigDecimalUtil.getWithNoZera(price).toString())
|
| | | .replace("{总销量}", goods.getSalesTip()).replace("{短链接}", shortLink)
|
| | | .replace("{优惠券面额}", BigDecimalUtil.getWithNoZera(amount).toString())
|
| | | .replace("{优惠券价}", BigDecimalUtil.getWithNoZera(PinDuoDuoUtil.getQuanPrice(goods)).toString());
|
| | | }
|
| | | |
| | | if (StringUtil.isNullOrEmpty(token)) {
|
| | | template = template.replace("{多多口令}打开拼多多,", "");
|
| | | } else {
|
| | | template = template.replace("{多多口令}", token);
|
| | | |
| | | if (StringUtil.isNullOrEmpty(token)) {
|
| | | template = template.replace("{多多口令}", "");
|
| | | } else {
|
| | | template = template.replace("{多多口令}", token);
|
| | | }
|
| | | }
|
| | |
|
| | | return template;
|
| | |
| | |
|
| | | void updateHotSearch(HotSearch hotSearch);
|
| | |
|
| | | public List<HotSearch> listQuery(int start, int count, String key, Long systemId) throws Exception;
|
| | | public List<HotSearch> listQuery(int start, int count, String key, Long systemId, Integer useType) throws Exception;
|
| | |
|
| | | int countList(String key, Long systemId);
|
| | | int countList(String key, Long systemId, Integer useType);
|
| | |
|
| | | }
|
| | |
| | | textStyleVO.setContent("京东自营");
|
| | | textStyleVO.setColor("#E42219");
|
| | | labels.add(textStyleVO);
|
| | | goodsInfo.setLabels(labels);
|
| | | }
|
| | | // 拼团价
|
| | | JDPingouInfo pinGouInfo = otherDTO.getPinGouInfo();
|
| | |
| | | }
|
| | | ClientTextStyleVO textStyleVO = new ClientTextStyleVO();
|
| | | textStyleVO.setContent("拼购");
|
| | | textStyleVO.setColor("#FF9600");
|
| | | textStyleVO.setColor("#E42219");
|
| | | labels.add(textStyleVO);
|
| | | goodsInfo.setLabels(labels);
|
| | | } else {
|
| | | goodsInfo.setPriceName("京东价");
|
| | | }
|
| | | goodsInfo.setLabels(labels);
|
| | | } else if (goodsType == Constant.SOURCE_TYPE_PDD) {
|
| | | goodsInfo.setSalesType(4); // 总销量
|
| | | goodsInfo.setPriceName("拼团价");
|
| | |
| | | // 京东自营标签
|
| | | String owner = goods.getOwner();
|
| | | if (!StringUtil.isNullOrEmpty(owner) && "g".equalsIgnoreCase(owner)) {
|
| | | goodsInfo.setShopType(21); // 京东自营
|
| | | if (labels == null) {
|
| | | labels = new ArrayList<ClientTextStyleVO>();
|
| | | }
|
| | |
| | | textStyleVO.setContent("京东自营");
|
| | | textStyleVO.setColor("#E42219");
|
| | | labels.add(textStyleVO);
|
| | | goodsInfo.setLabels(labels);
|
| | | goodsInfo.setShopType(21); // 京东自营
|
| | | } else {
|
| | | goodsInfo.setShopType(20); // 京东
|
| | | }
|
| | |
| | | }
|
| | | ClientTextStyleVO textStyleVO = new ClientTextStyleVO();
|
| | | textStyleVO.setContent("拼购");
|
| | | textStyleVO.setColor("#FF9600");
|
| | | textStyleVO.setColor("#E42219");
|
| | | labels.add(textStyleVO);
|
| | | goodsInfo.setLabels(labels);
|
| | | } else {
|
| | | goodsInfo.setZkPrice(goods.getPrice());
|
| | | goodsInfo.setPriceName("京东价");
|
| | | }
|
| | | goodsInfo.setLabels(labels);
|
| | |
|
| | | // 店铺信息
|
| | | JDShopInfo shopInfo = goods.getShopInfo();
|