Commit e60370d9 authored by 李成龙's avatar 李成龙

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

parents 27bc6c53 d7ab7dad
......@@ -7,10 +7,11 @@ import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import com.alibaba.fastjson.JSONObject;
@FeignClient(name = "AMOS-API-WORKFLOW", path = "workflow", configuration = { CommonMultipartSupportConfig.class })
@FeignClient(name = "AMOS-API-WORKFLOW-CJHENHAO", path = "workflow", configuration = { CommonMultipartSupportConfig.class })
public interface WorkflowFeignService {
/**
* 发起流程
......@@ -48,7 +49,25 @@ public interface WorkflowFeignService {
* @param processInstanceId
* @return
*/
@RequestMapping(value = "/getTaskGroupName/{taskId}", method = RequestMethod.GET)
@RequestMapping(value = "/task/getTaskGroupName/{taskId}", method = RequestMethod.GET)
JSONObject getTaskGroupName(@PathVariable("taskId") String taskId);
/**
* 我的待办
* @param processDefinitionKey
* @param userId
* @return
*/
@RequestMapping(value = "/task/all-list", method = RequestMethod.GET)
JSONObject getTasksNoAuth(@RequestParam(value="processDefinitionKey", required=false) String processDefinitionKey,
@RequestParam(value="userId", required=false) String userId) ;
/**
* 流程信息
* @param processDefinitionKey
* @param userId
* @return
*/
@RequestMapping(value = "/activitiHistory/processes/historytasks/list/{processInstanceId}", method = RequestMethod.GET)
JSONObject queryHistoryTaskListByProcessId(@PathVariable("processInstanceId") String processInstanceId);
}
package com.yeejoin.amos.boot.module.common.api.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 流程日志
*
* @author system_generator
* @date 2021-08-12
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="FailureRepairlogDto", description="流程日志")
public class FailureRepairlogDto extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "流程处理人")
private String processAuditor;
@ApiModelProperty(value = "处理人所属部门")
private String processDepartment;
@ApiModelProperty(value = "流程处理结果")
private String processResult;
@ApiModelProperty(value = "流程处理时间")
private Date processTime;
@ApiModelProperty(value = "设备故障报修主表ID")
private Long faultId;
}
......@@ -14,7 +14,7 @@ import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 危化品
* '
*
* @author system_generator
* @date 2021-06-29
......
......@@ -39,7 +39,7 @@ public class FireTeamDto extends BaseDto {
private String companyCode;
@ExplicitConstraint(indexNum = 1, sourceClass = RoleNameExplicitConstraint.class,method="getFireTeam") //动态下拉内容
@ExcelProperty(value = "上级单位", index = 1)
@ExcelProperty(value = "上级队伍", index = 1)
@ApiModelProperty(value = "父级名称")
private String parentName;
......@@ -89,7 +89,7 @@ public class FireTeamDto extends BaseDto {
@ApiModelProperty(value = "职责_简要情况")
private String obligation;
@ExcelProperty(value = "消防队伍图片", index = 10)
@ExcelIgnore
@ApiModelProperty(value = "消防队伍图片")
private String img;
......
......@@ -42,7 +42,7 @@ public class FirefightersExcelDto extends BaseDto {
@ApiModelProperty(value = "队伍")
private String fireTeam;
@ExcelProperty(value = "所属部门", index = 3)
@ExcelIgnore
@ApiModelProperty(value = "所属机构")
private String company;
......@@ -50,7 +50,8 @@ public class FirefightersExcelDto extends BaseDto {
@ApiModelProperty(value = "机构code")
private String companyCode;
@ExcelIgnore
@ExcelProperty(value = "所属部门", index = 3)
@ApiModelProperty(value = "机构名称")
private String companyName;
......@@ -134,11 +135,11 @@ public class FirefightersExcelDto extends BaseDto {
@ApiModelProperty(value = "紧急联系人电话")
private String emergencyContactPhone;
@ExcelProperty(value = "身份证正面", index = 20)
@ExcelIgnore
@ApiModelProperty(value = "身份证正面")
private String idPositive;
@ExcelProperty(value = "身份证反面", index = 21)
@ExcelIgnore
@ApiModelProperty(value = "身份证反面")
private String idReverse;
......
package com.yeejoin.amos.boot.module.common.api.dto;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import com.yeejoin.amos.boot.module.common.api.entity.SourceFile;
import com.yeejoin.amos.boot.module.common.api.excel.ExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.RoleNameExplicitConstraint;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -20,88 +24,99 @@ import java.util.List;
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "LinkageUnitDto", description = "联动单位")
public class LinkageUnitDto extends BaseDto {
@ExcelIgnore
private static final long serialVersionUID = 1L;
@ExcelProperty(value = "单位名称", index = 0)
@ApiModelProperty(value = "单位名称")
private String unitName;
@ExcelIgnore
@ApiModelProperty(value = "单位code")
private String unitCode;
@ExcelIgnore
@ApiModelProperty(value = "父级单位id")
private String parentId;
@ApiModelProperty(value = "联动单位类别")
@ExcelProperty(value = "服务类别", index = 1)
@ExplicitConstraint(type = "LDDWLB", indexNum =1, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ApiModelProperty(value = "服务类别")
private String linkageUnitType;
@ExcelIgnore
@ApiModelProperty(value = "联动单位类别code")
private String linkageUnitTypeCode;
@ExcelIgnore
@ApiModelProperty(value = "行政区划")
private String administrativeDivisions;
@ExcelIgnore
@ApiModelProperty(value = "行政区划代码")
private String administrativeDivisionsCode;
@ExcelProperty(value = "地址", index = 2)
@ApiModelProperty(value = "地址")
private String address;
@ExcelProperty(value = "经度", index = 3)
@ApiModelProperty(value = "经度")
private Double longitude;
@ExcelProperty(value = "纬度", index = 4)
@ApiModelProperty(value = "纬度")
private Double latitude;
@ExcelProperty(value = "协议开始日期", index = 5)
@ApiModelProperty(value = "协议开始日期")
private Date agreementStartDate;
@ExcelProperty(value = "协议结束日期", index = 6)
@ApiModelProperty(value = "协议结束日期")
private Date agreementEndDate;
@ExcelProperty(value = "应急联动单位类别", index = 7)
@ExplicitConstraint(type = "YJLDDW", indexNum =7, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ApiModelProperty(value = "应急联动单位类别")
private String emergencyLinkageUnit;
@ExcelIgnore
@ApiModelProperty(value = "应急联动单位类别code")
private String emergencyLinkageUnitCode;
@ExcelProperty(value = "联系人", index = 8)
@ApiModelProperty(value = "联系人 ")
private String contactUser;
@ExcelProperty(value = "联系人电话", index = 9)
@ApiModelProperty(value = "联系人电话")
private String contactPhone;
@ExcelIgnore
@ApiModelProperty(value = "实例id")
private Long instanceId;
@ExcelIgnore
@ApiModelProperty(value = "组织机构代码")
private String orgCode;
@ExcelIgnore
@ApiModelProperty(value = "操作人名称")
private String recUserName;
@ExcelIgnore
@ApiModelProperty(value = "是否在协议期 ")
private String inAgreement;
@ExcelProperty(value = "消防救援能力", index = 10)
@ApiModelProperty(value = "消防救援能力")
private String fireRescueCapability;
@ExcelProperty(value = "职责_简要情况", index = 11)
@ApiModelProperty(value = "职责_简要情况")
private String responsibilitiesSituation;
@ExcelProperty(value = "应急服务内容", index = 12)
@ApiModelProperty(value = "应急服务内容")
private String emergencyServiceContent;
@ExcelProperty(value = "单位_简要情况", index = 13)
@ApiModelProperty(value = "单位_简要情况")
private String unitSituation;
@ExcelIgnore
@ApiModelProperty(value = "联动单位图片")
private List<SourceFile> image;
@ExcelIgnore
@ApiModelProperty(value = "车辆数量")
private String vehicleNumber;
@ExcelIgnore
@ApiModelProperty(value = "特岗人数")
private String personNumber;
}
package com.yeejoin.amos.boot.module.common.api.dto;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance;
import com.yeejoin.amos.boot.module.common.api.excel.ExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.RoleNameExplicitConstraint;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.List;
/**
* 机构/部门/人员表
*
* @author tb
* @date 2021-06-18
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="OrgUsrExcelDto", description="机构/部门/人员表")
public class OrgUsrExcelDto extends BaseDto {
@ExcelProperty(value = "姓名", index = 0)
@ApiModelProperty(value = "机构/部门名称")
private String bizOrgName;
@ExcelIgnore
@ApiModelProperty(value = "机构编码")
private String bizOrgCode;
@ExcelIgnore
@ApiModelProperty(value = "amos中公司/部门ID")
private String amosOrgId;
@ExcelIgnore
@ApiModelProperty(value = "amos中公司/部门编码")
private String amosOrgCode;
@ExcelIgnore
@ApiModelProperty(value = "机构类型(部门:DEPARTMENT,单位:COMPANY,人员:PERSON)")
private String bizOrgType;
@ExcelIgnore
@ApiModelProperty(value = "所属建筑名称")
private String buildName;
@ExcelIgnore
@ApiModelProperty(value = "所属建筑ID")
private String buildId;
@ExcelProperty(value = "所属单位部门", index = 1)
@ExplicitConstraint(indexNum = 1, sourceClass = RoleNameExplicitConstraint.class, method = "getparent") //固定下拉内容
@ApiModelProperty(value = "归属机构/部门/人员")
private String parentId;
@ExcelIgnore
@ApiModelProperty(value = "扩展属性1")
private String orgExpandAttr1;
@ExcelIgnore
@ApiModelProperty(value = "扩展属性2")
private String orgExpandAttr2;
@ExcelIgnore
@ApiModelProperty(value = "扩展属性3")
private String orgExpandAttr3;
@ExcelIgnore
@ApiModelProperty(value = "扩展属性4")
private String orgExpandAttr4;
@ExcelIgnore
private String orgExpandAttr5;
@ExcelIgnore
private String orgExpandAttr6;
@ExcelIgnore
private String orgExpandAttr7;
@ExcelIgnore
private String orgExpandAttr8;
@ExcelIgnore
@ApiModelProperty(value = "更新人")
@TableField(fill= FieldFill.INSERT_UPDATE)
private String recUserName;
@ExcelIgnore
@ApiModelProperty(value = "动态表单值")
private List<DynamicFormInstance> dynamicFormValue;
@ExcelProperty(value = "行政职务", index = 2)
@ExplicitConstraint(type = "XZZW", indexNum =2, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内
private String administrativePositionCode;// 行政职务
@ExcelProperty(value = "审核周期", index = 3)
@ExplicitConstraint(type = "SHZQ", indexNum =3, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内
private String auditCycle; //审核周期
@ExcelProperty(value = "证件号码", index = 4)
private String certificatesNumber;// 证件号码
@ExcelProperty(value = "证件类型", index = 5)
@ExplicitConstraint(type = "RYZJLX", indexNum =5, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内
private String certificatesTypeCode; //证件类型
@ExcelProperty(value = "持证类别", index = 6)
@ExplicitConstraint(type = "CZLB", indexNum =6, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内
private String certificateType; //持证类别
@ExcelProperty(value = "消防管理岗位", index = 7)
@ExplicitConstraint(type = "XFGLGW", indexNum =7, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内
private String fireManagementPostCode; //消防管理岗位
@ExcelProperty(value = "性别", index = 8)
@ExplicitConstraint(type = "XB", indexNum =8, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内
private String gender; //性别
@ExcelProperty(value = "消防管理组织机构内部职务", index = 9)
@ExplicitConstraint(type = "JGNBZW", indexNum =9, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内
private String internalPositionCode; //消防管理组织机构内部职务
@ExcelProperty(value = "员工编号", index = 10)
private String personNumber; //员工编号
@ExcelProperty(value = "岗位类型", index = 11)
@ExplicitConstraint(type = "GWMC", indexNum =11, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内
private String positionType; //岗位类型
@ExcelProperty(value = "是否进行安全培训", index = 12)
@ExplicitConstraint(type = "AQPX", indexNum =12, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内
private String safetyTraining; //是否进行安全培训
@ExcelProperty(value = "人员状态", index = 13)
@ExplicitConstraint(type = "RYZT", indexNum =13, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内
private String stateCode; //人员状态
@ExcelProperty(value = "联系电话", index = 14)
private String telephone; //联系电话
}
......@@ -50,6 +50,12 @@ public class FailureAudit extends BaseEntity {
@TableField("audit_opinion")
private String auditOpinion;
/* *//**
* 审核状态
*//*
@TableField("audit_status")
private String auditStatus;
*/
/**
* 设备故障报修单id
*/
......
......@@ -102,8 +102,4 @@ public class FailureDetails extends BaseEntity {
@TableField("process_id")
private String processId;
@TableField ("current_role")
private String currentRole;
}
package com.yeejoin.amos.boot.module.common.api.entity;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 流程日志
*
* @author system_generator
* @date 2021-08-12
*/
@Data
@EqualsAndHashCode(callSuper = true)
//@Accessors(chain = true)
@TableName("cb_failure_repairlog")
public class FailureRepairlog extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 流程处理人
*/
@TableField("process_auditor_id")
private Long processAuditorId;
/**
* 流程处理人
*/
@TableField("process_auditor")
private String processAuditor;
/**
* 处理人所属部门
*/
@TableField("process_department")
private String processDepartment;
/**
* 处理人所属部门Id
*/
@TableField("process_department_id")
private Long processDepartmentId;
/**
* 流程处理结果
*/
@TableField("process_result")
private String processResult;
/**
* 流程处理时间
*/
@TableField("process_time")
private Date processTime;
/**
* 设备故障报修主表ID
*/
@TableField("fault_id")
private Long faultId;
}
package com.yeejoin.amos.boot.module.common.api.mapper;
import com.yeejoin.amos.boot.module.common.api.entity.FailureRepairlog;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* 流程日志 Mapper 接口
*
* @author system_generator
* @date 2021-08-12
*/
public interface FailureRepairlogMapper extends BaseMapper<FailureRepairlog> {
}
......@@ -61,6 +61,6 @@ public interface LinkageUnitMapper extends BaseMapper<LinkageUnit> {
Page<List<LinkageUnitDto>> getEmergencyLinkageUnitList(IPage<LinkageUnitDto> page,String unitName,
String linkageUnitTypeCode, String emergencyLinkageUnitCode);
List<LinkageUnitDto> exportToExcel();
}
......@@ -59,4 +59,8 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> {
List< OrgUsrzhDto> getOrgUsrzhDto(@Param("bizOrgName")String bizOrgName);
List< Map<String,Object>> getparent();
List< OrgUsrExcelDto> exportToExcel();
}
package com.yeejoin.amos.boot.module.common.api.service;
import com.yeejoin.amos.boot.module.common.api.entity.FailureRepairlog;
/**
* 流程日志接口类
*
* @author system_generator
* @date 2021-08-12
*/
public interface IFailureRepairlogService {
public FailureRepairlog findByprocessAuditorId(Long userId);
public FailureRepairlog findByFaultId(Long faultId) ;
}
......@@ -48,5 +48,6 @@ public interface ILinkageUnitService {
* @return
*/
public List<Menu> getEmergencyLinkageUnitCodeGroupBy(String type, String rootName) ;
List<LinkageUnitDto> exportToExcel();
}
......@@ -173,4 +173,7 @@ public interface IOrgUsrService {
List<ESOrgUsrDto> selectByIddata(String name);
List< Map<String,Object>> getparent();
List< OrgUsrExcelDto> exportToExcel();
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.common.api.mapper.FailureRepairlogMapper">
</mapper>
......@@ -69,7 +69,9 @@
</select>
<select id="exportToExcel" resultType="com.yeejoin.amos.boot.module.common.api.dto.FirefightersExcelDto">
select f.*, emergency_contact, relationship, emergency_contact_phone
select f.*,
(select cb_fire_team.name from cb_fire_team where cb_fire_team.sequence_nbr=f.fire_team_id) fireTeam,
emergency_contact, relationship, emergency_contact_phone
from cb_firefighters f
left join cb_firefighters_contacts fc on f.sequence_nbr = fc.firefighters_id
where f.is_delete = #{isDelete}
......
......@@ -87,6 +87,29 @@
emergency_linkage_unit_code
</select>
<select id="exportToExcel" resultType="com.yeejoin.amos.boot.module.common.api.dto.LinkageUnitDto">
select
a.unit_name unitName,
a.linkage_unit_type linkageUnitType,
a.address ,
a.latitude,
a.longitude,
a.agreement_start_date agreementStartDate,
a.agreement_end_date agreementEndDate,
a.contact_user contactUser,
a.contact_phone contactPhone,
b.*
from cb_linkage_unit a LEFT JOIN
(SELECT
m.instance_id,
max(case m.field_code when 'emergencyServiceContent' then m.field_value end) emergencyServiceContent,
max(case m.field_code when 'fireRescueCapability' then m.field_value end) fireRescueCapability,
max(case m.field_code when 'responsibilitiesSituation' then m.field_value end) responsibilitiesSituation,
max(case m.field_code when 'unitSituation' then m.field_value end) unitSituation
FROM cb_dynamic_form_instance m GROUP BY m.instance_id) b
on b.instance_id=a.instance_id where a.unit_name is not null
</select>
<select id="getEmergencyLinkageUnitList"
......
......@@ -297,4 +297,43 @@ LEFT JOIN (
keysite.belong_id
) keysite_sur ON company_sur.sequence_nbr = keysite_sur.belong_id
</select>
<select id="getparent" resultType="Map">
SELECT important_companys.id ,important_companys.name
FROM important_companys
</select>
<select id="exportToExcel" 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
</select>
</mapper>
package com.yeejoin.amos.boot.module.jcs.api.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 导出类型常量
***/
public class ExcelEnums {
public static final String WHP = "WHP";// ("WHP","危险品"),
public static final String XFZJ = "XFZJ";//("XFZJ","消防专家"),
public static final String SYXX = "SYXX";//("SYXX","水源信息"),
public static final String HKQ = "HKQ";//("HKQ","航空器");
public static final String XFDW = "XFDW";//("XFDW","消防队伍")
public static final String WXXFZ = "WXXFZ";//("WXXFZ","微型消防站")
public static final String XFRY = "XFRY";//("XFRY","消防人员")
public static final String CLZQ = "CLZQ";//("CLZQ","车辆执勤")
public static final String RYZB = "RYZB";//("RYZB","人员值班")
public static final String WBRY = "WBRY";//("WBRY",维保人员)
public static final String KEYSITE = "KEYSITE";//{"KEYSITE":重點部位}
@Getter
@AllArgsConstructor
public enum ExcelEnums {
WHP ("危险品", "危险品", "com.yeejoin.amos.boot.module.common.api.dto.FireChemicalDto","WHP"),// ("WHP","危险品"),
XFZJ ("消防专家", "消防专家", "com.yeejoin.amos.boot.module.common.api.dto.FireExpertsDto","XFZJ"),//("XFZJ","消防专家"),
SYXX ("水源信息", "水源信息", "com.yeejoin.amos.boot.module.common.api.dto.WaterResourceDto","SYXX"),//("SYXX","水源信息"),
HKQ ("航空器", "航空器", "com.yeejoin.amos.boot.module.jcs.api.dto.AircraftDto","HKQ"),//("HKQ","航空器");
XFDW ("消防队伍", "消防队伍", "com.yeejoin.amos.boot.module.common.api.dto.FireTeamDto","XFDW"),//("XFDW","消防队伍")
WXXFZ("微型消防站", "微型消防站", "com.yeejoin.amos.boot.module.common.api.dto.FireStationDto","WXXFZ"),//("WXXFZ","微型消防站")
XFRY ("消防人员", "消防人员", "com.yeejoin.amos.boot.module.common.api.dto.FirefightersExcelDto","XFRY"),//("XFRY","消防人员")
WBRY ("维保人员", "维保人员", "com.yeejoin.amos.boot.module.common.api.dto.MaintenancePersonExcleDto","WBRY"),//("WBRY",维保人员)
KEYSITE ("重點部位", "重點部位", "com.yeejoin.amos.boot.module.common.api.dto.KeySiteExcleDto","KEYSITE"),//{"KEYSITE":重點部位}
CLZQ ("车辆执勤", "车辆执勤", "com.yeejoin.amos.boot.module.common.api.dto.DutyCarExcelDto","CLZQ"),//("CLZQ","车辆执勤")
JCDWRY ("机场单位人员", "机场单位人员", "com.yeejoin.amos.boot.module.common.api.dto.OrgUsrExcelDto","JCDWRY"),//("JCDW","机场单位")
LDDW ("联动单位", "联动单位", "com.yeejoin.amos.boot.module.common.api.dto.LinkageUnitDto","LDDW"),//("JCDW","机场单位")
RYZB ("人员值班", "人员值班", "com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto","RYZB");//("RYZB","人员值班")
private String fileName;
private String sheetName;
private String classUrl;
private String type;
public static ExcelEnums getByKey(String type) {
for (ExcelEnums status : ExcelEnums.values())
{
if (status.getType().equals(type))
{
return status;
}
}
return null;
}
}
package com.yeejoin.amos.maintenance.common.enums;
import java.util.ArrayList;
import java.util.List;
import java.util.*;
import java.util.stream.Collectors;
public enum PlanTaskDetailIsFinishEnum {
UNFINISHED("未完成",0),
FINISHED("已完成",1),
OVERTIME("超时漏检",2);
OVERTIME("超时未维保",2);
/**
* 名称
......@@ -25,6 +25,14 @@ public enum PlanTaskDetailIsFinishEnum {
this.value = value;
}
public static List<Map<String, Object>> getEnumList() {
return Arrays.stream(PlanTaskDetailIsFinishEnum.values()).map(e -> {
Map<String, Object> map = new HashMap<>();
map.put(String.valueOf(e.getValue()), e.getName());
return map;
}).collect(Collectors.toList());
}
public static String getName(int value) {
for (PlanTaskDetailIsFinishEnum c : PlanTaskDetailIsFinishEnum.values()) {
......
......@@ -26,6 +26,22 @@ import cn.afterturn.easypoi.excel.annotation.Excel;
public class Point extends BasicEntity {
private static final long serialVersionUID = 1L;
public String getBuildingId() {
return buildingId;
}
public void setBuildingId(String buildingId) {
this.buildingId = buildingId;
}
public String getBuildingName() {
return buildingName;
}
public void setBuildingName(String buildingName) {
this.buildingName = buildingName;
}
/**
* 参考地址
*/
......@@ -143,6 +159,18 @@ public class Point extends BasicEntity {
@Column(name="point_no")
private String pointNo;
/**
* 所在建筑
*/
private String buildingId;
/**
* 所在建筑名称
*/
private String buildingName;
public String getEquipmentId() {
return equipmentId;
}
......
package com.yeejoin.amos.boot.module.tzs.api.dto;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* 警情查询DTO
*/
@Data
@ApiModel(value="AlertCalledDto", description="警情接警填报记录")
public class AlertCalledQueryDto {
@ExcelIgnore
private static final long serialVersionUID = 1L;
@ExcelProperty(value = "工单编号", index = 0)
@ApiModelProperty(value = "工单编号")
private String workOrderNumber;
@ExcelProperty(value = "接警人", index = 1)
@ApiModelProperty(value = "接警人")
private String creator;
@ExcelProperty(value = "求援人", index = 2)
@ApiModelProperty(value = "求援人")
private String emergency;
@ExcelProperty(value = "求援时间", index = 3)
@ApiModelProperty(value = "求援时间")
private Date emergencyTime;
@ExcelIgnore
@ApiModelProperty(value = "求援时间开始")
private Date emergencyTimeStart;
@ExcelIgnore
@ApiModelProperty(value = "求援时间结束")
private Date emergencyTimeEnd;
@ExcelProperty(value = "求援电话", index = 4)
@ApiModelProperty(value = "求援电话")
private String emergencyCall;
@ExcelProperty(value = "电梯识别码", index = 5)
@ApiModelProperty(value = "电梯识别码")
private String deviceId;
@ExcelProperty(value = "电梯地址", index = 6)
@ApiModelProperty(value = "电梯地址")
private String elevatorAddress;
@ExcelProperty(value = "所属区域", index = 7)
@ApiModelProperty(value = "所属区域")
private String address;
@ExcelProperty(value = "警情类型", index = 8)
@ApiModelProperty(value = "警情类型")
private String alertType;
@ExcelProperty(value = "警情来源", index = 9)
@ApiModelProperty(value = "警情来源")
private String alertSource;
@ExcelProperty(value = "处置环节", index = 10)
@ApiModelProperty(value = "处置环节")
private String alertStage;
@ExcelProperty(value = "完成状态", index = 11)
@ApiModelProperty(value = "完成状态")
private String alertStatus;
@ExcelIgnore
@ApiModelProperty(value = "页码")
private Integer pageNum;
@ExcelIgnore
@ApiModelProperty(value = "条数")
private Integer pageSize;
}
......@@ -64,9 +64,6 @@ public class RescueStationDto extends BaseDto {
@ApiModelProperty(value = "所属单位id")
private Long affiliatedUnitId;
@ApiModelProperty(value = "经纬度")
private String longitudeLatitude;
@ApiModelProperty(value = "经度")
private String longitude;
......
......@@ -70,9 +70,6 @@ public class RescueStation extends BaseEntity {
@ApiModelProperty(value = "所属单位id")
private Long affiliatedUnitId;
@ApiModelProperty(value = "经纬度")
private String longitudeLatitude;
@ApiModelProperty(value = "经度")
private String longitude;
......
package com.yeejoin.amos.boot.module.tzs.api.mapper;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledQueryDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.AlertCalled;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
......@@ -26,4 +28,11 @@ public interface AlertCalledMapper extends BaseMapper<AlertCalled> {
@Param("orgCode") String orgCode,
@Param("recUserId") String recUserId
);
/**
* 根据查询条件返回警情记录
* @param alertCalledQueryDto
* @return
*/
List<AlertCalledQueryDto> queryAlertListByQueryDto(@Param("alertCalledQueryDto") AlertCalledQueryDto alertCalledQueryDto);
}
......@@ -2,6 +2,9 @@ package com.yeejoin.amos.boot.module.tzs.api.service;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledFormDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledQueryDto;
import java.util.List;
/**
* 警情接警填报记录接口类
......@@ -24,4 +27,19 @@ public interface IAlertCalledService {
*
* **/
AlertCalledFormDto selectAlertCalledByIdNoCache(Long id);
/**
* 根据查询条件返回警情记录
* @param alertCalledQueryDto
* @return
*/
List<AlertCalledQueryDto> queryAlertListByQueryDto(AlertCalledQueryDto alertCalledQueryDto);
/**
* 根据警情id 更新警情状态
* @param alertId
* @param alertStage
* @return
*/
Boolean updateAlertStageByAlertId(Long alertId, String alertStage);
}
//package com.yeejoin.amos.boot.module.tzs.api.vo;
//
//import com.baomidou.mybatisplus.annotation.TableName;
//import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
//import io.swagger.annotations.ApiModel;
//import io.swagger.annotations.ApiModelProperty;
//import lombok.Data;
//import lombok.EqualsAndHashCode;
//import lombok.experimental.Accessors;
//
//import java.util.Date;
//
///**
// * 警情接警填报记录
// *
// * @author litw
// * @date 2021-08-03
// */
//@Data
//@EqualsAndHashCode(callSuper = true)
//@Accessors(chain = true)
//@TableName("tz_alert_called")
//@ApiModel(value = "AlertCalledVo", description = "AlertCalledVo")
//public class AlertCalledVo extends BaseEntity {
//
// private static final long serialVersionUID = 1L;
//
// /**
// * 警情状态 (0 未结案 1 结案)
// */
// @ApiModelProperty("警情状态")
// private Boolean alertStatus;
//
// /**
// * 警情来源类型
// */
// @ApiModelProperty("警情来源类型")
// private String alertSource;
//
// /**
// * 警情来源类型Code
// */
// @ApiModelProperty("警情来源类型Code")
// private String alertSourceCode;
//
// /**
// * 接警时间
// */
// @ApiModelProperty("接警时间")
// private Date callTime;
//
// /**
// * 报警人电话
// */
// @ApiModelProperty("报警人电话")
// private String emergencyCall;
//
// /**
// * 报警人名称,默认为先生或女士
// */
// @ApiModelProperty("报警人名称,默认为先生或女士")
// private String emergencyPerson;
//
// /**
// * 联系人姓名
// */
// @ApiModelProperty("联系人姓名")
// private String contactUser;
//
// /**
// * 联系人电话
// */
// @ApiModelProperty("联系人电话")
// private String contactPhone;
//
// /**
// * 设备分类,字典表数据
// */
// @ApiModelProperty("设备分类")
// private String equipmentClassification;
//
// /**
// * 报警类型
// */
// @ApiModelProperty("报警类型")
// private String type;
//
// /**
// * 警情类别
// */
// @ApiModelProperty("警情类别")
// private String alarmType;
//
// /**
// * 通话记录信息id
// */
// @ApiModelProperty("通话记录信息id")
// private Integer callRecordId;
//
// /**
// * 警情阶段
// */
// @ApiModelProperty("警情阶段")
// private String alertStage;
//
// /**
// * 父警情id
// */
// @ApiModelProperty("父警情id")
// private Long fatherAlert;
//
// /**
// * 设备识别码
// */
// @ApiModelProperty("设备识别码")
// private String deviceId;
//
// /**
// * 注册编码
// */
// @ApiModelProperty("注册编码")
// private String registrationCode;
//
// /**
// * 备注
// */
// @ApiModelProperty("备注")
// private String remark;
//
// /**
// * 更新时间
// */
// @ApiModelProperty("更新时间")
// private Date updateTime;
//
// /**
// * 设备分类code
// */
// @ApiModelProperty("设备分类code")
// private String equipmentClassificationCode;
//
// /**
// * 报警类型code
// */
// @ApiModelProperty("报警类型code")
// private String typeCode;
//
// /**
// * 警情类别code
// */
// @ApiModelProperty("警情类别code")
// private String alarmTypeCode;
//
// /**
// * 警情阶段code
// */
// @ApiModelProperty("警情阶段code")
// private String alertStageCode;
//
// /**
// * 组织机构
// */
// @ApiModelProperty("组织机构")
// private String orgCode;
//
//
// @ApiModelProperty(value = "使用单位")
// private String useUnit;
//
//
// @ApiModelProperty(value = "地址")
// private String address;
//
// @ApiModelProperty(value = "接警时间开始---用于列表过滤")
// private Date callTimeStart ;
//
// @ApiModelProperty(value = "接警时间结束---用于列表过滤")
// private Date callTimeEnd ;
//
// @ApiModelProperty(value = "是否处警")
// private Boolean isFatherAlert = false;
//
// @ApiModelProperty(value = "所属省")
// private String province;
//
// @ApiModelProperty(value = "所属地市")
// private String city;
//
// @ApiModelProperty(value = "所属区县")
// private String district;
//
// @ApiModelProperty(value = "所属区域代码")
// private String regionCode;
//
// @ApiModelProperty(value = "使用场所分类")
// private String useSiteCategory;
//
// @ApiModelProperty(value = "电梯使用状态")
// private Integer useStatus;
//
// @ApiModelProperty(value = "警情地址")
// private String alertAddress;
//
// @ApiModelProperty(value = "响应级别")
// private String responseLevel;
//
// /**
// * 工单编号
// */
// @ApiModelProperty("工单编号")
// private String workOrderNumber;
//
// @ApiModelProperty(value = "接警时间str")
// private String callTimeStr;
//
//}
//package com.yeejoin.amos.boot.module.tzs.api.vo;
//
//import com.baomidou.mybatisplus.annotation.TableName;
//import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
//import io.swagger.annotations.ApiModel;
//import io.swagger.annotations.ApiModelProperty;
//import lombok.Data;
//import lombok.EqualsAndHashCode;
//import lombok.experimental.Accessors;
//
//import java.util.Date;
//import java.util.List;
//
///**
// * @author tb
// * @date 2021-06-01
// */
//@Data
//@EqualsAndHashCode(callSuper = true)
//@Accessors(chain = true)
//@TableName("tcb_elevator")
//@ApiModel(value = "ElevatorDto", description = "ElevatorDto")
//public class ElevatorDto extends BaseEntity {
//
// private static final long serialVersionUID = 1L;
//
//
// @ApiModelProperty(value = "电梯应急救援识别码")
// private Integer rescueCode;
//
// @ApiModelProperty(value = "设备注册代码")
// private String registerCode;
//
// @ApiModelProperty(value = "所属省")
// private String province;
//
// @ApiModelProperty(value = "所属地市")
// private String city;
//
// @ApiModelProperty(value = "所属区县")
// private String district;
//
// @ApiModelProperty(value = "所属区域代码")
// private String regionCode;
//
// @ApiModelProperty(value = "安装地址")
// private String address;
//
// @ApiModelProperty(value = "内部编号")
// private String innerNum;
//
// @ApiModelProperty(value = "电梯品牌")
// private String brand;
//
// @ApiModelProperty(value = "出厂编号")
// private String factoryNum;
//
// @ApiModelProperty(value = "电梯安装单位")
// private String installationUnit;
//
// @ApiModelProperty(value = "制造日期(出厂时间)")
// private Date factoryDate;
//
// @ApiModelProperty(value = "电梯大修/改造日期")
// private Date overhaulDate;
//
// @ApiModelProperty(value = "开始使用日期")
// private Date startUseDate;
//
// @ApiModelProperty(value = "设备类别")
// private String category;
//
// @ApiModelProperty(value = "使用场所分类")
// private String useSiteCategory;
//
// @ApiModelProperty(value = "电梯型号")
// private String model;
//
// @ApiModelProperty(value = "电梯层数")
// private Integer floors;
//
// @ApiModelProperty(value = "电梯站数")
// private Integer stations;
//
// @ApiModelProperty(value = "电梯门数")
// private Integer doors;
//
// @ApiModelProperty(value = "电梯额定速度(单位:m/s)")
// private Float ratedSpeed;
//
// @ApiModelProperty(value = "电梯额定载重量(单位:kg)")
// private Float ratedLoad;
//
// @ApiModelProperty(value = "最大荷载人数")
// private Integer maxPersonLoad;
//
// @ApiModelProperty(value = "提升高度")
// private Float raiseHeight;
//
// @ApiModelProperty(value = "拖动方式")
// private String dragMode;
//
// @ApiModelProperty(value = "电梯使用状态")
// private Integer useStatus;
//
// @ApiModelProperty(value = "使用单位")
// private String useUnit;
//
// @ApiModelProperty(value = "使用单位id")
// private Long useUnitId;
//
// @ApiModelProperty(value = "制造单位名称")
// private String manufacturerName;
//
// @ApiModelProperty(value = "制造许可编号")
// private String manufacturingLicense;
//
// @ApiModelProperty(value = "维保类型")
// private String maintainType;
//
// @ApiModelProperty(value = "维护周期")
// private String maintainPeriod;
//
// @ApiModelProperty(value = "维保单位")
// private String maintainUnit;
//
// @ApiModelProperty(value = "维保单位id")
// private Long maintainUnitId;
//
// @ApiModelProperty(value = "维保负责人")
// private String maintainLeader;
//
// @ApiModelProperty(value = "维保负责人id")
// private Long maintainLeaderId;
//
// @ApiModelProperty(value = "维保负责人手机")
// private String maintainLeaderPhone;
//
// @ApiModelProperty(value = "主机模式")
// private String hostModel;
//
// @ApiModelProperty(value = "主机编号")
// private String hostNum;
//
// @ApiModelProperty(value = "动力类型")
// private String engineType;
//
// @ApiModelProperty(value = "动力编号")
// private String engineNum;
//
// @ApiModelProperty(value = "面板模型")
// private String panelModel;
//
// @ApiModelProperty(value = "面板编号")
// private String panelNum;
//
// @ApiModelProperty(value = "级联模型")
// private String cascadeModel;
//
// @ApiModelProperty(value = "级联线路模型")
// private String cascadeLineModel;
//
// @ApiModelProperty(value = "扶手带类型")
// private String handrailType;
//
// @ApiModelProperty(value = "扶手面板模型")
// private String handrailPanelModel;
//
// @ApiModelProperty(value = "扶手面板品牌")
// private String handrailPanelBrand;
//
// @ApiModelProperty(value = "滚转机模式")
// private String rollerMode;
//
// @ApiModelProperty(value = "倾斜的角度")
// private String tiltAngle;
//
// @ApiModelProperty(value = "横向跨度")
// private String horizontalSpan;
//
// @ApiModelProperty(value = "运行噪音")
// private String runningNoise;
//
// @ApiModelProperty(value = "运行方式")
// private String runningMode;
//
// @ApiModelProperty(value = "运行振动")
// private String runningVibration;
//
// @ApiModelProperty(value = "功率")
// private String power;
//
// @ApiModelProperty(value = "设备图片")
// private String photos;
//
// @ApiModelProperty(value = "设备图片")
// private List<Img> img;
//
// @ApiModelProperty(value = "原始表id(来自历史数据库)")
// private String originalId;
//
// @Data
// @EqualsAndHashCode()
// @Accessors(chain = true)
// @ApiModel(value = "Img", description = "Img")
// public static class Img {
// private String url;
//
// public Img(String url) {
// this.url = url;
// }
// }
//
//}
//package com.yeejoin.amos.boot.module.tzs.api.vo;
//
//import com.baomidou.mybatisplus.annotation.TableName;
//import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
//import io.swagger.annotations.ApiModel;
//import io.swagger.annotations.ApiModelProperty;
//import lombok.Data;
//import lombok.EqualsAndHashCode;
//import lombok.experimental.Accessors;
//
///**
// * @author tb
// * @date 2021-06-01
// */
//@Data
//@EqualsAndHashCode(callSuper = true)
//@Accessors(chain = true)
//@TableName("cb_maintenance_unit")
//@ApiModel(value = "MaintenanceUnitVo", description = "MaintenanceUnitVo")
//public class MaintenanceUnitVo extends BaseEntity {
//
// private static final long serialVersionUID = 1L;
//
//
// @ApiModelProperty(value = "统一社会信用代码")
// private String socialCreditCode;
//
// @ApiModelProperty(value = "维护保养单位名称")
// private String unitName;
//
// @ApiModelProperty(value = "省份")
// private String province;
//
// @ApiModelProperty(value = "地市")
// private String city;
//
// @ApiModelProperty(value = "区县")
// private String district;
//
// @ApiModelProperty(value = "区域代码")
// private String regionCode;
//
// @ApiModelProperty(value = "地址(详细地址,包括道路、门牌号码)")
// private String address;
//
// @ApiModelProperty(value = "经度")
// private String longitude;
//
// @ApiModelProperty(value = "纬度")
// private String latitude;
//
// @ApiModelProperty(value = "法人id")
// private Long legalPersonId;
//
// @ApiModelProperty(value = "法人")
// private String legalPerson;
//
// @ApiModelProperty(value = "法人电话/注册电话")
// private String legalPersonPhone;
//
// @ApiModelProperty(value = "企业资质等级")
// private String qualificationLevel;
//
// @ApiModelProperty(value = "信用级别")
// private Integer creditLevel;
//
// @ApiModelProperty(value = "许可证编号")
// private String licenseNum;
//
// @ApiModelProperty(value = "值班电话")
// private String dutyPhone;
//
// @ApiModelProperty(value = "紧急电话号码")
// private String emergencyPhone;
//
// @ApiModelProperty(value = "主要负责人1")
// private String principalFirst;
//
// @ApiModelProperty(value = "主要负责人1手机号码")
// private String principalFirstPhone;
//
// @ApiModelProperty(value = "主要负责人1id")
// private Long principalFirstId;
//
// @ApiModelProperty(value = "主要负责人2")
// private String principalSecond;
//
// @ApiModelProperty(value = "主要负责人2手机号码")
// private String principalSecondPhone;
//
// @ApiModelProperty(value = "主要负责人2id")
// private Long principalSecondId;
//
// @ApiModelProperty(value = "原始表id(来自历史数据库)")
// private String originalId;
//
//}
//package com.yeejoin.amos.boot.module.tzs.api.vo;
//
//import com.baomidou.mybatisplus.annotation.TableName;
//import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
//import io.swagger.annotations.ApiModel;
//import io.swagger.annotations.ApiModelProperty;
//import lombok.Data;
//import lombok.EqualsAndHashCode;
//import lombok.experimental.Accessors;
//
///**
// * @author tb
// * @date 2021-06-01
// */
//@Data
//@EqualsAndHashCode(callSuper = true)
//@Accessors(chain = true)
//@TableName("tcb_rescue_station")
//@ApiModel(value = "RescueStationVo", description = "RescueStationVo")
//public class RescueStationVo extends BaseEntity {
//
// private static final long serialVersionUID = 1L;
//
//
// @ApiModelProperty(value = "应急救援机构名称")
// private String name;
//
// @ApiModelProperty(value = "省份")
// private String province;
//
// @ApiModelProperty(value = "地市")
// private String city;
//
// @ApiModelProperty(value = "区县")
// private String district;
//
// @ApiModelProperty(value = "区域代码")
// private String regionCode;
//
// @ApiModelProperty(value = "地址(详细地址,包括道路、门牌号码)")
// private String address;
//
// @ApiModelProperty(value = "责任人id")
// private Long principalId;
//
// @ApiModelProperty(value = "主要负责人")
// private String principal;
//
// @ApiModelProperty(value = "负责人电话")
// private String principalPhone;
//
// @ApiModelProperty(value = "应急救援负责人")
// private String rescueLeader;
//
// @ApiModelProperty(value = "应急救援负责人手机号")
// private String rescueLeaderPhone;
//
// @ApiModelProperty(value = "应急救援负责人id")
// private Long rescueLeaderId;
//
// @ApiModelProperty(value = "所属单位(维保单位)")
// private String affiliatedUnit;
//
// @ApiModelProperty(value = "所属单位id")
// private Long affiliatedUnitId;
//
// @ApiModelProperty(value = "经纬度")
// private String longitudeLatitude;
//
//}
//package com.yeejoin.amos.boot.module.tzs.api.vo;
//
//import com.baomidou.mybatisplus.annotation.TableName;
//import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
//import io.swagger.annotations.ApiModel;
//import io.swagger.annotations.ApiModelProperty;
//import lombok.Data;
//import lombok.EqualsAndHashCode;
//import lombok.experimental.Accessors;
//
///**
// * @author tb
// * @date 2021-06-01
// */
//@Data
//@EqualsAndHashCode(callSuper = true)
//@Accessors(chain = true)
//@TableName("tcb_use_unit")
//@ApiModel(value = "UseUnitVo", description = "UseUnitVo")
//public class UseUnitVo extends BaseEntity {
//
// private static final long serialVersionUID = 1L;
//
//
// @ApiModelProperty(value = "统一社会信用代码")
// private String socialCreditCode;
//
// @ApiModelProperty(value = "使用单位(小区)名称")
// private String useUnitName;
//
// @ApiModelProperty(value = "小区所属地产品牌")
// private String realEstateBrand;
//
// @ApiModelProperty(value = "物业公司所属品牌")
// private String propertyCompanyBrand;
//
// @ApiModelProperty(value = "省份")
// private String province;
//
// @ApiModelProperty(value = "地市")
// private String city;
//
// @ApiModelProperty(value = "区县")
// private String district;
//
// @ApiModelProperty(value = "区域代码")
// private String regionCode;
//
// @ApiModelProperty(value = "地址")
// private String address;
//
// @ApiModelProperty(value = "责任人id")
// private Long principalId;
//
// @ApiModelProperty(value = "主要负责人")
// private String principal;
//
// @ApiModelProperty(value = "负责人电话")
// private String principalPhone;
//
// @ApiModelProperty(value = "管理部门")
// private String management;
//
// @ApiModelProperty(value = "管理员id")
// private Long managerId;
//
// @ApiModelProperty(value = "电梯安全管理员")
// private String manager;
//
// @ApiModelProperty(value = "电梯管理员手机")
// private String managerPhone;
//
// @ApiModelProperty(value = "原始表id(来自历史数据库)")
// private String originalId;
//
//}
......@@ -23,4 +23,83 @@
or rec_user_id = #{recUserId}
</if>
</select>
<select id="queryAlertListByQueryDto" resultType="com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledQueryDto">
SELECT
a.work_order_number AS workOrderNumber,
a.rec_user_name AS creator,
a.emergency_person AS emergency,
a.call_time AS emergencyTime,
a.emergency_call AS emergencyCall,
a.device_id AS deviceId,
e.address AS elevatorAddress,
a.region_code AS address,
a.alarm_type AS alertType,
a.alert_source AS alertSource,
a.alert_stage AS alertStage,
CASE a.alert_status
WHEN 0 THEN
'未完成'
WHEN 1 THEN
'完成'
ELSE
''
END AS alertStatus
FROM
tz_alert_called a
LEFT JOIN tcb_elevator e ON e.rescue_code = a.device_id
WHERE 1=1
<if test="alertCalledQueryDto.workOrderNumber != null and alertCalledQueryDto.workOrderNumber != ''">
AND a.work_order_number like CONCAT(CONCAT('%',#{alertCalledQueryDto.workOrderNumber}),'%')
</if>
<if test="alertCalledQueryDto.creator != null and alertCalledQueryDto.creator != ''">
AND a.rec_user_name like CONCAT(CONCAT('%',#{alertCalledQueryDto.creator}),'%')
</if>
<if test="alertCalledQueryDto.emergency != null and alertCalledQueryDto.emergency != ''">
AND a.emergency_person like CONCAT(CONCAT('%',#{alertCalledQueryDto.emergency}),'%')
</if>
<if test="alertCalledQueryDto.emergencyTimeStart != null ">
and #{alertCalledQueryDto.emergencyTimeStart} <![CDATA[ <= ]]> a.call_time
</if>
<if test="alertCalledQueryDto.emergencyTimeEnd != null ">
and a.call_time <![CDATA[ <= ]]> #{alertCalledQueryDto.emergencyTimeEnd}
</if>
<if test="alertCalledQueryDto.workOrderNumber != null and alertCalledQueryDto.workOrderNumber != ''">
and call_time <![CDATA[ <= ]]> #{endDate}
</if>
<if test="alertCalledQueryDto.emergencyCall != null and alertCalledQueryDto.emergencyCall != ''">
AND a.emergency_call like CONCAT(CONCAT('%',#{alertCalledQueryDto.emergencyCall}),'%')
</if>
<if test="alertCalledQueryDto.deviceId != null and alertCalledQueryDto.deviceId != ''">
AND a.device_id like CONCAT(CONCAT('%',#{alertCalledQueryDto.deviceId}),'%')
</if>
<if test="alertCalledQueryDto.elevatorAddress != null and alertCalledQueryDto.elevatorAddress != ''">
AND e.address like CONCAT(CONCAT('%',#{alertCalledQueryDto.elevatorAddress}),'%')
</if>
<if test="alertCalledQueryDto.address != null and alertCalledQueryDto.address != ''">
AND a.region_code like CONCAT(CONCAT('%',#{alertCalledQueryDto.address}),'%')
</if>
<if test="alertCalledQueryDto.alertType != null and alertCalledQueryDto.alertType != ''">
AND a.alarm_type_code = #{alertCalledQueryDto.alertType}
</if>
<if test="alertCalledQueryDto.alertSource != null and alertCalledQueryDto.alertSource != ''">
AND a.alert_source_code = #{alertCalledQueryDto.alertSource}
</if>
<if test="alertCalledQueryDto.alertStage != null and alertCalledQueryDto.alertStage != ''">
AND a.alert_stage_code = #{alertCalledQueryDto.alertStage}
</if>
<if test="alertCalledQueryDto.alertStatus != null and alertCalledQueryDto.alertStatus != ''">
AND a.alert_status = #{alertCalledQueryDto.alertStatus}
</if>
ORDER BY a.rec_date
<if test="alertCalledQueryDto.pageNum != null and alertCalledQueryDto.pageSize != ''">
limit #{alertCalledQueryDto.pageNum},#{alertCalledQueryDto.pageSize}
</if>
</select>
</mapper>
package com.yeejoin.amos.boot.module.common.biz.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.common.api.dto.FailureAuditDto;
import com.yeejoin.amos.boot.module.common.api.entity.FailureAudit;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FailureAuditServiceImpl;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -38,8 +40,9 @@ public class FailureAuditController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增", notes = "新增")
public ResponseModel<FailureAuditDto> save(@RequestBody FailureAuditDto model) {
model = failureAuditServiceImpl.savemodel(model);
public ResponseModel<FailureAuditDto> save(@RequestBody FailureAuditDto model, ReginParams userInfo) throws Exception {
model = failureAuditServiceImpl.savemodel(model,userInfo);
return ResponseHelper.buildResponse(model);
}
......
......@@ -122,12 +122,12 @@ public class FailureDetailsController extends BaseController {
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "分页查询", notes = "分页查询")
public ResponseModel<Page<FailureDetailsDto>> queryForPage(@RequestParam(value = "current") int current,@RequestParam
(value = "size") int size,@RequestParam Long currentStatus) {
(value = "size") int size,@RequestParam Long currentStatus,@RequestParam Integer type) {
Page<FailureDetailsDto> page = new Page<FailureDetailsDto>();
page.setCurrent(current);
page.setSize(size);
final AgencyUserModel userInfo = getUserInfo();
return ResponseHelper.buildResponse(failureDetailsServiceImpl.queryForFailureDetailsPage(page,currentStatus,userInfo));
return ResponseHelper.buildResponse(failureDetailsServiceImpl.queryForFailureDetailsPage(page,currentStatus,userInfo,type));
}
/**
......@@ -167,11 +167,11 @@ public class FailureDetailsController extends BaseController {
return ResponseHelper.buildResponse(failureDetailsServiceImpl.queryStatusCount(currentStatus));
}
/**
/* *//**
* 查询我提交状态任务数量
*
* @return
*/
*//*
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "查询我提交状态任务数量", notes = "查询我提交状态任务数量")
@GetMapping(value = "/list/userID")
......@@ -182,6 +182,11 @@ public class FailureDetailsController extends BaseController {
page.setSize(size);
String userId = getUserInfo().getUserId();
return ResponseHelper.buildResponse(failureDetailsServiceImpl.queryForPage(page,userId));
}*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "流程信息", notes = "流程信息")
@GetMapping(value = "/processHistory")
public ResponseModel<Object> selectHistoryt(@RequestParam Long sequenceNbr) {
return ResponseHelper.buildResponse(failureDetailsServiceImpl.getCurrentProcessHistoryTask(sequenceNbr));
}
}
package com.yeejoin.amos.boot.module.common.biz.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.common.api.dto.FailureMaintainDto;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FailureMaintainServiceImpl;
......@@ -37,8 +38,8 @@ public class FailureMaintainController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增", notes = "新增")
public ResponseModel<FailureMaintainDto> save(@RequestBody FailureMaintainDto model) {
model = failureMaintainServiceImpl.createWithModel(model);
public ResponseModel<FailureMaintainDto> save(@RequestBody FailureMaintainDto model, ReginParams userInfo) {
model = failureMaintainServiceImpl.savemodel(model,userInfo);
return ResponseHelper.buildResponse(model);
}
......@@ -52,9 +53,9 @@ public class FailureMaintainController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "PUT", value = "验收操作", notes = "根据sequenceNbr更新")
public ResponseModel<FailureMaintainDto> updateBySequenceNbrFailureMaintain(@RequestBody FailureMaintainDto model,Integer status,@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
public ResponseModel<FailureMaintainDto> updateBySequenceNbrFailureMaintain(@RequestBody FailureMaintainDto model,Integer status,@PathVariable(value = "sequenceNbr") Long sequenceNbr,ReginParams userInfo) {
model.setSequenceNbr(sequenceNbr);
return ResponseHelper.buildResponse(failureMaintainServiceImpl.updateModel(model,status));
return ResponseHelper.buildResponse(failureMaintainServiceImpl.updateModel(model,status,userInfo));
}
/*
......
package com.yeejoin.amos.boot.module.common.biz.controller;
import com.yeejoin.amos.boot.module.common.api.entity.FailureRepairlog;
import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.List;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FailureRepairlogServiceImpl;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.common.api.dto.FailureRepairlogDto;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
/**
* 流程日志
*
* @author system_generator
* @date 2021-08-12
*/
@RestController
@Api(tags = "流程日志Api")
@RequestMapping(value = "/common/failure-repairlog")
public class FailureRepairlogController extends BaseController {
@Autowired
FailureRepairlogServiceImpl failureRepairlogServiceImpl;
/**
* 新增流程日志
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增流程日志", notes = "新增流程日志")
public ResponseModel<FailureRepairlogDto> save(@RequestBody FailureRepairlogDto model) {
model = failureRepairlogServiceImpl.createWithModel(model);
return ResponseHelper.buildResponse(model);
}
/**
* 根据sequenceNbr更新
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新流程日志", notes = "根据sequenceNbr更新流程日志")
public ResponseModel<FailureRepairlogDto> updateBySequenceNbrFailureRepairlog(@RequestBody FailureRepairlogDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
model.setSequenceNbr(sequenceNbr);
return ResponseHelper.buildResponse(failureRepairlogServiceImpl.updateWithModel(model));
}
/**
* 根据sequenceNbr删除
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@DeleteMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除流程日志", notes = "根据sequenceNbr删除流程日志")
public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @PathVariable(value = "sequenceNbr") Long sequenceNbr){
return ResponseHelper.buildResponse(failureRepairlogServiceImpl.removeById(sequenceNbr));
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个流程日志", notes = "根据sequenceNbr查询单个流程日志")
public ResponseModel<FailureRepairlogDto> selectOne(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(failureRepairlogServiceImpl.queryBySeq(sequenceNbr));
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "流程日志分页查询", notes = "流程日志分页查询")
public ResponseModel<Page<FailureRepairlogDto>> queryForPage(@RequestParam(value = "current") int current,@RequestParam
(value = "size") int size) {
Page<FailureRepairlogDto> page = new Page<FailureRepairlogDto>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(failureRepairlogServiceImpl.queryForFailureRepairlogPage(page));
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "流程日志列表全部数据查询", notes = "流程日志列表全部数据查询")
@GetMapping(value = "/list")
public ResponseModel<List<FailureRepairlogDto>> selectForList() {
return ResponseHelper.buildResponse(failureRepairlogServiceImpl.queryForFailureRepairlogList());
}
/**
* 查询报修日志
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "查询报修日志", notes = "查询报修日志")
@GetMapping(value = "/list/{faultId}")
public ResponseModel<List<FailureRepairlog>> findByFaultIdLog(@RequestParam Long faultId) {
return ResponseHelper.buildResponse(failureRepairlogServiceImpl.findByfaultIdLog(faultId));
}
}
package com.yeejoin.amos.boot.module.common.biz.service.impl;
import java.util.Date;
import java.util.List;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yeejoin.amos.boot.module.common.api.entity.FailureDetails;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.module.common.api.dto.FailureAuditDto;
import com.yeejoin.amos.boot.module.common.api.dto.FailureDetailsDto;
import com.yeejoin.amos.boot.module.common.api.dto.FailureRepairlogDto;
import com.yeejoin.amos.boot.module.common.api.entity.FailureAudit;
import com.yeejoin.amos.boot.module.common.api.enums.AuditResultEnum;
import com.yeejoin.amos.boot.module.common.api.enums.FailureStatuEnum;
......@@ -31,8 +32,8 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
@Autowired
FailureDetailsServiceImpl failureDetailsService;
// @Autowired
// RemoteWorkFlowService remoteWorkFlowService;
@Autowired
FailureRepairlogServiceImpl failureRepairlogService;
/**
* 分页查询
......@@ -51,18 +52,22 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
/**
* 发起审核
*/
public FailureAuditDto savemodel(FailureAuditDto model) {
// remoteWorkFlowService.currentTask();
public FailureAuditDto savemodel(FailureAuditDto model, ReginParams userInfo) throws Exception {
if (model.getAuditResult().equals(5)) {
model.setAuditTime(new Date());
model.setIsDelete(false);
this.createWithModel(model);
return model;
}
Integer auditResult = model.getAuditResult();
//根据审核的结果进行业务操作
if (auditResult.equals(AuditResultEnum.AGREE.getCode())) {
updateStatus(model, FailureStatuEnum.WAITING_MAINTAIN.getCode());
updateStatus(model, FailureStatuEnum.WAITING_MAINTAIN.getCode(), userInfo);
} else if (auditResult.equals(AuditResultEnum.REFUSE.getCode())) {
updateStatus(model, FailureStatuEnum.REFUSE.getCode());
updateStatus(model, FailureStatuEnum.REFUSE.getCode(), userInfo);
} else if (auditResult.equals(AuditResultEnum.SEND_BACK.getCode())) {
updateStatus(model, FailureStatuEnum.WAITING_SUBMIT.getCode());
updateStatus(model, FailureStatuEnum.WAITING_SUBMIT.getCode(), userInfo);
}
return model;
}
......@@ -70,14 +75,46 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
/**
* 修改故障保修单任务状态
*/
FailureDetailsDto updateStatus(FailureAuditDto model, Integer status) {
FailureDetailsDto updateStatus(FailureAuditDto model, Integer status, ReginParams userInfo) throws Exception {
failureDetailsService.checkExcuteTaskAuthMap(model.getSequenceNbr(),userInfo);
FailureDetailsDto failureDetailsDto = failureDetailsService.queryBySeq(model.getFaultId());
failureDetailsDto.setCurrentStatus(status);
failureDetailsDto.setSequenceNbr(model.getFaultId());
String condition;
//添加报修日志
Long faultId = model.getFaultId();
Date processTime = model.getAuditTime();
String processDepartment = model.getAuditDepartment();
String processAuditor = model.getAuditor();
if (status.equals(AuditResultEnum.AGREE)) {
condition = AuditResultEnum.AGREE.getName();
repairlog(faultId,processAuditor,processTime,processDepartment,condition);
}
condition = AuditResultEnum.REFUSE.getName();
failureDetailsService.excuteTask(failureDetailsDto.getProcessId(), userInfo, condition);
repairlog(faultId,processAuditor,processTime,processDepartment,condition);
return failureDetailsService.updateWithModel(failureDetailsDto);
}
/**
* 添加报修日志
*/
public void repairlog(Long faultId, String processAuditor, Date processTime, String processDepartment, String processResult) {
FailureRepairlogDto failureRepairlogDto = new FailureRepairlogDto();
failureRepairlogDto.setFaultId(faultId);
failureRepairlogDto.setProcessAuditor(processAuditor);
failureRepairlogDto.setProcessTime(processTime);
failureRepairlogDto.setProcessDepartment(processDepartment);
failureRepairlogDto.setProcessResult(processResult);
failureRepairlogService.createWithModel(failureRepairlogDto);
}
/**
* 根据FaultId查询
*/
public List<FailureAudit> findByfaultId(Long faultId) {
......
package com.yeejoin.amos.boot.module.common.biz.service.impl;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
......@@ -26,12 +27,15 @@ import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.workflow.feign.WorkflowFeignService;
import com.yeejoin.amos.boot.module.common.api.dto.FailureAuditDto;
import com.yeejoin.amos.boot.module.common.api.dto.FailureDetailsDto;
import com.yeejoin.amos.boot.module.common.api.dto.FailureRepairlogDto;
import com.yeejoin.amos.boot.module.common.api.entity.FailureAudit;
import com.yeejoin.amos.boot.module.common.api.entity.FailureDetails;
import com.yeejoin.amos.boot.module.common.api.entity.FailureRepairlog;
import com.yeejoin.amos.boot.module.common.api.enums.FailureStatuEnum;
import com.yeejoin.amos.boot.module.common.api.mapper.FailureDetailsMapper;
import com.yeejoin.amos.boot.module.common.api.service.IFailureAuditService;
import com.yeejoin.amos.boot.module.common.api.service.IFailureDetailsService;
import com.yeejoin.amos.boot.module.common.api.service.IFailureRepairlogService;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
/**
......@@ -59,28 +63,55 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
@Autowired
IFailureAuditService failureAuditService;
@Autowired
FailureRepairlogServiceImpl failureRepairlogService;
@Autowired
IFailureRepairlogService failureRepairlog;
public static String EMERGENCY_COMMAND = "应急指挥科";
private final Logger logger = LoggerFactory.getLogger(FailureDetailsServiceImpl.class);
public static Integer SELECY_ALL = 6;
public static Integer SELECY_STATUS = 7;
public static Integer SELECY_ISUBMIT = 8;
/**
* 分页查询
*/
public Page<FailureDetailsDto> queryForFailureDetailsPage(Page<FailureDetailsDto> page, Long currentStatus, AgencyUserModel userInfo ) {
if (currentStatus == null){
public Page<FailureDetailsDto> queryForFailureDetailsPage(Page<FailureDetailsDto> page, Long currentStatus,
AgencyUserModel userInfo) {
if (currentStatus == null) {
return this.queryForPage(page, "submission_time", true);
}
return this.queryForPage(page, "submission_time", true,currentStatus);
return this.queryForPage(page, "submission_time", true, currentStatus);
}
public Page<FailureDetailsDto> queryForFailureDetailsPage(Page<FailureDetailsDto> page, Long currentStatus,
AgencyUserModel userInfo, Integer type) {
if (currentStatus == null || type.equals(SELECY_ALL)) {
return this.queryForPage(page, "submission_time", true);
}
if (type.equals(SELECY_ISUBMIT)) {
if (currentStatus == null || ObjectUtils.isNotEmpty(userInfo)) {
String submissionPid = userInfo.getUserId();
queryForPage(page, submissionPid);
}
return null;
}
return this.queryForPage(page, "submission_time", true, currentStatus);
}
/**
* 我发起分页查询
*/
public Page<FailureDetailsDto> queryForPage(Page<FailureDetailsDto> page, String userId ) {
if (userId == null){
public Page<FailureDetailsDto> queryForPage(Page<FailureDetailsDto> page, String userId) {
if (userId == null) {
return null;
}
return this.queryForPage(page, "submission_time", true,userId);
return this.queryForPage(page, "submission_time", true, userId);
}
/**
......@@ -101,6 +132,14 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
}
/**
* 流程日志
*/
public List<Map> repairLog(Long currentStatus) {
return null;
}
/**
* 查询任务状态数量
*/
public Integer queryStatusCount(Long currentStatus) {
......@@ -135,18 +174,31 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
FailureDetailsDto model = null;
try {
if (ObjectUtils.isNotEmpty(failureDetailsDto.getAttachment())) {
sourceFileServiceImpl.saveSourceFile(failureDetailsDto.getSequenceNbr(),
failureDetailsDto.getAttachment());
sourceFileServiceImpl.saveSourceFile(failureDetailsDto.getSequenceNbr(), failureDetailsDto.getAttachment());
}
/*failureDetailsDto.set*/
// 发起主表流程 并添加至报修日志
failureDetailsDto.setSubmissionTime(new Date());
model = this.createWithModel(failureDetailsDto);
Long faultId = model.getSequenceNbr();
String processAuditor = model.getRecUserName();
String processResult = "提交报修单";
String processDepartment = "1111";
Date processTime = model.getSubmissionTime();
repairlog(faultId, processAuditor, processTime, processDepartment, processResult);
FailureAuditDto failureAuditDto = new FailureAuditDto();
failureAuditDto.setAuditor(model.getRecUserName());
failureAuditDto.setFaultId(model.getSequenceNbr());
failureAuditDto.setAuditOpinion("已发起");
failureAuditServiceImpl.savemodel(failureAuditDto);
failureAuditDto.setAuditTime(new Date());
failureAuditDto.setIsDelete(true);
failureAuditDto.setAuditResult(5);
if (ObjectUtils.isNotEmpty(failureAuditDto)) {
failureAuditServiceImpl.savemodel(failureAuditDto, userInfo);
}
} catch (Exception e) {
e.printStackTrace();
logger.info("添加故障维修信息到数据库失败");
return false;
// return CommonResponseUtil.failure("添加失败");
......@@ -157,9 +209,24 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
return true;
}
/**
* 添加报修日志
*/
public void repairlog(Long faultId, String processAuditor, Date processTime, String processDepartment,
String processResult) {
FailureRepairlogDto failureRepairlogDto = new FailureRepairlogDto();
failureRepairlogDto.setFaultId(faultId);
failureRepairlogDto.setProcessAuditor(processAuditor);
failureRepairlogDto.setProcessTime(processTime);
failureRepairlogDto.setProcessDepartment(processDepartment);
failureRepairlogDto.setProcessResult(processResult);
failureRepairlogDto.setIsDelete(false);
failureRepairlogService.createWithModel(failureRepairlogDto);
}
public boolean excuteTask(Long sequenceNbr, ReginParams userInfo, String condition) {
HashMap<String, Object> conditionMap = new HashMap<String, Object>();
conditionMap.put("condition", condition);
conditionMap.put("condition", Integer.parseInt(condition));
Map<String, Object> map = checkExcuteTaskAuthMap(sequenceNbr, userInfo);
try {
if (Boolean.parseBoolean(map.get("checkFlag").toString())) {
......@@ -188,26 +255,25 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
public Object getNextTaskGroupName(String procressId) {
JSONObject teskObject = workflowFeignService.getTaskList(procressId);
JSONArray taskDetailArray = teskObject.getJSONArray("data");
String currentRoleName="";
String currentRoleName = "";
for (Object obj : taskDetailArray) {
JSONObject detail = JSONObject.parseObject(JSONObject.toJSONString(obj));
JSONObject taskGroupNameObject = workflowFeignService.getTaskGroupName(detail.getString("id"));
for (Object object : taskGroupNameObject.getJSONArray("data")) {
JSONObject taskGroupNameDetail= JSONObject.parseObject(JSONObject.toJSONString(object));
currentRoleName =currentRoleName +taskGroupNameDetail.getString("groupId")+",";
JSONObject taskGroupNameDetail = JSONObject.parseObject(JSONObject.toJSONString(object));
currentRoleName = currentRoleName + taskGroupNameDetail.getString("groupId") + ",";
}
}
return currentRoleName;
}
public boolean checkExcuteTaskAuth(Long sequenceNbr, ReginParams userInfo) {
Map<String, Object> map = this.checkExcuteTaskAuthMap(sequenceNbr, userInfo);
return Boolean.parseBoolean(map.get("checkFlag").toString());
}
public Map<String, Object> checkExcuteTaskAuthMap(Long sequenceNbr, ReginParams userInfo) {
//获取当前登录用户的角色
// 获取当前登录用户的角色
String currentLoginUserRole = userInfo.getRole().getRoleName();
Map<String, Object> map = new HashMap<String, Object>();
map.put("checkFlag", false);
......@@ -238,8 +304,8 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
}
// 当流程节点为应急指挥科时,需要判断当前用户所在的部门id和前面处理的用户部门id是否一致
if (name.contains(EMERGENCY_COMMAND)) {
FailureAudit failureAuditDetail = failureAuditService.findByFaultId(sequenceNbr);
Long auditDepartmentId = failureAuditDetail.getAuditDepartmentId();
FailureRepairlog failureRepairlog = failureRepairlogService.findByFaultId(sequenceNbr);
Long auditDepartmentId = failureRepairlog.getProcessDepartmentId();
if (auditDepartmentId.intValue() == seq.intValue()) {
map.put("taskId", detail.getString("id"));
map.put("checkFlag", true);
......@@ -257,56 +323,69 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
}
return map;
}
/**
/**
* 獲取待處理的任務數量
*
* @param userInfo
* @return
*/
public int getPendingCount (ReginParams userInfo) {
int countNum=0;
//获取当前登录人的部门id
public int getPendingCount(ReginParams userInfo) {
int countNum = 0;
// 获取当前登录人的部门id
Long seq = userInfo.getDepartment().getSequenceNbr();
//获取当前登录用户的角色
String currentLoginUserRole = userInfo.getRole().getRoleName();
// 获取同角色信息的我的待办任务
JSONObject taskListJson = workflowFeignService.getTasksNoAuth(processDefinitionKey,
userInfo.getUserModel().getUserId());
JSONArray taskList = JSONArray.parseArray(JSONObject.toJSONString(taskListJson.getString("data")));
for (Object i : taskList) {
JSONObject task = JSONObject.parseObject(JSONObject.toJSONString(i));
String procressId = task.getString("processInstanceId");
// 通过流程ID查找当前的故障报修表ID 的信息
LambdaQueryWrapper<FailureDetails> wrapper = new LambdaQueryWrapper<FailureDetails>();
String[] arr= {"结束","拒绝"};
wrapper.likeRight(FailureDetails::getCurrentRole,currentLoginUserRole);
wrapper.notIn(FailureDetails::getCurrentStatus, arr);
//根据当前用户的执行角色来获取所有的任务
List<FailureDetails> list= this.baseMapper.selectList(wrapper);
for (FailureDetails i : list) {
String procressId = i.getProcessId();
JSONObject teskObject = workflowFeignService.getTaskList(procressId);
JSONArray taskDetailArray = teskObject.getJSONArray("data");
for (Object obj : taskDetailArray) {
JSONObject taskDetail= JSONObject.parseObject(JSONObject.toJSONString(obj));
if (taskDetail.getString("name").contains(EMERGENCY_COMMAND)) {
FailureAudit failureAuditDetail = failureAuditService.findByFaultId(i.getSequenceNbr());
Long auditDepartmentId = failureAuditDetail.getAuditDepartmentId();
wrapper.eq(FailureDetails::getProcessId, procressId);
FailureDetails failureDetails = this.baseMapper.selectOne(wrapper);
// 通过故障报修单查找创建人的部门ID
FailureRepairlog failureRepairlog = failureRepairlogService.findByFaultId(failureDetails.getSequenceNbr());
// 再去判断当前的任务节点信息是不是维修部门,是的话将于第一次填报保单的操作人部门id进行匹配,符合将视作为一条合法的待办任务
if (task.getString("name").contains(EMERGENCY_COMMAND)) {
Long auditDepartmentId = failureRepairlog.getProcessDepartmentId();
if (auditDepartmentId.intValue() == seq.intValue()) {
countNum++;
continue;
}
} else {
// 判断当前节点任务属于送达部门节点时需要判断当前登录人所在的部门id是否与表单发起时设置的送达部门一致
if (i.getFailureEquipmentId().intValue() == seq.intValue()) {
if (failureDetails.getFailureEquipmentId().intValue() == seq.intValue()) {
countNum++;
continue;
}
}
}
}
return countNum;
}
public Object getCurrentProcessHistoryTask(Long id) {
FailureDetailsDto failureDetailsDto = this.queryBySeq(id);
String processId = failureDetailsDto.getProcessId();
return logger;
JSONObject object= workflowFeignService.queryHistoryTaskListByProcessId(processId);
JSONArray datArray=null;
if(ObjectUtils.isNotEmpty(object)) {
datArray=object.getJSONArray("data");
}
List<Object> list = new ArrayList<Object>();
if(datArray!=null) {
datArray.stream().forEach(i->{
JSONObject detail = JSONObject.parseObject(JSONObject.toJSONString(i));
if(detail.containsKey("operator") && !detail.getString("name").equals("维修中")) {
//从流程记录表中拿到处理人的名称
FailureRepairlog failureRepairlog=failureRepairlogService.findByprocessAuditorId(Long.parseLong(detail.getString("operator")));
detail.replace("operator", failureRepairlog.getProcessAuditor());
list.add(object);
}
});
}
return list;
}
public static String buildOrderNo() {
......@@ -319,4 +398,5 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
}
return newDate + result;
}
}
\ No newline at end of file
package com.yeejoin.amos.boot.module.common.biz.service.impl;
import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.module.common.api.dto.FailureDetailsDto;
import com.yeejoin.amos.boot.module.common.api.dto.FailureMaintainDto;
import com.yeejoin.amos.boot.module.common.api.entity.FailureAudit;
import com.yeejoin.amos.boot.module.common.api.dto.FailureRepairlogDto;
import com.yeejoin.amos.boot.module.common.api.entity.FailureMaintain;
import com.yeejoin.amos.boot.module.common.api.enums.AuditResultEnum;
import com.yeejoin.amos.boot.module.common.api.enums.FailureStatuEnum;
import com.yeejoin.amos.boot.module.common.api.mapper.FailureMaintainMapper;
import com.yeejoin.amos.boot.module.common.api.service.IFailureMaintainService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.List;
/**
* 服务实现类
......@@ -28,6 +31,8 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,F
SourceFileServiceImpl sourceFileServiceImpl;
@Autowired
FailureDetailsServiceImpl failureDetailsService;
@Autowired
FailureRepairlogServiceImpl failureRepairlogService;
/**
* 分页查询
......@@ -46,14 +51,21 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,F
/**
* 添加维修记录
*/
public FailureMaintainDto savemodel(FailureMaintainDto failureMaintainDto) {
this.createWithModel(failureMaintainDto);
public FailureMaintainDto savemodel(FailureMaintainDto failureMaintainDto,ReginParams userInfo) {
failureDetailsService.checkExcuteTaskAuthMap(failureMaintainDto.getFaultId(),userInfo);
failureDetailsService.excuteTask(failureMaintainDto.getFaultId(), userInfo, null);
this.createWithModel(failureMaintainDto);
//添加完成后修改保修单状态为待验收
FailureDetailsDto failureDetailsDto = failureDetailsService.queryBySeq(failureMaintainDto.getFaultId());
failureDetailsDto.setCurrentStatus(FailureStatuEnum.WAITING_ACCEPTANCE.getCode());
failureDetailsService.updateWithModel(failureDetailsDto);
//添加报修日志
String processResult = "维修完成";
repairlog(failureMaintainDto.getFaultId(),failureMaintainDto.getMaintainMan(),failureMaintainDto.getMaintainTime(),
failureMaintainDto.getDepartment(),processResult);
sourceFileServiceImpl.saveSourceFile(failureMaintainDto.getSequenceNbr(),failureMaintainDto.getAttachment());
return failureMaintainDto;
}
......@@ -71,18 +83,32 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,F
/**
*根据审核结果更新维修表
*/
public FailureMaintainDto updateModel(FailureMaintainDto failureMaintainDto,Integer status) {
public FailureMaintainDto updateModel(FailureMaintainDto failureMaintainDto, Integer status, ReginParams userInfo) {
failureDetailsService.checkExcuteTaskAuthMap(failureMaintainDto.getFaultId(),userInfo);
this.updateWithModel(failureMaintainDto);
//根据status修改状态
String processResult = new String();
String condition = new String();
FailureDetailsDto failureDetailsDto = failureDetailsService.queryBySeq(failureMaintainDto.getFaultId());
if (status == AuditResultEnum.AGREE.getCode()) {//同意状态为已完结
failureDetailsDto.setCurrentStatus(FailureStatuEnum.FINISH.getCode());
failureDetailsService.updateWithModel(failureDetailsDto);
processResult = "验证通过";
condition= AuditResultEnum.AGREE.getName();
}else {//不同意状态为已拒绝
failureDetailsDto.setCurrentStatus(FailureStatuEnum.REFUSE.getCode());
failureDetailsService.updateWithModel(failureDetailsDto);
processResult = "验证未通过";
condition = AuditResultEnum.REFUSE.getName();
}
failureDetailsService.excuteTask(failureMaintainDto.getFaultId(), userInfo, condition);
//添加报修日志
repairlog(failureMaintainDto.getFaultId(),failureMaintainDto.getMaintainMan(),failureMaintainDto.getMaintainTime(),
failureMaintainDto.getDepartment(),processResult);
return failureMaintainDto;
}
/**
......@@ -94,4 +120,17 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,F
// TODO Auto-generated method stub
return null;
}
/**
* 添加报修日志
*/
public void repairlog(Long faultId, String processAuditor, Date processTime, String processDepartment, String processResult) {
FailureRepairlogDto failureRepairlogDto = new FailureRepairlogDto();
failureRepairlogDto.setFaultId(faultId);
failureRepairlogDto.setProcessAuditor(processAuditor);
failureRepairlogDto.setProcessTime(processTime);
failureRepairlogDto.setProcessDepartment(processDepartment);
failureRepairlogDto.setProcessResult(processResult);
failureRepairlogService.createWithModel(failureRepairlogDto);
}
}
\ No newline at end of file
package com.yeejoin.amos.boot.module.common.biz.service.impl;
import java.util.List;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.common.api.dto.FailureRepairlogDto;
import com.yeejoin.amos.boot.module.common.api.entity.FailureAudit;
import com.yeejoin.amos.boot.module.common.api.entity.FailureRepairlog;
import com.yeejoin.amos.boot.module.common.api.mapper.FailureRepairlogMapper;
import com.yeejoin.amos.boot.module.common.api.service.IFailureRepairlogService;
/**
* 流程日志服务实现类
*
* @author system_generator
* @date 2021-08-12
*/
@Service
public class FailureRepairlogServiceImpl extends BaseService<FailureRepairlogDto,FailureRepairlog,FailureRepairlogMapper> implements IFailureRepairlogService {
/**
* 分页查询
*/
public Page<FailureRepairlogDto> queryForFailureRepairlogPage(Page<FailureRepairlogDto> page) {
return this.queryForPage(page, null, false);
}
/**
* 列表查询 示例
*/
public List<FailureRepairlogDto> queryForFailureRepairlogList() {
return this.queryForList("" , false);
}
/**
* 根据FaultId查询
*/
public List<FailureRepairlog> findByfaultIdLog(Long faultId) {
Page<FailureRepairlogDto> page = new Page<>();
QueryWrapper<FailureRepairlog> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("fault_id", faultId).orderByAsc("process_time");
return baseMapper.selectList(queryWrapper);
}
public FailureRepairlog findByprocessAuditorId(Long userId) {
QueryWrapper<FailureRepairlog> queryWrapper = new QueryWrapper<FailureRepairlog>();
queryWrapper.eq("process_auditor_id", userId);
queryWrapper.last("LIMIT 1");
return baseMapper.selectOne(queryWrapper);
}
public FailureRepairlog findByFaultId(Long faultId) {
LambdaQueryWrapper<FailureRepairlog> wrapper = new LambdaQueryWrapper<FailureRepairlog>();
wrapper.eq(FailureRepairlog::getIsDelete, false);
wrapper.eq(FailureRepairlog::getFaultId, faultId);
wrapper.orderByAsc(FailureRepairlog::getProcessTime);
wrapper.last("LIMIT 1");
return this.baseMapper.selectOne(wrapper);
}
}
\ No newline at end of file
......@@ -150,6 +150,27 @@ public class LinkageUnitServiceImpl extends BaseService<LinkageUnitDto, LinkageU
return model;
}
public LinkageUnitDto saveLinkageModel(LinkageUnitDto linkageUnitDto) {
// 1.保存行数据
String groupCode = this.getGroupCode();
Map<String, Object> map = Bean.BeantoMap(linkageUnitDto);
Long instanceId = dynamicFormInstanceService.commonSave(groupCode, map);
linkageUnitDto.setInstanceId(instanceId);
// 2.保存基本信息
linkageUnitDto.setUnitCode(getUnitCodeStr());
LinkageUnitDto model = createWithModel(linkageUnitDto);
// 3.保存照片信息
sourceFileServiceImpl.saveSourceFile(model.getSequenceNbr(), model.getImage());
// 3.返回保存后的数据
return model;
}
@Override
public LinkageUnitDto queryOne(Long sequenceNbr) {
String groupCode = getGroupCode();
......@@ -289,4 +310,9 @@ public class LinkageUnitServiceImpl extends BaseService<LinkageUnitDto, LinkageU
return menuList;
}
@Override
public List<LinkageUnitDto> exportToExcel() {
return linkageUnitMapper.exportToExcel();
}
}
\ No newline at end of file
......@@ -6,21 +6,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.constants.CommonConstant;
import com.yeejoin.amos.boot.biz.common.utils.TreeParser;
import com.yeejoin.amos.boot.module.common.api.dto.CompanyDto;
import com.yeejoin.amos.boot.module.common.api.dto.CompanyPerson;
import com.yeejoin.amos.boot.module.common.api.dto.DynamicFormInstanceDto;
import com.yeejoin.amos.boot.module.common.api.dto.ESOrgUsrDto;
import com.yeejoin.amos.boot.module.common.api.dto.FormValue;
import com.yeejoin.amos.boot.module.common.api.dto.OrgDepartmentDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgDepartmentFormDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgMenuDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgPersonDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgPersonExcelDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgPersonFormDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgUsrDto;
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.RequestData;
import com.yeejoin.amos.boot.module.common.api.dto.*;
import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormColumn;
import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
......@@ -570,6 +556,33 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
saveOrgUsrDynamicFormInstance(orgUsr, OrgPersonVo.getDynamicFormValue());
}
public void saveOrgPersonExcel(OrgUsrExcelDto OrgPersonVo) throws Exception {
OrgUsr orgUsr = new OrgUsr();
BeanUtils.copyProperties(OrgPersonVo, orgUsr);
orgUsr.setBizOrgType(CommonConstant.BIZ_ORG_TYPE_PERSON);
if (OrgPersonVo.getParentId() != null) {
OrgUsr parent = getById(OrgPersonVo.getParentId());
if (parent != null && ObjectUtils.isEmpty(OrgPersonVo.getBizOrgCode())) {
orgUsr.setBizOrgCode(parent.getBizOrgCode() + getOrgCodeStr());
}
} else {
orgUsr.setBizOrgCode(getOrgCodeStr());
}
if (!ObjectUtils.isEmpty(OrgPersonVo.getAmosOrgId())) {
AgencyUserModel user = Privilege.agencyUserClient.queryByUserId(OrgPersonVo.getAmosOrgId()).getResult();
OrgPersonVo.setAmosOrgCode(user.getRealName());
}
saveOrgUsrDynamicFormInstance(orgUsr, OrgPersonVo.getDynamicFormValue());
}
@Override
public void updateByIdOrgUsr(OrgUsrDto OrgUsrVo, Long id) throws Exception {
// 修改单位信息
......@@ -975,6 +988,16 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
return lidataDtos;
}
@Override
public List<Map<String, Object>> getparent() {
return orgUsrMapper.getparent();
}
@Override
public List<OrgUsrExcelDto> exportToExcel() {
return orgUsrMapper.exportToExcel();
}
public List<OrgUsr> getCompanyDetailTree() {
LambdaQueryWrapper<OrgUsr> wrapper= new LambdaQueryWrapper<OrgUsr>();
wrapper.eq(OrgUsr::getBizOrgType, "COMPANY");
......
package com.yeejoin.amos.boot.module.jcs.biz.controller;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.MenuFrom;
import com.yeejoin.amos.boot.module.common.api.dto.ExcelDto;
import com.yeejoin.amos.boot.module.jcs.api.enums.ExcelEnums;
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.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;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 导出导入
......@@ -34,25 +34,15 @@ public class ExcelController extends BaseController {
private static final String NOT_DUTY = "休班";
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "下载模板")
@GetMapping("/template")
public void template(HttpServletResponse response, ExcelDto excelDto) {
try {
excelService.templateExport(response, excelDto);
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("系统异常!");
}
}
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "下载模板")
@GetMapping("/download/template")
public void downloadTemplate(HttpServletResponse response, @RequestParam(required = false) String fileName,
@RequestParam(required = false) String sheetName, @RequestParam String classUrl) {
@GetMapping("/download/template/{type}")
public void downloadTemplate(HttpServletResponse response, @PathVariable(value = "type") String type) {
try {
ExcelDto excelDto = new ExcelDto(fileName, sheetName, classUrl, toString());
ExcelEnums excelEnums= ExcelEnums.getByKey(type);
ExcelDto excelDto = new ExcelDto(excelEnums.getFileName(), excelEnums.getSheetName(), excelEnums.getClassUrl(), excelEnums.getType());
excelService.templateExport(response, excelDto);
} catch (Exception e) {
e.printStackTrace();
......@@ -62,9 +52,11 @@ public class ExcelController extends BaseController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "导出公用类")
@GetMapping("/export")
public void getFireStationFile(HttpServletResponse response, ExcelDto excelDto) {
@GetMapping("/export/{type}")
public void getFireStationFile(HttpServletResponse response, @PathVariable(value = "type") String type) {
try {
ExcelEnums excelEnums= ExcelEnums.getByKey(type);
ExcelDto excelDto = new ExcelDto(excelEnums.getFileName(), excelEnums.getSheetName(), excelEnums.getClassUrl(), excelEnums.getType());
excelService.commonExport(response, excelDto);
} catch (Exception e) {
e.printStackTrace();
......@@ -72,46 +64,53 @@ public class ExcelController extends BaseController {
}
}
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "导出公用类2")
@GetMapping("/export/list")
public void exportByType(HttpServletResponse response, @RequestParam(required = false) String fileName,
@RequestParam(required = false) String sheetName, @RequestParam String type) {
try {
excelService.commonExport(response, new ExcelDto(fileName, sheetName, type));
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("系统异常!");
}
}
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "上传文件数据-")
@PostMapping("/upload")
public void upload(@RequestPart("file") MultipartFile multipartFile, ExcelDto excelDto) {
@ApiOperation(value = "导入公用")
@PostMapping("/upload/{type}")
public ResponseModel<Object> upload(@RequestPart("file") MultipartFile multipartFile, @PathVariable(value = "type") String type) {
try {
ExcelEnums excelEnums= ExcelEnums.getByKey(type);
ExcelDto excelDto = new ExcelDto(excelEnums.getFileName(), excelEnums.getSheetName(), excelEnums.getClassUrl(), excelEnums.getType());
excelService.commonUpload(multipartFile, excelDto);
return ResponseHelper.buildResponse(null);
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("系统异常!");
}
}
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "上传文件数据-2")
@PostMapping("/upload2")
public void upload2(@RequestPart("file") MultipartFile multipartFile,
@RequestParam(required = false) String fileName,
@RequestParam(required = false) String sheetName,
@RequestParam String type) {
try {
excelService.commonUpload(multipartFile, new ExcelDto(fileName, sheetName, type));
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("系统异常!");
}
}
// @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
// @ApiOperation(value = "上传文件数据-2")
// @PostMapping("/upload2")
// public void upload2(@RequestPart("file") MultipartFile multipartFile,
// @RequestParam(required = false) String fileName,
// @RequestParam(required = false) String sheetName,
// @RequestParam String type) {
// try {
// excelService.commonUpload(multipartFile, new ExcelDto(fileName, sheetName, type));
// } catch (Exception e) {
// e.printStackTrace();
// throw new RuntimeException("系统异常!");
// }
// }
// @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
// @ApiOperation(value = "导出公用类2")
// @GetMapping("/export/list")
// public void exportByType(HttpServletResponse response, @RequestParam(required = false) String fileName,
// @RequestParam(required = false) String sheetName, @RequestParam String type) {
// try {
// excelService.commonExport(response, new ExcelDto(fileName, sheetName, type));
// } catch (Exception e) {
// e.printStackTrace();
// throw new RuntimeException("系统异常!");
// }
// }
/**
* 导出值班模板
*
......
......@@ -127,6 +127,12 @@ public class DataSourcesImpl implements DataSources {
case "getCompanyDetailTree":
str =getCompanyDetailTree();
break;
case "getparent":
str =getparent();
break;
}
}
return str;
......@@ -273,4 +279,19 @@ public class DataSourcesImpl implements DataSources {
String[] str = stringList.toArray(new String[stringList.size()]);
return str;
}
private String[] getparent() throws Exception {
String[] str=null;
List<Map<String ,Object>> orgUsrTree = orgUsrService.getparent();
if(orgUsrTree!=null&&orgUsrTree.size()>0){
List<String> buildingNames = orgUsrTree.stream().map(item -> {
return item.get("name") + "@" + item.get("id");
}).collect(Collectors.toList());
str = buildingNames.toArray(new String[buildingNames.size()]);
}
return str;
}
}
......@@ -2,26 +2,11 @@ package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import com.alibaba.excel.support.ExcelTypeEnum;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Sequence;
import com.google.common.collect.Lists;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.module.common.api.dto.CompanyPerson;
import com.yeejoin.amos.boot.module.common.api.dto.DutyCarDto;
import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto;
import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonShiftDto;
import com.yeejoin.amos.boot.module.common.api.dto.DutyShiftDto;
import com.yeejoin.amos.boot.module.common.api.dto.ExcelDto;
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.FireTeamDto;
import com.yeejoin.amos.boot.module.common.api.dto.FirefightersDto;
import com.yeejoin.amos.boot.module.common.api.dto.FirefightersExcelDto;
import com.yeejoin.amos.boot.module.common.api.dto.FirefightersInfoDto;
import com.yeejoin.amos.boot.module.common.api.dto.KeySiteExcleDto;
import com.yeejoin.amos.boot.module.common.api.dto.MaintenancePersonExcleDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgUsrDto;
import com.yeejoin.amos.boot.module.common.api.dto.WaterResourceDto;
import com.yeejoin.amos.boot.module.common.api.dto.*;
import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormColumn;
import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance;
import com.yeejoin.amos.boot.module.common.api.entity.FireChemical;
......@@ -35,25 +20,18 @@ import com.yeejoin.amos.boot.module.common.api.excel.ExcelUtil;
import com.yeejoin.amos.boot.module.common.api.service.IDutyPersonService;
import com.yeejoin.amos.boot.module.common.api.service.IKeySiteService;
import com.yeejoin.amos.boot.module.common.api.service.IMaintenanceCompanyService;
import com.yeejoin.amos.boot.module.common.biz.service.impl.DutyCarServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.DutyPersonServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.DutyPersonShiftServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.DutyShiftServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.DynamicFormColumnServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FireChemicalServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FireExpertsServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FireStationServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FirefightersServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.WaterResourceServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.*;
import com.yeejoin.amos.boot.module.jcs.api.dto.AircraftDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.Aircraft;
import com.yeejoin.amos.boot.module.jcs.api.enums.ExcelEnums;
import org.apache.commons.beanutils.ConvertUtils;
import org.apache.ibatis.annotations.Case;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.elasticsearch.search.aggregations.metrics.ParsedSingleValueNumericMetricsAggregation;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
......@@ -118,6 +96,10 @@ public class ExcelServiceImpl {
DutyShiftServiceImpl dutyShiftService;
@Autowired
IDutyPersonService iDutyPersonService;
@Autowired
DynamicFormColumnServiceImpl dynamicFormColumnServiceImpl;
@Autowired
LinkageUnitServiceImpl linkageUnitServiceImpl;
public void templateExport(HttpServletResponse response, ExcelDto excelDto) throws ClassNotFoundException {
String url = excelDto.getClassUrl();
......@@ -129,52 +111,64 @@ public class ExcelServiceImpl {
public void commonExport(HttpServletResponse response, ExcelDto excelDto) {
switch (excelDto.getType()) {
case ExcelEnums.WHP:
case "WHP":
List<FireChemicalDto> data = fireChemicalServiceImpl.queryForFireChemicalList(false);
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), data,
FireChemicalDto.class, dataSourcesImpl, false);
break;
case ExcelEnums.XFZJ:
case "XFZJ":
List<FireExpertsDto> fireExpertsDtoList = fireExpertsServiceImpl.queryForFireExpertsList(false);
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(),
fireExpertsDtoList, FireExpertsDto.class, dataSourcesImpl, false);
break;
case ExcelEnums.SYXX:
case "SYXX":
List<WaterResourceDto> waterResourceDtoList = waterResourceServiceImpl.exportToExcel(true);
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(),
waterResourceDtoList, WaterResourceDto.class, dataSourcesImpl, false);
break;
case ExcelEnums.HKQ:
case "HKQ":
List<AircraftDto> aircraftDtoList = aircraftServiceImpl.queryAircraftDtoForList(false);
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(),
aircraftDtoList, AircraftDto.class, dataSourcesImpl, false);
break;
case ExcelEnums.XFDW:
case "XFDW":
List<FireTeamDto> fireTeamDtoList = fireTeamService.queryFireTeamForList(false);
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), fireTeamDtoList,
FireTeamDto.class, dataSourcesImpl, false);
break;
case ExcelEnums.WXXFZ:
case "WXXFZ":
List<FireStationDto> fireStationDtoList = fireStationService.queryForFireStationList(false);
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(),
fireStationDtoList, FireStationDto.class, null, false);
break;
case ExcelEnums.XFRY:
case "XFRY":
List<FirefightersExcelDto> firefightersExcelDtoList = firefightersService.exportToExcel(false);
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(),
firefightersExcelDtoList, FirefightersExcelDto.class, null, false);
break;
case ExcelEnums.WBRY:
case "WBRY":
List<MaintenancePersonExcleDto> maintenancePersonExcelDtoList =
maintenanceCompanyService.exportToMaintenancePersonExcel();
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(),
maintenancePersonExcelDtoList, MaintenancePersonExcleDto.class, null, false);
break;
case ExcelEnums.KEYSITE:
case "KEYSITE":
List<KeySiteExcleDto> keySiteDtoList = keySiteService.exportToExcel();
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(),
keySiteDtoList, KeySiteExcleDto.class, null, false);
break;
case "JCDWRY":
List<OrgUsrExcelDto> orgUsrList = orgUsrService.exportToExcel();
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;
}
......@@ -183,40 +177,217 @@ public class ExcelServiceImpl {
public void commonUpload(MultipartFile multipartFile, ExcelDto excelDto) throws Exception {
switch (excelDto.getType()) {
case ExcelEnums.WHP:
case "WHP":
excelImportFireChemical(multipartFile);
break;
case ExcelEnums.XFZJ:
case "XFZJ":
excelImportFireExperts(multipartFile);
break;
case ExcelEnums.SYXX:
case "SYXX":
excelImportWaterResource(multipartFile);
break;
case ExcelEnums.HKQ:
case "HKQ":
excelImportAircraft(multipartFile);
break;
case ExcelEnums.XFDW:
case "XFDW":
excelImportFireTeam(multipartFile);
break;
case ExcelEnums.WXXFZ:
case "WXXFZ":
excelImportFireStation(multipartFile);
break;
case ExcelEnums.XFRY:
case "XFRY":
excelImportFirefighters(multipartFile);
break;
case ExcelEnums.CLZQ:
excelImportDutyPerson(multipartFile, ExcelEnums.CLZQ);
case "CLZQ":
excelImportDutyPerson(multipartFile, "CLZQ");
break;
case "RYZB":
excelImportDutyPerson(multipartFile, "RYZB");
break;
case ExcelEnums.RYZB:
excelImportDutyPerson(multipartFile, ExcelEnums.RYZB);
case ExcelEnums.WBRY:
case "WBRY":
excelImportMaintenancePerson(multipartFile);
case ExcelEnums.KEYSITE:
break;
case "KEYSITE":
excelImportKeySite(multipartFile);
break;
case "JCDWRY":
excelImportOrgUsrExcelDto(multipartFile);
break;
case "LDDW":
excelImportLinkageUnitZhDto(multipartFile);
break;
}
return;
}
private void excelImportLinkageUnitZhDto(MultipartFile multipartFile) throws Exception {
List<LinkageUnitDto> excelDtoList = ExcelUtil.readFirstSheetExcel(multipartFile,
LinkageUnitDto.class, 1);
if(excelDtoList!=null&&excelDtoList.size()>0){
excelDtoList.forEach(linkageUnitDto->{
if(linkageUnitDto.getLinkageUnitType()!=null){
String[] certificates = linkageUnitDto.getLinkageUnitType().split("@");
linkageUnitDto.setLinkageUnitType(certificates[0]);
linkageUnitDto.setLinkageUnitTypeCode(certificates[1]);
}
if(linkageUnitDto.getEmergencyLinkageUnit()!=null){
String[] certificates = linkageUnitDto.getEmergencyLinkageUnit().split("@");
linkageUnitDto.setEmergencyLinkageUnit(certificates[0]);
linkageUnitDto.setEmergencyLinkageUnitCode(certificates[1]);
}
linkageUnitServiceImpl.saveLinkageModel(linkageUnitDto);
});
}
}
private void excelImportOrgUsrExcelDto(MultipartFile multipartFile) throws Exception {
List<OrgUsrExcelDto> excelDtoList = ExcelUtil.readFirstSheetExcel(multipartFile,
OrgUsrExcelDto.class, 1);
if(excelDtoList!=null&&excelDtoList.size()>0){
excelDtoList.forEach(orgUsrExcelDto->{
if(orgUsrExcelDto.getParentId()!=null){
String[] certificates = orgUsrExcelDto.getParentId().split("@");
orgUsrExcelDto.setParentId(certificates[1]);
}
// 动态字段填充
List<DynamicFormInitDto> dynamicFormColumn = dynamicFormColumnServiceImpl.getFormlist("246");
List<DynamicFormInstanceDto> dynamicFormValue =new ArrayList<>();
List<DynamicFormInstance> dynamicFormInstancelist =new ArrayList<>();
dynamicFormColumn.forEach(DynamicFormInitDto->{
dynamicFormValue.add(DynamicFormInitDto.getFormItemDescr());
});
dynamicFormValue.forEach(dynamicFormInstanceDto->{
switch (dynamicFormInstanceDto.getFieldCode()) {
case "administrativePositionCode":
if(orgUsrExcelDto.getAdministrativePositionCode()!=null){
String[] certificates = orgUsrExcelDto.getAdministrativePositionCode().split("@");
dynamicFormInstanceDto.setFieldValue(certificates[1]);
dynamicFormInstanceDto.setFieldValueLabel(certificates[0]);
}
break;
case "auditCycle":
if(orgUsrExcelDto.getAuditCycle()!=null){
String[] certificates = orgUsrExcelDto.getAuditCycle().split("@");
dynamicFormInstanceDto.setFieldValue(certificates[1]);
dynamicFormInstanceDto.setFieldValueLabel(certificates[0]);
}
break;
case "certificatesNumber":
dynamicFormInstanceDto.setFieldValue(orgUsrExcelDto.getCertificatesNumber());
break;
case "certificatesTypeCode":
if(orgUsrExcelDto.getCertificatesTypeCode()!=null){
String[] certificates = orgUsrExcelDto.getCertificatesTypeCode().split("@");
dynamicFormInstanceDto.setFieldValue(certificates[1]);
dynamicFormInstanceDto.setFieldValueLabel(certificates[0]);
}
break;
case "certificateType":
if(orgUsrExcelDto.getCertificateType()!=null){
String[] certificates = orgUsrExcelDto.getCertificateType().split("@");
dynamicFormInstanceDto.setFieldValue(certificates[1]);
dynamicFormInstanceDto.setFieldValueLabel(certificates[0]);
}
case "fireManagementPostCode":
if(orgUsrExcelDto.getFireManagementPostCode()!=null){
String[] certificates = orgUsrExcelDto.getFireManagementPostCode().split("@");
dynamicFormInstanceDto.setFieldValue(certificates[1]);
dynamicFormInstanceDto.setFieldValueLabel(certificates[0]);
}
break;
case "gender":
dynamicFormInstanceDto.setFieldValue(orgUsrExcelDto.getGender());
break;
case "internalPositionCode":
if(orgUsrExcelDto.getInternalPositionCode()!=null){
String[] certificates = orgUsrExcelDto.getInternalPositionCode().split("@");
dynamicFormInstanceDto.setFieldValue(certificates[1]);
dynamicFormInstanceDto.setFieldValueLabel(certificates[0]);
}
break;
case "personNumber":
dynamicFormInstanceDto.setFieldValue(orgUsrExcelDto.getPersonNumber());
break;
case "positionType":
if(orgUsrExcelDto.getPositionType()!=null){
String[] certificates = orgUsrExcelDto.getPositionType().split("@");
dynamicFormInstanceDto.setFieldValue(certificates[1]);
dynamicFormInstanceDto.setFieldValueLabel(certificates[0]);
}
break;
case "safetyTraining":
if(orgUsrExcelDto.getSafetyTraining()!=null){
String[] certificates = orgUsrExcelDto.getSafetyTraining().split("@");
dynamicFormInstanceDto.setFieldValue(certificates[1]);
dynamicFormInstanceDto.setFieldValueLabel(certificates[0]);
}
break;
case "stateCode":
if(orgUsrExcelDto.getStateCode()!=null){
String[] certificates = orgUsrExcelDto.getStateCode().split("@");
dynamicFormInstanceDto.setFieldValue(certificates[1]);
dynamicFormInstanceDto.setFieldValueLabel(certificates[0]);
}
break;
case "telephone":
dynamicFormInstanceDto.setFieldValue(orgUsrExcelDto.getTelephone());
break;
}
DynamicFormInstance dynamicFormInstance=new DynamicFormInstance();
BeanUtils.copyProperties(dynamicFormInstanceDto, dynamicFormInstance);
dynamicFormInstancelist.add(dynamicFormInstance);
});
orgUsrExcelDto.setDynamicFormValue(dynamicFormInstancelist);
try {
orgUsrService.saveOrgPersonExcel(orgUsrExcelDto);
} catch (Exception e) {
throw new RuntimeException("导入失败!");
}
});
}
}
private void excelImportFirefighters(MultipartFile multipartFile) throws Exception {
List<FirefightersExcelDto> excelDtoList = ExcelUtil.readFirstSheetExcel(multipartFile,
FirefightersExcelDto.class, 1);
......@@ -469,10 +640,10 @@ public class ExcelServiceImpl {
String dateStr = monthCell == null ? "" : monthCell.toString();
List<Date> dayByMonth = DateUtils.getDayByMonth(dateStr);
if (ExcelEnums.CLZQ.equals(dutyType)) {
if (ExcelEnums.CLZQ.getType().equals(dutyType)) {
initDutyCarData(sheet, dataList, dayByMonth);
dutyCarService.saveImportData(dataList);
} else if (ExcelEnums.RYZB.equals(dutyType)) {
} else if (ExcelEnums.RYZB.getType().equals(dutyType)) {
initDutyPersonData(sheet, dataList, dayByMonth);
dutyPersonService.saveImportData(dataList);
}
......@@ -613,12 +784,19 @@ public class ExcelServiceImpl {
keySiteService.saveExcel(excelDtoList);
}
public void dutyTemplateExport(HttpServletResponse response, String beginDate, String endDate, ExcelDto excelDto,
String ids) {
List<List<Object>> data = new ArrayList<>();
if (ExcelEnums.CLZQ.equals(excelDto.getType())) {
if (ExcelEnums.CLZQ.getType().equals(excelDto.getType())) {
data = initDutyCarTemplate(ids);
} else if (ExcelEnums.RYZB.equals(excelDto.getType())) {
} else if (ExcelEnums.RYZB.getType().equals(excelDto.getType())) {
data = initDutyPersonTemplate(ids);
}
// 获取日期
......@@ -636,9 +814,9 @@ public class ExcelServiceImpl {
List<String> dayByMonth = new ArrayList<>();
rangeDate.forEach(item -> dayByMonth.add((String) item.get("date")));
List<List<Object>> data = new ArrayList<>();
if (ExcelEnums.CLZQ.equals(excelDto.getType())) {
if (ExcelEnums.CLZQ.getType().equals(excelDto.getType())) {
data = initDutyCarInfo(beginDate, endDate, dayByMonth);
} else if (ExcelEnums.RYZB.equals(excelDto.getType())) {
} else if (ExcelEnums.RYZB.getType().equals(excelDto.getType())) {
data = initDutyPersonInfo(beginDate, endDate, dayByMonth);
}
......
......@@ -22,6 +22,7 @@ import org.springframework.cloud.client.ServiceInstance;
import org.springframework.cloud.client.loadbalancer.LoadBalancerClient;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.component.emq.EmqKeeper;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.exception.BaseException;
......@@ -361,7 +362,7 @@ public class DocAuditService {
AtomicBoolean isRange = new AtomicBoolean(false);
AtomicReference<String> resRight = new AtomicReference<>("");
AtomicReference<String> unit = new AtomicReference<>("");
if (!ValidationUtil.isEmpty(values.isEmpty())) {
if (!ObjectUtils.isEmpty(values)) {
values.forEach(value -> {
if (TagValueService.VALUE_TAG_FIELD_RANGE_MAX.equals(value.getFieldName())) {
resRight.set(value.getTagValue());
......
......@@ -402,4 +402,13 @@ public class InputItemController extends AbstractBaseController {
List<InputItemTemplateVo> itemTemplateVoList = ExcelUtils.importExcel(file, 1, 1, InputItemTemplateVo.class);
return CommonResponseUtil.success(inputItemService.uploadListByTemplate(itemTemplateVoList, orgCode, userId));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "校验填写项是否合格")
@GetMapping(value = "/check-is-ok")
public CommonResponse checkIsOk(
@ApiParam(value = "检查项id",required = true) @RequestParam(value = "inputItemId") Long inputItemId,
@ApiParam(value = "填写内容",required = true) @RequestParam(value = "inputValue") String inputValue){
return CommonResponseUtil.success(inputItemService.checkIsOk(inputItemId,inputValue));
}
}
package com.yeejoin.amos.maintenance.business.controller;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
......@@ -33,18 +8,11 @@ import com.yeejoin.amos.maintenance.business.param.PlanTaskPageParam;
import com.yeejoin.amos.maintenance.business.service.intfc.IPlanTaskService;
import com.yeejoin.amos.maintenance.business.service.intfc.IPointService;
import com.yeejoin.amos.maintenance.business.service.intfc.IRouteService;
import com.yeejoin.amos.maintenance.business.util.CommonResponse;
import com.yeejoin.amos.maintenance.business.util.CommonResponseUtil;
import com.yeejoin.amos.maintenance.business.util.FileHelper;
import com.yeejoin.amos.maintenance.business.util.PlanTaskPageParamUtil;
import com.yeejoin.amos.maintenance.business.util.Toke;
import com.yeejoin.amos.maintenance.business.util.*;
import com.yeejoin.amos.maintenance.business.vo.CodeOrderVo;
import com.yeejoin.amos.maintenance.business.vo.PlanTaskVo;
import com.yeejoin.amos.maintenance.business.vo.PointInputItemVo;
import com.yeejoin.amos.maintenance.common.enums.OrderByEnum;
import com.yeejoin.amos.maintenance.common.enums.PlanTaskDetailStatusEnum;
import com.yeejoin.amos.maintenance.common.enums.PlanTaskFinishStatusEnum;
import com.yeejoin.amos.maintenance.common.enums.TaskIsOrderEnum;
import com.yeejoin.amos.maintenance.common.enums.*;
import com.yeejoin.amos.maintenance.core.common.request.CommonPageable;
import com.yeejoin.amos.maintenance.core.common.request.CommonRequest;
import com.yeejoin.amos.maintenance.core.common.response.AppPointCheckRespone;
......@@ -52,10 +20,23 @@ import com.yeejoin.amos.maintenance.dao.entity.Point;
import com.yeejoin.amos.maintenance.dao.entity.PointClassify;
import com.yeejoin.amos.maintenance.exception.YeeException;
import com.yeejoin.amos.maintenance.feign.RemoteSecurityService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import javax.servlet.http.HttpServletResponse;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
@RestController
@RequestMapping(value = "/api/planTask")
......@@ -74,7 +55,6 @@ public class PlanTaskController extends AbstractBaseController {
@Autowired
private RemoteSecurityService remoteSecurityService;
private String loginOrgCode;
/**
* 计划执行查询
......@@ -259,12 +239,11 @@ public class PlanTaskController extends AbstractBaseController {
@ApiParam(value = "巡检点编号", required = true) @RequestParam(required = true) String serial,
@ApiParam(value = "参数", required = false) @RequestParam(required = false) Long planTaskId) {
try {
HashMap<String, Object> params = new HashMap<String, Object>();
HashMap<String, Object> params = new HashMap<>();
ReginParams reginParams = getSelectedOrgInfo();
String loginOrgCode = getOrgCode(reginParams);
params.put("orgCode", loginOrgCode);
String pointNo = serial;
params.put("pointNo", pointNo);
params.put("pointNo", serial);
Point point = pointService.queryPointByPointNo(params);
// 1.通用校验
if (point == null) {
......@@ -454,32 +433,23 @@ public class PlanTaskController extends AbstractBaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "根据计划任务ID查询计划任务详情和任务点(<font color='blue'>手机app</font>)", notes = "根据计划任务ID查询计划任务详情和任务点(<font color='blue'>手机app</font>)")
@RequestMapping(value = "/queryPlanTaskById", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
@RequestMapping(value = "/point/{planTaskId}/list", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public CommonResponse qryPlanTaskById(
@ApiParam(value = "巡检计划任务ID", required = true) @RequestParam(required = true) Long planTaskId) {
try {
Map<String, Object> response = new HashMap<String, Object>();
Map task = planTaskService.queryPlanTaskById(planTaskId);
if (ObjectUtils.isEmpty(task) || ObjectUtils.isEmpty(task.get("planTaskId"))) {
return CommonResponseUtil.failure("该计划已刷新,请重新选择!!!");
}
List points = planTaskService.getPlanTaskPoints(planTaskId);
// SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
// task.put("checkDate", task.get("checkDate").toString());
String[] userIds = task.get("userId").toString().split(",");
for (String userId : userIds) {
task.put("userId", userId);
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
task.put("checkDate", sdf.format(task.get("checkDate") != null ? sdf.parse(task.get("checkDate").toString()) : new Date()));
response.put("planTask", task);
response.put("points", points);
return CommonResponseUtil.success(response);
} catch (Exception e) {
return CommonResponseUtil.failure(e.getMessage());
}
@ApiParam(value = "巡检计划任务ID", required = true) @PathVariable Long planTaskId,
@ApiParam(value = "建筑id", required = true) @RequestParam(value = "buildingId",required = false) String buildingId,
@ApiParam(value = "维保状态", required = true) @RequestParam(value = "isFinish",required = false) String isFinish,
@ApiParam(value = "消防系统id", required = true) @RequestParam(value = "systemId",required = false) String systemId,
@ApiParam(value = "设备编号", required = true) @RequestParam(value = "pointNo",required = false) String pointNo,
@ApiParam(value = "设备名称", required = true) @RequestParam(value = "pointName",required = false) String pointName
) {
Map<String,Object> param = new HashMap<>();
param.put("planTaskId",planTaskId);
param.put("buildingId",buildingId);
param.put("isFinish",isFinish);
param.put("systemId",systemId);
param.put("pointNo",pointNo);
param.put("pointName",pointName);
return CommonResponseUtil.success(planTaskService.getPlanTaskPoints(param));
}
/**
......@@ -489,7 +459,7 @@ public class PlanTaskController extends AbstractBaseController {
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "维保任务查询-mobile", notes = "根据用户条件查询所有计划任务")
@ApiOperation(value = "维保任务查询-mobile", notes = "根据用户条件查询所有计划任务-mobile")
@RequestMapping(value = "/queryPlanTask", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public CommonResponse qryLoginUserPlanTask(
@ApiParam(value = "人员") @RequestParam(value = "userId", required = false) Long userId,
......@@ -500,7 +470,7 @@ public class PlanTaskController extends AbstractBaseController {
@ApiParam(value = "业主单位") @RequestParam(value = "companyId", required = false) String companyId,
@ApiParam(value = "当前页") @RequestParam(value = "pageNumber") int pageNumber,
@ApiParam(value = "页大小") @RequestParam(value = "pageSize") int pageSize) throws Exception {
HashMap<String, Object> params = new HashMap<String, Object>();
HashMap<String, Object> params = new HashMap<>();
ReginParams reginParams = getSelectedOrgInfo();
String loginOrgCode = getOrgCode(reginParams);
Map<String, Object> authMap = Bean.BeantoMap(reginParams.getPersonIdentity());
......@@ -513,11 +483,7 @@ public class PlanTaskController extends AbstractBaseController {
params.put("finishStatus", finishStatus);
params.put("orderBy", OrderByEnum.getEumByCode(orderBy).getOderBy());
CommonPageable pageable = new CommonPageable(pageNumber, pageSize);
try {
return CommonResponseUtil.success(planTaskService.getPlanTasks(params, pageable));
} catch (Exception e) {
return CommonResponseUtil.failure(e.getMessage());
}
}
......@@ -687,4 +653,21 @@ public class PlanTaskController extends AbstractBaseController {
return CommonResponseUtil.failure(e.getMessage());
}
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "查询维保设施,检查内容详情")
@GetMapping(value = "/task-point-detail")
public CommonResponse planTaskPointDetail(
@RequestParam(value = "routePointId") String routePointId,
@RequestParam(value = "id") String planTaskDetailId
){
return CommonResponseUtil.success(planTaskService.planTaskPointDetail(planTaskDetailId,routePointId));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "维保设施完成状态下拉枚举数据")
@GetMapping(value = "/taskDetail/finishStatus/list")
public CommonResponse planTaskPointDetail(){
return CommonResponseUtil.success(PlanTaskDetailIsFinishEnum.getEnumList());
}
}
......@@ -32,4 +32,6 @@ public interface InputItemMapper {
List<PointInputItemVo> queryCustomInputItemByPointId(@Param("pointId") Long pointId, @Param("equipmentId") String equipmentName);
Integer insertList(List<InputItem> list);
List<Map<String, Object>> queryInputItemInRountPoint(String routePointId);
}
......@@ -77,10 +77,10 @@ public interface PlanTaskMapper extends BaseMapper {
Map queryPlanTaskById(@Param(value="planTaskId") Long planTaskId);
/**
* 通过计划任务Id获取任务所有点信息
* @param planTaskId
* @param param
* @return
*/
List getPlanTaskPoints(@Param(value="planTaskId") Long planTaskId);
List<Map<String,Object>> getPlanTaskPoints(Map<String, Object> param);
/**
* 获取用户当前所有可以做的任务个数
* @param userId
......
......@@ -15,8 +15,6 @@ public interface IRoutePointDao extends BaseDao<RoutePoint, Long> {
@Query(value = "SELECT COUNT( point_id ) FROM `p_route_point` where route_id = ?1", nativeQuery = true)
int countRoutePoint(Long routeId);
@Query(value = "SELECT * FROM `p_route_point` where point_id = ?1", nativeQuery = true)
List<RoutePoint> queryByPointId(Long pointId);
@Query(value = "SELECT IfNULL(max(order_no),0) FROM `p_route_point` where route_id = ?1", nativeQuery = true)
int maxRoutePointOrderNo(Long routeId);
......@@ -38,11 +36,6 @@ public interface IRoutePointDao extends BaseDao<RoutePoint, Long> {
@Query(value = "select point_id from p_route_point WHERE route_id = ?1", nativeQuery = true)
List<Long> findAllByRouteId(Long routeId);
@Modifying
@Transactional
@Query(value = "delete from p_route_point WHERE point_id in (?1)", nativeQuery = true)
void delRoutePointByPointId(List<Long> pointIds);
@Query(value = "SELECT id FROM p_route_point WHERE point_id IN (?1)", nativeQuery = true)
List<BigInteger> queryRoutePointByPointId(List<Long> pointIds);
......
......@@ -15,6 +15,10 @@ public class CheckInputParam {
return checkInputImg;
}
public CheckInputParam(String inputValue){
this.inputValue = inputValue;
}
public void setCheckInputImg(List<String> checkInputImg) {
this.checkInputImg = checkInputImg;
}
......
......@@ -398,7 +398,7 @@ public class CheckServiceImpl implements ICheckService {
checkDao.deleteBatch(list);
}
private CheckInput paraseText(CheckInput checkInput, String json, CheckInputParam item, String isScore) {
public static CheckInput paraseText(CheckInput checkInput, String json, CheckInputParam item, String isScore) {
JSONObject jsonObject = JSONObject.parseObject(json);
String checkType = jsonObject.getString("CheckType");
int score = 0;
......@@ -431,7 +431,7 @@ public class CheckServiceImpl implements ICheckService {
return checkInput;
}
private CheckInput paraseNumber(CheckInput checkInput, String json, CheckInputParam item, String isScore) {
public static CheckInput paraseNumber(CheckInput checkInput, String json, CheckInputParam item, String isScore) {
JSONObject jsonObject = JSONObject.parseObject(json);
String OkUpStr = jsonObject.get("OkUp").toString();
;
......@@ -472,7 +472,7 @@ public class CheckServiceImpl implements ICheckService {
return checkInput;
}
private CheckInput paraseSelect(CheckInput checkInput, String json, CheckInputParam item, String isScore) {
public static CheckInput paraseSelect(CheckInput checkInput, String json, CheckInputParam item, String isScore) {
JSONArray jsonArray = JSONArray.parseArray(json);
int score = 0;
if (!ObjectUtils.isEmpty(jsonArray)) {
......
......@@ -2,10 +2,12 @@ package com.yeejoin.amos.maintenance.business.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.maintenance.business.constants.XJConstant;
import com.yeejoin.amos.maintenance.business.dao.mapper.InputItemMapper;
import com.yeejoin.amos.maintenance.business.dao.mapper.RouteMapper;
import com.yeejoin.amos.maintenance.business.dao.repository.IInputItemDao;
import com.yeejoin.amos.maintenance.business.dao.repository.IPointInputItemDao;
import com.yeejoin.amos.maintenance.business.param.CheckInputParam;
import com.yeejoin.amos.maintenance.business.param.InputItemPageParam;
import com.yeejoin.amos.maintenance.business.service.intfc.ICatalogTreeService;
import com.yeejoin.amos.maintenance.business.service.intfc.IInputItemService;
......@@ -14,10 +16,9 @@ import com.yeejoin.amos.maintenance.business.vo.InputItemTemplateVo;
import com.yeejoin.amos.maintenance.business.vo.InputItemVo;
import com.yeejoin.amos.maintenance.business.vo.PointInputItemVo;
import com.yeejoin.amos.maintenance.core.util.query.BaseQuerySpecification;
import com.yeejoin.amos.maintenance.dao.entity.CatalogTree;
import com.yeejoin.amos.maintenance.dao.entity.CheckInput;
import com.yeejoin.amos.maintenance.dao.entity.InputItem;
import com.yeejoin.amos.maintenance.feign.RemoteSecurityService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
......@@ -230,4 +231,18 @@ public class InputItemServiceImpl implements IInputItemService {
return inputItemMapper.insertList(list);
}
@Override
public Boolean checkIsOk(Long inputItemId, String inputValue) {
InputItem inputItem = inputItemDao.findById(inputItemId).orElseThrow(() -> new RuntimeException("检查项不存在"));
CheckInput checkInput = new CheckInput();
if (XJConstant.INPUT_ITEM_SELECT.equals(inputItem.getItemType())) {
CheckServiceImpl.paraseSelect(checkInput, inputItem.getDataJson(), new CheckInputParam(inputValue), inputItem.getIsScore());
} else if (XJConstant.INPUT_ITEM_NUMBER.equals(inputItem.getItemType())) {
CheckServiceImpl.paraseNumber(checkInput, inputItem.getDataJson(), new CheckInputParam(inputValue), inputItem.getIsScore());
} else if (XJConstant.INPUT_ITEM_TEXT.equals(inputItem.getItemType())) {
CheckServiceImpl.paraseText(checkInput, inputItem.getDataJson(), new CheckInputParam(inputValue), inputItem.getIsScore());
}
return checkInput.getIsOk().equals(XJConstant.OK);
}
}
......@@ -7,13 +7,13 @@ import com.google.common.base.Joiner;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.DepartmentModel;
import com.yeejoin.amos.maintenance.business.constants.XJConstant;
import com.yeejoin.amos.maintenance.business.dao.mapper.InputItemMapper;
import com.yeejoin.amos.maintenance.business.dao.mapper.PlanMapper;
import com.yeejoin.amos.maintenance.business.dao.mapper.PlanTaskDetailMapper;
import com.yeejoin.amos.maintenance.business.dao.mapper.PlanTaskMapper;
import com.yeejoin.amos.maintenance.business.dao.repository.*;
import com.yeejoin.amos.maintenance.business.entity.mybatis.CheckChkExListBo;
import com.yeejoin.amos.maintenance.business.entity.mybatis.PointCheckDetailBo;
import com.yeejoin.amos.maintenance.business.feign.Business;
import com.yeejoin.amos.maintenance.business.feign.EquipFeign;
import com.yeejoin.amos.maintenance.business.param.CheckPtListPageParam;
import com.yeejoin.amos.maintenance.business.param.PlanTaskPageParam;
......@@ -30,15 +30,13 @@ import com.yeejoin.amos.maintenance.core.common.response.AppCheckInputRespone;
import com.yeejoin.amos.maintenance.core.common.response.AppPointCheckRespone;
import com.yeejoin.amos.maintenance.core.util.DateUtil;
import com.yeejoin.amos.maintenance.core.util.StringUtil;
import com.yeejoin.amos.maintenance.dao.entity.Check;
import com.yeejoin.amos.maintenance.dao.entity.Plan;
import com.yeejoin.amos.maintenance.dao.entity.PlanTask;
import com.yeejoin.amos.maintenance.dao.entity.PlanTaskDetail;
import com.yeejoin.amos.maintenance.dao.entity.*;
import com.yeejoin.amos.maintenance.exception.YeeException;
import com.yeejoin.amos.maintenance.feign.RemoteSecurityService;
import com.yeejoin.amos.maintenance.quartz.IJobService;
import org.apache.commons.collections.CollectionUtils;
import org.assertj.core.util.Lists;
import org.omg.CORBA.OBJ_ADAPTER;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -85,10 +83,16 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
private ICheckService checkService;
@Autowired
private Business business;
private EquipFeign equipFeign;
@Autowired
private EquipFeign equipFeign;
IPointDao iPointDao;
@Autowired
IPlanTaskDetailDao iPlanTaskDetailDao;
@Autowired
InputItemMapper inputItemMapper;
@Override
public Page<HashMap<String, Object>> getPlanTaskInfo(PlanTaskPageParam params) {
......@@ -582,8 +586,8 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
}
@Override
public List getPlanTaskPoints(Long planTaskId) {
return planTaskMapper.getPlanTaskPoints(planTaskId);
public List getPlanTaskPoints(Map<String, Object> param) {
return planTaskMapper.getPlanTaskPoints(param);
}
@Override
......@@ -1009,4 +1013,34 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
}
return result;
}
@Override
public Map<String, Object> planTaskPointDetail(String planTaskDetailId, String routePointId) {
Map<String,Object> result = new LinkedHashMap<>();
Optional<RoutePoint> rOp = iRoutePointDao.findById(Long.parseLong(routePointId));
RoutePoint routePoint = rOp.orElseThrow(()->new RuntimeException("计划清单不存在该点"));
Point point = iPointDao.findById(routePoint.getPointId()).orElseThrow(()->new RuntimeException("维保项不存在"));
PlanTaskDetail planTaskDetail = iPlanTaskDetailDao.findById(Long.parseLong(planTaskDetailId)).orElseThrow(()->new RuntimeException("任务不存在"));
PlanTask planTask = iplanTaskDao.findById(planTaskDetail.getTaskNo()).orElseThrow(()->new RuntimeException("主任务不存在"));
Map<String,Object> facility = this.buildFacilityDetail(point,planTask);
List<Map<String, Object>> itemList = this.buildCheckInputItem(routePointId);
result.put("facility",facility);
result.put("itemList",itemList);
return result;
}
private List<Map<String, Object>> buildCheckInputItem(String routePointId) {
return inputItemMapper.queryInputItemInRountPoint(routePointId);
}
private Map<String, Object> buildFacilityDetail(Point point, PlanTask planTask) {
Map<String,Object> facility = new LinkedHashMap<>();
facility.put("name",point.getName());
facility.put("pointId",point.getId());
facility.put("point_no",point.getPointNo());
facility.put("position",point.getBuildingName() + point.getAddress());
facility.put("userName",planTask.getUserName());
facility.put("riskAndManage",point.getRemark());
return facility;
}
}
......@@ -112,4 +112,6 @@ public interface IInputItemService {
Boolean uploadListByTemplate(List<InputItemTemplateVo> itemTemplateVoList, String orgCode, String userId) throws Exception;
Integer insertList(List<InputItem> list);
Boolean checkIsOk(Long inputItemId, String inputValue);
}
......@@ -91,10 +91,10 @@ public interface IPlanTaskService {
/**
* 根据计划ID获取所有的 任务计划巡检点
* @param planTaskId
* @param param
* @return
*/
List getPlanTaskPoints(Long planTaskId);
List getPlanTaskPoints(Map<String, Object> param);
/**
* 获取用户当前所有有的计划任务
......@@ -149,4 +149,13 @@ public interface IPlanTaskService {
List<Map<String,Object>> queryPlanTaskTimeAxis(Long userId,Integer createDate);
List<Map<String,Object>> queryTimeAxis(Long userId,Integer createDate);
/**
* 任务点详情
*
* @param planTaskDetailId 子表id
* @param routePointId 关系表id
* @return Map<String, Object>
*/
Map<String, Object> planTaskPointDetail(String planTaskDetailId, String routePointId);
}
......@@ -9,11 +9,15 @@ import com.google.common.collect.Maps;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.biz.common.utils.ExcelUtils;
import com.yeejoin.amos.boot.biz.common.utils.NameUtils;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.common.api.dto.OrgPersonExcelDto;
import com.yeejoin.amos.boot.module.common.api.excel.ExcelUtil;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCallInfoDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledObjsDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledQueryDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.ESAlertCalledDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.ESAlertCalledRequestDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.AlertCalled;
......@@ -28,13 +32,16 @@ import com.yeejoin.amos.boot.module.tzs.biz.utils.AlertBeanDtoVoUtils;
import com.yeejoin.amos.boot.module.tzs.biz.utils.BeanDtoVoUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.openxml4j.opc.internal.FileHelper;
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.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
......@@ -44,6 +51,7 @@ import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletResponse;
import java.lang.reflect.Field;
import java.text.ParseException;
import java.util.Arrays;
......@@ -341,4 +349,30 @@ public class AlertCalledController extends BaseController {
}
}
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "查询警情事件记录", notes = "查询警情事件记录")
@PostMapping("/selectRecord")
public ResponseModel<Page<AlertCalledQueryDto>> queryAlertCalledByPager(@RequestBody AlertCalledQueryDto alertCalledQueryDto) {
List<AlertCalledQueryDto> list = iAlertCalledService.queryAlertListByQueryDto(alertCalledQueryDto);
Page<AlertCalledQueryDto> result = new Page<AlertCalledQueryDto>(alertCalledQueryDto.getPageNum(), alertCalledQueryDto.getPageSize());
long totle = list.size();
result.setRecords(list);
result.setTotal(totle);
return ResponseHelper.buildResponse(result);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "导出警情事件记录", notes = "导出警情事件记录")
@PostMapping("/exportSelectRecord")
public void exportAlertCalled(@RequestBody AlertCalledQueryDto alertCalledQueryDto, HttpServletResponse response) {
List<AlertCalledQueryDto> list = iAlertCalledService.queryAlertListByQueryDto(alertCalledQueryDto);
String fileName = "警情事件记录" + new Date().getTime();
ExcelUtil.createTemplate(response, fileName, "警情事件记录", list,
AlertCalledQueryDto.class, null, false);
}
}
......@@ -70,33 +70,4 @@ public class RescueProcessController extends BaseController {
return ResponseHelper.buildResponse(rescueProcessServiceImpl.getProcessByAlertId(alertId));
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "救援过程表分页查询", notes = "救援过程表分页查询")
public ResponseModel<Page<RescueProcessDto>> queryForPage(@RequestParam(value = "current") int current,@RequestParam
(value = "size") int size) {
Page<RescueProcessDto> page = new Page<RescueProcessDto>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(rescueProcessServiceImpl.queryForRescueProcessPage(page));
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "救援过程表列表全部数据查询", notes = "救援过程表列表全部数据查询")
@GetMapping(value = "/list")
public ResponseModel<List<RescueProcessDto>> selectForList() {
return ResponseHelper.buildResponse(rescueProcessServiceImpl.queryForRescueProcessList());
}
}
package com.yeejoin.amos.boot.module.tzs.biz.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Maps;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
......@@ -9,13 +12,17 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledFormDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledObjsDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledQueryDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.ESAlertCalledDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.FormValue;
import com.yeejoin.amos.boot.module.tzs.api.entity.AlertCalled;
import com.yeejoin.amos.boot.module.tzs.api.entity.AlertFormValue;
import com.yeejoin.amos.boot.module.tzs.api.entity.ESAlertCalled;
import com.yeejoin.amos.boot.module.tzs.api.entity.Elevator;
import com.yeejoin.amos.boot.module.tzs.api.entity.RepairConsult;
import com.yeejoin.amos.boot.module.tzs.api.entity.Template;
import com.yeejoin.amos.boot.module.tzs.api.enums.AlertStageEnums;
import com.yeejoin.amos.boot.module.tzs.api.enums.AlertStatusEnum;
import com.yeejoin.amos.boot.module.tzs.api.mapper.AlertCalledMapper;
import com.yeejoin.amos.boot.module.tzs.api.service.IAlertCalledService;
import com.yeejoin.amos.boot.module.tzs.biz.utils.AlertBeanDtoVoUtils;
......@@ -23,14 +30,22 @@ import com.yeejoin.amos.boot.module.tzs.biz.utils.BeanDtoVoUtils;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.QueryBuilders;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.elasticsearch.core.SearchHit;
import org.springframework.data.elasticsearch.core.SearchHits;
import org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
......@@ -62,9 +77,6 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
private ElevatorServiceImpl iElevatorService;
@Autowired
private RepairConsultServiceImpl repairConsultService;
@Autowired
AlertCalledMapper alertCalledMapper;
@Autowired
......@@ -151,6 +163,22 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
return alertCalledFormVo;
}
@Override
public List<AlertCalledQueryDto> queryAlertListByQueryDto(AlertCalledQueryDto alertCalledQueryDto) {
List<AlertCalledQueryDto> list = alertCalledMapper.queryAlertListByQueryDto(alertCalledQueryDto);
return list;
}
@Override
public Boolean updateAlertStageByAlertId(Long alertId, String alertStage) {
UpdateWrapper<AlertCalled> updateWrapper = new UpdateWrapper<>();
updateWrapper.eq("sequence_nbr",alertId);
AlertStageEnums stage = AlertStageEnums.getEnumByCode(alertStage);
updateWrapper.set("alert_stage_code",stage.getId());
updateWrapper.set("alert_stage",stage.getValue());
return this.update(updateWrapper);
}
/**
*
......
......@@ -198,7 +198,8 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
rescueProcessDto.setDispatchTime(dispatchPaper.getDispatchTime());
rescueProcessServiceImpl.updateByAlertId(rescueProcessDto,null);
}
// 修改警情到派遣阶段
alertCalledServiceImpl.updateAlertStageByAlertId(alertId,"PQ");
return dispatchPaperFormDto;
}
......@@ -287,11 +288,11 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
dispatchSaveFeedbackDto.setSaveFeedbackResult(value);
break;
case "fix_result":
value = alertFormValue.getFieldValue();
value = alertFormValue.getFieldValueCode();
dispatchSaveFeedbackDto.setFixResult(value);
break;
case "error_result":
value = alertFormValue.getFieldValue();
value = alertFormValue.getFieldValueCode();
dispatchSaveFeedbackDto.setErrorResult(value);
break;
}
......@@ -313,8 +314,15 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
dynamicFormAlert.stream().forEach(alertFormValue -> {
switch (alertFormValue.getFieldCode()) {
case "save_feedback_time":
if (dispatchSaveFeedbackDto.getSaveFeedbackTime() != null)
if (dispatchSaveFeedbackDto.getSaveFeedbackTime() != null) {
if(alertFormValue.getFieldValue() == null ) {
// 坐席回访
repairConsultServiceImpl.saveRepairConsultByAlertIdType(dispatchSaveFeedbackDto.getAlertId(),"JYHF",null,user);
// 修改警情到救援反馈
alertCalledServiceImpl.updateAlertStageByAlertId(dispatchSaveFeedbackDto.getAlertId(),"JYHF");
}
alertFormValue.setFieldValue(sdf.format(dispatchSaveFeedbackDto.getSaveFeedbackTime()));
}
break;
case "save_feedback_user":
if (StringUtils.isNotBlank(dispatchSaveFeedbackDto.getSaveFeedbackUser()))
......@@ -330,19 +338,19 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
break;
case "fix_result":
if (StringUtils.isNotBlank(dispatchSaveFeedbackDto.getFixResult())) {
alertFormValue.setFieldValue(dispatchSaveFeedbackDto.getFixResult());
QueryWrapper<DataDictionary> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("type", "WXJG").eq("name", dispatchSaveFeedbackDto.getFixResult());
queryWrapper.eq("type", "WXJG").eq("code", dispatchSaveFeedbackDto.getFixResult());
DataDictionary fixResult = iDataDictionaryService.getOne(queryWrapper);
alertFormValue.setFieldValue(fixResult.getName());
alertFormValue.setFieldValueCode(fixResult.getCode());
}
break;
case "error_result":
if (StringUtils.isNotBlank(dispatchSaveFeedbackDto.getErrorResult())) {
alertFormValue.setFieldValue(dispatchSaveFeedbackDto.getErrorResult());
QueryWrapper<DataDictionary> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("type", "GZYY").eq("name", dispatchSaveFeedbackDto.getErrorResult());
queryWrapper.eq("type", "GZYY").eq("code", dispatchSaveFeedbackDto.getErrorResult());
DataDictionary errorResult = iDataDictionaryService.getOne(queryWrapper);
alertFormValue.setFieldValue(errorResult.getName());
alertFormValue.setFieldValueCode(errorResult.getCode());
}
break;
......@@ -354,19 +362,21 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
dispatchPaper.setFeedbackUid(dispatchSaveFeedbackDto.getFeedbackUid());
dispatchPaper.setFeedbackUname(dispatchSaveFeedbackDto.getFeedbackUname());
dispatchPaper.setRemark(dispatchSaveFeedbackDto.getRemark());
dispatchPaper.setFeedbackTime(dispatchSaveFeedbackDto.getFeedbackTime());
// 保存动态表单数据
iAlertFormValueService.updateBatchById(dynamicFormAlert);
// 保存派遣表
flag = this.updateById(dispatchPaper);
// 坐席回访
repairConsultServiceImpl.saveRepairConsultByAlertIdType(dispatchSaveFeedbackDto.getAlertId(),"JYHF",null,user);
if(dispatchPaper.getFeedbackTime() == null && dispatchSaveFeedbackDto.getFeedbackTime() != null) {
// 维修反馈
Long taskId = dispatchPaper.getRepairOrgTaskId() != null ? dispatchPaper.getRepairOrgTaskId() : dispatchPaper.getUseOrgTaskId();
if(taskId == null) {
throw new BadRequest("未找到反馈任务单");
}
// 维修反馈
repairConsultServiceImpl.saveRepairConsultByAlertIdType(dispatchSaveFeedbackDto.getAlertId(),"WXFK",taskId,user);
// 修改警情到维修反馈
alertCalledServiceImpl.updateAlertStageByAlertId(dispatchSaveFeedbackDto.getAlertId(),"WXFK");
}
dispatchPaper.setFeedbackTime(dispatchSaveFeedbackDto.getFeedbackTime());
// 保存动态表单数据
iAlertFormValueService.updateBatchById(dynamicFormAlert);
// 保存派遣表
flag = this.updateById(dispatchPaper);
return flag;
}
......@@ -443,7 +453,7 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
dispatchRepairFeedbackDto.setFeedbackResult(value);
break;
case "fix_feedback_type":// 保修反馈方式
value = alertFormValue.getFieldValue();
value = alertFormValue.getFieldValueCode();
dispatchRepairFeedbackDto.setFixFeedbackType(value);
break;
case "fix_feedback_uname":
......@@ -463,11 +473,11 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
}
break;
case "fix_result":
value = alertFormValue.getFieldValue();
value = alertFormValue.getFieldValueCode();
dispatchRepairFeedbackDto.setFixResult(value);
break;
case "error_result":
value = alertFormValue.getFieldValue();
value = alertFormValue.getFieldValueCode();
dispatchRepairFeedbackDto.setErrorResult(value);
break;
case "fix_remark":
......@@ -493,24 +503,35 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
dynamicFormAlert.stream().forEach(alertFormValue -> {
switch (alertFormValue.getFieldCode()) {
case "fix_feedback_time":
if (dispatchRepairFeedbackDto.getFixFeedbackTime() != null)
if (dispatchRepairFeedbackDto.getFixFeedbackTime() != null) {
if(alertFormValue.getFieldValue() == null) {
// 报修反馈
Long taskId = dispatchPaper.getRepairOrgTaskId() != null ? dispatchPaper.getRepairOrgTaskId() : dispatchPaper.getUseOrgTaskId();
if(taskId == null) {
throw new BadRequest("未找到反馈任务单");
}
// 修改警情到报修反馈
alertCalledServiceImpl.updateAlertStageByAlertId(dispatchRepairFeedbackDto.getAlertId(),"BXFK");
repairConsultServiceImpl.saveRepairConsultByAlertIdType(dispatchRepairFeedbackDto.getAlertId(),"BXFK",taskId,user);
}
alertFormValue.setFieldValue(sdf.format(dispatchRepairFeedbackDto.getFixFeedbackTime()));
}
break;
case "feedback_result":
if (StringUtils.isNotBlank(dispatchRepairFeedbackDto.getFeedbackResult())) {
alertFormValue.setFieldValue(dispatchRepairFeedbackDto.getFeedbackResult());
QueryWrapper<DataDictionary> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("type", "FKJG").eq("name", dispatchRepairFeedbackDto.getFeedbackResult());
queryWrapper.eq("type", "FKJG").eq("code", dispatchRepairFeedbackDto.getFeedbackResult());
DataDictionary feedbackType = iDataDictionaryService.getOne(queryWrapper);
alertFormValue.setFieldValue(feedbackType.getName());
alertFormValue.setFieldValueCode(feedbackType.getCode());
}
break;
case "fix_feedback_type":
if (StringUtils.isNotBlank(dispatchRepairFeedbackDto.getFixFeedbackType())) {
alertFormValue.setFieldValue(dispatchRepairFeedbackDto.getFixFeedbackType());
QueryWrapper<DataDictionary> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("type", "FKFS").eq("name", dispatchRepairFeedbackDto.getFixFeedbackType());
queryWrapper.eq("type", "FKFS").eq("code", dispatchRepairFeedbackDto.getFixFeedbackType());
DataDictionary feedbackType = iDataDictionaryService.getOne(queryWrapper);
alertFormValue.setFieldValue(feedbackType.getName());
alertFormValue.setFieldValueCode(feedbackType.getCode());
}
break;
......@@ -524,19 +545,19 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
break;
case "fix_result":
if (StringUtils.isNotBlank(dispatchRepairFeedbackDto.getFixResult())) {
alertFormValue.setFieldValue(dispatchRepairFeedbackDto.getFixResult());
QueryWrapper<DataDictionary> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("type", "WXJG").eq("name", dispatchRepairFeedbackDto.getFixResult());
queryWrapper.eq("type", "WXJG").eq("code", dispatchRepairFeedbackDto.getFixResult());
DataDictionary fixResult = iDataDictionaryService.getOne(queryWrapper);
alertFormValue.setFieldValue(fixResult.getName());
alertFormValue.setFieldValueCode(fixResult.getCode());
}
break;
case "error_result":
if (StringUtils.isNotBlank(dispatchRepairFeedbackDto.getErrorResult())) {
alertFormValue.setFieldValue(dispatchRepairFeedbackDto.getErrorResult());
QueryWrapper<DataDictionary> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("type", "GZYY").eq("name", dispatchRepairFeedbackDto.getErrorResult());
queryWrapper.eq("type", "GZYY").eq("code", dispatchRepairFeedbackDto.getErrorResult());
DataDictionary errorResult = iDataDictionaryService.getOne(queryWrapper);
alertFormValue.setFieldValue(errorResult.getName());
alertFormValue.setFieldValueCode(errorResult.getCode());
}
break;
......@@ -552,17 +573,21 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
dispatchPaper.setFeedbackUid(dispatchRepairFeedbackDto.getFeedbackUid());
dispatchPaper.setFeedbackUname(dispatchRepairFeedbackDto.getFeedbackUname());
dispatchPaper.setRemark(dispatchRepairFeedbackDto.getRemark());
if(dispatchPaper.getFeedbackTime() == null && dispatchRepairFeedbackDto.getFeedbackTime() != null) {
// 维修反馈
Long taskId = dispatchPaper.getRepairOrgTaskId() != null ? dispatchPaper.getRepairOrgTaskId() : dispatchPaper.getUseOrgTaskId();
if(taskId == null) {
throw new BadRequest("未找到反馈任务单");
}
// 修改警情到维修反馈
alertCalledServiceImpl.updateAlertStageByAlertId(dispatchRepairFeedbackDto.getAlertId(),"WXFK");
repairConsultServiceImpl.saveRepairConsultByAlertIdType(dispatchRepairFeedbackDto.getAlertId(),"WXFK",taskId,user);
}
dispatchPaper.setFeedbackTime(dispatchRepairFeedbackDto.getFeedbackTime());
// 保存动态表单数据
iAlertFormValueService.updateBatchById(dynamicFormAlert);
// 保存派遣表
flag = this.updateById(dispatchPaper);
// 报修反馈
Long taskId = dispatchPaper.getRepairOrgTaskId() != null ? dispatchPaper.getRepairOrgTaskId() : dispatchPaper.getUseOrgTaskId();
if(taskId == null) {
throw new BadRequest("未找到反馈任务单");
}
repairConsultServiceImpl.saveRepairConsultByAlertIdType(dispatchRepairFeedbackDto.getAlertId(),"BXFK",taskId,user);
return flag;
}
......@@ -644,7 +669,7 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
dispatchConsultFeedbackDto.setFeedbackResult(value);
break;
case "consult_feedback_type":// 咨询反馈方式
value = alertFormValue.getFieldValue();
value = alertFormValue.getFieldValueCode();
dispatchConsultFeedbackDto.setConsultFeedbackType(value);
break;
case "consult_feedback_uname":
......@@ -685,24 +710,35 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
dynamicFormAlert.stream().forEach(alertFormValue -> {
switch (alertFormValue.getFieldCode()) {
case "consult_feedback_time":
if (dispatchConsultFeedbackDto.getConsultFeedbackTime() != null)
if (dispatchConsultFeedbackDto.getConsultFeedbackTime() != null) {
if(alertFormValue.getFieldValue() == null ) {
// 投诉人反馈
Long taskId = dispatchPaper.getRepairOrgTaskId() != null ? dispatchPaper.getRepairOrgTaskId() : dispatchPaper.getUseOrgTaskId();
if(taskId == null) {
throw new BadRequest("未找到反馈任务单");
}
// 修改警情到投诉人反馈
alertCalledServiceImpl.updateAlertStageByAlertId(dispatchConsultFeedbackDto.getAlertId(),"TSRFK");
repairConsultServiceImpl.saveRepairConsultByAlertIdType(dispatchConsultFeedbackDto.getAlertId(),"TSRFK",taskId,user);
}
alertFormValue.setFieldValue(sdf.format(dispatchConsultFeedbackDto.getConsultFeedbackTime()));
}
break;
case "action_result":
if (StringUtils.isNotBlank(dispatchConsultFeedbackDto.getActionResult())) {
alertFormValue.setFieldValue(dispatchConsultFeedbackDto.getActionResult());
QueryWrapper<DataDictionary> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("type", "CZJG").eq("name", dispatchConsultFeedbackDto.getActionResult());
queryWrapper.eq("type", "CZJG").eq("code", dispatchConsultFeedbackDto.getActionResult());
DataDictionary feedbackType = iDataDictionaryService.getOne(queryWrapper);
alertFormValue.setFieldValue(feedbackType.getName());
alertFormValue.setFieldValueCode(feedbackType.getCode());
}
break;
case "consult_feedback_type":
if (StringUtils.isNotBlank(dispatchConsultFeedbackDto.getConsultFeedbackType())) {
alertFormValue.setFieldValue(dispatchConsultFeedbackDto.getConsultFeedbackType());
QueryWrapper<DataDictionary> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("type", "FKFS").eq("name", dispatchConsultFeedbackDto.getConsultFeedbackType());
queryWrapper.eq("type", "FKFS").eq("code", dispatchConsultFeedbackDto.getConsultFeedbackType());
DataDictionary feedbackType = iDataDictionaryService.getOne(queryWrapper);
alertFormValue.setFieldValue(feedbackType.getName());
alertFormValue.setFieldValueCode(feedbackType.getCode());
}
break;
......@@ -720,10 +756,10 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
break;
case "feedback_result":
if (StringUtils.isNotBlank(dispatchConsultFeedbackDto.getFeedbackResult())) {
alertFormValue.setFieldValue(dispatchConsultFeedbackDto.getFeedbackResult());
QueryWrapper<DataDictionary> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("type", "FKJG").eq("name", dispatchConsultFeedbackDto.getFeedbackResult());
queryWrapper.eq("type", "FKJG").eq("code", dispatchConsultFeedbackDto.getFeedbackResult());
DataDictionary feedbackType = iDataDictionaryService.getOne(queryWrapper);
alertFormValue.setFieldValue(feedbackType.getName());
alertFormValue.setFieldValueCode(feedbackType.getCode());
}
break;
......@@ -731,6 +767,16 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
});
dispatchPaper.setFeedbackCode(dispatchConsultFeedbackDto.getFeedbackCode());
dispatchPaper.setFeedbackType(dispatchConsultFeedbackDto.getFeedbackType());
if(dispatchPaper.getFeedbackTime() == null && dispatchConsultFeedbackDto.getFeedbackTime() != null) {
// 维修反馈
Long taskId = dispatchPaper.getRepairOrgTaskId() != null ? dispatchPaper.getRepairOrgTaskId() : dispatchPaper.getUseOrgTaskId();
if(taskId == null) {
throw new BadRequest("未找到反馈任务单");
}
// 修改警情到维修反馈
alertCalledServiceImpl.updateAlertStageByAlertId(dispatchConsultFeedbackDto.getAlertId(),"WXFK");
repairConsultServiceImpl.saveRepairConsultByAlertIdType(dispatchConsultFeedbackDto.getAlertId(),"WXFK-TS",taskId,user);
}
dispatchPaper.setFeedbackTime(dispatchConsultFeedbackDto.getFeedbackTime());
dispatchPaper.setFeedbackFinishTime(dispatchConsultFeedbackDto.getFeedbackFinishTime());
dispatchPaper.setFeedbackUid(dispatchConsultFeedbackDto.getFeedbackUid());
......@@ -740,12 +786,7 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
iAlertFormValueService.updateBatchById(dynamicFormAlert);
// 保存派遣表
flag = this.updateById(dispatchPaper);
// 投诉人反馈
Long taskId = dispatchPaper.getRepairOrgTaskId() != null ? dispatchPaper.getRepairOrgTaskId() : dispatchPaper.getUseOrgTaskId();
if(taskId == null) {
throw new BadRequest("未找到反馈任务单");
}
repairConsultServiceImpl.saveRepairConsultByAlertIdType(dispatchConsultFeedbackDto.getAlertId(),"TSRFK",taskId,user);
return flag;
}
......
......@@ -200,12 +200,13 @@ public class DispatchTaskServiceImpl extends BaseService<DispatchTaskDto,Dispatc
String createTime = sdf.format(alertCalledDto.getCallTime());
String rescueCode = alertCalledDto.getDeviceId();
String emergencyCall = alertCalledDto.getEmergencyCall();
String contactPhone = alertCalledDto.getContactPhone();
String emergencyCall = alertCalledDto.getEmergencyCall() == null ? "" : alertCalledDto.getEmergencyCall();
String contactPhone = alertCalledDto.getContactPhone() == null ? "" : alertCalledDto.getContactPhone();
// 电梯数据
Elevator elevator = elevatorServiceImpl.selectByAlertId(alertId);
String address = elevator.getAddress();
String useSiteCategory = elevator.getUseSiteCategory();
String address = elevator.getAddress() == null ? "" : elevator.getAddress();
String useSiteCategory = elevator.getUseSiteCategory() == null ? "" : elevator.getUseSiteCategory() ;
String useUnit = elevator.getUseUnit();
content = content.replace("$call_time",createTime).replace("$address",address).replace("$rescue_code",rescueCode).replace("$use_site_category",useSiteCategory);
String typeCode = "";
......@@ -230,22 +231,22 @@ public class DispatchTaskServiceImpl extends BaseService<DispatchTaskDto,Dispatc
switch(alertTypeCode) {
case "KRJY" : // 困人救援
dispatchTaskDto.setIsSaveTask(true);
String trappedNum = dynamicParms.get("trapped_num");
String trappedFloorNum = dynamicParms.get("trapped_floor_num");
String isLight = dynamicParms.get("is_light");
String trappedTime = dynamicParms.get("trapped_time");
String trappedNum = dynamicParms.get("trapped_num") == null ? "" : dynamicParms.get("trapped_num");
String trappedFloorNum = dynamicParms.get("trapped_floor_num") == null ? "" : dynamicParms.get("trapped_floor_num");
String isLight = dynamicParms.get("is_light") == null ? "" : dynamicParms.get("is_light");
String trappedTime = dynamicParms.get("trapped_time") == null ? "" : dynamicParms.get("trapped_time");
content = content.replace("$trapped_num",trappedNum).replace("$trapped_floor_num",trappedFloorNum);
content = content.replace("$emergency_call",emergencyCall).replace("$contact_phone",contactPhone);
content = content.replace("$is_light",isLight).replace("$trapped_time",trappedTime);
break;
case "GZWX" : // 故障维修
dispatchTaskDto.setIsSaveTask(false);
desc = dynamicParms.get("desc");
desc = dynamicParms.get("desc") == null ? "" : dynamicParms.get("desc");
content = content.replace("$use_unit",useUnit).replace("$desc",desc);
break;
case "TSZX" : // 投诉咨询
dispatchTaskDto.setIsSaveTask(false);
desc = dynamicParms.get("desc");
desc = dynamicParms.get("desc") == null ? "" : dynamicParms.get("desc");
content = content.replace("$emergency_call",emergencyCall).replace("$contact_phone",contactPhone);
content = content.replace("$use_unit",useUnit).replace("$desc",desc);
break;
......
......@@ -11,6 +11,7 @@ import com.yeejoin.amos.boot.module.tzs.api.dto.DispatchPaperFormDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.RepairConsultDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.RescueProcessDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.AlertFormValue;
import com.yeejoin.amos.boot.module.tzs.api.entity.DispatchPaper;
import com.yeejoin.amos.boot.module.tzs.api.entity.DispatchTask;
import com.yeejoin.amos.boot.module.tzs.api.entity.RepairConsult;
import com.yeejoin.amos.boot.module.tzs.api.entity.Template;
......@@ -92,11 +93,18 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai
String emergency_call = alertCalledVo.getEmergencyCall();
String area = alertCalledVo.getAddress();
String alertType = alertCalledVo.getAlarmType();
if(createUser == null)
throw new BadRequest("坐席人缺失");
if(emergency_call == null)
throw new BadRequest("求援人缺失");
if(area == null)
throw new BadRequest("区域缺失");
if(alertType == null)
throw new BadRequest("警情类型缺失");
content = content.replace("$createTime",createTime).replace("$createUser",createUser).replace("$call",emergency_call);
content = content.replace("$area",area).replace("$alertType",alertType);
} else if("PQ".equals(type)) {
String createUser = user.getUserName();
DispatchTask dispatchTask = dispatchTaskServiceImpl.getById(taskId);
String unit = dispatchTask.getResponseOrgName();
String person = dispatchTask.getResponseUserName();
......@@ -118,6 +126,7 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai
} else if("DD".equals(type)) {
DispatchTask dispatchTask = dispatchTaskServiceImpl.getById(taskId);
String person = dispatchTask.getResponseUserName();
content = content.replace("$createTime",createTime).replace("$person",person);
RescueProcessDto rescueProcessDto = rescueProcessServiceImpl.getProcessByAlertId(alertId);
String FKFS = rescueProcessDto.getArriveFeedbackType();
content = content.replace("$FKFS",FKFS);
......@@ -132,26 +141,38 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai
String createUser = user.getUserName();
String create = alertCalledVo.getEmergencyPerson();
content = content.replace("$createTime",createTime).replace("$createUser",createUser).replace("$create",create);
} else if("WXFK".equals(type)) {
} else if("WXFK".equals(type)) { //从派遣单获取数据
DispatchTask dispatchTask = dispatchTaskServiceImpl.getById(taskId);
String person = dispatchTask.getResponseUserName();
String fix_result =
content = content.replace("$createTime",createTime).replace("$person",person);
DispatchPaperFormDto dispatchPaperFormDto = dispatchPaperServiceImpl.selectDispatchPaperDtoByAlertId(alertId);
DispatchPaper dispatchPaper = dispatchPaperFormDto.getDispatchPaper();
List<AlertFormValue> dynamicForm = dispatchPaperFormDto.getDynamicFormAlert();
Map<String,String> tempMap = new HashMap<String,String>();
dynamicForm.stream().forEach(alertFormValue -> {
if("fix_feedback_type".equals(alertFormValue.getFieldCode())) {
tempMap.put("FKFS",alertFormValue.getFieldValue());
} else if("fix_result".equals(alertFormValue.getFieldCode())) {
if("fix_result".equals(alertFormValue.getFieldCode())) {
tempMap.put("fixResult",alertFormValue.getFieldValue());
}
});
content = content.replace("$FKFS",dispatchPaper.getFeedbackType()).replace("$fixResult",tempMap.get("fixResult"));
} else if("WXFK-TS".equals(type)) { //从派遣单获取数据
DispatchTask dispatchTask = dispatchTaskServiceImpl.getById(taskId);
String person = dispatchTask.getResponseUserName();
content = content.replace("$createTime",createTime).replace("$person",person);
DispatchPaperFormDto dispatchPaperFormDto = dispatchPaperServiceImpl.selectDispatchPaperDtoByAlertId(alertId);
DispatchPaper dispatchPaper = dispatchPaperFormDto.getDispatchPaper();
List<AlertFormValue> dynamicForm = dispatchPaperFormDto.getDynamicFormAlert();
Map<String,String> tempMap = new HashMap<String,String>();
dynamicForm.stream().forEach(alertFormValue -> {
if("action_result".equals(alertFormValue.getFieldCode())) {
tempMap.put("fixResult",alertFormValue.getFieldValue());
}
});
content = content.replace("$FKFS",tempMap.get("FKFS")).replace("$fixResult",tempMap.get("fixResult"));
content = content.replace("$FKFS",dispatchPaper.getFeedbackType()).replace("$fixResult",tempMap.get("fixResult"));
type = "WXFK";
} else if("BXFK".equals(type)) {
DispatchTask dispatchTask = dispatchTaskServiceImpl.getById(taskId);
String person = dispatchTask.getResponseUserName();
String fix_result =
content = content.replace("$createTime",createTime).replace("$person",person);
DispatchPaperFormDto dispatchPaperFormDto = dispatchPaperServiceImpl.selectDispatchPaperDtoByAlertId(alertId);
List<AlertFormValue> dynamicForm = dispatchPaperFormDto.getDynamicFormAlert();
......@@ -180,7 +201,7 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai
});
content = content.replace("$FKFS",tempMap.get("FKFS")).replace("$feedbackResult",tempMap.get("action_result"));
}
repairConsult.setType(type);
repairConsult.setType(AlertStageEnums.getEnumByCode(type).getId());
repairConsult.setAlertStageCode(AlertStageEnums.getEnumByCode(type).getId());
repairConsult.setAlertStatus(AlertStageEnums.getEnumByCode(type).getValue());
repairConsult.setDescription(content);
......
......@@ -142,6 +142,13 @@ public class RescueProcessServiceImpl extends BaseService<RescueProcessDto,Rescu
repairConsultServiceImpl.saveRepairConsultByAlertIdType(dispatchTask.getAlertId(),"PQ", dispatchTask.getSequenceNbr(),sendUser);
}
}
rescueProcessDto.setSequenceNbr(rescueProcess.getSequenceNbr());
rescueProcessDto.setRecDate(rescueProcess.getRecDate());
rescueProcessDto.setRecUserId(rescueProcess.getRecUserId());
rescueProcessDto.setRecUserName(rescueProcess.getRecUserName());
rescueProcess = BeanDtoVoUtils.convert(rescueProcessDto, RescueProcess.class);
Boolean flag =this.updateById(rescueProcess);
if(rescueProcessDto.getArriveByUser()) { // 手动到达
DispatchPaperFormDto dispatchPaperDto = dispatchPaperServiceImpl.selectDispatchPaperDtoByAlertId(rescueProcessDto.getAlertId());
if (dispatchPaperDto == null || dispatchPaperDto.getDispatchPaper() == null) {
......@@ -172,11 +179,7 @@ public class RescueProcessServiceImpl extends BaseService<RescueProcessDto,Rescu
}
repairConsultServiceImpl.saveRepairConsultByAlertIdType(rescueProcessDto.getAlertId(),"JC",taskId,sendUser); //保存接警日志
}
rescueProcessDto.setSequenceNbr(rescueProcess.getSequenceNbr());
rescueProcessDto.setRecDate(rescueProcess.getRecDate());
rescueProcessDto.setRecUserId(rescueProcess.getRecUserId());
rescueProcessDto.setRecUserName(rescueProcess.getRecUserName());
rescueProcess = BeanDtoVoUtils.convert(rescueProcessDto, RescueProcess.class);
return this.updateById(rescueProcess);
return flag;
}
}
\ No newline at end of file
......@@ -16,4 +16,26 @@
ALTER TABLE p_point ADD COLUMN `last_check_id` varchar(32) DEFAULT NULL COMMENT '最近检查记录(漏检不算)' AFTER `original_id`;
</sql>
</changeSet>
<changeSet author="suhuiguang" id="1628747347004-1">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="p_point" columnName="building_id"/>
</not>
</preConditions>
<comment>p_point ADD COLUMN building_id 需求变更</comment>
<sql>
ALTER TABLE p_point ADD COLUMN `building_id` varchar(32) DEFAULT NULL COMMENT '所在建筑' AFTER `address`;
</sql>
</changeSet>
<changeSet author="suhuiguang" id="1628747347004-2">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="p_point" columnName="building_name"/>
</not>
</preConditions>
<comment>p_point ADD COLUMN building_name 需求变更</comment>
<sql>
ALTER TABLE p_point ADD COLUMN `building_name` varchar(255) DEFAULT NULL COMMENT '所在建筑名称' AFTER `building_id`;
</sql>
</changeSet>
</databaseChangeLog>
\ No newline at end of file
......@@ -230,6 +230,26 @@
and org_Code = #{orgCode}
</if>
</select>
<select id="queryInputItemInRountPoint" resultType="java.util.Map">
SELECT
pii.id,
pii.`name` inputName,
pii.item_type itemType,
pii.test_requirement testRequirement,
pii.data_json dataJson,
pii.is_must isMust,
pii.picture_json pictureJson,
pii.order_no orderNo,
prpi.id as routePointItemId
FROM
p_route_point_item prpi
LEFT JOIN p_point_inputitem ppii ON ppii.id = prpi.point_input_item_id
LEFT JOIN p_input_item pii ON pii.id = ppii.input_item_id
WHERE
prpi.route_point_id = #{routePointId}
ORDER BY
prpi.order_no
</select>
<insert id="insertList" parameterType="java.util.List">
INSERT INTO p_input_item (
`org_code`, `name`, `item_type`,
......
......@@ -336,19 +336,19 @@
where 1 = 1
<if test="planTaskId != null and planTaskId >0 "> and a.planTaskId = #{planTaskId} </if>
</select>
<select id="getPlanTaskPoints" resultType="Map">
SELECT
ptd.id,
p.name,
p.id pointId,
p.point_no pointNO,
p.offline,
p.point_no pointNo,
concat_ws(' ',p.building_name,p.address) as position,
p.belong_system_name as belongSystemName,
ptd.status,
ptd.is_finish finish,
p.is_fixed isFixed,
pt.route_id routeId,
ptd.is_finish as isFinish,
pt.route_id as routeId,
c.id checkId,
prp.order_no orderNo
prp.order_no orderNo,
prp.id as routePointId
FROM
p_plan_task_detail ptd
LEFT JOIN p_plan_task pt ON pt.id = ptd.task_no
......@@ -356,8 +356,12 @@
LEFT JOIN p_check c ON c.plan_task_detail_id = ptd.id
LEFT JOIN p_route_point prp ON prp.point_id = ptd.point_id AND prp.route_id = pt.route_id
WHERE
p.is_delete = 0
<if test="planTaskId != null and planTaskId > 0 ">and pt.id = #{planTaskId}</if>
p.is_delete = 0 and pt.id = #{planTaskId}
<if test="buildingId != null and buildingId != ''">and find_in_set(p.building_id,#{buildingId})</if>
<if test="isFinish != null and isFinish != ''">and ptd.is_finish = #{isFinish}</if>
<if test="systemId != null and systemId != ''">and p.belong_system_id = #{systemId}</if>
<if test="pointNo != null and pointNo != ''">and p.point_no = #{pointNo}</if>
<if test="pointName != null and pointName != ''">and p.name like CONCAT ('%',#{pointName},'%')</if>
ORDER BY orderNo
</select>
......@@ -712,100 +716,6 @@
<if test="routeId != null">prp.route_id = #{routeId}</if>
<if test="pointId != null">and prp.point_id = #{pointId}</if>
</where>
<!--
SELECT
ii.*, pii.classify_ids, group_concat(ppc.name) classifyNames
FROM
p_input_item ii
LEFT JOIN p_point_inputitem pii ON pii.input_item_id = ii.id
LEFT JOIN p_point_classify ppc on pii.classify_ids REGEXP CONCAT(
'^',
ppc.id,
',|,',
ppc.id,
',|,',
ppc.id,
'$',
'|^',
ppc.id,
'$'
)
LEFT JOIN p_route_point_item prpi ON prpi.point_input_item_id = pii.id,
(
SELECT
id AS route_point_id
FROM
p_route_point rp
<where>
<if test="routeId != null">route_id = #{routeId}</if>
<if test="pointId != null">and point_id = #{pointId}</if>
</where>
) prp
WHERE
prp.route_point_id = prpi.route_point_id
GROUP BY ii.id,
ii.org_code,
ii.name,
ii.order_no,
ii.item_type,
ii.is_must,
ii.is_score,
ii.default_value,
ii.is_multiline,
ii.catalog_id,
ii.input_json,
ii.data_json,
ii.remark,
ii.picture_json,
ii.create_by,
ii.create_date,
ii.is_delete,
ii.level
, pii.classify_ids
SELECT
*
FROM
p_point_inputitem
WHERE
id IN (
SELECT
point_input_item_id
FROM
p_route_point_item prpi,
(
SELECT
id AS route_point_id
FROM
p_route_point
<where>
<if test="routeId != null">route_id = #{routeId}</if>
<if test="pointId != null">and point_id = #{pointId}</if>
</where>
) prp
WHERE
prp.route_point_id = prpi.route_point_id
) -->
</select>
<select id="queryPointClassifyByRouteIdAndPointId" resultType="Map">
SELECT
ppc.id,
ppc.point_id pointId,
ppc.`name`,
ppc.order_no orderNo
FROM
`p_route_point_item` prpi
LEFT JOIN p_route_point prp ON prp.id = prpi.route_point_id
LEFT JOIN p_point_classify ppc ON ppc.id = prpi.point_classify_id
WHERE
prp.route_id = #{routeId}
AND prp.point_id = #{pointId}
GROUP BY
ppc.id,
ppc.point_id,
ppc.`name`,
ppc.order_no
</select>
<select id="queryLeavePlanTask" resultMap="LeavePlanTaskMap">
......
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