Commit 653e2c84 authored by wujiang's avatar wujiang

修改特种设备bug

parent 7f0787ce
...@@ -123,4 +123,5 @@ public class RegUnitInfoDto extends BaseDto { ...@@ -123,4 +123,5 @@ public class RegUnitInfoDto extends BaseDto {
@ApiModelProperty(value = "平台用户id,平台创建用户后更新") @ApiModelProperty(value = "平台用户id,平台创建用户后更新")
private String adminUserId; private String adminUserId;
} }
...@@ -17,4 +17,26 @@ public interface ICylinderInfoService { ...@@ -17,4 +17,26 @@ public interface ICylinderInfoService {
* @return * @return
*/ */
Map<String, String> queryNumAndOutOfDateNum(Long unitId); Map<String, String> queryNumAndOutOfDateNum(Long unitId);
void synFillingUnloadData();
void synAreaData();
void addIntegrityData();
void getCylinderUnitInfo();
void getCylinderInfo();
void synUnitCylinderInfoData();
void synUnitCylinderFillingData();
void synUnitCylinderTagsData();
void synUnitIntegrityData();
void synUnitFillingCheckData();
void synFillingUnloadUnitData();
} }
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
WHERE WHERE
t.sequence_nbr IN ( SELECT max( tt.sequence_nbr ) FROM tz_cylinder_info tt GROUP BY tt.sequence_code ) t.sequence_nbr IN ( SELECT max( tt.sequence_nbr ) FROM tz_cylinder_info tt GROUP BY tt.sequence_code )
AND u.sequence_nbr = #{sequenceNbr} AND u.sequence_nbr = #{sequenceNbr}
GROUP BY t.sequence_nbr GROUP BY u.sequence_nbr
</select> </select>
<sql id="selectAPPIdByRegionCode"> <sql id="selectAPPIdByRegionCode">
......
...@@ -5,18 +5,16 @@ ...@@ -5,18 +5,16 @@
<select id="getInfoByUseUnit" <select id="getInfoByUseUnit"
resultType="com.yeejoin.amos.boot.module.tzs.api.dto.EquEnterDto"> resultType="com.yeejoin.amos.boot.module.tzs.api.dto.EquEnterDto">
SELECT SELECT
RI.sequence_nbr, RI.sequence_nbr,
RI.use_org_code, RI.use_org_code,
RI.equ_category, RI.equ_category,
RI.product_name, RI.product_name,
UI.address UI.address
FROM FROM tz_jg_registration_info RI
tz_jg_registration_info AS RI LEFT JOIN tz_jg_use_info UI ON RI.sequence_code = UI.sequence_code
LEFT JOIN tz_jg_use_info UI ON RI.sequence_code = UI.sequence_code LEFT JOIN tz_base_enterprise_info EI ON EI.use_code = UI.use_unit_credit_code
LEFT JOIN tz_base_enterprise_info EI ON EI.use_unit = #{useUnit} WHERE EI.use_unit =#{useUnit}
WHERE
EI.use_code = RI.organization_code
</select> </select>
<select id="getInfo" <select id="getInfo"
......
...@@ -30,6 +30,7 @@ import com.yeejoin.amos.boot.biz.common.utils.oConvertUtils; ...@@ -30,6 +30,7 @@ import com.yeejoin.amos.boot.biz.common.utils.oConvertUtils;
import com.yeejoin.amos.boot.module.tzs.biz.listener.BaseEnterpriseMqTtlListener; import com.yeejoin.amos.boot.module.tzs.biz.listener.BaseEnterpriseMqTtlListener;
import com.yeejoin.amos.boot.module.tzs.biz.listener.CarcylUnitInspectMqTtlListener; import com.yeejoin.amos.boot.module.tzs.biz.listener.CarcylUnitInspectMqTtlListener;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.StartPlatformTokenService; import com.yeejoin.amos.boot.module.tzs.biz.service.impl.StartPlatformTokenService;
import com.yeejoin.amos.boot.module.tzs.flc.api.service.ICylinderInfoService;
/** /**
* <pre> * <pre>
...@@ -71,6 +72,9 @@ public class AmosTzsApplication { ...@@ -71,6 +72,9 @@ public class AmosTzsApplication {
@Autowired @Autowired
private PrivilegeCompanyDeleteListener privilegeCompanyDeleteListener; private PrivilegeCompanyDeleteListener privilegeCompanyDeleteListener;
@Autowired
ICylinderInfoService cylinderInfoServiceImpl;
public static void main(String[] args) throws UnknownHostException { public static void main(String[] args) throws UnknownHostException {
ConfigurableApplicationContext context = SpringApplication.run(AmosTzsApplication.class, args); ConfigurableApplicationContext context = SpringApplication.run(AmosTzsApplication.class, args);
Environment env = context.getEnvironment(); Environment env = context.getEnvironment();
...@@ -92,14 +96,30 @@ public class AmosTzsApplication { ...@@ -92,14 +96,30 @@ public class AmosTzsApplication {
public void initMqtt() throws MqttException { public void initMqtt() throws MqttException {
emqKeeper.getMqttClient().subscribe("/idx/idx_biz_carcyl_unit_inspect", 1, carcylUnitInspectMqTtlListener); emqKeeper.getMqttClient().subscribe("/idx/idx_biz_carcyl_unit_inspect", 1, carcylUnitInspectMqTtlListener);
emqKeeper.getMqttClient().subscribe("/tm/tz_base_enterprise_info", 1, baseEnterpriseMqTtlListener); emqKeeper.getMqttClient().subscribe("/tm/tz_base_enterprise_info", 1, baseEnterpriseMqTtlListener);
emqKeeper.getMqttClient().subscribe("/tz/privilege_company_add_update",1, privilegeCompanyUpdateAddListener); emqKeeper.getMqttClient().subscribe("/tz/privilege_company_add_update", 1, privilegeCompanyUpdateAddListener);
emqKeeper.getMqttClient().subscribe("/tz/privilege_company_delete",1, privilegeCompanyDeleteListener); emqKeeper.getMqttClient().subscribe("/tz/privilege_company_delete", 1, privilegeCompanyDeleteListener);
// emqKeeper.getMqttClient().subscribe("topic_mqtt_exam", 1, examMqTtlListener); // emqKeeper.getMqttClient().subscribe("topic_mqtt_exam", 1, examMqTtlListener);
// emqKeeper.getMqttClient().subscribe("topic_mqtt_exam_record", 1, examMqTtRecordListener); // emqKeeper.getMqttClient().subscribe("topic_mqtt_exam_record", 1, examMqTtRecordListener);
} }
@Bean @Bean
public void initToken() { public void initToken() {
new Thread(new Runnable() {
@Override
public void run() {
cylinderInfoServiceImpl.synFillingUnloadData();
cylinderInfoServiceImpl.synAreaData();
cylinderInfoServiceImpl.addIntegrityData();
cylinderInfoServiceImpl.getCylinderUnitInfo();
cylinderInfoServiceImpl.getCylinderInfo();
cylinderInfoServiceImpl.synUnitCylinderInfoData();
cylinderInfoServiceImpl.synUnitCylinderFillingData();
cylinderInfoServiceImpl.synUnitCylinderTagsData();
cylinderInfoServiceImpl.synUnitIntegrityData();
cylinderInfoServiceImpl.synUnitFillingCheckData();
cylinderInfoServiceImpl.synFillingUnloadUnitData();
}
}).start();
startPlatformTokenService.getToken(); startPlatformTokenService.getToken();
} }
} }
...@@ -129,7 +129,8 @@ public class TzBaseEnterpriseInfoController { ...@@ -129,7 +129,8 @@ public class TzBaseEnterpriseInfoController {
}); });
IPage<TzBaseEnterpriseInfo> page; IPage<TzBaseEnterpriseInfo> page;
if (StringUtils.isBlank(pageNum) || StringUtils.isBlank(pageSize)) { if (StringUtils.isBlank(pageNum) || StringUtils.isBlank(pageSize)) {
pageBean = new Page<>(0, Long.MAX_VALUE);
pageBean = new Page<>(0, Integer.MAX_VALUE);
} else { } else {
pageBean = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize)); pageBean = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
} }
......
...@@ -105,6 +105,7 @@ public class TzsAuthController extends BaseController { ...@@ -105,6 +105,7 @@ public class TzsAuthController extends BaseController {
map.put("regulator",company.getCompanyName()); map.put("regulator",company.getCompanyName());
} }
map.put("company", company.getCompanyName()); map.put("company", company.getCompanyName());
map.put("companyId", company.getParentId()!=0L?company.getParentId():company.getSequenceNbr());
} }
map.put("userName", result.getResult().getRealName()); map.put("userName", result.getResult().getRealName());
} }
......
package com.yeejoin.amos.boot.module.tzs.biz.service.impl; package com.yeejoin.amos.boot.module.tzs.biz.service.impl;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.context.RequestContext; import org.typroject.tyboot.core.foundation.context.RequestContext;
import com.yeejoin.amos.boot.module.tzs.biz.utils.DesUtil;
import com.yeejoin.amos.boot.module.tzs.biz.utils.RedisUtil; import com.yeejoin.amos.boot.module.tzs.biz.utils.RedisUtil;
import com.yeejoin.amos.component.feign.model.FeignClientResult; import com.yeejoin.amos.component.robot.AmosRequestContext;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.IdPasswordAuthModel;
@Service @Service
public class StartPlatformTokenService { public class StartPlatformTokenService {
...@@ -34,17 +29,14 @@ public class StartPlatformTokenService { ...@@ -34,17 +29,14 @@ public class StartPlatformTokenService {
@Autowired @Autowired
RedisUtil redisUtil; RedisUtil redisUtil;
@Autowired
AmosRequestContext amosRequestContext;
public void getToken() { public void getToken() {
RequestContext.setProduct(product); RequestContext.setProduct(product);
RequestContext.setAppKey(appkey); RequestContext.setAppKey(appkey);
IdPasswordAuthModel authModel = new IdPasswordAuthModel(); String token = amosRequestContext.getToken();
authModel.setLoginId(user);
authModel.setPassword(DesUtil.encode(password, secretKey));
System.out.println("user:" + user);
System.out.println("secretKey:" + secretKey);
FeignClientResult<Map<String, String>> authResult = Privilege.authClient.idpassword(authModel);
String token = authResult.getResult().get("token");
System.out.println("token:" + token); System.out.println("token:" + token);
RequestContext.setToken(token); RequestContext.setToken(token);
redisUtil.set("platform_token", token); redisUtil.set("platform_token", token);
......
...@@ -97,8 +97,19 @@ public class RegUnitInfoController extends BaseController { ...@@ -97,8 +97,19 @@ public class RegUnitInfoController extends BaseController {
if (ValidationUtil.isEmpty(unitCode)) { if (ValidationUtil.isEmpty(unitCode)) {
throw new BadRequest("单位编码不能为空"); throw new BadRequest("单位编码不能为空");
} }
RegUnitInfoDto regUnitInfoDto = iRegUnitInfoService.unitCheck(unitCode, unitType,companyName); try {
return ResponseHelper.buildResponse(regUnitInfoDto); RegUnitInfoDto regUnitInfoDto = iRegUnitInfoService.unitCheck(unitCode, unitType,companyName);
return ResponseHelper.buildResponse(regUnitInfoDto);
}catch (Exception e) {
ResponseModel<RegUnitInfoDto> response = new ResponseModel<>();
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
response.setResult(null);
response.setDevMessage(e.getMessage());
response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.value());
response.setTraceId(RequestContext.getTraceId());
response.setPath(request.getServletPath());
return response;
}
} }
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
......
package com.yeejoin.amos.boot.module.tzs.flc.biz.service.impl; package com.yeejoin.amos.boot.module.tzs.flc.biz.service.impl;
import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collection;
import java.util.Comparator;
import java.util.Date;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.function.Consumer;
import java.util.function.IntConsumer;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
...@@ -10,29 +32,40 @@ import com.yeejoin.amos.boot.module.tzs.api.entity.MsgLog; ...@@ -10,29 +32,40 @@ import com.yeejoin.amos.boot.module.tzs.api.entity.MsgLog;
import com.yeejoin.amos.boot.module.tzs.api.enums.EarlyWarningLevelEnum; import com.yeejoin.amos.boot.module.tzs.api.enums.EarlyWarningLevelEnum;
import com.yeejoin.amos.boot.module.tzs.api.mapper.ScheduleMapper; import com.yeejoin.amos.boot.module.tzs.api.mapper.ScheduleMapper;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.MsgLogServiceImpl; import com.yeejoin.amos.boot.module.tzs.biz.service.impl.MsgLogServiceImpl;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.StartPlatformTokenService;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.TzsAuthServiceImpl; import com.yeejoin.amos.boot.module.tzs.biz.service.impl.TzsAuthServiceImpl;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.*; import com.yeejoin.amos.boot.module.tzs.flc.api.dto.CylinderAreaDataDto;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.*; import com.yeejoin.amos.boot.module.tzs.flc.api.dto.CylinderFillingCheckDataUnitDto;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.CylinderFillingDataUnitDto;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.CylinderFillingUnloadDataDto;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.CylinderFillingUnloadDataUnitDto;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.CylinderInfoDataDto;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.CylinderInfoDataUnitDto;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.CylinderInfoDto;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.CylinderIntegrityDataDto;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.CylinderIntegrityDataUnitDto;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.CylinderTagsDataUnitDto;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.CylinderUnitDataDto;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.CylinderAreaData;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.CylinderFillingCheckDataUnit;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.CylinderFillingDataUnit;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.CylinderFillingUnloadData;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.CylinderFillingUnloadDataUnit;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.CylinderInfo;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.CylinderInfoDataUnit;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.CylinderIntegrityData;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.CylinderIntegrityDataUnit;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.CylinderTags;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.CylinderTagsDataUnit;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.CylinderUnit;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.CylinderUnitData;
import com.yeejoin.amos.boot.module.tzs.flc.api.mapper.CylinderInfoMapper; import com.yeejoin.amos.boot.module.tzs.flc.api.mapper.CylinderInfoMapper;
import com.yeejoin.amos.boot.module.tzs.flc.api.service.ICylinderInfoService; import com.yeejoin.amos.boot.module.tzs.flc.api.service.ICylinderInfoService;
import com.yeejoin.amos.component.rule.RuleTrigger; import com.yeejoin.amos.component.rule.RuleTrigger;
import com.yeejoin.amos.feign.systemctl.Systemctl; import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.RegionModel; import com.yeejoin.amos.feign.systemctl.model.RegionModel;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.math.BigDecimal; import lombok.extern.slf4j.Slf4j;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.function.Consumer;
import java.util.function.IntConsumer;
/** /**
* 气瓶基本信息服务实现类 * 气瓶基本信息服务实现类
...@@ -110,6 +143,9 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind ...@@ -110,6 +143,9 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
@Value("${cylinder-early-warning-packageId:气瓶消息预警/cylwarningmsg}") @Value("${cylinder-early-warning-packageId:气瓶消息预警/cylwarningmsg}")
private String cylPackageId; private String cylPackageId;
@Autowired
StartPlatformTokenService startPlatformTokenService;
/** /**
* 分页查询 * 分页查询
...@@ -218,28 +254,37 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind ...@@ -218,28 +254,37 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
* 按区域统计 * 按区域统计
*/ */
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Scheduled(cron = "0 0 2 * * ?") @Scheduled(cron = "* * 2 * * ?")
public void addIntegrityData() { public void addIntegrityData() {
System.out.println("====================数据完整性开始============================");
cylinderIntegrityDataServiceImpl.remove(new LambdaQueryWrapper<CylinderIntegrityData>()); cylinderIntegrityDataServiceImpl.remove(new LambdaQueryWrapper<CylinderIntegrityData>());
countByRegion(regionModel -> { countByRegion(regionModel -> {
List<CylinderUnit> unitlist = cylinderUnitServiceImpl.list(new LambdaQueryWrapper<CylinderUnit>().like(CylinderUnit::getRegionCode, regionModel)); List<CylinderUnit> unitlist = cylinderUnitServiceImpl.list(new LambdaQueryWrapper<CylinderUnit>().like(CylinderUnit::getRegionCode, regionModel.getRegionCode()));
List<CylinderIntegrityDataDto> tempList = new LinkedList<>(); List<CylinderIntegrityDataDto> tempList = new LinkedList<>();
System.out.println("====================regioncode: "+regionModel.getRegionCode()+"============================");
unitlist.forEach(t -> { unitlist.forEach(t -> {
System.out.println("====================appId: "+t.getAppId()+"============================");
CylinderIntegrityDataDto temp = new CylinderIntegrityDataDto(); CylinderIntegrityDataDto temp = new CylinderIntegrityDataDto();
String appId = t.getAppId(); String appId = t.getAppId();
Double totalIntegirty = 0d; Double totalIntegirty = 0d;
// tz_cylinder_info // tz_cylinder_info
Double unitIntegirty = t.getIntegrity(); Double unitIntegirty = t.getIntegrity();
unitIntegirty=unitIntegirty==null?0d:unitIntegirty;
//tz_cylinder_tags //tz_cylinder_tags
Double tagIntegirty = cylinderTagsServiceImpl.queryIntegirtyByAppId(appId); Double tagIntegirty = cylinderTagsServiceImpl.queryIntegirtyByAppId(appId);
//tz_cylinder_info tagIntegirty=tagIntegirty==null?0d:tagIntegirty;
//tz_cylinder_info
Double infoIntegirty = this.queryIntegirtyByAppId(appId); Double infoIntegirty = this.queryIntegirtyByAppId(appId);
infoIntegirty=infoIntegirty==null?0d:infoIntegirty;
// tz_cylinder_filling_record 30天内 // tz_cylinder_filling_record 30天内
Double recordIntegirty = cylinderFillingRecordServiceImpl.queryIntegirtyByAppId(appId); Double recordIntegirty = cylinderFillingRecordServiceImpl.queryIntegirtyByAppId(appId);
//tz_cylinder_filling 30天内 recordIntegirty=recordIntegirty==null?0d:recordIntegirty;
//tz_cylinder_filling 30天内ji
Double fillingIntegirty = cylinderFillingServiceImpl.queryIntegirtyByAppId(appId); Double fillingIntegirty = cylinderFillingServiceImpl.queryIntegirtyByAppId(appId);
fillingIntegirty=fillingIntegirty==null?0d:fillingIntegirty;
//tz_cylinder_filling_check 30天内 //tz_cylinder_filling_check 30天内
Double checkIntegirty = cylinderFillingCheckServiceImpl.queryIntegirtyByAppId(appId); Double checkIntegirty = cylinderFillingCheckServiceImpl.queryIntegirtyByAppId(appId);
checkIntegirty=checkIntegirty==null?0d:checkIntegirty;
totalIntegirty = (unitIntegirty + tagIntegirty + infoIntegirty + recordIntegirty + fillingIntegirty + checkIntegirty) / 6; totalIntegirty = (unitIntegirty + tagIntegirty + infoIntegirty + recordIntegirty + fillingIntegirty + checkIntegirty) / 6;
BigDecimal bg = new BigDecimal(totalIntegirty); BigDecimal bg = new BigDecimal(totalIntegirty);
totalIntegirty = bg.setScale(4, BigDecimal.ROUND_HALF_UP).doubleValue() * 100; totalIntegirty = bg.setScale(4, BigDecimal.ROUND_HALF_UP).doubleValue() * 100;
...@@ -258,9 +303,12 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind ...@@ -258,9 +303,12 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
tempList.sort(Comparator.comparing(CylinderIntegrityDataDto::getIntegrity)); tempList.sort(Comparator.comparing(CylinderIntegrityDataDto::getIntegrity));
}); });
tempList.forEach(t -> { tempList.forEach(t -> {
System.out.println("====================unitName: "+t.getUnitName()+"============================");
t.setUpdateTime(new Date());
cylinderIntegrityDataServiceImpl.createWithModel(t); cylinderIntegrityDataServiceImpl.createWithModel(t);
}); });
}); });
System.out.println("====================数据完整性结束============================");
} }
/** /**
...@@ -287,6 +335,7 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind ...@@ -287,6 +335,7 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
temp.setChangePercent((int) (percent * 100) + ""); temp.setChangePercent((int) (percent * 100) + "");
temp.setRegionCode(regionCode); temp.setRegionCode(regionCode);
temp.setTotalSum((long) cylinderUnitTotal); temp.setTotalSum((long) cylinderUnitTotal);
temp.setUpdateTime(new Date());
cylinderUnitDataServiceImpl.createWithModel(temp); cylinderUnitDataServiceImpl.createWithModel(temp);
}); });
} }
...@@ -574,6 +623,7 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind ...@@ -574,6 +623,7 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
*/ */
private void countByRegion(Consumer<RegionModel> consumer) { private void countByRegion(Consumer<RegionModel> consumer) {
List<RegionModel> regionList = new ArrayList<>(); List<RegionModel> regionList = new ArrayList<>();
startPlatformTokenService.getToken();
Collection<RegionModel> regions = Systemctl.regionClient.queryForTree(null).getResult(); Collection<RegionModel> regions = Systemctl.regionClient.queryForTree(null).getResult();
regions.forEach(regionModel -> convertTreeToList(regionList, regionModel)); regions.forEach(regionModel -> convertTreeToList(regionList, regionModel));
regionList.forEach(consumer); regionList.forEach(consumer);
......
...@@ -228,7 +228,7 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI ...@@ -228,7 +228,7 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
FeignClientResult<CompanyModel> result =Privilege.companyClient.queryByCompanyName(companyName); FeignClientResult<CompanyModel> result =Privilege.companyClient.queryByCompanyName(companyName);
if(result.getResult()!=null) if(result.getResult()!=null)
{ {
throw new BadRequest("重复的公司名称"); throw new RuntimeException("重复的公司名称");
} }
} }
......
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