Commit 1a7c2dfe authored by tangwei's avatar tangwei

修改户用光伏注册

parent 95f30b0b
...@@ -269,6 +269,48 @@ public class UnitInfoController extends BaseController { ...@@ -269,6 +269,48 @@ public class UnitInfoController extends BaseController {
@ApiOperation(httpMethod = "POST", value = "单位注册", notes = "单位注册") @ApiOperation(httpMethod = "POST", value = "单位注册", notes = "单位注册")
public ResponseModel<UnitRegisterDto> save(@RequestBody UnitRegisterDto model) { public ResponseModel<UnitRegisterDto> save(@RequestBody UnitRegisterDto model) {
try { try {
//判断公司名称重复,
LambdaQueryWrapper<UnitInfo> qudg=new LambdaQueryWrapper<>();
qudg.eq(UnitInfo::getName,model.getUnitInfoDto().getName());
qudg.eq(UnitInfo::getIsDelete,0);
List<UnitInfo> unitInfo= unitInfoMapper.selectList(qudg);
if(unitInfo!=null&&!unitInfo.isEmpty()){
throw new BadRequest("公司名称重复");
}
//判断公司统一信息用代码重复
LambdaQueryWrapper<CommerceInfo> queryWrapper1 = new LambdaQueryWrapper<CommerceInfo>();
queryWrapper1.eq(CommerceInfo::getCreditCode, model.getCommerceInfoDto().getCreditCode());
queryWrapper1.eq(CommerceInfo::getIsDelete,0);
List<CommerceInfo> commerceInfo= commerceInfoMapper.selectList(queryWrapper1);
if(commerceInfo!=null&&!commerceInfo.isEmpty()){
throw new BadRequest("统一信用代码重复");
}
//用户名重复
LambdaQueryWrapper<UnitInfo> qudg1=new LambdaQueryWrapper<>();
qudg1.eq(UnitInfo::getAdminLoginName,model.getUnitInfoDto().getAdminLoginName());
qudg1.eq(UnitInfo::getIsDelete,0);
List<UnitInfo> unitInfo1= unitInfoMapper.selectList(qudg);
if(unitInfo1!=null&&!unitInfo1.isEmpty()){
throw new BadRequest("管理员账户名重复,请更换");
}
LambdaQueryWrapper<PublicAgencyUser> qud2=new LambdaQueryWrapper<>();
qud2.eq(PublicAgencyUser::getAmosUserName,model.getUnitInfoDto().getAdminLoginName());
List<PublicAgencyUser> publicAgencyUse= publicAgencyUserMapper.selectList(qud2);
if(publicAgencyUse!=null&&!publicAgencyUse.isEmpty()){
throw new BadRequest("管理员账户名重复,请更换");
}
RequestContext.setAppKey("AMOS_STUDIO"); RequestContext.setAppKey("AMOS_STUDIO");
RequestContext.setProduct("AMOS_STUDIO_WEB"); RequestContext.setProduct("AMOS_STUDIO_WEB");
RequestContext.setToken(requestContext.getToken()); RequestContext.setToken(requestContext.getToken());
......
...@@ -35,12 +35,12 @@ ...@@ -35,12 +35,12 @@
<groupId>org.influxdb</groupId> <groupId>org.influxdb</groupId>
<artifactId>influxdb-java</artifactId> <artifactId>influxdb-java</artifactId>
</dependency> </dependency>
<dependency> <!-- <dependency>-->
<groupId>com.yeejoin</groupId> <!-- <groupId>com.yeejoin</groupId>-->
<artifactId>amos-component-influxdb</artifactId> <!-- <artifactId>amos-component-influxdb</artifactId>-->
<version>1.9.0-SNAPSHOT</version> <!-- <version>1.9.0-SNAPSHOT</version>-->
<scope>compile</scope> <!-- <scope>compile</scope>-->
</dependency> <!-- </dependency>-->
<dependency> <dependency>
<groupId>com.taosdata.jdbc</groupId> <groupId>com.taosdata.jdbc</groupId>
<artifactId>taos-jdbcdriver</artifactId> <artifactId>taos-jdbcdriver</artifactId>
......
...@@ -178,9 +178,7 @@ public class PowerGenerationImpl { ...@@ -178,9 +178,7 @@ public class PowerGenerationImpl {
} }
public List<ESMoonPowerGeneration> getESMoonPowerGeneration(StationCacheInfoDto stationCacheInfoDto,List<IndicatorData> indexDto,String daty,String day,String year,Double flags){ public List<ESMoonPowerGeneration> getESMoonPowerGeneration(StationCacheInfoDto stationCacheInfoDto,List<IndicatorData> indexDto,String daty,String day,String year,Double flags){
List<ESMoonPowerGeneration> list=new ArrayList<>(); List<ESMoonPowerGeneration> list=new ArrayList<>();
SimpleDateFormat myFmt2=new SimpleDateFormat("yyyy-MM-dd");
Date now=new Date();
String datynew= myFmt2.format(now);
if(indexDto!=null&&!indexDto.isEmpty()){ if(indexDto!=null&&!indexDto.isEmpty()){
for (IndicatorData dto : indexDto) { for (IndicatorData dto : indexDto) {
double value=dto.getValueF()!=null?(double)dto.getValueF():0.0; double value=dto.getValueF()!=null?(double)dto.getValueF():0.0;
...@@ -188,7 +186,7 @@ public class PowerGenerationImpl { ...@@ -188,7 +186,7 @@ public class PowerGenerationImpl {
value=value*flags; value=value*flags;
} }
ESMoonPowerGeneration moonPowerGeneration=new ESMoonPowerGeneration( ESMoonPowerGeneration moonPowerGeneration=new ESMoonPowerGeneration(
datynew+"_"+dto.getAddress(), daty+"_"+dto.getAddress(),
stationCacheInfoDto.getStationId(), stationCacheInfoDto.getStationId(),
stationCacheInfoDto.getStationName(), stationCacheInfoDto.getStationName(),
stationCacheInfoDto.getStationType(), stationCacheInfoDto.getStationType(),
...@@ -210,9 +208,7 @@ public class PowerGenerationImpl { ...@@ -210,9 +208,7 @@ public class PowerGenerationImpl {
} }
public List<ESYearPowerGeneration> getESYearPowerGeneration(StationCacheInfoDto stationCacheInfoDto,List<IndicatorData> indexDto,String daty,String day,Double flags){ public List<ESYearPowerGeneration> getESYearPowerGeneration(StationCacheInfoDto stationCacheInfoDto,List<IndicatorData> indexDto,String daty,String day,Double flags){
List<ESYearPowerGeneration> list=new ArrayList<>(); List<ESYearPowerGeneration> list=new ArrayList<>();
SimpleDateFormat myFmt2=new SimpleDateFormat("yyyy-MM-dd");
Date now=new Date();
String datynew= myFmt2.format(now);
if(indexDto!=null&&!indexDto.isEmpty()){ if(indexDto!=null&&!indexDto.isEmpty()){
for (IndicatorData dto : indexDto) { for (IndicatorData dto : indexDto) {
double value=dto.getValueF()!=null?(double)dto.getValueF():0.0; double value=dto.getValueF()!=null?(double)dto.getValueF():0.0;
...@@ -220,7 +216,7 @@ public class PowerGenerationImpl { ...@@ -220,7 +216,7 @@ public class PowerGenerationImpl {
value=value*flags; value=value*flags;
} }
ESYearPowerGeneration yearPowerGeneration=new ESYearPowerGeneration( ESYearPowerGeneration yearPowerGeneration=new ESYearPowerGeneration(
datynew+"_"+dto.getAddress(), daty+"_"+dto.getAddress(),
stationCacheInfoDto.getStationId(), stationCacheInfoDto.getStationId(),
stationCacheInfoDto.getStationName(), stationCacheInfoDto.getStationName(),
stationCacheInfoDto.getStationType(), stationCacheInfoDto.getStationType(),
......
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