Browse Source

IFS jar 测试开发代码

master
DouDou 1 year ago
parent
commit
e9731fa5d7
  1. 8
      src/main/java/com/spring/ifs/api/MasterPartApi.java
  2. 10
      src/main/java/com/spring/ifs/bean/MasterServiceBean.java
  3. 16
      src/main/java/com/spring/ifs/bean/MasterServiceBeanTest.java
  4. 44
      src/main/java/com/spring/ifs/controller/TestIfsController.java

8
src/main/java/com/spring/ifs/api/MasterPartApi.java

@ -1,8 +1,8 @@
package com.spring.ifs.api;
import com.spring.ifs.data.PartCatalog;
import com.spring.ifs.utils.IfsConverterToMap;
import com.spring.ifs.utils.IfsPlsqlUtils;
import com.spring.modules.part.entity.APIEntity.PartIfsCatalog;
import ifs.fnd.ap.*;
import java.util.HashMap;
@ -48,7 +48,7 @@ public class MasterPartApi {
* @date 2024/12/10 17:59
* @version 1.0
*/
public static Map<String, String> insertMasterPart(Server srv, PartCatalog inData) throws APException {
public static Map<String, String> insertMasterPart(Server srv, PartIfsCatalog inData) throws APException {
//公共参数
String partNo = inData.getPartNo().toUpperCase();
String partDesc = inData.getPartDesc();
@ -115,7 +115,7 @@ public class MasterPartApi {
* @date 2024/12/11 9:24
* @version 1.0
*/
public static Map<String, String> modifyMasterPart(Server srv, PartCatalog inData) throws APException {
public static Map<String, String> modifyMasterPart(Server srv, PartIfsCatalog inData) throws APException {
//公共参数
String ifsRowId = inData.getIfsRowId();
String ifsRowVersion = inData.getIfsRowVersion();
@ -171,7 +171,7 @@ public class MasterPartApi {
* @date 2024/12/11 10:01
* @version 1.0
*/
public static void removeMasterPart(Server srv, PartCatalog inData) throws APException {
public static void removeMasterPart(Server srv, PartIfsCatalog inData) throws APException {
//公共参数
String ifsRowId = inData.getIfsRowId();
String ifsRowVersion = inData.getIfsRowVersion();

10
src/main/java/com/spring/ifs/bean/MasterServiceBean.java

@ -3,7 +3,7 @@ package com.spring.ifs.bean;
import com.alibaba.fastjson.JSON;
import com.spring.ifs.api.IfsServer;
import com.spring.ifs.api.MasterPartApi;
import com.spring.ifs.data.PartCatalog;
import com.spring.modules.part.entity.APIEntity.PartIfsCatalog;
import ifs.fnd.ap.APException;
import ifs.fnd.ap.Server;
import org.slf4j.Logger;
@ -32,7 +32,7 @@ public class MasterServiceBean {
* @date 2024/12/9 13:28
* @version 1.0
*/
public Map<String, String> getMasterPart(Server srv, PartCatalog inData) throws APException {
public Map<String, String> getMasterPart(Server srv, PartIfsCatalog inData) throws APException {
//公共参数
String partNo = inData.getPartNo();
//获取参数
@ -50,7 +50,7 @@ public class MasterServiceBean {
* @date 2024/12/12 15:33
* @version 1.0
*/
public PartCatalog syncPartCatalog(Server srv, PartCatalog inData) throws APException {
public PartIfsCatalog syncPartCatalog(Server srv, PartIfsCatalog inData) throws APException {
logger.info("Part Catalog 新增开始:"+ JSON.toJSONString(inData));
//公共参数
String partNo = inData.getPartNo();
@ -76,7 +76,7 @@ public class MasterServiceBean {
* @date 2024/12/12 15:40
* @version 1.0
*/
public PartCatalog modifyPartCatalog(Server srv, PartCatalog inData) throws APException {
public PartIfsCatalog modifyPartCatalog(Server srv, PartIfsCatalog inData) throws APException {
logger.info("Part Catalog 修改开始:"+JSON.toJSONString(inData));
//公共参数
String partNo = inData.getPartNo();
@ -104,7 +104,7 @@ public class MasterServiceBean {
* @date 2024/12/12 15:40
* @version 1.0
*/
public void removePartCatalog(Server srv, PartCatalog inData) throws APException {
public void removePartCatalog(Server srv, PartIfsCatalog inData) throws APException {
logger.info("Part Catalog 删除开始:"+JSON.toJSONString(inData));
//公共参数
String partNo = inData.getPartNo();

16
src/main/java/com/spring/ifs/bean/MasterServiceBeanTest.java

@ -2,7 +2,7 @@ package com.spring.ifs.bean;
import com.alibaba.fastjson.JSON;
import com.spring.ifs.api.IfsServer;
import com.spring.ifs.api.MasterPartApi;
import com.spring.ifs.api.MasterPartApiTest;
import com.spring.ifs.data.PartCatalog;
import ifs.fnd.ap.APException;
import ifs.fnd.ap.Server;
@ -40,7 +40,7 @@ public class MasterServiceBeanTest {
//获取连接
Server srv = ifsServer.getIfsServer(username, password);
//获取参数
Map<String, String> resultMap = MasterPartApi.getMasterPart(srv, partNo);
Map<String, String> resultMap = MasterPartApiTest.getMasterPart(srv, partNo);
//判断是否存在
if(null == resultMap) {
throw new RuntimeException("当前物料件不存在!");
@ -62,10 +62,10 @@ public class MasterServiceBeanTest {
String partNo = inData.getPartNo();
//获取连接
Server srv = ifsServer.getIfsServer(username, password);
Map<String, String> partMap = MasterPartApi.getMasterPart(srv, partNo);
Map<String, String> partMap = MasterPartApiTest.getMasterPart(srv, partNo);
//判断是否需要插入到ifs
if(partMap == null || partMap.size() == 0) {
Map<String, String> resultMap = MasterPartApi.insertMasterPart(srv, inData);
Map<String, String> resultMap = MasterPartApiTest.insertMasterPart(srv, inData);
//设置ifs 信息
inData.setIfsRowId(resultMap.get("OBJID"));
inData.setIfsRowVersion(resultMap.get("OBJVERSION"));
@ -92,7 +92,7 @@ public class MasterServiceBeanTest {
String partNo = inData.getPartNo();
//获取连接
Server srv = ifsServer.getIfsServer(username, password);
Map<String, String> partMap = MasterPartApi.getMasterPart(srv, partNo);
Map<String, String> partMap = MasterPartApiTest.getMasterPart(srv, partNo);
//判断是否需要插入到ifs
if(partMap == null && partMap.size() == 0) {
throw new RuntimeException("物料件不存在!");
@ -100,7 +100,7 @@ public class MasterServiceBeanTest {
//设置ifs 信息
inData.setIfsRowId(partMap.get("IFSROWID"));
inData.setIfsRowVersion(partMap.get("IFSROWVERSION"));
Map<String, String> resultMap = MasterPartApi.modifyMasterPart(srv, inData);
Map<String, String> resultMap = MasterPartApiTest.modifyMasterPart(srv, inData);
//设置ifs 信息
inData.setIfsRowVersion(resultMap.get("OBJVERSION"));
}
@ -123,7 +123,7 @@ public class MasterServiceBeanTest {
String partNo = inData.getPartNo();
//获取连接
Server srv = ifsServer.getIfsServer(username, password);
Map<String, String> partMap = MasterPartApi.getMasterPart(srv, partNo);
Map<String, String> partMap = MasterPartApiTest.getMasterPart(srv, partNo);
//判断是否需要插入到ifs
if(partMap == null && partMap.size() == 0) {
throw new RuntimeException("物料件不存在!");
@ -131,7 +131,7 @@ public class MasterServiceBeanTest {
//设置ifs 信息
inData.setIfsRowId(partMap.get("IFSROWID"));
inData.setIfsRowVersion(partMap.get("IFSROWVERSION"));
MasterPartApi.removeMasterPart(srv, inData);
MasterPartApiTest.removeMasterPart(srv, inData);
}
logger.info("Part Catalog 删除结束:"+JSON.toJSONString(inData));
}

44
src/main/java/com/spring/ifs/controller/TestIfsController.java

@ -1,13 +1,10 @@
package com.spring.ifs.controller;
import com.alibaba.fastjson.JSON;
import com.spring.ifs.api.InventoryPartApi;
import com.spring.ifs.bean.BaseSearchBeanTest;
import com.spring.ifs.bean.InventoryServiceBean;
import com.spring.ifs.bean.InventoryServiceBeanTest;
import com.spring.ifs.bean.MasterServiceBeanTest;
import com.spring.ifs.data.*;
import ifs.fnd.ap.APException;
import ifs.fnd.ap.Server;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@ -27,7 +24,7 @@ public class TestIfsController {
@Autowired
private MasterServiceBeanTest masterServiceBeanTest;
@Autowired
private InventoryServiceBean inventoryServiceBean;
private InventoryServiceBeanTest inventoryServiceBeanTest;
@ -234,7 +231,7 @@ public class TestIfsController {
public Object getInventoryPart(@RequestBody InventoryPart inData) throws APException {
Map<String, Object> resultMap = new HashMap<String, Object>();
try {
InventoryPart returnRow = inventoryServiceBean.getInventoryPart(inData);
InventoryPart returnRow = inventoryServiceBeanTest.getInventoryPart(inData);
resultMap.put("obj", returnRow);
resultMap.put("code", 200);
resultMap.put("msg", "操作成功!");
@ -255,7 +252,7 @@ public class TestIfsController {
public Object syncInventoryPart(@RequestBody InventoryPart inData) throws APException {
Map<String, Object> resultMap = new HashMap<String, Object>();
try {
InventoryPart resultRow = inventoryServiceBean.syncInventoryPart(inData);
InventoryPart resultRow = inventoryServiceBeanTest.syncInventoryPart(inData);
resultMap.put("obj", resultRow);
resultMap.put("code", 200);
resultMap.put("msg", "操作成功!");
@ -276,7 +273,7 @@ public class TestIfsController {
public Object modifyInventoryPart(@RequestBody InventoryPart inData) throws APException {
Map<String, Object> resultMap = new HashMap<String, Object>();
try {
InventoryPart resultRow = inventoryServiceBean.modifyInventoryPart(inData);
InventoryPart resultRow = inventoryServiceBeanTest.modifyInventoryPart(inData);
resultMap.put("obj", resultRow);
resultMap.put("code", 200);
resultMap.put("msg", "操作成功!");
@ -297,7 +294,7 @@ public class TestIfsController {
public Object removeInventoryPart(@RequestBody InventoryPart inData) throws APException {
Map<String, Object> resultMap = new HashMap<String, Object>();
try {
inventoryServiceBean.removeInventoryPart(inData);
inventoryServiceBeanTest.removeInventoryPart(inData);
resultMap.put("code", 200);
resultMap.put("msg", "操作成功!");
} catch (Exception e) {
@ -317,7 +314,7 @@ public class TestIfsController {
public Object modifyInventoryPartCost(@RequestBody InventoryPartConfig inData) throws APException {
Map<String, Object> resultMap = new HashMap<String, Object>();
try {
InventoryPartConfig resultRow = inventoryServiceBean.modifyInventoryPartCost(inData);
InventoryPartConfig resultRow = inventoryServiceBeanTest.modifyInventoryPartCost(inData);
resultMap.put("obj", resultRow);
resultMap.put("code", 200);
resultMap.put("msg", "操作成功!");
@ -338,7 +335,7 @@ public class TestIfsController {
public Object modifyInventoryPartPlan(@RequestBody InventoryPartPlan inData) throws APException {
Map<String, Object> resultMap = new HashMap<String, Object>();
try {
InventoryPartPlan resultRow = inventoryServiceBean.modifyInventoryPartPlan(inData);
InventoryPartPlan resultRow = inventoryServiceBeanTest.modifyInventoryPartPlan(inData);
resultMap.put("obj", resultRow);
resultMap.put("code", 200);
resultMap.put("msg", "操作成功!");
@ -359,7 +356,7 @@ public class TestIfsController {
public Object syncInventoryPartLocations(@RequestBody List<InventoryPartLocation> inDatas) throws APException {
Map<String, Object> resultMap = new HashMap<String, Object>();
try {
List<InventoryPartLocation> resultList = inventoryServiceBean.syncInventoryPartLocations(inDatas);
List<InventoryPartLocation> resultList = inventoryServiceBeanTest.syncInventoryPartLocations(inDatas);
resultMap.put("obj", resultList);
resultMap.put("code", 200);
resultMap.put("msg", "操作成功!");
@ -380,7 +377,7 @@ public class TestIfsController {
public Object removeInventoryPartLocation(@RequestBody InventoryPartLocation inData) throws APException {
Map<String, Object> resultMap = new HashMap<String, Object>();
try {
inventoryServiceBean.removeInventoryPartLocation(inData);
inventoryServiceBeanTest.removeInventoryPartLocation(inData);
resultMap.put("code", 200);
resultMap.put("msg", "操作成功!");
} catch (Exception e) {
@ -390,7 +387,6 @@ public class TestIfsController {
return resultMap;
}
/**************************************************************************************************************************/
/**
* @description: 修改库存件的制造商
* @author LR
@ -401,7 +397,7 @@ public class TestIfsController {
public Object modifyInventoryPartManufacture(@RequestBody InventoryPartManufacture inData) throws APException {
Map<String, Object> resultMap = new HashMap<String, Object>();
try {
InventoryPartManufacture resultRow = inventoryServiceBean.modifyInventoryPartManufacture(inData);
InventoryPartManufacture resultRow = inventoryServiceBeanTest.modifyInventoryPartManufacture(inData);
resultMap.put("obj", resultRow);
resultMap.put("code", 200);
resultMap.put("msg", "操作成功!");
@ -422,7 +418,7 @@ public class TestIfsController {
public Object getInventoryPartRevision(@RequestBody InventoryPartRevision inData) throws APException {
Map<String, Object> resultMap = new HashMap<String, Object>();
try {
InventoryPartRevision resultRow = inventoryServiceBean.getInventoryPartRevision(inData);
InventoryPartRevision resultRow = inventoryServiceBeanTest.getInventoryPartRevision(inData);
resultMap.put("resultRow", resultRow);
resultMap.put("code", 200);
resultMap.put("msg", "操作成功!");
@ -443,7 +439,7 @@ public class TestIfsController {
public Object syncInventoryPartRevision(@RequestBody InventoryPartRevision inData) throws APException {
Map<String, Object> resultMap = new HashMap<String, Object>();
try {
InventoryPartRevision resultRow = inventoryServiceBean.syncInventoryPartRevision(inData);
InventoryPartRevision resultRow = inventoryServiceBeanTest.syncInventoryPartRevision(inData);
resultMap.put("resultRow", resultRow);
resultMap.put("code", 200);
resultMap.put("msg", "操作成功!");
@ -465,7 +461,7 @@ public class TestIfsController {
public Object modifyInventoryPartRevision(@RequestBody InventoryPartRevision inData) throws APException {
Map<String, Object> resultMap = new HashMap<String, Object>();
try {
InventoryPartRevision resultRow = inventoryServiceBean.modifyInventoryPartRevision(inData);
InventoryPartRevision resultRow = inventoryServiceBeanTest.modifyInventoryPartRevision(inData);
resultMap.put("resultRow", resultRow);
resultMap.put("code", 200);
resultMap.put("msg", "操作成功!");
@ -486,7 +482,7 @@ public class TestIfsController {
public Object removeInventoryPartRevision(@RequestBody InventoryPartRevision inData) throws APException {
Map<String, Object> resultMap = new HashMap<String, Object>();
try {
inventoryServiceBean.removeInventoryPartRevision(inData);
inventoryServiceBeanTest.removeInventoryPartRevision(inData);
resultMap.put("code", 200);
resultMap.put("msg", "操作成功!");
} catch (Exception e) {
@ -506,7 +502,7 @@ public class TestIfsController {
public Object syncInventoryPartCharacteristics(@RequestBody List<CharacteristicCode> inDatas) throws APException {
Map<String, Object> resultMap = new HashMap<String, Object>();
try {
List<CharacteristicCode> resultList = inventoryServiceBean.syncInventoryPartCharacteristics(inDatas);
List<CharacteristicCode> resultList = inventoryServiceBeanTest.syncInventoryPartCharacteristics(inDatas);
resultMap.put("code", 200);
resultMap.put("resultList", resultList);
resultMap.put("msg", "操作成功!");
@ -527,7 +523,7 @@ public class TestIfsController {
public Object removeInventoryPartCharacteristicsByPartNo(@RequestBody InventoryPart inData) throws APException {
Map<String, Object> resultMap = new HashMap<String, Object>();
try {
inventoryServiceBean.removeInventoryPartCharacteristicsByPartNo(inData);
inventoryServiceBeanTest.removeInventoryPartCharacteristicsByPartNo(inData);
resultMap.put("code", 200);
resultMap.put("msg", "操作成功!");
} catch (Exception e) {
@ -547,7 +543,7 @@ public class TestIfsController {
public Object removeInventoryPartRelationInfo(@RequestBody InventoryPart inData) throws APException {
Map<String, Object> resultMap = new HashMap<String, Object>();
try {
inventoryServiceBean.removeInventoryPartRelationInfo(inData);
inventoryServiceBeanTest.removeInventoryPartRelationInfo(inData);
resultMap.put("code", 200);
resultMap.put("msg", "操作成功!");
} catch (Exception e) {
@ -567,7 +563,7 @@ public class TestIfsController {
public Object removeInventoryPartLocations(@RequestBody List<InventoryPartLocation> inDatas) throws APException {
Map<String, Object> resultMap = new HashMap<String, Object>();
try {
inventoryServiceBean.removeInventoryPartLocations(inDatas);
inventoryServiceBeanTest.removeInventoryPartLocations(inDatas);
resultMap.put("code", 200);
resultMap.put("msg", "操作成功!");
} catch (Exception e) {
@ -587,7 +583,7 @@ public class TestIfsController {
public Object syncCopyPartForInventoryPart(@RequestBody CopyPart inData) throws APException {
Map<String, Object> resultMap = new HashMap<String, Object>();
try {
inventoryServiceBean.syncCopyPartForInventoryPart(inData);
inventoryServiceBeanTest.syncCopyPartForInventoryPart(inData);
resultMap.put("code", 200);
resultMap.put("msg", "操作成功!");
} catch (Exception e) {

Loading…
Cancel
Save