Commit 79485e8f authored by shiyu's avatar shiyu

藏家商品新增官方预估价

parent 24ad3055
...@@ -313,6 +313,7 @@ public class SysSupplierItemServiceImpl implements SysSupplierItemService { ...@@ -313,6 +313,7 @@ public class SysSupplierItemServiceImpl implements SysSupplierItemService {
EntityMapper.copyAttribute(supplierItem, supplierItemVo); EntityMapper.copyAttribute(supplierItem, supplierItemVo);
supplierItemVo.setSupplyPrice(PriceUtil.convertPriceFenToYuan(supplierItem.getSupplyPrice())); supplierItemVo.setSupplyPrice(PriceUtil.convertPriceFenToYuan(supplierItem.getSupplyPrice()));
supplierItemVo.setDistributionPrice(PriceUtil.convertPriceFenToYuan(supplierItem.getDistributionPrice())); supplierItemVo.setDistributionPrice(PriceUtil.convertPriceFenToYuan(supplierItem.getDistributionPrice()));
supplierItemVo.setOfficialEstimatedPrice(PriceUtil.convertPriceFenToYuan(supplierItem.getOfficialEstimatedPrice()));
supplierItemVo.setHomePageImage(MediaUtil.getHomePageImage(supplierItem.getImages(), supplierItem.getVideos())); supplierItemVo.setHomePageImage(MediaUtil.getHomePageImage(supplierItem.getImages(), supplierItem.getVideos()));
supplierItemVo.setTypeName(DistributionEnum.DistributionTypeEnum.getNameByCode(supplierItem.getType())); supplierItemVo.setTypeName(DistributionEnum.DistributionTypeEnum.getNameByCode(supplierItem.getType()));
supplierItemVo.setCreatorName(supplierItem.getCreatorId() == CommConsts.SYSTEM_ACCOUNT.longValue()? "平台自营":cacheUtil.getAppletUserById(supplierItem.getCreatorId()).getNickname()); supplierItemVo.setCreatorName(supplierItem.getCreatorId() == CommConsts.SYSTEM_ACCOUNT.longValue()? "平台自营":cacheUtil.getAppletUserById(supplierItem.getCreatorId()).getNickname());
...@@ -367,6 +368,7 @@ public class SysSupplierItemServiceImpl implements SysSupplierItemService { ...@@ -367,6 +368,7 @@ public class SysSupplierItemServiceImpl implements SysSupplierItemService {
supplierItemVo.setRebate(supplierItem.getRebate().toPlainString()); supplierItemVo.setRebate(supplierItem.getRebate().toPlainString());
supplierItemVo.setSupplyPrice(PriceUtil.convertPriceFenToYuan(supplierItem.getSupplyPrice())); supplierItemVo.setSupplyPrice(PriceUtil.convertPriceFenToYuan(supplierItem.getSupplyPrice()));
supplierItemVo.setDistributionPrice(PriceUtil.convertPriceFenToYuan(supplierItem.getDistributionPrice())); supplierItemVo.setDistributionPrice(PriceUtil.convertPriceFenToYuan(supplierItem.getDistributionPrice()));
supplierItemVo.setOfficialEstimatedPrice(PriceUtil.convertPriceFenToYuan(supplierItem.getOfficialEstimatedPrice()));
supplierItemVo.setHomePageImage(MediaUtil.getHomePageImage(supplierItem.getImages(), supplierItem.getVideos())); supplierItemVo.setHomePageImage(MediaUtil.getHomePageImage(supplierItem.getImages(), supplierItem.getVideos()));
supplierItemVo.setCreatorName(supplierItem.getCreatorId() == CommConsts.SYSTEM_ACCOUNT.longValue()? "平台自营":cacheUtil.getAppletUserById(supplierItem.getCreatorId()).getNickname()); supplierItemVo.setCreatorName(supplierItem.getCreatorId() == CommConsts.SYSTEM_ACCOUNT.longValue()? "平台自营":cacheUtil.getAppletUserById(supplierItem.getCreatorId()).getNickname());
//拍卖品需要查询拍卖配置信息 //拍卖品需要查询拍卖配置信息
...@@ -433,27 +435,6 @@ public class SysSupplierItemServiceImpl implements SysSupplierItemService { ...@@ -433,27 +435,6 @@ public class SysSupplierItemServiceImpl implements SysSupplierItemService {
groupPurchaseConfig.setTargetNum(dto.getTargetNum()); groupPurchaseConfig.setTargetNum(dto.getTargetNum());
groupPurchaseConfig.setWxQrcode(dto.getWxQrcode()); groupPurchaseConfig.setWxQrcode(dto.getWxQrcode());
groupPurchaseConfigDao.update(groupPurchaseConfig); groupPurchaseConfigDao.update(groupPurchaseConfig);
/* //设置团购商品优惠
//先删除之前的优惠信息,再插入新的
if (groupPurchaseDiscountDao.isExisted(dto.getId())) {
groupPurchaseDiscountDao.delete(dto.getId());
}
String discountJson = dto.getDiscountJson();
List<Map<String, Object>> list = JsonUtils.toMapList(discountJson);
for (Map map : list) {
int requireNum = Integer.valueOf(map.get("requireNum").toString());
String rebate = map.get("rebate").toString();
GroupPurchaseDiscount groupPurchaseDiscount = new GroupPurchaseDiscount();
groupPurchaseDiscount.setItemId(dto.getId());
groupPurchaseDiscount.setCreateTime(new Date());
groupPurchaseDiscount.setUpdateTime(new Date());
groupPurchaseDiscount.setRequireNum(requireNum);
groupPurchaseDiscount.setRebate(new BigDecimal(rebate));
groupPurchaseDiscount.setState(GroupPurchaseEnum.StateEnum.VALID.getCode());
groupPurchaseDiscountDao.insert(groupPurchaseDiscount);
}
*/
} }
long oldDistributionPrice = oldSupplierItem.getDistributionPrice(); long oldDistributionPrice = oldSupplierItem.getDistributionPrice();
...@@ -469,6 +450,9 @@ public class SysSupplierItemServiceImpl implements SysSupplierItemService { ...@@ -469,6 +450,9 @@ public class SysSupplierItemServiceImpl implements SysSupplierItemService {
if (StringUtils.hasLength(dto.getSupplyPrice())) { if (StringUtils.hasLength(dto.getSupplyPrice())) {
supplierItem.setSupplyPrice(PriceUtil.convertPriceFromStr(dto.getSupplyPrice())); supplierItem.setSupplyPrice(PriceUtil.convertPriceFromStr(dto.getSupplyPrice()));
} }
if (StringUtils.hasLength(dto.getOfficialEstimatedPrice())) {
supplierItem.setOfficialEstimatedPrice(PriceUtil.convertPriceFromStr(dto.getOfficialEstimatedPrice()));
}
supplierItem.setImages(dto.getImages()); supplierItem.setImages(dto.getImages());
if (StringUtils.hasLength(dto.getVideos())) { if (StringUtils.hasLength(dto.getVideos())) {
supplierItem.setVideos(getVideosImage(dto.getVideos())); supplierItem.setVideos(getVideosImage(dto.getVideos()));
......
...@@ -45,6 +45,11 @@ public class SupplierItemVo implements Entity { ...@@ -45,6 +45,11 @@ public class SupplierItemVo implements Entity {
*/ */
private String distributionPrice; private String distributionPrice;
/**
* 官方预估价,单位元
*/
private String officialEstimatedPrice;
/** /**
* 进货价格,要除以100 * 进货价格,要除以100
*/ */
......
...@@ -11,7 +11,7 @@ import lombok.Data; ...@@ -11,7 +11,7 @@ import lombok.Data;
/** /**
* @author shiyu * @author shiyu
* @date 2024/04/29 * @date 2024/08/13
*/ */
@Data @Data
public class SupplierItem implements Entity { public class SupplierItem implements Entity {
...@@ -52,6 +52,11 @@ public class SupplierItem implements Entity { ...@@ -52,6 +52,11 @@ public class SupplierItem implements Entity {
*/ */
private Long supplyPrice; private Long supplyPrice;
/**
* 官方预估价,要除以100
*/
private Long officialEstimatedPrice;
/** /**
* 库存 * 库存
*/ */
...@@ -133,6 +138,7 @@ public class SupplierItem implements Entity { ...@@ -133,6 +138,7 @@ public class SupplierItem implements Entity {
sb.append(", topImage=").append(topImage); sb.append(", topImage=").append(topImage);
sb.append(", distributionPrice=").append(distributionPrice); sb.append(", distributionPrice=").append(distributionPrice);
sb.append(", supplyPrice=").append(supplyPrice); sb.append(", supplyPrice=").append(supplyPrice);
sb.append(", officialEstimatedPrice=").append(officialEstimatedPrice);
sb.append(", stock=").append(stock); sb.append(", stock=").append(stock);
sb.append(", createTime=").append(createTime); sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime); sb.append(", updateTime=").append(updateTime);
...@@ -171,6 +177,7 @@ public class SupplierItem implements Entity { ...@@ -171,6 +177,7 @@ public class SupplierItem implements Entity {
&& (this.getTopImage() == null ? other.getTopImage() == null : this.getTopImage().equals(other.getTopImage())) && (this.getTopImage() == null ? other.getTopImage() == null : this.getTopImage().equals(other.getTopImage()))
&& (this.getDistributionPrice() == null ? other.getDistributionPrice() == null : this.getDistributionPrice().equals(other.getDistributionPrice())) && (this.getDistributionPrice() == null ? other.getDistributionPrice() == null : this.getDistributionPrice().equals(other.getDistributionPrice()))
&& (this.getSupplyPrice() == null ? other.getSupplyPrice() == null : this.getSupplyPrice().equals(other.getSupplyPrice())) && (this.getSupplyPrice() == null ? other.getSupplyPrice() == null : this.getSupplyPrice().equals(other.getSupplyPrice()))
&& (this.getOfficialEstimatedPrice() == null ? other.getOfficialEstimatedPrice() == null : this.getOfficialEstimatedPrice().equals(other.getOfficialEstimatedPrice()))
&& (this.getStock() == null ? other.getStock() == null : this.getStock().equals(other.getStock())) && (this.getStock() == null ? other.getStock() == null : this.getStock().equals(other.getStock()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())) && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
...@@ -198,6 +205,7 @@ public class SupplierItem implements Entity { ...@@ -198,6 +205,7 @@ public class SupplierItem implements Entity {
result = prime * result + ((getTopImage() == null) ? 0 : getTopImage().hashCode()); result = prime * result + ((getTopImage() == null) ? 0 : getTopImage().hashCode());
result = prime * result + ((getDistributionPrice() == null) ? 0 : getDistributionPrice().hashCode()); result = prime * result + ((getDistributionPrice() == null) ? 0 : getDistributionPrice().hashCode());
result = prime * result + ((getSupplyPrice() == null) ? 0 : getSupplyPrice().hashCode()); result = prime * result + ((getSupplyPrice() == null) ? 0 : getSupplyPrice().hashCode());
result = prime * result + ((getOfficialEstimatedPrice() == null) ? 0 : getOfficialEstimatedPrice().hashCode());
result = prime * result + ((getStock() == null) ? 0 : getStock().hashCode()); result = prime * result + ((getStock() == null) ? 0 : getStock().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode()); result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
...@@ -230,6 +238,7 @@ public class SupplierItem implements Entity { ...@@ -230,6 +238,7 @@ public class SupplierItem implements Entity {
topImage("top_image", "topImage", "VARCHAR", false), topImage("top_image", "topImage", "VARCHAR", false),
distributionPrice("distribution_price", "distributionPrice", "BIGINT", false), distributionPrice("distribution_price", "distributionPrice", "BIGINT", false),
supplyPrice("supply_price", "supplyPrice", "BIGINT", false), supplyPrice("supply_price", "supplyPrice", "BIGINT", false),
officialEstimatedPrice("official_estimated_price", "officialEstimatedPrice", "BIGINT", false),
stock("stock", "stock", "INTEGER", false), stock("stock", "stock", "INTEGER", false),
createTime("create_time", "createTime", "TIMESTAMP", false), createTime("create_time", "createTime", "TIMESTAMP", false),
updateTime("update_time", "updateTime", "TIMESTAMP", false), updateTime("update_time", "updateTime", "TIMESTAMP", false),
......
...@@ -1225,6 +1225,138 @@ public class SupplierItemExample { ...@@ -1225,6 +1225,138 @@ public class SupplierItemExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andOfficialEstimatedPriceIsNull() {
addCriterion("official_estimated_price is null");
return (Criteria) this;
}
public Criteria andOfficialEstimatedPriceIsNotNull() {
addCriterion("official_estimated_price is not null");
return (Criteria) this;
}
public Criteria andOfficialEstimatedPriceEqualTo(Long value) {
addCriterion("official_estimated_price =", value, "officialEstimatedPrice");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table supplier_item
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andOfficialEstimatedPriceEqualToColumn(SupplierItem.Column column) {
addCriterion(new StringBuilder("official_estimated_price = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andOfficialEstimatedPriceNotEqualTo(Long value) {
addCriterion("official_estimated_price <>", value, "officialEstimatedPrice");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table supplier_item
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andOfficialEstimatedPriceNotEqualToColumn(SupplierItem.Column column) {
addCriterion(new StringBuilder("official_estimated_price <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andOfficialEstimatedPriceGreaterThan(Long value) {
addCriterion("official_estimated_price >", value, "officialEstimatedPrice");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table supplier_item
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andOfficialEstimatedPriceGreaterThanColumn(SupplierItem.Column column) {
addCriterion(new StringBuilder("official_estimated_price > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andOfficialEstimatedPriceGreaterThanOrEqualTo(Long value) {
addCriterion("official_estimated_price >=", value, "officialEstimatedPrice");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table supplier_item
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andOfficialEstimatedPriceGreaterThanOrEqualToColumn(SupplierItem.Column column) {
addCriterion(new StringBuilder("official_estimated_price >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andOfficialEstimatedPriceLessThan(Long value) {
addCriterion("official_estimated_price <", value, "officialEstimatedPrice");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table supplier_item
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andOfficialEstimatedPriceLessThanColumn(SupplierItem.Column column) {
addCriterion(new StringBuilder("official_estimated_price < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andOfficialEstimatedPriceLessThanOrEqualTo(Long value) {
addCriterion("official_estimated_price <=", value, "officialEstimatedPrice");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table supplier_item
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andOfficialEstimatedPriceLessThanOrEqualToColumn(SupplierItem.Column column) {
addCriterion(new StringBuilder("official_estimated_price <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andOfficialEstimatedPriceIn(List<Long> values) {
addCriterion("official_estimated_price in", values, "officialEstimatedPrice");
return (Criteria) this;
}
public Criteria andOfficialEstimatedPriceNotIn(List<Long> values) {
addCriterion("official_estimated_price not in", values, "officialEstimatedPrice");
return (Criteria) this;
}
public Criteria andOfficialEstimatedPriceBetween(Long value1, Long value2) {
addCriterion("official_estimated_price between", value1, value2, "officialEstimatedPrice");
return (Criteria) this;
}
public Criteria andOfficialEstimatedPriceNotBetween(Long value1, Long value2) {
addCriterion("official_estimated_price not between", value1, value2, "officialEstimatedPrice");
return (Criteria) this;
}
public Criteria andStockIsNull() { public Criteria andStockIsNull() {
addCriterion("stock is null"); addCriterion("stock is null");
return (Criteria) this; return (Criteria) this;
......
...@@ -59,6 +59,12 @@ public class SupplierItemRequestDto extends BaseRequestDto implements Entity { ...@@ -59,6 +59,12 @@ public class SupplierItemRequestDto extends BaseRequestDto implements Entity {
*/ */
private String salePrice; private String salePrice;
/**
* 官方预估价
* 前端传过来的单位是元,后台要处理为分
*/
private String officialEstimatedPrice;
/** /**
* 团购商品定金 * 团购商品定金
* 前端传过来的单位是元,后台要处理为分 * 前端传过来的单位是元,后台要处理为分
...@@ -110,6 +116,11 @@ public class SupplierItemRequestDto extends BaseRequestDto implements Entity { ...@@ -110,6 +116,11 @@ public class SupplierItemRequestDto extends BaseRequestDto implements Entity {
*/ */
private String distributionPrice; private String distributionPrice;
/**
* 用于查询大于该价格的商品
*/
private Long GreaterThanPrice;
/** /**
* 创建开始时间 * 创建开始时间
* 用于查询 * 用于查询
......
...@@ -129,7 +129,8 @@ public class SupplierItemDaoImpl implements SupplierItemDao { ...@@ -129,7 +129,8 @@ public class SupplierItemDaoImpl implements SupplierItemDao {
public List<SupplierItem> findForHomePage(SupplierItemRequestDto dto) { public List<SupplierItem> findForHomePage(SupplierItemRequestDto dto) {
SupplierItemExample supplierItemExample = new SupplierItemExample(); SupplierItemExample supplierItemExample = new SupplierItemExample();
SupplierItemExample.Criteria criteria = supplierItemExample.createCriteria(); SupplierItemExample.Criteria criteria = supplierItemExample.createCriteria();
criteria.andCreatorIdIn(dto.getCreatorIdList()); // criteria.andCreatorIdIn(dto.getCreatorIdList());
criteria.andDistributionPriceGreaterThanOrEqualTo(dto.getGreaterThanPrice());
criteria.andTypeIn(dto.getTypeList()); criteria.andTypeIn(dto.getTypeList());
criteria.andStockGreaterThan(0); criteria.andStockGreaterThan(0);
criteria.andIsDeletedEqualTo(false); criteria.andIsDeletedEqualTo(false);
......
...@@ -10,6 +10,7 @@ import java.util.ArrayList; ...@@ -10,6 +10,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
public class MyBatisGeneratorRun { public class MyBatisGeneratorRun {
public static void main(String[] args) throws Exception{ public static void main(String[] args) throws Exception{
MyBatisGeneratorRun app = new MyBatisGeneratorRun(); MyBatisGeneratorRun app = new MyBatisGeneratorRun();
app.generator(); app.generator();
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
<result column="top_image" jdbcType="VARCHAR" property="topImage" /> <result column="top_image" jdbcType="VARCHAR" property="topImage" />
<result column="distribution_price" jdbcType="BIGINT" property="distributionPrice" /> <result column="distribution_price" jdbcType="BIGINT" property="distributionPrice" />
<result column="supply_price" jdbcType="BIGINT" property="supplyPrice" /> <result column="supply_price" jdbcType="BIGINT" property="supplyPrice" />
<result column="official_estimated_price" jdbcType="BIGINT" property="officialEstimatedPrice" />
<result column="stock" jdbcType="INTEGER" property="stock" /> <result column="stock" jdbcType="INTEGER" property="stock" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /> <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
...@@ -86,8 +87,8 @@ ...@@ -86,8 +87,8 @@
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, `name`, supplier_id, is_on_sale, sort, top_image, distribution_price, supply_price, id, `name`, supplier_id, is_on_sale, sort, top_image, distribution_price, supply_price,
stock, create_time, update_time, is_deleted, buy_limit_num, `type`, rebate, creator_id, official_estimated_price, stock, create_time, update_time, is_deleted, buy_limit_num,
`status`, is_able_sale `type`, rebate, creator_id, `status`, is_able_sale
</sql> </sql>
<sql id="Blob_Column_List"> <sql id="Blob_Column_List">
images, videos, description images, videos, description
...@@ -131,7 +132,7 @@ ...@@ -131,7 +132,7 @@
@project https://github.com/itfsw/mybatis-generator-plugin @project https://github.com/itfsw/mybatis-generator-plugin
--> -->
select select
'true' as QUERYID,
<if test="example.distinct"> <if test="example.distinct">
distinct distinct
</if> </if>
...@@ -143,8 +144,9 @@ ...@@ -143,8 +144,9 @@
</when> </when>
<otherwise> <otherwise>
id, `name`, supplier_id, is_on_sale, sort, top_image, distribution_price, supply_price, id, `name`, supplier_id, is_on_sale, sort, top_image, distribution_price, supply_price,
stock, create_time, update_time, is_deleted, buy_limit_num, `type`, rebate, creator_id, official_estimated_price, stock, create_time, update_time, is_deleted, buy_limit_num,
`status`, is_able_sale, images, videos, description `type`, rebate, creator_id, `status`, is_able_sale, images, videos, description
</otherwise> </otherwise>
</choose> </choose>
from supplier_item from supplier_item
...@@ -178,8 +180,9 @@ ...@@ -178,8 +180,9 @@
</when> </when>
<otherwise> <otherwise>
id, `name`, supplier_id, is_on_sale, sort, top_image, distribution_price, supply_price, id, `name`, supplier_id, is_on_sale, sort, top_image, distribution_price, supply_price,
stock, create_time, update_time, is_deleted, buy_limit_num, `type`, rebate, creator_id, official_estimated_price, stock, create_time, update_time, is_deleted, buy_limit_num,
`status`, is_able_sale, images, videos, description `type`, rebate, creator_id, `status`, is_able_sale, images, videos, description
</otherwise> </otherwise>
</choose> </choose>
from supplier_item from supplier_item
...@@ -201,18 +204,20 @@ ...@@ -201,18 +204,20 @@
</selectKey> </selectKey>
insert into supplier_item (`name`, supplier_id, is_on_sale, insert into supplier_item (`name`, supplier_id, is_on_sale,
sort, top_image, distribution_price, sort, top_image, distribution_price,
supply_price, stock, create_time, supply_price, official_estimated_price, stock,
update_time, is_deleted, buy_limit_num, create_time, update_time, is_deleted,
`type`, rebate, creator_id, buy_limit_num, `type`, rebate,
`status`, is_able_sale, images, creator_id, `status`, is_able_sale,
videos, description) images, videos, description
)
values (#{name,jdbcType=VARCHAR}, #{supplierId,jdbcType=BIGINT}, #{isOnSale,jdbcType=BIT}, values (#{name,jdbcType=VARCHAR}, #{supplierId,jdbcType=BIGINT}, #{isOnSale,jdbcType=BIT},
#{sort,jdbcType=INTEGER}, #{topImage,jdbcType=VARCHAR}, #{distributionPrice,jdbcType=BIGINT}, #{sort,jdbcType=INTEGER}, #{topImage,jdbcType=VARCHAR}, #{distributionPrice,jdbcType=BIGINT},
#{supplyPrice,jdbcType=BIGINT}, #{stock,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{supplyPrice,jdbcType=BIGINT}, #{officialEstimatedPrice,jdbcType=BIGINT}, #{stock,jdbcType=INTEGER},
#{updateTime,jdbcType=TIMESTAMP}, #{isDeleted,jdbcType=BIT}, #{buyLimitNum,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{isDeleted,jdbcType=BIT},
#{type,jdbcType=INTEGER}, #{rebate,jdbcType=DECIMAL}, #{creatorId,jdbcType=BIGINT}, #{buyLimitNum,jdbcType=INTEGER}, #{type,jdbcType=INTEGER}, #{rebate,jdbcType=DECIMAL},
#{status,jdbcType=INTEGER}, #{isAbleSale,jdbcType=BIT}, #{images,jdbcType=LONGVARCHAR}, #{creatorId,jdbcType=BIGINT}, #{status,jdbcType=INTEGER}, #{isAbleSale,jdbcType=BIT},
#{videos,jdbcType=LONGVARCHAR}, #{description,jdbcType=LONGVARCHAR}) #{images,jdbcType=LONGVARCHAR}, #{videos,jdbcType=LONGVARCHAR}, #{description,jdbcType=LONGVARCHAR}
)
</insert> </insert>
<insert id="insertSelective" parameterType="com.wwdz.ch.db.domain.distribution.SupplierItem"> <insert id="insertSelective" parameterType="com.wwdz.ch.db.domain.distribution.SupplierItem">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long"> <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
...@@ -241,6 +246,9 @@ ...@@ -241,6 +246,9 @@
<if test="supplyPrice != null"> <if test="supplyPrice != null">
supply_price, supply_price,
</if> </if>
<if test="officialEstimatedPrice != null">
official_estimated_price,
</if>
<if test="stock != null"> <if test="stock != null">
stock, stock,
</if> </if>
...@@ -303,6 +311,9 @@ ...@@ -303,6 +311,9 @@
<if test="supplyPrice != null"> <if test="supplyPrice != null">
#{supplyPrice,jdbcType=BIGINT}, #{supplyPrice,jdbcType=BIGINT},
</if> </if>
<if test="officialEstimatedPrice != null">
#{officialEstimatedPrice,jdbcType=BIGINT},
</if>
<if test="stock != null"> <if test="stock != null">
#{stock,jdbcType=INTEGER}, #{stock,jdbcType=INTEGER},
</if> </if>
...@@ -377,6 +388,9 @@ ...@@ -377,6 +388,9 @@
<if test="record.supplyPrice != null"> <if test="record.supplyPrice != null">
supply_price = #{record.supplyPrice,jdbcType=BIGINT}, supply_price = #{record.supplyPrice,jdbcType=BIGINT},
</if> </if>
<if test="record.officialEstimatedPrice != null">
official_estimated_price = #{record.officialEstimatedPrice,jdbcType=BIGINT},
</if>
<if test="record.stock != null"> <if test="record.stock != null">
stock = #{record.stock,jdbcType=INTEGER}, stock = #{record.stock,jdbcType=INTEGER},
</if> </if>
...@@ -431,6 +445,7 @@ ...@@ -431,6 +445,7 @@
top_image = #{record.topImage,jdbcType=VARCHAR}, top_image = #{record.topImage,jdbcType=VARCHAR},
distribution_price = #{record.distributionPrice,jdbcType=BIGINT}, distribution_price = #{record.distributionPrice,jdbcType=BIGINT},
supply_price = #{record.supplyPrice,jdbcType=BIGINT}, supply_price = #{record.supplyPrice,jdbcType=BIGINT},
official_estimated_price = #{record.officialEstimatedPrice,jdbcType=BIGINT},
stock = #{record.stock,jdbcType=INTEGER}, stock = #{record.stock,jdbcType=INTEGER},
create_time = #{record.createTime,jdbcType=TIMESTAMP}, create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP}, update_time = #{record.updateTime,jdbcType=TIMESTAMP},
...@@ -458,6 +473,7 @@ ...@@ -458,6 +473,7 @@
top_image = #{record.topImage,jdbcType=VARCHAR}, top_image = #{record.topImage,jdbcType=VARCHAR},
distribution_price = #{record.distributionPrice,jdbcType=BIGINT}, distribution_price = #{record.distributionPrice,jdbcType=BIGINT},
supply_price = #{record.supplyPrice,jdbcType=BIGINT}, supply_price = #{record.supplyPrice,jdbcType=BIGINT},
official_estimated_price = #{record.officialEstimatedPrice,jdbcType=BIGINT},
stock = #{record.stock,jdbcType=INTEGER}, stock = #{record.stock,jdbcType=INTEGER},
create_time = #{record.createTime,jdbcType=TIMESTAMP}, create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP}, update_time = #{record.updateTime,jdbcType=TIMESTAMP},
...@@ -496,6 +512,9 @@ ...@@ -496,6 +512,9 @@
<if test="supplyPrice != null"> <if test="supplyPrice != null">
supply_price = #{supplyPrice,jdbcType=BIGINT}, supply_price = #{supplyPrice,jdbcType=BIGINT},
</if> </if>
<if test="officialEstimatedPrice != null">
official_estimated_price = #{officialEstimatedPrice,jdbcType=BIGINT},
</if>
<if test="stock != null"> <if test="stock != null">
stock = #{stock,jdbcType=INTEGER}, stock = #{stock,jdbcType=INTEGER},
</if> </if>
...@@ -547,6 +566,7 @@ ...@@ -547,6 +566,7 @@
top_image = #{topImage,jdbcType=VARCHAR}, top_image = #{topImage,jdbcType=VARCHAR},
distribution_price = #{distributionPrice,jdbcType=BIGINT}, distribution_price = #{distributionPrice,jdbcType=BIGINT},
supply_price = #{supplyPrice,jdbcType=BIGINT}, supply_price = #{supplyPrice,jdbcType=BIGINT},
official_estimated_price = #{officialEstimatedPrice,jdbcType=BIGINT},
stock = #{stock,jdbcType=INTEGER}, stock = #{stock,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP}, create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}, update_time = #{updateTime,jdbcType=TIMESTAMP},
...@@ -571,6 +591,7 @@ ...@@ -571,6 +591,7 @@
top_image = #{topImage,jdbcType=VARCHAR}, top_image = #{topImage,jdbcType=VARCHAR},
distribution_price = #{distributionPrice,jdbcType=BIGINT}, distribution_price = #{distributionPrice,jdbcType=BIGINT},
supply_price = #{supplyPrice,jdbcType=BIGINT}, supply_price = #{supplyPrice,jdbcType=BIGINT},
official_estimated_price = #{officialEstimatedPrice,jdbcType=BIGINT},
stock = #{stock,jdbcType=INTEGER}, stock = #{stock,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP}, create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}, update_time = #{updateTime,jdbcType=TIMESTAMP},
...@@ -637,8 +658,9 @@ ...@@ -637,8 +658,9 @@
</when> </when>
<otherwise> <otherwise>
id, `name`, supplier_id, is_on_sale, sort, top_image, distribution_price, supply_price, id, `name`, supplier_id, is_on_sale, sort, top_image, distribution_price, supply_price,
stock, create_time, update_time, is_deleted, buy_limit_num, `type`, rebate, creator_id, official_estimated_price, stock, create_time, update_time, is_deleted, buy_limit_num,
`status`, is_able_sale, images, videos, description `type`, rebate, creator_id, `status`, is_able_sale, images, videos, description
</otherwise> </otherwise>
</choose> </choose>
from supplier_item from supplier_item
......
...@@ -63,16 +63,16 @@ ...@@ -63,16 +63,16 @@
<!--生成Model类存放位置--> <!--生成Model类存放位置-->
<javaModelGenerator targetPackage="com.wwdz.ch.db.domain" targetProject="ch-dao/src/main/java"> <javaModelGenerator targetPackage="com.wwdz.ch.db.domain.distribution" targetProject="ch-dao/src/main/java">
<property name="enableSubPackages" value="true"/> <property name="enableSubPackages" value="true"/>
<property name="trimStrings" value="true"/> <property name="trimStrings" value="true"/>
</javaModelGenerator> </javaModelGenerator>
<sqlMapGenerator targetPackage="com.wwdz.ch.db.mapper" targetProject="ch-dao/src/main/resources"/> <sqlMapGenerator targetPackage="com.wwdz.ch.db.mapper.distribution" targetProject="ch-dao/src/main/resources"/>
<javaClientGenerator type="XMLMAPPER" targetPackage="com.wwdz.ch.db.mapper" <javaClientGenerator type="XMLMAPPER" targetPackage="com.wwdz.ch.db.mapper.distribution"
targetProject="ch-dao/src/main/java"/> targetProject="ch-dao/src/main/java"/>
<table tableName="collector_white_list" enableCountByExample="true" enableUpdateByExample="true" enableDeleteByExample="true" enableSelectByExample="true" selectByExampleQueryId="true"> <table tableName="supplier_item" enableCountByExample="true" enableUpdateByExample="true" enableDeleteByExample="true" enableSelectByExample="true" selectByExampleQueryId="true">
<generatedKey column="id" sqlStatement="Mysql" identity="true" /> <generatedKey column="id" sqlStatement="Mysql" identity="true" />
</table> </table>
......
...@@ -944,6 +944,7 @@ public class SupplierItemServiceImpl implements SupplierItemService { ...@@ -944,6 +944,7 @@ public class SupplierItemServiceImpl implements SupplierItemService {
EntityMapper.copyAttribute(supplierItem, supplierItemVo); EntityMapper.copyAttribute(supplierItem, supplierItemVo);
supplierItemVo.setItemId(supplierItem.getId()); supplierItemVo.setItemId(supplierItem.getId());
supplierItemVo.setDistributionPrice(PriceUtil.convertPriceFenToYuan(supplierItem.getDistributionPrice())); supplierItemVo.setDistributionPrice(PriceUtil.convertPriceFenToYuan(supplierItem.getDistributionPrice()));
supplierItemVo.setOfficialEstimatedPrice(PriceUtil.convertPriceFenToYuan(supplierItem.getOfficialEstimatedPrice()));
supplierItemVo.setHomePageImage(MediaUtil.getHomePageImage(supplierItem.getImages(), supplierItem.getVideos())); supplierItemVo.setHomePageImage(MediaUtil.getHomePageImage(supplierItem.getImages(), supplierItem.getVideos()));
User creator = cacheUtil.appletUserInfoCache.get(supplierItem.getCreatorId()).get(); User creator = cacheUtil.appletUserInfoCache.get(supplierItem.getCreatorId()).get();
supplierItemVo.setCreatorName(creator.getNickname()); supplierItemVo.setCreatorName(creator.getNickname());
...@@ -1130,7 +1131,7 @@ public class SupplierItemServiceImpl implements SupplierItemService { ...@@ -1130,7 +1131,7 @@ public class SupplierItemServiceImpl implements SupplierItemService {
//用户默认展示系统账号发布的藏品和白名单中藏家的藏品 //用户默认展示系统账号发布的藏品和白名单中藏家的藏品
SupplierItemRequestDto searchDto = new SupplierItemRequestDto(); SupplierItemRequestDto searchDto = new SupplierItemRequestDto();
//查询用户关注的人 //查询用户关注的人
FollowFansRecordRequestDto followFansRecordRequestDto = new FollowFansRecordRequestDto(); /* FollowFansRecordRequestDto followFansRecordRequestDto = new FollowFansRecordRequestDto();
followFansRecordRequestDto.setFansId(userId); followFansRecordRequestDto.setFansId(userId);
List<FollowFansRecord> followFansRecordList = followFansRecordDao.findList(followFansRecordRequestDto); List<FollowFansRecord> followFansRecordList = followFansRecordDao.findList(followFansRecordRequestDto);
List<Long> followerIds = followFansRecordList.stream().map(FollowFansRecord::getFollowerId).collect(Collectors.toList()); List<Long> followerIds = followFansRecordList.stream().map(FollowFansRecord::getFollowerId).collect(Collectors.toList());
...@@ -1146,8 +1147,10 @@ public class SupplierItemServiceImpl implements SupplierItemService { ...@@ -1146,8 +1147,10 @@ public class SupplierItemServiceImpl implements SupplierItemService {
searchDto.setTypeList(Arrays.asList(DistributionEnum.DistributionTypeEnum.FIXED_PRICE.getCode(), DistributionEnum.DistributionTypeEnum.COLLECT.getCode())); searchDto.setTypeList(Arrays.asList(DistributionEnum.DistributionTypeEnum.FIXED_PRICE.getCode(), DistributionEnum.DistributionTypeEnum.COLLECT.getCode()));
} else { } else {
searchDto.setTypeList(Arrays.asList(DistributionEnum.DistributionTypeEnum.AUCTION.getCode())); searchDto.setTypeList(Arrays.asList(DistributionEnum.DistributionTypeEnum.AUCTION.getCode()));
} }*/
searchDto.setCreatorIdList(distinctCollectorIds); //大于200元的商品展示
searchDto.setGreaterThanPrice(20000L);
// searchDto.setCreatorIdList(distinctCollectorIds);
searchDto.setStock(0);//库存大于0 searchDto.setStock(0);//库存大于0
searchDto.setPage(dto.getPage()); searchDto.setPage(dto.getPage());
searchDto.setLimit(dto.getLimit()); searchDto.setLimit(dto.getLimit());
......
...@@ -46,8 +46,8 @@ public class SendMsgFromExcelJob { ...@@ -46,8 +46,8 @@ public class SendMsgFromExcelJob {
@Value("${spring.profiles.active}") @Value("${spring.profiles.active}")
private String env; private String env;
// 每年8月12日晚上19点执行一次 // 每年8月13日晚上19点执行一次
@Scheduled(cron = "0 0 19 12 8 ?") @Scheduled(cron = "0 0 19 13 8 ?")
public void executeTask() { public void executeTask() {
if ("dev".equals(env)) { if ("dev".equals(env)) {
logger.info(">>>>>>>>>>>>>>>>>>>>>>> dev环境, 不执行给指定类目用户发送通知任务<<<<<<<<<<<<<<<<<<<<<"); logger.info(">>>>>>>>>>>>>>>>>>>>>>> dev环境, 不执行给指定类目用户发送通知任务<<<<<<<<<<<<<<<<<<<<<");
...@@ -60,7 +60,7 @@ public class SendMsgFromExcelJob { ...@@ -60,7 +60,7 @@ public class SendMsgFromExcelJob {
} }
logger.info(">>>>>>>>>>>> sendMsgFromExcel 开始执行 <<<<<<<<<<<<"); logger.info(">>>>>>>>>>>> sendMsgFromExcel 开始执行 <<<<<<<<<<<<");
try { try {
String key = "cx:sendMsgFromExcel:0812"; String key = "cq:sendMsgFromExcel:081319";
Date now = new Date(); Date now = new Date();
if (redisUtils.hasKey(key)) { if (redisUtils.hasKey(key)) {
String msg = "给指定类目用户发送通知任务正在重复执行"; String msg = "给指定类目用户发送通知任务正在重复执行";
...@@ -68,7 +68,7 @@ public class SendMsgFromExcelJob { ...@@ -68,7 +68,7 @@ public class SendMsgFromExcelJob {
logger.info(">>>>>>>>>>>> sendMsgFromExcel 已经执行过了 <<<<<<<<<<<<"); logger.info(">>>>>>>>>>>> sendMsgFromExcel 已经执行过了 <<<<<<<<<<<<");
return; return;
} }
String fileName = "沉香短信表.xlsx"; String fileName = "瓷器短信表.xlsx";
InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream(fileName); InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream(fileName);
StringArrayExcelReadListener listener = new StringArrayExcelReadListener(); StringArrayExcelReadListener listener = new StringArrayExcelReadListener();
ExcelReader reader = EasyExcelFactory.read(inputStream, listener).build(); ExcelReader reader = EasyExcelFactory.read(inputStream, listener).build();
...@@ -78,19 +78,19 @@ public class SendMsgFromExcelJob { ...@@ -78,19 +78,19 @@ public class SendMsgFromExcelJob {
List<String> head = listener.getHead(); List<String> head = listener.getHead();
logger.info("excel title = {}", head); logger.info("excel title = {}", head);
List<List<String>> dataList = listener.getData(); List<List<String>> dataList = listener.getData();
logger.info(">>>>>>>>>> 沉香类目 excel 读取数据 : {} 条", dataList.size()); logger.info(">>>>>>>>>> 瓷器类目 excel 读取数据 : {} 条", dataList.size());
dataList.stream().forEach(row -> { dataList.stream().forEach(row -> {
String phone = row.get(0); String phone = row.get(0);
String url = wxAppletApi.getUrlLink(CommConsts.SPECIAL_PERFORMANCE_URL,"specialId=" + 28 + "&k=sms"); String url = wxAppletApi.getUrlLink(CommConsts.SPECIAL_PERFORMANCE_URL,"specialId=" + 32 + "&k=sms");
//发短信 //发短信
String msg = "万香之王·沉香高货专场开始啦,请前往"+ url + "查看"; String msg = "巧手裁云·神毫绘莲|景德镇瓷器专场开始啦,请前往"+ url + "查看";
aliSmsSender.sendSms(phone, msg); aliSmsSender.sendSms(phone, msg);
logger.info("手机号: {}, 沉香类目, 发送短信成功", phone); logger.info("手机号: {}, 瓷器类目, 发送短信成功", phone);
}); });
String successMsg = "给指定类目用户发送通知执行完成"; String successMsg = "给指定类目用户发送通知执行完成";
//发短信 //发短信
String url = wxAppletApi.getUrlLink(CommConsts.SPECIAL_PERFORMANCE_URL,"specialId=" + 28 + "&k=sms"); String url = wxAppletApi.getUrlLink(CommConsts.SPECIAL_PERFORMANCE_URL,"specialId=" + 32 + "&k=sms");
String msg = "万香之王·沉香高货专场开始啦,请前往"+ url + "查看"; String msg = "巧手裁云·神毫绘莲|景德镇瓷器专场开始啦,请前往"+ url + "查看";
aliSmsSender.sendSms("15757185512", msg); aliSmsSender.sendSms("15757185512", msg);
redisUtils.set(key, now, 3600 * 24); redisUtils.set(key, now, 3600 * 24);
logger.info(">>>>>>>>>>>> sendMsgFromExcel 发送通知给指定用户定时任务执行完成 <<<<<<<<<<<<"); logger.info(">>>>>>>>>>>> sendMsgFromExcel 发送通知给指定用户定时任务执行完成 <<<<<<<<<<<<");
......
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