Commit c33d80cd authored by gaia's avatar gaia

Merge remote-tracking branch 'origin/quanku_0930' into release_pre_20230927140710

parents ef31384d 78bc7b85
......@@ -74,7 +74,7 @@ public class CoinVo implements Entity {
/**
* 成交时间
*/
private String bidTime;
private Date bidTime;
/**
* 备注说明
......
......@@ -4,12 +4,14 @@ import com.wwdz.ch.core.consts.ItemStateEnum;
import com.wwdz.ch.core.util.PriceUtil;
import com.wwdz.ch.db.domain.Item;
import com.xxdxxs.entity.Entity;
import com.xxdxxs.utils.DateUtils;
import com.xxdxxs.utils.EntityMapper;
import lombok.Data;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import java.util.Arrays;
import java.util.Date;
import java.util.Objects;
@Data
......@@ -93,6 +95,11 @@ public class ItemVo implements Entity {
private String topImage;
/**
* 成交时间
*/
private String bidTime;
public Integer getCid() {
return cid;
......@@ -159,6 +166,7 @@ public class ItemVo implements Entity {
item.setImages(com.qiniu.util.StringUtils.join(images, ";"));
item.setIsOnSale(this.isOnSale);
item.setIsStd(this.isStd);
item.setBidTime(StringUtils.hasLength(this.bidTime)? DateUtils.parseString(this.bidTime):null);
if (!ObjectUtils.isEmpty(this.price)) {
item.setPrice((long)(this.price*100L));
}
......@@ -181,6 +189,7 @@ public class ItemVo implements Entity {
itemVo.setSort(item.getSort());
itemVo.setShareImage(item.getShareImage());
itemVo.setDetail(item.getDetail());
itemVo.setBidTime(item.getBidTime()!=null?DateUtils.toString(item.getBidTime()):"");
if (!StringUtils.isEmpty(item.getImages())){
itemVo.setImages(item.getImages().split(";"));
}
......
......@@ -19,6 +19,7 @@ import com.wwdz.ch.db.domain.OperateLog;
import com.wwdz.ch.db.dto.request.CoinRequestDto;
import com.wwdz.ch.db.dao.CategoryDao;
import com.wwdz.ch.db.dto.request.CroppingRecordRequestDto;
import com.xxdxxs.utils.DateUtils;
import com.xxdxxs.utils.EntityMapper;
import com.xxdxxs.utils.JsonUtils;
import com.xxdxxs.utils.StringUtils;
......@@ -109,6 +110,7 @@ public class ItemServiceImpl implements ItemService {
try {
Item item = new Item();
EntityMapper.copyAttribute(coinRequestDto, item);
item.setBidTime(StringUtils.hasLength(coinRequestDto.getBidTime())? DateUtils.parseString(coinRequestDto.getBidTime()):null);
item.setIsStd(coinRequestDto.getIsStd() == 0 ? false : true);
item.setImages(com.qiniu.util.StringUtils.join(coinRequestDto.getImages(), ";"));
item.setName(coinRequestDto.getName());
......
......@@ -131,7 +131,7 @@ public class ImportNephriteDataJob {
item.setSourceType(CommonEnum.SourceTypeEnum.SYSTEM_GET.getCode());
item.setUpdateTime(time);
item.setIsDeleted(false);
item.setBidTime(bidTime);
item.setBidTime(StringUtils.hasLength(bidTime)?DateUtils.parseString(bidTime):null);
item.setRemark(null);
item.setState(ItemStateEnum.PENDING.getCode());
item.setOriginalSourceUrl(null);
......
......@@ -96,7 +96,7 @@ public class SynCoinJob {
item.setSourceType(CommonEnum.SourceTypeEnum.SYSTEM_GET.getCode());
item.setUpdateTime(coins.getUpdated());
item.setIsDeleted(false);
item.setBidTime("");
item.setBidTime(coins.getBidTime());
item.setRemark(null);
item.setState(ItemStateEnum.PENDING.getCode());
item.setOriginalExtra(coins.getExtra());
......
......@@ -132,7 +132,7 @@ public class MediaUtil {
public static Map<String, Object> getAspect(String image) {
Map<String, Object> map = new HashMap<>();
String[] _image = image.split("_");
String[] infoImage = _image[1].split("\\.");
String[] infoImage = _image[_image.length - 1].split("\\.");
String[] result = infoImage[0].split("x");
map.put("width", result[0]);
map.put("height", result[1]);
......
......@@ -3,9 +3,11 @@ package com.wwdz.ch.core.util;
import com.google.gson.Gson;
import com.wwdz.ch.db.domain.Item;
import com.xxdxxs.utils.DateUtils;
import com.xxdxxs.utils.JsonUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import java.io.Serializable;
......@@ -110,7 +112,9 @@ public class ZincUtil {
item.setName(rawData.get("name").toString());
item.setPrice(((Double)rawData.get("price")).longValue());
item.setImages(rawData.get("images").toString());
item.setBidTime(rawData.get("bid_time").toString());
if (!ObjectUtils.isEmpty(rawData.get("bid_time"))) {
item.setBidTime(DateUtils.parseString(rawData.get("bid_time").toString()));
}
item.setCid(((Double)rawData.get("cid")).intValue());
item.setDetail(rawData.get("detail").toString());
item.setExtra(rawData.get("extra").toString());
......
......@@ -76,7 +76,7 @@ public class ItemOfEs implements Entity {
/**
* 成交时间
*/
private String bidTime;
private Date bidTime;
/**
* 备注说明
......
package com.wwdz.ch.db.domain;
import com.xxdxxs.entity.Entity;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import com.xxdxxs.entity.Entity;
import lombok.Data;
/**
* @author shiyu
* @date 2023/09/15
* @date 2023/09/27
*/
@Data
public class Item implements Entity {
private Long id;
/**
* 商品名称
* 钱币名称
*/
private String name;
/**
* 商品所属类目ID
* 钱币所属类目ID
*/
private Integer cid;
......@@ -75,10 +76,7 @@ public class Item implements Entity {
*/
private Boolean isDeleted;
/**
* 成交时间
*/
private String bidTime;
private Date bidTime;
/**
* 备注说明
......@@ -96,7 +94,7 @@ public class Item implements Entity {
private String originalSourceUrl;
/**
* 来源7(1,2,3,,8,10,11):中国的
* 来源(1,2,3,7,8,10,11):中国的
*/
private Integer source;
......@@ -111,17 +109,17 @@ public class Item implements Entity {
private Integer viewPermission;
/**
* 商品额外信息
* 钱币额外信息
*/
private String extra;
/**
* 商品图片,分号分隔
* 商品图片分号分隔
*/
private String images;
/**
* 商品视频, 分号分隔
* 商品视频,分号分隔
*/
private String videos;
......@@ -265,7 +263,7 @@ public class Item implements Entity {
sourceType("source_type", "sourceType", "INTEGER", false),
updateTime("update_time", "updateTime", "TIMESTAMP", false),
isDeleted("is_deleted", "isDeleted", "BIT", false),
bidTime("bid_time", "bidTime", "VARCHAR", false),
bidTime("bid_time", "bidTime", "TIMESTAMP", false),
remark("remark", "remark", "VARCHAR", false),
state("state", "state", "INTEGER", true),
originalSourceUrl("original_source_url", "originalSourceUrl", "VARCHAR", false),
......
......@@ -1904,7 +1904,7 @@ public class ItemExample {
return (Criteria) this;
}
public Criteria andBidTimeEqualTo(String value) {
public Criteria andBidTimeEqualTo(Date value) {
addCriterion("bid_time =", value, "bidTime");
return (Criteria) this;
}
......@@ -1921,7 +1921,7 @@ public class ItemExample {
return (Criteria) this;
}
public Criteria andBidTimeNotEqualTo(String value) {
public Criteria andBidTimeNotEqualTo(Date value) {
addCriterion("bid_time <>", value, "bidTime");
return (Criteria) this;
}
......@@ -1938,7 +1938,7 @@ public class ItemExample {
return (Criteria) this;
}
public Criteria andBidTimeGreaterThan(String value) {
public Criteria andBidTimeGreaterThan(Date value) {
addCriterion("bid_time >", value, "bidTime");
return (Criteria) this;
}
......@@ -1955,7 +1955,7 @@ public class ItemExample {
return (Criteria) this;
}
public Criteria andBidTimeGreaterThanOrEqualTo(String value) {
public Criteria andBidTimeGreaterThanOrEqualTo(Date value) {
addCriterion("bid_time >=", value, "bidTime");
return (Criteria) this;
}
......@@ -1972,7 +1972,7 @@ public class ItemExample {
return (Criteria) this;
}
public Criteria andBidTimeLessThan(String value) {
public Criteria andBidTimeLessThan(Date value) {
addCriterion("bid_time <", value, "bidTime");
return (Criteria) this;
}
......@@ -1989,7 +1989,7 @@ public class ItemExample {
return (Criteria) this;
}
public Criteria andBidTimeLessThanOrEqualTo(String value) {
public Criteria andBidTimeLessThanOrEqualTo(Date value) {
addCriterion("bid_time <=", value, "bidTime");
return (Criteria) this;
}
......@@ -2006,32 +2006,22 @@ public class ItemExample {
return (Criteria) this;
}
public Criteria andBidTimeLike(String value) {
addCriterion("bid_time like", value, "bidTime");
return (Criteria) this;
}
public Criteria andBidTimeNotLike(String value) {
addCriterion("bid_time not like", value, "bidTime");
return (Criteria) this;
}
public Criteria andBidTimeIn(List<String> values) {
public Criteria andBidTimeIn(List<Date> values) {
addCriterion("bid_time in", values, "bidTime");
return (Criteria) this;
}
public Criteria andBidTimeNotIn(List<String> values) {
public Criteria andBidTimeNotIn(List<Date> values) {
addCriterion("bid_time not in", values, "bidTime");
return (Criteria) this;
}
public Criteria andBidTimeBetween(String value1, String value2) {
public Criteria andBidTimeBetween(Date value1, Date value2) {
addCriterion("bid_time between", value1, value2, "bidTime");
return (Criteria) this;
}
public Criteria andBidTimeNotBetween(String value1, String value2) {
public Criteria andBidTimeNotBetween(Date value1, Date value2) {
addCriterion("bid_time not between", value1, value2, "bidTime");
return (Criteria) this;
}
......
......@@ -2,11 +2,11 @@ package com.wwdz.ch.db.mapper;
import com.wwdz.ch.db.domain.Item;
import com.wwdz.ch.db.domain.ItemExample;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface ItemMapper {
long countByExample(ItemExample example);
......
......@@ -15,7 +15,7 @@
<result column="source_type" jdbcType="INTEGER" property="sourceType" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="is_deleted" jdbcType="BIT" property="isDeleted" />
<result column="bid_time" jdbcType="VARCHAR" property="bidTime" />
<result column="bid_time" jdbcType="TIMESTAMP" property="bidTime" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="state" jdbcType="INTEGER" property="state" />
<result column="original_source_url" jdbcType="VARCHAR" property="originalSourceUrl" />
......@@ -216,7 +216,7 @@
#{isStd,jdbcType=BIT}, #{sort,jdbcType=INTEGER}, #{shareImage,jdbcType=VARCHAR},
#{topImage,jdbcType=VARCHAR}, #{price,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP},
#{sourceType,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP}, #{isDeleted,jdbcType=BIT},
#{bidTime,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{state,jdbcType=INTEGER},
#{bidTime,jdbcType=TIMESTAMP}, #{remark,jdbcType=VARCHAR}, #{state,jdbcType=INTEGER},
#{originalSourceUrl,jdbcType=VARCHAR}, #{source,jdbcType=INTEGER}, #{kind,jdbcType=INTEGER},
#{viewPermission,jdbcType=INTEGER}, #{extra,jdbcType=LONGVARCHAR}, #{images,jdbcType=LONGVARCHAR},
#{videos,jdbcType=LONGVARCHAR}, #{detail,jdbcType=LONGVARCHAR}, #{originalExtra,jdbcType=LONGVARCHAR}
......@@ -339,7 +339,7 @@
#{isDeleted,jdbcType=BIT},
</if>
<if test="bidTime != null">
#{bidTime,jdbcType=VARCHAR},
#{bidTime,jdbcType=TIMESTAMP},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
......@@ -425,7 +425,7 @@
is_deleted = #{record.isDeleted,jdbcType=BIT},
</if>
<if test="record.bidTime != null">
bid_time = #{record.bidTime,jdbcType=VARCHAR},
bid_time = #{record.bidTime,jdbcType=TIMESTAMP},
</if>
<if test="record.remark != null">
remark = #{record.remark,jdbcType=VARCHAR},
......@@ -480,7 +480,7 @@
source_type = #{record.sourceType,jdbcType=INTEGER},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
is_deleted = #{record.isDeleted,jdbcType=BIT},
bid_time = #{record.bidTime,jdbcType=VARCHAR},
bid_time = #{record.bidTime,jdbcType=TIMESTAMP},
remark = #{record.remark,jdbcType=VARCHAR},
`state` = #{record.state,jdbcType=INTEGER},
original_source_url = #{record.originalSourceUrl,jdbcType=VARCHAR},
......@@ -511,7 +511,7 @@
source_type = #{record.sourceType,jdbcType=INTEGER},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
is_deleted = #{record.isDeleted,jdbcType=BIT},
bid_time = #{record.bidTime,jdbcType=VARCHAR},
bid_time = #{record.bidTime,jdbcType=TIMESTAMP},
remark = #{record.remark,jdbcType=VARCHAR},
`state` = #{record.state,jdbcType=INTEGER},
original_source_url = #{record.originalSourceUrl,jdbcType=VARCHAR},
......@@ -562,7 +562,7 @@
is_deleted = #{isDeleted,jdbcType=BIT},
</if>
<if test="bidTime != null">
bid_time = #{bidTime,jdbcType=VARCHAR},
bid_time = #{bidTime,jdbcType=TIMESTAMP},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
......@@ -614,7 +614,7 @@
source_type = #{sourceType,jdbcType=INTEGER},
update_time = #{updateTime,jdbcType=TIMESTAMP},
is_deleted = #{isDeleted,jdbcType=BIT},
bid_time = #{bidTime,jdbcType=VARCHAR},
bid_time = #{bidTime,jdbcType=TIMESTAMP},
remark = #{remark,jdbcType=VARCHAR},
`state` = #{state,jdbcType=INTEGER},
original_source_url = #{originalSourceUrl,jdbcType=VARCHAR},
......@@ -642,7 +642,7 @@
source_type = #{sourceType,jdbcType=INTEGER},
update_time = #{updateTime,jdbcType=TIMESTAMP},
is_deleted = #{isDeleted,jdbcType=BIT},
bid_time = #{bidTime,jdbcType=VARCHAR},
bid_time = #{bidTime,jdbcType=TIMESTAMP},
remark = #{remark,jdbcType=VARCHAR},
`state` = #{state,jdbcType=INTEGER},
original_source_url = #{originalSourceUrl,jdbcType=VARCHAR},
......@@ -718,6 +718,7 @@
</if>
limit 1
</select>
<select id="selectOnlyOneselfItems" parameterType="java.lang.Long" resultType="java.lang.Long">
select a.id from item a join user_items_relation b on a.id = b.item_id where a.source_type = 2 and a.view_permission = 1 and b.user_id != #{userId}
</select>
......
......@@ -31,7 +31,6 @@ public class WebMvcConfiguration implements WebMvcConfigurer {
.addPathPatterns("/**")
.excludePathPatterns("/*.html", "/**/*.html", "/**/*.css", "/**/*.js"
, "/wx/user/loginByWx", "/wx/user/loginByMobile", "/wx/user/loginRegCaptcha", "/wx/user/updateRegCaptcha", "/wx/user/login", "/wx/user/fillCode"
,"/wx/follow/**" ,"/wx/message/**"
);
}
}
......@@ -36,4 +36,5 @@ public class ItemResponseVo implements Entity {
private Boolean isFollowed;
private Integer followedId;
private String viewsNumber;
private Integer isDisplay;
}
......@@ -269,6 +269,10 @@ public class ItemServiceImpl implements ItemService {
// 设置用户头像和昵称
itemResponseVo.setItemNickname(nickname);
itemResponseVo.setItemAvatar(avatar);
// 判断是否需要展示浏览量
if (!isGuest && item.getViewPermission().equals(ViewPermissionEnum.ALL.getCode())) {
itemResponseVo.setIsDisplay(1);
}
// 设置浏览量
itemResponseVo.setViewsNumber(item.getViewPermission().equals(ViewPermissionEnum.ALL.getCode()) ?
StringUtil.formatCount(footPrintDao.countByItemIds(dto.getUserId(), item.getId(), null)) : "0");
......@@ -319,6 +323,10 @@ public class ItemServiceImpl implements ItemService {
// 设置藏品发布用户的昵称和头像
itemResponseVo.setItemNickname(itemNickname);
itemResponseVo.setItemAvatar(itemAvatar);
// 判断是否需要展示浏览量
if (!isGuest && es.getViewPermission().equals(ViewPermissionEnum.ALL.getCode())) {
itemResponseVo.setIsDisplay(1);
}
// 设置浏览量
itemResponseVo.setViewsNumber(StringUtil.formatCount(footPrintDao.countByItemIds(dto.getUserId(), es.getId(), null)));
......
......@@ -17,6 +17,7 @@ import com.wwdz.ch.db.domain.Footprint;
import com.wwdz.ch.db.domain.Item;
import com.wwdz.ch.db.domain.SearchHistory;
import com.wwdz.ch.wx.annotation.LoginUser;
import com.xxdxxs.utils.DateUtils;
import org.apache.commons.collections.CollectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -123,9 +124,11 @@ public class WxGoodsController {
if (null != item) {
iv.setId(item.getId());
if (null != item.getBidTime() && item.getBidTime().length() > 3) {
iv.setBidTime(item.getBidTime().substring(0, 4) + "年");
if (item.getBidTime() != null) {
String bidTime = DateUtils.toString(item.getBidTime());
iv.setBidTime(bidTime.substring(0, 4) + "年");
}
String extra = item.getExtra();
iv.setName(item.getName());
Map<String, Object> extraData = (Map<String, Object>) JSONUtils.parse(extra);
......@@ -259,9 +262,11 @@ public class WxGoodsController {
for (Item item : rawItemList) {
ItemVo iv = new ItemVo();
iv.setId(item.getId());
if (null != item.getBidTime() && item.getBidTime().length() > 3) {
iv.setBidTime(item.getBidTime().substring(0, 4) + "年");
if (item.getBidTime() != null) {
String bidTime = DateUtils.toString(item.getBidTime());
iv.setBidTime(bidTime.substring(0, 4) + "年");
}
String extra = item.getExtra();
iv.setName(item.getName());
Map<String, Object> extraData = (Map<String, Object>) JSONUtils.parse(extra);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment