Commit 2308b6ef authored by shiyu's avatar shiyu

小程序个人主页新增寄售单退货单数量显示

parent 3543d3fe
......@@ -104,6 +104,9 @@ public class ConsignSaleEnum {
CUSTOM_CANCEL(100, "用户取消寄售"),
SYS_CANCEL(101, "平台取消寄售"),
TIME_OUT_CANCEL(102, "超时未确认,取消寄售"),
WAIT_RETURN(116, "货品待收回"),
RETURNED(122, "货品已收回"),
;
private int code;
......@@ -142,8 +145,10 @@ public class ConsignSaleEnum {
IDENTIFY(30,"平台实物鉴定并定价", "平台签收后,会在1~3天完成货品的鉴定和估价", "40,50,53,60"),
CONSIGN_SALEING(40, "平台寄售中", "", "70"),
PRE_PAY(50,"货品售出,待结款", "货品售出后,平台会在20天内完成打款。如果实际的售出价低于预估价,则会在售出后由客服通知您具体情况。", "80"),
FINISH_PAT(60,"平台完成结款", "", "90"),
CANCEL(70,"取消寄售", "", "100,101"),
FINISH_PAY(60,"平台完成结款", "", "90"),
CANCEL(70,"取消寄售", "", "100,101,102"),
WAIT_RETURN(80,"货品待收回", "平台会在3天内通过邮寄将货品退回。", "100,101,102"),
RETURNED(90,"货品已收回", "", "122"),
;
......
package com.wwdz.ch.core.consts;
public class ReturnOrderEnum {
/**
* 用户端寄售单的状态
*/
public enum StateEnum {
WAIT_RETURN(10, "待退回"),
OUTBOUND(20, "已出库"),
FINISH(30, "完成退货"),
;
private int code;
private String des;
StateEnum(int code, String des) {
this.code = code;
this.des = des;
}
public static String getNameByCode(int code) {
for (ConsignSaleEnum.SaleForUserStateEnum saleForUserStateEnum : ConsignSaleEnum.SaleForUserStateEnum.values()) {
if (code == saleForUserStateEnum.getCode()) {
return saleForUserStateEnum.getDes();
}
}
return null;
}
public int getCode() {
return code;
}
public String getDes() {
return des;
}
}
public enum OperateTypeEnum {
CUSTOM_CANCEL(100, "用户取消寄售"),
SYS_CANCEL(101, "平台取消寄售"),
TIME_OUT_CANCEL(102, "超时未确认,取消寄售"),
WAIT_RETURN(116, "货品待退回"),
SEND_RETURN(120, "货品已发出"),
USER_SIGNED(130, "用户已签收"),
SYSTEM_SIGNED(131, "系统默认已签收"),
;
private int code;
private String des;
OperateTypeEnum(int code, String des) {
this.code = code;
this.des = des;
}
public static String getNameByCode(int code) {
for (ConsignSaleEnum.OperateTypeEnum operateTypeEnum : ConsignSaleEnum.OperateTypeEnum.values()) {
if (code == operateTypeEnum.getCode()) {
return operateTypeEnum.getDes();
}
}
return null;
}
public int getCode() {
return code;
}
public String getDes() {
return des;
}
}
/**
* 时间线接你打
*/
public enum NodeDescEnum {
CANCEL(70, "取消寄售", ""),
WAIT_RETURN(80, "货品待退回", "平台人员需要在寄售单取消后3天内将货品发出。"),
RETURNED(90, "货品已发出", ""),
SIGNED(100, "货品已签收", ""),
;
private int code;
private String node;
private String des;
NodeDescEnum(int code, String node, String des) {
this.code = code;
this.node = node;
this.des = des;
}
public int getCode() {
return code;
}
public String getNode() {
return node;
}
public String getDes() {
return des;
}
}
}
package com.wwdz.ch.core.entity;
import com.xxdxxs.entity.Entity;
import lombok.Data;
import java.util.Date;
import java.util.Map;
@Data
public class ReturnOrderVo implements Entity {
/**
* 退货单号
*/
private String returnOrderId;
/**
* 寄售单号
*/
private String saleId;
/**
* 商品ID
*/
private Long itemId;
/**
* 商品名称
*/
private String itemName;
// 用于列表展示的图片对象
private Map<String, Object> homePageImage;
/**
* 商品图片
*/
private String itemImg;
/**
* 用户ID
*/
private Long userId;
/**
* 状态
*/
private Integer state;
/**
* 状态
*/
private String stateName;
/**
* 创建时间
*/
private Date createTime;
/**
* 原因
*/
private String remark;
/**
* 物流公司
*/
private String logisticsCode;
/**
* 物流公司名称
*/
private String logisticsName;
/**
* 快递单号
*/
private String waybill;
}
......@@ -57,4 +57,13 @@ public interface ConsignSaleDao {
* @return
*/
List<ConsignSale> findValuateConfirmOrdersByPage(ConsignSaleRequestDto dto);
/**
* 统计不包含某些状态的寄售单数量
* @param userId
* @param filterStates
* @return
*/
long countByState(long userId, List<Integer> filterStates);
}
package com.wwdz.ch.db.dao;
import com.wwdz.ch.db.domain.ConsignSale;
import com.wwdz.ch.db.domain.ReturnOrder;
import com.wwdz.ch.db.dto.request.ConsignSaleRequestDto;
import com.wwdz.ch.db.dto.request.ReturnOrderRequestDto;
import java.util.List;
public interface ReturnOrderDao {
/**
* 插入新记录
*
* @param returnOrder
* @return
*/
int insert(ReturnOrder returnOrder);
/**
* 更新记录
*
* @param returnOrder
* @return
*/
int update(ReturnOrder returnOrder);
ReturnOrder findById(String returnOrderId);
/**
* 根据商品id查询寄售单
* @param itemId
* @return
*/
List<ReturnOrder> findByItemId(long itemId);
/**
*
* @param dto
* @return
*/
List<ReturnOrder> findByPage(ReturnOrderRequestDto dto);
/**
* 统计不包含某些状态的退货单数量
* @param userId
* @param filterStates
* @return
*/
long countByState(long userId, List<Integer> filterStates);
}
package com.wwdz.ch.db.dao;
import com.wwdz.ch.db.domain.ConsignSaleRecord;
import com.wwdz.ch.db.domain.ReturnOrderRecord;
import java.util.List;
public interface ReturnOrderRecordDao {
/**
* 插入新记录
* @param returnOrderRecord
* @return
*/
int insert(ReturnOrderRecord returnOrderRecord);
int insert(String returnOrderId, String content, int type, String remark);
/**
* 查询记录
* @param returnOrderId
* @return
*/
List<ReturnOrderRecord> findByReturnOrderId(String returnOrderId);
/**
* 根据操作类型查询记录
* @param returnOrderId
* @param type
* @return
*/
ReturnOrderRecord findByType(String returnOrderId, int type);
}
......@@ -10,7 +10,7 @@ import lombok.Data;
/**
* @author shiyu
* @date 2023/12/21
* @date 2024/01/02
*/
@Data
public class ConsignSale implements Entity {
......@@ -71,6 +71,11 @@ public class ConsignSale implements Entity {
*/
private Integer systemState;
/**
* 退货地址id
*/
private Long addressId;
/**
* 快递公司编码
*/
......@@ -116,6 +121,7 @@ public class ConsignSale implements Entity {
sb.append(", settleAmount=").append(settleAmount);
sb.append(", customState=").append(customState);
sb.append(", systemState=").append(systemState);
sb.append(", addressId=").append(addressId);
sb.append(", logisticsCode=").append(logisticsCode);
sb.append(", waybill=").append(waybill);
sb.append(", credential=").append(credential);
......@@ -150,6 +156,7 @@ public class ConsignSale implements Entity {
&& (this.getSettleAmount() == null ? other.getSettleAmount() == null : this.getSettleAmount().equals(other.getSettleAmount()))
&& (this.getCustomState() == null ? other.getCustomState() == null : this.getCustomState().equals(other.getCustomState()))
&& (this.getSystemState() == null ? other.getSystemState() == null : this.getSystemState().equals(other.getSystemState()))
&& (this.getAddressId() == null ? other.getAddressId() == null : this.getAddressId().equals(other.getAddressId()))
&& (this.getLogisticsCode() == null ? other.getLogisticsCode() == null : this.getLogisticsCode().equals(other.getLogisticsCode()))
&& (this.getWaybill() == null ? other.getWaybill() == null : this.getWaybill().equals(other.getWaybill()))
&& (this.getCredential() == null ? other.getCredential() == null : this.getCredential().equals(other.getCredential()))
......@@ -173,6 +180,7 @@ public class ConsignSale implements Entity {
result = prime * result + ((getSettleAmount() == null) ? 0 : getSettleAmount().hashCode());
result = prime * result + ((getCustomState() == null) ? 0 : getCustomState().hashCode());
result = prime * result + ((getSystemState() == null) ? 0 : getSystemState().hashCode());
result = prime * result + ((getAddressId() == null) ? 0 : getAddressId().hashCode());
result = prime * result + ((getLogisticsCode() == null) ? 0 : getLogisticsCode().hashCode());
result = prime * result + ((getWaybill() == null) ? 0 : getWaybill().hashCode());
result = prime * result + ((getCredential() == null) ? 0 : getCredential().hashCode());
......@@ -201,6 +209,7 @@ public class ConsignSale implements Entity {
settleAmount("settle_amount", "settleAmount", "INTEGER", false),
customState("custom_state", "customState", "INTEGER", false),
systemState("system_state", "systemState", "INTEGER", false),
addressId("address_id", "addressId", "BIGINT", false),
logisticsCode("logistics_code", "logisticsCode", "VARCHAR", false),
waybill("waybill", "waybill", "VARCHAR", false),
credential("credential", "credential", "VARCHAR", false),
......
......@@ -1752,6 +1752,138 @@ public class ConsignSaleExample {
return (Criteria) this;
}
public Criteria andAddressIdIsNull() {
addCriterion("address_id is null");
return (Criteria) this;
}
public Criteria andAddressIdIsNotNull() {
addCriterion("address_id is not null");
return (Criteria) this;
}
public Criteria andAddressIdEqualTo(Long value) {
addCriterion("address_id =", value, "addressId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table consign_sale
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andAddressIdEqualToColumn(ConsignSale.Column column) {
addCriterion(new StringBuilder("address_id = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andAddressIdNotEqualTo(Long value) {
addCriterion("address_id <>", value, "addressId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table consign_sale
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andAddressIdNotEqualToColumn(ConsignSale.Column column) {
addCriterion(new StringBuilder("address_id <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andAddressIdGreaterThan(Long value) {
addCriterion("address_id >", value, "addressId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table consign_sale
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andAddressIdGreaterThanColumn(ConsignSale.Column column) {
addCriterion(new StringBuilder("address_id > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andAddressIdGreaterThanOrEqualTo(Long value) {
addCriterion("address_id >=", value, "addressId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table consign_sale
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andAddressIdGreaterThanOrEqualToColumn(ConsignSale.Column column) {
addCriterion(new StringBuilder("address_id >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andAddressIdLessThan(Long value) {
addCriterion("address_id <", value, "addressId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table consign_sale
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andAddressIdLessThanColumn(ConsignSale.Column column) {
addCriterion(new StringBuilder("address_id < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andAddressIdLessThanOrEqualTo(Long value) {
addCriterion("address_id <=", value, "addressId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table consign_sale
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andAddressIdLessThanOrEqualToColumn(ConsignSale.Column column) {
addCriterion(new StringBuilder("address_id <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andAddressIdIn(List<Long> values) {
addCriterion("address_id in", values, "addressId");
return (Criteria) this;
}
public Criteria andAddressIdNotIn(List<Long> values) {
addCriterion("address_id not in", values, "addressId");
return (Criteria) this;
}
public Criteria andAddressIdBetween(Long value1, Long value2) {
addCriterion("address_id between", value1, value2, "addressId");
return (Criteria) this;
}
public Criteria andAddressIdNotBetween(Long value1, Long value2) {
addCriterion("address_id not between", value1, value2, "addressId");
return (Criteria) this;
}
public Criteria andLogisticsCodeIsNull() {
addCriterion("logistics_code is null");
return (Criteria) this;
......
This diff is collapsed.
package com.wwdz.ch.db.domain;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import com.xxdxxs.entity.Entity;
import lombok.Data;
/**
* @author shiyu
* @date 2024/01/02
*/
@Data
public class ReturnOrderRecord implements Entity {
private Integer id;
private String returnOrderId;
/**
* 操作时间
*/
private Date createTime;
/**
* 操作内容
*/
private String content;
/**
* 描述
*/
private String remark;
/**
* 操作类型
*/
private Integer type;
private static final long serialVersionUID = 1L;
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", returnOrderId=").append(returnOrderId);
sb.append(", createTime=").append(createTime);
sb.append(", content=").append(content);
sb.append(", remark=").append(remark);
sb.append(", type=").append(type);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
ReturnOrderRecord other = (ReturnOrderRecord) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getReturnOrderId() == null ? other.getReturnOrderId() == null : this.getReturnOrderId().equals(other.getReturnOrderId()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getContent() == null ? other.getContent() == null : this.getContent().equals(other.getContent()))
&& (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()))
&& (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getReturnOrderId() == null) ? 0 : getReturnOrderId().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getContent() == null) ? 0 : getContent().hashCode());
result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
return result;
}
/**
* This enum was generated by MyBatis Generator.
* This enum corresponds to the database table return_order_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public enum Column {
id("id", "id", "INTEGER", false),
returnOrderId("return_order_id", "returnOrderId", "VARCHAR", false),
createTime("create_time", "createTime", "TIMESTAMP", false),
content("content", "content", "VARCHAR", false),
remark("remark", "remark", "VARCHAR", false),
type("type", "type", "INTEGER", true);
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table return_order_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private static final String BEGINNING_DELIMITER = "`";
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table return_order_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private static final String ENDING_DELIMITER = "`";
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table return_order_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private final String column;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table return_order_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private final boolean isColumnNameDelimited;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table return_order_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private final String javaProperty;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table return_order_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private final String jdbcType;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table return_order_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String value() {
return this.column;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table return_order_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String getValue() {
return this.column;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table return_order_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String getJavaProperty() {
return this.javaProperty;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table return_order_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String getJdbcType() {
return this.jdbcType;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table return_order_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) {
this.column = column;
this.javaProperty = javaProperty;
this.jdbcType = jdbcType;
this.isColumnNameDelimited = isColumnNameDelimited;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table return_order_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String desc() {
return this.getEscapedColumnName() + " DESC";
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table return_order_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String asc() {
return this.getEscapedColumnName() + " ASC";
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table return_order_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public static Column[] excludes(Column ... excludes) {
ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
if (excludes != null && excludes.length > 0) {
columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
}
return columns.toArray(new Column[]{});
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table return_order_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String getEscapedColumnName() {
if (this.isColumnNameDelimited) {
return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
} else {
return this.column;
}
}
}
}
\ No newline at end of file
......@@ -109,4 +109,9 @@ public class ConsignSaleRequestDto extends BaseRequestDto implements Entity {
* 结款凭证
*/
private String credential;
/**
* 退货地址id
*/
private Long addressId;
}
package com.wwdz.ch.db.dto.request;
import com.xxdxxs.entity.Entity;
import lombok.Data;
import java.util.Date;
import java.util.List;
@Data
public class ReturnOrderRequestDto extends BaseRequestDto implements Entity {
/**
* 退货单号
*/
private String returnOrderId;
/**
* 寄售单号
*/
private String saleId;
/**
* 商品ID
*/
private Long itemId;
private List<Long> itemIds;
/**
* 商品名称
*/
private String itemName;
/**
* 商品名称/寄售单号
* 正则判断根据哪个字段查询
*/
private String searchParam;
/**
* 用户ID
*/
private Long userId;
/**
* 客户端状态
*/
private Integer state;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
/**
* 快递公司编码
*/
private String logisticsCode;
/**
* 运单号
*/
private String waybill;
}
......@@ -92,4 +92,13 @@ public class ConsignSaleDaoImpl implements ConsignSaleDao {
PageHelper.startPage(dto.getPage(), dto.getLimit());
return consignSaleMapper.selectByExample(example);
}
public long countByState(long userId, List<Integer> filterStates) {
ConsignSaleExample example = new ConsignSaleExample();
ConsignSaleExample.Criteria criteria = example.createCriteria();
criteria.andUserIdEqualTo(userId);
criteria.andSystemStateNotIn(filterStates);
return consignSaleMapper.countByExample(example);
}
}
package com.wwdz.ch.db.impl;
import com.github.pagehelper.PageHelper;
import com.wwdz.ch.db.dao.ReturnOrderDao;
import com.wwdz.ch.db.domain.ConsignSaleExample;
import com.wwdz.ch.db.domain.ReturnOrder;
import com.wwdz.ch.db.domain.ReturnOrderExample;
import com.wwdz.ch.db.dto.request.ReturnOrderRequestDto;
import com.wwdz.ch.db.mapper.ReturnOrderMapper;
import com.xxdxxs.db.component.JdbcHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import java.util.Date;
import java.util.List;
@Repository
public class ReturnOrderDaoImpl implements ReturnOrderDao {
@Autowired
ReturnOrderMapper returnOrderMapper;
@Override
public int insert(ReturnOrder returnOrder) {
return returnOrderMapper.insert(returnOrder);
}
@Override
public int update(ReturnOrder returnOrder) {
ReturnOrderExample example = new ReturnOrderExample();
ReturnOrderExample.Criteria criteria = example.createCriteria();
criteria.andReturnOrderIdEqualTo(returnOrder.getReturnOrderId());
returnOrder.setUpdateTime(new Date());
return returnOrderMapper.updateByExampleSelective(returnOrder, example);
}
@Override
public ReturnOrder findById(String returnOrderId) {
ReturnOrderExample example = new ReturnOrderExample();
ReturnOrderExample.Criteria criteria = example.createCriteria();
criteria.andReturnOrderIdEqualTo(returnOrderId);
return returnOrderMapper.selectOneByExample(example);
}
@Override
public List<ReturnOrder> findByItemId(long itemId) {
ReturnOrderExample example = new ReturnOrderExample();
ReturnOrderExample.Criteria criteria = example.createCriteria();
criteria.andItemIdEqualTo(itemId);
return returnOrderMapper.selectByExample(example);
}
@Override
public List<ReturnOrder> findByPage(ReturnOrderRequestDto dto) {
ReturnOrderExample example = new ReturnOrderExample();
ReturnOrderExample.Criteria criteria = example.createCriteria();
JdbcHelper.ifPresent(dto.getReturnOrderId(), criteria::andReturnOrderIdEqualTo);
JdbcHelper.ifPresent(dto.getSaleId(), criteria::andSaleIdEqualTo);
JdbcHelper.ifPresent(dto.getWaybill(), criteria::andWaybillEqualTo);
JdbcHelper.ifPresent(dto.getItemId(), criteria::andItemIdEqualTo);
JdbcHelper.ifPresent(dto.getItemIds(), criteria::andItemIdIn);
JdbcHelper.ifPresent(dto.getUserId(), criteria::andUserIdEqualTo);
JdbcHelper.ifPresent(dto.getState(), criteria::andStateEqualTo);
example.orderBy(" create_time desc");
PageHelper.startPage(dto.getPage(), dto.getLimit());
return returnOrderMapper.selectByExample(example);
}
public long countByState(long userId, List<Integer> filterStates) {
ReturnOrderExample example = new ReturnOrderExample();
ReturnOrderExample.Criteria criteria = example.createCriteria();
criteria.andUserIdEqualTo(userId);
criteria.andStateNotIn(filterStates);
return returnOrderMapper.countByExample(example);
}
}
package com.wwdz.ch.db.impl;
import com.wwdz.ch.db.dao.ReturnOrderRecordDao;
import com.wwdz.ch.db.domain.ReturnOrderRecord;
import com.wwdz.ch.db.domain.ReturnOrderRecordExample;
import com.wwdz.ch.db.mapper.ReturnOrderRecordMapper;
import com.xxdxxs.db.component.JdbcHelper;
import com.xxdxxs.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import java.util.Date;
import java.util.List;
@Repository
public class ReturnOrderRecordDaoImpl implements ReturnOrderRecordDao {
@Autowired
ReturnOrderRecordMapper returnOrderRecordMapper;
@Override
public int insert(ReturnOrderRecord returnOrderRecord) {
return returnOrderRecordMapper.insert(returnOrderRecord);
}
@Override
public int insert(String returnOrderId, String content, int type, String remark) {
ReturnOrderRecord returnOrderRecord = new ReturnOrderRecord();
returnOrderRecord.setReturnOrderId(returnOrderId);
returnOrderRecord.setCreateTime(new Date());
returnOrderRecord.setContent(content);
returnOrderRecord.setType(type);
if (StringUtils.hasLength(remark)) {
returnOrderRecord.setRemark(remark);
}
return returnOrderRecordMapper.insertSelective(returnOrderRecord);
}
@Override
public List<ReturnOrderRecord> findByReturnOrderId(String returnOrderId) {
ReturnOrderRecordExample example = new ReturnOrderRecordExample();
ReturnOrderRecordExample.Criteria criteria = example.createCriteria();
JdbcHelper.ifPresent(returnOrderId, criteria::andReturnOrderIdEqualTo);
example.orderBy(" create_time asc");
return returnOrderRecordMapper.selectByExample(example);
}
@Override
public ReturnOrderRecord findByType(String returnOrderId, int type) {
ReturnOrderRecordExample example = new ReturnOrderRecordExample();
ReturnOrderRecordExample.Criteria criteria = example.createCriteria();
criteria.andReturnOrderIdEqualTo(returnOrderId);
criteria.andTypeEqualTo(type);
return returnOrderRecordMapper.selectOneByExample(example);
}
}
......@@ -7,6 +7,7 @@ import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface ConsignSaleMapper {
long countByExample(ConsignSaleExample example);
......
package com.wwdz.ch.db.mapper;
import com.wwdz.ch.db.domain.ReturnOrder;
import com.wwdz.ch.db.domain.ReturnOrderExample;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface ReturnOrderMapper {
long countByExample(ReturnOrderExample example);
int deleteByExample(ReturnOrderExample example);
int deleteByPrimaryKey(Integer id);
int insert(ReturnOrder record);
int insertSelective(ReturnOrder record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table return_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
ReturnOrder selectOneByExample(ReturnOrderExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table return_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
ReturnOrder selectOneByExampleSelective(@Param("example") ReturnOrderExample example, @Param("selective") ReturnOrder.Column ... selective);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table return_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
List<ReturnOrder> selectByExampleSelective(@Param("example") ReturnOrderExample example, @Param("selective") ReturnOrder.Column ... selective);
List<ReturnOrder> selectByExample(ReturnOrderExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table return_order
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
ReturnOrder selectByPrimaryKeySelective(@Param("id") Integer id, @Param("selective") ReturnOrder.Column ... selective);
ReturnOrder selectByPrimaryKey(Integer id);
int updateByExampleSelective(@Param("record") ReturnOrder record, @Param("example") ReturnOrderExample example);
int updateByExample(@Param("record") ReturnOrder record, @Param("example") ReturnOrderExample example);
int updateByPrimaryKeySelective(ReturnOrder record);
int updateByPrimaryKey(ReturnOrder record);
}
\ No newline at end of file
package com.wwdz.ch.db.mapper;
import com.wwdz.ch.db.domain.ReturnOrderRecord;
import com.wwdz.ch.db.domain.ReturnOrderRecordExample;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface ReturnOrderRecordMapper {
long countByExample(ReturnOrderRecordExample example);
int deleteByExample(ReturnOrderRecordExample example);
int deleteByPrimaryKey(Integer id);
int insert(ReturnOrderRecord record);
int insertSelective(ReturnOrderRecord record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table return_order_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
ReturnOrderRecord selectOneByExample(ReturnOrderRecordExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table return_order_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
ReturnOrderRecord selectOneByExampleSelective(@Param("example") ReturnOrderRecordExample example, @Param("selective") ReturnOrderRecord.Column ... selective);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table return_order_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
List<ReturnOrderRecord> selectByExampleSelective(@Param("example") ReturnOrderRecordExample example, @Param("selective") ReturnOrderRecord.Column ... selective);
List<ReturnOrderRecord> selectByExample(ReturnOrderRecordExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table return_order_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
ReturnOrderRecord selectByPrimaryKeySelective(@Param("id") Integer id, @Param("selective") ReturnOrderRecord.Column ... selective);
ReturnOrderRecord selectByPrimaryKey(Integer id);
int updateByExampleSelective(@Param("record") ReturnOrderRecord record, @Param("example") ReturnOrderRecordExample example);
int updateByExample(@Param("record") ReturnOrderRecord record, @Param("example") ReturnOrderRecordExample example);
int updateByPrimaryKeySelective(ReturnOrderRecord record);
int updateByPrimaryKey(ReturnOrderRecord record);
}
\ No newline at end of file
......@@ -14,6 +14,7 @@
<result column="settle_amount" jdbcType="INTEGER" property="settleAmount" />
<result column="custom_state" jdbcType="INTEGER" property="customState" />
<result column="system_state" jdbcType="INTEGER" property="systemState" />
<result column="address_id" jdbcType="BIGINT" property="addressId" />
<result column="logistics_code" jdbcType="VARCHAR" property="logisticsCode" />
<result column="waybill" jdbcType="VARCHAR" property="waybill" />
<result column="credential" jdbcType="VARCHAR" property="credential" />
......@@ -80,8 +81,8 @@
</sql>
<sql id="Base_Column_List">
id, sale_id, item_id, user_id, sale_time, user_price, img_valuation, valuation, deal_price,
settle_amount, custom_state, system_state, logistics_code, waybill, credential, create_time,
update_time
settle_amount, custom_state, system_state, address_id, logistics_code, waybill, credential,
create_time, update_time
</sql>
<select id="selectByExample" parameterType="com.wwdz.ch.db.domain.ConsignSaleExample" resultMap="BaseResultMap">
select
......@@ -117,8 +118,8 @@
</when>
<otherwise>
id, sale_id, item_id, user_id, sale_time, user_price, img_valuation, valuation, deal_price,
settle_amount, custom_state, system_state, logistics_code, waybill, credential,
create_time, update_time
settle_amount, custom_state, system_state, address_id, logistics_code, waybill,
credential, create_time, update_time
</otherwise>
</choose>
from consign_sale
......@@ -150,8 +151,8 @@
</when>
<otherwise>
id, sale_id, item_id, user_id, sale_time, user_price, img_valuation, valuation, deal_price,
settle_amount, custom_state, system_state, logistics_code, waybill, credential,
create_time, update_time
settle_amount, custom_state, system_state, address_id, logistics_code, waybill,
credential, create_time, update_time
</otherwise>
</choose>
from consign_sale
......@@ -174,15 +175,15 @@
insert into consign_sale (sale_id, item_id, user_id,
sale_time, user_price, img_valuation,
valuation, deal_price, settle_amount,
custom_state, system_state, logistics_code,
waybill, credential, create_time,
update_time)
custom_state, system_state, address_id,
logistics_code, waybill, credential,
create_time, update_time)
values (#{saleId,jdbcType=VARCHAR}, #{itemId,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT},
#{saleTime,jdbcType=TIMESTAMP}, #{userPrice,jdbcType=INTEGER}, #{imgValuation,jdbcType=VARCHAR},
#{valuation,jdbcType=INTEGER}, #{dealPrice,jdbcType=INTEGER}, #{settleAmount,jdbcType=INTEGER},
#{customState,jdbcType=INTEGER}, #{systemState,jdbcType=INTEGER}, #{logisticsCode,jdbcType=VARCHAR},
#{waybill,jdbcType=VARCHAR}, #{credential,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP})
#{customState,jdbcType=INTEGER}, #{systemState,jdbcType=INTEGER}, #{addressId,jdbcType=BIGINT},
#{logisticsCode,jdbcType=VARCHAR}, #{waybill,jdbcType=VARCHAR}, #{credential,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.wwdz.ch.db.domain.ConsignSale">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
......@@ -223,6 +224,9 @@
<if test="systemState != null">
system_state,
</if>
<if test="addressId != null">
address_id,
</if>
<if test="logisticsCode != null">
logistics_code,
</if>
......@@ -273,6 +277,9 @@
<if test="systemState != null">
#{systemState,jdbcType=INTEGER},
</if>
<if test="addressId != null">
#{addressId,jdbcType=BIGINT},
</if>
<if test="logisticsCode != null">
#{logisticsCode,jdbcType=VARCHAR},
</if>
......@@ -335,6 +342,9 @@
<if test="record.systemState != null">
system_state = #{record.systemState,jdbcType=INTEGER},
</if>
<if test="record.addressId != null">
address_id = #{record.addressId,jdbcType=BIGINT},
</if>
<if test="record.logisticsCode != null">
logistics_code = #{record.logisticsCode,jdbcType=VARCHAR},
</if>
......@@ -369,6 +379,7 @@
settle_amount = #{record.settleAmount,jdbcType=INTEGER},
custom_state = #{record.customState,jdbcType=INTEGER},
system_state = #{record.systemState,jdbcType=INTEGER},
address_id = #{record.addressId,jdbcType=BIGINT},
logistics_code = #{record.logisticsCode,jdbcType=VARCHAR},
waybill = #{record.waybill,jdbcType=VARCHAR},
credential = #{record.credential,jdbcType=VARCHAR},
......@@ -414,6 +425,9 @@
<if test="systemState != null">
system_state = #{systemState,jdbcType=INTEGER},
</if>
<if test="addressId != null">
address_id = #{addressId,jdbcType=BIGINT},
</if>
<if test="logisticsCode != null">
logistics_code = #{logisticsCode,jdbcType=VARCHAR},
</if>
......@@ -445,6 +459,7 @@
settle_amount = #{settleAmount,jdbcType=INTEGER},
custom_state = #{customState,jdbcType=INTEGER},
system_state = #{systemState,jdbcType=INTEGER},
address_id = #{addressId,jdbcType=BIGINT},
logistics_code = #{logisticsCode,jdbcType=VARCHAR},
waybill = #{waybill,jdbcType=VARCHAR},
credential = #{credential,jdbcType=VARCHAR},
......@@ -486,8 +501,8 @@
</when>
<otherwise>
id, sale_id, item_id, user_id, sale_time, user_price, img_valuation, valuation, deal_price,
settle_amount, custom_state, system_state, logistics_code, waybill, credential,
create_time, update_time
settle_amount, custom_state, system_state, address_id, logistics_code, waybill,
credential, create_time, update_time
</otherwise>
</choose>
from consign_sale
......
......@@ -72,7 +72,7 @@
<javaClientGenerator type="XMLMAPPER" targetPackage="com.wwdz.ch.db.mapper"
targetProject="ch-dao/src/main/java"/>
<table tableName="consign_sale" enableCountByExample="true" enableUpdateByExample="true" enableDeleteByExample="true" enableSelectByExample="true" selectByExampleQueryId="true">
<table tableName="return_order" enableCountByExample="true" enableUpdateByExample="true" enableDeleteByExample="true" enableSelectByExample="true" selectByExampleQueryId="true">
<generatedKey column="id" sqlStatement="Mysql" identity="true" />
</table>
......
......@@ -43,6 +43,16 @@ public class UserInfo implements Serializable {
private String profile;
private String background;
/**
* 未完成寄售单数量
*/
private Integer consignOrderNumber;
/**
* 未完成退货单数量
*/
private Integer returnOrderNumber;
}
......@@ -524,6 +524,7 @@ public class ConsignSaleServiceImpl implements ConsignSaleService {
consignSale.setSaleId(dto.getSaleId());
consignSale.setLogisticsCode(dto.getLogisticsCode());
consignSale.setWaybill(dto.getWaybill());
consignSale.setAddressId(dto.getAddressId());
consignSale.setCustomState(ConsignSaleEnum.SaleForUserStateEnum.CONSIGNED.getCode());
consignSale.setSystemState(ConsignSaleEnum.SaleForSysStateEnum.WAIT_TAKE.getCode());
consignSaleDao.update(consignSale);
......
......@@ -32,10 +32,7 @@ import com.wwdz.ch.wx.manager.AlipayLoginManager;
import com.wwdz.ch.wx.manager.TikTokLoginManager;
import com.wwdz.ch.wx.manager.UserTokenManager;
import com.wwdz.ch.wx.manager.WxLoginManager;
import com.wwdz.ch.wx.service.FollowFansRecordService;
import com.wwdz.ch.wx.service.ItemCommonService;
import com.wwdz.ch.wx.service.ItemService;
import com.wwdz.ch.wx.service.MessageService;
import com.wwdz.ch.wx.service.*;
import com.wwdz.ch.wx.util.RedisUtil;
import com.wwdz.ch.wx.util.StringUtil;
import com.wwdz.mall.common.vo.response.CloudServerResponse;
......@@ -149,6 +146,9 @@ public class ItemServiceImpl implements ItemService {
@Reference
CommunityAttributeReadService communityAttributeReadService;
@Autowired
ConsignSaleService consignSaleService;
@Override
public Result nameList(ItemRequestDto dto) {
try {
......
package com.wwdz.ch.wx.service;
import com.wwdz.ch.core.type.Result;
import com.wwdz.ch.db.dto.request.ReturnOrderRequestDto;
public interface ReturnOrderService {
/**
* 查询退货单
* @param dto
* @return
*/
Result findList(ReturnOrderRequestDto dto);
/**
* 查询退货单详情
* @param dto
* @return
*/
Result findDetail(ReturnOrderRequestDto 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