Commit aa121a5c authored by zhangsen's avatar zhangsen

Merge remote-tracking branch 'origin/developer' into developer

parents 009aebe8 23f55cc2
...@@ -2,6 +2,9 @@ package com.yeejoin.amos.boot.module.hygf.api.mapper; ...@@ -2,6 +2,9 @@ package com.yeejoin.amos.boot.module.hygf.api.mapper;
import com.yeejoin.amos.boot.module.hygf.api.entity.CommerceInfo; import com.yeejoin.amos.boot.module.hygf.api.entity.CommerceInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/** /**
* 经销商单位信息 Mapper 接口 * 经销商单位信息 Mapper 接口
...@@ -11,4 +14,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -11,4 +14,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/ */
public interface CommerceInfoMapper extends BaseMapper<CommerceInfo> { public interface CommerceInfoMapper extends BaseMapper<CommerceInfo> {
List<CommerceInfo> selectListby(@Param("creditCode") String creditCode);
} }
...@@ -2,4 +2,23 @@ ...@@ -2,4 +2,23 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.hygf.api.mapper.CommerceInfoMapper"> <mapper namespace="com.yeejoin.amos.boot.module.hygf.api.mapper.CommerceInfoMapper">
<select id="selectListby" resultType="com.yeejoin.amos.boot.module.hygf.api.entity.CommerceInfo">
select
hygf_commerce_info.sequence_nbr sequenceNbr
from hygf_commerce_info LEFT JOIN hygf_unit_info
on hygf_unit_info.sequence_nbr=hygf_commerce_info.unit_seq
where hygf_commerce_info.is_delete=0 and hygf_commerce_info.credit_code=#{creditCode}
and hygf_unit_info.audit_status!=3
</select>
</mapper> </mapper>
...@@ -274,6 +274,7 @@ public class UnitInfoController extends BaseController { ...@@ -274,6 +274,7 @@ public class UnitInfoController extends BaseController {
LambdaQueryWrapper<UnitInfo> qudg=new LambdaQueryWrapper<>(); LambdaQueryWrapper<UnitInfo> qudg=new LambdaQueryWrapper<>();
qudg.eq(UnitInfo::getName,model.getUnitInfoDto().getName()); qudg.eq(UnitInfo::getName,model.getUnitInfoDto().getName());
qudg.eq(UnitInfo::getIsDelete,0); qudg.eq(UnitInfo::getIsDelete,0);
qudg.ne(UnitInfo::getAuditStatus,3);
List<UnitInfo> unitInfo= unitInfoMapper.selectList(qudg); List<UnitInfo> unitInfo= unitInfoMapper.selectList(qudg);
if(unitInfo!=null&&!unitInfo.isEmpty()){ if(unitInfo!=null&&!unitInfo.isEmpty()){
...@@ -282,10 +283,12 @@ public class UnitInfoController extends BaseController { ...@@ -282,10 +283,12 @@ public class UnitInfoController extends BaseController {
//判断公司统一信息用代码重复 //判断公司统一信息用代码重复
LambdaQueryWrapper<CommerceInfo> queryWrapper1 = new LambdaQueryWrapper<CommerceInfo>(); // LambdaQueryWrapper<CommerceInfo> queryWrapper1 = new LambdaQueryWrapper<CommerceInfo>();
queryWrapper1.eq(CommerceInfo::getCreditCode, model.getCommerceInfoDto().getCreditCode()); // queryWrapper1.eq(CommerceInfo::getCreditCode, model.getCommerceInfoDto().getCreditCode());
queryWrapper1.eq(CommerceInfo::getIsDelete,0); // queryWrapper1.eq(CommerceInfo::getIsDelete,0);
List<CommerceInfo> commerceInfo= commerceInfoMapper.selectList(queryWrapper1); // List<CommerceInfo> commerceInfo= commerceInfoMapper.selectList(queryWrapper1);
List<CommerceInfo> commerceInfo= commerceInfoMapper.selectListby( model.getCommerceInfoDto().getCreditCode());
if(commerceInfo!=null&&!commerceInfo.isEmpty()){ if(commerceInfo!=null&&!commerceInfo.isEmpty()){
throw new BadRequest("统一信用代码重复"); throw new BadRequest("统一信用代码重复");
...@@ -295,7 +298,8 @@ public class UnitInfoController extends BaseController { ...@@ -295,7 +298,8 @@ public class UnitInfoController extends BaseController {
LambdaQueryWrapper<UnitInfo> qudg1=new LambdaQueryWrapper<>(); LambdaQueryWrapper<UnitInfo> qudg1=new LambdaQueryWrapper<>();
qudg1.eq(UnitInfo::getAdminLoginName,model.getUnitInfoDto().getAdminLoginName()); qudg1.eq(UnitInfo::getAdminLoginName,model.getUnitInfoDto().getAdminLoginName());
qudg1.eq(UnitInfo::getIsDelete,0); qudg1.eq(UnitInfo::getIsDelete,0);
List<UnitInfo> unitInfo1= unitInfoMapper.selectList(qudg); qudg1.ne(UnitInfo::getAuditStatus,3);
List<UnitInfo> unitInfo1= unitInfoMapper.selectList(qudg1);
if(unitInfo1!=null&&!unitInfo1.isEmpty()){ if(unitInfo1!=null&&!unitInfo1.isEmpty()){
throw new BadRequest("管理员账户名重复,请更换"); throw new BadRequest("管理员账户名重复,请更换");
......
...@@ -22,6 +22,7 @@ import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.MonitorFanIndicatorIm ...@@ -22,6 +22,7 @@ import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.MonitorFanIndicatorIm
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.MonitoringServiceImpl; import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.MonitoringServiceImpl;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.eclipse.paho.client.mqttv3.MqttException; import org.eclipse.paho.client.mqttv3.MqttException;
import org.elasticsearch.index.query.BoolQueryBuilder; import org.elasticsearch.index.query.BoolQueryBuilder;
...@@ -1113,9 +1114,11 @@ public class MonitorFanIdxController extends BaseController { ...@@ -1113,9 +1114,11 @@ public class MonitorFanIdxController extends BaseController {
Map<String, List<ESEquipments>> resultMap = equipments.stream().collect(Collectors.groupingBy(ESEquipments::getEquipmentNumber)); Map<String, List<ESEquipments>> resultMap = equipments.stream().collect(Collectors.groupingBy(ESEquipments::getEquipmentNumber));
for (String key : resultMap.keySet()) { for (String key : resultMap.keySet()) {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("name", key); map.put("num", key);
for (ESEquipments equip : resultMap.get(key)) { for (ESEquipments equip : resultMap.get(key)) {
String value = String.format("%.4f", equip.getValueF()); String value = String.format("%.4f", equip.getValueF());
map.put("name", equip.getEquipmentSpecificName().substring(0, equip.getEquipmentSpecificName().indexOf("#"))+"/"+key);
switch (equip.getEquipmentIndexName()) { switch (equip.getEquipmentIndexName()) {
case "日发电量": case "日发电量":
map.put("dayNum", value); map.put("dayNum", value);
...@@ -1138,6 +1141,9 @@ public class MonitorFanIdxController extends BaseController { ...@@ -1138,6 +1141,9 @@ public class MonitorFanIdxController extends BaseController {
} }
esEquipmentsMap.add(map); esEquipmentsMap.add(map);
} }
this.sortByFeild(esEquipmentsMap,"num");
IPage<Map<String, Object>> page = new Page<>(); IPage<Map<String, Object>> page = new Page<>();
page.setTotal(esEquipmentsMap.size()); page.setTotal(esEquipmentsMap.size());
page.setSize(999); page.setSize(999);
...@@ -1157,6 +1163,17 @@ public class MonitorFanIdxController extends BaseController { ...@@ -1157,6 +1163,17 @@ public class MonitorFanIdxController extends BaseController {
} }
public static List<Map<String, Object>> sortByFeild(List<Map<String, Object>> list, String feild) {
if (CollectionUtils.isNotEmpty(list)) {
Collections.sort(list, (m1, m2)-> Integer.valueOf(m1.get(feild).toString()).compareTo(Integer.valueOf(m2.get(feild).toString())));
}
return list;
}
//@Scheduled(cron = "0/10 * * * * ? ") //@Scheduled(cron = "0/10 * * * * ? ")
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "测试方法 ") @ApiOperation(value = "测试方法 ")
......
...@@ -614,6 +614,7 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto, PersonBa ...@@ -614,6 +614,7 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto, PersonBa
try { try {
amosLoginfo = Privilege.agencyUserClient.createLoginInfo(userDto); amosLoginfo = Privilege.agencyUserClient.createLoginInfo(userDto);
} catch (Exception e) { } catch (Exception e) {
FeignClientResult<List<String>> cResult = Privilege.agencyUserClient.multDeleteUser(userDto.getUserId(),true);
throw new RuntimeException(e); throw new RuntimeException(e);
} }
return amosLoginfo.getResult(); return amosLoginfo.getResult();
...@@ -680,7 +681,7 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto, PersonBa ...@@ -680,7 +681,7 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto, PersonBa
} }
private void deleuser(String userid) { private void deleuser(String userid) {
FeignClientResult<List<String>> cResult = Privilege.agencyUserClient.multDeleteUser(userid); FeignClientResult<List<String>> cResult = Privilege.agencyUserClient.multDeleteUser(userid,true);
if (!ObjectUtils.isEmpty(cResult)) { if (!ObjectUtils.isEmpty(cResult)) {
if (cResult.getStatus() != 200) { if (cResult.getStatus() != 200) {
......
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
<dependency> <dependency>
<groupId>com.yeejoin</groupId> <groupId>com.yeejoin</groupId>
<artifactId>amos-feign-privilege</artifactId> <artifactId>amos-feign-privilege</artifactId>
<version>1.8.5</version> <version>1.9.0-SNAPSHOT</version>
</dependency> </dependency>
......
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