Commit 15819834 authored by shiyu's avatar shiyu

lot设置

parent 1d15bc67
...@@ -129,4 +129,33 @@ public class SysSpecialPerformanceController { ...@@ -129,4 +129,33 @@ public class SysSpecialPerformanceController {
return sysSpecialPerformanceService.findItemListById(dto); return sysSpecialPerformanceService.findItemListById(dto);
} }
@ApiOperation(value = "拍品排序")
@PostMapping("/itemSort")
public Result itemSort(@RequestBody SpecialPerformanceConfigRequestDto dto) {
logger.info("专场拍品排序,请求参数:{}", JSON.toJSONString(dto));
Validator validator = new Validator(FormHandler.ofEntity(dto));
validator.set("specialPerformanceId", "专场id").must().number()
.set("itemId", "商品id").must().number()
.set("lot", "lot").must().number()
.end();
if (!validator.isValid()) {
return Result.failed(validator.getErrorInfo());
}
return sysSpecialPerformanceService.itemSort(dto);
}
@ApiOperation(value = "根据lot配置截拍时间")
@PostMapping("/autoConfigTimeByLot")
public Result autoConfigTimeByLot(@RequestBody SpecialPerformanceConfigRequestDto dto) {
logger.info("专场配置截拍时间,请求参数:{}", JSON.toJSONString(dto));
Validator validator = new Validator(FormHandler.ofEntity(dto));
validator.set("specialPerformanceId", "专场id").must().number()
.end();
if (!validator.isValid()) {
return Result.failed(validator.getErrorInfo());
}
return sysSpecialPerformanceService.autoConfigTimeByLot(dto);
}
} }
...@@ -127,6 +127,7 @@ public class SysSpecialPerformanceServiceImpl implements SysSpecialPerformanceSe ...@@ -127,6 +127,7 @@ public class SysSpecialPerformanceServiceImpl implements SysSpecialPerformanceSe
SupplierItem supplierItem = supplierItemDao.findById(specialPerformanceConfig.getItemId()); SupplierItem supplierItem = supplierItemDao.findById(specialPerformanceConfig.getItemId());
SupplierItemVo supplierItemVo = new SupplierItemVo(); SupplierItemVo supplierItemVo = new SupplierItemVo();
EntityMapper.copyAttribute(supplierItem, supplierItemVo); EntityMapper.copyAttribute(supplierItem, supplierItemVo);
supplierItemVo.setLot(specialPerformanceConfig.getLot());
supplierItemVo.setDistributionPrice(PriceUtil.convertPriceFenToYuan(supplierItem.getDistributionPrice())); supplierItemVo.setDistributionPrice(PriceUtil.convertPriceFenToYuan(supplierItem.getDistributionPrice()));
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()));
...@@ -213,9 +214,11 @@ public class SysSpecialPerformanceServiceImpl implements SysSpecialPerformanceSe ...@@ -213,9 +214,11 @@ public class SysSpecialPerformanceServiceImpl implements SysSpecialPerformanceSe
if (flag) { if (flag) {
continue; continue;
} }
AuctionConfig auctionConfig = auctionConfigDao.findByItemId(Long.valueOf(itemId));
SpecialPerformanceConfig specialPerformanceConfig = new SpecialPerformanceConfig(); SpecialPerformanceConfig specialPerformanceConfig = new SpecialPerformanceConfig();
specialPerformanceConfig.setItemId(Long.valueOf(itemId)); specialPerformanceConfig.setItemId(Long.valueOf(itemId));
specialPerformanceConfig.setSpecialPerformanceId(dto.getSpecialPerformanceId()); specialPerformanceConfig.setSpecialPerformanceId(dto.getSpecialPerformanceId());
specialPerformanceConfig.setCurrentPrice(auctionConfig.getStartPrice());
specialPerformanceConfig.setState(SpecialPerformanceEnum.ConfigStateEnum.VALID.getCode()); specialPerformanceConfig.setState(SpecialPerformanceEnum.ConfigStateEnum.VALID.getCode());
Random random = new Random(); Random random = new Random();
int randomNumber = random.nextInt(20); int randomNumber = random.nextInt(20);
...@@ -258,4 +261,27 @@ public class SysSpecialPerformanceServiceImpl implements SysSpecialPerformanceSe ...@@ -258,4 +261,27 @@ public class SysSpecialPerformanceServiceImpl implements SysSpecialPerformanceSe
} }
return Result.failed(); return Result.failed();
} }
@Override
public Result itemSort(SpecialPerformanceConfigRequestDto dto) {
try {
//校验是否lot重复
boolean isExist = specialPerformanceConfigDao.isExistedSort(dto.getSpecialPerformanceId(), dto.getItemId(), dto.getLot());
if (isExist) {
return Result.failed("lot重复");
}
specialPerformanceConfigDao.itemSort(dto.getSpecialPerformanceId(), dto.getItemId(), dto.getLot());
return Result.success();
} catch (Exception e) {
logger.error("专场商品排序 error {}", e);
}
return Result.failed();
}
@Override
public Result autoConfigTimeByLot(SpecialPerformanceConfigRequestDto dto) {
return null;
}
} }
...@@ -378,6 +378,9 @@ public class SysSupplierItemServiceImpl implements SysSupplierItemService { ...@@ -378,6 +378,9 @@ public class SysSupplierItemServiceImpl implements SysSupplierItemService {
auctionConfig.setIsDeal(false); auctionConfig.setIsDeal(false);
} }
auctionConfigDao.update(auctionConfig); auctionConfigDao.update(auctionConfig);
//调整专场里商品的当前价
// List<SpecialPerformanceConfig> specialPerformanceConfigList = specialPerformanceConfigDao.findList();
// specialPerformanceConfigDao.update();
} }
long oldDistributionPrice = oldSupplierItem.getDistributionPrice(); long oldDistributionPrice = oldSupplierItem.getDistributionPrice();
if (oldDistributionPrice != PriceUtil.convertPriceFromStr(dto.getDistributionPrice())) { if (oldDistributionPrice != PriceUtil.convertPriceFromStr(dto.getDistributionPrice())) {
......
...@@ -71,4 +71,18 @@ public interface SysSpecialPerformanceService { ...@@ -71,4 +71,18 @@ public interface SysSpecialPerformanceService {
*/ */
Result reSale(SpecialPerformanceConfigRequestDto dto); Result reSale(SpecialPerformanceConfigRequestDto dto);
/**
* 专场商品排序
* @param dto
* @return
*/
Result itemSort(SpecialPerformanceConfigRequestDto dto);
/**
* 根据lot配置拍品截拍时间
* @param dto
* @return
*/
Result autoConfigTimeByLot(SpecialPerformanceConfigRequestDto dto);
} }
...@@ -5,6 +5,7 @@ public enum ShareTypeEnum { ...@@ -5,6 +5,7 @@ public enum ShareTypeEnum {
COLLECTOR_ITEM(1, "藏家藏品"), COLLECTOR_ITEM(1, "藏家藏品"),
COLLECTOR_PAGE(2, "藏家藏馆"), COLLECTOR_PAGE(2, "藏家藏馆"),
SYSTEM_ITEM(3, "平台藏品"), SYSTEM_ITEM(3, "平台藏品"),
COLLECTOR_AUCTION_ITEM(4, "藏家拍品"),
; ;
private Integer code; private Integer code;
......
...@@ -304,4 +304,9 @@ public class SupplierItemVo implements Entity { ...@@ -304,4 +304,9 @@ public class SupplierItemVo implements Entity {
*/ */
private Boolean isTransformAuction; private Boolean isTransformAuction;
/**
* 专场拍品编号
*/
private Integer lot;
} }
...@@ -25,4 +25,8 @@ public interface SpecialPerformanceConfigDao { ...@@ -25,4 +25,8 @@ public interface SpecialPerformanceConfigDao {
boolean isExisted(int specialPerformanceId, long itemId); boolean isExisted(int specialPerformanceId, long itemId);
boolean isExistedSort(int specialPerformanceId, long itemId, int lot);
boolean itemSort(int specialPerformanceId, long itemId, int lot);
} }
package com.wwdz.ch.db.domain.distribution; package com.wwdz.ch.db.domain.distribution;
import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Date; import java.util.Date;
import com.xxdxxs.entity.Entity; import com.xxdxxs.entity.Entity;
import lombok.Data; import lombok.Data;
/** /**
* @author shiyu * @author shiyu
* @date 2024/06/04 * @date 2024/06/26
*/ */
@Data @Data
public class SpecialPerformance implements Entity { public class SpecialPerformance implements Entity {
...@@ -46,6 +44,11 @@ public class SpecialPerformance implements Entity { ...@@ -46,6 +44,11 @@ public class SpecialPerformance implements Entity {
*/ */
private Date endTime; private Date endTime;
/**
* 商品结束间隔,单位分钟
*/
private Double itemEndInterval;
/** /**
* 专场类型1拍卖 * 专场类型1拍卖
*/ */
...@@ -71,6 +74,7 @@ public class SpecialPerformance implements Entity { ...@@ -71,6 +74,7 @@ public class SpecialPerformance implements Entity {
sb.append(", updateTime=").append(updateTime); sb.append(", updateTime=").append(updateTime);
sb.append(", startTime=").append(startTime); sb.append(", startTime=").append(startTime);
sb.append(", endTime=").append(endTime); sb.append(", endTime=").append(endTime);
sb.append(", itemEndInterval=").append(itemEndInterval);
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);
...@@ -97,6 +101,7 @@ public class SpecialPerformance implements Entity { ...@@ -97,6 +101,7 @@ public class SpecialPerformance implements Entity {
&& (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.getStartTime() == null ? other.getStartTime() == null : this.getStartTime().equals(other.getStartTime()))
&& (this.getEndTime() == null ? other.getEndTime() == null : this.getEndTime().equals(other.getEndTime())) && (this.getEndTime() == null ? other.getEndTime() == null : this.getEndTime().equals(other.getEndTime()))
&& (this.getItemEndInterval() == null ? other.getItemEndInterval() == null : this.getItemEndInterval().equals(other.getItemEndInterval()))
&& (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()));
} }
...@@ -112,6 +117,7 @@ public class SpecialPerformance implements Entity { ...@@ -112,6 +117,7 @@ public class SpecialPerformance implements Entity {
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 + ((getStartTime() == null) ? 0 : getStartTime().hashCode());
result = prime * result + ((getEndTime() == null) ? 0 : getEndTime().hashCode()); result = prime * result + ((getEndTime() == null) ? 0 : getEndTime().hashCode());
result = prime * result + ((getItemEndInterval() == null) ? 0 : getItemEndInterval().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;
...@@ -132,6 +138,7 @@ public class SpecialPerformance implements Entity { ...@@ -132,6 +138,7 @@ public class SpecialPerformance implements Entity {
updateTime("update_time", "updateTime", "TIMESTAMP", false), updateTime("update_time", "updateTime", "TIMESTAMP", false),
startTime("start_time", "startTime", "TIMESTAMP", false), startTime("start_time", "startTime", "TIMESTAMP", false),
endTime("end_time", "endTime", "TIMESTAMP", false), endTime("end_time", "endTime", "TIMESTAMP", false),
itemEndInterval("item_end_interval", "itemEndInterval", "DOUBLE", false),
type("type", "type", "INTEGER", true), type("type", "type", "INTEGER", true),
state("state", "state", "INTEGER", true); state("state", "state", "INTEGER", true);
......
package com.wwdz.ch.db.domain.distribution; package com.wwdz.ch.db.domain.distribution;
import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Date; import java.util.Date;
...@@ -9,7 +10,7 @@ import lombok.Data; ...@@ -9,7 +10,7 @@ import lombok.Data;
/** /**
* @author shiyu * @author shiyu
* @date 2024/05/29 * @date 2024/06/25
*/ */
@Data @Data
public class SpecialPerformanceConfig implements Entity { public class SpecialPerformanceConfig implements Entity {
...@@ -35,6 +36,16 @@ public class SpecialPerformanceConfig implements Entity { ...@@ -35,6 +36,16 @@ public class SpecialPerformanceConfig implements Entity {
*/ */
private Integer viewNum; private Integer viewNum;
/**
* 当前价,要除以100
*/
private Long currentPrice;
/**
* 编号
*/
private Integer lot;
/** /**
* 状态 * 状态
*/ */
...@@ -53,6 +64,8 @@ public class SpecialPerformanceConfig implements Entity { ...@@ -53,6 +64,8 @@ public class SpecialPerformanceConfig implements Entity {
sb.append(", itemId=").append(itemId); sb.append(", itemId=").append(itemId);
sb.append(", createTime=").append(createTime); sb.append(", createTime=").append(createTime);
sb.append(", viewNum=").append(viewNum); sb.append(", viewNum=").append(viewNum);
sb.append(", currentPrice=").append(currentPrice);
sb.append(", lot=").append(lot);
sb.append(", state=").append(state); sb.append(", state=").append(state);
sb.append(", serialVersionUID=").append(serialVersionUID); sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]"); sb.append("]");
...@@ -76,6 +89,8 @@ public class SpecialPerformanceConfig implements Entity { ...@@ -76,6 +89,8 @@ public class SpecialPerformanceConfig implements Entity {
&& (this.getItemId() == null ? other.getItemId() == null : this.getItemId().equals(other.getItemId())) && (this.getItemId() == null ? other.getItemId() == null : this.getItemId().equals(other.getItemId()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getViewNum() == null ? other.getViewNum() == null : this.getViewNum().equals(other.getViewNum())) && (this.getViewNum() == null ? other.getViewNum() == null : this.getViewNum().equals(other.getViewNum()))
&& (this.getCurrentPrice() == null ? other.getCurrentPrice() == null : this.getCurrentPrice().equals(other.getCurrentPrice()))
&& (this.getLot() == null ? other.getLot() == null : this.getLot().equals(other.getLot()))
&& (this.getState() == null ? other.getState() == null : this.getState().equals(other.getState())); && (this.getState() == null ? other.getState() == null : this.getState().equals(other.getState()));
} }
...@@ -88,6 +103,8 @@ public class SpecialPerformanceConfig implements Entity { ...@@ -88,6 +103,8 @@ public class SpecialPerformanceConfig implements Entity {
result = prime * result + ((getItemId() == null) ? 0 : getItemId().hashCode()); result = prime * result + ((getItemId() == null) ? 0 : getItemId().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getViewNum() == null) ? 0 : getViewNum().hashCode()); result = prime * result + ((getViewNum() == null) ? 0 : getViewNum().hashCode());
result = prime * result + ((getCurrentPrice() == null) ? 0 : getCurrentPrice().hashCode());
result = prime * result + ((getLot() == null) ? 0 : getLot().hashCode());
result = prime * result + ((getState() == null) ? 0 : getState().hashCode()); result = prime * result + ((getState() == null) ? 0 : getState().hashCode());
return result; return result;
} }
...@@ -105,6 +122,8 @@ public class SpecialPerformanceConfig implements Entity { ...@@ -105,6 +122,8 @@ public class SpecialPerformanceConfig implements Entity {
itemId("item_id", "itemId", "BIGINT", false), itemId("item_id", "itemId", "BIGINT", false),
createTime("create_time", "createTime", "TIMESTAMP", false), createTime("create_time", "createTime", "TIMESTAMP", false),
viewNum("view_num", "viewNum", "INTEGER", false), viewNum("view_num", "viewNum", "INTEGER", false),
currentPrice("current_price", "currentPrice", "BIGINT", false),
lot("lot", "lot", "INTEGER", false),
state("state", "state", "INTEGER", true); state("state", "state", "INTEGER", true);
/** /**
......
...@@ -808,6 +808,270 @@ public class SpecialPerformanceConfigExample { ...@@ -808,6 +808,270 @@ public class SpecialPerformanceConfigExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCurrentPriceIsNull() {
addCriterion("current_price is null");
return (Criteria) this;
}
public Criteria andCurrentPriceIsNotNull() {
addCriterion("current_price is not null");
return (Criteria) this;
}
public Criteria andCurrentPriceEqualTo(Long value) {
addCriterion("current_price =", value, "currentPrice");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table special_performance_config
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCurrentPriceEqualToColumn(SpecialPerformanceConfig.Column column) {
addCriterion(new StringBuilder("current_price = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andCurrentPriceNotEqualTo(Long value) {
addCriterion("current_price <>", value, "currentPrice");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table special_performance_config
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCurrentPriceNotEqualToColumn(SpecialPerformanceConfig.Column column) {
addCriterion(new StringBuilder("current_price <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andCurrentPriceGreaterThan(Long value) {
addCriterion("current_price >", value, "currentPrice");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table special_performance_config
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCurrentPriceGreaterThanColumn(SpecialPerformanceConfig.Column column) {
addCriterion(new StringBuilder("current_price > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andCurrentPriceGreaterThanOrEqualTo(Long value) {
addCriterion("current_price >=", value, "currentPrice");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table special_performance_config
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCurrentPriceGreaterThanOrEqualToColumn(SpecialPerformanceConfig.Column column) {
addCriterion(new StringBuilder("current_price >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andCurrentPriceLessThan(Long value) {
addCriterion("current_price <", value, "currentPrice");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table special_performance_config
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCurrentPriceLessThanColumn(SpecialPerformanceConfig.Column column) {
addCriterion(new StringBuilder("current_price < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andCurrentPriceLessThanOrEqualTo(Long value) {
addCriterion("current_price <=", value, "currentPrice");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table special_performance_config
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCurrentPriceLessThanOrEqualToColumn(SpecialPerformanceConfig.Column column) {
addCriterion(new StringBuilder("current_price <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andCurrentPriceIn(List<Long> values) {
addCriterion("current_price in", values, "currentPrice");
return (Criteria) this;
}
public Criteria andCurrentPriceNotIn(List<Long> values) {
addCriterion("current_price not in", values, "currentPrice");
return (Criteria) this;
}
public Criteria andCurrentPriceBetween(Long value1, Long value2) {
addCriterion("current_price between", value1, value2, "currentPrice");
return (Criteria) this;
}
public Criteria andCurrentPriceNotBetween(Long value1, Long value2) {
addCriterion("current_price not between", value1, value2, "currentPrice");
return (Criteria) this;
}
public Criteria andLotIsNull() {
addCriterion("lot is null");
return (Criteria) this;
}
public Criteria andLotIsNotNull() {
addCriterion("lot is not null");
return (Criteria) this;
}
public Criteria andLotEqualTo(Integer value) {
addCriterion("lot =", value, "lot");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table special_performance_config
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andLotEqualToColumn(SpecialPerformanceConfig.Column column) {
addCriterion(new StringBuilder("lot = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andLotNotEqualTo(Integer value) {
addCriterion("lot <>", value, "lot");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table special_performance_config
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andLotNotEqualToColumn(SpecialPerformanceConfig.Column column) {
addCriterion(new StringBuilder("lot <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andLotGreaterThan(Integer value) {
addCriterion("lot >", value, "lot");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table special_performance_config
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andLotGreaterThanColumn(SpecialPerformanceConfig.Column column) {
addCriterion(new StringBuilder("lot > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andLotGreaterThanOrEqualTo(Integer value) {
addCriterion("lot >=", value, "lot");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table special_performance_config
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andLotGreaterThanOrEqualToColumn(SpecialPerformanceConfig.Column column) {
addCriterion(new StringBuilder("lot >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andLotLessThan(Integer value) {
addCriterion("lot <", value, "lot");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table special_performance_config
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andLotLessThanColumn(SpecialPerformanceConfig.Column column) {
addCriterion(new StringBuilder("lot < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andLotLessThanOrEqualTo(Integer value) {
addCriterion("lot <=", value, "lot");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table special_performance_config
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andLotLessThanOrEqualToColumn(SpecialPerformanceConfig.Column column) {
addCriterion(new StringBuilder("lot <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andLotIn(List<Integer> values) {
addCriterion("lot in", values, "lot");
return (Criteria) this;
}
public Criteria andLotNotIn(List<Integer> values) {
addCriterion("lot not in", values, "lot");
return (Criteria) this;
}
public Criteria andLotBetween(Integer value1, Integer value2) {
addCriterion("lot between", value1, value2, "lot");
return (Criteria) this;
}
public Criteria andLotNotBetween(Integer value1, Integer value2) {
addCriterion("lot not between", value1, value2, "lot");
return (Criteria) this;
}
public Criteria andStateIsNull() { public Criteria andStateIsNull() {
addCriterion("`state` is null"); addCriterion("`state` is null");
return (Criteria) this; return (Criteria) this;
......
...@@ -1092,6 +1092,138 @@ public class SpecialPerformanceExample { ...@@ -1092,6 +1092,138 @@ public class SpecialPerformanceExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andItemEndIntervalIsNull() {
addCriterion("item_end_interval is null");
return (Criteria) this;
}
public Criteria andItemEndIntervalIsNotNull() {
addCriterion("item_end_interval is not null");
return (Criteria) this;
}
public Criteria andItemEndIntervalEqualTo(Double value) {
addCriterion("item_end_interval =", value, "itemEndInterval");
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 andItemEndIntervalEqualToColumn(SpecialPerformance.Column column) {
addCriterion(new StringBuilder("item_end_interval = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andItemEndIntervalNotEqualTo(Double value) {
addCriterion("item_end_interval <>", value, "itemEndInterval");
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 andItemEndIntervalNotEqualToColumn(SpecialPerformance.Column column) {
addCriterion(new StringBuilder("item_end_interval <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andItemEndIntervalGreaterThan(Double value) {
addCriterion("item_end_interval >", value, "itemEndInterval");
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 andItemEndIntervalGreaterThanColumn(SpecialPerformance.Column column) {
addCriterion(new StringBuilder("item_end_interval > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andItemEndIntervalGreaterThanOrEqualTo(Double value) {
addCriterion("item_end_interval >=", value, "itemEndInterval");
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 andItemEndIntervalGreaterThanOrEqualToColumn(SpecialPerformance.Column column) {
addCriterion(new StringBuilder("item_end_interval >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andItemEndIntervalLessThan(Double value) {
addCriterion("item_end_interval <", value, "itemEndInterval");
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 andItemEndIntervalLessThanColumn(SpecialPerformance.Column column) {
addCriterion(new StringBuilder("item_end_interval < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andItemEndIntervalLessThanOrEqualTo(Double value) {
addCriterion("item_end_interval <=", value, "itemEndInterval");
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 andItemEndIntervalLessThanOrEqualToColumn(SpecialPerformance.Column column) {
addCriterion(new StringBuilder("item_end_interval <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andItemEndIntervalIn(List<Double> values) {
addCriterion("item_end_interval in", values, "itemEndInterval");
return (Criteria) this;
}
public Criteria andItemEndIntervalNotIn(List<Double> values) {
addCriterion("item_end_interval not in", values, "itemEndInterval");
return (Criteria) this;
}
public Criteria andItemEndIntervalBetween(Double value1, Double value2) {
addCriterion("item_end_interval between", value1, value2, "itemEndInterval");
return (Criteria) this;
}
public Criteria andItemEndIntervalNotBetween(Double value1, Double value2) {
addCriterion("item_end_interval not between", value1, value2, "itemEndInterval");
return (Criteria) this;
}
public Criteria andTypeIsNull() { public Criteria andTypeIsNull() {
addCriterion("`type` is null"); addCriterion("`type` is null");
return (Criteria) this; return (Criteria) this;
......
...@@ -27,6 +27,11 @@ public class SpecialPerformanceConfigRequestDto extends BaseRequestDto implement ...@@ -27,6 +27,11 @@ public class SpecialPerformanceConfigRequestDto extends BaseRequestDto implement
*/ */
private Long itemId; private Long itemId;
/**
* 编号
*/
private Integer lot;
/** /**
* 创建时间 * 创建时间
*/ */
......
...@@ -22,6 +22,11 @@ public class SpecialPerformanceRequestDto extends BaseRequestDto implements Enti ...@@ -22,6 +22,11 @@ public class SpecialPerformanceRequestDto extends BaseRequestDto implements Enti
*/ */
private String backgroundImage; private String backgroundImage;
/**
* 商品结束间隔,单位分钟
*/
private Double itemEndInterval;
/** /**
* 专场名称 * 专场名称
*/ */
......
...@@ -111,4 +111,27 @@ public class SpecialPerformanceConfigDaoImpl implements SpecialPerformanceConfig ...@@ -111,4 +111,27 @@ public class SpecialPerformanceConfigDaoImpl implements SpecialPerformanceConfig
criteria.andStateEqualTo(1); criteria.andStateEqualTo(1);
return specialPerformanceConfigMapper.countByExample(example) > 0; return specialPerformanceConfigMapper.countByExample(example) > 0;
} }
@Override
public boolean isExistedSort(int specialPerformanceId, long itemId, int lot) {
SpecialPerformanceConfigExample example = new SpecialPerformanceConfigExample();
SpecialPerformanceConfigExample.Criteria criteria = example.createCriteria();
criteria.andSpecialPerformanceIdEqualTo(specialPerformanceId);
criteria.andItemIdEqualTo(itemId);
criteria.andLotEqualTo(lot);
criteria.andStateEqualTo(1);
return specialPerformanceConfigMapper.countByExample(example) > 0;
}
@Override
public boolean itemSort(int specialPerformanceId, long itemId, int lot) {
SpecialPerformanceConfigExample example = new SpecialPerformanceConfigExample();
SpecialPerformanceConfigExample.Criteria criteria = example.createCriteria();
criteria.andSpecialPerformanceIdEqualTo(specialPerformanceId);
criteria.andItemIdEqualTo(itemId);
SpecialPerformanceConfig specialPerformanceConfig = new SpecialPerformanceConfig();
specialPerformanceConfig.setLot(lot);
return specialPerformanceConfigMapper.updateByExampleSelective(specialPerformanceConfig, example) > 0;
}
} }
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
<result column="item_id" jdbcType="BIGINT" property="itemId" /> <result column="item_id" jdbcType="BIGINT" property="itemId" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="view_num" jdbcType="INTEGER" property="viewNum" /> <result column="view_num" jdbcType="INTEGER" property="viewNum" />
<result column="current_price" jdbcType="BIGINT" property="currentPrice" />
<result column="lot" jdbcType="INTEGER" property="lot" />
<result column="state" jdbcType="INTEGER" property="state" /> <result column="state" jdbcType="INTEGER" property="state" />
</resultMap> </resultMap>
<sql id="Example_Where_Clause"> <sql id="Example_Where_Clause">
...@@ -68,7 +70,7 @@ ...@@ -68,7 +70,7 @@
</where> </where>
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, special_performance_id, item_id, create_time, view_num, `state` id, special_performance_id, item_id, create_time, view_num, current_price, lot, `state`
</sql> </sql>
<select id="selectByExample" parameterType="com.wwdz.ch.db.domain.distribution.SpecialPerformanceConfigExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="com.wwdz.ch.db.domain.distribution.SpecialPerformanceConfigExample" resultMap="BaseResultMap">
select select
...@@ -97,13 +99,14 @@ ...@@ -97,13 +99,14 @@
distinct distinct
</if> </if>
<choose> <choose>
<when test="selective != null and selective.length > 0"> <when test="selective != null and selective.length &gt; 0">
<foreach collection="selective" item="column" separator=","> <foreach collection="selective" item="column" separator=",">
${column.escapedColumnName} ${column.escapedColumnName}
</foreach> </foreach>
</when> </when>
<otherwise> <otherwise>
id, special_performance_id, item_id, create_time, view_num, `state` id, special_performance_id, item_id, create_time, view_num, current_price, lot, `state`
</otherwise> </otherwise>
</choose> </choose>
from special_performance_config from special_performance_config
...@@ -128,13 +131,14 @@ ...@@ -128,13 +131,14 @@
--> -->
select select
<choose> <choose>
<when test="selective != null and selective.length > 0"> <when test="selective != null and selective.length &gt; 0">
<foreach collection="selective" item="column" separator=","> <foreach collection="selective" item="column" separator=",">
${column.escapedColumnName} ${column.escapedColumnName}
</foreach> </foreach>
</when> </when>
<otherwise> <otherwise>
id, special_performance_id, item_id, create_time, view_num, `state` id, special_performance_id, item_id, create_time, view_num, current_price, lot, `state`
</otherwise> </otherwise>
</choose> </choose>
from special_performance_config from special_performance_config
...@@ -155,9 +159,11 @@ ...@@ -155,9 +159,11 @@
SELECT LAST_INSERT_ID() SELECT LAST_INSERT_ID()
</selectKey> </selectKey>
insert into special_performance_config (special_performance_id, item_id, create_time, insert into special_performance_config (special_performance_id, item_id, create_time,
view_num, `state`) view_num, current_price, lot,
`state`)
values (#{specialPerformanceId,jdbcType=INTEGER}, #{itemId,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP}, values (#{specialPerformanceId,jdbcType=INTEGER}, #{itemId,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP},
#{viewNum,jdbcType=INTEGER}, #{state,jdbcType=INTEGER}) #{viewNum,jdbcType=INTEGER}, #{currentPrice,jdbcType=BIGINT}, #{lot,jdbcType=INTEGER},
#{state,jdbcType=INTEGER})
</insert> </insert>
<insert id="insertSelective" parameterType="com.wwdz.ch.db.domain.distribution.SpecialPerformanceConfig"> <insert id="insertSelective" parameterType="com.wwdz.ch.db.domain.distribution.SpecialPerformanceConfig">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer"> <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
...@@ -177,6 +183,12 @@ ...@@ -177,6 +183,12 @@
<if test="viewNum != null"> <if test="viewNum != null">
view_num, view_num,
</if> </if>
<if test="currentPrice != null">
current_price,
</if>
<if test="lot != null">
lot,
</if>
<if test="state != null"> <if test="state != null">
`state`, `state`,
</if> </if>
...@@ -194,6 +206,12 @@ ...@@ -194,6 +206,12 @@
<if test="viewNum != null"> <if test="viewNum != null">
#{viewNum,jdbcType=INTEGER}, #{viewNum,jdbcType=INTEGER},
</if> </if>
<if test="currentPrice != null">
#{currentPrice,jdbcType=BIGINT},
</if>
<if test="lot != null">
#{lot,jdbcType=INTEGER},
</if>
<if test="state != null"> <if test="state != null">
#{state,jdbcType=INTEGER}, #{state,jdbcType=INTEGER},
</if> </if>
...@@ -223,6 +241,12 @@ ...@@ -223,6 +241,12 @@
<if test="record.viewNum != null"> <if test="record.viewNum != null">
view_num = #{record.viewNum,jdbcType=INTEGER}, view_num = #{record.viewNum,jdbcType=INTEGER},
</if> </if>
<if test="record.currentPrice != null">
current_price = #{record.currentPrice,jdbcType=BIGINT},
</if>
<if test="record.lot != null">
lot = #{record.lot,jdbcType=INTEGER},
</if>
<if test="record.state != null"> <if test="record.state != null">
`state` = #{record.state,jdbcType=INTEGER}, `state` = #{record.state,jdbcType=INTEGER},
</if> </if>
...@@ -238,6 +262,8 @@ ...@@ -238,6 +262,8 @@
item_id = #{record.itemId,jdbcType=BIGINT}, item_id = #{record.itemId,jdbcType=BIGINT},
create_time = #{record.createTime,jdbcType=TIMESTAMP}, create_time = #{record.createTime,jdbcType=TIMESTAMP},
view_num = #{record.viewNum,jdbcType=INTEGER}, view_num = #{record.viewNum,jdbcType=INTEGER},
current_price = #{record.currentPrice,jdbcType=BIGINT},
lot = #{record.lot,jdbcType=INTEGER},
`state` = #{record.state,jdbcType=INTEGER} `state` = #{record.state,jdbcType=INTEGER}
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
...@@ -258,6 +284,12 @@ ...@@ -258,6 +284,12 @@
<if test="viewNum != null"> <if test="viewNum != null">
view_num = #{viewNum,jdbcType=INTEGER}, view_num = #{viewNum,jdbcType=INTEGER},
</if> </if>
<if test="currentPrice != null">
current_price = #{currentPrice,jdbcType=BIGINT},
</if>
<if test="lot != null">
lot = #{lot,jdbcType=INTEGER},
</if>
<if test="state != null"> <if test="state != null">
`state` = #{state,jdbcType=INTEGER}, `state` = #{state,jdbcType=INTEGER},
</if> </if>
...@@ -270,6 +302,8 @@ ...@@ -270,6 +302,8 @@
item_id = #{itemId,jdbcType=BIGINT}, item_id = #{itemId,jdbcType=BIGINT},
create_time = #{createTime,jdbcType=TIMESTAMP}, create_time = #{createTime,jdbcType=TIMESTAMP},
view_num = #{viewNum,jdbcType=INTEGER}, view_num = #{viewNum,jdbcType=INTEGER},
current_price = #{currentPrice,jdbcType=BIGINT},
lot = #{lot,jdbcType=INTEGER},
`state` = #{state,jdbcType=INTEGER} `state` = #{state,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</update> </update>
...@@ -300,13 +334,14 @@ ...@@ -300,13 +334,14 @@
select select
'true' as QUERYID, 'true' as QUERYID,
<choose> <choose>
<when test="selective != null and selective.length > 0"> <when test="selective != null and selective.length &gt; 0">
<foreach collection="selective" item="column" separator=","> <foreach collection="selective" item="column" separator=",">
${column.escapedColumnName} ${column.escapedColumnName}
</foreach> </foreach>
</when> </when>
<otherwise> <otherwise>
id, special_performance_id, item_id, create_time, view_num, `state` id, special_performance_id, item_id, create_time, view_num, current_price, lot, `state`
</otherwise> </otherwise>
</choose> </choose>
from special_performance_config from special_performance_config
...@@ -318,7 +353,6 @@ ...@@ -318,7 +353,6 @@
</if> </if>
limit 1 limit 1
</select> </select>
<select id="countViewNum" parameterType="java.lang.Integer" resultType="java.lang.Long"> <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 IFNULL(sum(view_num),0) from special_performance_config where special_performance_id = #{specialPerformanceId} and state = 1
</select> </select>
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /> <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="start_time" jdbcType="TIMESTAMP" property="startTime" /> <result column="start_time" jdbcType="TIMESTAMP" property="startTime" />
<result column="end_time" jdbcType="TIMESTAMP" property="endTime" /> <result column="end_time" jdbcType="TIMESTAMP" property="endTime" />
<result column="item_end_interval" jdbcType="DOUBLE" property="itemEndInterval" />
<result column="type" jdbcType="INTEGER" property="type" /> <result column="type" jdbcType="INTEGER" property="type" />
<result column="state" jdbcType="INTEGER" property="state" /> <result column="state" jdbcType="INTEGER" property="state" />
</resultMap> </resultMap>
...@@ -71,8 +72,8 @@ ...@@ -71,8 +72,8 @@
</where> </where>
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, title, background_image, create_time, update_time, start_time, end_time, `type`, id, title, background_image, create_time, update_time, start_time, end_time, item_end_interval,
`state` `type`, `state`
</sql> </sql>
<select id="selectByExample" parameterType="com.wwdz.ch.db.domain.distribution.SpecialPerformanceExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="com.wwdz.ch.db.domain.distribution.SpecialPerformanceExample" resultMap="BaseResultMap">
select select
...@@ -107,8 +108,8 @@ ...@@ -107,8 +108,8 @@
</foreach> </foreach>
</when> </when>
<otherwise> <otherwise>
id, title, background_image, create_time, update_time, start_time, end_time, `type`, id, title, background_image, create_time, update_time, start_time, end_time, item_end_interval,
`state` `type`, `state`
</otherwise> </otherwise>
</choose> </choose>
from special_performance from special_performance
...@@ -139,8 +140,8 @@ ...@@ -139,8 +140,8 @@
</foreach> </foreach>
</when> </when>
<otherwise> <otherwise>
id, title, background_image, create_time, update_time, start_time, end_time, `type`, id, title, background_image, create_time, update_time, start_time, end_time, item_end_interval,
`state` `type`, `state`
</otherwise> </otherwise>
</choose> </choose>
from special_performance from special_performance
...@@ -162,10 +163,12 @@ ...@@ -162,10 +163,12 @@
</selectKey> </selectKey>
insert into special_performance (title, background_image, create_time, insert into special_performance (title, background_image, create_time,
update_time, start_time, end_time, update_time, start_time, end_time,
`type`, `state`) item_end_interval, `type`, `state`
)
values (#{title,jdbcType=VARCHAR}, #{backgroundImage,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, values (#{title,jdbcType=VARCHAR}, #{backgroundImage,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP}, #{startTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{startTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP},
#{type,jdbcType=INTEGER}, #{state,jdbcType=INTEGER}) #{itemEndInterval,jdbcType=DOUBLE}, #{type,jdbcType=INTEGER}, #{state,jdbcType=INTEGER}
)
</insert> </insert>
<insert id="insertSelective" parameterType="com.wwdz.ch.db.domain.distribution.SpecialPerformance"> <insert id="insertSelective" parameterType="com.wwdz.ch.db.domain.distribution.SpecialPerformance">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer"> <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
...@@ -191,6 +194,9 @@ ...@@ -191,6 +194,9 @@
<if test="endTime != null"> <if test="endTime != null">
end_time, end_time,
</if> </if>
<if test="itemEndInterval != null">
item_end_interval,
</if>
<if test="type != null"> <if test="type != null">
`type`, `type`,
</if> </if>
...@@ -217,6 +223,9 @@ ...@@ -217,6 +223,9 @@
<if test="endTime != null"> <if test="endTime != null">
#{endTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP},
</if> </if>
<if test="itemEndInterval != null">
#{itemEndInterval,jdbcType=DOUBLE},
</if>
<if test="type != null"> <if test="type != null">
#{type,jdbcType=INTEGER}, #{type,jdbcType=INTEGER},
</if> </if>
...@@ -255,6 +264,9 @@ ...@@ -255,6 +264,9 @@
<if test="record.endTime != null"> <if test="record.endTime != null">
end_time = #{record.endTime,jdbcType=TIMESTAMP}, end_time = #{record.endTime,jdbcType=TIMESTAMP},
</if> </if>
<if test="record.itemEndInterval != null">
item_end_interval = #{record.itemEndInterval,jdbcType=DOUBLE},
</if>
<if test="record.type != null"> <if test="record.type != null">
`type` = #{record.type,jdbcType=INTEGER}, `type` = #{record.type,jdbcType=INTEGER},
</if> </if>
...@@ -275,6 +287,7 @@ ...@@ -275,6 +287,7 @@
update_time = #{record.updateTime,jdbcType=TIMESTAMP}, update_time = #{record.updateTime,jdbcType=TIMESTAMP},
start_time = #{record.startTime,jdbcType=TIMESTAMP}, start_time = #{record.startTime,jdbcType=TIMESTAMP},
end_time = #{record.endTime,jdbcType=TIMESTAMP}, end_time = #{record.endTime,jdbcType=TIMESTAMP},
item_end_interval = #{record.itemEndInterval,jdbcType=DOUBLE},
`type` = #{record.type,jdbcType=INTEGER}, `type` = #{record.type,jdbcType=INTEGER},
`state` = #{record.state,jdbcType=INTEGER} `state` = #{record.state,jdbcType=INTEGER}
<if test="_parameter != null"> <if test="_parameter != null">
...@@ -302,6 +315,9 @@ ...@@ -302,6 +315,9 @@
<if test="endTime != null"> <if test="endTime != null">
end_time = #{endTime,jdbcType=TIMESTAMP}, end_time = #{endTime,jdbcType=TIMESTAMP},
</if> </if>
<if test="itemEndInterval != null">
item_end_interval = #{itemEndInterval,jdbcType=DOUBLE},
</if>
<if test="type != null"> <if test="type != null">
`type` = #{type,jdbcType=INTEGER}, `type` = #{type,jdbcType=INTEGER},
</if> </if>
...@@ -319,6 +335,7 @@ ...@@ -319,6 +335,7 @@
update_time = #{updateTime,jdbcType=TIMESTAMP}, update_time = #{updateTime,jdbcType=TIMESTAMP},
start_time = #{startTime,jdbcType=TIMESTAMP}, start_time = #{startTime,jdbcType=TIMESTAMP},
end_time = #{endTime,jdbcType=TIMESTAMP}, end_time = #{endTime,jdbcType=TIMESTAMP},
item_end_interval = #{itemEndInterval,jdbcType=DOUBLE},
`type` = #{type,jdbcType=INTEGER}, `type` = #{type,jdbcType=INTEGER},
`state` = #{state,jdbcType=INTEGER} `state` = #{state,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
...@@ -356,8 +373,8 @@ ...@@ -356,8 +373,8 @@
</foreach> </foreach>
</when> </when>
<otherwise> <otherwise>
id, title, background_image, create_time, update_time, start_time, end_time, `type`, id, title, background_image, create_time, update_time, start_time, end_time, item_end_interval,
`state` `type`, `state`
</otherwise> </otherwise>
</choose> </choose>
from special_performance from special_performance
......
...@@ -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="auction_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>
......
...@@ -254,6 +254,8 @@ public class SelfPageServiceImpl implements SelfPageService { ...@@ -254,6 +254,8 @@ public class SelfPageServiceImpl implements SelfPageService {
map.put("wechatQrCode", user.getWechatQrCode()); map.put("wechatQrCode", user.getWechatQrCode());
long followerNum = followFansRecordDao.countFollowers(itemUserId); long followerNum = followFansRecordDao.countFollowers(itemUserId);
map.put("followerNum", followerNum); map.put("followerNum", followerNum);
long fansNum = followFansRecordDao.countFans(itemUserId);
map.put("fansNum", fansNum);
map.put("targetUserId", itemUserId); map.put("targetUserId", itemUserId);
long count = supplierItemDao.countByCreatorId(itemUserId); long count = supplierItemDao.countByCreatorId(itemUserId);
map.put("count", count); map.put("count", count);
......
...@@ -330,4 +330,8 @@ public class SpecialPerformanceServiceImpl implements SpecialPerformanceService ...@@ -330,4 +330,8 @@ public class SpecialPerformanceServiceImpl implements SpecialPerformanceService
} }
return Result.failed(); return Result.failed();
} }
} }
...@@ -508,15 +508,20 @@ public class SupplierItemServiceImpl implements SupplierItemService { ...@@ -508,15 +508,20 @@ public class SupplierItemServiceImpl implements SupplierItemService {
Date previewStartTime = Date.from(startInstant); Date previewStartTime = Date.from(startInstant);
Long itemId; Long itemId;
String shareRecordId = dto.getShareRecordId(); String shareRecordId = dto.getShareRecordId();
DistributorShareRecord distributorShareRecord = null; CollectionShareRecord collectionShareRecord = null;
if (StringUtils.isEmpty(shareRecordId) && dto.getId() == null) { if (StringUtils.isEmpty(shareRecordId) && dto.getId() == null) {
return Result.failed("商品信息为空"); return Result.failed("商品信息为空");
} else if (StringUtils.hasLength(shareRecordId) && !shareRecordId.equals(CommConsts.DEFAULT_SHARE_ID)) { } else if (StringUtils.hasLength(shareRecordId) && ! shareRecordId.equals(CommConsts.DEFAULT_SHARE_ID)) {
distributorShareRecord = distributorShareRecordDao.findById(shareRecordId); collectionShareRecord = collectionShareRecordDao.findById(dto.getShareRecordId());
if (distributorShareRecord == null || !distributorShareRecord.getEnabled()) { itemId = collectionShareRecord.getShareTargetId();
return Result.failed("该商品已下架"); if (collectionShareRecord.getItemUserId().longValue() != dto.getUserId().longValue()) {
} else { //客态进入别人的藏馆,自动关注
itemId = distributorShareRecord.getItemId(); FollowFansRecordRequestDto followFansRecordRequestDto = new FollowFansRecordRequestDto();
followFansRecordRequestDto.setFollowerId(collectionShareRecord.getItemUserId());
followFansRecordRequestDto.setFansId(dto.getUserId());
followFansRecordRequestDto.setIntroducerId(collectionShareRecord.getSharerId());
followFansRecordService.follow(followFansRecordRequestDto);
logger.info("通过藏品详情分享点击,用户id:{} 关注了 用户id为 {}, 介绍人为", dto.getUserId(), collectionShareRecord.getItemUserId(), collectionShareRecord.getSharerId());
} }
} else { } else {
itemId = dto.getId(); itemId = dto.getId();
...@@ -525,25 +530,11 @@ public class SupplierItemServiceImpl implements SupplierItemService { ...@@ -525,25 +530,11 @@ public class SupplierItemServiceImpl implements SupplierItemService {
return Result.failed("没有对应的商品id"); return Result.failed("没有对应的商品id");
} }
if (StringUtils.hasLength(shareRecordId) && !shareRecordId.equals(CommConsts.DEFAULT_SHARE_ID)) { if (StringUtils.hasLength(shareRecordId) && !shareRecordId.equals(CommConsts.DEFAULT_SHARE_ID)) {
if (distributorShareRecord.getDistributorId().longValue() != dto.getUserId().longValue()) { if (collectionShareRecord.getItemUserId().longValue() != dto.getUserId().longValue()) {
//做浏览记录
boolean flag = userRecentBrowseDao.isExisted(dto.getUserId(), distributorShareRecord.getDistributorId());
if (!flag) {
UserRecentBrowse newRecord = new UserRecentBrowse();
newRecord.setShareRecordId(dto.getShareRecordId());
newRecord.setSharerId(distributorShareRecord.getDistributorId());
newRecord.setUserId(dto.getUserId());
newRecord.setCreateTime(new Date());
newRecord.setUpdateTime(new Date());
newRecord.setType(DistributionEnum.UserBrowseTypeEnum.PLATFORM_ITEM.getCode());
newRecord.setSharedUserId(distributorShareRecord.getDistributorId());
userRecentBrowseDao.insert(newRecord);
}
}
} else {
//拍卖专场进入详情页,增加围观次数 //拍卖专场进入详情页,增加围观次数
specialPerformanceConfigDao.addViewNum(itemId); specialPerformanceConfigDao.addViewNum(itemId);
} }
}
//查询商品所属专场id //查询商品所属专场id
SpecialPerformanceConfigRequestDto specialPerformanceConfigRequestDto = new SpecialPerformanceConfigRequestDto(); SpecialPerformanceConfigRequestDto specialPerformanceConfigRequestDto = new SpecialPerformanceConfigRequestDto();
specialPerformanceConfigRequestDto.setItemId(itemId); specialPerformanceConfigRequestDto.setItemId(itemId);
......
package com.wwdz.ch.wx.service.distribution; package com.wwdz.ch.wx.service.distribution;
import com.wwdz.ch.core.type.Result; import com.wwdz.ch.core.type.Result;
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.SpecialPerformanceRequestDto;
public interface SpecialPerformanceService { public interface SpecialPerformanceService {
...@@ -23,4 +24,6 @@ public interface SpecialPerformanceService { ...@@ -23,4 +24,6 @@ public interface SpecialPerformanceService {
* @return * @return
*/ */
Result sendMsg(); Result sendMsg();
} }
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