|
|
|
@ -16,6 +16,8 @@ import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import javax.jws.WebService;
|
|
|
|
|
import java.io.ByteArrayInputStream;
|
|
|
|
|
import java.io.File;
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
@ -29,6 +31,16 @@ public class TBasicWebService implements ITBasicWebService {
|
|
|
|
|
@Autowired
|
|
|
|
|
private TBasicSubMapper tBasicSubMapper;
|
|
|
|
|
|
|
|
|
|
private String CurrentPath(){
|
|
|
|
|
File dir = new File(".");
|
|
|
|
|
String currentpath ="";
|
|
|
|
|
try {
|
|
|
|
|
currentpath = dir.getCanonicalPath();
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
return currentpath;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public String savaAndSub(String tbasic) {
|
|
|
|
@ -37,7 +49,7 @@ public class TBasicWebService implements ITBasicWebService {
|
|
|
|
|
//解析xml
|
|
|
|
|
xmlUtils = new XmlUtils(new ByteArrayInputStream(tbasic.getBytes("UTF-8")));
|
|
|
|
|
//解析json映射文件
|
|
|
|
|
String json = JsonUtils.readJsonFile(Codes.JSON_ADDRESS.getMessage());
|
|
|
|
|
String json = JsonUtils.readJsonFile(CurrentPath()+Codes.JSON_ADDRESS.getMessage());
|
|
|
|
|
Map jsonMap = JSON.parseObject(json, Map.class);
|
|
|
|
|
HashMap<String, Object> tBasicMap = new HashMap<>();
|
|
|
|
|
HashMap<String, Object> tBasicSubMap = new HashMap<>();
|
|
|
|
@ -104,7 +116,9 @@ public class TBasicWebService implements ITBasicWebService {
|
|
|
|
|
//解析xml
|
|
|
|
|
xmlUtils = new XmlUtils(new ByteArrayInputStream(tbasic.getBytes("UTF-8")));
|
|
|
|
|
//解析json映射文件
|
|
|
|
|
String json = JsonUtils.readJsonFile(Codes.JSON_ADDRESS.getMessage());
|
|
|
|
|
String path=CurrentPath()+Codes.JSON_ADDRESS.getMessage();
|
|
|
|
|
System.out.println(path);
|
|
|
|
|
String json = JsonUtils.readJsonFile(path);
|
|
|
|
|
Map jsonMap = JSON.parseObject(json, Map.class);
|
|
|
|
|
HashMap<String, Object> tBasicMap = new HashMap<>();
|
|
|
|
|
HashMap<String, Object> tBasicSubMap = new HashMap<>();
|
|
|
|
@ -138,7 +152,7 @@ public class TBasicWebService implements ITBasicWebService {
|
|
|
|
|
int insert;
|
|
|
|
|
if (tBasicMap != null && tBasicMap.size() > 0) {
|
|
|
|
|
tBasic = JSON.parseObject(JSON.toJSONString(tBasicMap), TBasic.class);
|
|
|
|
|
if(StringUtils.isNotBlank(tBasic.getEmpId())){
|
|
|
|
|
if(StringUtils.isBlank(tBasic.getEmpId())){
|
|
|
|
|
return ResultUtils.fail("emp_id字段不能为空值");
|
|
|
|
|
}
|
|
|
|
|
TBasic selectTBasic = tBasicMapper.selectOne(new QueryWrapper<TBasic>().eq("emp_id", tBasic.getEmpId()));
|
|
|
|
@ -166,6 +180,6 @@ public class TBasicWebService implements ITBasicWebService {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
return ResultUtils.fail();
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
return ResultUtils.success().asXML();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|