Commit ca41a7e7 authored by 刘凡's avatar 刘凡

Merge remote-tracking branch 'origin/develop_tzs_register_to_0715' into…

Merge remote-tracking branch 'origin/develop_tzs_register_to_0715' into develop_tzs_register_to_0715
parents 594559b9 44985717
......@@ -14,5 +14,5 @@ public interface AlertStatisticsMapper extends BaseMapper<AlertStatistics> {
AlertStatistics getStatisticsMessage(@Param("orgCode")String orgCode, @Param("startDate")String startDate , @Param("endDate")String endDate);
AlertStatistics statisticsInfoByRegionAndDate(@Param("regionCode")String regionCode, @Param("startDate")String startDate , @Param("endDate")String endDate);
AlertStatistics statisticsInfoByRegionAndDate(@Param("regionCode")Integer regionCode, @Param("startDate")String startDate , @Param("endDate")String endDate);
}
......@@ -5,8 +5,8 @@ import com.alibaba.fastjson.JSONArray;
import com.yeejoin.amos.boot.module.elevator.api.entity.AlertStatistics;
import java.text.ParseException;
import java.time.LocalDate;
import java.util.List;
import java.util.Map;
public interface IAlertStatisticsService {
......@@ -14,5 +14,5 @@ public interface IAlertStatisticsService {
List<AlertStatistics> getList(String date) throws ParseException;
JSONArray statisticInfoByRegionAndDate(String regionCode, LocalDate startDate, LocalDate endDate);
JSONArray statisticInfoByRegionAndDate(Map<String, Object> queryParams);
}
......@@ -12,10 +12,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
......@@ -24,11 +21,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletResponse;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.*;
@RestController
......@@ -350,9 +343,9 @@ public class StatisticsController extends BaseController {
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/region/info")
@ApiOperation(httpMethod = "GET", value = "查询区域统计信息", notes = "查询区域统计信息")
public ResponseModel<JSONArray> statisticsRegionInfo(@RequestParam(value = "cityCode") String regionCode, @RequestParam(value = "startDate", required = false) LocalDate startDate, @RequestParam(value = "endDate", required = false) LocalDate endDate) {
return ResponseHelper.buildResponse(alertStatisticsService.statisticInfoByRegionAndDate(regionCode, startDate, endDate));
@PostMapping (value = "/region/info")
@ApiOperation(httpMethod = "POST", value = "查询区域统计信息", notes = "查询区域统计信息")
public ResponseModel<JSONArray> statisticsRegionInfo(@RequestBody Map<String, Object> queryParams) {
return ResponseHelper.buildResponse(alertStatisticsService.statisticInfoByRegionAndDate(queryParams));
}
}
......@@ -165,9 +165,12 @@ public class AlertStatisticsServiceImpl extends BaseService<AlertStatisticsDto,
}
@Override
public JSONArray statisticInfoByRegionAndDate(String regionCode, LocalDate startDate, LocalDate endDate) {
public JSONArray statisticInfoByRegionAndDate(Map<String, Object> params) {
LocalDate today = LocalDate.now();
if (ObjectUtils.isEmpty(startDate) || ObjectUtils.isEmpty(endDate)) {
LocalDate startDate = (LocalDate) params.get("startDate");
LocalDate endDate = (LocalDate) params.get("endDate");
Integer regionCode = (Integer) params.get("cityCode");
if (ObjectUtils.isEmpty(params.get("startDate")) || ObjectUtils.isEmpty(params.get("endDate"))) {
startDate = today.minusDays(6);
endDate = today;
}
......
......@@ -51,7 +51,7 @@ public class DPStatisticsController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "大屏总览中间-地图左右两侧8大类、单位、人员数量全局统计", notes = "大屏总览中间-地图左右两侧8大类、单位、人员数量全局统计")
@PostMapping(value = "/zl/center-map/global/count")
@PostMapping(value = "/zl/center-map/legend")
public ResponseModel<Map<String, Object>> centerMapCountForGlobal(@Validated @RequestBody DPFilterParamDto dpFilterParamDto, BindingResult result) {
List<FieldError> fieldErrors = result.getFieldErrors();
if (!fieldErrors.isEmpty()) {
......@@ -61,6 +61,17 @@ public class DPStatisticsController {
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "大屏总览中间-地图地市统计", notes = "大屏总览中间-地图地市统计")
@PostMapping(value = "/zl/center-map/overview")
public ResponseModel<List<Map<String, Object>>> centerMapCountForOverview(@Validated @RequestBody DPFilterParamDto dpFilterParamDto, BindingResult result) {
List<FieldError> fieldErrors = result.getFieldErrors();
if (!fieldErrors.isEmpty()) {
throw new BadRequest(fieldErrors.get(0).getDefaultMessage());
}
return ResponseHelper.buildResponse(statisticsService.getCenterMapCountDataForOverview(dpFilterParamDto));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "大屏八大类左侧-使用登记统计", notes = "大屏八大类左侧-使用登记统计")
@PostMapping(value = "/useRegisterCount")
public ResponseModel<Map<String, Object>> useRegisterCount(@Validated @RequestBody DPFilterParamDto dpFilterParamDto, BindingResult result) {
......
......@@ -13,7 +13,6 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.web.bind.annotation.*;
......@@ -124,7 +123,6 @@ public class IdxBizJqEquipmentRegisterController extends BaseController {
return ResponseHelper.buildResponse(idxBizJgRegisterInfoService.equCategoryListByCompanyType(getSelectedOrgInfo(), null, null));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/equ-category/listByPersonAndEquList")
@ApiOperation(httpMethod = "GET", value = "按照人员身份、设备种类查询设备类别", notes = "按照人员身份、设备种类查询设备类别")
......@@ -167,7 +165,7 @@ public class IdxBizJqEquipmentRegisterController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/importData")
@ApiOperation(httpMethod = "POST", value = "气瓶批量导入", notes = "气瓶批量导入")
public List<EquipInfoCylinderExcelDto> ImportData (@RequestPart MultipartFile multipartFile) throws Exception {
public List<EquipInfoCylinderExcelDto> ImportData (@RequestPart("file") MultipartFile multipartFile) throws Exception {
List<EquipInfoCylinderExcelDto> aircraftList = new ArrayList<>();
try {
EasyExcel.read(multipartFile.getInputStream(), EquipInfoCylinderExcelDto.class, new AnalysisEventListener<EquipInfoCylinderExcelDto>() {
......
......@@ -5,9 +5,11 @@ import com.yeejoin.amos.boot.module.jg.api.entity.*;
import com.yeejoin.amos.boot.module.jg.api.service.IEquipUsedCheck;
import com.yeejoin.amos.boot.module.jg.biz.service.impl.*;
import com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum;
import com.yeejoin.amos.component.robot.AmosRequestContext;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import java.util.List;
......@@ -48,6 +50,10 @@ public class ApplicationRunnerImpl implements ApplicationRunner {
private List<IEquipUsedCheck> equipUsedCheckList;
private DPStatisticsServiceImpl statisticsService;
private AmosRequestContext amosRequestContext;
public ApplicationRunnerImpl(JgUseRegistrationServiceImpl useRegistrationService,
CommonServiceImpl commonService,
JgInstallationNoticeServiceImpl installationNoticeService,
......@@ -63,7 +69,7 @@ public class ApplicationRunnerImpl implements ApplicationRunner {
JgScrapCancelServiceImpl scrapCancelService,
JgChangeRegistrationNameServiceImpl changeRegistrationNameService,
ReportAnalysisServiceImpl reportAnalysisService,
List<IEquipUsedCheck> equipUsedCheckList) {
List<IEquipUsedCheck> equipUsedCheckList, DPStatisticsServiceImpl statisticsService, AmosRequestContext amosRequestContext) {
this.commonService = commonService;
this.useRegistrationService = useRegistrationService;
......@@ -95,6 +101,8 @@ public class ApplicationRunnerImpl implements ApplicationRunner {
this.reportAnalysisService = reportAnalysisService;
this.equipUsedCheckList = equipUsedCheckList;
this.statisticsService = statisticsService;
this.amosRequestContext = amosRequestContext;
}
......@@ -184,5 +192,11 @@ public class ApplicationRunnerImpl implements ApplicationRunner {
// 流程中的设备统计数据预热
equipUsedCheckList.forEach(IEquipUsedCheck::init);
// 初始化数据到内存
RequestContext.setAppKey(amosRequestContext.getAppKey());
RequestContext.setProduct(amosRequestContext.getProduct());
RequestContext.setToken(amosRequestContext.getToken());
statisticsService.init();
}
}
......@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto;
import com.yeejoin.amos.boot.module.jyjc.api.dto.InspectTimeCountDto;
import com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionApplicationEquip;
import org.apache.ibatis.annotations.Param;
import java.util.List;
......@@ -23,4 +24,6 @@ public interface JyjcInspectionApplicationEquipMapper extends BaseMapper<JyjcIns
* @return 统计列表
*/
List<InspectTimeCountDto> countInspectTimeCountByTypeAndEquList(DPFilterParamDto dpFilterParamDto);
Integer inspectTimeCount(@Param("dpFilterParamDto") DPFilterParamDto dpFilterParamDto);
}
......@@ -47,4 +47,27 @@
c.equ_category,
c.equ_define
</select>
<select id="inspectTimeCount" resultType="java.lang.Integer">
SELECT COUNT(1) AS num
FROM
(
SELECT
ae.equ_category,
concat ( u.PROVINCE, '#', u.CITY, '#', u.COUNTY ) AS areaCode
FROM
"tz_jyjc_inspection_application_equip" ae,
tz_jyjc_inspection_application A,
"idx_biz_jg_use_info" u
WHERE
ae.equip_unicode = u."RECORD"
AND A.sequence_nbr = ae.application_seq
AND ( A.application_date BETWEEN #{ dpFilterParamDto.beginDate } AND #{ dpFilterParamDto.endDate } )
AND A.status = '6616'
AND ae.equ_category = '2300'
) C
WHERE
C.areaCode LIKE concat ( '%', #{dpFilterParamDto.cityCode}, '%' )
GROUP BY
C.equ_category
</select>
</mapper>
......@@ -47,4 +47,16 @@ public class DPStatisticsController {
}
return ResponseHelper.buildResponse(statisticsService.inspectTimeCountByTypeAndEquList(dpFilterParamDto));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "气瓶检验检测次数统计", notes = "气瓶检验检测次数统计")
@PostMapping(value = "/inspectTimeCount")
public ResponseModel<Map<String, Object>> inspectTimeCount(@Validated @RequestBody DPFilterParamDto dpFilterParamDto, BindingResult result) {
List<FieldError> fieldErrors = result.getFieldErrors();
if(!fieldErrors.isEmpty()){
throw new BadRequest(fieldErrors.get(0).getDefaultMessage());
}
return ResponseHelper.buildResponse(statisticsService.inspectTimeCount(dpFilterParamDto));
}
}
......@@ -10,6 +10,10 @@ import com.yeejoin.amos.boot.module.ymt.api.mapper.EquipmentCategoryMapper;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.time.temporal.TemporalAdjusters;
import java.util.*;
import java.util.stream.Collectors;
......@@ -113,4 +117,24 @@ public class DPStatisticsServiceImpl {
dpFilterParamDto.setEndDate(DateUtil.today());
}
}
public Map<String, Object> inspectTimeCount(DPFilterParamDto dpFilterParamDto) {
Map<String, Object> returnMap = new HashMap<>();
LocalDate today = LocalDate.now();
List xDataList = new ArrayList();
List<Integer> yDataList = new ArrayList();
DateTimeFormatter sdf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
for (int i = 2; i >= 0; i--) {
LocalDate firstDayOfPrevMonth = today.minusMonths(i).with(TemporalAdjusters.firstDayOfMonth());
LocalDate lastDayOfPrevMonth = today.minusMonths(i).with(TemporalAdjusters.lastDayOfMonth());
dpFilterParamDto.setBeginDate(LocalDateTime.of(firstDayOfPrevMonth, java.time.LocalTime.MIN).format(sdf));
dpFilterParamDto.setEndDate(LocalDateTime.of(lastDayOfPrevMonth, java.time.LocalTime.MAX).format(sdf));
Integer inspectTimeCount = inspectionApplicationEquipMapper.inspectTimeCount(dpFilterParamDto);
xDataList.add(firstDayOfPrevMonth.getMonthValue()+"月");
yDataList.add(null == inspectTimeCount ? 0 : inspectTimeCount);
}
returnMap.put("xData",xDataList);
returnMap.put("yData",yDataList);
return returnMap;
}
}
......@@ -64,4 +64,6 @@ public interface TzBaseEnterpriseInfoMapper extends BaseMapper<TzBaseEnterpriseI
* @author yangyang
*/
TzBaseEnterpriseInfo selectBySeq(Long sequenceNbr);
Long countByUnitTypeAndOrgCode(@Param("orgCode") String orgCode,@Param("unitType") String unitType);
}
......@@ -11,4 +11,6 @@ import java.util.Set;
public interface TzsUserInfoMapper extends BaseMapper<TzsUserInfo> {
Page<TzsUserInfoDto> selectPageMessage(@Param("page") Page<TzsUserInfoDto> page, @Param("dto") TzsUserInfoDto dto);
Long countUserByPostAndAreaCode(@Param("orgCode") String orgCode, @Param("post") String post);
}
......@@ -27,7 +27,7 @@
</select>
<select id="sumPipeLengthByArea" resultType="java.lang.String">
select
round(sum(p."PIPE_LENGTH"), 2) as PIPE_LENGTH
COALESCE(round(sum(p."PIPE_LENGTH"), 2),0) as PIPE_LENGTH
from
idx_biz_jg_tech_params_pipeline p,
(
......@@ -45,6 +45,6 @@
and ui.IS_INTO_MANAGEMENT =true
) a
where
p."RECORD" = a."RECORD" and c.areaCode like concat('%',#{cityCode}, '%')
p."RECORD" = a."RECORD" and a.areaCode like concat('%',#{cityCode}, '%')
</select>
</mapper>
......@@ -196,4 +196,13 @@
<select id="selectBySeq" resultType="com.yeejoin.amos.boot.module.ymt.api.entity.TzBaseEnterpriseInfo">
select * from tz_base_enterprise_info where sequence_nbr = #{sequenceNbr}
</select>
<select id="countByUnitTypeAndOrgCode" resultType="java.lang.Long">
SELECT
count(1)
FROM
"tz_base_enterprise_info" a
where
a.supervise_org_code like concat(#{orgCode},'%')
and a.unit_type like concat('%', #{unitType},'%')
</select>
</mapper>
......@@ -48,4 +48,16 @@
</where>
order by rec_date
</select>
<select id="countUserByPostAndAreaCode" resultType="java.lang.Long">
SELECT
count(1)
FROM
tzs_user_info tui,
tz_base_enterprise_info bi
WHERE
tui.unit_code = bi.use_code
and tui.post LIKE concat ( '%', #{post}, '%' )
and bi.supervise_org_code LIKE CONCAT ( #{orgCode}, '%' )
and tui.is_delete=false
</select>
</mapper>
\ No newline at end of file
package com.yeejoin.amos.boot.module.ymt.biz.dao;
import com.yeejoin.amos.boot.module.ymt.api.dto.ESEquipmentCategoryDto;
import com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;
......
......@@ -10,7 +10,7 @@ import com.google.common.collect.Lists;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.ymt.api.dto.ESEquipmentCategoryDto;
import com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto;
import com.yeejoin.amos.boot.module.ymt.api.dto.EquipExportDto;
import com.yeejoin.amos.boot.module.ymt.api.dto.EquipmentCategoryDto;
import com.yeejoin.amos.boot.module.ymt.api.dto.EquipmentMessageDto;
......
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