Browse Source

BUG修改

master
parent
commit
de61a5450c
  1. 17
      win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/controller/item/ItemController.java
  2. 5
      win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/controller/item/vo/ItemBaseVO.java
  3. 4
      win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/controller/item/vo/ItemExcelVO.java
  4. 4
      win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/controller/item/vo/ItemExportReqVO.java
  5. 4
      win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/controller/item/vo/ItemImportExcelVo.java
  6. 4
      win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/controller/item/vo/ItemImportVO.java
  7. 4
      win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/controller/item/vo/ItemPageReqVO.java
  8. 3
      win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/controller/item/vo/ItemRespVO.java
  9. 7
      win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/dal/dataobject/item/ItemDO.java
  10. 18
      win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/service/item/ItemService.java
  11. 45
      win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/service/item/ItemServiceImpl.java

17
win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/controller/item/ItemController.java

@ -217,4 +217,21 @@ public class ItemController {
return success(returnMap);
}
@GetMapping("/warningPage")
@Operation(summary = "获得备件分页")
// @PreAuthorize("@ss.hasPermission('basic:item:query')")
public CommonResult<PageResult<ItemRespVO>> getItemWarningPage(@Valid ItemPageReqVO pageVO) {
PageResult<ItemDO> pageResult = itemService.getWarningPage(pageVO);
return success(ItemConvert.INSTANCE.convertPage(pageResult));
}
@PostMapping("/warningSenior")
@Operation(summary = "高级搜索获得账期日历分页")
// @PreAuthorize("@ss.hasPermission('wms:item:query')")
public CommonResult<PageResult<ItemRespVO>> getItemWarningSenior(@Valid @RequestBody CustomConditions conditions) {
PageResult<ItemDO> pageResult = itemService.getItemWarningSenior(conditions);
PageResult<ItemRespVO> result = ItemConvert.INSTANCE.convertPage(pageResult);
return success(result);
}
}

5
win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/controller/item/vo/ItemBaseVO.java

@ -34,10 +34,10 @@ public class ItemBaseVO {
private String brand;
@Schema(description = "最高库存")
private Integer maxInventory;
private BigDecimal maxInventory;
@Schema(description = "最低库存")
private Integer minInventory;
private BigDecimal minInventory;
@Schema(description = "采购周期(周)")
private Integer procurementCycle;
@ -64,7 +64,6 @@ public class ItemBaseVO {
private String available;
@Schema(description = "并发乐观锁", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "并发乐观锁不能为空")
private Integer concurrencyStamp;
}

4
win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/controller/item/vo/ItemExcelVO.java

@ -40,10 +40,10 @@ public class ItemExcelVO {
private String brand;
@ExcelProperty("最高库存")
private Integer maxInventory;
private BigDecimal maxInventory;
@ExcelProperty("最低库存")
private Integer minInventory;
private BigDecimal minInventory;
@ExcelProperty("采购周期(周)")
private Integer procurementCycle;

4
win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/controller/item/vo/ItemExportReqVO.java

@ -33,10 +33,10 @@ public class ItemExportReqVO {
private String brand;
@Schema(description = "最高库存")
private Integer maxInventory;
private BigDecimal maxInventory;
@Schema(description = "最低库存")
private Integer minInventory;
private BigDecimal minInventory;
@Schema(description = "采购周期(周)")
private Integer procurementCycle;

4
win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/controller/item/vo/ItemImportExcelVo.java

@ -35,10 +35,10 @@ public class ItemImportExcelVo {
private String brand;
@ExcelProperty("最高库存")
private Integer maxInventory;
private BigDecimal maxInventory;
@ExcelProperty("最低库存")
private Integer minInventory;
private BigDecimal minInventory;
@ExcelProperty("采购周期(周)")
private Integer procurementCycle;

4
win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/controller/item/vo/ItemImportVO.java

@ -39,10 +39,10 @@ public class ItemImportVO {
private String brand;
@ExcelProperty("最高库存")
private Integer maxInventory;
private BigDecimal maxInventory;
@ExcelProperty("最低库存")
private Integer minInventory;
private BigDecimal minInventory;
@ExcelProperty("采购周期(周)")
private Integer procurementCycle;

4
win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/controller/item/vo/ItemPageReqVO.java

@ -37,10 +37,10 @@ public class ItemPageReqVO extends PageParam {
private String brand;
@Schema(description = "最高库存")
private Integer maxInventory;
private BigDecimal maxInventory;
@Schema(description = "最低库存")
private Integer minInventory;
private BigDecimal minInventory;
@Schema(description = "采购周期(周)")
private Integer procurementCycle;

3
win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/controller/item/vo/ItemRespVO.java

@ -21,4 +21,7 @@ public class ItemRespVO extends ItemBaseVO {
@Schema(description = "创建时间")
private LocalDateTime createTime;
@Schema(description = "库存总数量")
private BigDecimal allCount;
}

7
win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/dal/dataobject/item/ItemDO.java

@ -58,11 +58,11 @@ public class ItemDO extends BaseDO {
/**
* 最高库存
*/
private Integer maxInventory;
private BigDecimal maxInventory;
/**
* 最低库存
*/
private Integer minInventory;
private BigDecimal minInventory;
/**
* 采购周期
*/
@ -149,6 +149,9 @@ public class ItemDO extends BaseDO {
@TableField(exist = false)
private List<Map<String,Object>> list;
@TableField(exist = false)
private BigDecimal allCount;
}

18
win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/service/item/ItemService.java

@ -134,5 +134,21 @@ public interface ItemService {
*/
ItemDO getByNumber(String number);
public List<ItemImportErrorVO> importItemList(List<ItemImportExcelVo> importItembasics, Integer mode, boolean updatePart);
List<ItemImportErrorVO> importItemList(List<ItemImportExcelVo> importItembasics, Integer mode, boolean updatePart);
/**
* 获得备件库存预警库存
*
* @param pageReqVO 分页查询
* @return 备件分页
*/
PageResult<ItemDO> getWarningPage(ItemPageReqVO pageReqVO);
/**
* 获得用高级搜索库位分页列表
*
* @param conditions 分页排序和自定义条件
* @return 分页列表
*/
PageResult<ItemDO> getItemWarningSenior(CustomConditions conditions);
}

45
win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/service/item/ItemServiceImpl.java

@ -315,5 +315,50 @@ public class ItemServiceImpl implements ItemService {
return itemMapper.selectOne(queryWrapper);
}
@Override
public PageResult<ItemDO> getWarningPage(ItemPageReqVO pageReqVO) {
PageResult<ItemDO> pageResult = itemMapper.selectPage(pageReqVO);
List<ItemDO> itemNewList=new ArrayList();
for (ItemDO itemDO : pageResult.getList()) {
QueryWrapper<ItemAccountsDO> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("item_number",itemDO.getNumber());
queryWrapper.eq("available","TRUE");
List<ItemAccountsDO> itemAccountsDOList = itemAccountsMapper.selectList(queryWrapper);
BigDecimal allCount = BigDecimal.ZERO;
for (ItemAccountsDO itemAccountsDO : itemAccountsDOList) {
allCount=allCount.add(itemAccountsDO.getQty());
}
//如果各种类型的备件库存数量总数低于最低库存数量
if(allCount.compareTo(itemDO.getMinInventory())==-1){
itemDO.setAllCount(allCount);
itemNewList.add(itemDO);
}
}
pageResult.setList(itemNewList);
pageResult.setTotal(Long.valueOf(itemNewList.size()).longValue());
return pageResult;
}
@Override
public PageResult<ItemDO> getItemWarningSenior(CustomConditions conditions) {
PageResult<ItemDO> pageResult = itemMapper.getItemSenior(conditions);
for (ItemDO itemDO : pageResult.getList()) {
QueryWrapper<ItemAccountsDO> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("item_number",itemDO.getNumber());
queryWrapper.eq("available","TRUE");
List<ItemAccountsDO> itemAccountsDOList = itemAccountsMapper.selectList(queryWrapper);
BigDecimal allCount = BigDecimal.ZERO;
for (ItemAccountsDO itemAccountsDO : itemAccountsDOList) {
allCount=allCount.add(itemAccountsDO.getQty());
}
//如果各种类型的备件库存数量总数低于最低库存数量
if(allCount.compareTo(itemDO.getMinInventory())>=0){
pageResult.getList().remove(itemDO);
}else {
itemDO.setAllCount(allCount);
}
}
return pageResult;
}
}

Loading…
Cancel
Save