|
|
|
@ -2121,4 +2121,59 @@ public class ScheduleController extends AbstractController { |
|
|
|
.put("msg", "批量更新固定载具可用数量失败: " + e.getMessage()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @description: 打开材料卷(重新激活已完成的材料) |
|
|
|
* @param params 请求参数,包含site、seqNo、rollNo、histSeqNo、type、userId |
|
|
|
* @return: com.gaotao.common.utils.R |
|
|
|
*/ |
|
|
|
@PostMapping("openMaterialRoll") |
|
|
|
public R openMaterialRoll(@RequestBody Map<String, Object> params) { |
|
|
|
try { |
|
|
|
String site = (String) params.get("site"); |
|
|
|
String seqNo = (String) params.get("seqNo"); |
|
|
|
String rollNo = (String) params.get("rollNo"); |
|
|
|
Integer histSeqNo = params.get("histSeqNo") != null ? Integer.valueOf(params.get("histSeqNo").toString()) : null; |
|
|
|
String type = (String) params.get("type"); |
|
|
|
String userId = (String) params.get("userId"); |
|
|
|
|
|
|
|
// 参数校验 |
|
|
|
if (site == null || site.isEmpty()) { |
|
|
|
return R.error("站点不能为空").put("code", 400); |
|
|
|
} |
|
|
|
if (seqNo == null || seqNo.isEmpty()) { |
|
|
|
return R.error("派工单号不能为空").put("code", 400); |
|
|
|
} |
|
|
|
if (rollNo == null || rollNo.isEmpty()) { |
|
|
|
return R.error("材料卷号不能为空").put("code", 400); |
|
|
|
} |
|
|
|
if (histSeqNo == null) { |
|
|
|
return R.error("序号不能为空").put("code", 400); |
|
|
|
} |
|
|
|
if (userId == null || userId.isEmpty()) { |
|
|
|
return R.error("用户ID不能为空").put("code", 400); |
|
|
|
} |
|
|
|
|
|
|
|
// 调用Service执行存储过程 |
|
|
|
Map<String, Object> result = scheduleService.openMaterialRoll(site, seqNo, rollNo, histSeqNo, type, userId); |
|
|
|
|
|
|
|
String resultCode = result.get("code") != null ? result.get("code").toString() : "400"; |
|
|
|
String resultMessage = result.get("message") != null ? result.get("message").toString() : ""; |
|
|
|
|
|
|
|
if ("200".equals(resultCode)) { |
|
|
|
return R.ok() |
|
|
|
.put("code", 0) |
|
|
|
.put("message", resultMessage.isEmpty() ? "操作成功" : resultMessage); |
|
|
|
} else { |
|
|
|
return R.error(resultMessage.isEmpty() ? "操作失败" : resultMessage) |
|
|
|
.put("code", 400) |
|
|
|
.put("message", resultMessage.isEmpty() ? "操作失败" : resultMessage); |
|
|
|
} |
|
|
|
} catch (Exception e) { |
|
|
|
logger.error("打开材料卷失败", e); |
|
|
|
return R.error("操作失败: " + e.getMessage()) |
|
|
|
.put("code", 400) |
|
|
|
.put("message", "操作失败: " + e.getMessage()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |