commit
a28eceaf61
20
DB/2024-3-19.sql
Normal file
20
DB/2024-3-19.sql
Normal file
@ -0,0 +1,20 @@
|
||||
|
||||
/**
|
||||
文件表增加拥有者名称
|
||||
*/
|
||||
ALTER TABLE li_file ADD `owner_name` varchar(255) DEFAULT NULL COMMENT '拥有者名称';
|
||||
|
||||
/**
|
||||
初始化文件拥有者名称
|
||||
*/
|
||||
UPDATE li_file f JOIN li_store s ON f.owner_id = s.id
|
||||
SET f.owner_name = s.store_name
|
||||
WHERE user_enums = 'STORE';
|
||||
|
||||
UPDATE li_file f JOIN li_admin_user a ON f.owner_id = a.id
|
||||
SET f.owner_name = a.nick_name
|
||||
WHERE user_enums = 'MANAGER';
|
||||
|
||||
UPDATE li_file f JOIN li_member m ON f.owner_id = m.id
|
||||
SET f.owner_name = m.nick_name
|
||||
WHERE user_enums = 'MEMBER';
|
@ -105,8 +105,10 @@ public class UploadController {
|
||||
//如果是店铺,则记录店铺id
|
||||
if (authUser.getRole().equals(UserEnums.STORE)) {
|
||||
newFile.setOwnerId(authUser.getStoreId());
|
||||
newFile.setOwnerName(authUser.getStoreName());
|
||||
} else {
|
||||
newFile.setOwnerId(authUser.getId());
|
||||
newFile.setOwnerName(authUser.getNickName());
|
||||
}
|
||||
|
||||
//存储文件目录
|
||||
|
@ -43,7 +43,7 @@ public class VerificationOrderExecute implements OrderStatusChangeEvent {
|
||||
//修改虚拟订单货物可以进行售后、投诉
|
||||
orderItemService.update(new LambdaUpdateWrapper<OrderItem>().eq(OrderItem::getOrderSn, orderMessage.getOrderSn())
|
||||
.set(OrderItem::getAfterSaleStatus, OrderItemAfterSaleStatusEnum.ALREADY_APPLIED)
|
||||
.set(OrderItem::getCommentStatus, OrderComplaintStatusEnum.COMPLETE));
|
||||
.set(OrderItem::getComplainStatus, OrderComplaintStatusEnum.COMPLETE));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -80,23 +80,25 @@ public class DistributionServiceImpl extends ServiceImpl<DistributionMapper, Dis
|
||||
|
||||
//如果分销员非空并未审核则提示用户请等待,如果分销员为拒绝状态则重新提交申请
|
||||
if (Optional.ofNullable(distribution).isPresent()) {
|
||||
if (distribution.getDistributionStatus().equals(DistributionStatusEnum.APPLY.name())) {
|
||||
throw new ServiceException(ResultCode.DISTRIBUTION_IS_APPLY);
|
||||
} else if (distribution.getDistributionStatus().equals(DistributionStatusEnum.REFUSE.name())) {
|
||||
distribution.setDistributionStatus(DistributionStatusEnum.APPLY.name());
|
||||
BeanUtil.copyProperties(distributionApplyDTO, distribution);
|
||||
this.updateById(distribution);
|
||||
return distribution;
|
||||
switch (DistributionStatusEnum.valueOf(distribution.getDistributionStatus())) {
|
||||
case REFUSE:
|
||||
case RETREAT:
|
||||
distribution.setDistributionStatus(DistributionStatusEnum.APPLY.name());
|
||||
BeanUtil.copyProperties(distributionApplyDTO, distribution);
|
||||
this.updateById(distribution);
|
||||
return distribution;
|
||||
default:
|
||||
throw new ServiceException(ResultCode.DISTRIBUTION_IS_APPLY);
|
||||
}
|
||||
}else{
|
||||
//如果未申请分销员则新增进行申请
|
||||
//获取当前登录用户
|
||||
Member member = memberService.getUserInfo();
|
||||
//新建分销员
|
||||
distribution = new Distribution(member.getId(), member.getNickName(), distributionApplyDTO);
|
||||
//添加分销员
|
||||
this.save(distribution);
|
||||
}
|
||||
//如果未申请分销员则新增进行申请
|
||||
//获取当前登录用户
|
||||
Member member = memberService.getUserInfo();
|
||||
//新建分销员
|
||||
distribution = new Distribution(member.getId(), member.getNickName(), distributionApplyDTO);
|
||||
//添加分销员
|
||||
this.save(distribution);
|
||||
|
||||
return distribution;
|
||||
}
|
||||
|
||||
|
@ -41,6 +41,9 @@ public class File extends BaseEntity {
|
||||
@ApiModelProperty(value = "拥有者id")
|
||||
private String ownerId;
|
||||
|
||||
@ApiModelProperty(value = "拥有者名称")
|
||||
private String ownerName;
|
||||
|
||||
@ApiModelProperty(value = "用户类型")
|
||||
private String userEnums;
|
||||
|
||||
|
@ -25,6 +25,9 @@ public class FileOwnerDTO extends PageVO {
|
||||
@ApiModelProperty(value = "拥有者id")
|
||||
private String ownerId;
|
||||
|
||||
@ApiModelProperty(value = "拥有者名称")
|
||||
private String ownerName;
|
||||
|
||||
@ApiModelProperty(value = "用户类型")
|
||||
private String userEnums;
|
||||
|
||||
|
@ -88,6 +88,7 @@ public class FileServiceImpl extends ServiceImpl<FileMapper, File> implements Fi
|
||||
public IPage<File> customerPage(FileOwnerDTO fileOwnerDTO) {
|
||||
LambdaQueryWrapper<File> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.like(CharSequenceUtil.isNotEmpty(fileOwnerDTO.getName()), File::getName, fileOwnerDTO.getName())
|
||||
.like(CharSequenceUtil.isNotEmpty(fileOwnerDTO.getOwnerName()), File::getOwnerName, fileOwnerDTO.getOwnerName())
|
||||
.eq(CharSequenceUtil.isNotEmpty(fileOwnerDTO.getFileDirectoryId()),File::getFileDirectoryId, fileOwnerDTO.getFileDirectoryId())
|
||||
.like(CharSequenceUtil.isNotEmpty(fileOwnerDTO.getFileKey()), File::getFileKey, fileOwnerDTO.getFileKey())
|
||||
.like(CharSequenceUtil.isNotEmpty(fileOwnerDTO.getFileType()), File::getFileType, fileOwnerDTO.getFileType())
|
||||
|
Loading…
x
Reference in New Issue
Block a user