Merge remote-tracking branch 'origin/0.8.X' into 0.8.X
This commit is contained in:
@@ -0,0 +1,94 @@
|
||||
package com.klp.controller;
|
||||
|
||||
import com.klp.common.core.controller.BaseController;
|
||||
import com.klp.common.core.domain.R;
|
||||
import com.klp.domain.DrMillProcessRecipe;
|
||||
import com.klp.domain.DrMillProcessRecipeVersion;
|
||||
import com.klp.service.IDrMillProcessRecipeService;
|
||||
import com.klp.service.IDrMillProcessRecipeVersionService;
|
||||
import com.klp.service.impl.DrRecipeSyncService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/dr/mill/recipe")
|
||||
public class DrMillProcessRecipeController extends BaseController {
|
||||
|
||||
private final IDrMillProcessRecipeService recipeService;
|
||||
private final IDrMillProcessRecipeVersionService versionService;
|
||||
private final DrRecipeSyncService syncService;
|
||||
|
||||
// ─── 方案 ────────────────────────────────────────────────
|
||||
|
||||
@GetMapping("/list")
|
||||
public R<List<DrMillProcessRecipe>> list(DrMillProcessRecipe query) {
|
||||
List<DrMillProcessRecipe> list = recipeService.selectList(query);
|
||||
// 每次查询时补齐缺失的 L3 工艺规程(幂等,已存在则跳过)
|
||||
syncService.syncRecipesToSpec(list);
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
@GetMapping("/{id}")
|
||||
public R<DrMillProcessRecipe> detail(@PathVariable Long id) {
|
||||
return R.ok(recipeService.selectDetailById(id));
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
public R<Long> add(@RequestBody DrMillProcessRecipe recipe) {
|
||||
recipeService.save(recipe);
|
||||
// 新增方案后立即同步 L3 工艺规程
|
||||
syncService.syncRecipesToSpec(Collections.singletonList(recipe));
|
||||
return R.ok(recipe.getRecipeId());
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
public R<Void> edit(@RequestBody DrMillProcessRecipe recipe) {
|
||||
recipeService.update(recipe);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@PathVariable Long[] ids) {
|
||||
recipeService.deleteByIds(ids);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
// ─── 版本 ────────────────────────────────────────────────
|
||||
|
||||
@GetMapping("/version/list/{recipeId}")
|
||||
public R<List<DrMillProcessRecipeVersion>> versionList(@PathVariable Long recipeId) {
|
||||
return R.ok(versionService.listByRecipeId(recipeId));
|
||||
}
|
||||
|
||||
@GetMapping("/version/{versionId}")
|
||||
public R<DrMillProcessRecipeVersion> versionDetail(@PathVariable Long versionId) {
|
||||
return R.ok(versionService.getDetailById(versionId));
|
||||
}
|
||||
|
||||
@PostMapping("/version")
|
||||
public R<Long> addVersion(@RequestBody DrMillProcessRecipeVersion version) {
|
||||
return R.ok(versionService.save(version));
|
||||
}
|
||||
|
||||
@PutMapping("/version")
|
||||
public R<Void> editVersion(@RequestBody DrMillProcessRecipeVersion version) {
|
||||
versionService.update(version);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@PutMapping("/version/activate/{versionId}")
|
||||
public R<Void> activate(@PathVariable Long versionId) {
|
||||
versionService.activate(versionId);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@DeleteMapping("/version/{versionId}")
|
||||
public R<Void> deleteVersion(@PathVariable Long versionId) {
|
||||
versionService.deleteById(versionId);
|
||||
return R.ok();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
package com.klp.controller;
|
||||
|
||||
import com.klp.common.core.controller.BaseController;
|
||||
import com.klp.common.core.domain.R;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.domain.DrMillProductionPlan;
|
||||
import com.klp.service.IDrMillProductionPlanService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 双机架生产计划管理
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/dr/mill/plan")
|
||||
public class DrMillProductionPlanController extends BaseController {
|
||||
|
||||
private final IDrMillProductionPlanService planService;
|
||||
|
||||
@GetMapping("/list")
|
||||
public R<List<DrMillProductionPlan>> list(DrMillProductionPlan query) {
|
||||
return R.ok(planService.selectList(query));
|
||||
}
|
||||
|
||||
/** 实绩分页查询(按创建时间倒序,支持卷号/状态/时间范围过滤) */
|
||||
@GetMapping("/actual/page")
|
||||
public TableDataInfo<DrMillProductionPlan> actualPage(DrMillProductionPlan query) {
|
||||
return planService.selectPageList(query);
|
||||
}
|
||||
|
||||
@GetMapping("/{id}")
|
||||
public R<DrMillProductionPlan> detail(@PathVariable Long id) {
|
||||
return R.ok(planService.selectById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过待操作ID查询绑定计划(含道次),供录入页快捷写入
|
||||
* planNo = "DR" + actionId
|
||||
*/
|
||||
@GetMapping("/byAction/{actionId}")
|
||||
public R<DrMillProductionPlan> getByActionId(@PathVariable Long actionId) {
|
||||
return R.ok(planService.selectByActionId(actionId));
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
public R<Void> add(@RequestBody DrMillProductionPlan plan) {
|
||||
planService.insert(plan);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
public R<Void> edit(@RequestBody DrMillProductionPlan plan) {
|
||||
planService.update(plan);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@DeleteMapping("/{id}")
|
||||
public R<Void> remove(@PathVariable Long id) {
|
||||
planService.deleteById(id);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@PutMapping("/moveUp/{id}")
|
||||
public R<Void> moveUp(@PathVariable Long id) {
|
||||
planService.moveUp(id);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@PutMapping("/moveDown/{id}")
|
||||
public R<Void> moveDown(@PathVariable Long id) {
|
||||
planService.moveDown(id);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@PutMapping("/finish/{id}")
|
||||
public R<Void> finish(@PathVariable Long id) {
|
||||
planService.finish(id);
|
||||
return R.ok();
|
||||
}
|
||||
}
|
||||
@@ -607,6 +607,16 @@ public class WmsMaterialCoilController extends BaseController {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据入场钢卷号或当前钢卷号查询钢卷信息,供双机架计划绑定使用
|
||||
*
|
||||
* @param coilNo 入场钢卷号或当前钢卷号
|
||||
*/
|
||||
@GetMapping("/queryByCoilNo")
|
||||
public R<com.klp.domain.vo.WmsMaterialCoilVo> queryByCoilNo(@NotBlank(message = "钢卷号不能为空") @RequestParam String coilNo) {
|
||||
return R.ok(iWmsMaterialCoilService.queryByCoilNo(coilNo));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 冷硬卷切边统计
|
||||
|
||||
Reference in New Issue
Block a user