Commit 94c4710a authored by chenhao's avatar chenhao

Merge branch 'developer' of http://172.16.10.76/moa/amos-boot-biz into developer

parents df537d21 2c98629f
package com.yeejoin.amos.boot.biz.common.utils;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
public enum CodeInfoEnum {
LOCK(1L, 1L, "LOCK_TYPE", "LOCK"), UNLOCK(1L, 2L, "LOCK_TYPE", "LOCK");
public Long classId;
public Long infoId;
public String classCode;
public String infoCode;
CodeInfoEnum(Long classId, Long infoId, String classCode, String infoCode) {
this.classId = classId;
this.infoId = infoId;
this.classCode = classCode;
this.infoCode = infoCode;
}
public static CodeInfoEnum getByInfoId(Long infoId) {
return CodeInfoEnum.valueOf(infoId + "");
}
public static List getByClassId(Long classId) {
return Arrays.stream(CodeInfoEnum.values()).filter(item -> item.classId.equals(classId)).collect(Collectors.toList());
}
public static CodeInfoEnum getByClassCodeAndInfoCode(String classCode, String infoCode) {
Optional opt = Arrays.stream(CodeInfoEnum.values()).filter(item -> item.classCode.equals(classCode) && item.infoCode.equals(infoCode)).findFirst();
return (CodeInfoEnum) opt.orElse(null);
}
@Override
public String toString() {
return "CodeInfoEnum{" +
"classId=" + classId +
", infoId=" + infoId +
", classCode='" + classCode + '\'' +
", infoCode='" + infoCode + '\'' +
'}';
}
}
package com.yeejoin.amos.boot.biz.common.utils;
import sun.reflect.ConstructorAccessor;
import sun.reflect.FieldAccessor;
import sun.reflect.ReflectionFactory;
import java.lang.reflect.AccessibleObject;
import java.lang.reflect.Array;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class DynamicEnumUtils {
private static ReflectionFactory reflectionFactory = ReflectionFactory.getReflectionFactory();
private static void setFailsafeFieldValue(Field field, Object target, Object value) throws NoSuchFieldException,
IllegalAccessException {
// 反射访问私有变量
field.setAccessible(true);
/**
* 接下来,我们将字段实例中的修饰符更改为不再是final,
* 从而使反射允许我们修改静态final字段。
*/
Field modifiersField = Field.class.getDeclaredField("modifiers");
modifiersField.setAccessible(true);
int modifiers = modifiersField.getInt(field);
// 去掉修饰符int中的最后一位
modifiers &= ~Modifier.FINAL;
modifiersField.setInt(field, modifiers);
FieldAccessor fa = reflectionFactory.newFieldAccessor(field, false);
fa.set(target, value);
}
private static void blankField(Class<?> enumClass, String fieldName) throws NoSuchFieldException,
IllegalAccessException {
for (Field field : Class.class.getDeclaredFields()) {
if (field.getName().contains(fieldName)) {
AccessibleObject.setAccessible(new Field[]{field}, true);
setFailsafeFieldValue(field, enumClass, null);
break;
}
}
}
private static void cleanEnumCache(Class<?> enumClass) throws NoSuchFieldException, IllegalAccessException {
blankField(enumClass, "enumConstantDirectory"); // Sun (Oracle?!?) JDK 1.5/6
blankField(enumClass, "enumConstants"); // IBM JDK
}
private static ConstructorAccessor getConstructorAccessor(Class<?> enumClass, Class<?>[] additionalParameterTypes)
throws NoSuchMethodException {
Class<?>[] parameterTypes = new Class[additionalParameterTypes.length + 2];
parameterTypes[0] = String.class;
parameterTypes[1] = int.class;
System.arraycopy(additionalParameterTypes, 0, parameterTypes, 2, additionalParameterTypes.length);
return reflectionFactory.newConstructorAccessor(enumClass.getDeclaredConstructor(parameterTypes));
}
private static Object makeEnum(Class<?> enumClass, String value, int ordinal, Class<?>[] additionalTypes,
Object[] additionalValues) throws Exception {
Object[] parms = new Object[additionalValues.length + 2];
parms[0] = value;
parms[1] = Integer.valueOf(ordinal);
System.arraycopy(additionalValues, 0, parms, 2, additionalValues.length);
return enumClass.cast(getConstructorAccessor(enumClass, additionalTypes).newInstance(parms));
}
/**
* 将枚举实例添加到作为参数提供的枚举类中
*
* @param enumType 要修改的枚举类型
* @param enumName 添加的枚举类型名字
* @param additionalTypes 枚举类型参数类型列表
* @param additionalValues 枚举类型参数值列表
* @param <T>
*/
@SuppressWarnings("unchecked")
public static <T extends Enum<?>> void addEnum(Class<T> enumType, String enumName, Class<?>[] additionalTypes, Object[] additionalValues) {
// 0. 检查类型
if (!Enum.class.isAssignableFrom(enumType)) {
throw new RuntimeException("class " + enumType + " is not an instance of Enum");
}
// 1. 在枚举类中查找“$values”持有者并获取以前的枚举实例
Field valuesField = null;
Field[] fields = enumType.getDeclaredFields();
for (Field field : fields) {
if (field.getName().contains("$VALUES")) {
valuesField = field;
break;
}
}
AccessibleObject.setAccessible(new Field[]{valuesField}, true);
try {
// 2. 将他拷贝到数组
T[] previousValues = (T[]) valuesField.get(enumType);
List<T> values = new ArrayList<T>(Arrays.asList(previousValues));
// 3. 创建新的枚举项
T newValue = (T) makeEnum(enumType, enumName, values.size(), additionalTypes, additionalValues);
// 4. 添加新的枚举项
values.add(newValue);
// 5. 设定拷贝的数组,到枚举类型
setFailsafeFieldValue(valuesField, null, values.toArray((T[]) Array.newInstance(enumType, 0)));
// 6. 清楚枚举的缓存
cleanEnumCache(enumType);
} catch (Exception e) {
throw new RuntimeException(e.getMessage(), e);
}
}
public static void main(String[] args) {
//
synchronized (CodeInfoEnum.class) {
addEnum(CodeInfoEnum.class, "3", new Class[]{Long.class, Long.class, String.class, String.class}, new Object[]{2L, 3L, "ActiveStatus", "Active"});
addEnum(CodeInfoEnum.class, "4", new Class[]{Long.class, Long.class, String.class, String.class}, new Object[]{2L, 4L, "ActiveStatus", "Inactive"});
addEnum(CodeInfoEnum.class, "5", new Class[]{Long.class, Long.class, String.class, String.class}, new Object[]{3L, 5L, "Optype", "OP1"});
addEnum(CodeInfoEnum.class, "6", new Class[]{Long.class, Long.class, String.class, String.class}, new Object[]{3L, 6L, "Optype", "OP2"});
addEnum(CodeInfoEnum.class, "7", new Class[]{Long.class, Long.class, String.class, String.class}, new Object[]{3L, 7L, "Optype", "OP3"});
addEnum(CodeInfoEnum.class, "8", new Class[]{Long.class, Long.class, String.class, String.class}, new Object[]{3L, 8L, "Optype", "OP4"});
}
CodeInfoEnum codeInfoEnum = CodeInfoEnum.valueOf("5");
System.out.println(codeInfoEnum);
// Run a few tests just to show it works OK.
System.out.println(Arrays.deepToString(CodeInfoEnum.values()));
System.out.println("============================打印所有枚举(包括固定的和动态的),可以将数据库中保存的CIC以枚举的形式加载到JVM");
for (CodeInfoEnum codeInfo : CodeInfoEnum.values()) {
System.out.println(codeInfo.toString());
}
System.out.println("============================通过codeId找到的枚举,用于PO转VO的处理");
CodeInfoEnum activeStatus_Active = CodeInfoEnum.getByInfoId(3L);
System.out.println(activeStatus_Active);
System.out.println("============================通过ClassId找到的枚举列表");
List<CodeInfoEnum> activeStatusEnumList = CodeInfoEnum.getByClassId(3L);
for (CodeInfoEnum codeInfo : activeStatusEnumList) {
System.out.println(codeInfo);
}
System.out.println("============================通过ClassCode和InfoCode获取枚举,用于导入验证CIC合法性");
CodeInfoEnum toGetActiveStatus_Active = CodeInfoEnum.getByClassCodeAndInfoCode("ActiveStatus", "Active");
System.out.println(toGetActiveStatus_Active);
System.out.println("============================通过ClassCode和InfoCode获取枚举,输入不存在的Code,则返回NULL");
CodeInfoEnum toGetActiveStatus_miss = CodeInfoEnum.getByClassCodeAndInfoCode("ActiveStatus", "MISS");
System.out.println(toGetActiveStatus_miss);
}
}
\ No newline at end of file
......@@ -87,39 +87,42 @@ public class FirefightersExcelDto extends BaseDto {
@ApiModelProperty(value = "婚姻状况")
private String maritalStatus;
@ExcelIgnore
@ApiModelProperty(value = "籍贯/户口所在地")
private String nativePlace;
@ExplicitConstraint(indexNum = 10, sourceClass = RoleNameExplicitConstraint.class,method="getCitys") //动态下拉内容// BUG 2760 修改消防人员导出模板和 导入问题 bykongfm
@ExcelProperty(value = "户籍所在地", index = 10)
@ApiModelProperty(value = "籍贯/户口所在地的值")
private String nativePlaceValue;
@ExplicitConstraint(indexNum = 11, sourceClass = RoleNameExplicitConstraint.class, method = "getPoliticalOutlook") //固定下拉内容
@ExcelProperty(value = "政治面貌", index = 11)
// BUG 3658 优化 by kongfm 2021-09-13 需求详细说明 1. 添加两个字段 2. 地区选择联动 只有新增时带联动 编辑时不带联动 3. 导出模板及导入同步修改
@ExcelProperty(value = "籍贯/户口所在地详细地址", index = 11)
@ApiModelProperty(value = "籍贯/户口所在地详细地址")
private String nativePlaceVal;
@ExplicitConstraint(indexNum = 12, sourceClass = RoleNameExplicitConstraint.class, method = "getPoliticalOutlook") //固定下拉内容
@ExcelProperty(value = "政治面貌", index = 12)
@ApiModelProperty(value = "政治面貌代码")
private String politicalOutlook;
@ExplicitConstraint(indexNum = 12, sourceClass = RoleNameExplicitConstraint.class,method="getCitys") //动态下拉内容// BUG 2760 修改消防人员导出模板和 导入问题 bykongfm
@ExcelProperty(value = "现居住地", index = 12)
@ExplicitConstraint(indexNum = 13, sourceClass = RoleNameExplicitConstraint.class,method="getCitys") //动态下拉内容// BUG 2760 修改消防人员导出模板和 导入问题 bykongfm
@ExcelProperty(value = "现居住地", index = 13)
@ApiModelProperty(value = "现居住地")
private String residence;
// BUG 3658 优化 by kongfm 2021-09-13 需求详细说明 1. 添加两个字段 2. 地区选择联动 只有新增时带联动 编辑时不带联动 3. 导出模板及导入同步修改
@ExcelProperty(value = "现居住地详细地址", index = 14)
@ApiModelProperty(value = "现居住地详细地址")
private String residenceDetailVal;
@ExcelIgnore
@ApiModelProperty(value = "现居住地详情")
private String residenceDetails;
@ExcelProperty(value = "机场住宿情况", index = 13)
@ExcelProperty(value = "机场住宿情况", index = 15)
@ApiModelProperty(value = "机场住宿情况")
private String airportAccommodation;
@ExcelProperty(value = "联系电话", index = 14)
@ExcelProperty(value = "联系电话", index = 16)
@ApiModelProperty(value = "手机")
private String mobilePhone;
@ExplicitConstraint(type = "RYZT", indexNum = 15, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "人员状态", index = 15)
@ExplicitConstraint(type = "RYZT", indexNum = 17, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "人员状态", index = 17)
@ApiModelProperty(value = "人员状态,在职/离职")
private String state;
......@@ -127,21 +130,21 @@ public class FirefightersExcelDto extends BaseDto {
@ApiModelProperty(value = "人员状态,在职/离职字典code")
private String stateCode;
@ExplicitConstraint(type = "GWMC", indexNum = 16, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "岗位名称", index = 16)
@ExplicitConstraint(type = "GWMC", indexNum = 18, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "岗位名称", index = 18)
@ApiModelProperty(value = "岗位名称")
private String jobTitle;
@ExcelProperty(value = "紧急联系人姓名", index = 17)
@ExcelProperty(value = "紧急联系人姓名", index = 19)
@ApiModelProperty(value = "紧急联系人姓名")
private String emergencyContact;
@ExplicitConstraint(type = "RJGX", indexNum = 18, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "与紧急联系人关系", index = 18)
@ExplicitConstraint(type = "RJGX", indexNum = 20, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "与紧急联系人关系", index = 20)
@ApiModelProperty(value = "紧急联系人与本人所属关系")
private String relationship;
@ExcelProperty(value = "紧急联系人电话", index = 19)
@ExcelProperty(value = "紧急联系人电话", index = 21)
@ApiModelProperty(value = "紧急联系人电话")
private String emergencyContactPhone;
......
......@@ -122,4 +122,11 @@ public class Firefighters extends BaseEntity {
@ApiModelProperty(value = "籍贯/户口所在地的值")
private String nativePlaceValue;
// BUG 3658 优化 by kongfm 2021-09-13 需求详细说明 1. 添加两个字段 2. 地区选择联动 只有新增时带联动 编辑时不带联动 3. 导出模板及导入同步修改
@ApiModelProperty(value = "户籍所在地详细地址")
private String nativePlaceVal;
@ApiModelProperty(value = "现居住地详细地址")
private String residenceDetailVal;
}
......@@ -82,8 +82,8 @@
and a.resource_type= #{par.resourceType}
</if>
<if test='par.distance!=null'>
<!-- and Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1) &lt;=
#{par.distance} -->
and Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1) &lt;=
#{par.distance}
</if>
ORDER BY distance limit #{pageNum},#{pageSize}
</select>
......@@ -97,8 +97,8 @@
and a.resource_type= #{par.resourceType}
</if>
<if test='par.distance!=null'>
<!-- and Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1) &lt;=
#{par.distance} -->
and Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1) &lt;=
#{par.distance}
</if>
</select>
<select id="getWaterResourceTypeList" resultType="com.yeejoin.amos.boot.module.common.api.dto.WaterResourceTypeDto">
......
......@@ -47,4 +47,7 @@ public interface AlertCalledMapper extends BaseMapper<AlertCalled> {
Integer AlertCalledcount(@Param("alertStatus")int alertStatus);
//未结束灾情列表
List<AlertCalled> AlertCalledStatusPage(@Param("current")Integer current, @Param("size")Integer size);
}
......@@ -75,4 +75,6 @@ public interface IAlertCalledService {
Integer AlertCalledcount(int type);
List<AlertCalled> AlertCalledStatusPage(Integer current, Integer size);
}
......@@ -186,5 +186,19 @@
</select>
<!-- 未结束警情列表 -->
<select id="AlertCalledStatusPage" resultType="com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled">
select * from jc_alert_called where is_delete=0 and alert_status = 0 ORDER BY response_level_code desc
,call_time limit #{current},#{size}
</select>
</mapper>
......@@ -580,15 +580,11 @@ public class CommandController extends BaseController {
@TycloudOperation( needAuth = true,ApiLevel = UserType.AGENCY)
@GetMapping(value = "LinkageUnitDto/page")
@ApiOperation(httpMethod = "GET", value = "联动单位分页查询", notes = "联动单位分页查询")
public ResponseModel<Page<LinkageUnitDto>> LinkageUnitDtoQueryForPage(@RequestParam(value = "pageNum") int pageNum,
@RequestParam(value = "pageSize") int pageSize,
String unitName,String linkageUnitTypeCode, String linkageUnitType, String inAgreement) {
public ResponseModel<Page<LinkageUnitDto>> LinkageUnitDtoQueryForPage(@RequestParam(value = "pageNum") int pageNum, @RequestParam(value = "pageSize") int pageSize,String unitName,String linkageUnitTypeCode, String linkageUnitType, String inAgreement) {
Page<LinkageUnitDto> page = new Page<LinkageUnitDto>();
page.setCurrent(pageNum);
page.setSize(pageSize);
Page<LinkageUnitDto> linkageUnitDtoPage = iLinkageUnitService.queryForLinkageUnitPage(page, false,
unitName,linkageUnitTypeCode, linkageUnitType, null, inAgreement);
Page<LinkageUnitDto> linkageUnitDtoPage = iLinkageUnitService.queryForLinkageUnitPage(page, false, unitName,linkageUnitTypeCode, linkageUnitType, null, inAgreement);
return ResponseHelper.buildResponse(linkageUnitDtoPage);
}
......@@ -627,9 +623,7 @@ public class CommandController extends BaseController {
@GetMapping(value = "statistics/{id}")
@ApiOperation(httpMethod = "GET", value = "火灾现场统计", notes = "火灾现场统计")
public ResponseModel<Object> getStatistics(@PathVariable Long id) {
return ResponseHelper.buildResponse(iAlertCalledService.selectAlertCalledcount(id));
}
/**
* * @param null
......@@ -673,7 +667,6 @@ public class CommandController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "获取灾情当前阶段", notes = "获取灾情当前阶段")
public ResponseModel<Object> getstate(@PathVariable Long id) {
AlertCalled AlertCalled=iAlertCalledService.getAlertCalledById(id);
List<StateDot> list=new ArrayList<>();
list.add(new StateDot("警情接报"));
list.add(new StateDot("力量调派"));
......@@ -779,16 +772,12 @@ public class CommandController extends BaseController {
@ApiOperation(value = "查看文件内容", notes = "查看文件内容")
public ResponseModel<Object> lookHtmlText( HttpServletResponse response,@RequestParam(value = "fileUrl")String fileUrl ,@RequestParam(value = "product")String product,@RequestParam(value = "appKey")String appKey,@RequestParam(value = "token")String token /* @PathVariable String fileName */)
throws Exception {
String fileName =readUrl+fileUrl; //目标文件
String fileName =readUrl+fileUrl; //目标文件
if (fileName.endsWith(".doc") || fileName.endsWith(".docx")) {
String htmlPath= System.getProperty("user.dir")+File.separator+"lookHtml"+File.separator+"file"+File.separator;
String imagePathStr= System.getProperty("user.dir")+File.separator+"lookHtml"+File.separator+"image"+File.separator;
String name = fileUrl.substring(fileUrl.lastIndexOf('/')+1);
String htmlFileName = htmlPath + name.substring(0, name.indexOf(".")) +".html";
String htmlFileName = htmlPath + name.substring(0, name.indexOf(".")) +".html";
File htmlP = new File(htmlPath);
if (!htmlP.exists()) {
htmlP.mkdirs();
......@@ -827,24 +816,18 @@ public class CommandController extends BaseController {
@GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET", value = "根据灾情查询单个航空器信息", notes = "根据灾情查询单个航空器信息")
public ResponseModel<AircraftDto> seleteaircraftOne(@PathVariable Long sequenceNbr) {
// 警情动态表单数据
List<AlertFormValue> list = alertFormValueService.getzqlist(sequenceNbr);
for (AlertFormValue alertFormValue : list) {
if("aircraftModel".equals(alertFormValue.getFieldCode())) {
String aircraftModel=alertFormValue.getFieldValue();
if(aircraftModel!=null&&!"".equals(aircraftModel)) {
AircraftDto aircraftDto=aircraftService.queryByAircraftSeq(RequestContext.getAgencyCode(),1411994005943717890L);
//现场照片 待完成,
return ResponseHelper.buildResponse(aircraftDto);
}
}
}
return ResponseHelper.buildResponse(null);
}
......@@ -852,7 +835,6 @@ public class CommandController extends BaseController {
@GetMapping(value = "/getOrgUsrzhDto/{id}")
@ApiOperation(httpMethod = "GET", value = "根据灾情id处置对象单位详情", notes = "根据灾情id处置对象单位详情")
public ResponseModel<OrgusrDataxDto> getOrgUsrzhDto(@PathVariable Long id) {
AlertCalled AlertCalled = iAlertCalledService.getAlertCalledById(id);
String buildId = null;
OrgusrDataxDto orgusrDataxDto = new OrgusrDataxDto();
......@@ -949,8 +931,6 @@ public class CommandController extends BaseController {
@RequestMapping(value = "/getVideo", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "分页获取视频", notes = "分页获取视频")
public ResponseModel<Object> getVideo(long current, long size)throws Exception {
Page page = new Page(current, size);
List<OrderItem> list= OrderItem.ascs("id");
page.setOrders(list);
......@@ -1011,7 +991,6 @@ public class CommandController extends BaseController {
OrgusrDataxDto orgusrDataxDto=new OrgusrDataxDto();
if(AlertCalled.getUnitInvolved()!=null&&!"".equals(AlertCalled.getUnitInvolved())) {
List<OrgUsrzhDto> orgUsrzhDto= iOrgUsrService.getOrgUsrzhDto( AlertCalled.getUnitInvolved());
if(orgUsrzhDto!=null&&orgUsrzhDto.size()>0&&orgUsrzhDto.get(0)!=null){
buildId=orgUsrzhDto.get(0).getBuildId()==null?null:Long.valueOf(orgUsrzhDto.get(0).getBuildId());
}
......@@ -1046,10 +1025,7 @@ public class CommandController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "app-根据警情id查询力量调派列表", notes = "app-根据警情id查询力量调派列表")
@GetMapping(value = "/app/transferList")
public ResponseModel getPowerTransferList(@RequestParam String alertId,
@RequestParam(defaultValue = "team") String type,
@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size) {
public ResponseModel getPowerTransferList(@RequestParam String alertId,@RequestParam(defaultValue = "team") String type, @RequestParam(value = "current") int current, @RequestParam(value = "size") int size) {
Page page = new Page();
page.setSize(size);
page.setCurrent(current);
......@@ -1059,8 +1035,7 @@ public class CommandController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "app-根据警情id查询力量调派资源统计", notes = "app-根据警情id查询力量调派资源统计")
@GetMapping(value = "/app/transfer/statistics")
public ResponseModel getPowerTransferStatistics(@RequestParam String alertId,
@RequestParam(defaultValue = "team") String type) {
public ResponseModel getPowerTransferStatistics(@RequestParam String alertId, @RequestParam(defaultValue = "team") String type) {
return ResponseHelper.buildResponse(powerTransferService.getPowerTransferStatistics(Long.valueOf(alertId), type));
}
......@@ -1076,7 +1051,6 @@ public class CommandController extends BaseController {
} catch (Exception e) {
throw new BaseException("更新车辆状态异常", "", e.getMessage());
}
return ResponseHelper.buildResponse(true);
}
......@@ -1149,20 +1123,29 @@ public class CommandController extends BaseController {
@GetMapping(value = "/DynamicFlightInfo/{dynamicFlightId}")
@ApiOperation(httpMethod = "GET", value = "航班信息", notes = "航班信息")
public ResponseModel<Object> DynamicFlightInfo(@PathVariable String dynamicFlightId) {
ResponseModel<Object> dataModel = iotFeignClient.DynamicFlightInfo(dynamicFlightId);
if (dataModel != null) {
return ResponseHelper.buildResponse(dataModel.getResult());
}
return ResponseHelper.buildResponse(null);
}
@TycloudOperation( needAuth = true, ApiLevel = UserType.AGENCY)
@GetMapping(value = "AlertCalledStatusPage")
@ApiOperation(httpMethod = "GET", value = "未结束的灾情列表", notes = "未结束的灾情列表")
public ResponseModel<Page<AlertCalled>> AlertCalledStatusPage( @RequestParam(value = "current") Integer current, @RequestParam(value = "size") Integer size) {
if (null == current || null == size) {
current = 1;
size = Integer.MAX_VALUE;
}
List<AlertCalled> list= iAlertCalledService.AlertCalledStatusPage( current, size);
int num= iAlertCalledService.AlertCalledcount(0);
Page<AlertCalled> pageBean = new Page<>(current, size, num);
pageBean.setRecords(list);
return ResponseHelper.buildResponse(pageBean);
}
......
......@@ -72,7 +72,7 @@ public class DynamicFormColumnServiceImpl extends BaseService<DynamicFormColumnD
List<DynamicFormInitDto> listForm = new ArrayList<DynamicFormInitDto>();
String appKey = RequestContext.getAppKey();
// 组装数据
dynamicFormColumn.parallelStream().forEach(dynamicForm -> {
dynamicFormColumn.stream().forEach(dynamicForm -> {
if ( dynamicForm.getFieldType().equals("input") ||
dynamicForm.getFieldType().equals("string") ||
dynamicForm.getFieldType().equals("datetime") ||
......@@ -193,7 +193,7 @@ public class DynamicFormColumnServiceImpl extends BaseService<DynamicFormColumnD
}
});
return listForm.stream().sorted(Comparator.comparing(DynamicFormInitDto::getSort)).collect(Collectors.toList());
return listForm.stream().sorted(Comparator.nullsFirst(Comparator.comparing(DynamicFormInitDto::getSort))).collect(Collectors.toList());
}
public List<SelectItem> getdata(Collection<DataDictionary> list) {
......
......@@ -1011,7 +1011,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
}
CompanyPerson company = new CompanyPerson();
BeanUtils.copyProperties(org, company);
company.setPersons(this.queryForListByParentIdAndOrgType(org.getSequenceNbr(), OrgPersonEnum.人员.getKey(), false));
company.setPersons(this.queryForListByParentIdAndOrgType(org.getSequenceNbr(), OrgPersonEnum.人员.getKey()));
return company;
}).filter(c -> {
return c != null;
......@@ -1019,6 +1019,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
}
// BUG 2736 人员导出过滤已经删除的数据by kongfm
// 该方法使用时参数有问题 会有下标越界问题,现在更改为public List<OrgUsrDto> queryForListByParentIdAndOrgType(Long parentId, String bizOrgType) 2021-09-13 by kongfm
public List<OrgUsrDto> queryForListByParentIdAndOrgType(Long parentId, String bizOrgType, Boolean isDelete) {
return this.queryForList(null, false, parentId, bizOrgType, isDelete);
}
......
......@@ -7,13 +7,7 @@ import com.yeejoin.amos.boot.module.jcs.biz.service.impl.ExcelServiceImpl;
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.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
......@@ -21,6 +15,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;
/**
* 导出导入
......@@ -53,15 +48,22 @@ public class ExcelController extends BaseController {
throw new RuntimeException("系统异常!");
}
}
/**
* * @param Map par 可以传递过滤条件,传入具体实现类中
* @return
* <PRE>
* author tw
* date 2021/9/13
* </PRE>
*/
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "导出公用类")
@GetMapping("/export/{type}")
public void getFireStationFile(HttpServletResponse response, @PathVariable(value = "type") String type) {
public void getFireStationFile(HttpServletResponse response, @PathVariable(value = "type") String type , @RequestParam Map par) {
try {
ExcelEnums excelEnums= ExcelEnums.getByKey(type);
ExcelDto excelDto = new ExcelDto(excelEnums.getFileName(), excelEnums.getSheetName(), excelEnums.getClassUrl(), excelEnums.getType());
excelService.commonExport(response, excelDto);
excelService.commonExport(response, excelDto,par);
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("系统异常!");
......
......@@ -449,7 +449,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
listdate.add(new KeyValueLabel("伤亡人数", "casualtiesNum", alertCalled.getCasualtiesNum()));
listdate.add(new KeyValueLabel("联系人", "contactUser", alertCalled.getContactUser()));
listdate.add(new KeyValueLabel("联系电话", "contactPhone", alertCalled.getContactPhone()));
listdate.add(new KeyValueLabel("联系人电话", "contactPhone", alertCalled.getContactPhone()));
// listdate.add(new KeyValueLabel("联系人电话", "contactPhone", alertCalled.getContactPhone()));
list.stream().forEach(alertFormValue -> {
String valueCode = alertFormValue.getFieldValueCode();
if(null == valueCode) {
......@@ -674,11 +674,13 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
//未结案警情统计
@Override
public Integer AlertCalledcount(int type) {
return alertCalledMapper.AlertCalledcount(1);
return alertCalledMapper.AlertCalledcount(0);
}
@Override
public List<AlertCalled> AlertCalledStatusPage(Integer current, Integer size) {
return alertCalledMapper.AlertCalledStatusPage( current, size);
}
@Override
......
......@@ -29,7 +29,7 @@ public class DispatchMapServiceImpl implements IHomePageService {
@Override
public Object getHomePageData() {
Integer num= alertCalledMapper1.AlertCalledcount(1);
Integer num= alertCalledMapper1.AlertCalledcount(0);
return num;
}
}
......@@ -28,7 +28,7 @@ public class DispatchTaskServiceImpl implements IHomePageService {
@Override
public Object getHomePageData() {
Integer num= alertCalledMapper1.AlertCalledcount(1);
Integer num= alertCalledMapper1.AlertCalledcount(0);
return num;
}
}
......@@ -171,7 +171,7 @@ public class ExcelServiceImpl {
true);
}
public void commonExport(HttpServletResponse response, ExcelDto excelDto) {
public void commonExport(HttpServletResponse response, ExcelDto excelDto,Map par) {
switch (excelDto.getType()) {
case "WHP":
......
......@@ -95,9 +95,9 @@ public class GroupController extends AbstractBaseController{
for (DepartmentBo d : departmentBos) {
LinkedHashMap<String, Object> dept = new LinkedHashMap<>();
dept.put("id", d.getSequenceNbr());
dept.put("key", d.getSequenceNbr());
dept.put("value", d.getSequenceNbr());
dept.put("id", String.valueOf(d.getSequenceNbr()));
dept.put("key", String.valueOf(d.getSequenceNbr()));
dept.put("value", String.valueOf(d.getSequenceNbr()));
dept.put("state", "open");
dept.put("type", "department");
dept.put("orgCode", loginOrgCode+"-"+d.getSequenceNbr());
......
......@@ -56,7 +56,6 @@ public class LatentDangerController extends AbstractBaseController {
@PostMapping(value = "/normal/save")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public CommonResponse saveNormal(@ApiParam(value = "隐患对象", required = true) @RequestBody LatentDangerNormalParam latentDangerParam) {
CommonResponse commonResponse = new CommonResponse();
try {
AgencyUserModel user = getUserInfo();
if (ObjectUtils.isEmpty(user)) {
......
......@@ -8,7 +8,7 @@ import java.io.Serializable;
@RuleFact(value = "消防设备",project = "维保规范")
public class EquipmentInputItemRo implements Serializable {
private static final long serialVersionUID = -7088399431688039744L;
private static final long serialVersionUID = 2994025183812872473L;
@Label("设备名称")
private String equipmentName;
......
......@@ -47,4 +47,19 @@ public class LatentDangerNormalParam {
* 建筑名称
*/
private String structureName;
/**
* 隐患地址经度
*/
private String longitude;
/**
* 隐患地址纬度
*/
private String latitude;
/**
* 业务类型(不同业务创建的隐患以此区分)
*/
private String bizType;
}
......@@ -44,9 +44,9 @@ public class LatentDangerPatrolItemParam {
private String instanceKey;
/*
/**
* 隐患名称
* */
*/
private String name;
private String limitDate;
......
package com.yeejoin.amos.patrol.business.service.impl;
import static org.typroject.tyboot.core.foundation.context.RequestContext.getProduct;
import java.net.InetAddress;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
......@@ -106,6 +77,34 @@ import com.yeejoin.amos.patrol.dao.entity.PointClassify;
import com.yeejoin.amos.patrol.exception.YeeException;
import com.yeejoin.amos.patrol.feign.RemoteSecurityService;
import com.yeejoin.amos.patrol.mqtt.WebMqttComponent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import java.net.InetAddress;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import static org.typroject.tyboot.core.foundation.context.RequestContext.getProduct;
@Service("latentDangerService")
public class LatentDangerServiceImpl implements ILatentDangerService {
......@@ -540,14 +539,14 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
@Override
public CommonResponse list(String toke, String product, String appKey, LatentDangerListParam latentDangerListParam, AgencyUserModel user, String loginOrgCode, String deptId) {
JSONObject respBody;
Date startDate = new Date();
Date startDate = new Date();
if (latentDangerListParam.getIsHandle()) {
respBody = remoteWorkFlowService.completedPageTask(user.getUserName(),latentDangerListParam.getBelongType());
} else {
respBody = remoteWorkFlowService.pageTask(user.getUserId(),latentDangerListParam.getBelongType());
}
Date endDate = new Date();
logger.info("-------------------------工作流列表时间" +(endDate.getTime()-startDate.getTime()));
Date endDate = new Date();
logger.info("-------------------------工作流列表时间" + (endDate.getTime() - startDate.getTime()));
JSONArray taskJsonList = respBody.getJSONArray("data");
List<JSONObject> taskList = JSONObject.parseArray(taskJsonList.toJSONString(), JSONObject.class);
List<String> bussinessKeys = new ArrayList<>();
......@@ -720,9 +719,9 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
}
@Override
public CommonResponse detail(String id, String userId,boolean isFinish) {
public CommonResponse detail(String id, String userId, boolean isFinish) {
JSONObject jsonObject;
if(isFinish==true){
if(isFinish){
jsonObject = remoteWorkFlowService.queryFinishTaskDetail(id);
}else{
jsonObject = remoteWorkFlowService.queryTaskDetail(id);
......@@ -1172,7 +1171,7 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
String departmentName,
DangerExecuteSubmitDto executeSubmitDto,
RoleBo role) {
JSONObject executeJson = remoteWorkFlowService.excute(param.getTaskId(), executeTypeEnum.getRequestBody());
JSONObject executeJson = remoteWorkFlowService.execute(param.getTaskId(), executeTypeEnum.getRequestBody());
if (executeJson == null) {
executeSubmitDto.setIsOk(false);
executeSubmitDto.setMsg("执行失败");
......
......@@ -173,7 +173,7 @@ public class RemoteWorkFlowService {
// return json;
// }
public JSONObject excute(String taskId, String requestBody) {
public JSONObject execute(String taskId, String requestBody) {
Map<String, String> map = Maps.newHashMap();
map.put("taskId", taskId);
Map<String, String> headerMap = Maps.newHashMap();
......
......@@ -163,7 +163,13 @@
</changeSet>
<changeSet author="litengwei" id="2021-09-01-litengwei-1">
<preConditions onFail="MARK_RAN">
<tableExists tableName="cb_data_dictionary" />
<!-- <sqlCheck expectedResult="0">select count(*) from cb_data_dictionary where sequence_nbr between 1152 and-->
<!-- 1166</sqlCheck>-->
<not>
<primaryKeyExists primaryKeyName="sequence_nbr" tableName="cb_data_dictionary"/>
</not>
</preConditions>
<comment>add data cb_data_dictionary</comment>
<sql>
......@@ -187,6 +193,9 @@
<changeSet author="litengwei" id="2021-09-01-litengwei-2">
<preConditions onFail="MARK_RAN">
<tableExists tableName="jc_alert_form" />
<not>
<primaryKeyExists primaryKeyName="sequence_nbr" tableName="jc_alert_form"/>
</not>
</preConditions>
<comment>add data jc_alert_form</comment>
<sql>
......@@ -270,6 +279,9 @@
<changeSet author="chenhao" id="2021-09-06-chenhao-1">
<preConditions onFail="MARK_RAN">
<tableExists tableName="cb_data_dictionary" />
<not>
<primaryKeyExists primaryKeyName="sequence_nbr" tableName="cb_data_dictionary"/>
</not>
</preConditions>
<comment>insert data cb_data_dictionary</comment>
<sql>
......@@ -317,6 +329,16 @@
<sql>
ALTER TABLE `cb_firefighters_workexperience` modify working_hours date COMMENT '参加工作时间';
ALTER TABLE `cb_firefighters_workexperience` modify fire_working_hours date COMMENT '参加消防部门工作时间';
</sql>
</changeSet>
<changeSet author="kongfm" id="2021-09-13-kongfm-1">
<preConditions onFail="MARK_RAN">
<tableExists tableName="cb_firefighters"/>
</preConditions>
<comment>BUG 3658 优化 by kongfm 2021-09-13 需求详细说明 1. 添加两个字段 2. 地区选择联动 只有新增时带联动 编辑时不带联动 3. 导出模板及导入同步修改</comment>
<sql>
ALTER TABLE `cb_firefighters` add native_place_val varchar(255) COMMENT '户籍所在地详细地址';
ALTER TABLE `cb_firefighters` add residence_detail_val varchar(255) COMMENT '现居住地详细地址';
</sql>
</changeSet>
</databaseChangeLog>
......@@ -48,3 +48,7 @@ amosRefresh.patrol.topic =patrolCheckInsert
management.endpoints.web.exposure.exclude=*
## redis失效时间
redis.cache.failure.time=10800
rule.definition.load=false
rule.definition.model-package=com.yeejoin.amos.patrol.business.entity.mybatis
rule.definition.default-agency=STATE_GRID
\ No newline at end of file
......@@ -25,6 +25,13 @@
<artifactId>spring-boot-starter-data-elasticsearch</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
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