Commit c4b974a4 authored by shiyu's avatar shiyu

后台订单管理

parent c197ea72
...@@ -3,6 +3,7 @@ package com.wwdz.ch.admin.impl; ...@@ -3,6 +3,7 @@ package com.wwdz.ch.admin.impl;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.wwdz.ch.admin.entity.vo.SysDistributionOrderVo; import com.wwdz.ch.admin.entity.vo.SysDistributionOrderVo;
import com.wwdz.ch.admin.service.SysDistributionOrderService; import com.wwdz.ch.admin.service.SysDistributionOrderService;
import com.wwdz.ch.core.consts.CommConsts;
import com.wwdz.ch.core.consts.DistributionEnum; import com.wwdz.ch.core.consts.DistributionEnum;
import com.wwdz.ch.core.type.PageSearchResult; import com.wwdz.ch.core.type.PageSearchResult;
import com.wwdz.ch.core.type.Result; import com.wwdz.ch.core.type.Result;
...@@ -79,12 +80,9 @@ public class SysDistributionOrderServiceImpl implements SysDistributionOrderServ ...@@ -79,12 +80,9 @@ public class SysDistributionOrderServiceImpl implements SysDistributionOrderServ
return Result.success(); return Result.success();
} }
} }
if (dto.getType() == DistributionEnum.DistributionTypeEnum.COLLECT.getCode()) { if (dto.getType() == null) {
dto.setType(DistributionEnum.DistributionTypeEnum.COLLECT.getCode());
} else {
dto.setTypeList(Arrays.asList(DistributionEnum.DistributionTypeEnum.FIXED_PRICE.getCode(), DistributionEnum.DistributionTypeEnum.AUCTION.getCode())); dto.setTypeList(Arrays.asList(DistributionEnum.DistributionTypeEnum.FIXED_PRICE.getCode(), DistributionEnum.DistributionTypeEnum.AUCTION.getCode()));
} }
List<DistributionOrder> distributionOrderList = distributionOrderDao.findByPage(dto); List<DistributionOrder> distributionOrderList = distributionOrderDao.findByPage(dto);
PageInfo pageInfo = new PageInfo<>(distributionOrderList); PageInfo pageInfo = new PageInfo<>(distributionOrderList);
...@@ -100,7 +98,7 @@ public class SysDistributionOrderServiceImpl implements SysDistributionOrderServ ...@@ -100,7 +98,7 @@ public class SysDistributionOrderServiceImpl implements SysDistributionOrderServ
distributionOrderVo.setTypeName(DistributionEnum.DistributionTypeEnum.getNameByCode(distributionOrder.getType())); distributionOrderVo.setTypeName(DistributionEnum.DistributionTypeEnum.getNameByCode(distributionOrder.getType()));
distributionOrderVo.setHomePageImage(MediaUtil.getHomePageImage(supplierItem.getImages(), supplierItem.getVideos())); distributionOrderVo.setHomePageImage(MediaUtil.getHomePageImage(supplierItem.getImages(), supplierItem.getVideos()));
distributionOrderVo.setBuyerName(cacheUtil.getAppletUserNameById(distributionOrder.getBuyerId())); distributionOrderVo.setBuyerName(cacheUtil.getAppletUserNameById(distributionOrder.getBuyerId()));
distributionOrderVo.setSellerName(cacheUtil.getAppletUserNameById(distributionOrder.getSellerId())); distributionOrderVo.setSellerName(distributionOrder.getSellerId() == CommConsts.SYSTEM_ACCOUNT.longValue()? "系统账号" : cacheUtil.getAppletUserNameById(distributionOrder.getSellerId()));
//支付截止时间,下单后半小时内 //支付截止时间,下单后半小时内
Date date = distributionOrder.getCreateTime(); Date date = distributionOrder.getCreateTime();
Instant instant = date.toInstant().plus(Duration.ofMinutes(30)); Instant instant = date.toInstant().plus(Duration.ofMinutes(30));
......
...@@ -31,7 +31,6 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -31,7 +31,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport; import org.springframework.transaction.interceptor.TransactionAspectSupport;
import org.springframework.util.CollectionUtils;
import javax.imageio.ImageIO; import javax.imageio.ImageIO;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
...@@ -165,6 +164,7 @@ public class SysSupplierItemServiceImpl implements SysSupplierItemService { ...@@ -165,6 +164,7 @@ public class SysSupplierItemServiceImpl implements SysSupplierItemService {
supplierItemVo.setHomePageImage(MediaUtil.getHomePageImage(supplierItem.getImages(), supplierItem.getVideos())); supplierItemVo.setHomePageImage(MediaUtil.getHomePageImage(supplierItem.getImages(), supplierItem.getVideos()));
supplierItemVo.setTypeName(DistributionEnum.DistributionTypeEnum.getNameByCode(supplierItem.getType())); supplierItemVo.setTypeName(DistributionEnum.DistributionTypeEnum.getNameByCode(supplierItem.getType()));
supplierItemVo.setCreatorName(cacheUtil.getAppletUserById(supplierItem.getCreatorId()).getNickname()); supplierItemVo.setCreatorName(cacheUtil.getAppletUserById(supplierItem.getCreatorId()).getNickname());
supplierItemVo.setStatusName(SupplierItemEnum.StatusEnum.getNameByCode(supplierItem.getStatus()));
if (supplierItem.getBuyLimitNum() == -1) { if (supplierItem.getBuyLimitNum() == -1) {
supplierItemVo.setIsLimitBuy(false); supplierItemVo.setIsLimitBuy(false);
} }
...@@ -211,6 +211,7 @@ public class SysSupplierItemServiceImpl implements SysSupplierItemService { ...@@ -211,6 +211,7 @@ public class SysSupplierItemServiceImpl implements SysSupplierItemService {
supplierItemVo.setSupplyPrice(PriceUtil.convertPriceFenToYuan(supplierItem.getSupplyPrice())); supplierItemVo.setSupplyPrice(PriceUtil.convertPriceFenToYuan(supplierItem.getSupplyPrice()));
supplierItemVo.setDistributionPrice(PriceUtil.convertPriceFenToYuan(supplierItem.getDistributionPrice())); supplierItemVo.setDistributionPrice(PriceUtil.convertPriceFenToYuan(supplierItem.getDistributionPrice()));
supplierItemVo.setHomePageImage(MediaUtil.getHomePageImage(supplierItem.getImages(), supplierItem.getVideos())); supplierItemVo.setHomePageImage(MediaUtil.getHomePageImage(supplierItem.getImages(), supplierItem.getVideos()));
supplierItemVo.setCreatorName(cacheUtil.getAppletUserById(supplierItem.getCreatorId()).getNickname());
//拍卖品需要查询拍卖配置信息 //拍卖品需要查询拍卖配置信息
if (supplierItem.getType() == DistributionEnum.DistributionTypeEnum.AUCTION.getCode()) { if (supplierItem.getType() == DistributionEnum.DistributionTypeEnum.AUCTION.getCode()) {
AuctionConfig auctionConfig = auctionConfigDao.findByItemId(itemId); AuctionConfig auctionConfig = auctionConfigDao.findByItemId(itemId);
...@@ -219,6 +220,9 @@ public class SysSupplierItemServiceImpl implements SysSupplierItemService { ...@@ -219,6 +220,9 @@ public class SysSupplierItemServiceImpl implements SysSupplierItemService {
supplierItemVo.setStartPrice(PriceUtil.convertPriceFenToYuan(auctionConfig.getStartPrice())); supplierItemVo.setStartPrice(PriceUtil.convertPriceFenToYuan(auctionConfig.getStartPrice()));
supplierItemVo.setAddExtent(PriceUtil.convertPriceFenToYuan(auctionConfig.getAddExtent())); supplierItemVo.setAddExtent(PriceUtil.convertPriceFenToYuan(auctionConfig.getAddExtent()));
} }
if (supplierItem.getStock() == 0 || supplierItem.getIsOnSale()) {
supplierItemVo.setIsAbleSale(true);
}
return Result.success(supplierItemVo); return Result.success(supplierItemVo);
} catch (Exception e) { } catch (Exception e) {
logger.error("商品详情查询失败 error : {}", e); logger.error("商品详情查询失败 error : {}", e);
...@@ -344,7 +348,7 @@ public class SysSupplierItemServiceImpl implements SysSupplierItemService { ...@@ -344,7 +348,7 @@ public class SysSupplierItemServiceImpl implements SysSupplierItemService {
SupplierItem supplierItem = new SupplierItem(); SupplierItem supplierItem = new SupplierItem();
supplierItem.setId(dto.getId()); supplierItem.setId(dto.getId());
supplierItem.setIsDeleted(true); supplierItem.setIsDeleted(true);
supplierItem.setState(SupplierItemEnum.StateEnum.IRREGULAR.getCode()); supplierItem.setStatus(SupplierItemEnum.StatusEnum.IRREGULAR.getCode());
supplierItemDao.update(supplierItem); supplierItemDao.update(supplierItem);
//发送短息通知用户商品违规被下架,跳转到个人藏馆 //发送短息通知用户商品违规被下架,跳转到个人藏馆
String url = wxAppletApi.getUrlLink("/pages/saleSelf/index","userId=" + oldItem.getCreatorId() + "&shareRecordId="); String url = wxAppletApi.getUrlLink("/pages/saleSelf/index","userId=" + oldItem.getCreatorId() + "&shareRecordId=");
......
...@@ -5,7 +5,7 @@ public class SupplierItemEnum { ...@@ -5,7 +5,7 @@ public class SupplierItemEnum {
/** /**
* 商品状态 * 商品状态
*/ */
public enum StateEnum { public enum StatusEnum {
COMMON(0, "正常"), COMMON(0, "正常"),
IRREGULAR(1, "违规"), IRREGULAR(1, "违规"),
; ;
...@@ -13,15 +13,15 @@ public class SupplierItemEnum { ...@@ -13,15 +13,15 @@ public class SupplierItemEnum {
private int code; private int code;
private String des; private String des;
StateEnum(int code, String des) { StatusEnum(int code, String des) {
this.code = code; this.code = code;
this.des = des; this.des = des;
} }
public static String getNameByCode(int code) { public static String getNameByCode(int code) {
for (SupplierItemEnum.StateEnum levelEnum : SupplierItemEnum.StateEnum.values()) { for (StatusEnum statusEnum : StatusEnum.values()) {
if (code == levelEnum.getCode()) { if (code == statusEnum.getCode()) {
return levelEnum.getDes(); return statusEnum.getDes();
} }
} }
return null; return null;
......
...@@ -261,4 +261,11 @@ public class SupplierItemVo implements Entity { ...@@ -261,4 +261,11 @@ public class SupplierItemVo implements Entity {
* 是否可以出售 * 是否可以出售
*/ */
private Boolean isAbleSale; private Boolean isAbleSale;
/**
* 藏品状态
*/
private Integer status;
private String statusName;
} }
...@@ -95,7 +95,7 @@ public class SupplierItem implements Entity { ...@@ -95,7 +95,7 @@ public class SupplierItem implements Entity {
/** /**
* 状态0正常1违规 * 状态0正常1违规
*/ */
private Integer state; private Integer status;
/** /**
* 商品图片,分号分隔 * 商品图片,分号分隔
...@@ -136,7 +136,7 @@ public class SupplierItem implements Entity { ...@@ -136,7 +136,7 @@ public class SupplierItem implements Entity {
sb.append(", type=").append(type); sb.append(", type=").append(type);
sb.append(", rebate=").append(rebate); sb.append(", rebate=").append(rebate);
sb.append(", creatorId=").append(creatorId); sb.append(", creatorId=").append(creatorId);
sb.append(", state=").append(state); sb.append(", status=").append(status);
sb.append(", images=").append(images); sb.append(", images=").append(images);
sb.append(", videos=").append(videos); sb.append(", videos=").append(videos);
sb.append(", description=").append(description); sb.append(", description=").append(description);
...@@ -173,7 +173,7 @@ public class SupplierItem implements Entity { ...@@ -173,7 +173,7 @@ public class SupplierItem implements Entity {
&& (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType())) && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
&& (this.getRebate() == null ? other.getRebate() == null : this.getRebate().equals(other.getRebate())) && (this.getRebate() == null ? other.getRebate() == null : this.getRebate().equals(other.getRebate()))
&& (this.getCreatorId() == null ? other.getCreatorId() == null : this.getCreatorId().equals(other.getCreatorId())) && (this.getCreatorId() == null ? other.getCreatorId() == null : this.getCreatorId().equals(other.getCreatorId()))
&& (this.getState() == null ? other.getState() == null : this.getState().equals(other.getState())) && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
&& (this.getImages() == null ? other.getImages() == null : this.getImages().equals(other.getImages())) && (this.getImages() == null ? other.getImages() == null : this.getImages().equals(other.getImages()))
&& (this.getVideos() == null ? other.getVideos() == null : this.getVideos().equals(other.getVideos())) && (this.getVideos() == null ? other.getVideos() == null : this.getVideos().equals(other.getVideos()))
&& (this.getDescription() == null ? other.getDescription() == null : this.getDescription().equals(other.getDescription())); && (this.getDescription() == null ? other.getDescription() == null : this.getDescription().equals(other.getDescription()));
...@@ -199,7 +199,7 @@ public class SupplierItem implements Entity { ...@@ -199,7 +199,7 @@ public class SupplierItem implements Entity {
result = prime * result + ((getType() == null) ? 0 : getType().hashCode()); result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
result = prime * result + ((getRebate() == null) ? 0 : getRebate().hashCode()); result = prime * result + ((getRebate() == null) ? 0 : getRebate().hashCode());
result = prime * result + ((getCreatorId() == null) ? 0 : getCreatorId().hashCode()); result = prime * result + ((getCreatorId() == null) ? 0 : getCreatorId().hashCode());
result = prime * result + ((getState() == null) ? 0 : getState().hashCode()); result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
result = prime * result + ((getImages() == null) ? 0 : getImages().hashCode()); result = prime * result + ((getImages() == null) ? 0 : getImages().hashCode());
result = prime * result + ((getVideos() == null) ? 0 : getVideos().hashCode()); result = prime * result + ((getVideos() == null) ? 0 : getVideos().hashCode());
result = prime * result + ((getDescription() == null) ? 0 : getDescription().hashCode()); result = prime * result + ((getDescription() == null) ? 0 : getDescription().hashCode());
...@@ -230,7 +230,7 @@ public class SupplierItem implements Entity { ...@@ -230,7 +230,7 @@ public class SupplierItem implements Entity {
type("type", "type", "INTEGER", true), type("type", "type", "INTEGER", true),
rebate("rebate", "rebate", "DECIMAL", false), rebate("rebate", "rebate", "DECIMAL", false),
creatorId("creator_id", "creatorId", "BIGINT", false), creatorId("creator_id", "creatorId", "BIGINT", false),
state("state", "state", "INTEGER", true), status("status", "status", "INTEGER", true),
images("images", "images", "LONGVARCHAR", false), images("images", "images", "LONGVARCHAR", false),
videos("videos", "videos", "LONGVARCHAR", false), videos("videos", "videos", "LONGVARCHAR", false),
description("description", "description", "LONGVARCHAR", false); description("description", "description", "LONGVARCHAR", false);
......
...@@ -2281,18 +2281,18 @@ public class SupplierItemExample { ...@@ -2281,18 +2281,18 @@ public class SupplierItemExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andStateIsNull() { public Criteria andStatusIsNull() {
addCriterion("`state` is null"); addCriterion("`status` is null");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andStateIsNotNull() { public Criteria andStatusIsNotNull() {
addCriterion("`state` is not null"); addCriterion("`status` is not null");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andStateEqualTo(Integer value) { public Criteria andStatusEqualTo(Integer value) {
addCriterion("`state` =", value, "state"); addCriterion("`status` =", value, "status");
return (Criteria) this; return (Criteria) this;
} }
...@@ -2303,13 +2303,13 @@ public class SupplierItemExample { ...@@ -2303,13 +2303,13 @@ public class SupplierItemExample {
* @mbg.generated * @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin * @project https://github.com/itfsw/mybatis-generator-plugin
*/ */
public Criteria andStateEqualToColumn(SupplierItem.Column column) { public Criteria andStatusEqualToColumn(SupplierItem.Column column) {
addCriterion(new StringBuilder("`state` = ").append(column.getEscapedColumnName()).toString()); addCriterion(new StringBuilder("`status` = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this; return (Criteria) this;
} }
public Criteria andStateNotEqualTo(Integer value) { public Criteria andStatusNotEqualTo(Integer value) {
addCriterion("`state` <>", value, "state"); addCriterion("`status` <>", value, "status");
return (Criteria) this; return (Criteria) this;
} }
...@@ -2320,13 +2320,13 @@ public class SupplierItemExample { ...@@ -2320,13 +2320,13 @@ public class SupplierItemExample {
* @mbg.generated * @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin * @project https://github.com/itfsw/mybatis-generator-plugin
*/ */
public Criteria andStateNotEqualToColumn(SupplierItem.Column column) { public Criteria andStatusNotEqualToColumn(SupplierItem.Column column) {
addCriterion(new StringBuilder("`state` <> ").append(column.getEscapedColumnName()).toString()); addCriterion(new StringBuilder("`status` <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this; return (Criteria) this;
} }
public Criteria andStateGreaterThan(Integer value) { public Criteria andStatusGreaterThan(Integer value) {
addCriterion("`state` >", value, "state"); addCriterion("`status` >", value, "status");
return (Criteria) this; return (Criteria) this;
} }
...@@ -2337,13 +2337,13 @@ public class SupplierItemExample { ...@@ -2337,13 +2337,13 @@ public class SupplierItemExample {
* @mbg.generated * @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin * @project https://github.com/itfsw/mybatis-generator-plugin
*/ */
public Criteria andStateGreaterThanColumn(SupplierItem.Column column) { public Criteria andStatusGreaterThanColumn(SupplierItem.Column column) {
addCriterion(new StringBuilder("`state` > ").append(column.getEscapedColumnName()).toString()); addCriterion(new StringBuilder("`status` > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this; return (Criteria) this;
} }
public Criteria andStateGreaterThanOrEqualTo(Integer value) { public Criteria andStatusGreaterThanOrEqualTo(Integer value) {
addCriterion("`state` >=", value, "state"); addCriterion("`status` >=", value, "status");
return (Criteria) this; return (Criteria) this;
} }
...@@ -2354,13 +2354,13 @@ public class SupplierItemExample { ...@@ -2354,13 +2354,13 @@ public class SupplierItemExample {
* @mbg.generated * @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin * @project https://github.com/itfsw/mybatis-generator-plugin
*/ */
public Criteria andStateGreaterThanOrEqualToColumn(SupplierItem.Column column) { public Criteria andStatusGreaterThanOrEqualToColumn(SupplierItem.Column column) {
addCriterion(new StringBuilder("`state` >= ").append(column.getEscapedColumnName()).toString()); addCriterion(new StringBuilder("`status` >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this; return (Criteria) this;
} }
public Criteria andStateLessThan(Integer value) { public Criteria andStatusLessThan(Integer value) {
addCriterion("`state` <", value, "state"); addCriterion("`status` <", value, "status");
return (Criteria) this; return (Criteria) this;
} }
...@@ -2371,13 +2371,13 @@ public class SupplierItemExample { ...@@ -2371,13 +2371,13 @@ public class SupplierItemExample {
* @mbg.generated * @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin * @project https://github.com/itfsw/mybatis-generator-plugin
*/ */
public Criteria andStateLessThanColumn(SupplierItem.Column column) { public Criteria andStatusLessThanColumn(SupplierItem.Column column) {
addCriterion(new StringBuilder("`state` < ").append(column.getEscapedColumnName()).toString()); addCriterion(new StringBuilder("`status` < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this; return (Criteria) this;
} }
public Criteria andStateLessThanOrEqualTo(Integer value) { public Criteria andStatusLessThanOrEqualTo(Integer value) {
addCriterion("`state` <=", value, "state"); addCriterion("`status` <=", value, "status");
return (Criteria) this; return (Criteria) this;
} }
...@@ -2388,28 +2388,28 @@ public class SupplierItemExample { ...@@ -2388,28 +2388,28 @@ public class SupplierItemExample {
* @mbg.generated * @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin * @project https://github.com/itfsw/mybatis-generator-plugin
*/ */
public Criteria andStateLessThanOrEqualToColumn(SupplierItem.Column column) { public Criteria andStatusLessThanOrEqualToColumn(SupplierItem.Column column) {
addCriterion(new StringBuilder("`state` <= ").append(column.getEscapedColumnName()).toString()); addCriterion(new StringBuilder("`status` <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this; return (Criteria) this;
} }
public Criteria andStateIn(List<Integer> values) { public Criteria andStatusIn(List<Integer> values) {
addCriterion("`state` in", values, "state"); addCriterion("`status` in", values, "status");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andStateNotIn(List<Integer> values) { public Criteria andStatusNotIn(List<Integer> values) {
addCriterion("`state` not in", values, "state"); addCriterion("`status` not in", values, "status");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andStateBetween(Integer value1, Integer value2) { public Criteria andStatusBetween(Integer value1, Integer value2) {
addCriterion("`state` between", value1, value2, "state"); addCriterion("`status` between", value1, value2, "status");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andStateNotBetween(Integer value1, Integer value2) { public Criteria andStatusNotBetween(Integer value1, Integer value2) {
addCriterion("`state` not between", value1, value2, "state"); addCriterion("`status` not between", value1, value2, "status");
return (Criteria) this; return (Criteria) this;
} }
} }
......
...@@ -4,7 +4,6 @@ import com.wwdz.ch.db.dto.request.BaseRequestDto; ...@@ -4,7 +4,6 @@ import com.wwdz.ch.db.dto.request.BaseRequestDto;
import com.xxdxxs.entity.Entity; import com.xxdxxs.entity.Entity;
import lombok.Data; import lombok.Data;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
...@@ -47,6 +46,11 @@ public class SupplierItemRequestDto extends BaseRequestDto implements Entity { ...@@ -47,6 +46,11 @@ public class SupplierItemRequestDto extends BaseRequestDto implements Entity {
*/ */
private String name; private String name;
/**
* 状态0正常1违规
*/
private Integer status;
/** /**
* 置顶图片 * 置顶图片
*/ */
......
...@@ -14,7 +14,6 @@ import org.springframework.util.CollectionUtils; ...@@ -14,7 +14,6 @@ import org.springframework.util.CollectionUtils;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.concurrent.TimeUnit;
@Repository @Repository
public class SupplierItemDaoImpl implements SupplierItemDao { public class SupplierItemDaoImpl implements SupplierItemDao {
...@@ -39,6 +38,7 @@ public class SupplierItemDaoImpl implements SupplierItemDao { ...@@ -39,6 +38,7 @@ public class SupplierItemDaoImpl implements SupplierItemDao {
} }
JdbcHelper.ifPresent(dto.getTypeList(), criteria::andTypeIn); JdbcHelper.ifPresent(dto.getTypeList(), criteria::andTypeIn);
JdbcHelper.ifPresent(dto.getType(), criteria::andTypeEqualTo); JdbcHelper.ifPresent(dto.getType(), criteria::andTypeEqualTo);
JdbcHelper.ifPresent(dto.getStatus(), criteria::andStatusEqualTo);
JdbcHelper.ifPresent(dto.getStock(), criteria::andStockGreaterThan); JdbcHelper.ifPresent(dto.getStock(), criteria::andStockGreaterThan);
JdbcHelper.ifPresent(dto.getIsOnSale(), criteria::andIsOnSaleEqualTo); JdbcHelper.ifPresent(dto.getIsOnSale(), criteria::andIsOnSaleEqualTo);
JdbcHelper.ifPresent(dto.getIsDeleted(), criteria::andIsDeletedEqualTo); JdbcHelper.ifPresent(dto.getIsDeleted(), criteria::andIsDeletedEqualTo);
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<result column="type" jdbcType="INTEGER" property="type" /> <result column="type" jdbcType="INTEGER" property="type" />
<result column="rebate" jdbcType="DECIMAL" property="rebate" /> <result column="rebate" jdbcType="DECIMAL" property="rebate" />
<result column="creator_id" jdbcType="BIGINT" property="creatorId" /> <result column="creator_id" jdbcType="BIGINT" property="creatorId" />
<result column="state" jdbcType="INTEGER" property="state" /> <result column="status" jdbcType="INTEGER" property="status" />
</resultMap> </resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.wwdz.ch.db.domain.distribution.SupplierItem"> <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.wwdz.ch.db.domain.distribution.SupplierItem">
<result column="images" jdbcType="LONGVARCHAR" property="images" /> <result column="images" jdbcType="LONGVARCHAR" property="images" />
...@@ -86,7 +86,7 @@ ...@@ -86,7 +86,7 @@
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, `name`, supplier_id, is_on_sale, sort, top_image, distribution_price, supply_price, id, `name`, supplier_id, is_on_sale, sort, top_image, distribution_price, supply_price,
stock, create_time, update_time, is_deleted, buy_limit_num, `type`, rebate, creator_id, stock, create_time, update_time, is_deleted, buy_limit_num, `type`, rebate, creator_id,
`state` `status`
</sql> </sql>
<sql id="Blob_Column_List"> <sql id="Blob_Column_List">
images, videos, description images, videos, description
...@@ -143,7 +143,7 @@ ...@@ -143,7 +143,7 @@
<otherwise> <otherwise>
id, `name`, supplier_id, is_on_sale, sort, top_image, distribution_price, supply_price, id, `name`, supplier_id, is_on_sale, sort, top_image, distribution_price, supply_price,
stock, create_time, update_time, is_deleted, buy_limit_num, `type`, rebate, creator_id, stock, create_time, update_time, is_deleted, buy_limit_num, `type`, rebate, creator_id,
`state`, images, videos, description `status`, images, videos, description
</otherwise> </otherwise>
</choose> </choose>
from supplier_item from supplier_item
...@@ -178,7 +178,7 @@ ...@@ -178,7 +178,7 @@
<otherwise> <otherwise>
id, `name`, supplier_id, is_on_sale, sort, top_image, distribution_price, supply_price, id, `name`, supplier_id, is_on_sale, sort, top_image, distribution_price, supply_price,
stock, create_time, update_time, is_deleted, buy_limit_num, `type`, rebate, creator_id, stock, create_time, update_time, is_deleted, buy_limit_num, `type`, rebate, creator_id,
`state`, images, videos, description `status`, images, videos, description
</otherwise> </otherwise>
</choose> </choose>
from supplier_item from supplier_item
...@@ -203,14 +203,14 @@ ...@@ -203,14 +203,14 @@
supply_price, stock, create_time, supply_price, stock, create_time,
update_time, is_deleted, buy_limit_num, update_time, is_deleted, buy_limit_num,
`type`, rebate, creator_id, `type`, rebate, creator_id,
`state`, images, videos, `status`, images, videos,
description) description)
values (#{name,jdbcType=VARCHAR}, #{supplierId,jdbcType=BIGINT}, #{isOnSale,jdbcType=BIT}, values (#{name,jdbcType=VARCHAR}, #{supplierId,jdbcType=BIGINT}, #{isOnSale,jdbcType=BIT},
#{sort,jdbcType=INTEGER}, #{topImage,jdbcType=VARCHAR}, #{distributionPrice,jdbcType=BIGINT}, #{sort,jdbcType=INTEGER}, #{topImage,jdbcType=VARCHAR}, #{distributionPrice,jdbcType=BIGINT},
#{supplyPrice,jdbcType=BIGINT}, #{stock,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{supplyPrice,jdbcType=BIGINT}, #{stock,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP}, #{isDeleted,jdbcType=BIT}, #{buyLimitNum,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP}, #{isDeleted,jdbcType=BIT}, #{buyLimitNum,jdbcType=INTEGER},
#{type,jdbcType=INTEGER}, #{rebate,jdbcType=DECIMAL}, #{creatorId,jdbcType=BIGINT}, #{type,jdbcType=INTEGER}, #{rebate,jdbcType=DECIMAL}, #{creatorId,jdbcType=BIGINT},
#{state,jdbcType=INTEGER}, #{images,jdbcType=LONGVARCHAR}, #{videos,jdbcType=LONGVARCHAR}, #{status,jdbcType=INTEGER}, #{images,jdbcType=LONGVARCHAR}, #{videos,jdbcType=LONGVARCHAR},
#{description,jdbcType=LONGVARCHAR}) #{description,jdbcType=LONGVARCHAR})
</insert> </insert>
<insert id="insertSelective" parameterType="com.wwdz.ch.db.domain.distribution.SupplierItem"> <insert id="insertSelective" parameterType="com.wwdz.ch.db.domain.distribution.SupplierItem">
...@@ -264,8 +264,8 @@ ...@@ -264,8 +264,8 @@
<if test="creatorId != null"> <if test="creatorId != null">
creator_id, creator_id,
</if> </if>
<if test="state != null"> <if test="status != null">
`state`, `status`,
</if> </if>
<if test="images != null"> <if test="images != null">
images, images,
...@@ -323,8 +323,8 @@ ...@@ -323,8 +323,8 @@
<if test="creatorId != null"> <if test="creatorId != null">
#{creatorId,jdbcType=BIGINT}, #{creatorId,jdbcType=BIGINT},
</if> </if>
<if test="state != null"> <if test="status != null">
#{state,jdbcType=INTEGER}, #{status,jdbcType=INTEGER},
</if> </if>
<if test="images != null"> <if test="images != null">
#{images,jdbcType=LONGVARCHAR}, #{images,jdbcType=LONGVARCHAR},
...@@ -394,8 +394,8 @@ ...@@ -394,8 +394,8 @@
<if test="record.creatorId != null"> <if test="record.creatorId != null">
creator_id = #{record.creatorId,jdbcType=BIGINT}, creator_id = #{record.creatorId,jdbcType=BIGINT},
</if> </if>
<if test="record.state != null"> <if test="record.status != null">
`state` = #{record.state,jdbcType=INTEGER}, `status` = #{record.status,jdbcType=INTEGER},
</if> </if>
<if test="record.images != null"> <if test="record.images != null">
images = #{record.images,jdbcType=LONGVARCHAR}, images = #{record.images,jdbcType=LONGVARCHAR},
...@@ -429,7 +429,7 @@ ...@@ -429,7 +429,7 @@
`type` = #{record.type,jdbcType=INTEGER}, `type` = #{record.type,jdbcType=INTEGER},
rebate = #{record.rebate,jdbcType=DECIMAL}, rebate = #{record.rebate,jdbcType=DECIMAL},
creator_id = #{record.creatorId,jdbcType=BIGINT}, creator_id = #{record.creatorId,jdbcType=BIGINT},
`state` = #{record.state,jdbcType=INTEGER}, `status` = #{record.status,jdbcType=INTEGER},
images = #{record.images,jdbcType=LONGVARCHAR}, images = #{record.images,jdbcType=LONGVARCHAR},
videos = #{record.videos,jdbcType=LONGVARCHAR}, videos = #{record.videos,jdbcType=LONGVARCHAR},
description = #{record.description,jdbcType=LONGVARCHAR} description = #{record.description,jdbcType=LONGVARCHAR}
...@@ -455,7 +455,7 @@ ...@@ -455,7 +455,7 @@
`type` = #{record.type,jdbcType=INTEGER}, `type` = #{record.type,jdbcType=INTEGER},
rebate = #{record.rebate,jdbcType=DECIMAL}, rebate = #{record.rebate,jdbcType=DECIMAL},
creator_id = #{record.creatorId,jdbcType=BIGINT}, creator_id = #{record.creatorId,jdbcType=BIGINT},
`state` = #{record.state,jdbcType=INTEGER} `status` = #{record.status,jdbcType=INTEGER}
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
</if> </if>
...@@ -508,8 +508,8 @@ ...@@ -508,8 +508,8 @@
<if test="creatorId != null"> <if test="creatorId != null">
creator_id = #{creatorId,jdbcType=BIGINT}, creator_id = #{creatorId,jdbcType=BIGINT},
</if> </if>
<if test="state != null"> <if test="status != null">
`state` = #{state,jdbcType=INTEGER}, `status` = #{status,jdbcType=INTEGER},
</if> </if>
<if test="images != null"> <if test="images != null">
images = #{images,jdbcType=LONGVARCHAR}, images = #{images,jdbcType=LONGVARCHAR},
...@@ -540,7 +540,7 @@ ...@@ -540,7 +540,7 @@
`type` = #{type,jdbcType=INTEGER}, `type` = #{type,jdbcType=INTEGER},
rebate = #{rebate,jdbcType=DECIMAL}, rebate = #{rebate,jdbcType=DECIMAL},
creator_id = #{creatorId,jdbcType=BIGINT}, creator_id = #{creatorId,jdbcType=BIGINT},
`state` = #{state,jdbcType=INTEGER}, `status` = #{status,jdbcType=INTEGER},
images = #{images,jdbcType=LONGVARCHAR}, images = #{images,jdbcType=LONGVARCHAR},
videos = #{videos,jdbcType=LONGVARCHAR}, videos = #{videos,jdbcType=LONGVARCHAR},
description = #{description,jdbcType=LONGVARCHAR} description = #{description,jdbcType=LONGVARCHAR}
...@@ -563,7 +563,7 @@ ...@@ -563,7 +563,7 @@
`type` = #{type,jdbcType=INTEGER}, `type` = #{type,jdbcType=INTEGER},
rebate = #{rebate,jdbcType=DECIMAL}, rebate = #{rebate,jdbcType=DECIMAL},
creator_id = #{creatorId,jdbcType=BIGINT}, creator_id = #{creatorId,jdbcType=BIGINT},
`state` = #{state,jdbcType=INTEGER} `status` = #{status,jdbcType=INTEGER}
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
<select id="selectOneByExample" parameterType="com.wwdz.ch.db.domain.distribution.SupplierItemExample" resultMap="BaseResultMap"> <select id="selectOneByExample" parameterType="com.wwdz.ch.db.domain.distribution.SupplierItemExample" resultMap="BaseResultMap">
...@@ -621,7 +621,7 @@ ...@@ -621,7 +621,7 @@
<otherwise> <otherwise>
id, `name`, supplier_id, is_on_sale, sort, top_image, distribution_price, supply_price, id, `name`, supplier_id, is_on_sale, sort, top_image, distribution_price, supply_price,
stock, create_time, update_time, is_deleted, buy_limit_num, `type`, rebate, creator_id, stock, create_time, update_time, is_deleted, buy_limit_num, `type`, rebate, creator_id,
`state`, images, videos, description `status`, images, videos, description
</otherwise> </otherwise>
</choose> </choose>
from supplier_item from supplier_item
......
...@@ -204,6 +204,7 @@ public class UserServiceImpl implements UserService { ...@@ -204,6 +204,7 @@ public class UserServiceImpl implements UserService {
ShopWhiteList shopWhiteList = shopWhiteListDao.findByUserId(dto.getUserId()); ShopWhiteList shopWhiteList = shopWhiteListDao.findByUserId(dto.getUserId());
result.put("isShop", true); result.put("isShop", true);
result.put("shopId", shopWhiteList.getShopId() == null ? dto.getUserId() : shopWhiteList.getShopId()); result.put("shopId", shopWhiteList.getShopId() == null ? dto.getUserId() : shopWhiteList.getShopId());
} else { } else {
try { try {
CloudServerResponse<ShopDTO> cloudServerResponse = shopReadService.getShopByUserId(dto.getUserId(), new ShopQueryOption()); CloudServerResponse<ShopDTO> cloudServerResponse = shopReadService.getShopByUserId(dto.getUserId(), new ShopQueryOption());
......
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