Commit 05d6f362 authored by shiyu's avatar shiyu

拍卖专场1

parent 0c6738fe
...@@ -151,6 +151,11 @@ public class SupplierItemVo implements Entity { ...@@ -151,6 +151,11 @@ public class SupplierItemVo implements Entity {
*/ */
private Date realEndTime; private Date realEndTime;
/**
* 出价记录
*/
private Long offerNum;
/** /**
* 起拍价 * 起拍价
* 单位元 需要转为分 * 单位元 需要转为分
......
package com.wwdz.ch.db.dao.distribution; package com.wwdz.ch.db.dao.distribution;
import com.wwdz.ch.db.domain.distribution.SpecialPerformanceConfig;
import com.wwdz.ch.db.dto.request.distribution.SpecialPerformanceConfigRequestDto;
import java.util.List;
public interface SpecialPerformanceConfigDao { public interface SpecialPerformanceConfigDao {
List<SpecialPerformanceConfig> findList(SpecialPerformanceConfigRequestDto dto);
List<SpecialPerformanceConfig> findAllItem(int specialPerformanceId);
boolean insert(SpecialPerformanceConfig specialPerformanceConfig);
boolean update(SpecialPerformanceConfig specialPerformanceConfig);
long countViewNum(int specialPerformanceId);
} }
package com.wwdz.ch.db.dao.distribution; package com.wwdz.ch.db.dao.distribution;
import com.wwdz.ch.db.domain.distribution.SpecialPerformance;
public interface SpecialPerformanceDao { public interface SpecialPerformanceDao {
SpecialPerformance findByType(int type);
SpecialPerformance findById(int id);
boolean update(SpecialPerformance specialPerformance);
} }
...@@ -10,7 +10,7 @@ import lombok.Data; ...@@ -10,7 +10,7 @@ import lombok.Data;
/** /**
* @author shiyu * @author shiyu
* @date 2024/05/29 * @date 2024/05/31
*/ */
@Data @Data
public class SpecialPerformance implements Entity { public class SpecialPerformance implements Entity {
...@@ -31,6 +31,16 @@ public class SpecialPerformance implements Entity { ...@@ -31,6 +31,16 @@ public class SpecialPerformance implements Entity {
*/ */
private Date updateTime; private Date updateTime;
/**
* 开始时间
*/
private Date startTime;
/**
* 结束时间
*/
private Date endTime;
/** /**
* 专场类型1拍卖 * 专场类型1拍卖
*/ */
...@@ -53,6 +63,8 @@ public class SpecialPerformance implements Entity { ...@@ -53,6 +63,8 @@ public class SpecialPerformance implements Entity {
sb.append(", title=").append(title); sb.append(", title=").append(title);
sb.append(", createTime=").append(createTime); sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime); sb.append(", updateTime=").append(updateTime);
sb.append(", startTime=").append(startTime);
sb.append(", endTime=").append(endTime);
sb.append(", type=").append(type); sb.append(", type=").append(type);
sb.append(", state=").append(state); sb.append(", state=").append(state);
sb.append(", serialVersionUID=").append(serialVersionUID); sb.append(", serialVersionUID=").append(serialVersionUID);
...@@ -76,6 +88,8 @@ public class SpecialPerformance implements Entity { ...@@ -76,6 +88,8 @@ public class SpecialPerformance implements Entity {
&& (this.getTitle() == null ? other.getTitle() == null : this.getTitle().equals(other.getTitle())) && (this.getTitle() == null ? other.getTitle() == null : this.getTitle().equals(other.getTitle()))
&& (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()))
&& (this.getStartTime() == null ? other.getStartTime() == null : this.getStartTime().equals(other.getStartTime()))
&& (this.getEndTime() == null ? other.getEndTime() == null : this.getEndTime().equals(other.getEndTime()))
&& (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType())) && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
&& (this.getState() == null ? other.getState() == null : this.getState().equals(other.getState())); && (this.getState() == null ? other.getState() == null : this.getState().equals(other.getState()));
} }
...@@ -88,6 +102,8 @@ public class SpecialPerformance implements Entity { ...@@ -88,6 +102,8 @@ public class SpecialPerformance implements Entity {
result = prime * result + ((getTitle() == null) ? 0 : getTitle().hashCode()); result = prime * result + ((getTitle() == null) ? 0 : getTitle().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());
result = prime * result + ((getStartTime() == null) ? 0 : getStartTime().hashCode());
result = prime * result + ((getEndTime() == null) ? 0 : getEndTime().hashCode());
result = prime * result + ((getType() == null) ? 0 : getType().hashCode()); result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
result = prime * result + ((getState() == null) ? 0 : getState().hashCode()); result = prime * result + ((getState() == null) ? 0 : getState().hashCode());
return result; return result;
...@@ -105,6 +121,8 @@ public class SpecialPerformance implements Entity { ...@@ -105,6 +121,8 @@ public class SpecialPerformance implements Entity {
title("title", "title", "VARCHAR", false), title("title", "title", "VARCHAR", 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),
startTime("start_time", "startTime", "TIMESTAMP", false),
endTime("end_time", "endTime", "TIMESTAMP", false),
type("type", "type", "INTEGER", true), type("type", "type", "INTEGER", true),
state("state", "state", "INTEGER", true); state("state", "state", "INTEGER", true);
......
...@@ -686,6 +686,270 @@ public class SpecialPerformanceExample { ...@@ -686,6 +686,270 @@ public class SpecialPerformanceExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andStartTimeIsNull() {
addCriterion("start_time is null");
return (Criteria) this;
}
public Criteria andStartTimeIsNotNull() {
addCriterion("start_time is not null");
return (Criteria) this;
}
public Criteria andStartTimeEqualTo(Date value) {
addCriterion("start_time =", value, "startTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table special_performance
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andStartTimeEqualToColumn(SpecialPerformance.Column column) {
addCriterion(new StringBuilder("start_time = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andStartTimeNotEqualTo(Date value) {
addCriterion("start_time <>", value, "startTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table special_performance
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andStartTimeNotEqualToColumn(SpecialPerformance.Column column) {
addCriterion(new StringBuilder("start_time <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andStartTimeGreaterThan(Date value) {
addCriterion("start_time >", value, "startTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table special_performance
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andStartTimeGreaterThanColumn(SpecialPerformance.Column column) {
addCriterion(new StringBuilder("start_time > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andStartTimeGreaterThanOrEqualTo(Date value) {
addCriterion("start_time >=", value, "startTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table special_performance
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andStartTimeGreaterThanOrEqualToColumn(SpecialPerformance.Column column) {
addCriterion(new StringBuilder("start_time >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andStartTimeLessThan(Date value) {
addCriterion("start_time <", value, "startTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table special_performance
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andStartTimeLessThanColumn(SpecialPerformance.Column column) {
addCriterion(new StringBuilder("start_time < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andStartTimeLessThanOrEqualTo(Date value) {
addCriterion("start_time <=", value, "startTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table special_performance
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andStartTimeLessThanOrEqualToColumn(SpecialPerformance.Column column) {
addCriterion(new StringBuilder("start_time <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andStartTimeIn(List<Date> values) {
addCriterion("start_time in", values, "startTime");
return (Criteria) this;
}
public Criteria andStartTimeNotIn(List<Date> values) {
addCriterion("start_time not in", values, "startTime");
return (Criteria) this;
}
public Criteria andStartTimeBetween(Date value1, Date value2) {
addCriterion("start_time between", value1, value2, "startTime");
return (Criteria) this;
}
public Criteria andStartTimeNotBetween(Date value1, Date value2) {
addCriterion("start_time not between", value1, value2, "startTime");
return (Criteria) this;
}
public Criteria andEndTimeIsNull() {
addCriterion("end_time is null");
return (Criteria) this;
}
public Criteria andEndTimeIsNotNull() {
addCriterion("end_time is not null");
return (Criteria) this;
}
public Criteria andEndTimeEqualTo(Date value) {
addCriterion("end_time =", value, "endTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table special_performance
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andEndTimeEqualToColumn(SpecialPerformance.Column column) {
addCriterion(new StringBuilder("end_time = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andEndTimeNotEqualTo(Date value) {
addCriterion("end_time <>", value, "endTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table special_performance
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andEndTimeNotEqualToColumn(SpecialPerformance.Column column) {
addCriterion(new StringBuilder("end_time <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andEndTimeGreaterThan(Date value) {
addCriterion("end_time >", value, "endTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table special_performance
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andEndTimeGreaterThanColumn(SpecialPerformance.Column column) {
addCriterion(new StringBuilder("end_time > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andEndTimeGreaterThanOrEqualTo(Date value) {
addCriterion("end_time >=", value, "endTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table special_performance
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andEndTimeGreaterThanOrEqualToColumn(SpecialPerformance.Column column) {
addCriterion(new StringBuilder("end_time >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andEndTimeLessThan(Date value) {
addCriterion("end_time <", value, "endTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table special_performance
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andEndTimeLessThanColumn(SpecialPerformance.Column column) {
addCriterion(new StringBuilder("end_time < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andEndTimeLessThanOrEqualTo(Date value) {
addCriterion("end_time <=", value, "endTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table special_performance
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andEndTimeLessThanOrEqualToColumn(SpecialPerformance.Column column) {
addCriterion(new StringBuilder("end_time <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andEndTimeIn(List<Date> values) {
addCriterion("end_time in", values, "endTime");
return (Criteria) this;
}
public Criteria andEndTimeNotIn(List<Date> values) {
addCriterion("end_time not in", values, "endTime");
return (Criteria) this;
}
public Criteria andEndTimeBetween(Date value1, Date value2) {
addCriterion("end_time between", value1, value2, "endTime");
return (Criteria) this;
}
public Criteria andEndTimeNotBetween(Date value1, Date value2) {
addCriterion("end_time not between", value1, value2, "endTime");
return (Criteria) this;
}
public Criteria andTypeIsNull() { public Criteria andTypeIsNull() {
addCriterion("`type` is null"); addCriterion("`type` is null");
return (Criteria) this; return (Criteria) this;
......
...@@ -5,6 +5,7 @@ import com.xxdxxs.entity.Entity; ...@@ -5,6 +5,7 @@ import com.xxdxxs.entity.Entity;
import lombok.Data; import lombok.Data;
import java.util.Date; import java.util.Date;
import java.util.List;
@Data @Data
public class AuctionRecordRequestDto extends BaseRequestDto implements Entity { public class AuctionRecordRequestDto extends BaseRequestDto implements Entity {
...@@ -16,6 +17,12 @@ public class AuctionRecordRequestDto extends BaseRequestDto implements Entity { ...@@ -16,6 +17,12 @@ public class AuctionRecordRequestDto extends BaseRequestDto implements Entity {
*/ */
private Long itemId; private Long itemId;
/**
* 商品id
*/
private List<Long> itemIdList;
/** /**
* 用户id * 用户id
*/ */
......
package com.wwdz.ch.db.dto.request.distribution;
import com.wwdz.ch.db.dto.request.BaseRequestDto;
import com.xxdxxs.entity.Entity;
import lombok.Data;
import java.util.Date;
@Data
public class SpecialPerformanceConfigRequestDto extends BaseRequestDto implements Entity {
private Integer id;
/**
* 专场id
*/
private Integer specialPerformanceId;
/**
* 商品id
*/
private Long itemId;
/**
* 创建时间
*/
private Date createTime;
/**
* 浏览次数
*/
private Integer viewNum;
/**
* 状态
*/
private Integer state;
}
package com.wwdz.ch.db.dto.request.distribution;
import com.wwdz.ch.db.dto.request.BaseRequestDto;
import com.xxdxxs.entity.Entity;
import lombok.Data;
import java.util.Date;
@Data
public class SpecialPerformanceRequestDto extends BaseRequestDto implements Entity {
private Integer id;
/**
* 专场id
*/
private Integer specialPerformanceId;
/**
* 专场名称
*/
private String title;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
/**
* 专场类型1拍卖
*/
private Integer type;
/**
* 状态
*/
private Integer state;
}
...@@ -98,6 +98,7 @@ public class AuctionRecordDaoImpl implements AuctionRecordDao { ...@@ -98,6 +98,7 @@ public class AuctionRecordDaoImpl implements AuctionRecordDao {
public long count(AuctionRecordRequestDto dto) { public long count(AuctionRecordRequestDto dto) {
AuctionRecordExample example = new AuctionRecordExample(); AuctionRecordExample example = new AuctionRecordExample();
AuctionRecordExample.Criteria criteria = example.createCriteria(); AuctionRecordExample.Criteria criteria = example.createCriteria();
JdbcHelper.ifPresent(dto.getItemIdList(), criteria::andItemIdIn);
JdbcHelper.ifPresent(dto.getItemId(), criteria::andItemIdEqualTo); JdbcHelper.ifPresent(dto.getItemId(), criteria::andItemIdEqualTo);
JdbcHelper.ifPresent(dto.getUserId(), criteria::andUserIdEqualTo); JdbcHelper.ifPresent(dto.getUserId(), criteria::andUserIdEqualTo);
JdbcHelper.ifPresent(dto.getIsLead(), criteria::andIsLeadEqualTo); JdbcHelper.ifPresent(dto.getIsLead(), criteria::andIsLeadEqualTo);
......
package com.wwdz.ch.db.impl.distribution;
import com.github.pagehelper.PageHelper;
import com.wwdz.ch.db.dao.distribution.SpecialPerformanceConfigDao;
import com.wwdz.ch.db.domain.distribution.SpecialPerformanceConfig;
import com.wwdz.ch.db.domain.distribution.SpecialPerformanceConfigExample;
import com.wwdz.ch.db.dto.request.distribution.SpecialPerformanceConfigRequestDto;
import com.wwdz.ch.db.mapper.distribution.SpecialPerformanceConfigMapper;
import com.xxdxxs.db.component.JdbcHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public class SpecialPerformanceConfigDaoImpl implements SpecialPerformanceConfigDao {
@Autowired
SpecialPerformanceConfigMapper specialPerformanceConfigMapper;
@Override
public List<SpecialPerformanceConfig> findList(SpecialPerformanceConfigRequestDto dto) {
SpecialPerformanceConfigExample example = new SpecialPerformanceConfigExample();
SpecialPerformanceConfigExample.Criteria criteria = example.createCriteria();
JdbcHelper.ifPresent(dto.getSpecialPerformanceId(), criteria::andSpecialPerformanceIdEqualTo);
JdbcHelper.ifPresent(dto.getItemId(), criteria::andItemIdEqualTo);
PageHelper.startPage(dto.getPage(), dto.getLimit());
return specialPerformanceConfigMapper.selectByExample(example);
}
@Override
public List<SpecialPerformanceConfig> findAllItem(int specialPerformanceId) {
SpecialPerformanceConfigExample example = new SpecialPerformanceConfigExample();
SpecialPerformanceConfigExample.Criteria criteria = example.createCriteria();
criteria.andSpecialPerformanceIdEqualTo(specialPerformanceId);
return specialPerformanceConfigMapper.selectByExampleSelective(example, SpecialPerformanceConfig.Column.itemId);
}
@Override
public boolean insert(SpecialPerformanceConfig specialPerformanceConfig) {
return specialPerformanceConfigMapper.insert(specialPerformanceConfig) > 0;
}
@Override
public boolean update(SpecialPerformanceConfig specialPerformanceConfig) {
SpecialPerformanceConfigExample example = new SpecialPerformanceConfigExample();
SpecialPerformanceConfigExample.Criteria criteria = example.createCriteria();
criteria.andSpecialPerformanceIdEqualTo(specialPerformanceConfig.getSpecialPerformanceId());
return specialPerformanceConfigMapper.updateByExampleSelective(specialPerformanceConfig, example) > 0;
}
@Override
public long countViewNum(int specialPerformanceId) {
return specialPerformanceConfigMapper.countViewNum(specialPerformanceId);
}
}
package com.wwdz.ch.db.impl.distribution;
import com.wwdz.ch.db.dao.distribution.SpecialPerformanceDao;
import com.wwdz.ch.db.domain.distribution.SpecialPerformance;
import com.wwdz.ch.db.domain.distribution.SpecialPerformanceExample;
import com.wwdz.ch.db.mapper.distribution.SpecialPerformanceMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
@Repository
public class SpecialPerformanceDaoImpl implements SpecialPerformanceDao {
@Autowired
SpecialPerformanceMapper specialPerformanceMapper;
@Override
public SpecialPerformance findByType(int type) {
SpecialPerformanceExample example = new SpecialPerformanceExample();
SpecialPerformanceExample.Criteria criteria = example.createCriteria();
criteria.andTypeEqualTo(type);
return specialPerformanceMapper.selectOneByExample(example);
}
@Override
public SpecialPerformance findById(int id) {
SpecialPerformanceExample example = new SpecialPerformanceExample();
SpecialPerformanceExample.Criteria criteria = example.createCriteria();
criteria.andIdEqualTo(id);
return specialPerformanceMapper.selectOneByExample(example);
}
@Override
public boolean update(SpecialPerformance specialPerformance) {
return specialPerformanceMapper.updateByPrimaryKeySelective(specialPerformance) > 0;
}
}
...@@ -66,4 +66,11 @@ public interface SpecialPerformanceConfigMapper { ...@@ -66,4 +66,11 @@ public interface SpecialPerformanceConfigMapper {
int updateByPrimaryKeySelective(SpecialPerformanceConfig record); int updateByPrimaryKeySelective(SpecialPerformanceConfig record);
int updateByPrimaryKey(SpecialPerformanceConfig record); int updateByPrimaryKey(SpecialPerformanceConfig record);
/**
* 统计专场总围观数
* @param specialPerformanceId
* @return
*/
long countViewNum(@Param("specialPerformanceId")Integer specialPerformanceId);
} }
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.wwdz.ch.db.mapper.distribution.SpecialPerformanceConfigMapper">
<resultMap id="BaseResultMap" type="com.wwdz.ch.db.domain.distribution.SpecialPerformanceConfig">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="special_performance_id" jdbcType="INTEGER" property="specialPerformanceId" />
<result column="item_id" jdbcType="BIGINT" property="itemId" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="view_num" jdbcType="INTEGER" property="viewNum" />
<result column="state" jdbcType="INTEGER" property="state" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, special_performance_id, item_id, create_time, view_num, `state`
</sql>
<select id="selectByExample" parameterType="com.wwdz.ch.db.domain.distribution.SpecialPerformanceConfigExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
'true' as QUERYID,
<include refid="Base_Column_List" />
from special_performance_config
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByExampleSelective" parameterType="map" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@project https://github.com/itfsw/mybatis-generator-plugin
-->
select
'true' as QUERYID,
<if test="example.distinct">
distinct
</if>
<choose>
<when test="selective != null and selective.length > 0">
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
</when>
<otherwise>
id, special_performance_id, item_id, create_time, view_num, `state`
</otherwise>
</choose>
from special_performance_config
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
<if test="example.orderByClause != null">
order by ${example.orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from special_performance_config
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectByPrimaryKeySelective" parameterType="map" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@project https://github.com/itfsw/mybatis-generator-plugin
-->
select
<choose>
<when test="selective != null and selective.length > 0">
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
</when>
<otherwise>
id, special_performance_id, item_id, create_time, view_num, `state`
</otherwise>
</choose>
from special_performance_config
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from special_performance_config
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.wwdz.ch.db.domain.distribution.SpecialPerformanceConfigExample">
delete from special_performance_config
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.wwdz.ch.db.domain.distribution.SpecialPerformanceConfig">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into special_performance_config (special_performance_id, item_id, create_time,
view_num, `state`)
values (#{specialPerformanceId,jdbcType=INTEGER}, #{itemId,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP},
#{viewNum,jdbcType=INTEGER}, #{state,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.wwdz.ch.db.domain.distribution.SpecialPerformanceConfig">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into special_performance_config
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="specialPerformanceId != null">
special_performance_id,
</if>
<if test="itemId != null">
item_id,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="viewNum != null">
view_num,
</if>
<if test="state != null">
`state`,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="specialPerformanceId != null">
#{specialPerformanceId,jdbcType=INTEGER},
</if>
<if test="itemId != null">
#{itemId,jdbcType=BIGINT},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="viewNum != null">
#{viewNum,jdbcType=INTEGER},
</if>
<if test="state != null">
#{state,jdbcType=INTEGER},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.wwdz.ch.db.domain.distribution.SpecialPerformanceConfigExample" resultType="java.lang.Long">
select count(*) from special_performance_config
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update special_performance_config
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.specialPerformanceId != null">
special_performance_id = #{record.specialPerformanceId,jdbcType=INTEGER},
</if>
<if test="record.itemId != null">
item_id = #{record.itemId,jdbcType=BIGINT},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.viewNum != null">
view_num = #{record.viewNum,jdbcType=INTEGER},
</if>
<if test="record.state != null">
`state` = #{record.state,jdbcType=INTEGER},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update special_performance_config
set id = #{record.id,jdbcType=INTEGER},
special_performance_id = #{record.specialPerformanceId,jdbcType=INTEGER},
item_id = #{record.itemId,jdbcType=BIGINT},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
view_num = #{record.viewNum,jdbcType=INTEGER},
`state` = #{record.state,jdbcType=INTEGER}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.wwdz.ch.db.domain.distribution.SpecialPerformanceConfig">
update special_performance_config
<set>
<if test="specialPerformanceId != null">
special_performance_id = #{specialPerformanceId,jdbcType=INTEGER},
</if>
<if test="itemId != null">
item_id = #{itemId,jdbcType=BIGINT},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="viewNum != null">
view_num = #{viewNum,jdbcType=INTEGER},
</if>
<if test="state != null">
`state` = #{state,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.wwdz.ch.db.domain.distribution.SpecialPerformanceConfig">
update special_performance_config
set special_performance_id = #{specialPerformanceId,jdbcType=INTEGER},
item_id = #{itemId,jdbcType=BIGINT},
create_time = #{createTime,jdbcType=TIMESTAMP},
view_num = #{viewNum,jdbcType=INTEGER},
`state` = #{state,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="selectOneByExample" parameterType="com.wwdz.ch.db.domain.distribution.SpecialPerformanceConfigExample" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@project https://github.com/itfsw/mybatis-generator-plugin
-->
select
'true' as QUERYID,
<include refid="Base_Column_List" />
from special_performance_config
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
limit 1
</select>
<select id="selectOneByExampleSelective" parameterType="map" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@project https://github.com/itfsw/mybatis-generator-plugin
-->
select
'true' as QUERYID,
<choose>
<when test="selective != null and selective.length > 0">
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
</when>
<otherwise>
id, special_performance_id, item_id, create_time, view_num, `state`
</otherwise>
</choose>
from special_performance_config
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
<if test="example.orderByClause != null">
order by ${example.orderByClause}
</if>
limit 1
</select>
<select id="countViewNum" parameterType="java.lang.Integer" resultType="java.lang.Long">
select IFNULL(sum(view_num),0) from special_performance_config where special_performance_id = #{specialPerformanceId} and state = 1
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.wwdz.ch.db.mapper.distribution.SpecialPerformanceMapper">
<resultMap id="BaseResultMap" type="com.wwdz.ch.db.domain.distribution.SpecialPerformance">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="title" jdbcType="VARCHAR" property="title" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="start_time" jdbcType="TIMESTAMP" property="startTime" />
<result column="end_time" jdbcType="TIMESTAMP" property="endTime" />
<result column="type" jdbcType="INTEGER" property="type" />
<result column="state" jdbcType="INTEGER" property="state" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, title, create_time, update_time, start_time, end_time, `type`, `state`
</sql>
<select id="selectByExample" parameterType="com.wwdz.ch.db.domain.distribution.SpecialPerformanceExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
'true' as QUERYID,
<include refid="Base_Column_List" />
from special_performance
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByExampleSelective" parameterType="map" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@project https://github.com/itfsw/mybatis-generator-plugin
-->
select
'true' as QUERYID,
<if test="example.distinct">
distinct
</if>
<choose>
<when test="selective != null and selective.length &gt; 0">
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
</when>
<otherwise>
id, title, create_time, update_time, start_time, end_time, `type`, `state`
</otherwise>
</choose>
from special_performance
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
<if test="example.orderByClause != null">
order by ${example.orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from special_performance
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectByPrimaryKeySelective" parameterType="map" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@project https://github.com/itfsw/mybatis-generator-plugin
-->
select
<choose>
<when test="selective != null and selective.length &gt; 0">
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
</when>
<otherwise>
id, title, create_time, update_time, start_time, end_time, `type`, `state`
</otherwise>
</choose>
from special_performance
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from special_performance
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.wwdz.ch.db.domain.distribution.SpecialPerformanceExample">
delete from special_performance
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.wwdz.ch.db.domain.distribution.SpecialPerformance">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into special_performance (title, create_time, update_time,
start_time, end_time, `type`,
`state`)
values (#{title,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},
#{startTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP}, #{type,jdbcType=INTEGER},
#{state,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.wwdz.ch.db.domain.distribution.SpecialPerformance">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into special_performance
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="title != null">
title,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="startTime != null">
start_time,
</if>
<if test="endTime != null">
end_time,
</if>
<if test="type != null">
`type`,
</if>
<if test="state != null">
`state`,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="title != null">
#{title,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="startTime != null">
#{startTime,jdbcType=TIMESTAMP},
</if>
<if test="endTime != null">
#{endTime,jdbcType=TIMESTAMP},
</if>
<if test="type != null">
#{type,jdbcType=INTEGER},
</if>
<if test="state != null">
#{state,jdbcType=INTEGER},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.wwdz.ch.db.domain.distribution.SpecialPerformanceExample" resultType="java.lang.Long">
select count(*) from special_performance
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update special_performance
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.title != null">
title = #{record.title,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
</if>
<if test="record.startTime != null">
start_time = #{record.startTime,jdbcType=TIMESTAMP},
</if>
<if test="record.endTime != null">
end_time = #{record.endTime,jdbcType=TIMESTAMP},
</if>
<if test="record.type != null">
`type` = #{record.type,jdbcType=INTEGER},
</if>
<if test="record.state != null">
`state` = #{record.state,jdbcType=INTEGER},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update special_performance
set id = #{record.id,jdbcType=INTEGER},
title = #{record.title,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
start_time = #{record.startTime,jdbcType=TIMESTAMP},
end_time = #{record.endTime,jdbcType=TIMESTAMP},
`type` = #{record.type,jdbcType=INTEGER},
`state` = #{record.state,jdbcType=INTEGER}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.wwdz.ch.db.domain.distribution.SpecialPerformance">
update special_performance
<set>
<if test="title != null">
title = #{title,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="startTime != null">
start_time = #{startTime,jdbcType=TIMESTAMP},
</if>
<if test="endTime != null">
end_time = #{endTime,jdbcType=TIMESTAMP},
</if>
<if test="type != null">
`type` = #{type,jdbcType=INTEGER},
</if>
<if test="state != null">
`state` = #{state,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.wwdz.ch.db.domain.distribution.SpecialPerformance">
update special_performance
set title = #{title,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
start_time = #{startTime,jdbcType=TIMESTAMP},
end_time = #{endTime,jdbcType=TIMESTAMP},
`type` = #{type,jdbcType=INTEGER},
`state` = #{state,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="selectOneByExample" parameterType="com.wwdz.ch.db.domain.distribution.SpecialPerformanceExample" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@project https://github.com/itfsw/mybatis-generator-plugin
-->
select
'true' as QUERYID,
<include refid="Base_Column_List" />
from special_performance
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
limit 1
</select>
<select id="selectOneByExampleSelective" parameterType="map" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@project https://github.com/itfsw/mybatis-generator-plugin
-->
select
'true' as QUERYID,
<choose>
<when test="selective != null and selective.length &gt; 0">
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
</when>
<otherwise>
id, title, create_time, update_time, start_time, end_time, `type`, `state`
</otherwise>
</choose>
from special_performance
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
<if test="example.orderByClause != null">
order by ${example.orderByClause}
</if>
limit 1
</select>
</mapper>
\ No newline at end of file
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
<javaClientGenerator type="XMLMAPPER" targetPackage="com.wwdz.ch.db.mapper.distribution" <javaClientGenerator type="XMLMAPPER" targetPackage="com.wwdz.ch.db.mapper.distribution"
targetProject="ch-dao/src/main/java"/> targetProject="ch-dao/src/main/java"/>
<table tableName="special_performance_config" enableCountByExample="true" enableUpdateByExample="true" enableDeleteByExample="true" enableSelectByExample="true" selectByExampleQueryId="true"> <table tableName="special_performance" 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>
......
...@@ -46,10 +46,10 @@ public class WebMvcConfiguration implements WebMvcConfigurer { ...@@ -46,10 +46,10 @@ public class WebMvcConfiguration implements WebMvcConfigurer {
"/wx/distributionOrder/refund", "/wx/distributionOrder/refund",
"/wx/supplierItem/findItemsOfCurrentDistributor", "/wx/selfPage/updateSwitch", "/wx/supplierItem/findHomePage" "/wx/supplierItem/findItemsOfCurrentDistributor", "/wx/selfPage/updateSwitch", "/wx/supplierItem/findHomePage"
//下列路径上线注释 //下列路径上线注释
,"/wx/specialPerformance/**"
/*, "/wx/supplierItem/**", "/wx/shareRecord/**", "/wx/distributionOrder/**", "/wx/selfPage/**", "/wx/auctionRecord/**", , "/wx/supplierItem/**", "/wx/shareRecord/**", "/wx/distributionOrder/**", "/wx/selfPage/**", "/wx/auctionRecord/**",
"/wx/shareRecord/**","/wx/collectionBook/**", "/wx/collectedRecord/**", "/wx/collectionItemsRelation/**","/wx/collectionShareRecord/**" "/wx/shareRecord/**","/wx/collectionBook/**", "/wx/collectedRecord/**", "/wx/collectionItemsRelation/**","/wx/collectionShareRecord/**"
,"/wx/logistics/**","/wx/follow/**"*/ ,"/wx/logistics/**","/wx/follow/**"
// , "/wx/supplierItem/**", "/wx/shareRecord/**", "/wx/distributionOrder/**", "/wx/selfPage/**", "/wx/auctionRecord/**" // , "/wx/supplierItem/**", "/wx/shareRecord/**", "/wx/distributionOrder/**", "/wx/selfPage/**", "/wx/auctionRecord/**"
/* "/wx/officialAccount/**", /* "/wx/officialAccount/**",
......
package com.wwdz.ch.wx.entity.vo.distribution;
import com.xxdxxs.entity.Entity;
import lombok.Data;
import java.util.Date;
import java.util.List;
import java.util.Map;
@Data
public class SpecialPerformanceVo implements Entity {
/**
* 专场总围观次数
*/
private Long totalViewNum;
/**
* 总商品数
*/
private Long totalItemNum;
/**
* 开始时间
*/
private Date startTime;
/**
* 截止日期
*/
private Date endTime;
/**
* 状态
*/
private Integer state;
private String stateName;
/**
* 专场标题
*/
private String title;
private List<Map<String, Object>> itemList;
}
...@@ -23,6 +23,7 @@ import com.wwdz.ch.wx.service.distribution.AuctionRecordService; ...@@ -23,6 +23,7 @@ import com.wwdz.ch.wx.service.distribution.AuctionRecordService;
import com.wwdz.ch.core.service.SendMsgService; import com.wwdz.ch.core.service.SendMsgService;
import com.xxdxxs.utils.DateUtils; import com.xxdxxs.utils.DateUtils;
import com.xxdxxs.utils.EntityMapper; import com.xxdxxs.utils.EntityMapper;
import com.xxdxxs.utils.StringUtils;
import org.redisson.api.RLock; import org.redisson.api.RLock;
import org.redisson.api.RedissonClient; import org.redisson.api.RedissonClient;
import org.slf4j.Logger; import org.slf4j.Logger;
...@@ -88,6 +89,9 @@ public class AuctionRecordServiceImpl implements AuctionRecordService { ...@@ -88,6 +89,9 @@ public class AuctionRecordServiceImpl implements AuctionRecordService {
@Autowired @Autowired
WxAppletApi wxAppletApi; WxAppletApi wxAppletApi;
@Autowired
SpecialPerformanceConfigDao specialPerformanceConfigDao;
@Override @Override
@Transactional @Transactional
...@@ -109,10 +113,16 @@ public class AuctionRecordServiceImpl implements AuctionRecordService { ...@@ -109,10 +113,16 @@ public class AuctionRecordServiceImpl implements AuctionRecordService {
return Result.failed("该商品已截拍"); return Result.failed("该商品已截拍");
} }
String shareRecordId = dto.getShareRecordId(); String shareRecordId = dto.getShareRecordId();
DistributorShareRecord distributorShareRecord = distributorShareRecordDao.findById(shareRecordId); DistributorShareRecord distributorShareRecord = new DistributorShareRecord();
if (distributorShareRecord == null || !distributorShareRecord.getEnabled()) { //拍卖专场进入的用户出价时没有分享记录的id,默认系统账号为分销商
logger.info("======== 拍卖出价,对应分享id = {}, 无效 ========", shareRecordId); if (StringUtils.isEmpty(shareRecordId)) {
return Result.failed("该商品分享链接已失效"); distributorShareRecord.setDistributorId(CommConsts.SYSTEM_ACCOUNT);
} else {
distributorShareRecord = distributorShareRecordDao.findById(shareRecordId);
if (distributorShareRecord == null || !distributorShareRecord.getEnabled()) {
logger.info("======== 拍卖出价,对应分享id = {}, 无效 ========", shareRecordId);
return Result.failed("该商品分享链接已失效");
}
} }
SupplierItem supplierItem = supplierItemDao.findById(itemId); SupplierItem supplierItem = supplierItemDao.findById(itemId);
//查询当前最新的价格 //查询当前最新的价格
...@@ -168,26 +178,28 @@ public class AuctionRecordServiceImpl implements AuctionRecordService { ...@@ -168,26 +178,28 @@ public class AuctionRecordServiceImpl implements AuctionRecordService {
logger.info("商品id:{}, 用户id:{}, 本次出价时间: {}, 原先截拍时间为:{}, 延长截拍时间为{}", itemId, dto.getUserId(), now, endTime, newRealEndTime); logger.info("商品id:{}, 用户id:{}, 本次出价时间: {}, 原先截拍时间为:{}, 延长截拍时间为{}", itemId, dto.getUserId(), now, endTime, newRealEndTime);
} }
//发送消息通知对应的分销商有用户出价 //发送消息通知对应的分销商有用户出价, 排除分销商id为系统默认账号的情况
String openId = sendMsgService.getOpenIdByUserId(distributorShareRecord.getDistributorId()); if (distributorShareRecord.getDistributorId().longValue() != CommConsts.SYSTEM_ACCOUNT) {
if (com.xxdxxs.utils.StringUtils.hasLength(openId)) { String openId = sendMsgService.getOpenIdByUserId(distributorShareRecord.getDistributorId());
AuctionOfferNoticeMsg auctionOfferNoticeMsg = new AuctionOfferNoticeMsg(); if (com.xxdxxs.utils.StringUtils.hasLength(openId)) {
auctionOfferNoticeMsg.setItemId(supplierItem.getId()); AuctionOfferNoticeMsg auctionOfferNoticeMsg = new AuctionOfferNoticeMsg();
auctionOfferNoticeMsg.setOpenId(openId); auctionOfferNoticeMsg.setItemId(supplierItem.getId());
auctionOfferNoticeMsg.setItemName(supplierItem.getName()); auctionOfferNoticeMsg.setOpenId(openId);
auctionOfferNoticeMsg.setCurrentPrice(PriceUtil.convertPriceFenToYuan(price)); auctionOfferNoticeMsg.setItemName(supplierItem.getName());
Result result = sendMsgService.offerNoticeToDistributorMsg(auctionOfferNoticeMsg); auctionOfferNoticeMsg.setCurrentPrice(PriceUtil.convertPriceFenToYuan(price));
if (!result.getSuccess()) { Result result = sendMsgService.offerNoticeToDistributorMsg(auctionOfferNoticeMsg);
if (!result.getSuccess()) {
String url = wxAppletApi.getUrlLink(AUCTION_MSG_URL,"itemId=" + itemId + "&shareRecordId=");
String msg = "您分销的拍品" + supplierItem.getName() + "有人成出价" + PriceUtil.convertPriceFenToYuan(price) +
"元,请前往"+ url + "查看";
aliSmsSender.sendSms(distributorShareRecord.getDistributorId(), msg);
}
} else {
String url = wxAppletApi.getUrlLink(AUCTION_MSG_URL,"itemId=" + itemId + "&shareRecordId="); String url = wxAppletApi.getUrlLink(AUCTION_MSG_URL,"itemId=" + itemId + "&shareRecordId=");
String msg = "您分销的拍品" + supplierItem.getName() + "有人成出价" + PriceUtil.convertPriceFenToYuan(price) + String msg = "您分销的拍品" + supplierItem.getName() + "有人成出价" + PriceUtil.convertPriceFenToYuan(price) +
"元,请前往"+ url + "查看"; "元,请前往"+ url + "查看";
aliSmsSender.sendSms(distributorShareRecord.getDistributorId(), msg); aliSmsSender.sendSms(distributorShareRecord.getDistributorId(), msg);
} }
} else {
String url = wxAppletApi.getUrlLink(AUCTION_MSG_URL,"itemId=" + itemId + "&shareRecordId=");
String msg = "您分销的拍品" + supplierItem.getName() + "有人成出价" + PriceUtil.convertPriceFenToYuan(price) +
"元,请前往"+ url + "查看";
aliSmsSender.sendSms(distributorShareRecord.getDistributorId(), msg);
} }
return Result.success(); return Result.success();
} else { } else {
......
package com.wwdz.ch.wx.impl.distribution;
import com.github.pagehelper.PageInfo;
import com.wwdz.ch.core.consts.DistributionEnum;
import com.wwdz.ch.core.entity.SupplierItemVo;
import com.wwdz.ch.core.type.PageSearchResult;
import com.wwdz.ch.core.type.Result;
import com.wwdz.ch.core.util.MediaUtil;
import com.wwdz.ch.core.util.PriceUtil;
import com.wwdz.ch.db.dao.distribution.*;
import com.wwdz.ch.db.domain.distribution.*;
import com.wwdz.ch.db.dto.request.distribution.AuctionRecordRequestDto;
import com.wwdz.ch.db.dto.request.distribution.SpecialPerformanceConfigRequestDto;
import com.wwdz.ch.db.dto.request.distribution.SpecialPerformanceRequestDto;
import com.wwdz.ch.db.dto.request.distribution.SupplierItemRequestDto;
import com.wwdz.ch.wx.entity.vo.distribution.SpecialPerformanceVo;
import com.wwdz.ch.wx.service.distribution.SpecialPerformanceService;
import com.xxdxxs.utils.EntityMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;
@Service
public class SpecialPerformanceServiceImpl implements SpecialPerformanceService {
private static final Logger logger = LoggerFactory.getLogger(SpecialPerformanceServiceImpl.class);
@Autowired
SpecialPerformanceDao specialPerformanceDao;
@Autowired
SpecialPerformanceConfigDao specialPerformanceConfigDao;
@Autowired
SupplierItemDao supplierItemDao;
@Autowired
AuctionRecordDao auctionRecordDao;
@Autowired
AuctionConfigDao auctionConfigDao;
@Override
public Result findInfo(SpecialPerformanceRequestDto dto) {
try {
SpecialPerformance specialPerformance = specialPerformanceDao.findByType(dto.getType());
Date now = new Date();
if (now.after(specialPerformance.getEndTime())) {
SpecialPerformance updateDto = new SpecialPerformance();
updateDto.setId(dto.getSpecialPerformanceId());
updateDto.setState(DistributionEnum.AuctionStateEnum.END.getCode());
updateDto.setUpdateTime(now);
specialPerformanceDao.update(updateDto);
specialPerformance.setState(DistributionEnum.AuctionStateEnum.END.getCode());
}
int specialPerformanceId = specialPerformance.getId();
SpecialPerformanceConfigRequestDto specialPerformanceConfigRequestDto = new SpecialPerformanceConfigRequestDto();
specialPerformanceConfigRequestDto.setPage(dto.getPage());
specialPerformanceConfigRequestDto.setLimit(dto.getLimit());
specialPerformanceConfigRequestDto.setSpecialPerformanceId(specialPerformanceId);
List<SpecialPerformanceConfig> list = specialPerformanceConfigDao.findList(specialPerformanceConfigRequestDto);
PageInfo pageInfo = new PageInfo<>(list);
SpecialPerformanceVo specialPerformanceVo = new SpecialPerformanceVo();
specialPerformanceVo.setTotalItemNum(pageInfo.getTotal());
specialPerformanceVo.setTitle(specialPerformance.getTitle());
specialPerformanceVo.setState(specialPerformance.getState());
specialPerformanceVo.setStateName(DistributionEnum.AuctionStateEnum.getNameByCode(specialPerformance.getState()));
specialPerformanceVo.setStartTime(specialPerformance.getStartTime());
specialPerformanceVo.setEndTime(specialPerformance.getEndTime());
long totalViewNum = specialPerformanceConfigDao.countViewNum(specialPerformanceId);
specialPerformanceVo.setTotalViewNum(totalViewNum);
List<Map<String, Object>> dataList = new ArrayList<>();
for (SpecialPerformanceConfig specialPerformanceConfig : list) {
long itemId = specialPerformance.getId();
SupplierItem supplierItem = supplierItemDao.findById(itemId);
Map<String, Object> map = new HashMap<>();
map.put("homePageImage", MediaUtil.getHomePageImage(supplierItem.getImages(), supplierItem.getVideos()));
map.put("itemName", supplierItem.getName());
map.put("viewNum", specialPerformanceConfig.getViewNum());
dataList.add(map);
}
specialPerformanceVo.setItemList(dataList);
return Result.success(specialPerformanceVo);
} catch (Exception e) {
logger.error("查询专场信息失败 error : {}", e);
}
return Result.failed();
}
@Override
public Result findItemList(SpecialPerformanceRequestDto dto) {
try {
SpecialPerformance specialPerformance = specialPerformanceDao.findById(dto.getSpecialPerformanceId());
Map<String, Object> resultMap = new HashMap<>();
List<SupplierItemVo> supplierItemVos = new ArrayList<>();
SpecialPerformanceConfigRequestDto specialPerformanceConfigRequestDto = new SpecialPerformanceConfigRequestDto();
specialPerformanceConfigRequestDto.setPage(dto.getPage());
specialPerformanceConfigRequestDto.setLimit(dto.getLimit());
specialPerformanceConfigRequestDto.setSpecialPerformanceId(dto.getSpecialPerformanceId());
List<SpecialPerformanceConfig> list = specialPerformanceConfigDao.findList(specialPerformanceConfigRequestDto);
PageInfo<SupplierItem> pageInfo = new PageInfo(list);
//商品总数
resultMap.put("totalItemNum", pageInfo.getTotal());
//围观总数
long totalViewNum = specialPerformanceConfigDao.countViewNum(dto.getSpecialPerformanceId());
resultMap.put("totalViewNum", totalViewNum);
//出价总数
List<SpecialPerformanceConfig> allItemlist = specialPerformanceConfigDao.findAllItem(dto.getSpecialPerformanceId());
List<Long> itemIdList = allItemlist.stream().map(SpecialPerformanceConfig::getItemId).collect(Collectors.toList());
AuctionRecordRequestDto auctionRecordRequestDtoOfTotal = new AuctionRecordRequestDto();
auctionRecordRequestDtoOfTotal.setItemIdList(itemIdList);
long totalOfferNum = auctionRecordDao.count(auctionRecordRequestDtoOfTotal);
resultMap.put("totalOfferNum", totalOfferNum);
List<Long> itemList = list.stream().map(SpecialPerformanceConfig::getItemId).collect(Collectors.toList());
SupplierItemRequestDto supplierItemRequestDto = new SupplierItemRequestDto();
supplierItemRequestDto.setIds(itemList);
List<SupplierItem> supplierItemList = supplierItemDao.findList(supplierItemRequestDto);
supplierItemList.forEach(supplierItem -> {
SupplierItemVo supplierItemVo = new SupplierItemVo();
EntityMapper.copyAttribute(supplierItem, supplierItemVo);
supplierItemVo.setItemId(supplierItem.getId());
supplierItemVo.setSupplyPrice(PriceUtil.convertPriceFenToYuan(supplierItem.getSupplyPrice()));
supplierItemVo.setDistributionPrice(PriceUtil.convertPriceFenToYuan(supplierItem.getDistributionPrice()));
supplierItemVo.setHomePageImage(MediaUtil.getHomePageImage(supplierItem.getImages(), supplierItem.getVideos()));
BigDecimal decimal = supplierItem.getRebate().divide(new BigDecimal("100")).multiply(new BigDecimal(supplierItem.getDistributionPrice().toString()));
supplierItemVo.setRebateAmount(PriceUtil.convertDoubleToString(decimal.doubleValue()));
supplierItemVo.setRebate(supplierItem.getRebate().toPlainString() + "%");
//竞拍商品需要展示当前价
if (supplierItem.getType() == DistributionEnum.DistributionTypeEnum.AUCTION.getCode()) {
Date now = new Date();
AuctionRecord lastedRecord = auctionRecordDao.findLastedRecord(supplierItem.getId());
if (lastedRecord != null && lastedRecord.getPrice() != null) {
supplierItemVo.setCurrentPrice(PriceUtil.convertPriceFenToYuan(lastedRecord.getPrice()));
} else {
supplierItemVo.setCurrentPrice("0");
}
AuctionConfig auctionConfig = auctionConfigDao.findByItemId(supplierItem.getId());
supplierItemVo.setRealEndTime(auctionConfig.getRealEndTime());
if (now.before(auctionConfig.getStartTime())) {
supplierItemVo.setState(DistributionEnum.AuctionStateEnum.NOT_START.getCode());
supplierItemVo.setStateName(DistributionEnum.AuctionStateEnum.NOT_START.getDes());
} else if (now.after(auctionConfig.getRealEndTime())) {
supplierItemVo.setState(DistributionEnum.AuctionStateEnum.END.getCode());
supplierItemVo.setStateName(DistributionEnum.AuctionStateEnum.END.getDes());
//如果当前时间已经超过截拍时间,并且竞拍配置还未改成无效,则进行修改
if (auctionConfig.getIsValid()) {
auctionConfigDao.setEnd(supplierItem.getId());
}
} else {
supplierItemVo.setState(DistributionEnum.AuctionStateEnum.IN_AUCTION.getCode());
supplierItemVo.setStateName(DistributionEnum.AuctionStateEnum.IN_AUCTION.getDes());
}
AuctionRecordRequestDto auctionRecordRequestDto = new AuctionRecordRequestDto();
auctionRecordRequestDto.setItemId(supplierItemVo.getItemId());
long count = auctionRecordDao.count(auctionRecordRequestDto);
supplierItemVo.setOfferNum(count);
}
supplierItemVos.add(supplierItemVo);
});
resultMap.put("dataList", PageSearchResult.of(pageInfo, supplierItemVos));
resultMap.put("endTime", specialPerformance.getEndTime());
Date now = new Date();
//当前时间大于专场结束时间则修改专场的状态
if (now.after(specialPerformance.getEndTime())) {
SpecialPerformance updateDto = new SpecialPerformance();
updateDto.setId(dto.getSpecialPerformanceId());
updateDto.setState(DistributionEnum.AuctionStateEnum.END.getCode());
updateDto.setUpdateTime(now);
specialPerformanceDao.update(updateDto);
resultMap.put("state", DistributionEnum.AuctionStateEnum.END.getCode());
resultMap.put("stateName", DistributionEnum.AuctionStateEnum.END.getDes());
} else {
resultMap.put("state", specialPerformance.getState());
resultMap.put("stateName", DistributionEnum.AuctionStateEnum.getNameByCode(specialPerformance.getState()));
}
return Result.success(resultMap);
} catch (Exception e) {
logger.error("拍卖专场商品列表 error : {}", e);
}
return Result.failed();
}
}
package com.wwdz.ch.wx.service.distribution;
import com.wwdz.ch.core.type.Result;
import com.wwdz.ch.db.dto.request.distribution.SpecialPerformanceRequestDto;
public interface SpecialPerformanceService {
/**
* 查询专场信息
* @return
*/
Result findInfo(SpecialPerformanceRequestDto dto);
/**
* 查询专场商品列表
* @param dto
* @return
*/
Result findItemList(SpecialPerformanceRequestDto dto);
}
package com.wwdz.ch.wx.web.distribution;
import com.alibaba.fastjson.JSON;
import com.wwdz.ch.core.consts.ResultCode;
import com.wwdz.ch.core.type.Result;
import com.wwdz.ch.db.dto.request.distribution.SpecialPerformanceRequestDto;
import com.wwdz.ch.db.dto.request.distribution.SupplierItemRequestDto;
import com.wwdz.ch.wx.service.distribution.SpecialPerformanceService;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/wx/specialPerformance")
public class SpecialPerformanceController {
private static final Logger logger = LoggerFactory.getLogger(SpecialPerformanceController.class);
@Autowired
SpecialPerformanceService specialPerformanceService;
@ApiOperation(value = "查询专场信息")
@PostMapping("/findInfo")
public Result findInfo(@RequestBody SpecialPerformanceRequestDto dto) {
logger.info("查询专场信息,请求参数:{}", JSON.toJSONString(dto));
if (dto.getType() == null) {
return Result.failed(ResultCode.PARAM_ERROR);
}
return specialPerformanceService.findInfo(dto);
}
@ApiOperation(value = "查询专场商品列表")
@PostMapping("/findItemList")
public Result findItemList(@RequestBody SpecialPerformanceRequestDto dto) {
logger.info("查询专场商品列表,请求参数:{}", JSON.toJSONString(dto));
if (dto.getSpecialPerformanceId() == null) {
return Result.failed(ResultCode.PARAM_ERROR);
}
return specialPerformanceService.findItemList(dto);
}
}
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