Commit 5c38eb8a authored by caotao's avatar caotao

1.更新平台amos-feign-privilege依赖版本至1.8.5。

2.删除场站之前判断是否有子节点或者户用光伏信息。
parent 4f2e4237
...@@ -2,6 +2,8 @@ package com.yeejoin.amos.boot.module.jxiop.biz.controller; ...@@ -2,6 +2,8 @@ package com.yeejoin.amos.boot.module.jxiop.biz.controller;
import com.yeejoin.amos.boot.module.jxiop.api.dto.StationInfoDto; import com.yeejoin.amos.boot.module.jxiop.api.dto.StationInfoDto;
import com.yeejoin.amos.boot.module.jxiop.api.entity.StationBasic; import com.yeejoin.amos.boot.module.jxiop.api.entity.StationBasic;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.HouseholdPvDistrictServiceImpl;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.HouseholdPvServiceImpl;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.StationCoordinateServiceImpl; import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.StationCoordinateServiceImpl;
import com.yeejoin.amos.component.feign.config.InnerInvokException; import com.yeejoin.amos.component.feign.config.InnerInvokException;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
...@@ -36,6 +38,8 @@ import org.typroject.tyboot.core.foundation.enumeration.UserType; ...@@ -36,6 +38,8 @@ import org.typroject.tyboot.core.foundation.enumeration.UserType;
@Api(tags = "场站基础信息表Api") @Api(tags = "场站基础信息表Api")
@RequestMapping(value = "/station-basic") @RequestMapping(value = "/station-basic")
public class StationBasicController extends BaseController { public class StationBasicController extends BaseController {
@Autowired
HouseholdPvDistrictServiceImpl householdPvDistrictServiceImpl;
@Autowired @Autowired
StationBasicServiceImpl stationBasicServiceImpl; StationBasicServiceImpl stationBasicServiceImpl;
...@@ -98,6 +102,10 @@ public class StationBasicController extends BaseController { ...@@ -98,6 +102,10 @@ public class StationBasicController extends BaseController {
@DeleteMapping(value = "/delete") @DeleteMapping(value = "/delete")
@ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除场站基础信息表", notes = "根据sequenceNbr删除场站基础信息表") @ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除场站基础信息表", notes = "根据sequenceNbr删除场站基础信息表")
public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @RequestParam(value = "ids") String ids) { public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @RequestParam(value = "ids") String ids) {
String checkResult = householdPvDistrictServiceImpl.removeCheck(Long.valueOf(ids));
if(!("ok".equals(checkResult))){
return this.buildResponseFalse(checkResult);
}
if (stationBasicServiceImpl.getStationPersonByStationID(ids) > 0) { if (stationBasicServiceImpl.getStationPersonByStationID(ids) > 0) {
return this.buildResponseFalse("请删除场站下的人员后再删除场站!"); return this.buildResponseFalse("请删除场站下的人员后再删除场站!");
} }
......
...@@ -13,6 +13,7 @@ import com.yeejoin.amos.feign.privilege.Privilege; ...@@ -13,6 +13,7 @@ import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.CompanyModel; import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import com.yeejoin.amos.feign.privilege.model.DepartmentModel; import com.yeejoin.amos.feign.privilege.model.DepartmentModel;
import com.yeejoin.amos.feign.privilege.model.LoginInfoModel;
import com.yeejoin.amos.feign.privilege.util.DesUtil; import com.yeejoin.amos.feign.privilege.util.DesUtil;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -127,6 +128,7 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto, PersonBa ...@@ -127,6 +128,7 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto, PersonBa
usd.setLockStatus("UNLOCK"); usd.setLockStatus("UNLOCK");
//新增平台用户 //新增平台用户
AgencyUserModel agencyUserModel = this.setcreateUser(usd); AgencyUserModel agencyUserModel = this.setcreateUser(usd);
// this.createLoginInfo(usd);
//查询部门 //查询部门
DepartmentModel departmentModel = null; DepartmentModel departmentModel = null;
if (personAccount.getDepartmentId() != null) { if (personAccount.getDepartmentId() != null) {
...@@ -209,6 +211,7 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto, PersonBa ...@@ -209,6 +211,7 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto, PersonBa
usd.setUserId(personAccount.getPuserId()); usd.setUserId(personAccount.getPuserId());
//新增平台用户 //新增平台用户
AgencyUserModel agencyUserModel = this.updateuser(personAccount.getPuserId(), usd); AgencyUserModel agencyUserModel = this.updateuser(personAccount.getPuserId(), usd);
// this.updateLoginInfo();
//查询部门 //查询部门
DepartmentModel departmentModel = null; DepartmentModel departmentModel = null;
if (personAccount.getDepartmentId() != null) { if (personAccount.getDepartmentId() != null) {
...@@ -285,6 +288,7 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto, PersonBa ...@@ -285,6 +288,7 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto, PersonBa
//删除平台 //删除平台
int deleteResult = personBasicMapper.deleteList(ids); int deleteResult = personBasicMapper.deleteList(ids);
this.deleuser(String.join(",", userid)); this.deleuser(String.join(",", userid));
// this.deleteLoginInfo();
return deleteResult; return deleteResult;
} }
...@@ -303,6 +307,15 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto, PersonBa ...@@ -303,6 +307,15 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto, PersonBa
} }
return user; return user;
} }
private LoginInfoModel createLoginInfo(AgencyUserModel userDto) {
FeignClientResult<LoginInfoModel> amosLoginfo = null;
try {
amosLoginfo = Privilege.agencyUserClient.createLoginInfo(userDto);
} catch (Exception e) {
throw new RuntimeException(e);
}
return amosLoginfo.getResult();
}
//修改平台用户 //修改平台用户
private AgencyUserModel updateuser(String userId, AgencyUserModel userDto) { private AgencyUserModel updateuser(String userId, AgencyUserModel userDto) {
...@@ -318,7 +331,15 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto, PersonBa ...@@ -318,7 +331,15 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto, PersonBa
} }
return user; return user;
} }
private LoginInfoModel updateLoginInfo(String loginId,AgencyUserModel userDto) {
FeignClientResult<LoginInfoModel> amosLoginfo = null;
try {
amosLoginfo = Privilege.agencyUserClient.updateLoginInfo(userDto,loginId);
} catch (Exception e) {
throw new RuntimeException(e);
}
return amosLoginfo.getResult();
}
private DepartmentModel getdepartmentModel(Long departmentId) { private DepartmentModel getdepartmentModel(Long departmentId) {
FeignClientResult<DepartmentModel> de = Privilege.departmentClient.seleteOne(departmentId); FeignClientResult<DepartmentModel> de = Privilege.departmentClient.seleteOne(departmentId);
...@@ -358,6 +379,15 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto, PersonBa ...@@ -358,6 +379,15 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto, PersonBa
} }
} }
private String deleteLoginInfo(String loginId) {
FeignClientResult<String> amosLoginfo = null;
try {
amosLoginfo = Privilege.agencyUserClient.deleteLoginInfo(loginId);
} catch (Exception e) {
throw new RuntimeException(e);
}
return amosLoginfo.getResult();
}
/** /**
* 分页查询 * 分页查询
*/ */
......
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
<dependency> <dependency>
<groupId>com.yeejoin</groupId> <groupId>com.yeejoin</groupId>
<artifactId>amos-feign-privilege</artifactId> <artifactId>amos-feign-privilege</artifactId>
<version>1.7.14-SNAPSHOT</version> <version>1.8.5</version>
</dependency> </dependency>
...@@ -82,7 +82,11 @@ ...@@ -82,7 +82,11 @@
<artifactId>logstash-logback-encoder</artifactId> <artifactId>logstash-logback-encoder</artifactId>
<version>6.3</version> <version>6.3</version>
</dependency> </dependency>
<dependency>
<groupId>com.kingbase8</groupId>
<artifactId>kingbase8</artifactId>
<version>8.6.0</version>
</dependency>
</dependencies> </dependencies>
</project> </project>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment