|
|
|
@ -24,6 +24,57 @@ public class ProductionReturnController extends AbstractController { |
|
|
|
@Autowired |
|
|
|
private ProductionReturnService productionReturnService; |
|
|
|
|
|
|
|
/** |
|
|
|
* 申请单退仓:获取列表 |
|
|
|
*/ |
|
|
|
@PostMapping("getApplicationReturnList") |
|
|
|
public R getApplicationReturnList(@RequestBody Map<String, Object> params) { |
|
|
|
try { |
|
|
|
String site = (String) params.get("site"); |
|
|
|
String searchCode = (String) params.get("searchCode"); |
|
|
|
|
|
|
|
if (site == null || site.trim().isEmpty()) { |
|
|
|
return R.error("站点不能为空"); |
|
|
|
} |
|
|
|
|
|
|
|
List<Map<String, Object>> resultList = productionReturnService.getApplicationReturnList(site, searchCode); |
|
|
|
|
|
|
|
return R.ok().put("data", resultList); |
|
|
|
} catch (Exception e) { |
|
|
|
logger.error("获取申请单退仓列表失败", e); |
|
|
|
return R.error("获取数据失败: " + e.getMessage()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 申请单退仓:获取详情 |
|
|
|
*/ |
|
|
|
@PostMapping("getApplicationReturnDetails") |
|
|
|
public R getApplicationReturnDetails(@RequestBody Map<String, Object> params) { |
|
|
|
try { |
|
|
|
String site = (String) params.get("site"); |
|
|
|
String searchCode = (String) params.get("searchCode"); |
|
|
|
|
|
|
|
if (site == null || site.trim().isEmpty()) { |
|
|
|
return R.error("站点不能为空"); |
|
|
|
} |
|
|
|
if (searchCode == null || searchCode.trim().isEmpty()) { |
|
|
|
return R.error("查询条件不能为空"); |
|
|
|
} |
|
|
|
|
|
|
|
Map<String, Object> result = productionReturnService.getApplicationReturnDetails(site, searchCode); |
|
|
|
|
|
|
|
if (result == null || result.isEmpty()) { |
|
|
|
return R.error("未找到详情"); |
|
|
|
} |
|
|
|
|
|
|
|
return R.ok().put("data", result); |
|
|
|
} catch (Exception e) { |
|
|
|
logger.error("获取申请单退仓详情失败", e); |
|
|
|
return R.error("获取详情失败: " + e.getMessage()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取生产待入库列表 |
|
|
|
* 数据来源:inbound_notification_head表,关联SFDC_ROLLS表 |
|
|
|
@ -100,6 +151,11 @@ public class ProductionReturnController extends AbstractController { |
|
|
|
String buNo = (String) params.get("buNo"); |
|
|
|
String operationType = (String) params.get("operationType"); // I-添加 D-移除 |
|
|
|
String warehouseId = (String) params.get("warehouseId"); // 仓库ID |
|
|
|
String actionType = (String) params.get("actionType"); // 生产退仓 或 申请单退仓 |
|
|
|
|
|
|
|
if (actionType == null || actionType.trim().isEmpty()) { |
|
|
|
actionType = "生产退仓"; |
|
|
|
} |
|
|
|
|
|
|
|
if (labelCode == null || labelCode.trim().isEmpty()) { |
|
|
|
return R.error("标签条码不能为空"); |
|
|
|
@ -119,7 +175,7 @@ public class ProductionReturnController extends AbstractController { |
|
|
|
|
|
|
|
String userName = getUser().getUsername(); |
|
|
|
Map<String, Object> result = productionReturnService.validateLabelWithInbound( |
|
|
|
site, buNo, inboundNo, labelCode, operationType, userName, warehouseId); |
|
|
|
site, buNo, inboundNo, labelCode, operationType, userName, warehouseId, actionType); |
|
|
|
return R.ok().put("data", result); |
|
|
|
} catch (Exception e) { |
|
|
|
logger.error("生产标签验证失败", e); |
|
|
|
|