Compare commits

..

No commits in common. "ed6d2748fcfc806c15e9a19ebabab3a4dd88c14d" and "188e49976c393005b9e43546566b0747dd93515d" have entirely different histories.

8 changed files with 12 additions and 165 deletions

View File

@ -50,13 +50,6 @@ public class QyUserController extends BaseController {
return ResponseDTO.ok(page);
}
@Operation(summary = "qy用户详情")
@GetMapping("/detail/{id}")
public ResponseDTO<QyUserDTO> detail(@PathVariable Long id) {
QyUserDTO qyUserDTO = qyUserApplicationService.getQyUserDetail(id);
return ResponseDTO.ok(qyUserDTO);
}
@Operation(summary = "新增用户")
@AccessLog(title = "用户管理", businessType = BusinessTypeEnum.ADD)
@PostMapping

View File

@ -209,7 +209,7 @@ public class PaymentController {
if (routerTree == null || routerTree.isEmpty()) {
return false;
}
boolean isAdmin = routerTree.stream().anyMatch(router -> router.getName().trim().equals("SmartCabinetCard"));
boolean isAdmin = routerTree.stream().anyMatch(router -> router.getName().equals("CabinetCell"));
if (isAdmin) {
return true;
}

View File

@ -1,102 +1,40 @@
package com.agileboot.domain.cabinet.smartCabinet;
/**
* 机柜模板枚举类
* 定义了系统中支持的各种机柜模板类型
*/
public enum CabinetTemplateEnum {
/** 16口机柜模板1块主板每块主板16个单元格 */
CABINET_16(1, "cabinet_16.jpg", "16口机柜", 1, 16),
/** 20口机柜模板1块主板每块主板20个单元格 */
CABINET_20(2, "cabinet_20.jpg", "20口机柜", 1, 20),
/** 22口机柜模板1块主板每块主板22个单元格 */
CABINET_22(3, "cabinet_22.jpg", "22口机柜", 1, 22),
/** 24口机柜模板1块主板每块主板24个单元格 */
CABINET_24(4, "cabinet_24.jpg", "24口机柜", 1, 24),
/** 40口机柜模板2块主板每块主板20个单元格 */
CABINET_40(5, "cabinet_40.jpg", "40口机柜", 2, 20),
/** 48口机柜模板2块主板每块主板24个单元格 */
CABINET_48(6, "cabinet_48.jpg", "48口机柜", 2, 24),
/** 60口机柜模板2块主板每块主板30个单元格 */
CABINET_60(7, "cabinet_60.jpg", "60口机柜", 2, 30),
/** 120口机柜模板(6X20)6块主板每块主板20个单元格 */
CABINET_6X20(8, "cabinet_120_6X20.jpg", "120口机柜6X20", 6, 20),
/** 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);
CABINET_16(1, "cabinet_16.jpg", "16口机柜", 1),
CABINET_20(2, "cabinet_20.jpg", "20口机柜", 1),
CABINET_22(3, "cabinet_22.jpg", "22口机柜", 1),
CABINET_24(4, "cabinet_24.jpg", "24口机柜", 1),
CABINET_40(5, "cabinet_40.jpg", "40口机柜", 2),
CABINET_48(6, "cabinet_48.jpg", "48口机柜", 2),
CABINET_60(7, "cabinet_60.jpg", "60口机柜", 4),
CABINET_120(8, "cabinet_120.jpg", "120口机柜", 6);
/** 模板代码 */
private final int code;
/** 模板图片名称 */
private final String img;
/** 模板名称 */
private final String name;
/** 主板数量 */
private final int boardCount;
/** 每块主板的单元格数量 */
private final int cellsPerBoard;
CabinetTemplateEnum(int code, String img, String name, int boardCount, int cellsPerBoard) {
CabinetTemplateEnum(int code, String img, String name, int boardCount) {
this.code = code;
this.img = img;
this.name = name;
this.boardCount = boardCount;
this.cellsPerBoard = cellsPerBoard;
}
/**
* 获取模板代码
* @return 模板代码
*/
public int getCode() {
return code;
}
/**
* 获取模板图片名称
* @return 模板图片名称
*/
public String getImg() {
return img;
}
/**
* 获取模板名称
* @return 模板名称
*/
public String getName() {
return name;
}
/**
* 获取主板数量
* @return 主板数量
*/
public int getBoardCount() {
return boardCount;
}
/**
* 获取每块主板的单元格数量
* @return 每块主板的单元格数量
*/
public int getCellsPerBoard() {
return cellsPerBoard;
}
/**
* 根据模板代码获取枚举实例
* @param code 模板代码
* @return 对应的枚举实例如果不存在则返回null
*/
public static CabinetTemplateEnum getByCode(int code) {
for (CabinetTemplateEnum value : values()) {
if (value.getCode() == code) {
return value;
}
}
return null;
}
}

View File

@ -1,14 +1,8 @@
package com.agileboot.domain.cabinet.smartCabinet;
import com.agileboot.common.core.page.PageDTO;
import com.agileboot.domain.cabinet.cell.command.AddCabinetCellCommand;
import com.agileboot.domain.cabinet.cell.db.CabinetCellEntity;
import com.agileboot.domain.cabinet.cell.db.CabinetCellService;
import com.agileboot.domain.cabinet.cell.model.CabinetCellModel;
import com.agileboot.domain.cabinet.cell.model.CabinetCellModelFactory;
import com.agileboot.domain.cabinet.mainboard.command.AddCabinetMainboardCommand;
import com.agileboot.domain.cabinet.mainboard.model.CabinetMainboardModel;
import com.agileboot.domain.cabinet.mainboard.model.CabinetMainboardModelFactory;
import com.agileboot.domain.cabinet.smartCabinet.dto.CabinetDetailDTO;
import com.agileboot.domain.common.command.BulkOperationCommand;
import com.agileboot.domain.cabinet.smartCabinet.command.AddSmartCabinetCommand;
@ -39,8 +33,6 @@ public class SmartCabinetApplicationService {
private final CabinetCellService cabinetCellService;
private final ShopGoodsService shopGoodsService;
private final ShopService shopService;
private final CabinetMainboardModelFactory cabinetMainboardModelFactory;
private final CabinetCellModelFactory cabinetCellModelFactory;
public PageDTO<SmartCabinetDTO> getSmartCabinetList(SearchSmartCabinetQuery<SmartCabinetEntity> query) {
List<ShopEntity> shopEntities = shopService.selectAll();
@ -83,17 +75,8 @@ public class SmartCabinetApplicationService {
public void addSmartCabinet(AddSmartCabinetCommand command) {
SmartCabinetModel model = smartCabinetModelFactory.create();
if (command.getLockControlNo() == null) {
command.setLockControlNo(1);
}
if (command.getLocation() == null) {
command.setLocation(1);
}
model.loadAddCommand(command);
model.insert();
List<CabinetMainboardModel> mainboardModels = createCabinetMainboardByTemplate(model);
createCabinetCellsByTemplate(model, mainboardModels);
}
public void updateSmartCabinet(UpdateSmartCabinetCommand command) {
@ -139,7 +122,6 @@ public class SmartCabinetApplicationService {
CabinetDetailDTO.CellInfoDTO cellInfo = new CabinetDetailDTO.CellInfoDTO();
// 设置单元格基础信息
cellInfo.setCellId(cell.getCellId());
cellInfo.setCellNo(cell.getCellNo());
cellInfo.setPinNo(cell.getPinNo());
cellInfo.setStock(cell.getStock());
@ -168,54 +150,7 @@ public class SmartCabinetApplicationService {
return result;
}
public List<CabinetMainboardModel> createCabinetMainboardByTemplate(SmartCabinetModel cabinetModel) {
CabinetTemplateEnum template = CabinetTemplateEnum.getByCode(Integer.parseInt(cabinetModel.getTemplateNo()));
if (template == null) {
throw new IllegalArgumentException("Invalid template code");
}
List<CabinetMainboardModel> result = new ArrayList<>();
for (int i = 1; i <= template.getBoardCount(); i++) {
CabinetMainboardModel mainboardModel = cabinetMainboardModelFactory.create();
AddCabinetMainboardCommand command = new AddCabinetMainboardCommand();
command.initBaseEntity();
command.setCabinetId(cabinetModel.getCabinetId());
command.setLockControlNo(i);
mainboardModel.loadAddCommand(command);
mainboardModel.insert();
result.add(mainboardModel);
}
return result;
}
public List<CabinetCellModel> createCabinetCellsByTemplate(SmartCabinetModel cabinetModel, List<CabinetMainboardModel> mainboards) {
CabinetTemplateEnum template = CabinetTemplateEnum.getByCode(Integer.parseInt(cabinetModel.getTemplateNo()));
if (template == null) {
throw new IllegalArgumentException("Invalid template code");
}
List<CabinetCellModel> result = new ArrayList<>();
int cell_no = 1;
for (CabinetMainboardModel mainboard : mainboards) {
for (int i = 1; i <= template.getCellsPerBoard(); i++) {
CabinetCellModel cellModel = cabinetCellModelFactory.create();
AddCabinetCellCommand command = new AddCabinetCellCommand();
command.initBaseEntity();
command.setCabinetId(cabinetModel.getCabinetId());
command.setMainboardId(mainboard.getMainboardId());
command.setCellNo(cell_no);
cell_no++;
command.setPinNo(i);
command.setStock(0);
command.setCellType(1);
command.setUsageStatus(1);
command.setAvailableStatus(1);
cellModel.loadAddCommand(command);
cellModel.insert();
result.add(cellModel);
}
}
return result;
public void createCabinetMainboardByTemplate(Long cabinetId) {
SmartCabinetModel cabinetModel = smartCabinetModelFactory.loadById(cabinetId);
}
}

View File

@ -15,7 +15,6 @@ public class CabinetDetailDTO {
@Data
public static class CellInfoDTO {
private Long cellId;
private Integer cellNo;
private Integer pinNo;
private Integer stock;
private ProductInfoDTO product;

View File

@ -17,7 +17,6 @@ import com.agileboot.domain.qywx.userQySys.db.SysUserQyUserEntity;
import com.agileboot.domain.qywx.userQySys.db.SysUserQyUserService;
import com.agileboot.domain.system.user.db.SysUserEntity;
import com.agileboot.domain.system.user.db.SysUserService;
import com.agileboot.domain.system.user.dto.UserDTO;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List;
import java.util.stream.Collectors;
@ -42,17 +41,6 @@ public class QyUserApplicationService {
return new PageDTO<>(dtoList, page.getTotal());
}
public QyUserDTO getQyUserDetail(Long id) {
QyUserEntity user = userService.getById(id);
QyUserDTO dto = new QyUserDTO(user);
SysUserQyUserEntity sysUserQyUser = sysUserQyUserService.getByQyUserId(id.intValue());
if (sysUserQyUser != null) {
SysUserEntity sysUser = sysUserService.getById(sysUserQyUser.getSysUserId());
dto.setSysUser(new UserDTO(sysUser));
}
return dto;
}
public List<QyUserEntity> selectAll() {
return userService.selectAll();
}

View File

@ -11,7 +11,6 @@ import com.agileboot.domain.system.user.db.SysUserEntity;
import java.math.BigDecimal;
import java.util.Date;
import com.agileboot.domain.system.user.dto.UserDTO;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -34,9 +33,6 @@ public class QyUserDTO {
}
}
// 系统用户
private UserDTO sysUser;
@ExcelColumn(name = "用户ID")
private Integer id;

View File

@ -15,7 +15,6 @@ public class SearchShopOrderQuery<T> extends AbstractPageQuery<T> {
private Long orderId;
private String openid;
private String userid;
private Long cellId;
private Long cabinetId;
private Integer status;
@ -33,7 +32,6 @@ public class SearchShopOrderQuery<T> extends AbstractPageQuery<T> {
.eq(orderId != null, "o.order_id", orderId)
.eq(cellId != null, "og.cell_id", cellId)
.eq(StrUtil.isNotBlank(openid), "o.openid", StringUtils.trim(openid))
.eq(StrUtil.isNotBlank(userid), "o.userid", StringUtils.trim(userid))
.eq(cabinetId != null, "cc.cabinet_id", cabinetId)
.eq(status != null, "o.status", status)
.eq(payStatus != null, "o.pay_status", payStatus)