Browse Source

feat(all): 仓库租赁成本统计

1 调整成本功能
fix-sign
zhaoqiaobo 4 months ago
parent
commit
60f29f1459
  1. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/WarehouseLeasingClient.java
  2. 78
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/ExpenseWarehouseDayController.java
  3. 2
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/job/ExpenseJob.java

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

@ -45,8 +45,8 @@ public class WarehouseLeasingClient implements IWarehouseLeasingClient {
public List<WarehouseLeasingEntity> findListByWarehouseIds(List<Long> ids, String contractDate) {
List<WarehouseLeasingEntity> list = leasingService.list(Wrappers.<WarehouseLeasingEntity>lambdaQuery()
.in(WarehouseLeasingEntity::getWarehouseId, ids)
.ge(WarehouseLeasingEntity::getLeaseCommencementDate, contractDate)
.le(WarehouseLeasingEntity::getLeaseCommencementDate, contractDate)
.ge(WarehouseLeasingEntity::getLeaseTerminationDate, contractDate)
);
if (CollUtil.isNotEmpty(list)) {
return list;

78
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/ExpenseWarehouseDayController.java

@ -64,27 +64,6 @@ public class ExpenseWarehouseDayController extends BladeController {
private final IExpenseWarehouseDayService expenseWarehouseDayService;
/**
* 日仓储成本统计表 详情
*/
@GetMapping("/detail")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "详情", notes = "传入expenseWarehouseDay")
public R<ExpenseWarehouseDayVO> detail(ExpenseWarehouseDayEntity expenseWarehouseDay) {
ExpenseWarehouseDayEntity detail = expenseWarehouseDayService.getOne(Condition.getQueryWrapper(expenseWarehouseDay));
return R.data(ExpenseWarehouseDayWrapper.build().entityVO(detail));
}
/**
* 日仓储成本统计表 分页
*/
@GetMapping("/list")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "传入expenseWarehouseDay")
public R<IPage<ExpenseWarehouseDayVO>> list(@ApiIgnore @RequestParam Map<String, Object> expenseWarehouseDay, Query query) {
IPage<ExpenseWarehouseDayEntity> pages = expenseWarehouseDayService.page(Condition.getPage(query), Condition.getQueryWrapper(expenseWarehouseDay, ExpenseWarehouseDayEntity.class));
return R.data(ExpenseWarehouseDayWrapper.build().pageVO(pages));
}
/**
* 日仓储成本统计表 自定义分页
*/
@ -96,61 +75,4 @@ public class ExpenseWarehouseDayController extends BladeController {
return R.data(pages);
}
/**
* 日仓储成本统计表 新增
*/
@PostMapping("/save")
@ApiOperationSupport(order = 4)
@ApiOperation(value = "新增", notes = "传入expenseWarehouseDay")
public R save(@Valid @RequestBody ExpenseWarehouseDayEntity expenseWarehouseDay) {
return R.status(expenseWarehouseDayService.save(expenseWarehouseDay));
}
/**
* 日仓储成本统计表 修改
*/
@PostMapping("/update")
@ApiOperationSupport(order = 5)
@ApiOperation(value = "修改", notes = "传入expenseWarehouseDay")
public R update(@Valid @RequestBody ExpenseWarehouseDayEntity expenseWarehouseDay) {
return R.status(expenseWarehouseDayService.updateById(expenseWarehouseDay));
}
/**
* 日仓储成本统计表 新增或修改
*/
@PostMapping("/submit")
@ApiOperationSupport(order = 6)
@ApiOperation(value = "新增或修改", notes = "传入expenseWarehouseDay")
public R submit(@Valid @RequestBody ExpenseWarehouseDayEntity expenseWarehouseDay) {
return R.status(expenseWarehouseDayService.saveOrUpdate(expenseWarehouseDay));
}
/**
* 日仓储成本统计表 删除
*/
@PostMapping("/remove")
@ApiOperationSupport(order = 7)
@ApiOperation(value = "逻辑删除", notes = "传入ids")
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
return R.status(expenseWarehouseDayService.deleteLogic(Func.toLongList(ids)));
}
/**
* 导出数据
*/
@GetMapping("/export-expenseWarehouseDay")
@ApiOperationSupport(order = 9)
@ApiOperation(value = "导出数据", notes = "传入expenseWarehouseDay")
public void exportExpenseWarehouseDay(@ApiIgnore @RequestParam Map<String, Object> expenseWarehouseDay, BladeUser bladeUser, HttpServletResponse response) {
QueryWrapper<ExpenseWarehouseDayEntity> queryWrapper = Condition.getQueryWrapper(expenseWarehouseDay, ExpenseWarehouseDayEntity.class);
//if (!AuthUtil.isAdministrator()) {
// queryWrapper.lambda().eq(ExpenseWarehouseDay::getTenantId, bladeUser.getTenantId());
//}
queryWrapper.lambda().eq(ExpenseWarehouseDayEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
List<ExpenseWarehouseDayExcel> list = expenseWarehouseDayService.exportExpenseWarehouseDay(queryWrapper);
ExcelUtil.export(response, "日仓储成本统计表数据" + DateUtil.time(), "日仓储成本统计表数据表", list, ExpenseWarehouseDayExcel.class);
}
}

2
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/job/ExpenseJob.java

@ -266,7 +266,7 @@ public class ExpenseJob {
private void initWarehouseBasicInfo(ExpenseWarehouseDayEntity entity, BasicdataWarehouseEntity warehouse, DateTime statisticsTime) {
entity.setCostSettlementYear(Convert.toStr(DateUtil.year(statisticsTime)));
entity.setCostSettlementMonth(Convert.toStr(DateUtil.month(statisticsTime)));
entity.setCostSettlementMonth(Convert.toStr(DateUtil.month(statisticsTime)) + 1);
entity.setCostSettlementDay(Convert.toStr(DateUtil.dayOfMonth(statisticsTime)));
entity.setCostSettlement(DateUtil.formatDate(statisticsTime));
entity.setWarehouseName(warehouse.getName());

Loading…
Cancel
Save