Commit 4c581c72 authored by chenzhao's avatar chenzhao

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

# Conflicts: # amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/mapper/OrgUsrMapper.java
parents aca8aeb0 3fa2ff39
...@@ -11,24 +11,23 @@ import java.util.Map; ...@@ -11,24 +11,23 @@ import java.util.Map;
/** /**
* 机构/部门/人员表 Mapper 接口 * 机构/部门/人员表 Mapper 接口
* *
* @author tb * @author tb
* @date 2021-06-18 * @date 2021-06-18
*/ */
public interface OrgUsrMapper extends BaseMapper<OrgUsr> { public interface OrgUsrMapper extends BaseMapper<OrgUsr> {
String selectUpUnitByParam(@Param("id") String biz_org_code); String selectUpUnitByParam(@Param("id")String biz_org_code);
int selectPersonListCount(Map<String, Object> map); int selectPersonListCount(Map<String, Object> map);
//, String bizOrgName,
// Object fields, Object fieldsValue, String bizOrgCode
List<Map<String, Object>> selectPersonList(@Param("map")Map<String, Object> map); List<Map<String, Object>> selectPersonList(@Param("map")Map<String, Object> map);
List<OrgUsr> selectCompanyDepartmentMsg(); List<OrgUsr> selectCompanyDepartmentMsg();
List<Map<String, Object>> selectPersonAllList(Map<String, Object> map); List<Map<String, Object>> selectPersonAllList(Map<String, Object> map);
List<OrgUsr> queryOrgUsrListByBizOrgCode(String bizOrgCode); List<OrgUsr> queryOrgUsrListByBizOrgCode(String bizOrgCode);
List<OrgPersonExcelDto> queryOrgPersonDtoList(boolean isDelete); List<OrgPersonExcelDto> queryOrgPersonDtoList(boolean isDelete);
...@@ -42,36 +41,40 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> { ...@@ -42,36 +41,40 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> {
/** /**
* * @param null * * @param null
* * @return
* @return <PRE> * <PRE>
* author tw * author tw
* date 2021/7/20 * date 2021/7/20
* </PRE> * </PRE>
* 指挥重点单位资源 * 指挥重点单位资源
*/ */
List<CompanyDto> listContractDto(@Param("pageNum") int pageNum, @Param("pageSize") int pageSize, @Param("par") RequestData par); List<CompanyDto> listContractDto(@Param("pageNum")int pageNum, @Param("pageSize")int pageSize, @Param("par") RequestData par);
Integer listContractDtoCount(@Param("par") RequestData par);
Integer listContractDtoCount(@Param("par")RequestData par);
/** /**
* 获取机场单位树,包含对应单位下部门的数量 * 获取机场单位树,包含对应单位下部门的数量
*
* @return * @return
*/ */
List<OrgUsrTreeDto> getCompanyAndCountDepartment(); List<OrgUsrTreeDto> getCompanyAndCountDepartment();
List<OrgUsrzhDto> getOrgUsrzhDto(@Param("bizOrgName") String bizOrgName); List< OrgUsrzhDto> getOrgUsrzhDto(@Param("bizOrgName")String bizOrgName);
List<Map<String, Object>> getparent(); List< Map<String,Object>> getparent();
List< OrgUsrExcelDto> exportToExcel();
List<OrgUsrExcelDto> exportToExcel();
/** /**
* 查询单位基本信息列表和单位下所有的重点部位数量。 * 查询单位基本信息列表和单位下所有的重点部位数量。
*/ */
List<CheckObjectDto> getCompanyAndKeySite(Long companyId); List<CheckObjectDto> getCompanyAndKeySite(Long companyId);
List<UserUnitDto> getUserUnit(String id, String type, String code); List<UserUnitDto> getUserUnit(String id, String type, String code);
/**
* 导出机场单位带过滤 bug2657 by kongfm
* @param parentId
* @return
*/
List< OrgUsrExcelDto> exportPersonToExcelByParentId(Long parentId);
} }
...@@ -2,7 +2,6 @@ package com.yeejoin.amos.boot.module.common.api.mapper; ...@@ -2,7 +2,6 @@ package com.yeejoin.amos.boot.module.common.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.utils.MenuFrom;
import com.yeejoin.amos.boot.module.common.api.dto.RequestData; import com.yeejoin.amos.boot.module.common.api.dto.RequestData;
import com.yeejoin.amos.boot.module.common.api.dto.WaterResourceDto; import com.yeejoin.amos.boot.module.common.api.dto.WaterResourceDto;
import com.yeejoin.amos.boot.module.common.api.dto.WaterResourceTypeDto; import com.yeejoin.amos.boot.module.common.api.dto.WaterResourceTypeDto;
...@@ -45,5 +44,7 @@ public interface WaterResourceMapper extends BaseMapper<WaterResource> { ...@@ -45,5 +44,7 @@ public interface WaterResourceMapper extends BaseMapper<WaterResource> {
* 根据参数查询 * 根据参数查询
* *
*/ */
Page<WaterResourceDto> getWaterResourcePageByParams(Page<WaterResourceDto> page, String name, String resourceType, ArrayList<Long> belongBuildingId, Long belongFightingSystemId, Long sequenceNbr); Page<WaterResourceDto> getWaterResourcePageByParams(Page<WaterResourceDto> page, String name, String resourceType,
ArrayList<Long> belongBuildingId, Long belongFightingSystemId,
Long sequenceNbr, String equipId);
} }
...@@ -227,4 +227,11 @@ public interface IOrgUsrService { ...@@ -227,4 +227,11 @@ public interface IOrgUsrService {
List<OrgUsr> getPersonListByParentId(Long id); List<OrgUsr> getPersonListByParentId(Long id);
/**
* 根据parentId 导出机场单位人员 bug2657 by kongfm
* @param parentId
* @return
*/
List<OrgUsrExcelDto> exportPersonToExcelByParentId(Long parentId);
} }
...@@ -337,6 +337,7 @@ LEFT JOIN ( ...@@ -337,6 +337,7 @@ LEFT JOIN (
ORDER BY ORDER BY
u.sequence_nbr DESC u.sequence_nbr DESC
</select> </select>
<!--BUG2655 导出机场人员存在已删除数据 bykongfm-->
<select id="exportToExcel" resultType="com.yeejoin.amos.boot.module.common.api.dto.OrgUsrExcelDto"> <select id="exportToExcel" resultType="com.yeejoin.amos.boot.module.common.api.dto.OrgUsrExcelDto">
select select
a.biz_org_name bizOrgName, a.biz_org_name bizOrgName,
...@@ -360,7 +361,7 @@ LEFT JOIN ( ...@@ -360,7 +361,7 @@ LEFT JOIN (
max(case field_code when 'telephone' then field_value end) telephone max(case field_code when 'telephone' then field_value end) telephone
FROM cb_dynamic_form_instance GROUP BY instance_id) b FROM cb_dynamic_form_instance GROUP BY instance_id) b
on b.instance_id=a.sequence_nbr where a.biz_org_name is not null on b.instance_id=a.sequence_nbr where a.biz_org_name is not null and a.is_delete = 0
</select> </select>
<select id="getCompanyAndKeySite" resultType="com.yeejoin.amos.boot.module.common.api.dto.CheckObjectDto" > <select id="getCompanyAndKeySite" resultType="com.yeejoin.amos.boot.module.common.api.dto.CheckObjectDto" >
...@@ -409,4 +410,39 @@ LEFT JOIN ( ...@@ -409,4 +410,39 @@ LEFT JOIN (
</select> </select>
<!--BUG2657 导出选中单位及子单位人员数据 by kongfm-->
<select id="exportPersonToExcelByParentId" resultType="com.yeejoin.amos.boot.module.common.api.dto.OrgUsrExcelDto">
select
a.biz_org_name bizOrgName,
(select c.biz_org_name from cb_org_usr c where c.sequence_nbr=a.parent_id) parentId,
b.*
from cb_org_usr a LEFT JOIN
(SELECT
instance_id,
max(case field_code when 'administrativePositionCode' then field_value_label end) administrativePositionCode,
max(case field_code when 'auditCycle' then field_value_label end) auditCycle,
max(case field_code when 'certificatesNumber' then field_value end) certificatesNumber,
max(case field_code when 'certificatesTypeCode' then field_value_label end) certificatesTypeCode,
max(case field_code when 'certificateType' then field_value_label end) certificateType,
max(case field_code when 'fireManagementPostCode' then field_value_label end) fireManagementPostCode,
max(case field_code when 'gender' then field_value_label end) gender,
max(case field_code when 'internalPositionCode' then field_value_label end) internalPositionCode,
max(case field_code when 'personNumber' then field_value end) personNumber,
max(case field_code when 'positionType' then field_value_label end) positionType,
max(case field_code when 'safetyTraining' then field_value_label end) safetyTraining,
max(case field_code when 'stateCode' then field_value_label end) stateCode,
max(case field_code when 'telephone' then field_value end) telephone
FROM cb_dynamic_form_instance GROUP BY instance_id) b
on b.instance_id=a.sequence_nbr where a.biz_org_name is not null and a.is_delete = 0
and a.biz_org_type = "PERSON"
<if test="parentId != null and parentId != -1 ">
and a.biz_org_code like
concat((select t.biz_org_code from cb_org_usr t where t.sequence_nbr = #{parentId}), '%')
</if>
</select>
</mapper> </mapper>
...@@ -120,6 +120,7 @@ ...@@ -120,6 +120,7 @@
select * from cb_water_resource where is_delete = 1 select * from cb_water_resource where is_delete = 1
<if test="sequenceNbr != null and sequenceNbr != ''">and sequence_nbr = #{sequenceNbr}</if> <if test="sequenceNbr != null and sequenceNbr != ''">and sequence_nbr = #{sequenceNbr}</if>
<if test="resourceType != null and resourceType != ''">and resource_type = #{resourceType}</if> <if test="resourceType != null and resourceType != ''">and resource_type = #{resourceType}</if>
<if test="equipId != null and equipId != ''">and equip_id = #{equipId}</if>
<if test="name != null and name != ''">and name like concat('%', #{name}, '%')</if> <if test="name != null and name != ''">and name like concat('%', #{name}, '%')</if>
<if test="belongFightingSystemId != null"> <if test="belongFightingSystemId != null">
<if test="belongFightingSystemId > -1"> <if test="belongFightingSystemId > -1">
......
...@@ -149,26 +149,27 @@ public class AircraftDto extends BaseDto { ...@@ -149,26 +149,27 @@ public class AircraftDto extends BaseDto {
@ApiModelProperty(value = "备注") @ApiModelProperty(value = "备注")
private String remark; private String remark;
@ExcelProperty(value = "外观图", index = 28) @ExcelIgnore // BUG2676 隐藏导出多余图片字段 by kongfm
@ApiModelProperty(value = "外观图") @ApiModelProperty(value = "外观图")
private String appearanceImages; private String appearanceImages;
@ExcelProperty(value = "平面图", index = 29) @ExcelIgnore// BUG2676 隐藏导出多余图片字段 by kongfm
@ApiModelProperty(value = "平面图") @ApiModelProperty(value = "平面图")
private String planeImages; private String planeImages;
@ExcelProperty(value = "救援图", index = 30) @ExcelIgnore// BUG2676 隐藏导出多余图片字段 by kongfm
@ApiModelProperty(value = "救援图") @ApiModelProperty(value = "救援图")
private String rescueImages; private String rescueImages;
@ExcelProperty(value = "方位图", index = 31) @ExcelIgnore// BUG2676 隐藏导出多余图片字段 by kongfm
@ApiModelProperty(value = "方位图") @ApiModelProperty(value = "方位图")
private String positionImages; private String positionImages;
@ExcelProperty(value = "三维模型", index = 32) @ExcelIgnore// BUG2676 隐藏导出多余图片字段 by kongfm
@ApiModelProperty(value = "三维模型") @ApiModelProperty(value = "三维模型")
private String models; private String models;
@ExcelIgnore// BUG2676 隐藏导出多余图片字段 by kongfm
@ApiModelProperty(value = "现场图片") @ApiModelProperty(value = "现场图片")
private List<String> scenePicture; private List<String> scenePicture;
......
package com.yeejoin.amos.boot.module.command.biz.controller; package com.yeejoin.amos.boot.module.command.biz.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.metadata.OrderItem; import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Lists;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.service.IDataDictionaryService; import com.yeejoin.amos.boot.biz.common.service.IDataDictionaryService;
import com.yeejoin.amos.boot.biz.common.utils.WordConverterUtils; import com.yeejoin.amos.boot.biz.common.utils.WordConverterUtils;
import com.yeejoin.amos.boot.module.command.api.dao.SeismometeorologyDtoDao; import com.yeejoin.amos.boot.module.command.api.dao.SeismometeorologyDtoDao;
import com.yeejoin.amos.boot.module.command.api.dto.SeismometeorologyDto; import com.yeejoin.amos.boot.module.command.api.dto.SeismometeorologyDto;
import com.yeejoin.amos.boot.module.command.biz.service.impl.RemoteSecurityService; import com.yeejoin.amos.boot.module.command.biz.service.impl.RemoteSecurityService;
import com.yeejoin.amos.boot.module.common.api.dto.*; import com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto;
import com.yeejoin.amos.boot.module.common.api.dto.CompanyDto;
import com.yeejoin.amos.boot.module.common.api.dto.FireChemicalDto;
import com.yeejoin.amos.boot.module.common.api.dto.FireExpertsDto;
import com.yeejoin.amos.boot.module.common.api.dto.FireStationDto;
import com.yeejoin.amos.boot.module.common.api.dto.FireStationzhDto;
import com.yeejoin.amos.boot.module.common.api.dto.FireTeamZhDto;
import com.yeejoin.amos.boot.module.common.api.dto.FirefightersDto;
import com.yeejoin.amos.boot.module.common.api.dto.FirefightersZhDto;
import com.yeejoin.amos.boot.module.common.api.dto.KeySiteDto;
import com.yeejoin.amos.boot.module.common.api.dto.LinkageUnitDto;
import com.yeejoin.amos.boot.module.common.api.dto.LinkageUnitZhDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgMenuDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgUsrFormDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgUsrzhDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgusrDataxDto;
import com.yeejoin.amos.boot.module.common.api.dto.RequestData;
import com.yeejoin.amos.boot.module.common.api.dto.WaterResourceZhDto;
import com.yeejoin.amos.boot.module.common.api.entity.FireTeam; import com.yeejoin.amos.boot.module.common.api.entity.FireTeam;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient; import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.common.api.service.*; import com.yeejoin.amos.boot.module.common.api.service.IDutyPersonService;
import com.yeejoin.amos.boot.module.jcs.api.dto.*; import com.yeejoin.amos.boot.module.common.api.service.IFireChemicalService;
import com.yeejoin.amos.boot.module.common.api.service.IFireExpertsService;
import com.yeejoin.amos.boot.module.common.api.service.IFireStationService;
import com.yeejoin.amos.boot.module.common.api.service.IFireTeamService;
import com.yeejoin.amos.boot.module.common.api.service.IFirefightersService;
import com.yeejoin.amos.boot.module.common.api.service.IKeySiteService;
import com.yeejoin.amos.boot.module.common.api.service.ILinkageUnitService;
import com.yeejoin.amos.boot.module.common.api.service.IOrgUsrService;
import com.yeejoin.amos.boot.module.common.api.service.ISourceFileService;
import com.yeejoin.amos.boot.module.common.api.service.IWaterResourceService;
import com.yeejoin.amos.boot.module.jcs.api.dto.AircraftDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledZhDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.CarStatusInfoDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.InstructionsZHDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.KeyValueLabel;
import com.yeejoin.amos.boot.module.jcs.api.dto.StateDot;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled; import com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue; import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue;
import com.yeejoin.amos.boot.module.jcs.api.enums.AlertStageEnums; import com.yeejoin.amos.boot.module.jcs.api.enums.AlertStageEnums;
import com.yeejoin.amos.boot.module.jcs.api.service.*; import com.yeejoin.amos.boot.module.jcs.api.service.IAircraftService;
import com.yeejoin.amos.boot.module.jcs.api.service.IAlertCalledService;
import com.yeejoin.amos.boot.module.jcs.api.service.IAlertFormValueService;
import com.yeejoin.amos.boot.module.jcs.api.service.IAlertSubmittedService;
import com.yeejoin.amos.boot.module.jcs.api.service.IPowerTransferCompanyService;
import com.yeejoin.amos.boot.module.jcs.api.service.IPowerTransferService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.io.IOUtils;
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.http.HttpEntity; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.http.HttpHeaders; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.http.HttpMethod; import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.util.LinkedMultiValueMap; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.util.MultiValueMap; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;
import org.typroject.tyboot.core.foundation.context.RequestContext; import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.exception.BaseException;
import org.typroject.tyboot.core.foundation.utils.DateUtil; import org.typroject.tyboot.core.foundation.utils.DateUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
...@@ -47,12 +80,11 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel; ...@@ -47,12 +80,11 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.ServletOutputStream; import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.net.URI; import java.util.ArrayList;
import java.net.URISyntaxException; import java.util.List;
import java.util.*; import java.util.Map;
/** /**
* *指挥资源Api * *指挥资源Api
...@@ -963,4 +995,17 @@ public class CommandController extends BaseController { ...@@ -963,4 +995,17 @@ public class CommandController extends BaseController {
@RequestParam(defaultValue = "team") String type) { @RequestParam(defaultValue = "team") String type) {
return ResponseHelper.buildResponse(powerTransferService.getPowerTransferStatistics(Long.valueOf(alertId), type)); return ResponseHelper.buildResponse(powerTransferService.getPowerTransferStatistics(Long.valueOf(alertId), type));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "PUT", value = "app-更新车辆状态", notes = "app-更新车辆状态")
@PutMapping(value = "/app/carStatus")
public ResponseModel<Boolean> updateCarStatus(CarStatusInfoDto carStatusInfoDto) {
try {
equipFeignClient.updateCarStatus(Lists.newArrayList(carStatusInfoDto));
} catch (Exception e) {
throw new BaseException("更新车辆状态异常", "", e.getMessage());
}
return ResponseHelper.buildResponse(true);
}
} }
\ No newline at end of file
...@@ -348,12 +348,13 @@ public class WaterResourceController extends BaseController { ...@@ -348,12 +348,13 @@ public class WaterResourceController extends BaseController {
@RequestParam(value = "size") int size, String name, @RequestParam(value = "size") int size, String name,
@RequestParam(value = "belongBuildingId", required = false) ArrayList<Long> belongBuildingId, @RequestParam(value = "belongBuildingId", required = false) ArrayList<Long> belongBuildingId,
Long belongFightingSystemId, Long sequenceNbr, Long belongFightingSystemId, Long sequenceNbr,
String resourceType,
String classifyId) { String classifyId) {
Page<WaterResourceDto> page = new Page<>(); Page<WaterResourceDto> page = new Page<>();
page.setCurrent(current); page.setCurrent(current);
page.setSize(size); page.setSize(size);
return ResponseHelper.buildResponse(waterResourceServiceImpl.queryForWaterResourcePage(page, name, return ResponseHelper.buildResponse(waterResourceServiceImpl.queryForWaterResourcePage(page, name, resourceType,
classifyId, belongBuildingId, belongFightingSystemId, sequenceNbr)); belongBuildingId, belongFightingSystemId, sequenceNbr, classifyId));
} }
/** /**
......
...@@ -30,6 +30,9 @@ public class FireChemicalServiceImpl extends BaseService<FireChemicalDto,FireChe ...@@ -30,6 +30,9 @@ public class FireChemicalServiceImpl extends BaseService<FireChemicalDto,FireChe
*/ */
@Override @Override
public Page<FireChemicalDto> queryForFireChemicalPage(Page<FireChemicalDto> page, @Condition(Operator.like) String casNo, @Condition(Operator.like)String formula, @Condition(Operator.like)String name, String typeCode,boolean isDelete) { public Page<FireChemicalDto> queryForFireChemicalPage(Page<FireChemicalDto> page, @Condition(Operator.like) String casNo, @Condition(Operator.like)String formula, @Condition(Operator.like)String name, String typeCode,boolean isDelete) {
if(typeCode.equals("-1")) { // bug 2673 选择 -1 时候没有查出所有危化品处理 by kongfm
typeCode = null;
}
return this.queryForPage(page, "", false,casNo, formula, name, typeCode, isDelete); return this.queryForPage(page, "", false,casNo, formula, name, typeCode, isDelete);
} }
......
...@@ -1332,11 +1332,14 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -1332,11 +1332,14 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
wrapper.eq(OrgUsr::getBizOrgType, OrgPersonEnum.人员.getKey()); wrapper.eq(OrgUsr::getBizOrgType, OrgPersonEnum.人员.getKey());
return this.baseMapper.selectList(wrapper); return this.baseMapper.selectList(wrapper);
} }
@Override
public List<OrgUsrExcelDto> exportPersonToExcelByParentId(Long parentId) {
return orgUsrMapper.exportPersonToExcelByParentId(parentId);
@Override }
@Override
public List<Map<String, Object>> getLoginUserDetails (AgencyUserModel user) { public List<Map<String, Object>> getLoginUserDetails (AgencyUserModel user) {
// 获取登陆人关联账号 // 获取登陆人关联账号
......
...@@ -56,12 +56,13 @@ public class WaterResourceServiceImpl extends BaseService<WaterResourceDto, Wate ...@@ -56,12 +56,13 @@ public class WaterResourceServiceImpl extends BaseService<WaterResourceDto, Wate
*/ */
public Page<WaterResourceDto> queryForWaterResourcePage(Page<WaterResourceDto> page, public Page<WaterResourceDto> queryForWaterResourcePage(Page<WaterResourceDto> page,
@Condition(Operator.like) String name, @Condition(Operator.like) String name,
@Condition(Operator.eq) String equipId, @Condition(Operator.eq) String resourceType,
@Condition(Operator.in) ArrayList<Long> belongBuildingId, @Condition(Operator.in) ArrayList<Long> belongBuildingId,
@Condition(Operator.eq) Long belongFightingSystemId, @Condition(Operator.eq) Long belongFightingSystemId,
@Condition(Operator.eq) Long sequenceNbr) { @Condition(Operator.eq) Long sequenceNbr,
return this.waterResourceMapper.getWaterResourcePageByParams(page, name, equipId, belongBuildingId, String equipId) {
belongFightingSystemId, sequenceNbr); return this.waterResourceMapper.getWaterResourcePageByParams(page, name, resourceType, belongBuildingId,
belongFightingSystemId, sequenceNbr, equipId);
} }
/** /**
......
...@@ -146,4 +146,18 @@ public class ExcelController extends BaseController { ...@@ -146,4 +146,18 @@ public class ExcelController extends BaseController {
throw new RuntimeException("系统异常!"); throw new RuntimeException("系统异常!");
} }
} }
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "导出公用类带过滤参数")
@PostMapping("/exportByParams/{type}")
public void getFireStationFileByParams(HttpServletResponse response, @PathVariable(value = "type") String type, @RequestParam(value = "params") String params) {
try {
ExcelEnums excelEnums= ExcelEnums.getByKey(type);
ExcelDto excelDto = new ExcelDto(excelEnums.getFileName(), excelEnums.getSheetName(), excelEnums.getClassUrl(), excelEnums.getType());
excelService.exportByParams(response, excelDto, params);
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("系统异常!");
}
}
} }
...@@ -40,6 +40,7 @@ import org.springframework.util.StringUtils; ...@@ -40,6 +40,7 @@ import org.springframework.util.StringUtils;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import org.typroject.tyboot.core.foundation.utils.Bean; import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.InputStream; import java.io.InputStream;
...@@ -1047,4 +1048,79 @@ public class ExcelServiceImpl { ...@@ -1047,4 +1048,79 @@ public class ExcelServiceImpl {
} }
return data; return data;
} }
public void exportByParams(HttpServletResponse response, ExcelDto excelDto, String params) {
switch (excelDto.getType()) {
case "WHP":
List<FireChemicalDto> data = fireChemicalServiceImpl.queryForFireChemicalList(false);
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), data,
FireChemicalDto.class, dataSourcesImpl, false);
break;
case "XFZJ":
List<FireExpertsDto> fireExpertsDtoList = fireExpertsServiceImpl.queryForFireExpertsList(false);
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(),
fireExpertsDtoList, FireExpertsDto.class, dataSourcesImpl, false);
break;
case "SYXX":
List<WaterResourceDto> waterResourceDtoList = waterResourceServiceImpl.exportToExcel(true);
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(),
waterResourceDtoList, WaterResourceDto.class, dataSourcesImpl, false);
break;
case "HKQ":
List<AircraftDto> aircraftDtoList = aircraftServiceImpl.queryAircraftDtoForList(false);
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(),
aircraftDtoList, AircraftDto.class, dataSourcesImpl, false);
break;
case "XFDW":
List<FireTeamDto> fireTeamDtoList = fireTeamService.queryFireTeamForList(false);
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), fireTeamDtoList,
FireTeamDto.class, dataSourcesImpl, false);
break;
case "WXXFZ":
List<FireStationDto> fireStationDtoList = fireStationService.queryForFireStationList(false);
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(),
fireStationDtoList, FireStationDto.class, null, false);
break;
case "XFRY":
List<FirefightersExcelDto> firefightersExcelDtoList = firefightersService.exportToExcel(false);
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(),
firefightersExcelDtoList, FirefightersExcelDto.class, null, false);
break;
case "WBRY":
List<MaintenancePersonExcleDto> maintenancePersonExcelDtoList =
maintenanceCompanyService.exportToMaintenancePersonExcel();
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(),
maintenancePersonExcelDtoList, MaintenancePersonExcleDto.class, null, false);
break;
case "KEYSITE":
List<KeySiteExcleDto> keySiteDtoList = keySiteService.exportToExcel();
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(),
keySiteDtoList, KeySiteExcleDto.class, null, false);
break;
case "JCDWRY":
// 机场单位人员参数传递为 parentId = xxxxxxx
String parentIdStr = params.split("=")[1];
Long parentId = -1l;
try {
parentId = Long.parseLong(parentIdStr);
} catch (NumberFormatException e) {
throw new BadRequest("导出机场单位时未传递正确parentId");
}
List<OrgUsrExcelDto> orgUsrList = orgUsrService.exportPersonToExcelByParentId(parentId);
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(),
orgUsrList, OrgUsrExcelDto.class, null, false);
break;
case "LDDW":
List<LinkageUnitDto> LinkageUnitDtoList = linkageUnitServiceImpl.exportToExcel();
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(),
LinkageUnitDtoList, LinkageUnitDto.class, null, false);
break;
default:
break;
}
}
} }
...@@ -69,7 +69,7 @@ public interface PlanTaskMapper extends BaseMapper { ...@@ -69,7 +69,7 @@ public interface PlanTaskMapper extends BaseMapper {
* @param params * @param params
* @return * @return
*/ */
List<HashMap<String, Object>> getPlanTasks(HashMap<String, Object> params); List<Map<String, Object>> getPlanTasks(HashMap<String, Object> params);
/** /**
* 通过计划任务Id获得计划任务信息 * 通过计划任务Id获得计划任务信息
* @param planTaskId * @param planTaskId
...@@ -121,6 +121,12 @@ public interface PlanTaskMapper extends BaseMapper { ...@@ -121,6 +121,12 @@ public interface PlanTaskMapper extends BaseMapper {
* @return * @return
*/ */
List<CheckChkExListBo> getChkExList(CheckPtListPageParam param); List<CheckChkExListBo> getChkExList(CheckPtListPageParam param);
/**
* 任务分页查询数量
* @param params 参数
* @return long
*/
long getPlanTasksCount(HashMap<String, Object> params); long getPlanTasksCount(HashMap<String, Object> params);
Map<String, Object> getPlanTaskStatisticsForApp(HashMap<String, Object> params); Map<String, Object> getPlanTaskStatisticsForApp(HashMap<String, Object> params);
......
...@@ -79,7 +79,7 @@ public interface IPlanTaskService { ...@@ -79,7 +79,7 @@ public interface IPlanTaskService {
* @param params * @param params
* @return * @return
*/ */
Page<HashMap<String, Object>> getPlanTasks(String toke,String product,String appKey,HashMap<String, Object> params); Page<Map<String, Object>> getPlanTasks(String toke,String product,String appKey,HashMap<String, Object> params);
/** /**
* 根据计划任务Id获取计划任务信息 * 根据计划任务Id获取计划任务信息
......
package com.yeejoin.amos.patrol.business.util; package com.yeejoin.amos.patrol.business.util;
import java.util.HashMap;
import java.util.List;
import org.springframework.util.ObjectUtils;
import com.yeejoin.amos.patrol.business.param.PlanTaskPageParam; import com.yeejoin.amos.patrol.business.param.PlanTaskPageParam;
import com.yeejoin.amos.patrol.core.common.request.CommonPageable; import com.yeejoin.amos.patrol.core.common.request.CommonPageable;
import com.yeejoin.amos.patrol.core.common.request.CommonRequest; import com.yeejoin.amos.patrol.core.common.request.CommonRequest;
import com.yeejoin.amos.patrol.core.enums.QueryOperatorEnum; import com.yeejoin.amos.patrol.core.enums.QueryOperatorEnum;
import org.springframework.util.ObjectUtils;
import java.util.HashMap;
import java.util.List;
public class PlanTaskPageParamUtil { public class PlanTaskPageParamUtil {
public static PlanTaskPageParam fillChkInfoParam(List<CommonRequest> queryRequests, CommonPageable commonPageable, public static PlanTaskPageParam fillChkInfoParam(List<CommonRequest> queryRequests, CommonPageable commonPageable,
PlanTaskPageParam param, HashMap<String, Object> paramMap) { PlanTaskPageParam param, HashMap<String, Object> paramMap) {
for(int i=0;i<queryRequests.size();i++){ for (int i = 0; i < queryRequests.size(); i++) {
String name = queryRequests.get(i).getName(); String name = queryRequests.get(i).getName();
if("pointNo".equals(name)){ if ("pointNo".equals(name)) {
param.setPointNo(toString(queryRequests.get(i).getValue())); param.setPointNo(toString(queryRequests.get(i).getValue()));
}else if("pointName".equals(name)){ } else if ("pointName".equals(name)) {
param.setPointName(toString(queryRequests.get(i).getValue())); param.setPointName(toString(queryRequests.get(i).getValue()));
}else if("beginDate".equals(name)){ } else if ("beginDate".equals(name)) {
param.setBeginDate(toString(queryRequests.get(i).getValue())); param.setBeginDate(toString(queryRequests.get(i).getValue()));
}else if("endDate".equals(name)){ } else if ("endDate".equals(name)) {
param.setEndDate(toString(queryRequests.get(i).getValue())); param.setEndDate(toString(queryRequests.get(i).getValue()));
}else if("status".equals(name)){ } else if ("status".equals(name)) {
param.setStatus(toString(queryRequests.get(i).getValue())); param.setStatus(toString(queryRequests.get(i).getValue()));
}else if("planId".equals(name)){ } else if ("planId".equals(name)) {
param.setPlanId(toString(queryRequests.get(i).getValue())); param.setPlanId(toString(queryRequests.get(i).getValue()));
}else if("routeId".equals(name)){ } else if ("routeId".equals(name)) {
param.setRouteId(toString(queryRequests.get(i).getValue())); param.setRouteId(toString(queryRequests.get(i).getValue()));
} }
} }
param.setOrgCode(paramMap.get("orgCode") == null ? null:paramMap.get("orgCode").toString()); param.setOrgCode(paramMap.get("orgCode") == null ? null : paramMap.get("orgCode").toString());
param.setUserId(paramMap.get("userId") == null ? null:paramMap.get("userId").toString()); param.setUserId(paramMap.get("userId") == null ? null : paramMap.get("userId").toString());
if (!ObjectUtils.isEmpty(commonPageable)) { if (!ObjectUtils.isEmpty(commonPageable)) {
param.setPageNumber(commonPageable.getPageNumber()); param.setPageNumber(commonPageable.getPageNumber());
param.setPageSize(commonPageable.getPageSize()); param.setPageSize(commonPageable.getPageSize());
} }
return param; return param;
} }
private static String toString(Object value) { private static String toString(Object value) {
if(null ==value || value ==""){ if (null == value || value == "") {
return null; return null;
}else{ } else {
return value.toString(); return value.toString();
} }
} }
public static HashMap<String, Object> fillPlanTask(List<CommonRequest> queryRequests, public static void fillPlanTask(List<CommonRequest> queryRequests,
HashMap<String, Object> params) { HashMap<String, Object> params) {
if (ObjectUtils.isEmpty(queryRequests)) { if (ObjectUtils.isEmpty(queryRequests)) {
return params; return;
} }
String order = ""; StringBuilder order = new StringBuilder();
for(int i=0;i<queryRequests.size();i++){ for (CommonRequest queryRequest : queryRequests) {
String name = queryRequests.get(i).getName(); String name = queryRequest.getName();
String type = queryRequests.get(i).getType(); String type = queryRequest.getType();
if(type!=null && type!=""){ if (type != null && !"".equals(type)) {
if (!QueryOperatorEnum.ORDER_BY.getName().equals(type)) { if (!QueryOperatorEnum.ORDER_BY.getName().equals(type)) {
params.put(name, queryRequests.get(i).getValue()); params.put(name, queryRequest.getValue());
} else if (QueryOperatorEnum.ORDER_BY.getName().equals(type)) { } else {
order +=name + " " + queryRequests.get(i).getValue(); order.append(name).append(" ").append(queryRequest.getValue());
} }
}else{ } else {
if(name.equals("orderBy") && queryRequests.get(i).getValue()!=null){ if ("orderBy".equals(name) && queryRequest.getValue() != null) {
order += queryRequests.get(i).getValue(); order.append(queryRequest.getValue());
} }
params.put(name, queryRequests.get(i).getValue()); params.put(name, queryRequest.getValue());
} }
}
if (!ObjectUtils.isEmpty(order.toString())) {
} params.put("orderBy", order.toString());
if (!ObjectUtils.isEmpty(order)) { } else {
params.put("orderBy", order); params.put("orderBy", "beginTime ASC");
}else{ }
params.put("orderBy", "beginTime ASC"); }
}
return params;
}
} }
...@@ -161,4 +161,51 @@ ...@@ -161,4 +161,51 @@
ALTER TABLE `cb_firefighters_thought` modify talking_time datetime COMMENT '谈话时间'; ALTER TABLE `cb_firefighters_thought` modify talking_time datetime COMMENT '谈话时间';
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="litengwei" id="2021-09-01-litengwei-1">
<comment>add data cb_data_dictionary</comment>
<sql>
INSERT INTO `cb_data_dictionary` VALUES(1152, '1152', '大面积航班延误保障', 'QTZL', NULL, NULL, NULL, NULL, NULL, 0, 1);
INSERT INTO `cb_data_dictionary` VALUES(1153, '1153', '二类运行保障', 'QTZL', NULL, NULL, NULL, NULL, NULL, 0, 1);
INSERT INTO `cb_data_dictionary` VALUES(1154, '1154', '施工加油保障', 'QTZL', NULL, NULL, NULL, NULL, NULL, 0, 1);
INSERT INTO `cb_data_dictionary` VALUES(1155, '1155', '航空器失事', 'HKQJYZL', NULL, NULL, NULL, NULL, NULL, 0, 1);
INSERT INTO `cb_data_dictionary` VALUES(1156, '1156', '空中遇险', 'HKQJYZL', NULL, NULL, NULL, NULL, NULL, 0, 1);
INSERT INTO `cb_data_dictionary` VALUES(1157, '1157', '跑道事件', 'HKQJYZL', NULL, NULL, NULL, NULL, NULL, 0, 1);
INSERT INTO `cb_data_dictionary` VALUES(1158, '1158', '地面遇险', 'HKQJYZL', NULL, NULL, NULL, NULL, NULL, 0, 1);
INSERT INTO `cb_data_dictionary` VALUES(1159, '1159', '劫机', 'HKQJYZL', NULL, NULL, NULL, NULL, NULL, 0, 1);
INSERT INTO `cb_data_dictionary` VALUES(1160, '1160', '发现爆炸物', 'HKQJYZL', NULL, NULL, NULL, NULL, NULL, 0, 1);
INSERT INTO `cb_data_dictionary` VALUES(1161, '1161', '爆炸物威胁', 'HKQJYZL', NULL, NULL, NULL, NULL, NULL, 0, 1);
INSERT INTO `cb_data_dictionary` VALUES(1162, '1162', '其他非法干扰', 'HKQJYZL', NULL, NULL, NULL, NULL, NULL, 0, 1);
INSERT INTO `cb_data_dictionary` VALUES(1163, '1163', '残损航空器搬移', 'HKQJYZL', NULL, NULL, NULL, NULL, NULL, 0, 1);
INSERT INTO `cb_data_dictionary` VALUES(1164, '1164', '紧急出动', 'XYJB', NULL, NULL, NULL, NULL, NULL, 0, 1);
INSERT INTO `cb_data_dictionary` VALUES(1165, '1165', '紧急集结', 'XYJB', NULL, NULL, NULL, NULL, NULL, 0, 1);
INSERT INTO `cb_data_dictionary` VALUES(1166, '1166', '原地待命', 'XYJB', NULL, NULL, NULL, NULL, NULL, 0, 1);
</sql>
</changeSet>
<changeSet author="litengwei" id="2021-09-01-litengwei-2">
<comment>add data jc_alert_form</comment>
<sql>
INSERT INTO `jc_alert_form` VALUES(127, '230', 'HKQJYZL', '航空器救援子类', 'aircraftRescueSub', 'radio', NULL, NULL, NULL, 0, 1, 1, NULL);
INSERT INTO `jc_alert_form` VALUES(128, '242', 'QTZL', '子类', 'sub', 'radio', NULL, NULL, NULL, 0, 1, 1, NULL);
INSERT INTO `jc_alert_form` VALUES(129, '230', NULL, '机位', 'mechinePosition', 'select', NULL, NULL, NULL, 0, 0, 5, NULL);
INSERT INTO `jc_alert_form` VALUES(130, '230', NULL, '响应级别', 'responseLevel', 'select', NULL, NULL, NULL, 0, 0, 8, NULL);
</sql>
</changeSet>
<changeSet author="litengwei" id="2021-09-01-litengwei-3">
<comment>update data jc_alert_form</comment>
<sql>
UPDATE `jc_alert_form` SET alert_type_code='230', field_value_code=NULL, field_name='航班号', field_code='flightNumber', field_type='selectDelay', rec_user_name=NULL, rec_user_id=NULL, rec_date=NULL, is_delete=0, block=0, sort_num=2, url='aircraft/getAircraftNum' WHERE sequence_nbr=103;
UPDATE `jc_alert_form` SET alert_type_code='230', field_value_code=NULL, field_name='航空器型号', field_code='aircraftModel', field_type='input', rec_user_name=NULL, rec_user_id=NULL, rec_date=NULL, is_delete=0, block=0, sort_num=3, url='aircraft/getAircraft' WHERE sequence_nbr=104;
UPDATE `jc_alert_form` SET alert_type_code='230', field_value_code=NULL, field_name='落地时间', field_code='landingTime', field_type='datetime', rec_user_name=NULL, rec_user_id=NULL, rec_date=NULL, is_delete=0, block=0, sort_num=4, url=NULL WHERE sequence_nbr=105;
UPDATE `jc_alert_form` SET alert_type_code='230', field_value_code=NULL, field_name='航空器故障部位', field_code='damageLocation', field_type='selectDelay', rec_user_name=NULL, rec_user_id=NULL, rec_date=NULL, is_delete=0, block=0, sort_num=7, url='data-dictionary/gwmcDataDictionary/FJSSWZ' WHERE sequence_nbr=106;
UPDATE `jc_alert_form` SET alert_type_code='230', field_value_code=NULL, field_name='燃油量(吨)', field_code='fuelQuantity', field_type='inputNumber', rec_user_name=NULL, rec_user_id=NULL, rec_date=NULL, is_delete=0, block=0, sort_num=10, url=NULL WHERE sequence_nbr=107;
UPDATE `jc_alert_form` SET alert_type_code='230', field_value_code=NULL, field_name='载客量', field_code='passengerCapacity', field_type='inputNumber', rec_user_name=NULL, rec_user_id=NULL, rec_date=NULL, is_delete=0, block=0, sort_num=9, url=NULL WHERE sequence_nbr=108;
UPDATE `jc_alert_form` SET alert_type_code='230', field_value_code='PJPD', field_name='迫降跑道', field_code='forcedLandingTrack ', field_type='select', rec_user_name=NULL, rec_user_id=NULL, rec_date=NULL, is_delete=0, block=0, sort_num=6, url='' WHERE sequence_nbr=109;
UPDATE `jc_alert_form` SET alert_type_code='230', field_value_code=NULL, field_name='灾害事故情况', field_code='accidentSituation', field_type='textarea', rec_user_name=NULL, rec_user_id=NULL, rec_date=NULL, is_delete=0, block=1, sort_num=11, url=NULL WHERE sequence_nbr=110;
UPDATE `jc_alert_form` SET alert_type_code='230', field_value_code=NULL, field_name='发展态势', field_code='developmentTrend', field_type='textarea', rec_user_name=NULL, rec_user_id=NULL, rec_date=NULL, is_delete=0, block=1, sort_num=12, url=NULL WHERE sequence_nbr=111;
UPDATE `jc_alert_form` SET alert_type_code='230', field_value_code=NULL, field_name='备注', field_code='remarks', field_type='textarea', rec_user_name=NULL, rec_user_id=NULL, rec_date=NULL, is_delete=0, block=1, sort_num=13, url=NULL WHERE sequence_nbr=112;
UPDATE `jc_alert_form` SET alert_type_code='242', field_value_code=NULL, field_name='保障类别', field_code='securityCategory', field_type='selectDelay', rec_user_name=NULL, rec_user_id=NULL, rec_date=NULL, is_delete=0, block=0, sort_num=2, url='data-dictionary/gwmcDataDictionary/YGCJ' WHERE sequence_nbr=124;
UPDATE `jc_alert_form` SET alert_type_code='242', field_value_code=NULL, field_name='事件概述', field_code='eventOverview', field_type='textarea', rec_user_name=NULL, rec_user_id=NULL, rec_date=NULL, is_delete=0, block=1, sort_num=3, url=NULL WHERE sequence_nbr=125;
UPDATE `jc_alert_form` SET alert_type_code='242', field_value_code=NULL, field_name='备注', field_code='remarks', field_type='textarea', rec_user_name=NULL, rec_user_id=NULL, rec_date=NULL, is_delete=0, block=1, sort_num=4, url=NULL WHERE sequence_nbr=126;
</sql>
</changeSet>
</databaseChangeLog> </databaseChangeLog>
...@@ -26,6 +26,8 @@ mybatis.mapper-locations = classpath:db/mapper/*.xml ...@@ -26,6 +26,8 @@ mybatis.mapper-locations = classpath:db/mapper/*.xml
mybatis-plus.mapper-locations=classpath:db/mapper/*.xml mybatis-plus.mapper-locations=classpath:db/mapper/*.xml
mybatis.type-aliases-package = com.yeejoin.amos.maintenance.business.entity.mybatis mybatis.type-aliases-package = com.yeejoin.amos.maintenance.business.entity.mybatis
mybatis.configuration.mapUnderscoreToCamelCase=true mybatis.configuration.mapUnderscoreToCamelCase=true
#null值也返回
mybatis-plus.configuration.call-setters-on-nulls=true
spring.liquibase.changeLog=classpath:db/changelog/changelog-master.xml spring.liquibase.changeLog=classpath:db/changelog/changelog-master.xml
spring.liquibase.enabled=true spring.liquibase.enabled=true
......
package com.yeejoin.amos; package com.yeejoin.amos;
import java.io.IOException;
import java.net.InetAddress;
import java.net.URISyntaxException;
import java.net.UnknownHostException;
import org.mybatis.spring.annotation.MapperScan; import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
...@@ -19,15 +14,21 @@ import org.springframework.cloud.openfeign.EnableFeignClients; ...@@ -19,15 +14,21 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.FilterType;
import org.springframework.core.env.Environment; import org.springframework.core.env.Environment;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing; import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.transaction.annotation.EnableTransactionManagement; import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.web.client.RestTemplate; import org.springframework.web.client.RestTemplate;
import org.typroject.tyboot.core.restful.config.JsonSerializerManage;
import org.typroject.tyboot.core.restful.exception.GlobalExceptionHandler; import org.typroject.tyboot.core.restful.exception.GlobalExceptionHandler;
import java.io.IOException;
import java.net.InetAddress;
import java.net.URISyntaxException;
import java.net.UnknownHostException;
/** /**
*
* <pre> * <pre>
* 服务启动类 * 服务启动类
* </pre> * </pre>
...@@ -44,42 +45,40 @@ import org.typroject.tyboot.core.restful.exception.GlobalExceptionHandler; ...@@ -44,42 +45,40 @@ import org.typroject.tyboot.core.restful.exception.GlobalExceptionHandler;
@EnableFeignClients @EnableFeignClients
@EnableAsync @EnableAsync
@EnableEurekaClient @EnableEurekaClient
@ComponentScan({"org.typroject","com.yeejoin.amos"}) @ComponentScan(value = {"org.typroject", "com.yeejoin.amos"}, excludeFilters = {
@MapperScan(basePackages = { "com.yeejoin.amos.patrol.business.dao.mapper","org.typroject.tyboot.core.auth.face.orm.dao","com.yeejoin.amos.boot.biz.common.dao.mapper" }) @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, classes = {JsonSerializerManage.class})})
public class PatrolApplication @MapperScan(basePackages = {"com.yeejoin.amos.patrol.business.dao.mapper", "org.typroject.tyboot.core.auth.face.orm.dao", "com.yeejoin.amos.boot.biz.common.dao.mapper"})
{ public class PatrolApplication {
private static final Logger logger = LoggerFactory.getLogger(PatrolApplication.class);
private static final Logger logger = LoggerFactory.getLogger(PatrolApplication.class);
@Bean @Bean
@LoadBalanced @LoadBalanced
RestTemplate initRestTemplate() { RestTemplate initRestTemplate() {
return new RestTemplate(); return new RestTemplate();
} }
/** /**
* 启动amosop-server * 启动amosop-server
* *
* @param args * @param args
* @throws IOException * @throws IOException
* @throws URISyntaxException * @throws URISyntaxException
*/ */
public static void main(String[] args) throws UnknownHostException public static void main(String[] args) throws UnknownHostException {
{ logger.info("start Service..........");
logger.info("start Service.........."); ConfigurableApplicationContext context = SpringApplication.run(PatrolApplication.class, args);
ConfigurableApplicationContext context = SpringApplication.run(PatrolApplication.class, args); GlobalExceptionHandler.setAlwaysOk(true);
GlobalExceptionHandler.setAlwaysOk(true); Environment env = context.getEnvironment();
Environment env = context.getEnvironment(); String ip = InetAddress.getLocalHost().getHostAddress();
String ip = InetAddress.getLocalHost().getHostAddress(); String port = env.getProperty("server.port");
String port = env.getProperty("server.port"); String path = env.getProperty("server.servlet.context-path");
String path = env.getProperty("server.servlet.context-path"); GlobalExceptionHandler.setAlwaysOk(true);
GlobalExceptionHandler.setAlwaysOk(true); logger.info("\n----------------------------------------------------------\n\t" +
logger.info("\n----------------------------------------------------------\n\t" + "Application Amos-Biz-Boot is running! Access URLs:\n\t" +
"Application Amos-Biz-Boot is running! Access URLs:\n\t" + "Swagger文档: \thttp://" + ip + ":" + port + path + "/doc.html\n" +
"Swagger文档: \thttp://" + ip + ":" + port + path + "/doc.html\n" + "----------------------------------------------------------");
"----------------------------------------------------------"); }
}
} }
\ No newline at end of file
...@@ -168,7 +168,6 @@ ...@@ -168,7 +168,6 @@
and SYSDATE() <![CDATA[>=]]> pt.begin_time and SYSDATE() <![CDATA[>=]]> pt.begin_time
and SYSDATE() <![CDATA[<]]> pt.end_time and SYSDATE() <![CDATA[<]]> pt.end_time
</select> </select>
<select id="getPlanTasks" resultType="Map"> <select id="getPlanTasks" resultType="Map">
SELECT SELECT
a.planTaskId, a.planTaskId,
...@@ -185,7 +184,6 @@ ...@@ -185,7 +184,6 @@
a.userId executiveName, a.userId executiveName,
a.userName, a.userName,
a.userDept a.userDept
<!-- (SELECT GROUP_CONCAT(`name`) FROM s_user where find_in_set(id,a.userId)>0 ORDER BY `id`) AS executiveName -->
FROM FROM
( (
SELECT SELECT
...@@ -202,7 +200,6 @@ ...@@ -202,7 +200,6 @@
pt.end_time, pt.end_time,
'%Y-%m-%d %H:%i:%s' '%Y-%m-%d %H:%i:%s'
) endTime, ) endTime,
date_format( date_format(
pt.check_date, pt.check_date,
'%Y-%m-%d %H:%i:%s' '%Y-%m-%d %H:%i:%s'
...@@ -219,79 +216,10 @@ ...@@ -219,79 +216,10 @@
p_plan_task pt p_plan_task pt
INNER JOIN p_plan p ON pt.plan_id = p.id INNER JOIN p_plan p ON pt.plan_id = p.id
) a ) a
<where> <include refid="plan-task-app-where"/>
<if test="userId != null and userId > 0 "> and find_in_set(#{userId},a.userId)>0</if> <if test="orderBy != null and orderBy != ''"> order by ${orderBy} </if>
<if test="routeId != null and userId > 0 "> and a.route_id = #{routeId} </if>
<if test="checkDate != null and checkDate != '' "> and a.beginTime <![CDATA[<=]]> #{checkDate} and a.endTime <![CDATA[>=]]> #{checkDate} </if>
<if test="finishStatus != null"> and a.finishStatus = #{finishStatus}</if>
<if test="orgCode != null and orgCode !=''" >
and (a.OrgCode LIKE CONCAT( #{orgCode}, '-%' ) or a.OrgCode= #{orgCode} )
</if>
<choose>
<when test="departmentId != null and departmentId != 0 ">and a.userDept like concat('%', #{departmentId}, '%')</when>
<!-- <when test="departmentId == -1 and ids != null">and a.userId in-->
<!-- <foreach item="item" collection="ids" separator="," open="(" close=")" index="index">-->
<!-- #{item}-->
<!-- </foreach>-->
<!-- </when>-->
</choose>
<if test="startTime != null and startTime != '' and endTime != null and endTime != '' ">
AND (
(
a.beginTime <![CDATA[>=]]> #{startTime}
AND a.endTime <![CDATA[<=]]> #{endTime}
)
OR (
a.beginTime <![CDATA[<=]]> #{endTime}
AND a.endTime <![CDATA[>=]]> #{endTime}
)
OR (
a.beginTime <![CDATA[<=]]> #{startTime}
AND a.endTime <![CDATA[>]]> #{startTime}
)
OR (
a.beginTime <![CDATA[<=]]> #{startTime}
AND a.endTime <![CDATA[>=]]> #{endTime}
)
)
</if>
<if test="query != null and query != '' ">
<if test="queryType != null and queryType != 'executiveName' and queryType != 'plan' ">
AND EXISTS (
SELECT
1
FROM
p_point pp
LEFT JOIN p_route_point rp ON rp.point_id = pp.id
LEFT JOIN p_route r ON r.id = rp.route_id
where a.route_id = r.id
<if test="queryType == null or queryType == '' or queryType == 'all' ">
AND CONCAT(pp.name, ',',r.name, ',', pp.point_no,a.taskName, ',', a.batchNo) LIKE concat('%', #{query}, '%')
</if>
<if test="queryType != null and queryType == 'route' ">
AND r.name LIKE concat('%', #{query}, '%')
</if>
<if test="queryType != null and queryType == 'point' ">
AND CONCAT(pp.name, ',', pp.point_no) LIKE concat('%', #{query}, '%')
</if>
)
</if>
<if test="queryType != null and queryType == 'executiveName' ">
AND a.userName LIKE concat('%', #{query}, '%')
</if>
<if test="queryType != null and queryType == 'plan' ">
AND CONCAT(a.taskName, ',', a.batchNo) LIKE concat('%', #{query}, '%')
</if>
</if>
</where>
<if test="orderBy != null and orderBy != '' "> order by ${orderBy} </if>
limit #{offset},#{pageSize} limit #{offset},#{pageSize}
</select> </select>
<select id="getPlanTasksCount" resultType="long"> <select id="getPlanTasksCount" resultType="long">
SELECT SELECT
count(1) tasksCount count(1) tasksCount
...@@ -324,78 +252,68 @@ ...@@ -324,78 +252,68 @@
p_plan_task pt p_plan_task pt
INNER JOIN p_plan p ON pt.plan_id = p.id INNER JOIN p_plan p ON pt.plan_id = p.id
) a ) a
<include refid="plan-task-app-where"/>
</select>
<sql id="plan-task-app-where">
<where> <where>
<if test="userId != null and userId > 0 "> and find_in_set(#{userId},a.userId)>0 </if> <if test="userId != null and userId > 0 "> and find_in_set(#{userId},a.userId)>0</if>
<if test="routeId != null and userId > 0 "> and a.route_id = #{routeId} </if> <if test="routeId != null and routeId > 0 "> and a.route_id = #{routeId} </if>
<if test="checkDate != null and checkDate != '' "> and a.beginTime <![CDATA[<=]]> #{checkDate} and a.endTime <![CDATA[>=]]> #{checkDate} </if> <if test="checkDate != null and checkDate != '' "> and a.beginTime <![CDATA[<=]]> #{checkDate} and a.endTime <![CDATA[>=]]> #{checkDate} </if>
<if test="finishStatus != null"> and a.finishStatus = #{finishStatus}</if> <if test="finishStatus != null"> and a.finishStatus = #{finishStatus}</if>
<if test="orgCode != null and orgCode !=''" > <if test="orgCode != null and orgCode !=''" >
and (a.OrgCode LIKE CONCAT( #{orgCode}, '-%' ) or a.OrgCode= #{orgCode} ) and (a.OrgCode LIKE CONCAT( #{orgCode}, '-%' ) or a.OrgCode= #{orgCode} )
</if> </if>
<choose> <if test="departmentId != null and departmentId != 0 ">and a.userDept like concat('%', #{departmentId}, '%')</if>
<when test="departmentId != null and departmentId!= 0 ">and a.userDept like concat('%', #{departmentId}, '%') </when> <if test="startTime != null and startTime != '' and endTime != null and endTime != '' ">
<!-- <when test="departmentId == -1 and ids != null">and a.userId in--> AND (
<!-- <foreach item="item" collection="ids" separator="," open="(" close=")" index="index">--> (
<!-- #{item}--> a.beginTime <![CDATA[>=]]> #{startTime}
<!-- </foreach>--> AND a.endTime <![CDATA[<=]]> #{endTime}
<!-- </when>--> )
</choose> OR (
a.beginTime <![CDATA[<=]]> #{endTime}
<if test="startTime != null and startTime != '' and endTime != null and endTime != '' "> AND a.endTime <![CDATA[>=]]> #{endTime}
AND ( )
( OR (
a.beginTime <![CDATA[>=]]> #{startTime} a.beginTime <![CDATA[<=]]> #{startTime}
AND a.endTime <![CDATA[<=]]> #{endTime} AND a.endTime <![CDATA[>]]> #{startTime}
) )
OR ( OR (
a.beginTime <![CDATA[<=]]> #{endTime} a.beginTime <![CDATA[<=]]> #{startTime}
AND a.endTime <![CDATA[>=]]> #{endTime} AND a.endTime <![CDATA[>=]]> #{endTime}
)
OR (
a.beginTime <![CDATA[<=]]> #{startTime}
AND a.endTime <![CDATA[>]]> #{startTime}
)
OR (
a.beginTime <![CDATA[<=]]> #{startTime}
AND a.endTime <![CDATA[>=]]> #{endTime}
)
) )
</if>
<if test="query != null and query != '' ">
<if test="queryType != null and queryType != 'executiveName' and queryType != 'plan' ">
AND EXISTS (
SELECT
1
FROM
p_point pp
LEFT JOIN p_route_point rp ON rp.point_id = pp.id
LEFT JOIN p_route r ON r.id = rp.route_id
where a.route_id = r.id
<if test="queryType == null or queryType == '' or queryType == 'all' ">
AND CONCAT(pp.name, ',',r.name, ',', pp.point_no,a.taskName, ',', a.batchNo) LIKE concat('%', #{query}, '%')
</if>
<if test="queryType != null and queryType == 'route' ">
AND r.name LIKE concat('%', #{query}, '%')
</if>
<if test="queryType != null and queryType == 'point' ">
AND CONCAT(pp.name, ',', pp.point_no) LIKE concat('%', #{query}, '%')
</if>
) )
</if> </if>
<if test="query != null and query != '' ">
<if test="queryType != null and queryType == 'executiveName' "> <if test="queryType != null and queryType != 'executiveName' and queryType != 'plan' ">
AND EXISTS (
SELECT
1
FROM
p_point pp
LEFT JOIN p_route_point rp ON rp.point_id = pp.id
LEFT JOIN p_route r ON r.id = rp.route_id
where a.route_id = r.id
<if test="queryType == null or queryType == '' or queryType == 'all' ">
AND CONCAT(pp.name, ',',r.name, ',', pp.point_no,a.taskName, ',', a.batchNo) LIKE concat('%', #{query}, '%')
</if>
<if test="queryType != null and queryType == 'route' ">
AND r.name LIKE concat('%', #{query}, '%')
</if>
<if test="queryType != null and queryType == 'point' ">
AND CONCAT(pp.name, ',', pp.point_no) LIKE concat('%', #{query}, '%')
</if>
)
</if>
<if test="queryType != null and queryType == 'executiveName' ">
AND a.userName LIKE concat('%', #{query}, '%') AND a.userName LIKE concat('%', #{query}, '%')
</if> </if>
<if test="queryType != null and queryType == 'plan' "> <if test="queryType != null and queryType == 'plan' ">
AND CONCAT(a.taskName, ',', a.batchNo) LIKE concat('%', #{query}, '%') AND CONCAT(a.taskName, ',', a.batchNo) LIKE concat('%', #{query}, '%')
</if>
</if> </if>
</if>
</where> </where>
</select> </sql>
<select id="queryPlanTaskById" resultType="Map"> <select id="queryPlanTaskById" resultType="Map">
......
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