Compare commits
4 Commits
188e49976c
...
ed6d2748fc
Author | SHA1 | Date |
---|---|---|
|
ed6d2748fc | |
|
b103184a1e | |
|
4e5ca6ea07 | |
|
8aa1b9cc5c |
|
@ -50,6 +50,13 @@ public class QyUserController extends BaseController {
|
||||||
return ResponseDTO.ok(page);
|
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 = "新增用户")
|
@Operation(summary = "新增用户")
|
||||||
@AccessLog(title = "用户管理", businessType = BusinessTypeEnum.ADD)
|
@AccessLog(title = "用户管理", businessType = BusinessTypeEnum.ADD)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
|
|
|
@ -209,7 +209,7 @@ public class PaymentController {
|
||||||
if (routerTree == null || routerTree.isEmpty()) {
|
if (routerTree == null || routerTree.isEmpty()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
boolean isAdmin = routerTree.stream().anyMatch(router -> router.getName().equals("CabinetCell"));
|
boolean isAdmin = routerTree.stream().anyMatch(router -> router.getName().trim().equals("SmartCabinetCard"));
|
||||||
if (isAdmin) {
|
if (isAdmin) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,40 +1,102 @@
|
||||||
package com.agileboot.domain.cabinet.smartCabinet;
|
package com.agileboot.domain.cabinet.smartCabinet;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 机柜模板枚举类
|
||||||
|
* 定义了系统中支持的各种机柜模板类型
|
||||||
|
*/
|
||||||
public enum CabinetTemplateEnum {
|
public enum CabinetTemplateEnum {
|
||||||
CABINET_16(1, "cabinet_16.jpg", "16口机柜", 1),
|
/** 16口机柜模板,1块主板,每块主板16个单元格 */
|
||||||
CABINET_20(2, "cabinet_20.jpg", "20口机柜", 1),
|
CABINET_16(1, "cabinet_16.jpg", "16口机柜", 1, 16),
|
||||||
CABINET_22(3, "cabinet_22.jpg", "22口机柜", 1),
|
/** 20口机柜模板,1块主板,每块主板20个单元格 */
|
||||||
CABINET_24(4, "cabinet_24.jpg", "24口机柜", 1),
|
CABINET_20(2, "cabinet_20.jpg", "20口机柜", 1, 20),
|
||||||
CABINET_40(5, "cabinet_40.jpg", "40口机柜", 2),
|
/** 22口机柜模板,1块主板,每块主板22个单元格 */
|
||||||
CABINET_48(6, "cabinet_48.jpg", "48口机柜", 2),
|
CABINET_22(3, "cabinet_22.jpg", "22口机柜", 1, 22),
|
||||||
CABINET_60(7, "cabinet_60.jpg", "60口机柜", 4),
|
/** 24口机柜模板,1块主板,每块主板24个单元格 */
|
||||||
CABINET_120(8, "cabinet_120.jpg", "120口机柜", 6);
|
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);
|
||||||
|
|
||||||
|
/** 模板代码 */
|
||||||
private final int code;
|
private final int code;
|
||||||
|
/** 模板图片名称 */
|
||||||
private final String img;
|
private final String img;
|
||||||
|
/** 模板名称 */
|
||||||
private final String name;
|
private final String name;
|
||||||
|
/** 主板数量 */
|
||||||
private final int boardCount;
|
private final int boardCount;
|
||||||
|
/** 每块主板的单元格数量 */
|
||||||
|
private final int cellsPerBoard;
|
||||||
|
|
||||||
CabinetTemplateEnum(int code, String img, String name, int boardCount) {
|
CabinetTemplateEnum(int code, String img, String name, int boardCount, int cellsPerBoard) {
|
||||||
this.code = code;
|
this.code = code;
|
||||||
this.img = img;
|
this.img = img;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.boardCount = boardCount;
|
this.boardCount = boardCount;
|
||||||
|
this.cellsPerBoard = cellsPerBoard;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取模板代码
|
||||||
|
* @return 模板代码
|
||||||
|
*/
|
||||||
public int getCode() {
|
public int getCode() {
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取模板图片名称
|
||||||
|
* @return 模板图片名称
|
||||||
|
*/
|
||||||
public String getImg() {
|
public String getImg() {
|
||||||
return img;
|
return img;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取模板名称
|
||||||
|
* @return 模板名称
|
||||||
|
*/
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取主板数量
|
||||||
|
* @return 主板数量
|
||||||
|
*/
|
||||||
public int getBoardCount() {
|
public int getBoardCount() {
|
||||||
return boardCount;
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,14 @@
|
||||||
package com.agileboot.domain.cabinet.smartCabinet;
|
package com.agileboot.domain.cabinet.smartCabinet;
|
||||||
|
|
||||||
import com.agileboot.common.core.page.PageDTO;
|
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.CabinetCellEntity;
|
||||||
import com.agileboot.domain.cabinet.cell.db.CabinetCellService;
|
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.cabinet.smartCabinet.dto.CabinetDetailDTO;
|
||||||
import com.agileboot.domain.common.command.BulkOperationCommand;
|
import com.agileboot.domain.common.command.BulkOperationCommand;
|
||||||
import com.agileboot.domain.cabinet.smartCabinet.command.AddSmartCabinetCommand;
|
import com.agileboot.domain.cabinet.smartCabinet.command.AddSmartCabinetCommand;
|
||||||
|
@ -33,6 +39,8 @@ public class SmartCabinetApplicationService {
|
||||||
private final CabinetCellService cabinetCellService;
|
private final CabinetCellService cabinetCellService;
|
||||||
private final ShopGoodsService shopGoodsService;
|
private final ShopGoodsService shopGoodsService;
|
||||||
private final ShopService shopService;
|
private final ShopService shopService;
|
||||||
|
private final CabinetMainboardModelFactory cabinetMainboardModelFactory;
|
||||||
|
private final CabinetCellModelFactory cabinetCellModelFactory;
|
||||||
|
|
||||||
public PageDTO<SmartCabinetDTO> getSmartCabinetList(SearchSmartCabinetQuery<SmartCabinetEntity> query) {
|
public PageDTO<SmartCabinetDTO> getSmartCabinetList(SearchSmartCabinetQuery<SmartCabinetEntity> query) {
|
||||||
List<ShopEntity> shopEntities = shopService.selectAll();
|
List<ShopEntity> shopEntities = shopService.selectAll();
|
||||||
|
@ -75,8 +83,17 @@ public class SmartCabinetApplicationService {
|
||||||
|
|
||||||
public void addSmartCabinet(AddSmartCabinetCommand command) {
|
public void addSmartCabinet(AddSmartCabinetCommand command) {
|
||||||
SmartCabinetModel model = smartCabinetModelFactory.create();
|
SmartCabinetModel model = smartCabinetModelFactory.create();
|
||||||
|
if (command.getLockControlNo() == null) {
|
||||||
|
command.setLockControlNo(1);
|
||||||
|
}
|
||||||
|
if (command.getLocation() == null) {
|
||||||
|
command.setLocation(1);
|
||||||
|
}
|
||||||
model.loadAddCommand(command);
|
model.loadAddCommand(command);
|
||||||
model.insert();
|
model.insert();
|
||||||
|
|
||||||
|
List<CabinetMainboardModel> mainboardModels = createCabinetMainboardByTemplate(model);
|
||||||
|
createCabinetCellsByTemplate(model, mainboardModels);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateSmartCabinet(UpdateSmartCabinetCommand command) {
|
public void updateSmartCabinet(UpdateSmartCabinetCommand command) {
|
||||||
|
@ -122,6 +139,7 @@ public class SmartCabinetApplicationService {
|
||||||
CabinetDetailDTO.CellInfoDTO cellInfo = new CabinetDetailDTO.CellInfoDTO();
|
CabinetDetailDTO.CellInfoDTO cellInfo = new CabinetDetailDTO.CellInfoDTO();
|
||||||
// 设置单元格基础信息
|
// 设置单元格基础信息
|
||||||
cellInfo.setCellId(cell.getCellId());
|
cellInfo.setCellId(cell.getCellId());
|
||||||
|
cellInfo.setCellNo(cell.getCellNo());
|
||||||
cellInfo.setPinNo(cell.getPinNo());
|
cellInfo.setPinNo(cell.getPinNo());
|
||||||
cellInfo.setStock(cell.getStock());
|
cellInfo.setStock(cell.getStock());
|
||||||
|
|
||||||
|
@ -150,7 +168,54 @@ public class SmartCabinetApplicationService {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void createCabinetMainboardByTemplate(Long cabinetId) {
|
public List<CabinetMainboardModel> createCabinetMainboardByTemplate(SmartCabinetModel cabinetModel) {
|
||||||
SmartCabinetModel cabinetModel = smartCabinetModelFactory.loadById(cabinetId);
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,6 +15,7 @@ public class CabinetDetailDTO {
|
||||||
@Data
|
@Data
|
||||||
public static class CellInfoDTO {
|
public static class CellInfoDTO {
|
||||||
private Long cellId;
|
private Long cellId;
|
||||||
|
private Integer cellNo;
|
||||||
private Integer pinNo;
|
private Integer pinNo;
|
||||||
private Integer stock;
|
private Integer stock;
|
||||||
private ProductInfoDTO product;
|
private ProductInfoDTO product;
|
||||||
|
|
|
@ -17,6 +17,7 @@ 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.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.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
@ -41,6 +42,17 @@ public class QyUserApplicationService {
|
||||||
return new PageDTO<>(dtoList, page.getTotal());
|
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() {
|
public List<QyUserEntity> selectAll() {
|
||||||
return userService.selectAll();
|
return userService.selectAll();
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,7 @@ import com.agileboot.domain.system.user.db.SysUserEntity;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
|
import com.agileboot.domain.system.user.dto.UserDTO;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
@ -33,6 +34,9 @@ public class QyUserDTO {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 系统用户
|
||||||
|
private UserDTO sysUser;
|
||||||
|
|
||||||
@ExcelColumn(name = "用户ID")
|
@ExcelColumn(name = "用户ID")
|
||||||
private Integer id;
|
private Integer id;
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,7 @@ public class SearchShopOrderQuery<T> extends AbstractPageQuery<T> {
|
||||||
|
|
||||||
private Long orderId;
|
private Long orderId;
|
||||||
private String openid;
|
private String openid;
|
||||||
|
private String userid;
|
||||||
private Long cellId;
|
private Long cellId;
|
||||||
private Long cabinetId;
|
private Long cabinetId;
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
@ -32,6 +33,7 @@ public class SearchShopOrderQuery<T> extends AbstractPageQuery<T> {
|
||||||
.eq(orderId != null, "o.order_id", orderId)
|
.eq(orderId != null, "o.order_id", orderId)
|
||||||
.eq(cellId != null, "og.cell_id", cellId)
|
.eq(cellId != null, "og.cell_id", cellId)
|
||||||
.eq(StrUtil.isNotBlank(openid), "o.openid", StringUtils.trim(openid))
|
.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(cabinetId != null, "cc.cabinet_id", cabinetId)
|
||||||
.eq(status != null, "o.status", status)
|
.eq(status != null, "o.status", status)
|
||||||
.eq(payStatus != null, "o.pay_status", payStatus)
|
.eq(payStatus != null, "o.pay_status", payStatus)
|
||||||
|
|
Loading…
Reference in New Issue