From 1d6bb3b9758a75dc5247d10e253d34f03ea7d2cc Mon Sep 17 00:00:00 2001 From: caoyizhong <1270296080@qq.com> Date: Thu, 10 Aug 2023 17:28:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=8F=AD=E7=BB=84=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/BasicdataTeamGroupEntity.java | 12 +++++- .../entity/BasicdataTeamStaffEntity.java | 29 +++++++++++++- .../BasicdataTeamGroupController.java | 2 +- .../BasicdataTeamStaffController.java | 2 +- .../BasicdataWarehouseController.java | 11 ++++++ .../service/IBasicdataTeamGroupService.java | 2 + .../service/IBasicdataTeamStaffService.java | 1 + .../service/IBasicdataWarehouseService.java | 3 ++ .../impl/BasicdataTeamGroupServiceImpl.java | 39 +++++++++++++++++++ .../impl/BasicdataTeamStaffServiceImpl.java | 39 +++++++++++++++++++ .../impl/BasicdataWarehouseServiceImpl.java | 11 ++++++ .../DistributionStockupController.java | 1 + 12 files changed, 147 insertions(+), 5 deletions(-) diff --git a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataTeamGroupEntity.java b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataTeamGroupEntity.java index a3e6389a4..0fbccd24d 100644 --- a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataTeamGroupEntity.java +++ b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataTeamGroupEntity.java @@ -71,11 +71,21 @@ public class BasicdataTeamGroupEntity extends TenantEntity { */ @ApiModelProperty(value = "仓库") private String belongTo; + /** + * 仓库名称 + */ + @ApiModelProperty(value = "仓库名称") + private String warehouseName; + /** + * 部门名称 + */ + @ApiModelProperty(value = "部门名称") + private String departmentName; /** * 班组类型 */ @ApiModelProperty(value = "班组类型") - private Integer groupType; + private String groupType; /** * 归属部门 */ diff --git a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataTeamStaffEntity.java b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataTeamStaffEntity.java index f0451e30d..01f537e14 100644 --- a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataTeamStaffEntity.java +++ b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataTeamStaffEntity.java @@ -65,7 +65,7 @@ public class BasicdataTeamStaffEntity extends TenantEntity { * 班组ID */ @ApiModelProperty(value = "班组ID") - private String teamGroupId; + private Long teamGroupId; /** * 姓名 */ @@ -80,6 +80,31 @@ public class BasicdataTeamStaffEntity extends TenantEntity { * 员工表ID */ @ApiModelProperty(value = "员工表ID") - private String staffId; + private Long staffId; + /** + * 班组名称 + */ + @ApiModelProperty(value = "班组名称") + private String teamGroupName; + /** + * 部门ID + */ + @ApiModelProperty(value = "部门ID") + private Long department; + /** + * 部门名称 + */ + @ApiModelProperty(value = "部门名称") + private String departmentName; + /** + * 仓库名称 + */ + @ApiModelProperty(value = "仓库名称") + private String warehouseName; + /** + * 部门ID + */ + @ApiModelProperty(value = "部门ID") + private Long warehouseId; } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataTeamGroupController.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataTeamGroupController.java index 26a8c1dd6..25554fecd 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataTeamGroupController.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataTeamGroupController.java @@ -128,7 +128,7 @@ public class BasicdataTeamGroupController extends BladeController { @ApiOperationSupport(order = 6) @ApiOperation(value = "新增或修改", notes = "传入basicdataTeamGroup") public R submit(@Valid @RequestBody BasicdataTeamGroupEntity basicdataTeamGroup) { - return R.status(basicdataTeamGroupService.saveOrUpdate(basicdataTeamGroup)); + return R.status(basicdataTeamGroupService.saveOrUpdateOwn(basicdataTeamGroup)); } /** diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataTeamStaffController.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataTeamStaffController.java index 6c0f36fcc..039e27042 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataTeamStaffController.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataTeamStaffController.java @@ -117,7 +117,7 @@ public class BasicdataTeamStaffController extends BladeController { @ApiOperationSupport(order = 6) @ApiOperation(value = "新增或修改", notes = "传入basicdataTeamStaff") public R submit(@Valid @RequestBody BasicdataTeamStaffEntity basicdataTeamStaff) { - return R.status(basicdataTeamStaffService.saveOrUpdate(basicdataTeamStaff)); + return R.status(basicdataTeamStaffService.saveOrUpdateOwn(basicdataTeamStaff)); } /** diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataWarehouseController.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataWarehouseController.java index 8957fb603..798e6b057 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataWarehouseController.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataWarehouseController.java @@ -72,6 +72,17 @@ public class BasicdataWarehouseController extends BladeController { return R.data(detail); } + /** + * 查询部门下的仓库 + */ + @GetMapping("/deptWarehouse") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入warehouseWarehouse") + public R> getDeptWarehouse(BasicdataWarehouseEntity basicdataWarehouseEntity) { + List detail = warehouseService.getDeptWarehouse(Condition.getQueryWrapper(basicdataWarehouseEntity)); + return R.data(detail); + } + /** * 仓库 分页 */ diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataTeamGroupService.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataTeamGroupService.java index 5e40a5e6a..df3f6164e 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataTeamGroupService.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataTeamGroupService.java @@ -59,4 +59,6 @@ public interface IBasicdataTeamGroupService extends BaseService getListTeamInfo(String params); + + Boolean saveOrUpdateOwn(BasicdataTeamGroupEntity basicdataTeamGroup); } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataTeamStaffService.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataTeamStaffService.java index 0f9f26840..57cd44834 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataTeamStaffService.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataTeamStaffService.java @@ -49,4 +49,5 @@ public interface IBasicdataTeamStaffService extends BaseService exportBasicdataTeamStaff(Wrapper queryWrapper); + Boolean saveOrUpdateOwn(BasicdataTeamStaffEntity basicdataTeamStaff); } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataWarehouseService.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataWarehouseService.java index 7b0d48986..51bcdb4e1 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataWarehouseService.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataWarehouseService.java @@ -18,6 +18,7 @@ package com.logpm.basicdata.service; import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.logpm.basicdata.entity.BasicdataWarehouseEntity; import com.logpm.basicdata.excel.BasicdataWarehouseExcel; @@ -85,4 +86,6 @@ public interface IBasicdataWarehouseService extends BaseService selectWarehouseWarehouseDictionary(); + + List getDeptWarehouse(QueryWrapper queryWrapper); } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataTeamGroupServiceImpl.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataTeamGroupServiceImpl.java index 408ac0acd..f325c8b8c 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataTeamGroupServiceImpl.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataTeamGroupServiceImpl.java @@ -18,12 +18,19 @@ package com.logpm.basicdata.service.impl; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; +import com.baomidou.mybatisplus.core.toolkit.StringUtils; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.fasterxml.jackson.annotation.JsonFormat; import com.logpm.basicdata.entity.BasicdataTeamGroupEntity; +import com.logpm.basicdata.entity.BasicdataWarehouseEntity; +import com.logpm.basicdata.service.IBasicdataWarehouseService; import com.logpm.basicdata.vo.BasicdataTeamGroupVO; import com.logpm.basicdata.excel.BasicdataTeamGroupExcel; import com.logpm.basicdata.mapper.BasicdataTeamGroupMapper; import com.logpm.basicdata.service.IBasicdataTeamGroupService; +import lombok.AllArgsConstructor; +import org.springblade.core.log.exception.ServiceException; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -38,8 +45,10 @@ import java.util.Map; * @since 2023-06-16 */ @Service +@AllArgsConstructor public class BasicdataTeamGroupServiceImpl extends BaseServiceImpl implements IBasicdataTeamGroupService { + private final IBasicdataWarehouseService basicdataWarehouseService; @Override public IPage selectBasicdataTeamGroupPage(IPage page, BasicdataTeamGroupVO basicdataTeamGroup) { return page.setRecords(baseMapper.selectBasicdataTeamGroupPage(page, basicdataTeamGroup)); @@ -66,4 +75,34 @@ public class BasicdataTeamGroupServiceImpl extends BaseServiceImplquery().lambda().eq(BasicdataWarehouseEntity::getId, basicdataTeamGroup.getBelongTo())); + if(ObjectUtils.isNull(one)){ + throw new ServiceException("仓库数据异常!!"); + } + //查询部门信息 + if(ObjectUtils.isNotNull(basicdataTeamGroup.getId())){ + //修改 + basicdataTeamGroup.setDepartment(one.getDepartment()); + basicdataTeamGroup.setDepartmentName(one.getDepartmentName()); + this.updateById(basicdataTeamGroup); + return true; + }else{ + //新增 + basicdataTeamGroup.setDepartment(one.getDepartment()); + basicdataTeamGroup.setDepartmentName(one.getDepartmentName()); + this.save(basicdataTeamGroup); + return true; + } + } + } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataTeamStaffServiceImpl.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataTeamStaffServiceImpl.java index 869102cba..a8f7933d1 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataTeamStaffServiceImpl.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataTeamStaffServiceImpl.java @@ -16,11 +16,17 @@ */ package com.logpm.basicdata.service.impl; +import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.logpm.basicdata.entity.BasicdataTeamStaffEntity; +import com.logpm.basicdata.entity.BasicdataWarehouseEntity; +import com.logpm.basicdata.service.IBasicdataWarehouseService; import com.logpm.basicdata.vo.BasicdataTeamStaffVO; import com.logpm.basicdata.excel.BasicdataTeamStaffExcel; import com.logpm.basicdata.mapper.BasicdataTeamStaffMapper; import com.logpm.basicdata.service.IBasicdataTeamStaffService; +import lombok.AllArgsConstructor; +import org.springblade.core.log.exception.ServiceException; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -34,8 +40,11 @@ import java.util.List; * @since 2023-06-16 */ @Service +@AllArgsConstructor public class BasicdataTeamStaffServiceImpl extends BaseServiceImpl implements IBasicdataTeamStaffService { + private final IBasicdataWarehouseService basicdataWarehouseService; + @Override public IPage selectBasicdataTeamStaffPage(IPage page, BasicdataTeamStaffVO basicdataTeamStaff) { return page.setRecords(baseMapper.selectBasicdataTeamStaffPage(page, basicdataTeamStaff)); @@ -51,4 +60,34 @@ public class BasicdataTeamStaffServiceImpl extends BaseServiceImplquery().lambda().eq(BasicdataWarehouseEntity::getId, basicdataTeamStaff.getWarehouseId())); + if(ObjectUtils.isNull(one)){ + throw new ServiceException("仓库数据异常!!"); + } + if(ObjectUtils.isNotNull(basicdataTeamStaff.getId())){ + //修改 + basicdataTeamStaff.setDepartment(one.getDepartment()); + basicdataTeamStaff.setDepartmentName(one.getDepartmentName()); + this.updateById(basicdataTeamStaff); + return true; + }else{ + //添加 + basicdataTeamStaff.setDepartment(one.getDepartment()); + basicdataTeamStaff.setDepartmentName(one.getDepartmentName()); + this.save(basicdataTeamStaff); + return true; + } + + } + } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataWarehouseServiceImpl.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataWarehouseServiceImpl.java index d02fad357..ceb559b20 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataWarehouseServiceImpl.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataWarehouseServiceImpl.java @@ -111,4 +111,15 @@ public class BasicdataWarehouseServiceImpl extends BaseServiceImpl getDeptWarehouse(QueryWrapper queryWrapper) { + + return baseMapper.selectList(queryWrapper); + } + } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockupController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockupController.java index 41d096ee2..79fdd8a67 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockupController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockupController.java @@ -139,6 +139,7 @@ public class DistributionStockupController extends BladeController { BladeUser u = new BladeUser(); u.setDeptId(user.getDeptId()); u.setTenantId(user.getTenantId()); + u.setUserId(user.getUserId()); u.setUserName(user.getUserName()); return R.data(u); }