Browse Source

分布式事务例子

feature/dangjian
管理员 6 years ago
parent
commit
fe42b50557
  1. 2
      esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysUserServiceImpl.java
  2. 271
      esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/utils/GPSUtils.java
  3. 3
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/DemoController.java
  4. 8
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java
  5. 8
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/DemoServiceImpl.java
  6. 2
      esua-epdc/epdc-module/epdc-demo/epdc-demo-server/src/main/java/com/elink/esua/epdc/entity/DemoEntity.java
  7. 4
      esua-epdc/epdc-module/epdc-demo/epdc-demo-server/src/main/java/com/elink/esua/epdc/service/impl/DemoServiceImpl.java
  8. 2
      esua-epdc/epdc-module/epdc-demo/epdc-demo-server/src/test/java/com/elink/esua/epdc/OrikaTest.java
  9. 22
      esua-epdc/epdc-module/epdc-webservice/src/main/java/com/elink/esua/epdc/config/WebServiceConfig.java
  10. 16
      esua-epdc/epdc-module/epdc-webservice/src/main/java/com/elink/esua/epdc/dto/form/TestDTO.java
  11. 2
      esua-epdc/epdc-module/epdc-webservice/src/main/java/com/elink/esua/epdc/utils/JaxbUtil.java

2
esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysUserServiceImpl.java

@ -188,7 +188,7 @@ public class SysUserServiceImpl extends BaseServiceImpl<SysUserDao, SysUserEntit
@Override @Override
public Result<GridLeaderRegisterDTO> listGridWhileLeaderRegister(String mobile) { public Result<GridLeaderRegisterDTO> listGridWhileLeaderRegister(String mobile) {
//TODO:该方法的获取组织结构不灵活,得重构 create by rongchao
QueryWrapper<SysUserEntity> wrapper = new QueryWrapper<>(); QueryWrapper<SysUserEntity> wrapper = new QueryWrapper<>();
wrapper.eq(FieldConstant.MOBILE, mobile) wrapper.eq(FieldConstant.MOBILE, mobile)
.eq(FieldConstant.DEL_FLAG, DelFlagEnum.NORMAL.value()); .eq(FieldConstant.DEL_FLAG, DelFlagEnum.NORMAL.value());

271
esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/utils/GPSUtils.java

@ -1,146 +1,155 @@
package com.elink.esua.epdc.commons.tools.utils; package com.elink.esua.epdc.commons.tools.utils;
/** /**
* @Description TODO * @Description
* @Author yinzuomei * @Author yinzuomei
* @Date 2019/12/27 10:00 * @Date 2019/12/27 10:00
*/ */
public class GPSUtils { public class GPSUtils {
public static double pi = 3.1415926535897932384626; public static double pi = 3.1415926535897932384626;
public static double x_pi = 3.14159265358979324 * 3000.0 / 180.0; public static double x_pi = 3.14159265358979324 * 3000.0 / 180.0;
public static double a = 6378245.0; public static double a = 6378245.0;
public static double ee = 0.00669342162296594323; public static double ee = 0.00669342162296594323;
public static double transformLat(double x, double y) { public static double transformLat(double x, double y) {
double ret = -100.0 + 2.0 * x + 3.0 * y + 0.2 * y * y + 0.1 * x * y double ret = -100.0 + 2.0 * x + 3.0 * y + 0.2 * y * y + 0.1 * x * y
+ 0.2 * Math.sqrt(Math.abs(x)); + 0.2 * Math.sqrt(Math.abs(x));
ret += (20.0 * Math.sin(6.0 * x * pi) + 20.0 * Math.sin(2.0 * x * pi)) * 2.0 / 3.0; ret += (20.0 * Math.sin(6.0 * x * pi) + 20.0 * Math.sin(2.0 * x * pi)) * 2.0 / 3.0;
ret += (20.0 * Math.sin(y * pi) + 40.0 * Math.sin(y / 3.0 * pi)) * 2.0 / 3.0; ret += (20.0 * Math.sin(y * pi) + 40.0 * Math.sin(y / 3.0 * pi)) * 2.0 / 3.0;
ret += (160.0 * Math.sin(y / 12.0 * pi) + 320 * Math.sin(y * pi / 30.0)) * 2.0 / 3.0; ret += (160.0 * Math.sin(y / 12.0 * pi) + 320 * Math.sin(y * pi / 30.0)) * 2.0 / 3.0;
return ret; return ret;
} }
public static double transformLon(double x, double y) { public static double transformLon(double x, double y) {
double ret = 300.0 + x + 2.0 * y + 0.1 * x * x + 0.1 * x * y + 0.1 double ret = 300.0 + x + 2.0 * y + 0.1 * x * x + 0.1 * x * y + 0.1
* Math.sqrt(Math.abs(x)); * Math.sqrt(Math.abs(x));
ret += (20.0 * Math.sin(6.0 * x * pi) + 20.0 * Math.sin(2.0 * x * pi)) * 2.0 / 3.0; ret += (20.0 * Math.sin(6.0 * x * pi) + 20.0 * Math.sin(2.0 * x * pi)) * 2.0 / 3.0;
ret += (20.0 * Math.sin(x * pi) + 40.0 * Math.sin(x / 3.0 * pi)) * 2.0 / 3.0; ret += (20.0 * Math.sin(x * pi) + 40.0 * Math.sin(x / 3.0 * pi)) * 2.0 / 3.0;
ret += (150.0 * Math.sin(x / 12.0 * pi) + 300.0 * Math.sin(x / 30.0 ret += (150.0 * Math.sin(x / 12.0 * pi) + 300.0 * Math.sin(x / 30.0
* pi)) * 2.0 / 3.0; * pi)) * 2.0 / 3.0;
return ret; return ret;
} }
public static double[] transform(double lat, double lon) {
if (outOfChina(lat, lon)) {
return new double[]{lat,lon};
}
double dLat = transformLat(lon - 105.0, lat - 35.0);
double dLon = transformLon(lon - 105.0, lat - 35.0);
double radLat = lat / 180.0 * pi;
double magic = Math.sin(radLat);
magic = 1 - ee * magic * magic;
double sqrtMagic = Math.sqrt(magic);
dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * sqrtMagic) * pi);
dLon = (dLon * 180.0) / (a / sqrtMagic * Math.cos(radLat) * pi);
double mgLat = lat + dLat;
double mgLon = lon + dLon;
return new double[]{mgLat,mgLon};
}
public static boolean outOfChina(double lat, double lon) {
if (lon < 72.004 || lon > 137.8347)
return true;
if (lat < 0.8293 || lat > 55.8271)
return true;
return false;
}
/**
* 84 to 火星坐标系 (GCJ-02) World Geodetic System ==> Mars Geodetic System
*
* @param lat
* @param lon
* @return
*/
public static double[] gps84_To_Gcj02(double lat, double lon) {
if (outOfChina(lat, lon)) {
return new double[]{lat,lon};
}
double dLat = transformLat(lon - 105.0, lat - 35.0);
double dLon = transformLon(lon - 105.0, lat - 35.0);
double radLat = lat / 180.0 * pi;
double magic = Math.sin(radLat);
magic = 1 - ee * magic * magic;
double sqrtMagic = Math.sqrt(magic);
dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * sqrtMagic) * pi);
dLon = (dLon * 180.0) / (a / sqrtMagic * Math.cos(radLat) * pi);
double mgLat = lat + dLat;
double mgLon = lon + dLon;
return new double[]{mgLat, mgLon};
}
/** public static double[] transform(double lat, double lon) {
* * 火星坐标系 (GCJ-02) to 84 * * @param lon * @param lat * @return if (outOfChina(lat, lon)) {
* */ return new double[]{lat, lon};
public static double[] gcj02_To_Gps84(double lat, double lon) { }
double[] gps = transform(lat, lon); double dLat = transformLat(lon - 105.0, lat - 35.0);
double lontitude = lon * 2 - gps[1]; double dLon = transformLon(lon - 105.0, lat - 35.0);
double latitude = lat * 2 - gps[0]; double radLat = lat / 180.0 * pi;
return new double[]{latitude, lontitude}; double magic = Math.sin(radLat);
} magic = 1 - ee * magic * magic;
/** double sqrtMagic = Math.sqrt(magic);
* 火星坐标系 (GCJ-02) 与百度坐标系 (BD-09) 的转换算法 GCJ-02 坐标转换成 BD-09 坐标 dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * sqrtMagic) * pi);
* dLon = (dLon * 180.0) / (a / sqrtMagic * Math.cos(radLat) * pi);
* @param lat double mgLat = lat + dLat;
* @param lon double mgLon = lon + dLon;
*/ return new double[]{mgLat, mgLon};
public static double[] gcj02_To_Bd09(double lat, double lon) { }
double x = lon, y = lat;
double z = Math.sqrt(x * x + y * y) + 0.00002 * Math.sin(y * x_pi);
double theta = Math.atan2(y, x) + 0.000003 * Math.cos(x * x_pi);
double tempLon = z * Math.cos(theta) + 0.0065;
double tempLat = z * Math.sin(theta) + 0.006;
double[] gps = {tempLat,tempLon};
return gps;
}
/** public static boolean outOfChina(double lat, double lon) {
* * 火星坐标系 (GCJ-02) 与百度坐标系 (BD-09) 的转换算法 * * BD-09 坐标转换成GCJ-02 坐标 * * @param if (lon < 72.004 || lon > 137.8347)
* bd_lat * @param bd_lon * @return return true;
*/ if (lat < 0.8293 || lat > 55.8271)
public static double[] bd09_To_Gcj02(double lat, double lon) { return true;
double x = lon - 0.0065, y = lat - 0.006; return false;
double z = Math.sqrt(x * x + y * y) - 0.00002 * Math.sin(y * x_pi); }
double theta = Math.atan2(y, x) - 0.000003 * Math.cos(x * x_pi);
double tempLon = z * Math.cos(theta);
double tempLat = z * Math.sin(theta);
double[] gps = {tempLat,tempLon};
return gps;
}
/**将gps84转为bd09 /**
* @param lat * 84 to 火星坐标系 (GCJ-02) World Geodetic System ==> Mars Geodetic System
* @param lon *
* @return * @param lat
*/ * @param lon
public static double[] gps84_To_bd09(double lat,double lon){ * @return
double[] gcj02 = gps84_To_Gcj02(lat,lon); */
double[] bd09 = gcj02_To_Bd09(gcj02[0],gcj02[1]); public static double[] gps84_To_Gcj02(double lat, double lon) {
return bd09; if (outOfChina(lat, lon)) {
} return new double[]{lat, lon};
public static double[] bd09_To_gps84(double lat,double lon){ }
double[] gcj02 = bd09_To_Gcj02(lat, lon); double dLat = transformLat(lon - 105.0, lat - 35.0);
double[] gps84 = gcj02_To_Gps84(gcj02[0], gcj02[1]); double dLon = transformLon(lon - 105.0, lat - 35.0);
//保留小数点后六位 double radLat = lat / 180.0 * pi;
gps84[0] = retain6(gps84[0]); double magic = Math.sin(radLat);
gps84[1] = retain6(gps84[1]); magic = 1 - ee * magic * magic;
return gps84; double sqrtMagic = Math.sqrt(magic);
} dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * sqrtMagic) * pi);
dLon = (dLon * 180.0) / (a / sqrtMagic * Math.cos(radLat) * pi);
double mgLat = lat + dLat;
double mgLon = lon + dLon;
return new double[]{mgLat, mgLon};
}
/**保留小数点后六位 /**
* @param num * * 火星坐标系 (GCJ-02) to 84 * * @param lon * @param lat * @return
* @return */
*/ public static double[] gcj02_To_Gps84(double lat, double lon) {
private static double retain6(double num){ double[] gps = transform(lat, lon);
String result = String .format("%.6f", num); double lontitude = lon * 2 - gps[1];
return Double.valueOf(result); double latitude = lat * 2 - gps[0];
} return new double[]{latitude, lontitude};
}
/**
* 火星坐标系 (GCJ-02) 与百度坐标系 (BD-09) 的转换算法 GCJ-02 坐标转换成 BD-09 坐标
*
* @param lat
* @param lon
*/
public static double[] gcj02_To_Bd09(double lat, double lon) {
double x = lon, y = lat;
double z = Math.sqrt(x * x + y * y) + 0.00002 * Math.sin(y * x_pi);
double theta = Math.atan2(y, x) + 0.000003 * Math.cos(x * x_pi);
double tempLon = z * Math.cos(theta) + 0.0065;
double tempLat = z * Math.sin(theta) + 0.006;
double[] gps = {tempLat, tempLon};
return gps;
}
/**
* * 火星坐标系 (GCJ-02) 与百度坐标系 (BD-09) 的转换算法 * * BD-09 坐标转换成GCJ-02 坐标 * * @param
* bd_lat * @param bd_lon * @return
*/
public static double[] bd09_To_Gcj02(double lat, double lon) {
double x = lon - 0.0065, y = lat - 0.006;
double z = Math.sqrt(x * x + y * y) - 0.00002 * Math.sin(y * x_pi);
double theta = Math.atan2(y, x) - 0.000003 * Math.cos(x * x_pi);
double tempLon = z * Math.cos(theta);
double tempLat = z * Math.sin(theta);
double[] gps = {tempLat, tempLon};
return gps;
}
/**
* 将gps84转为bd09
*
* @param lat
* @param lon
* @return
*/
public static double[] gps84_To_bd09(double lat, double lon) {
double[] gcj02 = gps84_To_Gcj02(lat, lon);
double[] bd09 = gcj02_To_Bd09(gcj02[0], gcj02[1]);
return bd09;
}
public static double[] bd09_To_gps84(double lat, double lon) {
double[] gcj02 = bd09_To_Gcj02(lat, lon);
double[] gps84 = gcj02_To_Gps84(gcj02[0], gcj02[1]);
//保留小数点后六位
gps84[0] = retain6(gps84[0]);
gps84[1] = retain6(gps84[1]);
return gps84;
}
/**
* 保留小数点后六位
*
* @param num
* @return
*/
private static double retain6(double num) {
String result = String.format("%.6f", num);
return Double.valueOf(result);
}
} }

3
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/DemoController.java

@ -4,6 +4,7 @@ import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.service.DemoService; import com.elink.esua.epdc.service.DemoService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@ -28,7 +29,7 @@ public class DemoController {
* @return * @return
*/ */
@PostMapping("seata") @PostMapping("seata")
public Result demo(Map<String, Object> map) { public Result demo(@RequestBody Map<String, Object> map) {
return demoService.demo(map); return demoService.demo(map);
} }

8
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java

@ -287,16 +287,16 @@ public class AppUserServiceImpl implements AppUserService {
GridLeaderRegisterDTO leaderRegisterDto = adminResult.getData(); GridLeaderRegisterDTO leaderRegisterDto = adminResult.getData();
// 组装用户注册信息 // 组装用户注册信息
EpdcGridLeaderRegisterDTO gridLeaderRegister = this.packageGridLeaderWhileRegister(leaderRegisterDto.getSysUser(), formDto.getWxCode());
List<UserGridRelationDTO> userGridList = ConvertUtils.sourceToTarget(leaderRegisterDto.getLeaderGridList(), UserGridRelationDTO.class); List<UserGridRelationDTO> userGridList = ConvertUtils.sourceToTarget(leaderRegisterDto.getLeaderGridList(), UserGridRelationDTO.class);
for (UserGridRelationDTO item : userGridList) { for (UserGridRelationDTO item : userGridList) {
//TODO:修改此地bug //TODO:修改此地bug
// item.setAllDeptNames(item.getDistrict()+"-"+item.getStreet()+"-"+item.getCommunity()+"-"+item.getGrid()); // item.setAllDeptNames(item.getDistrict() + "-" + item.getStreet() + "-" + item.getCommunity() + "-" + item.getGrid());
// item.setAllDeptIds(item.getDistrictId()+","+item.getStreetId()+","+item.getCommunityId()+","+item.getGridId()); // item.setAllDeptIds(item.getDistrictId() + "," + item.getStreetId() + "," + item.getCommunityId() + "," + item.getGridId());
// item.setParentDeptIds(item.getDistrict()+"-"+item.getStreet()+"-"+item.getCommunity()); // item.setParentDeptIds(item.getDistrict() + "-" + item.getStreet() + "-" + item.getCommunity());
// item.setParentDeptNames(item.getDistrictId()+","+item.getStreetId()+","+item.getCommunityId()); // item.setParentDeptNames(item.getDistrictId()+","+item.getStreetId()+","+item.getCommunityId());
} }
EpdcGridLeaderRegisterFormDTO registerDto = new EpdcGridLeaderRegisterFormDTO(); EpdcGridLeaderRegisterFormDTO registerDto = new EpdcGridLeaderRegisterFormDTO();
EpdcGridLeaderRegisterDTO gridLeaderRegister = this.packageGridLeaderWhileRegister(leaderRegisterDto.getSysUser(), formDto.getWxCode());
registerDto.setGridLeader(gridLeaderRegister); registerDto.setGridLeader(gridLeaderRegister);
registerDto.setUserGridList(userGridList); registerDto.setUserGridList(userGridList);

8
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/DemoServiceImpl.java

@ -1,10 +1,12 @@
package com.elink.esua.epdc.service.impl; package com.elink.esua.epdc.service.impl;
import com.elink.esua.epdc.commons.tools.exception.RenException;
import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.ScanSwitchDTO; import com.elink.esua.epdc.dto.ScanSwitchDTO;
import com.elink.esua.epdc.feign.DemoFeignClient; import com.elink.esua.epdc.feign.DemoFeignClient;
import com.elink.esua.epdc.service.DemoService; import com.elink.esua.epdc.service.DemoService;
import com.elink.esua.epdc.service.ScanSwitchService; import com.elink.esua.epdc.service.ScanSwitchService;
import io.seata.spring.annotation.GlobalTransactional;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -24,13 +26,17 @@ public class DemoServiceImpl implements DemoService {
@Autowired @Autowired
private DemoFeignClient demoFeignClient; private DemoFeignClient demoFeignClient;
@GlobalTransactional(rollbackFor = Exception.class)
@Override @Override
public Result demo(Map<String, Object> map) { public Result demo(Map<String, Object> map) {
ScanSwitchDTO dto = new ScanSwitchDTO(); ScanSwitchDTO dto = new ScanSwitchDTO();
dto.setId("54185412da2bea73804fc1de69827e18"); dto.setId("54185412da2bea73804fc1de69827e18");
dto.setMaintainInfo(map.get("username").toString()); dto.setMaintainInfo(map.get("username").toString());
scanSwitchService.update(dto); scanSwitchService.update(dto);
demoFeignClient.seata(map.get("username").toString(), Integer.parseInt(map.get("age").toString())); Result<String> r = demoFeignClient.seata(map.get("username").toString(), Integer.parseInt(map.get("age").toString()));
if (!r.success()) {
throw new RenException("添加失败");
}
return new Result(); return new Result();
} }
} }

2
esua-epdc/epdc-module/epdc-demo/epdc-demo-server/src/main/java/com/elink/esua/epdc/entity/DemoEntity.java

@ -28,7 +28,7 @@ public class DemoEntity implements Serializable {
* 用户ID * 用户ID
*/ */
@TableId @TableId
private Long id; private String id;
/** /**
* 用户名 * 用户名
*/ */

4
esua-epdc/epdc-module/epdc-demo/epdc-demo-server/src/main/java/com/elink/esua/epdc/service/impl/DemoServiceImpl.java

@ -16,7 +16,9 @@ import com.elink.esua.epdc.dao.DemoDao;
import com.elink.esua.epdc.dto.DemoDto; import com.elink.esua.epdc.dto.DemoDto;
import com.elink.esua.epdc.entity.DemoEntity; import com.elink.esua.epdc.entity.DemoEntity;
import com.elink.esua.epdc.service.DemoService; import com.elink.esua.epdc.service.DemoService;
import io.seata.spring.annotation.GlobalTransactional;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List; import java.util.List;
@ -36,6 +38,6 @@ public class DemoServiceImpl extends BaseServiceImpl<DemoDao, DemoEntity> implem
public Result<List<DemoDto>> demoService() { public Result<List<DemoDto>> demoService() {
QueryWrapper<DemoEntity> demoEntityWrapper = new QueryWrapper<>(); QueryWrapper<DemoEntity> demoEntityWrapper = new QueryWrapper<>();
List<DemoEntity> entityList = baseDao.selectList(demoEntityWrapper); List<DemoEntity> entityList = baseDao.selectList(demoEntityWrapper);
return new Result().ok(ConvertUtils.sourceToTarget(entityList,DemoDto.class)); return new Result().ok(ConvertUtils.sourceToTarget(entityList, DemoDto.class));
} }
} }

2
esua-epdc/epdc-module/epdc-demo/epdc-demo-server/src/test/java/com/elink/esua/epdc/OrikaTest.java

@ -29,7 +29,7 @@ public class OrikaTest {
@Test @Test
public void Test() { public void Test() {
DemoEntity demoEntity = new DemoEntity(); DemoEntity demoEntity = new DemoEntity();
demoEntity.setId(1000L); // demoEntity.setId(1000L);
demoEntity.setName("name"); demoEntity.setName("name");
demoEntity.setAge(19); demoEntity.setAge(19);

22
esua-epdc/epdc-module/epdc-webservice/src/main/java/com/elink/esua/epdc/config/WebServiceConfig.java

@ -10,23 +10,23 @@ import org.springframework.context.annotation.Configuration;
import javax.xml.ws.Endpoint; import javax.xml.ws.Endpoint;
/** /**
* @Description TODO * @Description
* @Author yinzuomei * @Author yinzuomei
* @Date 2019/12/30 12:55 * @Date 2019/12/30 12:55
*/ */
@Configuration @Configuration
public class WebServiceConfig { public class WebServiceConfig {
@Autowired @Autowired
private Bus bus; private Bus bus;
@Autowired @Autowired
private CityGridInterfaceServiceWebService cityGridInterfaceServiceWebService; private CityGridInterfaceServiceWebService cityGridInterfaceServiceWebService;
@Bean @Bean
public Endpoint endpointUserService() { public Endpoint endpointUserService() {
EndpointImpl endpoint = new EndpointImpl(bus,cityGridInterfaceServiceWebService); EndpointImpl endpoint = new EndpointImpl(bus, cityGridInterfaceServiceWebService);
endpoint.publish("/CityGridInterfaceServiceWebService");//接口发布在 /CityGridInterfaceServiceWebService 目录下 endpoint.publish("/CityGridInterfaceServiceWebService");//接口发布在 /CityGridInterfaceServiceWebService 目录下
return endpoint; return endpoint;
} }
} }

16
esua-epdc/epdc-module/epdc-webservice/src/main/java/com/elink/esua/epdc/dto/form/TestDTO.java

@ -6,20 +6,20 @@ import javax.xml.bind.annotation.*;
import java.io.Serializable; import java.io.Serializable;
/** /**
* @Description TODO * @Description
* @Author yinzuomei * @Author yinzuomei
* @Date 2019/12/30 17:28 * @Date 2019/12/30 17:28
*/ */
@XmlRootElement(name="user") @XmlRootElement(name = "user")
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "user",propOrder = {"userId","userName"}) @XmlType(name = "user", propOrder = {"userId", "userName"})
@Data @Data
public class TestDTO implements Serializable { public class TestDTO implements Serializable {
private static final long serialVersionUID = 1677005211935252496L; private static final long serialVersionUID = 1677005211935252496L;
@XmlElement(name = "userId",required = true) @XmlElement(name = "userId", required = true)
private String userId; private String userId;
@XmlElement(name = "userName",required = true) @XmlElement(name = "userName", required = true)
private String userName; private String userName;
} }

2
esua-epdc/epdc-module/epdc-webservice/src/main/java/com/elink/esua/epdc/utils/JaxbUtil.java

@ -1,7 +1,7 @@
package com.elink.esua.epdc.utils; package com.elink.esua.epdc.utils;
/** /**
* @Description TODO * @Description
* @Author yinzuomei * @Author yinzuomei
* @Date 2019/12/30 17:46 * @Date 2019/12/30 17:46
*/ */

Loading…
Cancel
Save