|
|
|
@ -2,7 +2,9 @@ package com.spring.ifs.controller; |
|
|
|
|
|
|
|
import com.spring.ifs.bean.*; |
|
|
|
import com.spring.ifs.data.*; |
|
|
|
import com.spring.modules.part.entity.APIEntity.PartIfsInventory; |
|
|
|
import com.spring.modules.part.entity.APIEntity.RecipeIfsAlternative; |
|
|
|
import com.spring.modules.part.entity.APIEntity.RecipeIfsHeader; |
|
|
|
import com.spring.modules.part.entity.APIEntity.RecipeIfsItem; |
|
|
|
import ifs.fnd.ap.APException; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.web.bind.annotation.PostMapping; |
|
|
|
@ -10,6 +12,7 @@ import org.springframework.web.bind.annotation.RequestBody; |
|
|
|
import org.springframework.web.bind.annotation.RequestMapping; |
|
|
|
import org.springframework.web.bind.annotation.RestController; |
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
@ -32,6 +35,8 @@ public class TestIfsController { |
|
|
|
private TechnicalClassBeanTest technicalClassBean; |
|
|
|
@Autowired |
|
|
|
private ToolServiceBeanTest toolServiceBean; |
|
|
|
@Autowired |
|
|
|
private RecipeServiceBeanTest recipeServiceBean; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -1722,4 +1727,298 @@ public class TestIfsController { |
|
|
|
return resultMap; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @description: 获取Recipe Header |
|
|
|
* @author LR |
|
|
|
* @date 2024/12/17 14:04 |
|
|
|
* @version 1.0 |
|
|
|
*/ |
|
|
|
@PostMapping("/getRecipeHeader") |
|
|
|
public Object getRecipeHeader(@RequestBody RecipeIfsHeader inData) throws APException { |
|
|
|
Map<String, Object> resultMap = new HashMap<String, Object>(); |
|
|
|
try { |
|
|
|
Map<String, String> returnMap = recipeServiceBean.getRecipeHeader(inData); |
|
|
|
resultMap.put("returnMap", returnMap); |
|
|
|
resultMap.put("code", 200); |
|
|
|
resultMap.put("msg", "操作成功!"); |
|
|
|
} catch (Exception e) { |
|
|
|
resultMap.put("code", 400); |
|
|
|
resultMap.put("msg", e.getMessage()); |
|
|
|
} |
|
|
|
return resultMap; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @description: 新增Recipe Header |
|
|
|
* @author LR |
|
|
|
* @date 2024/12/18 11:28 |
|
|
|
* @version 1.0 |
|
|
|
*/ |
|
|
|
@PostMapping("/syncRecipeHeader") |
|
|
|
public Object syncRecipeHeader(@RequestBody RecipeIfsHeader inData) throws APException { |
|
|
|
Map<String, Object> resultMap = new HashMap<String, Object>(); |
|
|
|
try { |
|
|
|
Map<String, String> returnMap = recipeServiceBean.syncRecipeHeader(inData); |
|
|
|
resultMap.put("returnMap", returnMap); |
|
|
|
resultMap.put("code", 200); |
|
|
|
resultMap.put("msg", "操作成功!"); |
|
|
|
} catch (Exception e) { |
|
|
|
resultMap.put("code", 400); |
|
|
|
resultMap.put("msg", e.getMessage()); |
|
|
|
} |
|
|
|
return resultMap; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @description: 修改Recipe Header |
|
|
|
* @author LR |
|
|
|
* @date 2024/12/18 11:28 |
|
|
|
* @version 1.0 |
|
|
|
*/ |
|
|
|
@PostMapping("/modifyRecipeHeader") |
|
|
|
public Object modifyRecipeHeader(@RequestBody RecipeIfsHeader inData) throws APException { |
|
|
|
Map<String, Object> resultMap = new HashMap<String, Object>(); |
|
|
|
try { |
|
|
|
Map<String, String> returnMap = recipeServiceBean.modifyRecipeHeader(inData); |
|
|
|
resultMap.put("returnMap", returnMap); |
|
|
|
resultMap.put("code", 200); |
|
|
|
resultMap.put("msg", "操作成功!"); |
|
|
|
} catch (Exception e) { |
|
|
|
resultMap.put("code", 400); |
|
|
|
resultMap.put("msg", e.getMessage()); |
|
|
|
} |
|
|
|
return resultMap; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @description: 修改Recipe Header |
|
|
|
* @author LR |
|
|
|
* @date 2024/12/18 11:28 |
|
|
|
* @version 1.0 |
|
|
|
*/ |
|
|
|
@PostMapping("/removeRecipeHeader") |
|
|
|
public Object removeRecipeHeader(@RequestBody RecipeIfsHeader inData) throws APException { |
|
|
|
Map<String, Object> resultMap = new HashMap<String, Object>(); |
|
|
|
try { |
|
|
|
Map<String, String> returnMap = recipeServiceBean.removeRecipeHeader(inData); |
|
|
|
resultMap.put("returnMap", returnMap); |
|
|
|
resultMap.put("code", 200); |
|
|
|
resultMap.put("msg", "操作成功!"); |
|
|
|
} catch (Exception e) { |
|
|
|
resultMap.put("code", 400); |
|
|
|
resultMap.put("msg", e.getMessage()); |
|
|
|
} |
|
|
|
return resultMap; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @description: 获取Recipe Alternative |
|
|
|
* @author LR |
|
|
|
* @date 2024/12/17 14:04 |
|
|
|
* @version 1.0 |
|
|
|
*/ |
|
|
|
@PostMapping("/getRecipeAlternative") |
|
|
|
public Object getRecipeAlternative(@RequestBody RecipeIfsAlternative inData) throws APException { |
|
|
|
Map<String, Object> resultMap = new HashMap<String, Object>(); |
|
|
|
try { |
|
|
|
Map<String, String> returnMap = recipeServiceBean.getRecipeAlternative(inData); |
|
|
|
resultMap.put("returnMap", returnMap); |
|
|
|
resultMap.put("code", 200); |
|
|
|
resultMap.put("msg", "操作成功!"); |
|
|
|
} catch (Exception e) { |
|
|
|
resultMap.put("code", 400); |
|
|
|
resultMap.put("msg", e.getMessage()); |
|
|
|
} |
|
|
|
return resultMap; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @description: 同步Recipe Alternative |
|
|
|
* @author LR |
|
|
|
* @date 2024/12/18 13:37 |
|
|
|
* @version 1.0 |
|
|
|
*/ |
|
|
|
@PostMapping("/syncRecipeAlternative") |
|
|
|
public Object syncRecipeAlternative(@RequestBody RecipeIfsAlternative inData) throws APException { |
|
|
|
Map<String, Object> resultMap = new HashMap<String, Object>(); |
|
|
|
try { |
|
|
|
Map<String, String> returnMap = recipeServiceBean.syncRecipeAlternative(inData); |
|
|
|
resultMap.put("returnMap", returnMap); |
|
|
|
resultMap.put("code", 200); |
|
|
|
resultMap.put("msg", "操作成功!"); |
|
|
|
} catch (Exception e) { |
|
|
|
resultMap.put("code", 400); |
|
|
|
resultMap.put("msg", e.getMessage()); |
|
|
|
} |
|
|
|
return resultMap; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @description: 修改Recipe Alternative |
|
|
|
* @author LR |
|
|
|
* @date 2024/12/18 13:37 |
|
|
|
* @version 1.0 |
|
|
|
*/ |
|
|
|
@PostMapping("/modifyRecipeAlternative") |
|
|
|
public Object modifyRecipeAlternative(@RequestBody RecipeIfsAlternative inData) throws APException { |
|
|
|
Map<String, Object> resultMap = new HashMap<String, Object>(); |
|
|
|
try { |
|
|
|
Map<String, String> returnMap = recipeServiceBean.modifyRecipeAlternative(inData); |
|
|
|
resultMap.put("returnMap", returnMap); |
|
|
|
resultMap.put("code", 200); |
|
|
|
resultMap.put("msg", "操作成功!"); |
|
|
|
} catch (Exception e) { |
|
|
|
resultMap.put("code", 400); |
|
|
|
resultMap.put("msg", e.getMessage()); |
|
|
|
} |
|
|
|
return resultMap; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @description: 删除Recipe Alternative |
|
|
|
* @author LR |
|
|
|
* @date 2024/12/18 13:37 |
|
|
|
* @version 1.0 |
|
|
|
*/ |
|
|
|
@PostMapping("/removeRecipeAlternative") |
|
|
|
public Object removeRecipeAlternative(@RequestBody RecipeIfsAlternative inData) throws APException { |
|
|
|
Map<String, Object> resultMap = new HashMap<String, Object>(); |
|
|
|
try { |
|
|
|
Map<String, String> returnMap = recipeServiceBean.removeRecipeAlternative(inData); |
|
|
|
resultMap.put("returnMap", returnMap); |
|
|
|
resultMap.put("code", 200); |
|
|
|
resultMap.put("msg", "操作成功!"); |
|
|
|
} catch (Exception e) { |
|
|
|
resultMap.put("code", 400); |
|
|
|
resultMap.put("msg", e.getMessage()); |
|
|
|
} |
|
|
|
return resultMap; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @description: Build Recipe Alternative |
|
|
|
* @author LR |
|
|
|
* @date 2024/12/18 13:47 |
|
|
|
* @version 1.0 |
|
|
|
*/ |
|
|
|
@PostMapping("/buildRecipeAlternative") |
|
|
|
public Object buildRecipeAlternative(@RequestBody RecipeIfsAlternative inData) throws APException { |
|
|
|
Map<String, Object> resultMap = new HashMap<String, Object>(); |
|
|
|
try { |
|
|
|
Map<String, String> returnMap = recipeServiceBean.buildRecipeAlternative(inData); |
|
|
|
resultMap.put("returnMap", returnMap); |
|
|
|
resultMap.put("code", 200); |
|
|
|
resultMap.put("msg", "操作成功!"); |
|
|
|
} catch (Exception e) { |
|
|
|
resultMap.put("code", 400); |
|
|
|
resultMap.put("msg", e.getMessage()); |
|
|
|
} |
|
|
|
return resultMap; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @description: Retire Recipe Alternative |
|
|
|
* @author LR |
|
|
|
* @date 2024/12/18 13:47 |
|
|
|
* @version 1.0 |
|
|
|
*/ |
|
|
|
@PostMapping("/retireRecipeAlternative") |
|
|
|
public Object retireRecipeAlternative(@RequestBody RecipeIfsAlternative inData) throws APException { |
|
|
|
Map<String, Object> resultMap = new HashMap<String, Object>(); |
|
|
|
try { |
|
|
|
Map<String, String> returnMap = recipeServiceBean.retireRecipeAlternative(inData); |
|
|
|
resultMap.put("returnMap", returnMap); |
|
|
|
resultMap.put("code", 200); |
|
|
|
resultMap.put("msg", "操作成功!"); |
|
|
|
} catch (Exception e) { |
|
|
|
resultMap.put("code", 400); |
|
|
|
resultMap.put("msg", e.getMessage()); |
|
|
|
} |
|
|
|
return resultMap; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @description: 获取 Recipe Item 集合 |
|
|
|
* @author LR |
|
|
|
* @date 2024/12/18 13:47 |
|
|
|
* @version 1.0 |
|
|
|
*/ |
|
|
|
@PostMapping("/getRecipeItems") |
|
|
|
public Object getRecipeItems(@RequestBody RecipeIfsItem inDatas) throws APException { |
|
|
|
Map<String, Object> resultMap = new HashMap<String, Object>(); |
|
|
|
try { |
|
|
|
Map<String, String> returnMap = recipeServiceBean.getRecipeItems(inDatas); |
|
|
|
resultMap.put("returnMap", returnMap); |
|
|
|
resultMap.put("code", 200); |
|
|
|
resultMap.put("msg", "操作成功!"); |
|
|
|
} catch (Exception e) { |
|
|
|
resultMap.put("code", 400); |
|
|
|
resultMap.put("msg", e.getMessage()); |
|
|
|
} |
|
|
|
return resultMap; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @description: 批量新增 Recipe Item 集合 |
|
|
|
* @author LR |
|
|
|
* @date 2024/12/18 13:47 |
|
|
|
* @version 1.0 |
|
|
|
*/ |
|
|
|
@PostMapping("/syncRecipeItems") |
|
|
|
public Object syncRecipeItems(@RequestBody List<RecipeIfsItem> inDatas) throws APException { |
|
|
|
Map<String, Object> resultMap = new HashMap<String, Object>(); |
|
|
|
try { |
|
|
|
Map<String, String> returnMap = recipeServiceBean.syncRecipeItems(inDatas); |
|
|
|
resultMap.put("returnMap", returnMap); |
|
|
|
resultMap.put("code", 200); |
|
|
|
resultMap.put("msg", "操作成功!"); |
|
|
|
} catch (Exception e) { |
|
|
|
resultMap.put("code", 400); |
|
|
|
resultMap.put("msg", e.getMessage()); |
|
|
|
} |
|
|
|
return resultMap; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @description: 修改Recipe Item 信息 |
|
|
|
* @author LR |
|
|
|
* @date 2024/12/18 13:53 |
|
|
|
* @version 1.0 |
|
|
|
*/ |
|
|
|
@PostMapping("/modifyRecipeItem") |
|
|
|
public Object modifyRecipeItem(@RequestBody RecipeIfsItem inData) throws APException { |
|
|
|
Map<String, Object> resultMap = new HashMap<String, Object>(); |
|
|
|
try { |
|
|
|
Map<String, String> returnMap = recipeServiceBean.modifyRecipeItem(inData); |
|
|
|
resultMap.put("returnMap", returnMap); |
|
|
|
resultMap.put("code", 200); |
|
|
|
resultMap.put("msg", "操作成功!"); |
|
|
|
} catch (Exception e) { |
|
|
|
resultMap.put("code", 400); |
|
|
|
resultMap.put("msg", e.getMessage()); |
|
|
|
} |
|
|
|
return resultMap; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @description: 批量删除 Recipe Item 集合 |
|
|
|
* @author LR |
|
|
|
* @date 2024/12/18 13:55 |
|
|
|
* @version 1.0 |
|
|
|
*/ |
|
|
|
@PostMapping("/removeRecipeItems") |
|
|
|
public Object removeRecipeItems(@RequestBody List<RecipeIfsItem> inDatas) throws APException { |
|
|
|
Map<String, Object> resultMap = new HashMap<String, Object>(); |
|
|
|
try { |
|
|
|
Map<String, String> returnMap = recipeServiceBean.removeRecipeItems((List<RecipeIfsItem>) inDatas); |
|
|
|
resultMap.put("returnMap", returnMap); |
|
|
|
resultMap.put("code", 200); |
|
|
|
resultMap.put("msg", "操作成功!"); |
|
|
|
} catch (Exception e) { |
|
|
|
resultMap.put("code", 400); |
|
|
|
resultMap.put("msg", e.getMessage()); |
|
|
|
} |
|
|
|
return resultMap; |
|
|
|
} |
|
|
|
|
|
|
|
} |