2025-11-25 15:44:19 +08:00
|
|
|
|
package com.klp.controller;
|
|
|
|
|
|
|
2025-11-26 09:38:22 +08:00
|
|
|
|
import java.util.Date;
|
2025-11-25 15:44:19 +08:00
|
|
|
|
import java.util.List;
|
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
|
|
2025-11-27 10:28:39 +08:00
|
|
|
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
2025-11-25 16:58:47 +08:00
|
|
|
|
import com.klp.domain.vo.WmsDeliveryPlanStatisticsVo;
|
2025-11-26 09:38:22 +08:00
|
|
|
|
import com.klp.domain.vo.WmsDeliveryReportVo;
|
2025-11-25 15:44:19 +08:00
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
import javax.validation.constraints.*;
|
2025-11-27 10:28:39 +08:00
|
|
|
|
|
|
|
|
|
|
import org.springframework.format.annotation.DateTimeFormat;
|
2025-11-25 15:44:19 +08:00
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
|
|
|
import com.klp.common.annotation.RepeatSubmit;
|
|
|
|
|
|
import com.klp.common.annotation.Log;
|
|
|
|
|
|
import com.klp.common.core.controller.BaseController;
|
|
|
|
|
|
import com.klp.common.core.domain.PageQuery;
|
|
|
|
|
|
import com.klp.common.core.domain.R;
|
|
|
|
|
|
import com.klp.common.core.validate.AddGroup;
|
|
|
|
|
|
import com.klp.common.core.validate.EditGroup;
|
|
|
|
|
|
import com.klp.common.enums.BusinessType;
|
|
|
|
|
|
import com.klp.common.utils.poi.ExcelUtil;
|
|
|
|
|
|
import com.klp.domain.vo.WmsDeliveryPlanVo;
|
|
|
|
|
|
import com.klp.domain.bo.WmsDeliveryPlanBo;
|
|
|
|
|
|
import com.klp.service.IWmsDeliveryPlanService;
|
|
|
|
|
|
import com.klp.common.core.page.TableDataInfo;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 发货计划
|
|
|
|
|
|
*
|
|
|
|
|
|
* @author klp
|
|
|
|
|
|
* @date 2025-11-25
|
|
|
|
|
|
*/
|
|
|
|
|
|
@Validated
|
|
|
|
|
|
@RequiredArgsConstructor
|
|
|
|
|
|
@RestController
|
|
|
|
|
|
@RequestMapping("/wms/deliveryPlan")
|
|
|
|
|
|
public class WmsDeliveryPlanController extends BaseController {
|
|
|
|
|
|
|
|
|
|
|
|
private final IWmsDeliveryPlanService iWmsDeliveryPlanService;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 查询发货计划列表
|
|
|
|
|
|
*/
|
|
|
|
|
|
@GetMapping("/list")
|
|
|
|
|
|
public TableDataInfo<WmsDeliveryPlanVo> list(WmsDeliveryPlanBo bo, PageQuery pageQuery) {
|
|
|
|
|
|
return iWmsDeliveryPlanService.queryPageList(bo, pageQuery);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 导出发货计划列表
|
|
|
|
|
|
*/
|
|
|
|
|
|
@Log(title = "发货计划", businessType = BusinessType.EXPORT)
|
|
|
|
|
|
@PostMapping("/export")
|
|
|
|
|
|
public void export(WmsDeliveryPlanBo bo, HttpServletResponse response) {
|
|
|
|
|
|
List<WmsDeliveryPlanVo> list = iWmsDeliveryPlanService.queryList(bo);
|
|
|
|
|
|
ExcelUtil.exportExcel(list, "发货计划", WmsDeliveryPlanVo.class, response);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 获取发货计划详细信息
|
|
|
|
|
|
*
|
|
|
|
|
|
* @param planId 主键
|
|
|
|
|
|
*/
|
|
|
|
|
|
@GetMapping("/{planId}")
|
|
|
|
|
|
public R<WmsDeliveryPlanVo> getInfo(@NotNull(message = "主键不能为空")
|
|
|
|
|
|
@PathVariable Long planId) {
|
|
|
|
|
|
return R.ok(iWmsDeliveryPlanService.queryById(planId));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 新增发货计划
|
|
|
|
|
|
*/
|
|
|
|
|
|
@Log(title = "发货计划", businessType = BusinessType.INSERT)
|
|
|
|
|
|
@RepeatSubmit()
|
|
|
|
|
|
@PostMapping()
|
|
|
|
|
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody WmsDeliveryPlanBo bo) {
|
|
|
|
|
|
return toAjax(iWmsDeliveryPlanService.insertByBo(bo));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 修改发货计划
|
|
|
|
|
|
*/
|
|
|
|
|
|
@Log(title = "发货计划", businessType = BusinessType.UPDATE)
|
|
|
|
|
|
@RepeatSubmit()
|
|
|
|
|
|
@PutMapping()
|
|
|
|
|
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WmsDeliveryPlanBo bo) {
|
|
|
|
|
|
return toAjax(iWmsDeliveryPlanService.updateByBo(bo));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 删除发货计划
|
|
|
|
|
|
*
|
|
|
|
|
|
* @param planIds 主键串
|
|
|
|
|
|
*/
|
|
|
|
|
|
@Log(title = "发货计划", businessType = BusinessType.DELETE)
|
|
|
|
|
|
@DeleteMapping("/{planIds}")
|
|
|
|
|
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
|
|
|
|
|
@PathVariable Long[] planIds) {
|
|
|
|
|
|
return toAjax(iWmsDeliveryPlanService.deleteWithValidByIds(Arrays.asList(planIds), true));
|
|
|
|
|
|
}
|
2025-11-25 16:58:47 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 获取发货计划统计信息
|
|
|
|
|
|
*
|
|
|
|
|
|
* @param planId 计划ID,可选
|
|
|
|
|
|
*/
|
|
|
|
|
|
@GetMapping("/statistics")
|
|
|
|
|
|
public R<List<WmsDeliveryPlanStatisticsVo>> getStatistics(@RequestParam(required = false) Long planId) {
|
|
|
|
|
|
List<WmsDeliveryPlanStatisticsVo> statistics = iWmsDeliveryPlanService.getDeliveryPlanStatistics(planId);
|
|
|
|
|
|
return R.ok(statistics);
|
|
|
|
|
|
}
|
2025-11-26 09:38:22 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 获取发货报表统计信息
|
|
|
|
|
|
*
|
|
|
|
|
|
* @param startTime 开始时间
|
|
|
|
|
|
* @param endTime 结束时间
|
|
|
|
|
|
*/
|
|
|
|
|
|
@GetMapping("/report")
|
|
|
|
|
|
public R<List<WmsDeliveryReportVo>> getDeliveryReport(
|
2025-11-27 10:28:39 +08:00
|
|
|
|
@RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date startTime,
|
|
|
|
|
|
@RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date endTime) {
|
2025-11-26 09:38:22 +08:00
|
|
|
|
List<WmsDeliveryReportVo> report = iWmsDeliveryPlanService.getDeliveryReport(startTime, endTime);
|
|
|
|
|
|
return R.ok(report);
|
|
|
|
|
|
}
|
2025-11-25 15:44:19 +08:00
|
|
|
|
}
|