Compare commits
11 Commits
ed6d2748fc
...
3ef4c71258
Author | SHA1 | Date |
---|---|---|
|
3ef4c71258 | |
|
14e7a934de | |
|
a26cd2e3c5 | |
|
ffc5befc81 | |
|
10329475f3 | |
|
32bf187134 | |
|
34f250b354 | |
|
ca858ba62b | |
|
97bf45987f | |
|
dc260dec0e | |
|
003b5b972c |
|
@ -0,0 +1,68 @@
|
||||||
|
package com.agileboot.admin.controller.ab98.tag;
|
||||||
|
|
||||||
|
import com.agileboot.admin.customize.aop.accessLog.AccessLog;
|
||||||
|
import com.agileboot.common.core.base.BaseController;
|
||||||
|
import com.agileboot.common.core.dto.ResponseDTO;
|
||||||
|
import com.agileboot.common.core.page.PageDTO;
|
||||||
|
import com.agileboot.common.enums.common.BusinessTypeEnum;
|
||||||
|
import com.agileboot.domain.common.command.BulkOperationCommand;
|
||||||
|
import com.agileboot.domain.ab98.tag.Ab98UserTagApplicationService;
|
||||||
|
import com.agileboot.domain.ab98.tag.command.AddAb98UserTagCommand;
|
||||||
|
import com.agileboot.domain.ab98.tag.command.UpdateAb98UserTagCommand;
|
||||||
|
import com.agileboot.domain.ab98.tag.db.Ab98UserTagEntity;
|
||||||
|
import com.agileboot.domain.ab98.tag.dto.Ab98UserTagDTO;
|
||||||
|
import com.agileboot.domain.ab98.tag.query.SearchAb98UserTagQuery;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import java.util.List;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PutMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/ab98/userTags")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Validated
|
||||||
|
public class Ab98UserTagController extends BaseController {
|
||||||
|
|
||||||
|
private final Ab98UserTagApplicationService ab98UserTagApplicationService;
|
||||||
|
|
||||||
|
@Operation(summary = "用户标签列表")
|
||||||
|
@GetMapping
|
||||||
|
public ResponseDTO<PageDTO<Ab98UserTagDTO>> list(SearchAb98UserTagQuery<Ab98UserTagEntity> query) {
|
||||||
|
PageDTO<Ab98UserTagDTO> page = ab98UserTagApplicationService.getAb98UserTagList(query);
|
||||||
|
return ResponseDTO.ok(page);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "新增用户标签")
|
||||||
|
@AccessLog(title = "用户标签管理", businessType = BusinessTypeEnum.ADD)
|
||||||
|
@PostMapping
|
||||||
|
public ResponseDTO<Void> add(@Validated @RequestBody AddAb98UserTagCommand command) {
|
||||||
|
ab98UserTagApplicationService.addAb98UserTag(command);
|
||||||
|
return ResponseDTO.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "修改用户标签")
|
||||||
|
@AccessLog(title = "用户标签管理", businessType = BusinessTypeEnum.MODIFY)
|
||||||
|
@PutMapping("/{id}")
|
||||||
|
public ResponseDTO<Void> edit(@PathVariable Long id, @Validated @RequestBody UpdateAb98UserTagCommand command) {
|
||||||
|
command.setTagId(id);
|
||||||
|
ab98UserTagApplicationService.updateAb98UserTag(command);
|
||||||
|
return ResponseDTO.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "删除用户标签")
|
||||||
|
@AccessLog(title = "用户标签管理", businessType = BusinessTypeEnum.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public ResponseDTO<Void> remove(@PathVariable @NotNull List<Long> ids) {
|
||||||
|
ab98UserTagApplicationService.deleteAb98UserTag(new BulkOperationCommand<>(ids));
|
||||||
|
return ResponseDTO.ok();
|
||||||
|
}
|
||||||
|
}
|
|
@ -5,14 +5,24 @@ import com.agileboot.common.core.base.BaseController;
|
||||||
import com.agileboot.common.core.dto.ResponseDTO;
|
import com.agileboot.common.core.dto.ResponseDTO;
|
||||||
import com.agileboot.common.core.page.PageDTO;
|
import com.agileboot.common.core.page.PageDTO;
|
||||||
import com.agileboot.common.enums.common.BusinessTypeEnum;
|
import com.agileboot.common.enums.common.BusinessTypeEnum;
|
||||||
|
import com.agileboot.domain.cabinet.cell.CabinetCellApplicationService;
|
||||||
|
import com.agileboot.domain.cabinet.smartCabinet.SmartCabinetApplicationService;
|
||||||
import com.agileboot.domain.common.command.BulkOperationCommand;
|
import com.agileboot.domain.common.command.BulkOperationCommand;
|
||||||
|
import com.agileboot.domain.mqtt.MqttService;
|
||||||
|
import com.agileboot.domain.shop.goods.GoodsApplicationService;
|
||||||
|
import com.agileboot.domain.shop.order.OrderApplicationService;
|
||||||
|
import com.agileboot.domain.shop.order.db.ShopOrderGoodsEntity;
|
||||||
|
import com.agileboot.domain.shop.order.db.TodayLatestOrderGoodsDTO;
|
||||||
import com.agileboot.domain.shop.shop.ShopApplicationService;
|
import com.agileboot.domain.shop.shop.ShopApplicationService;
|
||||||
import com.agileboot.domain.shop.shop.command.AddShopCommand;
|
import com.agileboot.domain.shop.shop.command.AddShopCommand;
|
||||||
import com.agileboot.domain.shop.shop.command.UpdateShopCommand;
|
import com.agileboot.domain.shop.shop.command.UpdateShopCommand;
|
||||||
import com.agileboot.domain.shop.shop.db.ShopEntity;
|
import com.agileboot.domain.shop.shop.db.ShopEntity;
|
||||||
import com.agileboot.domain.shop.shop.dto.ShopDTO;
|
import com.agileboot.domain.shop.shop.dto.ShopDTO;
|
||||||
|
import com.agileboot.domain.shop.shop.dto.StatsDTO;
|
||||||
import com.agileboot.domain.shop.shop.query.SearchShopQuery;
|
import com.agileboot.domain.shop.shop.query.SearchShopQuery;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
@ -33,6 +43,60 @@ import org.springframework.web.bind.annotation.RestController;
|
||||||
public class ShopController extends BaseController {
|
public class ShopController extends BaseController {
|
||||||
|
|
||||||
private final ShopApplicationService shopApplicationService;
|
private final ShopApplicationService shopApplicationService;
|
||||||
|
private final GoodsApplicationService goodsApplicationService;
|
||||||
|
private final OrderApplicationService orderApplicationService;
|
||||||
|
private final SmartCabinetApplicationService smartCabinetApplicationService;
|
||||||
|
private final CabinetCellApplicationService cabinetCellApplicationService;
|
||||||
|
private final MqttService mqttService;
|
||||||
|
|
||||||
|
@Operation(summary = "首页数据")
|
||||||
|
@GetMapping("/Stats")
|
||||||
|
public ResponseDTO<StatsDTO> stats() {
|
||||||
|
// 创建统计数据DTO对象
|
||||||
|
StatsDTO statsDTO = new StatsDTO();
|
||||||
|
// 设置商店总数(调用商店服务统计)
|
||||||
|
statsDTO.setShopCount(shopApplicationService.countAllRecord());
|
||||||
|
// 设置商品总数(调用商品服务统计)
|
||||||
|
statsDTO.setGoodsCount(goodsApplicationService.countAllRecord());
|
||||||
|
// 设置商品总金额(调用商品服务计算)
|
||||||
|
statsDTO.setGoodsTotalAmount(goodsApplicationService.calculateTotalAmount());
|
||||||
|
// 设置订单总数(调用订单服务统计)
|
||||||
|
statsDTO.setOrderCount(orderApplicationService.countAllRecord());
|
||||||
|
// 设置订单总金额(调用订单服务计算)
|
||||||
|
statsDTO.setOrderAmountSum(orderApplicationService.sumTotalAmount());
|
||||||
|
|
||||||
|
List<ShopOrderGoodsEntity> unReturnOrderGoods = orderApplicationService.selectUnReturnOrderGoods();
|
||||||
|
// 设置未还商品数量(调用订单服务统计)
|
||||||
|
statsDTO.setUnReturnedGoodsCount((long) unReturnOrderGoods.size());
|
||||||
|
// 设置未还订单数量(调用订单服务统计)
|
||||||
|
statsDTO.setUnReturnedOrderCount(unReturnOrderGoods.stream().map(ShopOrderGoodsEntity::getOrderId).distinct().count());
|
||||||
|
// 设置未还金额(调用订单服务计算)
|
||||||
|
statsDTO.setUnReturnedAmount(unReturnOrderGoods.stream().map(ShopOrderGoodsEntity::getTotalAmount).reduce(BigDecimal.ZERO, BigDecimal::add));
|
||||||
|
|
||||||
|
// 设置智能柜总数(调用智能柜服务统计)
|
||||||
|
statsDTO.setCabinetCount(smartCabinetApplicationService.countAllRecord());
|
||||||
|
// 设置格口总数(调用格口服务统计)
|
||||||
|
statsDTO.setCellCount(cabinetCellApplicationService.countAllRecord());
|
||||||
|
// 设置已关联格口数(调用格口服务统计)
|
||||||
|
statsDTO.setLinkedCellCount(cabinetCellApplicationService.countLinkedRecord());
|
||||||
|
// 计算并设置未管理格口数(总格口数-已关联格口数)
|
||||||
|
statsDTO.setUnmanagedCellCount(statsDTO.getCellCount() - statsDTO.getLinkedCellCount());
|
||||||
|
// 设置网关数量(从MQTT服务获取)
|
||||||
|
statsDTO.setGatewayCount(mqttService.getGatewayCount());
|
||||||
|
// 设置热门商品列表(调用订单服务获取)
|
||||||
|
statsDTO.setTopGoods(orderApplicationService.selectTopGoodsByOccurrence());
|
||||||
|
// 获取今日最新订单商品列表
|
||||||
|
List<TodayLatestOrderGoodsDTO> todayLatestOrderGoodsDTOS = orderApplicationService.selectTodayLatestOrderGoods();
|
||||||
|
// 格式化每个订单商品的创建时间(HH:mm:ss格式)
|
||||||
|
todayLatestOrderGoodsDTOS.forEach(dto -> {
|
||||||
|
if (dto.getCreateTime() != null) {
|
||||||
|
dto.setCreateTimeStr(cn.hutool.core.date.DateUtil.format(dto.getCreateTime(), "HH:mm:ss"));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// 设置今日最新订单商品列表到统计DTO
|
||||||
|
statsDTO.setTodayLatestOrderGoods(todayLatestOrderGoodsDTOS);
|
||||||
|
return ResponseDTO.ok(statsDTO);
|
||||||
|
}
|
||||||
|
|
||||||
@Operation(summary = "商店列表")
|
@Operation(summary = "商店列表")
|
||||||
@GetMapping
|
@GetMapping
|
||||||
|
|
|
@ -0,0 +1,61 @@
|
||||||
|
package com.agileboot.domain.ab98.tag;
|
||||||
|
|
||||||
|
import com.agileboot.common.core.page.PageDTO;
|
||||||
|
import com.agileboot.domain.common.command.BulkOperationCommand;
|
||||||
|
import com.agileboot.domain.ab98.tag.command.AddAb98UserTagCommand;
|
||||||
|
import com.agileboot.domain.ab98.tag.command.UpdateAb98UserTagCommand;
|
||||||
|
import com.agileboot.domain.ab98.tag.db.Ab98UserTagEntity;
|
||||||
|
import com.agileboot.domain.ab98.tag.db.Ab98UserTagService;
|
||||||
|
import com.agileboot.domain.ab98.tag.dto.Ab98UserTagDTO;
|
||||||
|
import com.agileboot.domain.ab98.tag.model.Ab98UserTagModel;
|
||||||
|
import com.agileboot.domain.ab98.tag.model.Ab98UserTagModelFactory;
|
||||||
|
import com.agileboot.domain.ab98.tag.query.SearchAb98UserTagQuery;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@Slf4j
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class Ab98UserTagApplicationService {
|
||||||
|
private final Ab98UserTagService ab98UserTagService;
|
||||||
|
private final Ab98UserTagModelFactory ab98UserTagModelFactory;
|
||||||
|
|
||||||
|
public PageDTO<Ab98UserTagDTO> getAb98UserTagList(SearchAb98UserTagQuery<Ab98UserTagEntity> query) {
|
||||||
|
Page<Ab98UserTagEntity> page = ab98UserTagService.getUserTagList(query);
|
||||||
|
List<Ab98UserTagDTO> dtoList = page.getRecords().stream()
|
||||||
|
.map(Ab98UserTagDTO::new)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
return new PageDTO<>(dtoList, page.getTotal());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addAb98UserTag(AddAb98UserTagCommand command) {
|
||||||
|
Ab98UserTagModel model = ab98UserTagModelFactory.create();
|
||||||
|
model.loadAddCommand(command);
|
||||||
|
model.insert();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void updateAb98UserTag(UpdateAb98UserTagCommand command) {
|
||||||
|
Ab98UserTagModel model = ab98UserTagModelFactory.loadById(command.getTagId());
|
||||||
|
model.loadUpdateCommand(command);
|
||||||
|
model.updateById();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void deleteAb98UserTag(BulkOperationCommand<Long> command) {
|
||||||
|
for (Long tagId : command.getIds()) {
|
||||||
|
Ab98UserTagModel model = ab98UserTagModelFactory.loadById(tagId);
|
||||||
|
model.deleteById();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Ab98UserTagEntity getFirstEnabledTag() {
|
||||||
|
return ab98UserTagService.getFirstEnabledTag();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Ab98UserTagEntity getByTagId(Long tagId) {
|
||||||
|
return ab98UserTagService.getByTagId(tagId);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
package com.agileboot.domain.ab98.tag.command;
|
||||||
|
|
||||||
|
import com.agileboot.domain.ab98.tag.db.Ab98UserTagEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
public class AddAb98UserTagCommand extends Ab98UserTagEntity {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
package com.agileboot.domain.ab98.tag.command;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import javax.validation.constraints.PositiveOrZero;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
public class UpdateAb98UserTagCommand extends AddAb98UserTagCommand {
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@PositiveOrZero
|
||||||
|
private Long tagId;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,48 @@
|
||||||
|
package com.agileboot.domain.ab98.tag.db;
|
||||||
|
|
||||||
|
import com.agileboot.common.core.base.BaseEntity;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 用户标签表
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author valarchie
|
||||||
|
* @since 2025-05-22
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@TableName("ab98_user_tag")
|
||||||
|
@ApiModel(value = "Ab98UserTagEntity对象", description = "用户标签表")
|
||||||
|
public class Ab98UserTagEntity extends BaseEntity<Ab98UserTagEntity> {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty("标签ID")
|
||||||
|
@TableId(value = "tag_id", type = IdType.AUTO)
|
||||||
|
private Long tagId;
|
||||||
|
|
||||||
|
@ApiModelProperty("关联用户ID")
|
||||||
|
@TableField("ab98_user_id")
|
||||||
|
private Long ab98UserId;
|
||||||
|
|
||||||
|
@ApiModelProperty("标签名称")
|
||||||
|
@TableField("tag_name")
|
||||||
|
private String tagName;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Serializable pkVal() {
|
||||||
|
return this.tagId;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,38 @@
|
||||||
|
package com.agileboot.domain.ab98.tag.db;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import java.util.List;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.apache.ibatis.annotations.Select;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 用户标签表 Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author valarchie
|
||||||
|
* @since 2025-05-22
|
||||||
|
*/
|
||||||
|
public interface Ab98UserTagMapper extends BaseMapper<Ab98UserTagEntity> {
|
||||||
|
@Select("SELECT tag_id, ab98_user_id, tag_name " +
|
||||||
|
"FROM ab98_user_tag " +
|
||||||
|
"${ew.customSqlSegment}")
|
||||||
|
Page<Ab98UserTagEntity> getUserTagList(
|
||||||
|
Page<Ab98UserTagEntity> page,
|
||||||
|
@Param(Constants.WRAPPER) Wrapper<Ab98UserTagEntity> queryWrapper
|
||||||
|
);
|
||||||
|
|
||||||
|
@Select("SELECT * " +
|
||||||
|
"FROM ab98_user_tag " +
|
||||||
|
"ORDER BY create_time DESC")
|
||||||
|
List<Ab98UserTagEntity> selectAll();
|
||||||
|
|
||||||
|
@Select("SELECT * FROM ab98_user_tag WHERE ab98_user_id = #{userId}")
|
||||||
|
List<Ab98UserTagEntity> selectByUserId(@Param("userId") Long userId);
|
||||||
|
|
||||||
|
@Select("SELECT * FROM ab98_user_tag WHERE tag_id = #{tagId} LIMIT 1")
|
||||||
|
Ab98UserTagEntity selectByTagId(@Param("tagId") Long tagId);
|
||||||
|
}
|
|
@ -0,0 +1,25 @@
|
||||||
|
package com.agileboot.domain.ab98.tag.db;
|
||||||
|
|
||||||
|
import com.agileboot.common.core.page.AbstractPageQuery;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 用户标签表 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author valarchie
|
||||||
|
* @since 2025-05-22
|
||||||
|
*/
|
||||||
|
public interface Ab98UserTagService extends IService<Ab98UserTagEntity> {
|
||||||
|
Page<Ab98UserTagEntity> getUserTagList(AbstractPageQuery<Ab98UserTagEntity> query);
|
||||||
|
|
||||||
|
List<Ab98UserTagEntity> selectAll();
|
||||||
|
|
||||||
|
Ab98UserTagEntity getFirstEnabledTag();
|
||||||
|
|
||||||
|
Ab98UserTagEntity getByTagId(Long tagId);
|
||||||
|
}
|
|
@ -0,0 +1,44 @@
|
||||||
|
package com.agileboot.domain.ab98.tag.db;
|
||||||
|
|
||||||
|
import com.agileboot.common.core.page.AbstractPageQuery;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 用户标签表 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author valarchie
|
||||||
|
* @since 2025-05-22
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class Ab98UserTagServiceImpl extends ServiceImpl<Ab98UserTagMapper, Ab98UserTagEntity> implements Ab98UserTagService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Page<Ab98UserTagEntity> getUserTagList(AbstractPageQuery<Ab98UserTagEntity> query) {
|
||||||
|
return this.page(query.toPage(), query.toQueryWrapper());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Ab98UserTagEntity> selectAll() {
|
||||||
|
return baseMapper.selectAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Ab98UserTagEntity getFirstEnabledTag() {
|
||||||
|
LambdaQueryWrapper<Ab98UserTagEntity> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
wrapper.eq(Ab98UserTagEntity::getDeleted, false)
|
||||||
|
.orderByDesc(Ab98UserTagEntity::getCreateTime);
|
||||||
|
return getOne(wrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Ab98UserTagEntity getByTagId(Long tagId) {
|
||||||
|
return baseMapper.selectByTagId(tagId);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,27 @@
|
||||||
|
package com.agileboot.domain.ab98.tag.dto;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import com.agileboot.common.annotation.ExcelColumn;
|
||||||
|
import com.agileboot.common.annotation.ExcelSheet;
|
||||||
|
import com.agileboot.domain.ab98.tag.db.Ab98UserTagEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@ExcelSheet(name = "AB98用户标签列表")
|
||||||
|
@Data
|
||||||
|
public class Ab98UserTagDTO {
|
||||||
|
|
||||||
|
public Ab98UserTagDTO(Ab98UserTagEntity entity) {
|
||||||
|
if (entity != null) {
|
||||||
|
BeanUtil.copyProperties(entity, this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@ExcelColumn(name = "标签ID")
|
||||||
|
private Long tagId;
|
||||||
|
|
||||||
|
@ExcelColumn(name = "关联用户ID")
|
||||||
|
private Long ab98UserId;
|
||||||
|
|
||||||
|
@ExcelColumn(name = "标签名称")
|
||||||
|
private String tagName;
|
||||||
|
}
|
|
@ -0,0 +1,39 @@
|
||||||
|
package com.agileboot.domain.ab98.tag.model;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import com.agileboot.domain.ab98.tag.command.AddAb98UserTagCommand;
|
||||||
|
import com.agileboot.domain.ab98.tag.command.UpdateAb98UserTagCommand;
|
||||||
|
import com.agileboot.domain.ab98.tag.db.Ab98UserTagEntity;
|
||||||
|
import com.agileboot.domain.ab98.tag.db.Ab98UserTagService;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
public class Ab98UserTagModel extends Ab98UserTagEntity {
|
||||||
|
|
||||||
|
private Ab98UserTagService ab98UserTagService;
|
||||||
|
|
||||||
|
public Ab98UserTagModel(Ab98UserTagEntity entity, Ab98UserTagService ab98UserTagService) {
|
||||||
|
this(ab98UserTagService);
|
||||||
|
if (entity != null) {
|
||||||
|
BeanUtil.copyProperties(entity, this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Ab98UserTagModel(Ab98UserTagService ab98UserTagService) {
|
||||||
|
this.ab98UserTagService = ab98UserTagService;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void loadAddCommand(AddAb98UserTagCommand command) {
|
||||||
|
if (command != null) {
|
||||||
|
BeanUtil.copyProperties(command, this, "id");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void loadUpdateCommand(UpdateAb98UserTagCommand command) {
|
||||||
|
if (command != null) {
|
||||||
|
loadAddCommand(command);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,27 @@
|
||||||
|
package com.agileboot.domain.ab98.tag.model;
|
||||||
|
|
||||||
|
import com.agileboot.common.exception.ApiException;
|
||||||
|
import com.agileboot.common.exception.error.ErrorCode;
|
||||||
|
import com.agileboot.domain.ab98.tag.db.Ab98UserTagEntity;
|
||||||
|
import com.agileboot.domain.ab98.tag.db.Ab98UserTagService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class Ab98UserTagModelFactory {
|
||||||
|
|
||||||
|
private final Ab98UserTagService ab98UserTagService;
|
||||||
|
|
||||||
|
public Ab98UserTagModel loadById(Long tagId) {
|
||||||
|
Ab98UserTagEntity entity = ab98UserTagService.getById(tagId);
|
||||||
|
if (entity == null) {
|
||||||
|
throw new ApiException(ErrorCode.Business.COMMON_OBJECT_NOT_FOUND, tagId, "用户标签");
|
||||||
|
}
|
||||||
|
return new Ab98UserTagModel(entity, ab98UserTagService);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Ab98UserTagModel create() {
|
||||||
|
return new Ab98UserTagModel(ab98UserTagService);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,32 @@
|
||||||
|
package com.agileboot.domain.ab98.tag.query;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.agileboot.common.core.page.AbstractPageQuery;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import java.util.Date;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
public class SearchAb98UserTagQuery<T> extends AbstractPageQuery<T> {
|
||||||
|
|
||||||
|
private Long ab98UserId;
|
||||||
|
private String tagName;
|
||||||
|
private Date startTime;
|
||||||
|
private Date endTime;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public QueryWrapper<T> addQueryCondition() {
|
||||||
|
QueryWrapper<T> queryWrapper = new QueryWrapper<>();
|
||||||
|
|
||||||
|
queryWrapper
|
||||||
|
.eq(ab98UserId != null, "ab98_user_id", ab98UserId)
|
||||||
|
.like(StrUtil.isNotEmpty(tagName), "tag_name", tagName)
|
||||||
|
.between(startTime != null && endTime != null, "create_time", startTime, endTime);
|
||||||
|
|
||||||
|
this.timeRangeColumn = "create_time";
|
||||||
|
|
||||||
|
return queryWrapper;
|
||||||
|
}
|
||||||
|
}
|
|
@ -104,4 +104,12 @@ public class CabinetCellApplicationService {
|
||||||
public void clearGoodsCells(Long cellId) {
|
public void clearGoodsCells(Long cellId) {
|
||||||
cabinetCellService.clearGoodsIdAndFreeCell(cellId);
|
cabinetCellService.clearGoodsIdAndFreeCell(cellId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Long countAllRecord() {
|
||||||
|
return cabinetCellService.countAllRecord();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long countLinkedRecord() {
|
||||||
|
return cabinetCellService.countLinkedRecord();
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -61,4 +61,9 @@ public interface CabinetCellMapper extends BaseMapper<CabinetCellEntity> {
|
||||||
@Param(Constants.WRAPPER) Wrapper<CabinetCellEntity> queryWrapper
|
@Param(Constants.WRAPPER) Wrapper<CabinetCellEntity> queryWrapper
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@Select("SELECT COUNT(1) FROM cabinet_cell WHERE deleted = 0")
|
||||||
|
Long countAllRecord();
|
||||||
|
|
||||||
|
@Select("SELECT COUNT(1) FROM cabinet_cell WHERE deleted = 0 AND goods_id IS NOT NULL")
|
||||||
|
Long countLinkedRecord();
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.apache.ibatis.annotations.Select;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -30,4 +31,8 @@ public interface CabinetCellService extends IService<CabinetCellEntity> {
|
||||||
void clearGoodsIdAndFreeCell(Long cellId);
|
void clearGoodsIdAndFreeCell(Long cellId);
|
||||||
|
|
||||||
Page<CabinetCellWithOrderCountDTO> getCellListWithOrders(AbstractPageQuery<CabinetCellEntity> query);
|
Page<CabinetCellWithOrderCountDTO> getCellListWithOrders(AbstractPageQuery<CabinetCellEntity> query);
|
||||||
|
|
||||||
|
Long countAllRecord();
|
||||||
|
|
||||||
|
Long countLinkedRecord();
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,4 +46,14 @@ public class CabinetCellServiceImpl extends ServiceImpl<CabinetCellMapper, Cabin
|
||||||
public Page<CabinetCellWithOrderCountDTO> getCellListWithOrders(AbstractPageQuery<CabinetCellEntity> query) {
|
public Page<CabinetCellWithOrderCountDTO> getCellListWithOrders(AbstractPageQuery<CabinetCellEntity> query) {
|
||||||
return baseMapper.getCellListWithOrders(query.toPage(), query.toQueryWrapper());
|
return baseMapper.getCellListWithOrders(query.toPage(), query.toQueryWrapper());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long countAllRecord() {
|
||||||
|
return baseMapper.countAllRecord();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long countLinkedRecord() {
|
||||||
|
return baseMapper.countLinkedRecord();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,11 +20,9 @@ public enum CabinetTemplateEnum {
|
||||||
/** 60口机柜模板,2块主板,每块主板30个单元格 */
|
/** 60口机柜模板,2块主板,每块主板30个单元格 */
|
||||||
CABINET_60(7, "cabinet_60.jpg", "60口机柜", 2, 30),
|
CABINET_60(7, "cabinet_60.jpg", "60口机柜", 2, 30),
|
||||||
/** 120口机柜模板(6X20),6块主板,每块主板20个单元格 */
|
/** 120口机柜模板(6X20),6块主板,每块主板20个单元格 */
|
||||||
CABINET_6X20(8, "cabinet_120_6X20.jpg", "120口机柜6X20", 6, 20),
|
CABINET_120(8, "cabinet_120.jpg", "120口机柜", 6, 20),
|
||||||
/** 4口机柜模板,1块主板,每块主板4个单元格 */
|
/** 4口机柜模板,1块主板,每块主板4个单元格 */
|
||||||
CABINET_4(9, "cabinet_4.jpg","4口机柜", 1, 4),
|
CABINET_4(9, "cabinet_4.jpg","4口机柜", 1, 4);
|
||||||
/** 120口机柜模板(4X30),4块主板,每块主板30个单元格 */
|
|
||||||
CABINET_4X30(10, "cabinet_120_4X30.jpg", "120口机柜4X30", 4, 30);
|
|
||||||
|
|
||||||
/** 模板代码 */
|
/** 模板代码 */
|
||||||
private final int code;
|
private final int code;
|
||||||
|
|
|
@ -218,4 +218,8 @@ public class SmartCabinetApplicationService {
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Long countAllRecord() {
|
||||||
|
return smartCabinetService.countAllRecord();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,4 +48,7 @@ public interface SmartCabinetMapper extends BaseMapper<SmartCabinetEntity> {
|
||||||
// 新增根据柜体ID查询的方法
|
// 新增根据柜体ID查询的方法
|
||||||
@Select("SELECT * FROM smart_cabinet WHERE cabinet_id = #{cabinetId} LIMIT 1")
|
@Select("SELECT * FROM smart_cabinet WHERE cabinet_id = #{cabinetId} LIMIT 1")
|
||||||
SmartCabinetEntity selectByCabinetId(Long cabinetId);
|
SmartCabinetEntity selectByCabinetId(Long cabinetId);
|
||||||
|
|
||||||
|
@Select("SELECT COUNT(1) FROM smart_cabinet WHERE deleted = 0")
|
||||||
|
Long countAllRecord();
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,4 +23,5 @@ public interface SmartCabinetService extends IService<SmartCabinetEntity> {
|
||||||
|
|
||||||
SmartCabinetEntity getByCabinetId(Long cabinetId);
|
SmartCabinetEntity getByCabinetId(Long cabinetId);
|
||||||
|
|
||||||
|
Long countAllRecord();
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,4 +40,9 @@ public class SmartCabinetServiceImpl extends ServiceImpl<SmartCabinetMapper, Sma
|
||||||
return baseMapper.selectByCabinetId(cabinetId);
|
return baseMapper.selectByCabinetId(cabinetId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long countAllRecord() {
|
||||||
|
return baseMapper.countAllRecord();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,8 +64,9 @@ public class MqttService implements MqttCallback {
|
||||||
.orElse(null);
|
.orElse(null);
|
||||||
|
|
||||||
if (existingConfig != null) {
|
if (existingConfig != null) {
|
||||||
log.info("复用已有MQTT连接:{} 账号:{}", config.getServerUrl(), config.getUsername());
|
existingConfig.client.subscribe(config.getTopicFilter());
|
||||||
clientConfigs.add(new ClientConfig(existingConfig.client, config));
|
clientConfigs.add(new ClientConfig(existingConfig.client, config));
|
||||||
|
log.info("复用已有MQTT连接:{} 账号:{}", config.getServerUrl(), config.getUsername());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -134,6 +135,10 @@ public class MqttService implements MqttCallback {
|
||||||
@Override
|
@Override
|
||||||
public void deliveryComplete(IMqttDeliveryToken token) {}
|
public void deliveryComplete(IMqttDeliveryToken token) {}
|
||||||
|
|
||||||
|
public Long getGatewayCount() {
|
||||||
|
return (long) clientConfigs.size();
|
||||||
|
}
|
||||||
|
|
||||||
/******************************************************
|
/******************************************************
|
||||||
*函数名称: lockCmd
|
*函数名称: lockCmd
|
||||||
*输 入: 指令,地址码,通道号,指令参数
|
*输 入: 指令,地址码,通道号,指令参数
|
||||||
|
|
|
@ -18,10 +18,10 @@ public class QyAccessTokenDTO {
|
||||||
if (entity != null) {
|
if (entity != null) {
|
||||||
BeanUtil.copyProperties(entity, this);
|
BeanUtil.copyProperties(entity, this);
|
||||||
|
|
||||||
SysUserEntity creator = CacheCenter.userCache.getObjectById(entity.getOperId());
|
/*SysUserEntity creator = CacheCenter.userCache.getObjectById(entity.getOperId());
|
||||||
if (creator != null) {
|
if (creator != null) {
|
||||||
this.operator = creator.getUsername();
|
this.operator = creator.getUsername();
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,10 +18,10 @@ public class QyAuthDTO {
|
||||||
if (entity != null) {
|
if (entity != null) {
|
||||||
BeanUtil.copyProperties(entity, this);
|
BeanUtil.copyProperties(entity, this);
|
||||||
|
|
||||||
SysUserEntity creator = CacheCenter.userCache.getObjectById(entity.getOperId());
|
/*SysUserEntity creator = CacheCenter.userCache.getObjectById(entity.getOperId());
|
||||||
if (creator != null) {
|
if (creator != null) {
|
||||||
this.operator = creator.getUsername();
|
this.operator = creator.getUsername();
|
||||||
}
|
}*/
|
||||||
|
|
||||||
this.timeStampStr = entity.getTimeStamp();
|
this.timeStampStr = entity.getTimeStamp();
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,10 +18,10 @@ public class QyAuthCorpInfoDTO {
|
||||||
if (entity != null) {
|
if (entity != null) {
|
||||||
BeanUtil.copyProperties(entity, this);
|
BeanUtil.copyProperties(entity, this);
|
||||||
|
|
||||||
SysUserEntity creator = CacheCenter.userCache.getObjectById(entity.getOperId());
|
/*SysUserEntity creator = CacheCenter.userCache.getObjectById(entity.getOperId());
|
||||||
if (creator != null) {
|
if (creator != null) {
|
||||||
this.operator = creator.getUsername();
|
this.operator = creator.getUsername();
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,10 +16,10 @@ public class QyDepartmentDTO {
|
||||||
if (entity != null) {
|
if (entity != null) {
|
||||||
BeanUtil.copyProperties(entity, this);
|
BeanUtil.copyProperties(entity, this);
|
||||||
|
|
||||||
SysUserEntity creator = CacheCenter.userCache.getObjectById(entity.getOperId());
|
/*SysUserEntity creator = CacheCenter.userCache.getObjectById(entity.getOperId());
|
||||||
if (creator != null) {
|
if (creator != null) {
|
||||||
this.operator = creator.getUsername();
|
this.operator = creator.getUsername();
|
||||||
}
|
}*/
|
||||||
|
|
||||||
this.enableStatus = "1".equals(entity.getEnable()) ? "启用" : "停用";
|
this.enableStatus = "1".equals(entity.getEnable()) ? "启用" : "停用";
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,10 +18,10 @@ public class QyMessageDTO {
|
||||||
if (entity != null) {
|
if (entity != null) {
|
||||||
BeanUtil.copyProperties(entity, this);
|
BeanUtil.copyProperties(entity, this);
|
||||||
|
|
||||||
SysUserEntity creator = CacheCenter.userCache.getObjectById(entity.getOperId());
|
/*SysUserEntity creator = CacheCenter.userCache.getObjectById(entity.getOperId());
|
||||||
if (creator != null) {
|
if (creator != null) {
|
||||||
this.operator = creator.getUsername();
|
this.operator = creator.getUsername();
|
||||||
}
|
}*/
|
||||||
|
|
||||||
this.sendTimeStr = DateUtil.format(entity.getSendTime(), "yyyy-MM-dd HH:mm:ss");
|
this.sendTimeStr = DateUtil.format(entity.getSendTime(), "yyyy-MM-dd HH:mm:ss");
|
||||||
this.recallStateStr = convertRecallState(entity.getRecallState());
|
this.recallStateStr = convertRecallState(entity.getRecallState());
|
||||||
|
|
|
@ -18,11 +18,6 @@ public class QyTemplateDTO {
|
||||||
if (entity != null) {
|
if (entity != null) {
|
||||||
BeanUtil.copyProperties(entity, this);
|
BeanUtil.copyProperties(entity, this);
|
||||||
|
|
||||||
SysUserEntity creator = CacheCenter.userCache.getObjectById(entity.getOperId());
|
|
||||||
if (creator != null) {
|
|
||||||
this.operator = creator.getUsername();
|
|
||||||
}
|
|
||||||
|
|
||||||
this.enableStatus = "1".equals(entity.getEnable()) ? "启用" : "停用";
|
this.enableStatus = "1".equals(entity.getEnable()) ? "启用" : "停用";
|
||||||
this.gettokenTimeStr = DateUtil.format(entity.getGettokenTime(), "yyyy-MM-dd HH:mm:ss");
|
this.gettokenTimeStr = DateUtil.format(entity.getGettokenTime(), "yyyy-MM-dd HH:mm:ss");
|
||||||
}
|
}
|
||||||
|
@ -55,9 +50,6 @@ public class QyTemplateDTO {
|
||||||
@ExcelColumn(name = "凭证有效期(秒)")
|
@ExcelColumn(name = "凭证有效期(秒)")
|
||||||
private Integer expiresIn;
|
private Integer expiresIn;
|
||||||
|
|
||||||
@ExcelColumn(name = "操作人")
|
|
||||||
private String operator;
|
|
||||||
|
|
||||||
@ExcelColumn(name = "状态")
|
@ExcelColumn(name = "状态")
|
||||||
private String enableStatus;
|
private String enableStatus;
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,8 @@ import com.agileboot.domain.qywx.user.model.QyUserModelFactory;
|
||||||
import com.agileboot.domain.qywx.user.query.SearchQyUserQuery;
|
import com.agileboot.domain.qywx.user.query.SearchQyUserQuery;
|
||||||
import com.agileboot.domain.qywx.userQySys.db.SysUserQyUserEntity;
|
import com.agileboot.domain.qywx.userQySys.db.SysUserQyUserEntity;
|
||||||
import com.agileboot.domain.qywx.userQySys.db.SysUserQyUserService;
|
import com.agileboot.domain.qywx.userQySys.db.SysUserQyUserService;
|
||||||
|
import com.agileboot.domain.system.role.db.SysRoleEntity;
|
||||||
|
import com.agileboot.domain.system.role.db.SysRoleService;
|
||||||
import com.agileboot.domain.system.user.db.SysUserEntity;
|
import com.agileboot.domain.system.user.db.SysUserEntity;
|
||||||
import com.agileboot.domain.system.user.db.SysUserService;
|
import com.agileboot.domain.system.user.db.SysUserService;
|
||||||
import com.agileboot.domain.system.user.dto.UserDTO;
|
import com.agileboot.domain.system.user.dto.UserDTO;
|
||||||
|
@ -33,6 +35,7 @@ public class QyUserApplicationService {
|
||||||
private final QyUserModelFactory qyUserModelFactory;
|
private final QyUserModelFactory qyUserModelFactory;
|
||||||
private final SysUserQyUserService sysUserQyUserService;
|
private final SysUserQyUserService sysUserQyUserService;
|
||||||
private final SysUserService sysUserService;
|
private final SysUserService sysUserService;
|
||||||
|
private final SysRoleService sysRoleService;
|
||||||
|
|
||||||
public PageDTO<QyUserDTO> getUserList(SearchQyUserQuery<QyUserEntity> query) {
|
public PageDTO<QyUserDTO> getUserList(SearchQyUserQuery<QyUserEntity> query) {
|
||||||
Page<QyUserEntity> page = userService.getUserList(query);
|
Page<QyUserEntity> page = userService.getUserList(query);
|
||||||
|
@ -48,7 +51,11 @@ public class QyUserApplicationService {
|
||||||
SysUserQyUserEntity sysUserQyUser = sysUserQyUserService.getByQyUserId(id.intValue());
|
SysUserQyUserEntity sysUserQyUser = sysUserQyUserService.getByQyUserId(id.intValue());
|
||||||
if (sysUserQyUser != null) {
|
if (sysUserQyUser != null) {
|
||||||
SysUserEntity sysUser = sysUserService.getById(sysUserQyUser.getSysUserId());
|
SysUserEntity sysUser = sysUserService.getById(sysUserQyUser.getSysUserId());
|
||||||
dto.setSysUser(new UserDTO(sysUser));
|
if (sysUser != null && sysUser.getRoleId()!= null) {
|
||||||
|
SysRoleEntity sysRole = sysRoleService.getById(sysUser.getRoleId());
|
||||||
|
dto.setRoleId(sysUser.getRoleId());
|
||||||
|
dto.setRoleName(sysRole.getRoleName());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return dto;
|
return dto;
|
||||||
}
|
}
|
||||||
|
@ -67,6 +74,16 @@ public class QyUserApplicationService {
|
||||||
UserModel model = qyUserModelFactory.loadById(command.getId());
|
UserModel model = qyUserModelFactory.loadById(command.getId());
|
||||||
model.loadUpdateCommand(command);
|
model.loadUpdateCommand(command);
|
||||||
model.updateById();
|
model.updateById();
|
||||||
|
|
||||||
|
if (command.getRoleId() == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
SysUserQyUserEntity sysUserQyUser = sysUserQyUserService.getByQyUserId(command.getId());
|
||||||
|
if (sysUserQyUser != null) {
|
||||||
|
SysUserEntity sysUser = sysUserService.getById(sysUserQyUser.getSysUserId());
|
||||||
|
sysUser.setRoleId(command.getRoleId() > 0 ? command.getRoleId() : null);
|
||||||
|
sysUserService.updateById(sysUser);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void deleteUser(BulkOperationCommand<Integer> command) {
|
public void deleteUser(BulkOperationCommand<Integer> command) {
|
||||||
|
|
|
@ -12,4 +12,7 @@ public class UpdateQyUserCommand extends AddQyUserCommand {
|
||||||
@NotNull
|
@NotNull
|
||||||
@PositiveOrZero
|
@PositiveOrZero
|
||||||
private Integer id;
|
private Integer id;
|
||||||
|
|
||||||
|
|
||||||
|
private Long roleId;
|
||||||
}
|
}
|
|
@ -148,6 +148,10 @@ public class QyUserEntity extends BaseEntity<QyUserEntity> {
|
||||||
@TableField("balance")
|
@TableField("balance")
|
||||||
private BigDecimal balance;
|
private BigDecimal balance;
|
||||||
|
|
||||||
|
@ApiModelProperty("系统角色id")
|
||||||
|
@TableField("sys_role_id")
|
||||||
|
private Long sysRoleId;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Serializable pkVal() {
|
public Serializable pkVal() {
|
||||||
return this.id;
|
return this.id;
|
||||||
|
|
|
@ -21,7 +21,7 @@ public class QyUserServiceImpl extends ServiceImpl<QyUserMapper, QyUserEntity> i
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page<QyUserEntity> getUserList(AbstractPageQuery<QyUserEntity> query) {
|
public Page<QyUserEntity> getUserList(AbstractPageQuery<QyUserEntity> query) {
|
||||||
return this.page(query.toPage(), query.toQueryWrapper());
|
return baseMapper.getUserList(query.toPage(), query.toQueryWrapper());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -24,19 +24,16 @@ public class QyUserDTO {
|
||||||
if (entity != null) {
|
if (entity != null) {
|
||||||
BeanUtil.copyProperties(entity, this);
|
BeanUtil.copyProperties(entity, this);
|
||||||
|
|
||||||
SysUserEntity creator = CacheCenter.userCache.getObjectById(entity.getOperId());
|
/*SysUserEntity creator = CacheCenter.userCache.getObjectById(entity.getOperId());
|
||||||
if (creator != null) {
|
if (creator != null) {
|
||||||
this.operator = creator.getUsername();
|
this.operator = creator.getUsername();
|
||||||
}
|
}*/
|
||||||
|
|
||||||
this.enableStatus = "1".equals(entity.getEnable()) ? "启用" : "停用";
|
this.enableStatus = "1".equals(entity.getEnable()) ? "启用" : "停用";
|
||||||
this.createTimeStr = DateUtil.format(entity.getCreateTime(), "yyyy-MM-dd HH:mm:ss");
|
this.createTimeStr = DateUtil.format(entity.getCreateTime(), "yyyy-MM-dd HH:mm:ss");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 系统用户
|
|
||||||
private UserDTO sysUser;
|
|
||||||
|
|
||||||
@ExcelColumn(name = "用户ID")
|
@ExcelColumn(name = "用户ID")
|
||||||
private Integer id;
|
private Integer id;
|
||||||
|
|
||||||
|
@ -108,4 +105,13 @@ public class QyUserDTO {
|
||||||
|
|
||||||
@ExcelColumn(name = "用户余额")
|
@ExcelColumn(name = "用户余额")
|
||||||
private BigDecimal balance;
|
private BigDecimal balance;
|
||||||
|
|
||||||
|
@ExcelColumn(name = "系统角色ID")
|
||||||
|
private Long sysRoleId;
|
||||||
|
|
||||||
|
@ExcelColumn(name = "角色ID")
|
||||||
|
private Long roleId;
|
||||||
|
|
||||||
|
@ExcelColumn(name = "角色名称")
|
||||||
|
private String roleName;
|
||||||
}
|
}
|
|
@ -20,6 +20,7 @@ public class SearchQyUserQuery<T> extends AbstractPageQuery<T> {
|
||||||
private String enable;
|
private String enable;
|
||||||
private Date startTime;
|
private Date startTime;
|
||||||
private Date endTime;
|
private Date endTime;
|
||||||
|
private Long sysRoleId;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public QueryWrapper<T> addQueryCondition() {
|
public QueryWrapper<T> addQueryCondition() {
|
||||||
|
@ -28,12 +29,14 @@ public class SearchQyUserQuery<T> extends AbstractPageQuery<T> {
|
||||||
queryWrapper
|
queryWrapper
|
||||||
.eq(StrUtil.isNotBlank(corpid), "corpid", corpid)
|
.eq(StrUtil.isNotBlank(corpid), "corpid", corpid)
|
||||||
.eq(StrUtil.isNotBlank(userid), "userid", userid)
|
.eq(StrUtil.isNotBlank(userid), "userid", userid)
|
||||||
|
.eq(sysRoleId != null, "sys_role_id", sysRoleId)
|
||||||
.like(StrUtil.isNotBlank(name), "name", name)
|
.like(StrUtil.isNotBlank(name), "name", name)
|
||||||
.like(StrUtil.isNotBlank(mobile), "mobile", mobile)
|
.like(StrUtil.isNotBlank(mobile), "mobile", mobile)
|
||||||
.eq(StrUtil.isNotBlank(department), "department", department)
|
.eq(StrUtil.isNotBlank(department), "department", department)
|
||||||
.eq(StrUtil.isNotBlank(mainDepartment), "main_department", mainDepartment)
|
.eq(StrUtil.isNotBlank(mainDepartment), "main_department", mainDepartment)
|
||||||
.eq(StrUtil.isNotBlank(enable), "enable", enable)
|
.eq(StrUtil.isNotBlank(enable), "enable", enable)
|
||||||
.between(startTime != null && endTime != null, "create_time", startTime, endTime);
|
.between(startTime != null && endTime != null, "create_time", startTime, endTime)
|
||||||
|
.orderByDesc("id");
|
||||||
|
|
||||||
this.timeRangeColumn = "create_time";
|
this.timeRangeColumn = "create_time";
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,8 @@ import com.agileboot.domain.shop.goods.model.GoodsModel;
|
||||||
import com.agileboot.domain.shop.goods.model.GoodsModelFactory;
|
import com.agileboot.domain.shop.goods.model.GoodsModelFactory;
|
||||||
import com.agileboot.domain.shop.goods.query.SearchShopGoodsQuery;
|
import com.agileboot.domain.shop.goods.query.SearchShopGoodsQuery;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
@ -69,4 +71,12 @@ public class GoodsApplicationService {
|
||||||
public ShopGoodsDTO getGoodsInfo(Long goodsId) {
|
public ShopGoodsDTO getGoodsInfo(Long goodsId) {
|
||||||
return new ShopGoodsDTO(shopGoodsService.getGoodsInfo(goodsId));
|
return new ShopGoodsDTO(shopGoodsService.getGoodsInfo(goodsId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Long countAllRecord() {
|
||||||
|
return shopGoodsService.countAllRecord();
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal calculateTotalAmount() {
|
||||||
|
return shopGoodsService.calculateTotalAmount();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,7 @@ public class SearchGoodsWithCabinetDO extends BaseEntity<SearchGoodsWithCabinetD
|
||||||
private Integer status;
|
private Integer status;
|
||||||
private String coverImg;
|
private String coverImg;
|
||||||
private String goodsDetail;
|
private String goodsDetail;
|
||||||
|
private String usageInstruction;
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
@TableField("sc.cabinet_id")
|
@TableField("sc.cabinet_id")
|
||||||
|
|
|
@ -68,6 +68,9 @@ public class ShopGoodsEntity extends BaseEntity<ShopGoodsEntity> {
|
||||||
@TableField("remark")
|
@TableField("remark")
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
|
@ApiModelProperty("商品使用说明")
|
||||||
|
@TableField("usage_instruction")
|
||||||
|
private String usageInstruction;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Serializable pkVal() {
|
public Serializable pkVal() {
|
||||||
|
|
|
@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.apache.ibatis.annotations.Select;
|
import org.apache.ibatis.annotations.Select;
|
||||||
|
@ -36,7 +38,7 @@ public interface ShopGoodsMapper extends BaseMapper<ShopGoodsEntity> {
|
||||||
@Param(Constants.WRAPPER) Wrapper<SearchGoodsDO> queryWrapper
|
@Param(Constants.WRAPPER) Wrapper<SearchGoodsDO> queryWrapper
|
||||||
); */
|
); */
|
||||||
@Select("SELECT g.goods_id, g.goods_name, g.category_id, g.price, " +
|
@Select("SELECT g.goods_id, g.goods_name, g.category_id, g.price, " +
|
||||||
"g.stock, g.status, g.auto_approval, g.cover_img, SUM(cc.stock) AS total_stock, " +
|
"g.stock, g.status, g.auto_approval, g.cover_img, g.usage_instruction, SUM(cc.stock) AS total_stock, " +
|
||||||
"GROUP_CONCAT(DISTINCT cc.cell_no) AS cell_no_str, " +
|
"GROUP_CONCAT(DISTINCT cc.cell_no) AS cell_no_str, " +
|
||||||
"GROUP_CONCAT(DISTINCT sc.cabinet_name) AS cabinet_name " +
|
"GROUP_CONCAT(DISTINCT sc.cabinet_name) AS cabinet_name " +
|
||||||
"FROM shop_goods g " +
|
"FROM shop_goods g " +
|
||||||
|
@ -63,7 +65,7 @@ public interface ShopGoodsMapper extends BaseMapper<ShopGoodsEntity> {
|
||||||
* @return 商品列表
|
* @return 商品列表
|
||||||
*/
|
*/
|
||||||
@Select("SELECT g.goods_id, g.goods_name, g.category_id, g.price, " +
|
@Select("SELECT g.goods_id, g.goods_name, g.category_id, g.price, " +
|
||||||
"g.status, g.cover_img, g.goods_detail, " +
|
"g.status, g.cover_img, g.goods_detail, g.usage_instruction, " +
|
||||||
"g.creator_id, g.create_time, g.updater_id, g.update_time, g.remark, g.deleted, " +
|
"g.creator_id, g.create_time, g.updater_id, g.update_time, g.remark, g.deleted, " +
|
||||||
"sc.cabinet_id, sc.cabinet_name, cc.stock, cc.cell_id " +
|
"sc.cabinet_id, sc.cabinet_name, cc.stock, cc.cell_id " +
|
||||||
"FROM shop_goods g " +
|
"FROM shop_goods g " +
|
||||||
|
@ -73,7 +75,7 @@ public interface ShopGoodsMapper extends BaseMapper<ShopGoodsEntity> {
|
||||||
List<SearchGoodsWithCabinetDO> getGoodsWithCabinetList();
|
List<SearchGoodsWithCabinetDO> getGoodsWithCabinetList();
|
||||||
|
|
||||||
@Select("SELECT g.goods_id, g.goods_name, g.category_id, g.price, " +
|
@Select("SELECT g.goods_id, g.goods_name, g.category_id, g.price, " +
|
||||||
"g.status, g.cover_img, g.goods_detail, " +
|
"g.status, g.cover_img, g.goods_detail, g.usage_instruction, " +
|
||||||
"g.creator_id, g.create_time, g.updater_id, g.update_time, g.remark, g.deleted, " +
|
"g.creator_id, g.create_time, g.updater_id, g.update_time, g.remark, g.deleted, " +
|
||||||
"sc.cabinet_id, sc.cabinet_name, sc.shop_id, cc.stock, cc.cell_id " +
|
"sc.cabinet_id, sc.cabinet_name, sc.shop_id, cc.stock, cc.cell_id " +
|
||||||
"FROM shop_goods g " +
|
"FROM shop_goods g " +
|
||||||
|
@ -91,4 +93,14 @@ public interface ShopGoodsMapper extends BaseMapper<ShopGoodsEntity> {
|
||||||
"LEFT JOIN smart_cabinet sc ON cc.cabinet_id = sc.cabinet_id AND sc.deleted = 0 " +
|
"LEFT JOIN smart_cabinet sc ON cc.cabinet_id = sc.cabinet_id AND sc.deleted = 0 " +
|
||||||
"WHERE g.goods_id = #{goodsId} ")
|
"WHERE g.goods_id = #{goodsId} ")
|
||||||
SearchGoodsDO getGoodsInfo(@Param("goodsId") Long goodsId);
|
SearchGoodsDO getGoodsInfo(@Param("goodsId") Long goodsId);
|
||||||
|
|
||||||
|
@Select("SELECT COUNT(1) FROM shop_goods WHERE deleted = 0")
|
||||||
|
Long countAllRecord();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计算所有未删除商品的总金额(price * stock)
|
||||||
|
* @return 商品总金额
|
||||||
|
*/
|
||||||
|
@Select("SELECT SUM(price * stock) FROM shop_goods WHERE deleted = 0")
|
||||||
|
BigDecimal calculateTotalAmount();
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@ import com.agileboot.common.core.page.AbstractPageQuery;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -22,4 +23,8 @@ public interface ShopGoodsService extends IService<ShopGoodsEntity> {
|
||||||
List<SearchGoodsWithCabinetDO> getGoodsWithCabinetList(Long shopId);
|
List<SearchGoodsWithCabinetDO> getGoodsWithCabinetList(Long shopId);
|
||||||
|
|
||||||
SearchGoodsDO getGoodsInfo(Long goodsId);
|
SearchGoodsDO getGoodsInfo(Long goodsId);
|
||||||
|
|
||||||
|
Long countAllRecord();
|
||||||
|
|
||||||
|
BigDecimal calculateTotalAmount();
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -45,4 +47,14 @@ public class ShopGoodsServiceImpl extends ServiceImpl<ShopGoodsMapper, ShopGoods
|
||||||
public SearchGoodsDO getGoodsInfo(Long goodsId) {
|
public SearchGoodsDO getGoodsInfo(Long goodsId) {
|
||||||
return baseMapper.getGoodsInfo(goodsId);
|
return baseMapper.getGoodsInfo(goodsId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long countAllRecord() {
|
||||||
|
return baseMapper.countAllRecord();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BigDecimal calculateTotalAmount() {
|
||||||
|
return baseMapper.calculateTotalAmount();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,4 +86,7 @@ public class ShopGoodsDTO {
|
||||||
private String cellNoStr;
|
private String cellNoStr;
|
||||||
@ExcelColumn(name = "已分配库存")
|
@ExcelColumn(name = "已分配库存")
|
||||||
private Integer totalStock;
|
private Integer totalStock;
|
||||||
|
|
||||||
|
@ExcelColumn(name = "商品使用说明")
|
||||||
|
private String usageInstruction;
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,14 +25,12 @@ import com.agileboot.domain.qywx.user.model.QyUserModelFactory;
|
||||||
import com.agileboot.domain.shop.goods.db.ShopGoodsEntity;
|
import com.agileboot.domain.shop.goods.db.ShopGoodsEntity;
|
||||||
import com.agileboot.domain.shop.goods.db.ShopGoodsService;
|
import com.agileboot.domain.shop.goods.db.ShopGoodsService;
|
||||||
import com.agileboot.domain.shop.order.command.SubmitOrderCommand;
|
import com.agileboot.domain.shop.order.command.SubmitOrderCommand;
|
||||||
import com.agileboot.domain.shop.order.db.ShopOrderEntity;
|
import com.agileboot.domain.shop.order.db.*;
|
||||||
import com.agileboot.domain.shop.order.db.ShopOrderService;
|
|
||||||
import com.agileboot.domain.shop.order.db.ShopOrderGoodsEntity;
|
|
||||||
import com.agileboot.domain.shop.order.db.ShopOrderGoodsService;
|
|
||||||
import com.agileboot.domain.shop.order.db.dto.OrderWithGoodsDTO;
|
import com.agileboot.domain.shop.order.db.dto.OrderWithGoodsDTO;
|
||||||
import com.agileboot.domain.shop.order.dto.CreateOrderResult;
|
import com.agileboot.domain.shop.order.dto.CreateOrderResult;
|
||||||
import com.agileboot.domain.shop.order.dto.GetOrdersByOpenIdDTO;
|
import com.agileboot.domain.shop.order.dto.GetOrdersByOpenIdDTO;
|
||||||
import com.agileboot.domain.shop.order.dto.ShopOrderDTO;
|
import com.agileboot.domain.shop.order.dto.ShopOrderDTO;
|
||||||
|
import com.agileboot.domain.shop.order.dto.TopGoodsDTO;
|
||||||
import com.agileboot.domain.shop.order.model.OrderModel;
|
import com.agileboot.domain.shop.order.model.OrderModel;
|
||||||
import com.agileboot.domain.shop.order.model.OrderModelFactory;
|
import com.agileboot.domain.shop.order.model.OrderModelFactory;
|
||||||
import com.agileboot.domain.shop.order.model.OrderGoodsModel;
|
import com.agileboot.domain.shop.order.model.OrderGoodsModel;
|
||||||
|
@ -339,4 +337,24 @@ public class OrderApplicationService {
|
||||||
public OrderModel loadById(Long orderId) {
|
public OrderModel loadById(Long orderId) {
|
||||||
return orderModelFactory.loadById(orderId);
|
return orderModelFactory.loadById(orderId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Long countAllRecord() {
|
||||||
|
return orderService.countAllRecord();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<TopGoodsDTO> selectTopGoodsByOccurrence(){
|
||||||
|
return orderGoodsService.selectTopGoodsByOccurrence();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<TodayLatestOrderGoodsDTO> selectTodayLatestOrderGoods(){
|
||||||
|
return orderGoodsService.selectTodayLatestOrderGoods();
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal sumTotalAmount() {
|
||||||
|
return orderService.sumTotalAmount();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<ShopOrderGoodsEntity> selectUnReturnOrderGoods() {
|
||||||
|
return orderGoodsService.selectUnReturnOrderGoods();
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -1,5 +1,6 @@
|
||||||
package com.agileboot.domain.shop.order.db;
|
package com.agileboot.domain.shop.order.db;
|
||||||
|
|
||||||
|
import com.agileboot.domain.shop.order.dto.TopGoodsDTO;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.apache.ibatis.annotations.Select;
|
import org.apache.ibatis.annotations.Select;
|
||||||
|
|
||||||
|
@ -22,4 +23,32 @@ public interface ShopOrderGoodsMapper extends BaseMapper<ShopOrderGoodsEntity> {
|
||||||
|
|
||||||
@Select("SELECT * FROM shop_order_goods WHERE order_id = #{orderId} AND deleted = 0")
|
@Select("SELECT * FROM shop_order_goods WHERE order_id = #{orderId} AND deleted = 0")
|
||||||
List<ShopOrderGoodsEntity> selectByOrderId(@Param("orderId") Long orderId);
|
List<ShopOrderGoodsEntity> selectByOrderId(@Param("orderId") Long orderId);
|
||||||
|
|
||||||
|
@Select("SELECT sog.goods_id, sg.goods_name, sg.cover_img, COUNT(*) AS occurrence_count " +
|
||||||
|
"FROM shop_order_goods sog " +
|
||||||
|
"JOIN shop_goods sg ON sog.goods_id = sg.goods_id " +
|
||||||
|
"WHERE sog.deleted = 0 AND sg.deleted = 0 AND sog.goods_id != 6 " +
|
||||||
|
"GROUP BY sog.goods_id, sg.goods_name, sg.cover_img " +
|
||||||
|
"ORDER BY occurrence_count DESC " +
|
||||||
|
"LIMIT 10")
|
||||||
|
List<TopGoodsDTO> selectTopGoodsByOccurrence();
|
||||||
|
|
||||||
|
@Select("SELECT sog.*, so.name AS buyer_name " +
|
||||||
|
"FROM shop_order_goods sog " +
|
||||||
|
"JOIN shop_order so ON sog.order_id = so.order_id " +
|
||||||
|
"WHERE sog.deleted = 0 AND so.deleted = 0 " +
|
||||||
|
"AND DATE(sog.create_time) = CURRENT_DATE " +
|
||||||
|
"ORDER BY sog.create_time DESC " +
|
||||||
|
"LIMIT 10")
|
||||||
|
List<TodayLatestOrderGoodsDTO> selectTodayLatestOrderGoods();
|
||||||
|
|
||||||
|
@Select("SELECT og.* " +
|
||||||
|
"FROM shop_order_goods og " +
|
||||||
|
"LEFT JOIN shop_goods g ON og.goods_id = g.goods_id " +
|
||||||
|
"LEFT JOIN cabinet_cell cc ON og.cell_id = cc.cell_id " +
|
||||||
|
"WHERE og.status = 1 " +
|
||||||
|
"AND og.deleted = 0 " +
|
||||||
|
"AND g.deleted = 0 " +
|
||||||
|
"AND cc.deleted = 0 AND cc.goods_id = og.goods_id")
|
||||||
|
List<ShopOrderGoodsEntity> selectUnReturnOrderGoods();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
package com.agileboot.domain.shop.order.db;
|
package com.agileboot.domain.shop.order.db;
|
||||||
|
|
||||||
|
import com.agileboot.domain.shop.order.dto.TopGoodsDTO;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import org.apache.ibatis.annotations.Select;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -16,4 +18,10 @@ public interface ShopOrderGoodsService extends IService<ShopOrderGoodsEntity> {
|
||||||
ShopOrderGoodsEntity getByOrderIdAndGoodsId(Long orderId, Long goodsId);
|
ShopOrderGoodsEntity getByOrderIdAndGoodsId(Long orderId, Long goodsId);
|
||||||
|
|
||||||
List<ShopOrderGoodsEntity> selectByOrderId(Long orderId);
|
List<ShopOrderGoodsEntity> selectByOrderId(Long orderId);
|
||||||
|
|
||||||
|
List<TopGoodsDTO> selectTopGoodsByOccurrence();
|
||||||
|
|
||||||
|
List<TodayLatestOrderGoodsDTO> selectTodayLatestOrderGoods();
|
||||||
|
|
||||||
|
List<ShopOrderGoodsEntity> selectUnReturnOrderGoods();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.agileboot.domain.shop.order.db;
|
package com.agileboot.domain.shop.order.db;
|
||||||
|
|
||||||
|
import com.agileboot.domain.shop.order.dto.TopGoodsDTO;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@ -26,4 +27,19 @@ public class ShopOrderGoodsServiceImpl extends ServiceImpl<ShopOrderGoodsMapper,
|
||||||
return baseMapper.selectByOrderId(orderId);
|
return baseMapper.selectByOrderId(orderId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<TopGoodsDTO> selectTopGoodsByOccurrence() {
|
||||||
|
return baseMapper.selectTopGoodsByOccurrence();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<TodayLatestOrderGoodsDTO> selectTodayLatestOrderGoods() {
|
||||||
|
return baseMapper.selectTodayLatestOrderGoods();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ShopOrderGoodsEntity> selectUnReturnOrderGoods() {
|
||||||
|
return baseMapper.selectUnReturnOrderGoods();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.apache.ibatis.annotations.Select;
|
import org.apache.ibatis.annotations.Select;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 商品订单表 Mapper 接口
|
* 商品订单表 Mapper 接口
|
||||||
|
@ -29,4 +31,11 @@ public interface ShopOrderMapper extends BaseMapper<ShopOrderEntity> {
|
||||||
Page<OrderWithGoodsDTO> page,
|
Page<OrderWithGoodsDTO> page,
|
||||||
@Param(Constants.WRAPPER) Wrapper<OrderWithGoodsDTO> queryWrapper
|
@Param(Constants.WRAPPER) Wrapper<OrderWithGoodsDTO> queryWrapper
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@Select("SELECT COUNT(1) FROM shop_order WHERE deleted = 0")
|
||||||
|
Long countAllRecord();
|
||||||
|
|
||||||
|
@Select("SELECT SUM(total_amount) FROM shop_order " +
|
||||||
|
"WHERE deleted = 0 and pay_status in (2,3,4) and payment_method = 'wechat'")
|
||||||
|
BigDecimal sumTotalAmount();
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 商品订单表 服务类
|
* 商品订单表 服务类
|
||||||
|
@ -16,4 +18,8 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
*/
|
*/
|
||||||
public interface ShopOrderService extends IService<ShopOrderEntity> {
|
public interface ShopOrderService extends IService<ShopOrderEntity> {
|
||||||
Page<OrderWithGoodsDTO> getOrderList(SearchShopOrderQuery<OrderWithGoodsDTO> query);
|
Page<OrderWithGoodsDTO> getOrderList(SearchShopOrderQuery<OrderWithGoodsDTO> query);
|
||||||
|
|
||||||
|
Long countAllRecord();
|
||||||
|
|
||||||
|
BigDecimal sumTotalAmount();
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 商品订单表 服务实现类
|
* 商品订单表 服务实现类
|
||||||
|
@ -23,4 +25,14 @@ public class ShopOrderServiceImpl extends ServiceImpl<ShopOrderMapper, ShopOrder
|
||||||
public Page<OrderWithGoodsDTO> getOrderList(SearchShopOrderQuery<OrderWithGoodsDTO> query) {
|
public Page<OrderWithGoodsDTO> getOrderList(SearchShopOrderQuery<OrderWithGoodsDTO> query) {
|
||||||
return baseMapper.getOrderList(query.toPage(), query.toQueryWrapper());
|
return baseMapper.getOrderList(query.toPage(), query.toQueryWrapper());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long countAllRecord() {
|
||||||
|
return baseMapper.countAllRecord();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BigDecimal sumTotalAmount() {
|
||||||
|
return baseMapper.sumTotalAmount();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,63 @@
|
||||||
|
package com.agileboot.domain.shop.order.db;
|
||||||
|
|
||||||
|
import com.agileboot.common.core.base.BaseEntity;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 今日最新订单商品DTO
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author valarchie
|
||||||
|
* @since 2025-03-10
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@ApiModel(value = "TodayLatestOrderGoodsDTO对象", description = "今日最新订单商品DTO")
|
||||||
|
public class TodayLatestOrderGoodsDTO extends BaseEntity<TodayLatestOrderGoodsDTO> {
|
||||||
|
|
||||||
|
@ApiModelProperty("订单商品唯一ID")
|
||||||
|
private Long orderGoodsId;
|
||||||
|
|
||||||
|
@ApiModelProperty("关联订单ID")
|
||||||
|
private Long orderId;
|
||||||
|
|
||||||
|
@ApiModelProperty("关联商品ID")
|
||||||
|
private Long goodsId;
|
||||||
|
|
||||||
|
@ApiModelProperty("关联格口ID")
|
||||||
|
private Long cellId;
|
||||||
|
|
||||||
|
@ApiModelProperty("购买数量")
|
||||||
|
private Integer quantity;
|
||||||
|
|
||||||
|
@ApiModelProperty("购买时单价")
|
||||||
|
private BigDecimal price;
|
||||||
|
|
||||||
|
@ApiModelProperty("商品总金额")
|
||||||
|
private BigDecimal totalAmount;
|
||||||
|
|
||||||
|
@ApiModelProperty("商品名称")
|
||||||
|
private String goodsName;
|
||||||
|
|
||||||
|
@ApiModelProperty("封面图URL")
|
||||||
|
private String coverImg;
|
||||||
|
|
||||||
|
@ApiModelProperty("商品状态(1正常 2已退货 3已换货 4已完成 5审核中 6退货未通过)")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty("买家姓名")
|
||||||
|
private String buyerName;
|
||||||
|
|
||||||
|
@ApiModelProperty("创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("创建时间")
|
||||||
|
private String createTimeStr;
|
||||||
|
}
|
|
@ -0,0 +1,22 @@
|
||||||
|
package com.agileboot.domain.shop.order.dto;
|
||||||
|
|
||||||
|
import com.agileboot.common.annotation.ExcelColumn;
|
||||||
|
import com.agileboot.common.annotation.ExcelSheet;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@ExcelSheet(name = "热门商品统计")
|
||||||
|
@Data
|
||||||
|
public class TopGoodsDTO {
|
||||||
|
|
||||||
|
@ExcelColumn(name = "商品ID")
|
||||||
|
private Long goodsId;
|
||||||
|
|
||||||
|
@ExcelColumn(name = "商品名称")
|
||||||
|
private String goodsName;
|
||||||
|
|
||||||
|
@ExcelColumn(name = "封面图片")
|
||||||
|
private String coverImg;
|
||||||
|
|
||||||
|
@ExcelColumn(name = "出现次数")
|
||||||
|
private Integer occurrenceCount;
|
||||||
|
}
|
|
@ -50,4 +50,8 @@ public class ShopApplicationService {
|
||||||
model.deleteById();
|
model.deleteById();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Long countAllRecord() {
|
||||||
|
return shopService.countAllRecord();
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -40,4 +40,7 @@ public interface ShopMapper extends BaseMapper<ShopEntity> {
|
||||||
|
|
||||||
@Select("SELECT * FROM shop WHERE shop_name = #{shopName} LIMIT 1")
|
@Select("SELECT * FROM shop WHERE shop_name = #{shopName} LIMIT 1")
|
||||||
ShopEntity selectByShopName(String shopName);
|
ShopEntity selectByShopName(String shopName);
|
||||||
|
|
||||||
|
@Select("SELECT COUNT(1) FROM shop WHERE deleted = 0")
|
||||||
|
Long countAllRecord();
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,4 +25,6 @@ public interface ShopService extends IService<ShopEntity> {
|
||||||
ShopEntity selectByShopId(Long shopId);
|
ShopEntity selectByShopId(Long shopId);
|
||||||
|
|
||||||
ShopEntity selectByShopName(String shopName);
|
ShopEntity selectByShopName(String shopName);
|
||||||
|
|
||||||
|
Long countAllRecord();
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,4 +42,9 @@ public class ShopServiceImpl extends ServiceImpl<ShopMapper, ShopEntity> impleme
|
||||||
public ShopEntity selectByShopName(String shopName) {
|
public ShopEntity selectByShopName(String shopName) {
|
||||||
return baseMapper.selectByShopName(shopName);
|
return baseMapper.selectByShopName(shopName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long countAllRecord() {
|
||||||
|
return baseMapper.countAllRecord();
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -0,0 +1,58 @@
|
||||||
|
package com.agileboot.domain.shop.shop.dto;
|
||||||
|
|
||||||
|
import com.agileboot.common.annotation.ExcelColumn;
|
||||||
|
import com.agileboot.common.annotation.ExcelSheet;
|
||||||
|
import com.agileboot.domain.shop.order.db.TodayLatestOrderGoodsDTO;
|
||||||
|
import com.agileboot.domain.shop.order.dto.TopGoodsDTO;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@ExcelSheet(name = "统计数据")
|
||||||
|
@Data
|
||||||
|
public class StatsDTO {
|
||||||
|
|
||||||
|
@ExcelColumn(name = "商店数量")
|
||||||
|
private Long shopCount;
|
||||||
|
|
||||||
|
@ExcelColumn(name = "商品数量")
|
||||||
|
private Long goodsCount;
|
||||||
|
|
||||||
|
@ExcelColumn(name = "商品总金额")
|
||||||
|
private BigDecimal goodsTotalAmount;
|
||||||
|
|
||||||
|
@ExcelColumn(name = "订单数量")
|
||||||
|
private Long orderCount;
|
||||||
|
|
||||||
|
@ExcelColumn(name = "总订单金额")
|
||||||
|
private BigDecimal orderAmountSum;
|
||||||
|
|
||||||
|
@ExcelColumn(name = "总柜子数量")
|
||||||
|
private Long cabinetCount;
|
||||||
|
|
||||||
|
@ExcelColumn(name = "未还商品数量")
|
||||||
|
private Long unReturnedGoodsCount;
|
||||||
|
|
||||||
|
@ExcelColumn(name = "未还订单数量")
|
||||||
|
private Long unReturnedOrderCount;
|
||||||
|
|
||||||
|
@ExcelColumn(name = "未还金额")
|
||||||
|
private BigDecimal unReturnedAmount;
|
||||||
|
|
||||||
|
@ExcelColumn(name = "总格口数量")
|
||||||
|
private Long cellCount;
|
||||||
|
|
||||||
|
@ExcelColumn(name = "已关联格口数量")
|
||||||
|
private Long linkedCellCount;
|
||||||
|
|
||||||
|
@ExcelColumn(name = "未管理格口数量")
|
||||||
|
private Long unmanagedCellCount;
|
||||||
|
|
||||||
|
@ExcelColumn(name = "网关数量")
|
||||||
|
private Long gatewayCount;
|
||||||
|
|
||||||
|
private List<TopGoodsDTO> topGoods;
|
||||||
|
|
||||||
|
private List<TodayLatestOrderGoodsDTO> todayLatestOrderGoods;
|
||||||
|
}
|
|
@ -21,10 +21,10 @@ public class NoticeDTO {
|
||||||
this.status = entity.getStatus();
|
this.status = entity.getStatus();
|
||||||
this.createTime = entity.getCreateTime();
|
this.createTime = entity.getCreateTime();
|
||||||
|
|
||||||
SysUserEntity cacheUser = CacheCenter.userCache.getObjectById(entity.getCreatorId());
|
/*SysUserEntity cacheUser = CacheCenter.userCache.getObjectById(entity.getCreatorId());
|
||||||
if (cacheUser != null) {
|
if (cacheUser != null) {
|
||||||
this.creatorName = cacheUser.getUsername();
|
this.creatorName = cacheUser.getUsername();
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.agileboot.domain.ab98.tag.db.Ab98UserTagMapper">
|
||||||
|
|
||||||
|
</mapper>
|
|
@ -11,7 +11,7 @@ public enum CacheKeyEnum {
|
||||||
* Redis各类缓存集合
|
* Redis各类缓存集合
|
||||||
*/
|
*/
|
||||||
CAPTCHAT("captcha_codes:", 2, TimeUnit.MINUTES),
|
CAPTCHAT("captcha_codes:", 2, TimeUnit.MINUTES),
|
||||||
LOGIN_USER_KEY("login_tokens:", 30, TimeUnit.MINUTES),
|
LOGIN_USER_KEY("login_tokens:", 10*60, TimeUnit.MINUTES),
|
||||||
RATE_LIMIT_KEY("rate_limit:", 60, TimeUnit.SECONDS),
|
RATE_LIMIT_KEY("rate_limit:", 60, TimeUnit.SECONDS),
|
||||||
USER_ENTITY_KEY("user_entity:", 60, TimeUnit.MINUTES),
|
USER_ENTITY_KEY("user_entity:", 60, TimeUnit.MINUTES),
|
||||||
ROLE_ENTITY_KEY("role_entity:", 60, TimeUnit.MINUTES),
|
ROLE_ENTITY_KEY("role_entity:", 60, TimeUnit.MINUTES),
|
||||||
|
|
|
@ -61,7 +61,7 @@ public class CodeGenerator {
|
||||||
//生成的类 放在orm子模块下的/target/generated-code目录底下
|
//生成的类 放在orm子模块下的/target/generated-code目录底下
|
||||||
.module("/agileboot-orm/target/generated-code")
|
.module("/agileboot-orm/target/generated-code")
|
||||||
.parentPackage("com.agileboot")
|
.parentPackage("com.agileboot")
|
||||||
.tableName("cabinet_mainboard")
|
.tableName("ab98_user_tag")
|
||||||
// 决定是否继承基类
|
// 决定是否继承基类
|
||||||
.isExtendsFromBaseEntity(true)
|
.isExtendsFromBaseEntity(true)
|
||||||
.build();
|
.build();
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
ALTER TABLE `shop_goods`
|
||||||
|
ADD COLUMN `usage_instruction` VARCHAR(512) NULL COMMENT '商品使用说明'
|
||||||
|
AFTER `goods_detail`;
|
||||||
|
|
||||||
|
ALTER TABLE `qy_user`
|
||||||
|
ADD COLUMN `sys_role_id` BIGINT DEFAULT NULL COMMENT '系统角色id'
|
||||||
|
AFTER `balance`;
|
|
@ -0,0 +1,15 @@
|
||||||
|
DROP TABLE IF EXISTS `ab98_user_tag`;
|
||||||
|
|
||||||
|
CREATE TABLE `ab98_user_tag` (
|
||||||
|
`tag_id` BIGINT NOT NULL AUTO_INCREMENT COMMENT '标签ID',
|
||||||
|
`ab98_user_id` BIGINT NOT NULL COMMENT '关联用户ID',
|
||||||
|
`tag_name` VARCHAR(50) NOT NULL COMMENT '标签名称',
|
||||||
|
`creator_id` BIGINT DEFAULT 0 COMMENT '创建者ID',
|
||||||
|
`create_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||||
|
`updater_id` BIGINT DEFAULT 0 COMMENT '更新者ID',
|
||||||
|
`update_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||||
|
`deleted` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '删除标志(0存在 1删除)',
|
||||||
|
PRIMARY KEY (`tag_id`),
|
||||||
|
KEY `idx_user` (`ab98_user_id`),
|
||||||
|
CONSTRAINT `fk_tag_user` FOREIGN KEY (`ab98_user_id`) REFERENCES `ab98_user` (`ab98_user_id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='用户标签表';
|
Loading…
Reference in New Issue