|
|
@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.text.ParseException;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
@ -239,4 +240,30 @@ public class SAPPortServiceImpl implements ISAPPortService {
|
|
|
|
this.getSapBaseOrderInfo(sapPortDto);
|
|
|
|
this.getSapBaseOrderInfo(sapPortDto);
|
|
|
|
return 1;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 获取生产工单测试
|
|
|
|
|
|
|
|
* @param params
|
|
|
|
|
|
|
|
* @return
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public List<BaseOrderInfo> getProduceWorkTest(String params) {
|
|
|
|
|
|
|
|
// 处理接口返回消息
|
|
|
|
|
|
|
|
ArrayList<BaseOrderInfo> baseOrderInfoVos = null;
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
ObjectMapper resultMapper = new ObjectMapper();
|
|
|
|
|
|
|
|
// 将 JSON 字符串转换为 Java 对象
|
|
|
|
|
|
|
|
SAPResultOrderInfoVo resultVo = resultMapper.readValue(params, SAPResultOrderInfoVo.class);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//判断返回数据是否正确
|
|
|
|
|
|
|
|
if (StringUtils.isNull(resultVo.getO_RETURN()) || !resultVo.getO_RETURN().getItem().get(0).get("ID").contains("0")){
|
|
|
|
|
|
|
|
throw new BaseException("处理接口返回消息错误!(ID不为0或O_RETURN为空)");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//转工单实体类 保存数据
|
|
|
|
|
|
|
|
baseOrderInfoVos = storageService.insertSAPBaseOrderInfo(resultVo);
|
|
|
|
|
|
|
|
} catch (JsonProcessingException | BaseException | ParseException e) {
|
|
|
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return baseOrderInfoVos;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|