rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/CompanysController.java
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.vincent.rsf.framework.common.Cools; import com.vincent.rsf.framework.common.R; import com.vincent.rsf.framework.exception.CoolException; import com.vincent.rsf.server.common.utils.ExcelUtil; import com.vincent.rsf.server.common.annotation.OperationLog; import com.vincent.rsf.server.common.domain.BaseParam; @@ -57,10 +58,17 @@ @OperationLog("Create 字典数据集") @PostMapping("/companys/save") public R save(@RequestBody Companys companys) { if (Objects.isNull(companys.getName())) { throw new CoolException("企业名称不能为空!!"); } if (Objects.isNull(companys.getBreifCode())) { throw new CoolException("企业助记码不能为空!!"); } if (Objects.isNull(companys.getType())) { throw new CoolException("企业类型不能为空!!"); } companys.setCreateBy(getLoginUserId()); companys.setCreateTime(new Date()); companys.setUpdateBy(getLoginUserId()); companys.setUpdateTime(new Date()); if (!companysService.save(companys)) { return R.error("Save Fail"); } @@ -106,7 +114,13 @@ @PreAuthorize("hasAuthority('manager:companys:list')") @PostMapping("/companys/export") public void export(@RequestBody Map<String, Object> map, HttpServletResponse response) throws Exception { ExcelUtil.build(ExcelUtil.create(companysService.list(), Companys.class), response); List<Companys> companies = new ArrayList<>(); if (!Objects.isNull(map.get("ids"))) { companies = companysService.list(new LambdaQueryWrapper<Companys>().in(Companys::getId, map.get("ids"))); } else { companies = companysService.list(); } ExcelUtil.build(ExcelUtil.create(companies, Companys.class), response); } } rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/ContainerController.java
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.vincent.rsf.framework.common.Cools; import com.vincent.rsf.framework.common.R; import com.vincent.rsf.framework.exception.CoolException; import com.vincent.rsf.server.common.utils.ExcelUtil; import com.vincent.rsf.server.common.annotation.OperationLog; import com.vincent.rsf.server.common.domain.BaseParam; @@ -56,9 +57,13 @@ @PostMapping("/container/save") public R save(@RequestBody Container container) { container.setCreateBy(getLoginUserId()); container.setCreateTime(new Date()); container.setUpdateBy(getLoginUserId()); container.setUpdateTime(new Date()); if (Objects.isNull(container.getType())) { throw new CoolException("容器类型不能为空!!"); } if (Objects.isNull(container.getUsed())) { throw new CoolException("容器使用次数不能为空!!"); } if (!containerService.save(container)) { return R.error("Save Fail"); } @@ -81,6 +86,10 @@ @OperationLog("Delete 库位信息表") @PostMapping("/container/remove/{ids}") public R remove(@PathVariable Long[] ids) { List<Container> containers = containerService.list(new LambdaQueryWrapper<Container>().in(Container::getPanrentId, ids)); if (containers.isEmpty()) { throw new CoolException("当前容器有子容器绑定,不能执行删除操作!!"); } if (!containerService.removeByIds(Arrays.asList(ids))) { return R.error("Delete Fail"); } @@ -104,7 +113,13 @@ @PreAuthorize("hasAuthority('manager:container:list')") @PostMapping("/container/export") public void export(@RequestBody Map<String, Object> map, HttpServletResponse response) throws Exception { ExcelUtil.build(ExcelUtil.create(containerService.list(), Container.class), response); List<Container> containers = new ArrayList<>(); if (!Objects.isNull(map.get("ids"))) { containers = containerService.list(new LambdaQueryWrapper<Container>().in(Container::getId, map.get("ids"))); } else { containers = containerService.list(); } ExcelUtil.build(ExcelUtil.create(containers, Container.class), response); } } rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/MatnrController.java
@@ -140,7 +140,7 @@ } else { matnrs = matnrService.list(new LambdaQueryWrapper<Matnr>().last("limit 1")); } ExcelUtil.build(ExcelUtil.create(null, MatnrsTemplate.class, true), response); ExcelUtil.build(ExcelUtil.create(matnrs, Matnr.class, true), response); } @PreAuthorize("hasAuthority('manager:matnr:list')") rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/WarehouseAreasController.java
@@ -4,12 +4,15 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.vincent.rsf.framework.common.Cools; import com.vincent.rsf.framework.common.R; import com.vincent.rsf.framework.exception.CoolException; import com.vincent.rsf.server.common.utils.ExcelUtil; import com.vincent.rsf.server.common.annotation.OperationLog; import com.vincent.rsf.server.common.domain.BaseParam; import com.vincent.rsf.server.common.domain.KeyValVo; import com.vincent.rsf.server.common.domain.PageParam; import com.vincent.rsf.server.manager.entity.Loc; import com.vincent.rsf.server.manager.entity.WarehouseAreas; import com.vincent.rsf.server.manager.service.LocService; import com.vincent.rsf.server.manager.service.WarehouseAreasService; import com.vincent.rsf.server.system.controller.BaseController; import org.springframework.beans.factory.annotation.Autowired; @@ -24,6 +27,8 @@ @Autowired private WarehouseAreasService warehouseAreasService; private LocService locService; @PreAuthorize("hasAuthority('manager:warehouseAreas:list')") @PostMapping("/warehouseAreas/page") @@ -56,9 +61,7 @@ @PostMapping("/warehouseAreas/save") public R save(@RequestBody WarehouseAreas warehouseAreas) { warehouseAreas.setCreateBy(getLoginUserId()); warehouseAreas.setCreateTime(new Date()); warehouseAreas.setUpdateBy(getLoginUserId()); warehouseAreas.setUpdateTime(new Date()); if (!warehouseAreasService.save(warehouseAreas)) { return R.error("Save Fail"); } @@ -81,6 +84,10 @@ @OperationLog("Delete 库区信息表") @PostMapping("/warehouseAreas/remove/{ids}") public R remove(@PathVariable Long[] ids) { List<Loc> locs = locService.list(new LambdaQueryWrapper<Loc>().in(Loc::getAreaId, ids)); if (!locs.isEmpty()) { throw new CoolException("当前库有库位绑定,不能执行删除操作!!"); } if (!warehouseAreasService.removeByIds(Arrays.asList(ids))) { return R.error("Delete Fail"); } rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/WarehouseController.java
@@ -4,12 +4,16 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.vincent.rsf.framework.common.Cools; import com.vincent.rsf.framework.common.R; import com.vincent.rsf.framework.exception.CoolException; import com.vincent.rsf.server.common.utils.ExcelUtil; import com.vincent.rsf.server.common.annotation.OperationLog; import com.vincent.rsf.server.common.domain.BaseParam; import com.vincent.rsf.server.common.domain.KeyValVo; import com.vincent.rsf.server.common.domain.PageParam; import com.vincent.rsf.server.manager.entity.Warehouse; import com.vincent.rsf.server.manager.entity.WarehouseAreas; import com.vincent.rsf.server.manager.service.WarehouseAreasItemService; import com.vincent.rsf.server.manager.service.WarehouseAreasService; import com.vincent.rsf.server.manager.service.WarehouseService; import com.vincent.rsf.server.system.controller.BaseController; import io.swagger.annotations.Api; @@ -26,6 +30,12 @@ @Autowired private WarehouseService warehouseService; @Autowired private WarehouseAreasService warehouseAreasService; @Autowired private WarehouseAreasItemService warehouseAreasItemService; @PreAuthorize("hasAuthority('manager:warehouse:list')") @PostMapping("/warehouse/page") @@ -57,10 +67,14 @@ @OperationLog("Create 仓库信息表") @PostMapping("/warehouse/save") public R save(@RequestBody Warehouse warehouse) { if (Objects.isNull(warehouse)) { throw new CoolException("参数不能为空!!"); } if (Objects.isNull(warehouse.getName())) { throw new CoolException("仓库名称不能为空!!"); } warehouse.setCreateBy(getLoginUserId()); warehouse.setCreateTime(new Date()); warehouse.setUpdateBy(getLoginUserId()); warehouse.setUpdateTime(new Date()); if (!warehouseService.save(warehouse)) { return R.error("Save Fail"); } @@ -71,8 +85,13 @@ @OperationLog("Update 仓库信息表") @PostMapping("/warehouse/update") public R update(@RequestBody Warehouse warehouse) { if (Objects.isNull(warehouse)) { throw new CoolException("参数不能为空!!"); } if (Objects.isNull(warehouse.getName())) { throw new CoolException("仓库名称不能为空!!"); } warehouse.setUpdateBy(getLoginUserId()); warehouse.setUpdateTime(new Date()); if (!warehouseService.updateById(warehouse)) { return R.error("Update Fail"); } @@ -83,6 +102,13 @@ @OperationLog("Delete 仓库信息表") @PostMapping("/warehouse/remove/{ids}") public R remove(@PathVariable Long[] ids) { if (ids.length < 1) { throw new CoolException("查询id不能为空!!"); } List<WarehouseAreas> warehouseAreas = warehouseAreasService.list(new LambdaQueryWrapper<WarehouseAreas>().in(WarehouseAreas::getWareId, ids)); if (!warehouseAreas.isEmpty()) { throw new CoolException("当前仓库下有未删除库区, 不可操作删除!!"); } if (!warehouseService.removeByIds(Arrays.asList(ids))) { return R.error("Delete Fail"); } @@ -106,7 +132,13 @@ @PreAuthorize("hasAuthority('manager:warehouse:list')") @PostMapping("/warehouse/export") public void export(@RequestBody Map<String, Object> map, HttpServletResponse response) throws Exception { ExcelUtil.build(ExcelUtil.create(warehouseService.list(), Warehouse.class), response); List<Warehouse> list = new ArrayList<>(); if (!Objects.isNull(map.get("ids"))) { list = warehouseService.list(new LambdaQueryWrapper<Warehouse>().in(Warehouse::getId, map.get("ids"))); } else { list = warehouseService.list(); } ExcelUtil.build(ExcelUtil.create(list, Warehouse.class), response); } } rsf-server/src/main/java/com/vincent/rsf/server/manager/entity/Container.java
@@ -51,14 +51,14 @@ /** * 容器类型标识 */ @ApiModelProperty(value= "容器类型标识") private Long typeId; @ApiModelProperty(value= "容器类型") private Long type; /** * 使用次数 */ @ApiModelProperty(value= "使用次数") private Double used; private Integer used; /** * 长度 @@ -180,10 +180,10 @@ public Container() {} public Container(String code,String name,Long typeId,Double used,Double lenght,Double width,Double height,Double rstLen,Double rstWid,Double rstWei,Double rstHei,Long panrentId,Date vaildTime,Short flagRycle,Short flagLogic,Integer status,Integer deleted,Integer tenantId,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo) { public Container(String code,String name,Long typeId,Integer used,Double lenght,Double width,Double height,Double rstLen,Double rstWid,Double rstWei,Double rstHei,Long panrentId,Date vaildTime,Short flagRycle,Short flagLogic,Integer status,Integer deleted,Integer tenantId,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo) { this.code = code; this.name = name; this.typeId = typeId; this.type = typeId; this.used = used; this.lenght = lenght; this.width = width; rsf-server/src/main/java/com/vincent/rsf/server/manager/entity/Loc.java
@@ -3,6 +3,8 @@ import com.baomidou.mybatisplus.annotation.*; import com.vincent.rsf.framework.common.Cools; import com.vincent.rsf.framework.common.SpringUtils; import com.vincent.rsf.server.manager.service.WarehouseAreasService; import com.vincent.rsf.server.manager.service.WarehouseService; import com.vincent.rsf.server.system.entity.User; import com.vincent.rsf.server.system.service.UserService; import io.swagger.annotations.ApiModelProperty; @@ -302,6 +304,26 @@ } } public String getWarehouseId$(){ if (null == this.warehouseId){ return null; } WarehouseService service = SpringUtils.getBean(WarehouseService.class); Warehouse warehouse = service.getById(this.warehouseId); if (!Cools.isEmpty(warehouse)){ return String.valueOf(warehouse.getName()); } return null; } public String getAreaId$(){ if (null == this.areaId){ return null; } WarehouseAreasService service = SpringUtils.getBean(WarehouseAreasService.class); WarehouseAreas warehouseAreas = service.getById(this.areaId); if (!Cools.isEmpty(warehouseAreas)){ return String.valueOf(warehouseAreas.getName()); } return null; } public String getStatus$(){ if (null == this.status){ return null; } switch (this.status){ rsf-server/src/main/java/com/vincent/rsf/server/manager/entity/WarehouseAreas.java
@@ -191,6 +191,15 @@ return null; } public String getSupplier$() { CompanysService service = SpringUtils.getBean(CompanysService.class); Companys supplier = service.getById(this.supplierId); if (!Cools.isEmpty(supplier)){ return String.valueOf(supplier.getName()); } return null; } public String getFlagMinus$(){ if (null == this.flagMinus){ return null; } switch (this.flagMinus){