Browse Source

2026-01-21

过站采集增价【打开】操作
master
fengyuan_yang 1 month ago
parent
commit
d0605f4be1
  1. 55
      src/main/java/com/gaotao/modules/schedule/controller/ScheduleController.java
  2. 7
      src/main/java/com/gaotao/modules/schedule/mapper/ScheduleMapper.java
  3. 12
      src/main/java/com/gaotao/modules/schedule/service/ScheduleService.java
  4. 32
      src/main/java/com/gaotao/modules/schedule/service/impl/ScheduleServiceImpl.java
  5. 14
      src/main/resources/mapper/schedule/ScheduleMapper.xml

55
src/main/java/com/gaotao/modules/schedule/controller/ScheduleController.java

@ -2121,4 +2121,59 @@ public class ScheduleController extends AbstractController {
.put("msg", "批量更新固定载具可用数量失败: " + e.getMessage());
}
}
/**
* @description: 打开材料卷重新激活已完成的材料
* @param params 请求参数包含siteseqNorollNohistSeqNotypeuserId
* @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());
}
}
}

7
src/main/java/com/gaotao/modules/schedule/mapper/ScheduleMapper.java

@ -776,4 +776,11 @@ public interface ScheduleMapper {
*/
Float getNewRollQtyByScan(@Param("site") String site, @Param("rollNo") String rollNo);
/**
* 调用存储过程 sfdcRollsOpsReportExecute
* 用于打开材料卷
* @param params 参数
*/
void callSfdcRollsOpsReportExecute(Map<String, Object> params);
}

12
src/main/java/com/gaotao/modules/schedule/service/ScheduleService.java

@ -1281,4 +1281,16 @@ public interface ScheduleService {
*/
void updateFixedCarrierBatch(List<Map<String, Object>> list);
/**
* @description: 打开材料卷重新激活已完成的材料
* @param site 站点
* @param seqNo 派工单号
* @param rollNo 材料卷号
* @param histSeqNo 序号
* @param type 操作类型
* @param userId 用户ID
* @return: 操作结果
*/
Map<String, Object> openMaterialRoll(String site, String seqNo, String rollNo, Integer histSeqNo, String type, String userId);
}

32
src/main/java/com/gaotao/modules/schedule/service/impl/ScheduleServiceImpl.java

@ -5659,4 +5659,36 @@ public class ScheduleServiceImpl implements ScheduleService {
throw new RuntimeException("批量更新固定载具可用数量失败: " + e.getMessage(), e);
}
}
/**
* @description: 打开材料卷重新激活已完成的材料
* 调用存储过程 sfdcRollsOpsReportExecute
*/
@Override
public Map<String, Object> openMaterialRoll(String site, String seqNo, String rollNo, Integer histSeqNo, String type, String userId) {
logger.info("打开材料卷,site: {}, seqNo: {}, rollNo: {}, histSeqNo: {}, type: {}, userId: {}",
site, seqNo, rollNo, histSeqNo, type, userId);
Map<String, Object> params = new HashMap<>();
params.put("site", site);
params.put("seqNo", seqNo);
params.put("rollNo", rollNo);
params.put("histSeqNo", histSeqNo);
params.put("type", type != null ? type : "open");
params.put("userId", userId);
// 调用存储过程
scheduleMapper.callSfdcRollsOpsReportExecute(params);
// 获取返回结果
String code = params.get("code") != null ? params.get("code").toString() : "400";
String message = params.get("message") != null ? params.get("message").toString() : "";
Map<String, Object> result = new HashMap<>();
result.put("code", code);
result.put("message", message);
logger.info("打开材料卷结果,code: {}, message: {}", code, message);
return result;
}
}

14
src/main/resources/mapper/schedule/ScheduleMapper.xml

@ -2042,4 +2042,18 @@
AND RollNo = #{rollNo}
</select>
<!-- 调用存储过程 sfdcRollsOpsReportExecute 用于打开材料卷 -->
<select id="callSfdcRollsOpsReportExecute" statementType="CALLABLE" parameterType="java.util.Map">
{call sfdcRollsOpsReportExecute(
#{site, mode=IN, jdbcType=VARCHAR},
#{seqNo, mode=IN, jdbcType=VARCHAR},
#{rollNo, mode=IN, jdbcType=VARCHAR},
#{histSeqNo, mode=IN, jdbcType=INTEGER},
#{type, mode=IN, jdbcType=VARCHAR},
#{userId, mode=IN, jdbcType=VARCHAR},
#{code, mode=OUT, jdbcType=VARCHAR},
#{message, mode=OUT, jdbcType=VARCHAR}
)}
</select>
</mapper>
Loading…
Cancel
Save