2025-10-28 12:20:20 +08:00
|
|
|
|
package com.klp.controller;
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
|
|
|
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
import javax.validation.constraints.*;
|
|
|
|
|
|
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.WmsMaterialCoilVo;
|
|
|
|
|
|
import com.klp.domain.bo.WmsMaterialCoilBo;
|
|
|
|
|
|
import com.klp.service.IWmsMaterialCoilService;
|
|
|
|
|
|
import com.klp.common.core.page.TableDataInfo;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 钢卷物料表
|
|
|
|
|
|
*
|
|
|
|
|
|
* @author Joshi
|
|
|
|
|
|
* @date 2025-07-18
|
|
|
|
|
|
*/
|
|
|
|
|
|
@Validated
|
|
|
|
|
|
@RequiredArgsConstructor
|
|
|
|
|
|
@RestController
|
|
|
|
|
|
@RequestMapping("/wms/materialCoil")
|
|
|
|
|
|
public class WmsMaterialCoilController extends BaseController {
|
|
|
|
|
|
|
|
|
|
|
|
private final IWmsMaterialCoilService iWmsMaterialCoilService;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 查询钢卷物料表列表
|
|
|
|
|
|
*/
|
|
|
|
|
|
@GetMapping("/list")
|
|
|
|
|
|
public TableDataInfo<WmsMaterialCoilVo> list(WmsMaterialCoilBo bo, PageQuery pageQuery) {
|
|
|
|
|
|
return iWmsMaterialCoilService.queryPageList(bo, pageQuery);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 导出钢卷物料表列表
|
|
|
|
|
|
*/
|
|
|
|
|
|
@Log(title = "钢卷物料表", businessType = BusinessType.EXPORT)
|
|
|
|
|
|
@PostMapping("/export")
|
|
|
|
|
|
public void export(WmsMaterialCoilBo bo, HttpServletResponse response) {
|
|
|
|
|
|
List<WmsMaterialCoilVo> list = iWmsMaterialCoilService.queryList(bo);
|
|
|
|
|
|
ExcelUtil.exportExcel(list, "钢卷物料表", WmsMaterialCoilVo.class, response);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 获取钢卷物料表详细信息
|
|
|
|
|
|
*
|
|
|
|
|
|
* @param coilId 主键
|
|
|
|
|
|
*/
|
|
|
|
|
|
@GetMapping("/{coilId}")
|
|
|
|
|
|
public R<WmsMaterialCoilVo> getInfo(@NotNull(message = "主键不能为空")
|
2025-11-05 22:18:10 +08:00
|
|
|
|
@PathVariable("coilId") Long coilId) {
|
2025-10-28 12:20:20 +08:00
|
|
|
|
return R.ok(iWmsMaterialCoilService.queryById(coilId));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 新增钢卷物料表
|
|
|
|
|
|
*/
|
|
|
|
|
|
@Log(title = "钢卷物料表", businessType = BusinessType.INSERT)
|
|
|
|
|
|
@RepeatSubmit()
|
|
|
|
|
|
@PostMapping()
|
2025-11-17 10:47:36 +08:00
|
|
|
|
public R<WmsMaterialCoilVo> add(@Validated(AddGroup.class) @RequestBody WmsMaterialCoilBo bo) {
|
|
|
|
|
|
return R.ok(iWmsMaterialCoilService.insertByBo(bo));
|
2025-10-28 12:20:20 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 修改钢卷物料表
|
|
|
|
|
|
*/
|
|
|
|
|
|
@Log(title = "钢卷物料表", businessType = BusinessType.UPDATE)
|
|
|
|
|
|
@RepeatSubmit()
|
|
|
|
|
|
@PutMapping()
|
|
|
|
|
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WmsMaterialCoilBo bo) {
|
|
|
|
|
|
return toAjax(iWmsMaterialCoilService.updateByBo(bo));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 简单更新钢卷物料表
|
|
|
|
|
|
* 直接更新属性内容,不进行历史记录处理
|
|
|
|
|
|
*/
|
|
|
|
|
|
@Log(title = "钢卷物料表", businessType = BusinessType.UPDATE)
|
|
|
|
|
|
@RepeatSubmit()
|
|
|
|
|
|
@PutMapping("/update")
|
|
|
|
|
|
public R<Void> update(@Validated(EditGroup.class) @RequestBody WmsMaterialCoilBo bo) {
|
|
|
|
|
|
return toAjax(iWmsMaterialCoilService.updateSimple(bo));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 删除钢卷物料表
|
|
|
|
|
|
*
|
|
|
|
|
|
* @param coilIds 主键串
|
|
|
|
|
|
*/
|
|
|
|
|
|
@Log(title = "钢卷物料表", businessType = BusinessType.DELETE)
|
|
|
|
|
|
@DeleteMapping("/{coilIds}")
|
|
|
|
|
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
2025-11-05 22:18:10 +08:00
|
|
|
|
@PathVariable("coilIds") Long[] coilIds) {
|
2025-10-28 12:20:20 +08:00
|
|
|
|
return toAjax(iWmsMaterialCoilService.deleteWithValidByIds(Arrays.asList(coilIds), true));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 钢卷溯源查询
|
|
|
|
|
|
* 根据入场钢卷号查询二维码,解析content中的steps,然后根据steps中的钢卷号反向查询数据库
|
|
|
|
|
|
*
|
|
|
|
|
|
* @param enterCoilNo 入场钢卷号
|
|
|
|
|
|
* @param currentCoilNo 当前钢卷号(可选参数,用于查询特定子钢卷)
|
|
|
|
|
|
*/
|
|
|
|
|
|
@GetMapping("/trace")
|
|
|
|
|
|
public R<Map<String, Object>> trace(@RequestParam @NotBlank(message = "入场钢卷号不能为空") String enterCoilNo,
|
|
|
|
|
|
@RequestParam(required = false) String currentCoilNo) {
|
|
|
|
|
|
Map<String, Object> traceResult = iWmsMaterialCoilService.queryTrace(enterCoilNo, currentCoilNo);
|
|
|
|
|
|
return R.ok(traceResult);
|
|
|
|
|
|
}
|
2025-10-29 14:13:06 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 查询各个库区中不同类型的钢卷分布情况
|
2025-10-29 14:40:09 +08:00
|
|
|
|
* 按库区分组,统计每种物品类型和物品ID的钢卷数量和重量
|
2025-10-29 14:13:06 +08:00
|
|
|
|
*/
|
|
|
|
|
|
@GetMapping("/distributionByWarehouse")
|
2025-10-29 14:40:09 +08:00
|
|
|
|
public R<List<WmsMaterialCoilVo>> getDistributionByWarehouse(
|
|
|
|
|
|
@RequestParam(required = false) String itemType,
|
|
|
|
|
|
@RequestParam(required = false) Long itemId) {
|
|
|
|
|
|
List<WmsMaterialCoilVo> distribution = iWmsMaterialCoilService.getDistributionByWarehouse(itemType, itemId);
|
2025-10-29 14:13:06 +08:00
|
|
|
|
return R.ok(distribution);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-11-03 17:06:17 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 查询各个库区中不同类型的钢卷分布情况
|
|
|
|
|
|
* 按库区分组,统计每种物品类型和物品ID的钢卷数量和重量
|
|
|
|
|
|
*/
|
|
|
|
|
|
@GetMapping("/distributionByActualWarehouse")
|
|
|
|
|
|
public R<List<WmsMaterialCoilVo>> getDistributionByActualWarehouse(
|
|
|
|
|
|
@RequestParam(required = false) String itemType,
|
|
|
|
|
|
@RequestParam(required = false) Long itemId) {
|
|
|
|
|
|
List<WmsMaterialCoilVo> distribution = iWmsMaterialCoilService.getDistributionByActualWarehouse(itemType, itemId);
|
|
|
|
|
|
return R.ok(distribution);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-10-29 14:13:06 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 查询不同类型的钢卷在不同库区的分布情况
|
2025-10-29 14:40:09 +08:00
|
|
|
|
* 按物品类型和物品ID分组,统计每个库区的钢卷数量和重量
|
2025-10-29 14:13:06 +08:00
|
|
|
|
*/
|
|
|
|
|
|
@GetMapping("/distributionByItemType")
|
2025-10-29 14:40:09 +08:00
|
|
|
|
public R<List<WmsMaterialCoilVo>> getDistributionByItemType(
|
|
|
|
|
|
@RequestParam(required = false) String itemType,
|
|
|
|
|
|
@RequestParam(required = false) Long itemId) {
|
|
|
|
|
|
List<WmsMaterialCoilVo> distribution = iWmsMaterialCoilService.getDistributionByItemType(itemType, itemId);
|
2025-10-29 14:13:06 +08:00
|
|
|
|
return R.ok(distribution);
|
|
|
|
|
|
}
|
2025-11-17 17:57:57 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 查询不同类型的钢卷在不同库区的分布情况
|
|
|
|
|
|
* 按物品类型和物品ID分组,统计每个库区的钢卷数量和重量
|
|
|
|
|
|
*/
|
|
|
|
|
|
@GetMapping("/distributionByActualItemType")
|
|
|
|
|
|
public R<List<WmsMaterialCoilVo>> getDistributionByActualItemType(
|
|
|
|
|
|
@RequestParam(required = false) String itemType,
|
|
|
|
|
|
@RequestParam(required = false) Long itemId) {
|
|
|
|
|
|
List<WmsMaterialCoilVo> distribution = iWmsMaterialCoilService.getDistributionByActualItemType(itemType, itemId);
|
|
|
|
|
|
return R.ok(distribution);
|
|
|
|
|
|
}
|
2025-10-28 12:20:20 +08:00
|
|
|
|
}
|
|
|
|
|
|
|