Commit 0fe49fa6 authored by shiyu's avatar shiyu

专场商品列表新增是否被订阅字段

parent 5d9252ac
package com.wwdz.ch.admin.controller;
import com.wwdz.ch.admin.service.SysSupplierItemService;
import com.wwdz.ch.admin.service.SysUserBankCardService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/admin/userBankCard")
public class UserBankCardController {
private static final Logger logger = LoggerFactory.getLogger(UserBankCardController.class);
@Autowired
SysUserBankCardService sysUserBankCardService;
}
package com.wwdz.ch.admin.impl;
import com.wwdz.ch.admin.service.SysUserBankCardService;
import com.wwdz.ch.core.type.Result;
import com.wwdz.ch.db.dao.distribution.UserBankCardDao;
import com.wwdz.ch.db.domain.distribution.UserBankCard;
import com.wwdz.ch.db.dto.request.distribution.SupplierItemRequestDto;
import com.wwdz.ch.db.dto.request.distribution.UserBankCardRequestDto;
import com.xxdxxs.utils.EntityMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
@Service
public class SysUserBankCardServiceImpl implements SysUserBankCardService {
private static final Logger logger = LoggerFactory.getLogger(SysUserBankCardServiceImpl.class);
@Autowired
UserBankCardDao userBankCardDao;
@Override
public Result add(UserBankCardRequestDto dto) {
try {
UserBankCard userBankCard = new UserBankCard();
EntityMapper.copyAttribute(dto, userBankCard);
userBankCard.setCreateTime(new Date());
userBankCard.setState(1);
userBankCardDao.insert(userBankCard);
return Result.success();
} catch (Exception e) {
logger.error("添加用户银行卡失败:{}", e);
}
return Result.failed();
}
}
package com.wwdz.ch.admin.service;
import com.wwdz.ch.core.type.Result;
import com.wwdz.ch.db.dto.request.distribution.SupplierItemRequestDto;
import com.wwdz.ch.db.dto.request.distribution.UserBankCardRequestDto;
public interface SysUserBankCardService {
/**
* 新增银行卡号
* @param dto
* @return
*/
Result add(UserBankCardRequestDto dto);
}
...@@ -11,7 +11,7 @@ public class DisposableSubscribeRecordEnum { ...@@ -11,7 +11,7 @@ public class DisposableSubscribeRecordEnum {
public enum TypeEnum { public enum TypeEnum {
PRE_START(1, "AzJht7hkLJHSCN7trT3zsV3TaOE0Xk8faqm2sTf3Pm4", "拍卖开始通知"), PRE_START(1, "AzJht7hkLJHSCN7trT3zsV3TaOE0Xk8faqm2sTf3Pm4", "拍卖开始通知"),
PRE_END(2, "G-GwA4yn63RJ6IysFotHB4anctNqbOy5qrz_R6vBJkM", "即将结束"), PRE_END(2, "G-GwA4yn63RJ6IysFotHB4anctNqbOy5qrz_R6vBJkM", "即将结束"),
ITEM_PRE_END(3, "G-XhEvunfXdO0j5JSpCVKKYlLuQbF7Yux8QfVEz5_L9xQ", "拍品即将结束"), ITEM_PRE_END(3, "XhEvunfXdO0j5JSpCVKKYlLuQbF7Yux8QfVEz5_L9xQ", "拍品即将结束"),
; ;
......
...@@ -11,6 +11,7 @@ public class DistributionEnum { ...@@ -11,6 +11,7 @@ public class DistributionEnum {
PRE_SIGNED(20, "待收货"), PRE_SIGNED(20, "待收货"),
AFTER_SALE(30, "售后中"), AFTER_SALE(30, "售后中"),
REFUNDING(80, "退款受理中"), REFUNDING(80, "退款受理中"),
SIGNED(90, "已签收"),
FINISH(100, "已完成"), FINISH(100, "已完成"),
CANCEL(101, "已取消"), CANCEL(101, "已取消"),
......
...@@ -329,4 +329,9 @@ public class SupplierItemVo implements Entity { ...@@ -329,4 +329,9 @@ public class SupplierItemVo implements Entity {
*/ */
private Long followRecordId; private Long followRecordId;
/**
* 是否被订阅
*/
private Boolean isSubscribed;
} }
package com.wwdz.ch.db.dao.distribution; package com.wwdz.ch.db.dao.distribution;
import com.wwdz.ch.db.domain.distribution.UserAccountDetail; import com.wwdz.ch.db.domain.distribution.UserAccountDetail;
import com.wwdz.ch.db.dto.request.distribution.UserAccountDetailRequestDto;
import java.util.List;
public interface UserAccountDetailDao { public interface UserAccountDetailDao {
boolean insert(UserAccountDetail userAccountDetail); boolean insert(UserAccountDetail userAccountDetail);
boolean update(UserAccountDetail userAccountDetail); boolean update(UserAccountDetail userAccountDetail);
List<UserAccountDetail> findList(UserAccountDetailRequestDto dto);
} }
package com.wwdz.ch.db.dao.distribution;
import com.wwdz.ch.db.domain.distribution.UserBankCard;
public interface UserBankCardDao {
boolean insert(UserBankCard userBankCard);
UserBankCard findById(long userId);
}
package com.wwdz.ch.db.domain.distribution;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import com.xxdxxs.entity.Entity;
import lombok.Data;
/**
* @author shiyu
* @date 2024/07/09
*/
@Data
public class UserBankCard implements Entity {
private Long id;
/**
* 用户ID
*/
private Long userId;
/**
* 卡号
*/
private String cardId;
/**
* 名称
*/
private String name;
/**
* 创建时间
*/
private Date createTime;
/**
* 状态1有效
*/
private Integer state;
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(", userId=").append(userId);
sb.append(", cardId=").append(cardId);
sb.append(", name=").append(name);
sb.append(", createTime=").append(createTime);
sb.append(", state=").append(state);
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;
}
UserBankCard other = (UserBankCard) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
&& (this.getCardId() == null ? other.getCardId() == null : this.getCardId().equals(other.getCardId()))
&& (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getState() == null ? other.getState() == null : this.getState().equals(other.getState()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
result = prime * result + ((getCardId() == null) ? 0 : getCardId().hashCode());
result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getState() == null) ? 0 : getState().hashCode());
return result;
}
/**
* This enum was generated by MyBatis Generator.
* This enum corresponds to the database table user_bank_card
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public enum Column {
id("id", "id", "BIGINT", false),
userId("user_id", "userId", "BIGINT", false),
cardId("card_id", "cardId", "VARCHAR", false),
name("name", "name", "VARCHAR", true),
createTime("create_time", "createTime", "TIMESTAMP", false),
state("state", "state", "INTEGER", true);
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table user_bank_card
*
* @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 user_bank_card
*
* @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 user_bank_card
*
* @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 user_bank_card
*
* @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 user_bank_card
*
* @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 user_bank_card
*
* @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 user_bank_card
*
* @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 user_bank_card
*
* @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 user_bank_card
*
* @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 user_bank_card
*
* @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 user_bank_card
*
* @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 user_bank_card
*
* @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 user_bank_card
*
* @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 user_bank_card
*
* @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 user_bank_card
*
* @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
...@@ -4,6 +4,7 @@ import com.wwdz.ch.db.dto.request.BaseRequestDto; ...@@ -4,6 +4,7 @@ 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.util.Date; import java.util.Date;
import java.util.List;
@Data @Data
public class UserAccountDetailRequestDto extends BaseRequestDto implements Entity { public class UserAccountDetailRequestDto extends BaseRequestDto implements Entity {
...@@ -20,6 +21,16 @@ public class UserAccountDetailRequestDto extends BaseRequestDto implements Entit ...@@ -20,6 +21,16 @@ public class UserAccountDetailRequestDto extends BaseRequestDto implements Entit
*/ */
private String orderId; private String orderId;
/**
* 批量查询订单id
*/
private List<String> orderIdList;
/**
* 查询时需要排除的订单id
*/
private List<String> filterOrderIdList;
/** /**
* 收入或支出的类型 * 收入或支出的类型
*/ */
......
package com.wwdz.ch.db.dto.request.distribution;
import com.wwdz.ch.db.dto.request.BaseRequestDto;
import com.xxdxxs.entity.Entity;
import lombok.Data;
import java.util.Date;
@Data
public class UserBankCardRequestDto extends BaseRequestDto implements Entity {
private Long id;
/**
* 用户ID
*/
private Long userId;
/**
* 卡号
*/
private String cardId;
/**
* 名称
*/
private String name;
/**
* 创建时间
*/
private Date createTime;
/**
* 状态1有效
*/
private Integer state;
}
package com.wwdz.ch.db.impl.distribution; package com.wwdz.ch.db.impl.distribution;
import com.github.pagehelper.PageHelper;
import com.wwdz.ch.db.dao.distribution.UserAccountDetailDao; import com.wwdz.ch.db.dao.distribution.UserAccountDetailDao;
import com.wwdz.ch.db.domain.distribution.UserAccountDetail; import com.wwdz.ch.db.domain.distribution.UserAccountDetail;
import com.wwdz.ch.db.domain.distribution.UserAccountDetailExample; import com.wwdz.ch.db.domain.distribution.UserAccountDetailExample;
import com.wwdz.ch.db.dto.request.distribution.UserAccountDetailRequestDto;
import com.wwdz.ch.db.mapper.distribution.UserAccountDetailMapper; import com.wwdz.ch.db.mapper.distribution.UserAccountDetailMapper;
import com.xxdxxs.db.component.JdbcHelper; import com.xxdxxs.db.component.JdbcHelper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import java.util.Date; import java.util.Date;
import java.util.List;
@Repository @Repository
public class UserAccountDetailDaoImpl implements UserAccountDetailDao { public class UserAccountDetailDaoImpl implements UserAccountDetailDao {
...@@ -34,4 +37,19 @@ public class UserAccountDetailDaoImpl implements UserAccountDetailDao { ...@@ -34,4 +37,19 @@ public class UserAccountDetailDaoImpl implements UserAccountDetailDao {
} }
@Override
public List<UserAccountDetail> findList(UserAccountDetailRequestDto dto) {
UserAccountDetailExample example = new UserAccountDetailExample();
UserAccountDetailExample.Criteria criteria = example.createCriteria();
JdbcHelper.ifPresent(dto.getUserId(), criteria::andUserIdEqualTo);
JdbcHelper.ifPresent(dto.getOrderId(), criteria::andOrderIdEqualTo);
JdbcHelper.ifPresent(dto.getOrderIdList(), criteria::andOrderIdIn);
JdbcHelper.ifPresent(dto.getFilterOrderIdList(), criteria::andOrderIdNotIn);
JdbcHelper.ifPresent(dto.getState(), criteria::andStateEqualTo);
JdbcHelper.ifPresent(dto.getType(), criteria::andTypeEqualTo);
JdbcHelper.ifPresent(dto.getFundType(), criteria::andFundTypeEqualTo);
example.setOrderByClause(" create_time desc");
PageHelper.startPage(dto.getPage(), dto.getLimit());
return userAccountDetailMapper.selectByExample(example);
}
} }
package com.wwdz.ch.db.impl.distribution;
import com.wwdz.ch.db.dao.distribution.UserBankCardDao;
import com.wwdz.ch.db.domain.distribution.UserBankCard;
import com.wwdz.ch.db.domain.distribution.UserBankCardExample;
import com.wwdz.ch.db.mapper.distribution.UserBankCardMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
@Repository
public class UserBankCardDaoImpl implements UserBankCardDao {
@Autowired
UserBankCardMapper userBankCardMapper;
@Override
public boolean insert(UserBankCard userBankCard) {
return userBankCardMapper.insert(userBankCard) > 0;
}
@Override
public UserBankCard findById(long userId) {
UserBankCardExample example = new UserBankCardExample();
UserBankCardExample.Criteria criteria = example.createCriteria();
criteria.andUserIdEqualTo(userId);
return userBankCardMapper.selectOneByExample(example);
}
}
package com.wwdz.ch.db.mapper.distribution;
import com.wwdz.ch.db.domain.distribution.UserBankCard;
import com.wwdz.ch.db.domain.distribution.UserBankCardExample;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface UserBankCardMapper {
long countByExample(UserBankCardExample example);
int deleteByExample(UserBankCardExample example);
int deleteByPrimaryKey(Long id);
int insert(UserBankCard record);
int insertSelective(UserBankCard record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bank_card
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
UserBankCard selectOneByExample(UserBankCardExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bank_card
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
UserBankCard selectOneByExampleSelective(@Param("example") UserBankCardExample example, @Param("selective") UserBankCard.Column ... selective);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bank_card
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
List<UserBankCard> selectByExampleSelective(@Param("example") UserBankCardExample example, @Param("selective") UserBankCard.Column ... selective);
List<UserBankCard> selectByExample(UserBankCardExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bank_card
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
UserBankCard selectByPrimaryKeySelective(@Param("id") Long id, @Param("selective") UserBankCard.Column ... selective);
UserBankCard selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") UserBankCard record, @Param("example") UserBankCardExample example);
int updateByExample(@Param("record") UserBankCard record, @Param("example") UserBankCardExample example);
int updateByPrimaryKeySelective(UserBankCard record);
int updateByPrimaryKey(UserBankCard record);
}
\ No newline at end of file
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
<javaClientGenerator type="XMLMAPPER" targetPackage="com.wwdz.ch.db.mapper.distribution" <javaClientGenerator type="XMLMAPPER" targetPackage="com.wwdz.ch.db.mapper.distribution"
targetProject="ch-dao/src/main/java"/> targetProject="ch-dao/src/main/java"/>
<table tableName="user_account_detail" enableCountByExample="true" enableUpdateByExample="true" enableDeleteByExample="true" enableSelectByExample="true" selectByExampleQueryId="true"> <table tableName="user_bank_card" 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>
......
...@@ -388,6 +388,8 @@ public class SpecialPerformanceServiceImpl implements SpecialPerformanceService ...@@ -388,6 +388,8 @@ public class SpecialPerformanceServiceImpl implements SpecialPerformanceService
} else { } else {
supplierItemVo.setIsFollowed(false); supplierItemVo.setIsFollowed(false);
} }
supplierItemVo.setIsSubscribed(disposableSubscribeRecordDao.isSubscribed(dto.getUserId(), itemId, DisposableSubscribeRecordEnum.TypeEnum.ITEM_PRE_END.getType()));
supplierItemVo.setLot(specialPerformanceConfig.getLot()); supplierItemVo.setLot(specialPerformanceConfig.getLot());
supplierItemVo.setCurrentPrice(PriceUtil.convertPriceFenToYuan(specialPerformanceConfig.getCurrentPrice())); supplierItemVo.setCurrentPrice(PriceUtil.convertPriceFenToYuan(specialPerformanceConfig.getCurrentPrice()));
supplierItemVo.setItemId(supplierItem.getId()); supplierItemVo.setItemId(supplierItem.getId());
......
...@@ -568,7 +568,7 @@ public class SupplierItemServiceImpl implements SupplierItemService { ...@@ -568,7 +568,7 @@ public class SupplierItemServiceImpl implements SupplierItemService {
SpecialPerformanceConfig specialPerformanceConfig = specialPerformanceConfigList.get(0); SpecialPerformanceConfig specialPerformanceConfig = specialPerformanceConfigList.get(0);
auctionDetailVo.setSpecialPerformanceId(specialPerformanceConfig.getSpecialPerformanceId()); auctionDetailVo.setSpecialPerformanceId(specialPerformanceConfig.getSpecialPerformanceId());
auctionDetailVo.setCurrentPrice(PriceUtil.convertPriceFenToYuan(specialPerformanceConfig.getCurrentPrice())); auctionDetailVo.setCurrentPrice(PriceUtil.convertPriceFenToYuan(specialPerformanceConfig.getCurrentPrice()));
auctionDetailVo.setIsSubscribed(disposableSubscribeRecordDao.isSubscribed(dto.getUserId(), specialPerformanceConfig.getSpecialPerformanceId(), DisposableSubscribeRecordEnum.TypeEnum.ITEM_PRE_END.getType())); auctionDetailVo.setIsSubscribed(disposableSubscribeRecordDao.isSubscribed(dto.getUserId(), itemId, DisposableSubscribeRecordEnum.TypeEnum.ITEM_PRE_END.getType()));
//查询用户是否关注该商品 //查询用户是否关注该商品
SpecialPerformanceItemFollowRequestDto specialPerformanceItemFollowRequestDto = new SpecialPerformanceItemFollowRequestDto(); SpecialPerformanceItemFollowRequestDto specialPerformanceItemFollowRequestDto = new SpecialPerformanceItemFollowRequestDto();
specialPerformanceItemFollowRequestDto.setSpecialPerformanceId(specialPerformanceConfig.getSpecialPerformanceId()); specialPerformanceItemFollowRequestDto.setSpecialPerformanceId(specialPerformanceConfig.getSpecialPerformanceId());
......
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