Browse Source

修改备货多个角色不能选择

training
caoyizhong 2 years ago
parent
commit
4a69ae2d2a
  1. 8
      blade-service/logpm-distribution/pom.xml
  2. 34
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java
  3. 15
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockupController.java
  4. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockupService.java
  5. 28
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java

8
blade-service/logpm-distribution/pom.xml

@ -104,8 +104,12 @@
<artifactId>logpm-old-project-api</artifactId> <artifactId>logpm-old-project-api</artifactId>
<version>${bladex.project.version}</version> <version>${bladex.project.version}</version>
</dependency> </dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-system-api</artifactId>
<version>3.1.0.RELEASE</version>
<scope>compile</scope>
</dependency>
</dependencies> </dependencies>

34
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java

@ -384,14 +384,14 @@ public class DistributionStockupAppController extends BladeController {
return R.fail(3002, "备货库存品ID不能为空"); return R.fail(3002, "备货库存品ID不能为空");
} }
List<DistributionStockupTrayVO> list = distributionStockupService.getLocationSelection(stockupDTO); List<DistributionStockupTrayVO> list = distributionStockupService.getLocationSelection(stockupDTO);
if(!list.isEmpty()){ if(!list.isEmpty() && ObjectUtils.isNotNull(list.get(0))){
return R.data(list); return R.data(list);
} }
List<DistributionStockupTrayVO> listMarket = distributionStockupService.getLocationMarketSelection(stockupDTO); List<DistributionStockupTrayVO> listMarket = distributionStockupService.getLocationMarketSelection(stockupDTO);
if(!listMarket.isEmpty()){ if(!listMarket.isEmpty() && ObjectUtils.isNotNull(listMarket.size())){
return R.data(listMarket); return R.data(listMarket);
} }
return R.data(null); return R.fail(3002,"当前物料未上架,请上架后在继续备货操作!!!");
} }
@ -594,7 +594,17 @@ public class DistributionStockupAppController extends BladeController {
log.warn("##################allocationId: 货位ID为空!"); log.warn("##################allocationId: 货位ID为空!");
return R.fail("货位ID不能为空"); return R.fail("货位ID不能为空");
} }
//判断是否可以继续备货
DistributionStockListEntity byId = iDistributionStockListService.getById(stockListId);
WarehouseUpdownGoodsEntity warehouseUpdownGoodsEntity = new WarehouseUpdownGoodsEntity();
warehouseUpdownGoodsEntity.setAllocationId(stockupDTO.getAllocationId());
warehouseUpdownGoodsEntity.setIncomingBatch(byId.getIncomingBatch());
warehouseUpdownGoodsEntity.setMarketId(byId.getMarketId());
warehouseUpdownGoodsEntity.setAssociationType("4");
WarehouseUpdownGoodsEntity locationInformation = warehouseUpdownGoodsClient.getLocationStockListInformation(warehouseUpdownGoodsEntity);
if(ObjectUtils.isNull(locationInformation)){
return Resp.scanFail("当前货位的本物料已为0,请更换货位继续!!", "当前货位的本物料已为0,请更换货位继续!!");
}
Integer i = distributionStockupService.selectPackagePrint(stockupDTO); Integer i = distributionStockupService.selectPackagePrint(stockupDTO);
switch (i) { switch (i) {
case 1: case 1:
@ -617,16 +627,16 @@ public class DistributionStockupAppController extends BladeController {
entity.setReservationId(reservationId); entity.setReservationId(reservationId);
entity.setStockListId(stockListId); entity.setStockListId(stockListId);
//添加物料信息 //添加物料信息
DistributionStockListEntity byId = iDistributionStockListService.getById(stockListId); // DistributionStockListEntity byId = iDistributionStockListService.getById(stockListId);
if(ObjectUtils.isNotNull(byId.getMarketId())){ if(ObjectUtils.isNotNull(byId.getMarketId())){
entity.setMarketId(byId.getMarketId()); entity.setMarketId(byId.getMarketId());
entity.setMaterialId(byId.getMaterialId()); entity.setMaterialId(byId.getMaterialId());
WarehouseUpdownGoodsEntity warehouseUpdownGoodsEntity = new WarehouseUpdownGoodsEntity(); // WarehouseUpdownGoodsEntity warehouseUpdownGoodsEntity = new WarehouseUpdownGoodsEntity();
warehouseUpdownGoodsEntity.setAllocationId(stockupDTO.getAllocationId()); // warehouseUpdownGoodsEntity.setAllocationId(stockupDTO.getAllocationId());
warehouseUpdownGoodsEntity.setIncomingBatch(byId.getIncomingBatch()); // warehouseUpdownGoodsEntity.setIncomingBatch(byId.getIncomingBatch());
warehouseUpdownGoodsEntity.setMarketId(byId.getMarketId()); // warehouseUpdownGoodsEntity.setMarketId(byId.getMarketId());
warehouseUpdownGoodsEntity.setAssociationType("4"); // warehouseUpdownGoodsEntity.setAssociationType("4");
WarehouseUpdownGoodsEntity locationInformation = warehouseUpdownGoodsClient.getLocationStockListInformation(warehouseUpdownGoodsEntity); // WarehouseUpdownGoodsEntity locationInformation = warehouseUpdownGoodsClient.getLocationStockListInformation(warehouseUpdownGoodsEntity);
if(!ObjectUtils.isNull(locationInformation)){ if(!ObjectUtils.isNull(locationInformation)){
entity.setAllocationTitle(locationInformation.getPositionCode()); entity.setAllocationTitle(locationInformation.getPositionCode());
entity.setAllocationId(stockupDTO.getAllocationId()); entity.setAllocationId(stockupDTO.getAllocationId());
@ -645,7 +655,7 @@ public class DistributionStockupAppController extends BladeController {
return R.fail(3002,"本货位的物料已为0,请更换货位继续!!"); return R.fail(3002,"本货位的物料已为0,请更换货位继续!!");
} }
}else{ }else{
return R.fail(3002,"物料信息查询失败,请联系TJJ!!"); return Resp.scanFail("物料信息查询失败,请联系TJJ!!", "物料信息查询失败,请联系TJJ!!");
} }
entity.setConditions("0"); entity.setConditions("0");
entity.setType(2); entity.setType(2);

15
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockupController.java

@ -43,6 +43,7 @@ import org.springblade.core.tool.constant.BladeConstant;
import org.springblade.core.tool.utils.DateUtil; import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.ObjectUtil; import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.system.entity.User;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore; import springfox.documentation.annotations.ApiIgnore;
@ -171,19 +172,11 @@ public class DistributionStockupController extends BladeController {
@GetMapping("/listUser") @GetMapping("/listUser")
@ApiOperationSupport(order = 2) @ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "传入distributionStockup") @ApiOperation(value = "分页", notes = "传入distributionStockup")
public R<BladeUser> listUser() { public R<List<User>> listUser() {
//获取当前登录用户 //获取当前登录用户
BladeUser user = AuthUtil.getUser(); BladeUser user = AuthUtil.getUser();
BladeUser u = new BladeUser(); List<User> cc = distributionStockupService.getRoleList(user.getDeptId(), user.getTenantId(), "叉车");
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse(); return R.data(cc);
if(ObjectUtil.isNotEmpty(myCurrentWarehouse)){
}
u.setDeptId(user.getDeptId());
u.setTenantId(user.getTenantId());
u.setUserId(user.getUserId());
u.setUserName(user.getUserName());
return R.data(u);
} }
/** /**

6
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockupService.java

@ -24,6 +24,7 @@ import com.logpm.distribution.excel.DistributionStockupExcel;
import com.logpm.distribution.vo.*; import com.logpm.distribution.vo.*;
import org.springblade.core.mp.base.BaseService; import org.springblade.core.mp.base.BaseService;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.system.entity.User;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -194,4 +195,9 @@ public interface IDistributionStockupService extends BaseService<DistributionSto
* @return * @return
*/ */
List<DistributionStockupTrayVO> getLocationMarketSelection(StockupDTO stockupDTO); List<DistributionStockupTrayVO> getLocationMarketSelection(StockupDTO stockupDTO);
/**
* @return
*/
List<User> getRoleList(String deptId, String tenantId, String roleNames);
} }

28
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java

@ -55,6 +55,9 @@ import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.StringUtil; import org.springblade.core.tool.utils.StringUtil;
import org.springblade.system.cache.DictBizCache; import org.springblade.system.cache.DictBizCache;
import org.springblade.system.entity.User;
import org.springblade.system.feign.ISysClient;
import org.springblade.system.feign.IUserSearchClient;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.Lazy;
@ -85,6 +88,12 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
@Autowired @Autowired
private IDistributionDeliveryDetailsService distributionDeliveryDetailsService; private IDistributionDeliveryDetailsService distributionDeliveryDetailsService;
@Autowired
private ISysClient sysClient;
@Autowired
private IUserSearchClient userSearchClient;
@Autowired @Autowired
private IDistributionReservationStocklistService distributionReservationStocklistService; private IDistributionReservationStocklistService distributionReservationStocklistService;
@ -1775,4 +1784,23 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
return baseMapper.getLocationMarketSelection(stockupDTO); return baseMapper.getLocationMarketSelection(stockupDTO);
} }
/**
* @return
*/
@Override
public List<User> getRoleList(String deptId, String tenantId, String roleNames) {
R<String> roleIds = sysClient.getRoleIds(tenantId, roleNames);
R<List<User>> listR = userSearchClient.listByRole(roleIds.getData());
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
if(ObjectUtils.isNotNull(myCurrentWarehouse)){
List<User> collect = listR.getData().stream().filter(i ->
ObjectUtils.isNotNull(i.getDeptId()) ? i.getDeptId().equals(myCurrentWarehouse.getDepartment().toString()) : false
).collect(Collectors.toList());
return collect;
}else{
return listR.getData();
}
}
} }

Loading…
Cancel
Save