Browse Source

修改班组添加

training
caoyizhong 1 year ago
parent
commit
1d6bb3b975
  1. 12
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataTeamGroupEntity.java
  2. 29
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataTeamStaffEntity.java
  3. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataTeamGroupController.java
  4. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataTeamStaffController.java
  5. 11
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataWarehouseController.java
  6. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataTeamGroupService.java
  7. 1
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataTeamStaffService.java
  8. 3
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataWarehouseService.java
  9. 39
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataTeamGroupServiceImpl.java
  10. 39
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataTeamStaffServiceImpl.java
  11. 11
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataWarehouseServiceImpl.java
  12. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockupController.java

12
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 = "仓库") @ApiModelProperty(value = "仓库")
private String belongTo; private String belongTo;
/**
* 仓库名称
*/
@ApiModelProperty(value = "仓库名称")
private String warehouseName;
/**
* 部门名称
*/
@ApiModelProperty(value = "部门名称")
private String departmentName;
/** /**
* 班组类型 * 班组类型
*/ */
@ApiModelProperty(value = "班组类型") @ApiModelProperty(value = "班组类型")
private Integer groupType; private String groupType;
/** /**
* 归属部门 * 归属部门
*/ */

29
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 * 班组ID
*/ */
@ApiModelProperty(value = "班组ID") @ApiModelProperty(value = "班组ID")
private String teamGroupId; private Long teamGroupId;
/** /**
* 姓名 * 姓名
*/ */
@ -80,6 +80,31 @@ public class BasicdataTeamStaffEntity extends TenantEntity {
* 员工表ID * 员工表ID
*/ */
@ApiModelProperty(value = "员工表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;
} }

2
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) @ApiOperationSupport(order = 6)
@ApiOperation(value = "新增或修改", notes = "传入basicdataTeamGroup") @ApiOperation(value = "新增或修改", notes = "传入basicdataTeamGroup")
public R submit(@Valid @RequestBody BasicdataTeamGroupEntity basicdataTeamGroup) { public R submit(@Valid @RequestBody BasicdataTeamGroupEntity basicdataTeamGroup) {
return R.status(basicdataTeamGroupService.saveOrUpdate(basicdataTeamGroup)); return R.status(basicdataTeamGroupService.saveOrUpdateOwn(basicdataTeamGroup));
} }
/** /**

2
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) @ApiOperationSupport(order = 6)
@ApiOperation(value = "新增或修改", notes = "传入basicdataTeamStaff") @ApiOperation(value = "新增或修改", notes = "传入basicdataTeamStaff")
public R submit(@Valid @RequestBody BasicdataTeamStaffEntity basicdataTeamStaff) { public R submit(@Valid @RequestBody BasicdataTeamStaffEntity basicdataTeamStaff) {
return R.status(basicdataTeamStaffService.saveOrUpdate(basicdataTeamStaff)); return R.status(basicdataTeamStaffService.saveOrUpdateOwn(basicdataTeamStaff));
} }
/** /**

11
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); return R.data(detail);
} }
/**
* 查询部门下的仓库
*/
@GetMapping("/deptWarehouse")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "详情", notes = "传入warehouseWarehouse")
public R<List<BasicdataWarehouseEntity>> getDeptWarehouse(BasicdataWarehouseEntity basicdataWarehouseEntity) {
List<BasicdataWarehouseEntity> detail = warehouseService.getDeptWarehouse(Condition.getQueryWrapper(basicdataWarehouseEntity));
return R.data(detail);
}
/** /**
* 仓库 分页 * 仓库 分页
*/ */

2
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataTeamGroupService.java

@ -59,4 +59,6 @@ public interface IBasicdataTeamGroupService extends BaseService<BasicdataTeamGro
* @return * @return
*/ */
List<BasicdataTeamGroupEntity> getListTeamInfo(String params); List<BasicdataTeamGroupEntity> getListTeamInfo(String params);
Boolean saveOrUpdateOwn(BasicdataTeamGroupEntity basicdataTeamGroup);
} }

1
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataTeamStaffService.java

@ -49,4 +49,5 @@ public interface IBasicdataTeamStaffService extends BaseService<BasicdataTeamSta
*/ */
List<BasicdataTeamStaffExcel> exportBasicdataTeamStaff(Wrapper<BasicdataTeamStaffEntity> queryWrapper); List<BasicdataTeamStaffExcel> exportBasicdataTeamStaff(Wrapper<BasicdataTeamStaffEntity> queryWrapper);
Boolean saveOrUpdateOwn(BasicdataTeamStaffEntity basicdataTeamStaff);
} }

3
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.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity; import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.excel.BasicdataWarehouseExcel; import com.logpm.basicdata.excel.BasicdataWarehouseExcel;
@ -85,4 +86,6 @@ public interface IBasicdataWarehouseService extends BaseService<BasicdataWarehou
* @return * @return
*/ */
List<BasicdataWarehouseVO> selectWarehouseWarehouseDictionary(); List<BasicdataWarehouseVO> selectWarehouseWarehouseDictionary();
List<BasicdataWarehouseEntity> getDeptWarehouse(QueryWrapper<BasicdataWarehouseEntity> queryWrapper);
} }

39
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.JSON;
import com.alibaba.fastjson.JSONObject; 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.fasterxml.jackson.annotation.JsonFormat;
import com.logpm.basicdata.entity.BasicdataTeamGroupEntity; 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.vo.BasicdataTeamGroupVO;
import com.logpm.basicdata.excel.BasicdataTeamGroupExcel; import com.logpm.basicdata.excel.BasicdataTeamGroupExcel;
import com.logpm.basicdata.mapper.BasicdataTeamGroupMapper; import com.logpm.basicdata.mapper.BasicdataTeamGroupMapper;
import com.logpm.basicdata.service.IBasicdataTeamGroupService; import com.logpm.basicdata.service.IBasicdataTeamGroupService;
import lombok.AllArgsConstructor;
import org.springblade.core.log.exception.ServiceException;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
@ -38,8 +45,10 @@ import java.util.Map;
* @since 2023-06-16 * @since 2023-06-16
*/ */
@Service @Service
@AllArgsConstructor
public class BasicdataTeamGroupServiceImpl extends BaseServiceImpl<BasicdataTeamGroupMapper, BasicdataTeamGroupEntity> implements IBasicdataTeamGroupService { public class BasicdataTeamGroupServiceImpl extends BaseServiceImpl<BasicdataTeamGroupMapper, BasicdataTeamGroupEntity> implements IBasicdataTeamGroupService {
private final IBasicdataWarehouseService basicdataWarehouseService;
@Override @Override
public IPage<BasicdataTeamGroupVO> selectBasicdataTeamGroupPage(IPage<BasicdataTeamGroupVO> page, BasicdataTeamGroupVO basicdataTeamGroup) { public IPage<BasicdataTeamGroupVO> selectBasicdataTeamGroupPage(IPage<BasicdataTeamGroupVO> page, BasicdataTeamGroupVO basicdataTeamGroup) {
return page.setRecords(baseMapper.selectBasicdataTeamGroupPage(page, basicdataTeamGroup)); return page.setRecords(baseMapper.selectBasicdataTeamGroupPage(page, basicdataTeamGroup));
@ -66,4 +75,34 @@ public class BasicdataTeamGroupServiceImpl extends BaseServiceImpl<BasicdataTeam
return baseMapper.getListTeamInfo(params); return baseMapper.getListTeamInfo(params);
} }
/**
*
* @param basicdataTeamGroup
* @return
*/
@Override
public Boolean saveOrUpdateOwn(BasicdataTeamGroupEntity basicdataTeamGroup) {
if(ObjectUtils.isNull(basicdataTeamGroup.getBelongTo())){
throw new ServiceException("参数异常!!");
}
BasicdataWarehouseEntity one = basicdataWarehouseService.getOne(Wrappers.<BasicdataWarehouseEntity>query().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;
}
}
} }

39
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataTeamStaffServiceImpl.java

@ -16,11 +16,17 @@
*/ */
package com.logpm.basicdata.service.impl; 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.BasicdataTeamStaffEntity;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.service.IBasicdataWarehouseService;
import com.logpm.basicdata.vo.BasicdataTeamStaffVO; import com.logpm.basicdata.vo.BasicdataTeamStaffVO;
import com.logpm.basicdata.excel.BasicdataTeamStaffExcel; import com.logpm.basicdata.excel.BasicdataTeamStaffExcel;
import com.logpm.basicdata.mapper.BasicdataTeamStaffMapper; import com.logpm.basicdata.mapper.BasicdataTeamStaffMapper;
import com.logpm.basicdata.service.IBasicdataTeamStaffService; import com.logpm.basicdata.service.IBasicdataTeamStaffService;
import lombok.AllArgsConstructor;
import org.springblade.core.log.exception.ServiceException;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
@ -34,8 +40,11 @@ import java.util.List;
* @since 2023-06-16 * @since 2023-06-16
*/ */
@Service @Service
@AllArgsConstructor
public class BasicdataTeamStaffServiceImpl extends BaseServiceImpl<BasicdataTeamStaffMapper, BasicdataTeamStaffEntity> implements IBasicdataTeamStaffService { public class BasicdataTeamStaffServiceImpl extends BaseServiceImpl<BasicdataTeamStaffMapper, BasicdataTeamStaffEntity> implements IBasicdataTeamStaffService {
private final IBasicdataWarehouseService basicdataWarehouseService;
@Override @Override
public IPage<BasicdataTeamStaffVO> selectBasicdataTeamStaffPage(IPage<BasicdataTeamStaffVO> page, BasicdataTeamStaffVO basicdataTeamStaff) { public IPage<BasicdataTeamStaffVO> selectBasicdataTeamStaffPage(IPage<BasicdataTeamStaffVO> page, BasicdataTeamStaffVO basicdataTeamStaff) {
return page.setRecords(baseMapper.selectBasicdataTeamStaffPage(page, basicdataTeamStaff)); return page.setRecords(baseMapper.selectBasicdataTeamStaffPage(page, basicdataTeamStaff));
@ -51,4 +60,34 @@ public class BasicdataTeamStaffServiceImpl extends BaseServiceImpl<BasicdataTeam
return basicdataTeamStaffList; return basicdataTeamStaffList;
} }
/**
*
* @param basicdataTeamStaff
* @return
*/
@Override
public Boolean saveOrUpdateOwn(BasicdataTeamStaffEntity basicdataTeamStaff) {
if(ObjectUtils.isNull(basicdataTeamStaff)){
throw new ServiceException("参数不全!!");
}
BasicdataWarehouseEntity one = basicdataWarehouseService.getOne(Wrappers.<BasicdataWarehouseEntity>query().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;
}
}
} }

11
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataWarehouseServiceImpl.java

@ -111,4 +111,15 @@ public class BasicdataWarehouseServiceImpl extends BaseServiceImpl<BasicdataWare
return baseMapper.selectWarehouseWarehouseDictionary(); return baseMapper.selectWarehouseWarehouseDictionary();
} }
/**
* 部门下的仓库
* @param queryWrapper
* @return
*/
@Override
public List<BasicdataWarehouseEntity> getDeptWarehouse(QueryWrapper<BasicdataWarehouseEntity> queryWrapper) {
return baseMapper.selectList(queryWrapper);
}
} }

1
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(); BladeUser u = new BladeUser();
u.setDeptId(user.getDeptId()); u.setDeptId(user.getDeptId());
u.setTenantId(user.getTenantId()); u.setTenantId(user.getTenantId());
u.setUserId(user.getUserId());
u.setUserName(user.getUserName()); u.setUserName(user.getUserName());
return R.data(u); return R.data(u);
} }

Loading…
Cancel
Save