Commit 9adfac96 authored by tianbo's avatar tianbo

Merge branch 'develop_tzs_register' of…

Merge branch 'develop_tzs_register' of http://39.98.45.134:8090/moa/amos-boot-biz into develop_tzs_register # Conflicts: # amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-api/src/main/java/com/yeejoin/amos/boot/module/tcm/api/service/IThreeSystemsService.java # amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-biz/src/main/java/com/yeejoin/amos/boot/module/tcm/biz/service/impl/ThreeSystemsServiceImpl.java
parents ac6ec0c8 2358b46b
......@@ -17,6 +17,7 @@ public class DateUtils {
public static final String DATE_TIME_PATTERN = "yyyy-MM-dd HH:mm:ss";
public static final String MINUTE_PATTERN = "yyyy-MM-dd HH:mm";
public static final String DATE_HOUR_PATTERN = "yyyy-MM-dd HH";
public static final String HOUR_PATTERN = "yyyy-MM-dd HH:mm:ss";
public static final String DATE_PATTERN = "yyyy-MM-dd";
public static final String MONTH_PATTERN = "yyyy-MM";
......
package com.yeejoin.amos.boot.module.elevator.api.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
*
*
* @author system_generator
* @date 2023-11-02
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="AlertStatisticsDto", description="")
public class AlertStatisticsDto extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "监管单位ID")
private String supervisoryUnitId;
@ApiModelProperty(value = "监管单位名称")
private String supervisoryUnitName;
@ApiModelProperty(value = "监管单位orgcode")
private String supervisoryUnitOrgcode;
@ApiModelProperty(value = "电梯总数")
private Integer elevatorNum;
@ApiModelProperty(value = "应急事件")
private Integer emergencyEvents;
@ApiModelProperty(value = "困人救援")
private Integer trappedPeople;
@ApiModelProperty(value = "故障救援")
private Integer breakdownRescue;
@ApiModelProperty(value = "故障救援")
private Integer rescuePersonnel;
@ApiModelProperty(value = "投诉建议")
private Integer complaint;
@ApiModelProperty(value = "故障率")
private Integer failureRate;
@ApiModelProperty(value = "统计日期")
private String statisticsDate;
@ApiModelProperty(value = "统计开始时间")
private String startDate;
@ApiModelProperty(value = "统计结束时间")
private String endDate;
}
package com.yeejoin.amos.boot.module.elevator.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
/**
*
*
* @author system_generator
* @date 2023-11-02
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("tzs_alert_statistics")
public class AlertStatistics extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 监管单位ID
*/
@TableField("supervisory_unit_id")
private String supervisoryUnitId;
/**
* 监管单位名称
*/
@TableField("supervisory_unit_name")
private String supervisoryUnitName;
/**
* 监管单位orgcode
*/
@TableField("supervisory_unit_org_code")
private String supervisoryUnitOrgCode;
/**
* 电梯总数
*/
@TableField("elevator_num")
private Integer elevatorNum;
/**
* 应急事件
*/
@TableField("emergency_events")
private Integer emergencyEvents;
/**
* 困人救援
*/
@TableField("trapped_people")
private Integer trappedPeople;
/**
* 故障救援
*/
@TableField("breakdown_rescue")
private Integer breakdownRescue;
/**
* 解救人员
*/
@TableField("rescue_personnel")
private Integer rescuePersonnel;
/**
* 投诉建议
*/
@TableField("complaint")
private Integer complaint;
/**
* 故障率
*/
@TableField("failure_rate")
private String failureRate;
/**
* 统计日期
*/
@TableField("statistics_date")
private String statisticsDate;
/**
* 统计开始时间
*/
@TableField("start_date")
private String startDate;
/**
* 统计结束时间
*/
@TableField("end_date")
private String endDate;
}
package com.yeejoin.amos.boot.module.elevator.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.elevator.api.entity.AlertStatistics;
import org.apache.ibatis.annotations.Param;
/**
* Mapper 接口
*
* @author system_generator
* @date 2023-11-02
*/
public interface AlertStatisticsMapper extends BaseMapper<AlertStatistics> {
AlertStatistics getStatissticsMessage(@Param("orgCode")String orgCode, @Param("startDate")String startDate , @Param("endDate")String endDate);
}
package com.yeejoin.amos.boot.module.elevator.api.service;
public interface IAlertStatisticsService {
void statisticalGeneration();
}
<?xml version="1.0" encoding="UTF-8"?>
<!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.elevator.api.mapper.AlertStatisticsMapper">
<select id="getStatissticsMessage"
resultType="com.yeejoin.amos.boot.module.elevator.api.entity.AlertStatistics">
SELECT temp.*,
CASE
when temp.emergencyEventsAll = 0 then '0%'
when temp.elevatorNum = 0 then '0%'
else concat(round((temp.emergencyEventsAll - temp.complaint) / temp.elevatorNum * 100, 2),
'%') end AS failureRate,
(temp.emergencyEventsAll - temp.complaint) as emergencyEvents
FROM (
SELECT (
SELECT COUNT(1)
FROM idx_biz_jg_supervision_info
WHERE ORG_BRANCH_CODE LIKE concat(#{orgCode}, '%')) AS elevatorNum,
(SELECT COUNT(1)
FROM tz_alert_called
WHERE equipment_id IN (SELECT RECORD
FROM idx_biz_jg_supervision_info
WHERE ORG_BRANCH_CODE LIKE concat(#{orgCode}, '%') ) and call_time BETWEEN #{startDate} and #{endDate}) AS emergencyEventsAll,
(SELECT COUNT(1)
FROM tz_alert_called
WHERE alarm_type_code = '960'
AND equipment_id IN (SELECT RECORD
FROM idx_biz_jg_supervision_info
WHERE ORG_BRANCH_CODE LIKE concat(#{orgCode}, '%')) and call_time BETWEEN #{startDate} and #{endDate}) AS trappedPeople,
(SELECT COUNT(1)
FROM tz_alert_called
WHERE alarm_type_code = '961'
AND equipment_id IN (SELECT RECORD
FROM idx_biz_jg_supervision_info
WHERE ORG_BRANCH_CODE LIKE concat(#{orgCode}, '%')) and call_time BETWEEN #{startDate} and #{endDate}) AS breakdownRescue,
(SELECT COUNT(1)
FROM tz_alert_called
WHERE alarm_type_code = '962'
AND equipment_id IN (SELECT RECORD
FROM idx_biz_jg_supervision_info
WHERE ORG_BRANCH_CODE LIKE concat(#{orgCode}, '%')) and call_time BETWEEN #{startDate} and #{endDate}) AS complaint,
(
SELECT (
(
SELECT ifnull(SUM(field_value), 0)
FROM tz_alert_form_value
WHERE alert_called_id IN (
SELECT sequence_nbr
FROM tz_alert_called
WHERE equipment_id IN (
SELECT RECORD
FROM idx_biz_jg_supervision_info
WHERE ORG_BRANCH_CODE LIKE concat(#{orgCode}, '%')) and call_time BETWEEN #{startDate} and #{endDate})
AND field_code = 'trapped_num'
) - (
SELECT ifnull(SUM(field_value), 0)
FROM tz_alert_form_value
WHERE alert_called_id IN (
SELECT sequence_nbr
FROM tz_alert_called
WHERE equipment_id IN (
SELECT RECORD
FROM idx_biz_jg_supervision_info
WHERE ORG_BRANCH_CODE LIKE concat(#{orgCode}, '%')) and call_time BETWEEN #{startDate} and #{endDate})
AND field_code = 'die_num'
)
)) AS rescuePersonnel
) temp
</select>
</mapper>
package com.yeejoin.amos.boot.module.elevator.biz.controller;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.elevator.api.dto.TemplateDto;
import com.yeejoin.amos.boot.module.elevator.api.service.IAlertStatisticsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
@RestController
@Api(tags = "统计Api")
@RequestMapping(value = "/statistics")
public class StatisticsController extends BaseController {
@Autowired
private IAlertStatisticsService alertStatisticsService;
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/statisticalGeneration")
@ApiOperation(httpMethod = "GET", value = "生成统计数据", notes = "生成统计数据")
public ResponseModel<Object> statisticalGeneration() {
alertStatisticsService.statisticalGeneration();
return ResponseHelper.buildResponse("success");
}
}
package com.yeejoin.amos.boot.module.elevator.biz.service.impl;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.elevator.api.common.BizCommonConstant;
import com.yeejoin.amos.boot.module.elevator.api.dto.AlertStatisticsDto;
import com.yeejoin.amos.boot.module.elevator.api.entity.AlertStatistics;
import com.yeejoin.amos.boot.module.elevator.api.mapper.AlertStatisticsMapper;
import com.yeejoin.amos.boot.module.elevator.api.service.IAlertStatisticsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.text.SimpleDateFormat;
import java.util.*;
@Service
public class AlertStatisticsServiceImpl extends BaseService<AlertStatisticsDto, AlertStatistics, AlertStatisticsMapper> implements IAlertStatisticsService {
private static final String REGULATOR_UNIT_TREE = "REGULATOR_UNIT_TREE";
@Autowired
RedisUtils redisUtils;
@Override
public void statisticalGeneration() {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
Calendar cal = Calendar.getInstance();
cal.setTime(new Date());
cal.add(Calendar.MONTH, -1);
cal.set(Calendar.DAY_OF_MONTH, cal.getActualMinimum(Calendar.DAY_OF_MONTH));
Date firstDayOfMonth = cal.getTime();
cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH));
Date lastDayOfMonth = cal.getTime();
ArrayList<AlertStatistics> list = new ArrayList<>();
List<LinkedHashMap> supervisionList = getSupervisionList();
if (!ObjectUtils.isEmpty(supervisionList)) {
supervisionList.forEach(item -> {
if (!ObjectUtils.isEmpty(item.get("orgCode"))) {
AlertStatistics statissticsMessage = this.getBaseMapper().getStatissticsMessage(String.valueOf(item.get("orgCode")), format.format(firstDayOfMonth) + " 00:00:00", format.format(lastDayOfMonth) + " 23:59:59");
statissticsMessage.setSupervisoryUnitName(String.valueOf(item.get("companyName")));
statissticsMessage.setSupervisoryUnitOrgCode(String.valueOf(item.get("orgCode")));
statissticsMessage.setSupervisoryUnitId(String.valueOf(item.get("sequenceNbr")));
statissticsMessage.setStartDate(format.format(firstDayOfMonth));
statissticsMessage.setEndDate(format.format(lastDayOfMonth));
statissticsMessage.setStatisticsDate(format.format(lastDayOfMonth).substring(0, 7));
list.add(statissticsMessage);
}
});
}
this.saveBatch(list);
}
private List<LinkedHashMap> getSupervisionList() {
List<LinkedHashMap> data = (List<LinkedHashMap>) redisUtils.get(REGULATOR_UNIT_TREE);
if (!ObjectUtils.isEmpty(data)) {
data = (List<LinkedHashMap>) data.get(0).get("children");
}
return data;
}
}
\ No newline at end of file
......@@ -26,12 +26,22 @@ public class ThreeSystemsDto extends BaseDto {
@ApiModelProperty(value = "监管单位名称")
private String supervisoryUnitName;
@ApiModelProperty(value = "监管单位orgcode")
private String supervisoryUnitOrgcode;
@ApiModelProperty(value = "监管单位orgCode")
private String supervisoryUnitOrgCode;
@ApiModelProperty(value = "监管单位等级")
private String supervisoryUnitLevel;
@ApiModelProperty(value = "使用单位类型")
private String unitType;
@ApiModelProperty(value = "使用单位统一信用代码")
private String useCode;
@ApiModelProperty(value = "检查状态")
private String checkStatus;
@ApiModelProperty(value = "占比")
private String proportion;
......@@ -48,7 +58,7 @@ public class ThreeSystemsDto extends BaseDto {
private String planType;
@ApiModelProperty(value = "统计日期")
private Date checkDate;
private String checkDate;
@ApiModelProperty(value = "统计开始日期")
private Date startDate;
......
......@@ -39,8 +39,8 @@ public class ThreeSystems extends BaseEntity {
/**
* 监管单位orgcode
*/
@TableField("supervisory_unit_orgcode")
private String supervisoryUnitOrgcode;
@TableField("supervisory_unit_org_code")
private String supervisoryUnitOrgCode;
/**
* 监管单位等级
......@@ -82,6 +82,6 @@ public class ThreeSystems extends BaseEntity {
* 统计日期
*/
@TableField("check_date")
private Date checkDate;
private String checkDate;
}
package com.yeejoin.amos.boot.module.tcm.api.mapper;
import com.yeejoin.amos.boot.module.tcm.api.dto.ThreeSystemsDto;
import com.yeejoin.amos.boot.module.tcm.api.entity.ThreeSystems;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* Mapper 接口
......@@ -11,4 +15,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public interface ThreeSystemsMapper extends BaseMapper<ThreeSystems> {
List<ThreeSystemsDto> getCompanyThreeSystemsStatisticsList(@Param("type") Integer type, @Param("startDay") String startDay, @Param("endDay") String endDay);
void saveOrUpdateBatch(@Param("resultList") List<ThreeSystems> resultList);
List<ThreeSystemsDto> getOldCompanyThreeSystemsStatisticsList(@Param("type") Integer type, @Param("lastStart") String lastStart);
}
......@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.tcm.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.tcm.api.dto.ThreeSystemsDto;
import com.yeejoin.amos.boot.module.tcm.api.dto.TzsTwoStaffingCompanyCheckDto;
import com.yeejoin.amos.boot.module.tcm.api.dto.TzsTwoStaffingCompanyDto;
import com.yeejoin.amos.boot.module.tcm.api.entity.TzsTwoStaffing;
......
......@@ -16,4 +16,6 @@ import java.util.List;
public interface IThreeSystemsService {
List<ThreeSystems> getStatisticsMessage(List<LinkedHashMap> list, String planType, String startDate, String endDate) throws ParseException;
void getThreeSystemsStatistics(String type);
}
......@@ -25,6 +25,5 @@ public interface ITzsTwoStaffingService {
Page<TzsTwoStaffingCompanyCheckDto> getCompanyCheckList(String orgCode, TzsTwoStaffingCompanyCheckDto companyDto, Page<TzsTwoStaffingCompanyCheckDto> page);
void getThreeSystemsStatistics();
}
......@@ -2,4 +2,101 @@
<!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.tcm.api.mapper.ThreeSystemsMapper">
<select id="getCompanyThreeSystemsStatisticsList"
resultType="com.yeejoin.amos.boot.module.tcm.api.dto.ThreeSystemsDto">
SELECT
ei.use_code useCode,
ei.supervise_org_code supervisoryUnitOrgCode,
ei.unit_type unitType,
CASE
WHEN (
SELECT COUNT
( 1 )
FROM
amos_tzs_biz.p_plan_task pt
WHERE
pt.finish_status = '2'
AND ppt.use_code = pt.use_code
AND pt.check_date BETWEEN #{startDay}
AND #{endDay}
AND pt.plan_type = #{type}
) > 0 THEN
1 ELSE 0
END AS checkStatus
FROM
amos_tzs_biz.tz_base_enterprise_info ei
LEFT JOIN amos_tzs_biz.p_plan_task ppt ON ei.use_code = ppt.use_code
GROUP BY
ei.use_code
</select>
<select id="saveOrUpdateBatch">
INSERT INTO "amos_tzs_biz"."tzs_three_systems" (
"sequence_nbr",
"rec_date",
"rec_user_id",
"rec_user_name",
"is_delete",
"supervisory_unit_id",
"supervisory_unit_name",
"supervisory_unit_org_code",
"supervisory_unit_level",
"proportion",
"registered_num",
"check_num",
"finish_check_num",
"plan_type",
"check_date"
)
VALUES <foreach collection="resultList" item="item" index="index" separator=",">
(
#{item.sequenceNbr},
#{item.recDate},
#{item.recUserId},
#{item.recUserName},
false,
#{item.supervisoryUnitId},
#{item.supervisoryUnitName},
#{item.supervisoryUnitOrgCode},
#{item.supervisoryUnitLevel},
#{item.proportion},
#{item.registeredNum},
#{item.checkNum},
#{item.finishCheckNum},
#{item.planType},
#{item.checkDate}
)
</foreach>
on conflict (supervisory_unit_org_code,plan_type,check_date) do update set
"sequence_nbr" = EXCLUDED."sequence_nbr",
"rec_date" = EXCLUDED."rec_date",
"rec_user_id" = EXCLUDED."rec_user_id",
"rec_user_name" = EXCLUDED."rec_user_name",
"is_delete" = EXCLUDED."is_delete",
"supervisory_unit_id" = EXCLUDED."supervisory_unit_id",
"supervisory_unit_name" = EXCLUDED."supervisory_unit_name",
"supervisory_unit_org_code" = EXCLUDED."supervisory_unit_org_code",
"supervisory_unit_level" = EXCLUDED."supervisory_unit_level",
"proportion" = EXCLUDED."proportion",
"registered_num" = EXCLUDED."registered_num",
"check_num" = EXCLUDED."check_num",
"finish_check_num" = EXCLUDED."finish_check_num",
"plan_type" = EXCLUDED."plan_type",
"check_date" = EXCLUDED."check_date"
</select>
<select id="getOldCompanyThreeSystemsStatisticsList"
resultType="com.yeejoin.amos.boot.module.tcm.api.dto.ThreeSystemsDto">
SELECT
*
FROM
tzs_three_systems
WHERE
plan_type = #{type}
AND check_date = #{lastStart}
</select>
</mapper>
......@@ -54,4 +54,13 @@ public class ThreeSystemsController<string> extends BaseController {
return ResponseHelper.buildResponse(threeSystemsPage);
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/getThreeSystemsStatistics")
@ApiOperation(httpMethod = "GET", value = "生成三项制度统计", notes = "生成三项制度统计")
public ResponseModel<Object> getThreeSystemsStatistics(@RequestParam(value = "type") String type) {
iThreeSystemsService.getThreeSystemsStatistics(type);
return ResponseHelper.buildResponse("ok");
}
}
......@@ -130,12 +130,4 @@ public class TzsTwoStaffingController extends BaseController {
return ResponseHelper.buildResponse(tzsTwoStaffingService.getCompanyCheckList(orgCode, companyDto,page));
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/getThreeSystemsStatistics")
@ApiOperation(httpMethod = "GET", value = "生成三项制度统计", notes = "生成三项制度统计")
public ResponseModel<Object> getThreeSystemsStatistics() {
tzsTwoStaffingService.getThreeSystemsStatistics();
return ResponseHelper.buildResponse("ok");
}
}
......@@ -5,6 +5,7 @@ import com.google.common.collect.Lists;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.tcm.api.common.BizCommonConstant;
import com.yeejoin.amos.boot.module.tcm.api.dto.ThreeSystemsDto;
import com.yeejoin.amos.boot.module.tcm.api.dto.TzsTwoStaffingCompanyCheckDto;
import com.yeejoin.amos.boot.module.tcm.api.dto.TzsTwoStaffingCompanyDto;
import com.yeejoin.amos.boot.module.tcm.api.dto.TzsTwoStaffingDto;
......@@ -27,10 +28,7 @@ import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.*;
import java.util.stream.Collectors;
/**
......@@ -160,12 +158,8 @@ public class TzsTwoStaffingServiceImpl extends BaseService<TzsTwoStaffingDto, Tz
return tzsTwoStaffingMapper.getCompanyCheckList(page, orgCode, companyDto);
}
@Override
public void getThreeSystemsStatistics() {
}
private List<LinkedHashMap<String, Object>> getSupervisionList() {
public List<LinkedHashMap<String, Object>> getSupervisionList() {
List<LinkedHashMap<String, Object>> supervisionList =
(List<LinkedHashMap<String, Object>>) redisUtils.get(BizCommonConstant.REGULATOR_UNIT_LIST);
if (ValidationUtil.isEmpty(supervisionList)) {
......
......@@ -487,15 +487,21 @@ public class EquipmentCategoryController extends BaseController {
zipFile.delete();
}
List<Object> code96333 = equipExportData.stream().filter(item -> !ObjectUtils.isEmpty(item.get("CODE96333"))).map(item -> item.get("CODE96333")).collect(Collectors.toList());
if (ObjectUtils.isEmpty(code96333) && ImageSizeEnums.DT.getCode().equals(type)){
throw new FileDownLoadException("96333码为空!");
}
if (!ObjectUtils.isEmpty(code96333)) {
LambdaQueryWrapper<IdxBizJgOtherInfo> lambda = new QueryWrapper<IdxBizJgOtherInfo>().lambda();
lambda.eq(IdxBizJgOtherInfo::getClaimStatus, "已认领");
lambda.in(IdxBizJgOtherInfo::getCode96333, code96333);
Integer integer = idxBizJgOtherInfoMapper.selectCount(lambda);
if (!ObjectUtils.isEmpty(strings) && strings.size() != integer){
throw new FileDownLoadException("96333码存在重复数据,请联系管理员!");
}
if (ObjectUtils.isEmpty(strings) && !String.valueOf(code96333.size()).equals(String.valueOf(integer))) {
// Integer integer = idxBizJgOtherInfoMapper.selectCount(lambda);
List<IdxBizJgOtherInfo> idxBizJgOtherInfos = idxBizJgOtherInfoMapper.selectList(lambda);
List<String> collect = idxBizJgOtherInfos.stream().map(IdxBizJgOtherInfo::getCode96333).collect(Collectors.toList());
HashSet<String> strings1 = new HashSet<>(collect);
// if (!ObjectUtils.isEmpty(strings) && strings.size() != strings1.size()){
// throw new FileDownLoadException("96333码存在重复数据,请联系管理员!");
// }
if (code96333.size()!=strings1.size() || idxBizJgOtherInfos.size() != code96333.size()) {
throw new FileDownLoadException("96333码存在重复数据,请联系管理员!");
}
}
......@@ -504,11 +510,11 @@ public class EquipmentCategoryController extends BaseController {
LambdaQueryWrapper<IdxBizJgOtherInfo> lambda = new QueryWrapper<IdxBizJgOtherInfo>().lambda();
lambda.eq(IdxBizJgOtherInfo::getClaimStatus, "已认领");
lambda.in(IdxBizJgOtherInfo::getSupervisoryCode, supervisoryCode);
Integer integer = idxBizJgOtherInfoMapper.selectCount(lambda);
if (!ObjectUtils.isEmpty(strings) && strings.size() != integer){
throw new FileDownLoadException("监管码存在重复数据,请联系管理员!");
}
if (ObjectUtils.isEmpty(strings) && !String.valueOf(supervisoryCode.size()).equals(String.valueOf(integer))) {
// Integer integer = idxBizJgOtherInfoMapper.selectCount(lambda);
List<IdxBizJgOtherInfo> idxBizJgOtherInfos = idxBizJgOtherInfoMapper.selectList(lambda);
List<String> collect = idxBizJgOtherInfos.stream().map(IdxBizJgOtherInfo::getSupervisoryCode).collect(Collectors.toList());
HashSet<String> strings1 = new HashSet<>(collect);
if (supervisoryCode.size() != strings1.size() || supervisoryCode.size() != idxBizJgOtherInfos.size()) {
throw new FileDownLoadException("监管码存在重复数据,请联系管理员!");
}
}
......
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