Commit 79485e8f authored by shiyu's avatar shiyu

藏家商品新增官方预估价

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