Commit 13101fb3 authored by KeYong's avatar KeYong

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

parents 0fb88b47 7650c073
......@@ -252,14 +252,4 @@ public class OrgUsrExcelDto extends BaseDto {
@ApiModelProperty(value = "消防人员id")
private Long firefightersId;
}
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.fasterxml.jackson.annotation.JsonFormat;
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.CommonExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.ExplicitConstraint;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
import java.util.List;
/**
* @author DELL
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="OrgUsrFireExcelDto", description="消防人员导出")
public class OrgUsrFireExcelDto 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 = CommonExplicitConstraint.class, method = "getparent") //固定下拉内容
@ApiModelProperty(value = "归属机构/部门/人员")
private String parentId;
@ExcelIgnore
@ApiModelProperty(value = "机构名称")
private String parentName;
@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 = CommonExplicitConstraint.class) //动态下拉内
private String administrativePositionCode;// 行政职务
@ExcelProperty(value = "审核周期", index = 3)
@ExplicitConstraint(type = "SHZQ", indexNum =3, sourceClass = CommonExplicitConstraint.class) //动态下拉内
private String auditCycle; //审核周期
@ExcelProperty(value = "证件类型", index = 4)
@ExplicitConstraint(type = "RYZJLX", indexNum =4, sourceClass = CommonExplicitConstraint.class) //动态下拉内
private String certificatesTypeCode; //证件类型
@ExcelProperty(value = "证件号码", index = 5)
private String certificatesNumber;// 证件号码
@ExcelProperty(value = "持证类别", index = 6)
@ExplicitConstraint(type = "CZLB", indexNum =6, sourceClass = CommonExplicitConstraint.class) //动态下拉内
private String certificateType; //持证类别
@ExcelProperty(value = "消防管理岗位", index = 7)
@ExplicitConstraint(type = "XFGLGW", indexNum =7, sourceClass = CommonExplicitConstraint.class) //动态下拉内
private String fireManagementPostCode; //消防管理岗位
@ExcelProperty(value = "性别", index = 8)
@ExplicitConstraint(type = "XB", indexNum =8, sourceClass = CommonExplicitConstraint.class) //动态下拉内
private String gender; //性别
@ExcelProperty(value = "消防管理组织机构内部职务", index = 9)
@ExplicitConstraint(type = "JGNBZW", indexNum =9, sourceClass = CommonExplicitConstraint.class) //动态下拉内
private String internalPositionCode; //消防管理组织机构内部职务
@ExcelProperty(value = "员工编号", index = 10)
private String personNumber; //员工编号
@ExcelProperty(value = "岗位类型", index = 11)
@ExplicitConstraint(type = "GWMC", indexNum =11, sourceClass = CommonExplicitConstraint.class) //动态下拉内
private String positionType; //岗位类型
@ExcelProperty(value = "是否进行安全培训", index = 12)
@ExplicitConstraint(type = "AQPX", indexNum =12, sourceClass = CommonExplicitConstraint.class) //动态下拉内
private String safetyTraining; //是否进行安全培训
@ExcelProperty(value = "人员状态", index = 13)
@ExplicitConstraint(type = "RYZT", indexNum =13, sourceClass = CommonExplicitConstraint.class) //动态下拉内
private String stateCode; //人员状态
@ExcelProperty(value = "联系电话", index = 14)
private String telephone; //联系电话
@ExcelProperty(value = "人员类型", index = 15)
@ExplicitConstraint(type = "DWRYLX", indexNum =15, sourceClass = CommonExplicitConstraint.class) //动态下拉内
private String peopleType; //人员类型
@ExplicitConstraint(indexNum = 16, sourceClass = CommonExplicitConstraint.class, method = "getNations") //固定下拉内容
@ExcelProperty(value = "民族", index = 16)
@ApiModelProperty(value = "民族")
private String nation;
@ExcelProperty(value = "出生日期", index = 17)
@ApiModelProperty(value = "出生日期")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
private String birthdayTime;
@ExplicitConstraint(indexNum = 18, sourceClass = CommonExplicitConstraint.class, method = "getMaritalStatus") //固定下拉内容
@ExcelProperty(value = "婚姻状况", index = 18)
@ApiModelProperty(value = "婚姻状况")
private String maritalStatus;
@ExplicitConstraint(indexNum = 19, sourceClass = CommonExplicitConstraint.class,method="getCitys") //动态下拉内容
@ExcelProperty(value = "户籍所在地", index = 19)
@ApiModelProperty(value = "籍贯/户口所在地的值")
private String nativePlace;
@ExcelProperty(value = "籍贯/户口所在地详细地址", index = 20)
@ApiModelProperty(value = "籍贯/户口所在地详细地址")
private String nativePlaceVal;
@ExplicitConstraint(indexNum = 21, sourceClass = CommonExplicitConstraint.class, method = "getPoliticalOutlook") //固定下拉内容
@ExcelProperty(value = "政治面貌", index = 21)
@ApiModelProperty(value = "政治面貌代码")
private String politicalOutlook;
@ExplicitConstraint(indexNum = 22, sourceClass = CommonExplicitConstraint.class,method="getCitys") //动态下拉内容// BUG 2760 修改消防人员导出模板和 导入问题 bykongfm
@ExcelProperty(value = "现居住地", index = 22)
@ApiModelProperty(value = "现居住地")
private String residenceDetails;
@ExcelProperty(value = "现居住地详细地址", index = 23)
@ApiModelProperty(value = "现居住地详细地址")
private String residenceDetailVal;
@ExcelProperty(value = "住宿情况", index = 24)
@ApiModelProperty(value = "住宿情况")
private String airportAccommodation;
@ExcelProperty(value = "紧急联系人", index = 25)
@ApiModelProperty(value = "紧急联系人")
private String emergencyContact;
@ExplicitConstraint(type = "RJGX", indexNum = 26, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "与紧急联系人关系", index = 26)
@ApiModelProperty(value = "紧急联系人与本人所属关系")
private String relationship;
@ExcelProperty(value = "紧急联系人电话", index = 27)
@ApiModelProperty(value = "紧急联系人电话")
private String emergencyContactPhone;
@ApiModelProperty(value = "员工层级")
@ExcelProperty(value = "员工层级", index = 28)
@ExplicitConstraint(type = "YGCJ", indexNum = 28, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
private String employeeHierarchy;
@ApiModelProperty(value = "岗位资质")
@ExplicitConstraint(type = "GWZZ", indexNum = 29, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "岗位资质", index = 29)
private String postQualification;
@ExplicitConstraint(indexNum = 30, sourceClass = CommonExplicitConstraint.class,method="getFireTeam") //动态下拉内容
@ExcelProperty(value = "消防队伍", index = 30)
@ApiModelProperty(value = "队伍")
private String fireTeam;
@ExplicitConstraint(indexNum = 31, sourceClass = CommonExplicitConstraint.class,method="ZJLY") //动态下拉内容
@ExcelProperty(value = "消防专家领域", index = 31)
@ApiModelProperty(value = "消防专家领域")
private String areasExpertise;
@ExplicitConstraint(indexNum = 32, sourceClass = CommonExplicitConstraint.class,method="XFRYLB") //动态下拉内容
@ExcelProperty(value = "消防救援人员类别", index = 32)
@ApiModelProperty(value = "消防救援人员类别")
private String category;
@ExplicitConstraint(indexNum = 33, sourceClass = CommonExplicitConstraint.class,method="XFJYJB") //动态下拉内容
@ExcelProperty(value = "消防授衔级别", index = 33)
@ApiModelProperty(value = "消防授衔级别")
private String level;
/*************************学历教育***********************/
@ApiModelProperty(value = "第一学历")
@ExplicitConstraint(type = "XLLX", indexNum = 34, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "第一学历", index = 34)
private String firstDegree;
@ApiModelProperty(value = "最高学历")
@ExplicitConstraint(type = "XLLX", indexNum = 35, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "最高学历", index = 35)
private String highestEducation;
@ApiModelProperty(value = "学位")
@ExplicitConstraint(type = "XWLX", indexNum = 36, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "学位", index = 36)
private String academicDegree;
@ApiModelProperty(value = "毕业院校")
@ExcelProperty(value = "毕业院校", index = 37)
private String school;
@ApiModelProperty(value = "毕业专业名称")
@ExcelProperty(value = "毕业专业名称", index = 38)
private String professionalName;
/*************************工作履历岗***********************/
@ApiModelProperty(value = "参加工作时间")
@ExcelProperty(value = "参加工作时间", index = 39)
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date workingHours;
@ApiModelProperty(value = "参加消防部门工作时间")
@ExcelProperty(value = "参加消防部门工作时间", index = 40)
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date fireWorkingHours;
@ExcelIgnore
@ApiModelProperty(value = "单位人员id")
private String orgUsrId;
@ExcelIgnore
@ApiModelProperty(value = "消防人员id")
private Long firefightersId;
}
......@@ -3,14 +3,12 @@ package com.yeejoin.amos.boot.module.common.api.mapper;
import java.util.List;
import java.util.Map;
import com.yeejoin.amos.boot.module.common.api.dto.FirefightersExcelDto;
import com.yeejoin.amos.boot.module.common.api.dto.FirefightersZhDto;
import com.yeejoin.amos.boot.module.common.api.dto.*;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.biz.common.utils.FirefightersTreeDto;
import com.yeejoin.amos.boot.module.common.api.dto.FirefightersDto;
import com.yeejoin.amos.boot.module.common.api.entity.Firefighters;
/**
......@@ -42,4 +40,6 @@ public interface FirefightersMapper extends BaseMapper<Firefighters> {
List<Map<String, String>> selectNormalFirePerson(String jobId);
List<Firefighters> getPersonByCodes(@Param("list") List<String> list);
List<OrgUsrFireExcelDto> exportToExcelNew(Boolean isDelete, String name, String postQualification, String fireTeamId, String state, String areasExpertise, String jobTitle, String bizOrgCode);
}
......@@ -347,9 +347,10 @@ public interface IOrgUsrService {
/**
* 查询身份证号码是否重复
* @param certificatesNumber 身份证号码
* @param orgUserId
* @return 标识
*/
boolean checkCertificatesNumber(String certificatesNumber);
boolean checkCertificatesNumber(String certificatesNumber, Long orgUserId);
/**
* 根据id删除消防人员
......
......@@ -271,4 +271,174 @@ LEFT JOIN cb_fire_team cft ON cff.fire_team_id = cft.sequence_nbr
</foreach>
and is_delete = 0
</select>
<select id="exportToExcelNew" resultType="com.yeejoin.amos.boot.module.common.api.dto.OrgUsrFireExcelDto">
select
a.biz_org_name bizOrgName,
(select c.biz_org_name from cb_org_usr c where c.sequence_nbr=a.parent_id) parentId,
(
SELECT
cb_fire_team. NAME
FROM
cb_fire_team
WHERE
cb_fire_team.sequence_nbr = f.fire_team_id
) fireTeam,
(
SELECT
NAME
FROM
cb_data_dictionary
WHERE
CODE = fe.first_degree
AND type = 'XLLX'
) AS first_degree,
(
SELECT
NAME
FROM
cb_data_dictionary
WHERE
CODE = fe.highest_education
AND type = 'XLLX'
) AS highest_education,
(
SELECT
NAME
FROM
cb_data_dictionary
WHERE
CODE = fe.academic_degree
AND type = 'XWLX'
) AS academic_degree,
fe.school,
fe.professional_name,
(
SELECT
NAME
FROM
cb_data_dictionary
WHERE
CODE = fp.employee_hierarchy
AND type = 'YGCJ'
) AS employee_hierarchy,
(
SELECT
NAME
FROM
cb_data_dictionary
WHERE
CODE = fp.internal_position_code
AND type = 'JGNBZW'
) AS internal_position_code,
(
SELECT
NAME
FROM
cb_data_dictionary
WHERE
CODE = fp.audit_cycle
AND type = 'SHZQ'
) AS audit_cycle,
fp.administrative_position as administrativePositionCode,
fp.job_title as positionType,
fp.post_qualification as postQualification,
fp.fire_management_post as fireManagementPostCode,
fp.certificate_type as certificateType,
(
SELECT
NAME
FROM
cb_data_dictionary
WHERE
CODE = fc.relationship
AND type = 'RJGX'
) AS relationship,
(
SELECT
NAME
FROM
cb_data_dictionary
WHERE
CODE = b.gender
AND type = 'XB'
) AS gender,
(
SELECT
NAME
FROM
cb_data_dictionary
WHERE
CODE = b.safetyTraining
AND type = 'AQPX'
) AS safetyTraining,
(
SELECT
NAME
FROM
cb_data_dictionary
WHERE
CODE = b.peopleType
AND type = 'DWRYLX'
) AS peopleType,
fc.emergency_contact,
fc.emergency_contact_phone,
fp.category,
fp.level,
fp.areas_expertise,
(
SELECT
NAME
FROM
cb_data_dictionary
WHERE
CODE = b.certificatesTypeCode
AND type = 'RYZJLX'
) AS certificatesTypeCode,
fp.employee_hierarchy,
cast(b.birthdayTime as datetime) as birthdayTime,
b.*,
fw.*
from cb_org_usr a LEFT JOIN
(SELECT
instance_id,
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 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 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 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,
max(case field_code when 'peopleType' then field_value end) peopleType,
max(case field_code when 'nation' then field_value end) nation,
max(case field_code when 'birthdayTime' then field_value end) birthdayTime,
max(case field_code when 'maritalStatus' then field_value end) maritalStatus,
max(case field_code when 'nativePlace' then field_value end) nativePlace,
max(case field_code when 'nativePlaceVal' then field_value end) nativePlaceVal,
max(case field_code when 'politicalOutlook' then field_value end) politicalOutlook,
max(case field_code when 'residenceDetails' then field_value end) residenceDetails,
max(case field_code when 'residenceDetailVal' then field_value end) residenceDetailVal,
max(case field_code when 'airportAccommodation' then field_value end) airportAccommodation
FROM cb_dynamic_form_instance GROUP BY instance_id) b
on b.instance_id=a.sequence_nbr
LEFT JOIN cb_firefighters_contacts fc ON a.sequence_nbr = fc.org_usr_id
LEFT JOIN cb_firefighters_workexperience fw ON a.sequence_nbr = fw.org_usr_id
LEFT JOIN cb_firefighters_education fe ON a.sequence_nbr = fe.org_usr_id
LEFT JOIN cb_firefighters_post fp ON a.sequence_nbr = fp.org_usr_id
LEFT JOIN cb_firefighters f ON a.sequence_nbr = f.org_usr_id
where a.biz_org_name is not null and a.is_delete = 0 and a.biz_org_type = 'PERSON'
<if test="name!=null and name !='-1' and name !=''">and a.`name` like concat('%',#{name},'%')</if>
<if test='postQualification!=null'>and fp.post_qualification_code = #{postQualification}</if>
<if test='fireTeamId !=null'>and f.fire_team_id = #{fireTeamId}</if>
<if test='state !=null'>and f.state_code = #{state}</if>
<if test='areasExpertise!=null'>and fp.areas_expertise_code = #{areasExpertise}</if>
<if test='jobTitle!=null'>and f.job_title_code = #{jobTitle}</if>
<if test='bizOrgCode!=null'>and f.biz_org_code like concat ('%',#{bizOrgCode},'%') </if>
</select>
</mapper>
......@@ -121,7 +121,7 @@
max(case v.field_code when 'auditCycle' then IFNULL(v.field_value_label,v.field_value) end) auditCycle,
max(case v.field_code when 'personImg' then IFNULL(v.field_value_label,v.field_value) end) personImg,
max(case v.field_code when 'certificateImg' then IFNULL(v.field_value_label,v.field_value) end) certificateImg,
max(case v.field_code when 'peopleType' then IFNULL(v.field_value_label,v.field_value) end) peopleType
max(case v.field_code when 'peopleType' then v.field_value end) peopleType
FROM
`cb_dynamic_form_instance` v
WHERE
......@@ -552,26 +552,152 @@ GROUP BY
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.*
(
SELECT
NAME
FROM
cb_data_dictionary
WHERE
CODE = fe.first_degree
AND type = 'XLLX'
) AS first_degree,
(
SELECT
NAME
FROM
cb_data_dictionary
WHERE
CODE = fe.highest_education
AND type = 'XLLX'
) AS highest_education,
(
SELECT
NAME
FROM
cb_data_dictionary
WHERE
CODE = fe.academic_degree
AND type = 'XWLX'
) AS academic_degree,
fe.school,
fe.professional_name,
(
SELECT
NAME
FROM
cb_data_dictionary
WHERE
CODE = fp.employee_hierarchy
AND type = 'YGCJ'
) AS employee_hierarchy,
(
SELECT
NAME
FROM
cb_data_dictionary
WHERE
CODE = fp.internal_position_code
AND type = 'JGNBZW'
) AS internal_position_code,
(
SELECT
NAME
FROM
cb_data_dictionary
WHERE
CODE = fp.audit_cycle
AND type = 'SHZQ'
) AS audit_cycle,
fp.administrative_position as administrativePositionCode,
fp.job_title as positionType,
fp.post_qualification as postQualification,
fp.fire_management_post as fireManagementPostCode,
fp.certificate_type as certificateType,
(
SELECT
NAME
FROM
cb_data_dictionary
WHERE
CODE = fc.relationship
AND type = 'RJGX'
) AS relationship,
(
SELECT
NAME
FROM
cb_data_dictionary
WHERE
CODE = b.gender
AND type = 'XB'
) AS gender,
(
SELECT
NAME
FROM
cb_data_dictionary
WHERE
CODE = b.safetyTraining
AND type = 'AQPX'
) AS safetyTraining,
(
SELECT
NAME
FROM
cb_data_dictionary
WHERE
CODE = b.peopleType
AND type = 'DWRYLX'
) AS peopleType,
(
SELECT
NAME
FROM
cb_data_dictionary
WHERE
CODE = b.certificatesTypeCode
AND type = 'RYZJLX'
) AS certificatesTypeCode,
fc.emergency_contact,
fc.emergency_contact_phone,
fp.employee_hierarchy employeeHierarchy,
cast(b.birthdayTime as datetime) as birthdayTime,
b.*,
fw.*
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 'certificatesTypeCode' then field_value 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 'gender' then field_value 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 'safetyTraining' then field_value 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
max(case field_code when 'telephone' then field_value end) telephone,
max(case field_code when 'peopleType' then field_value end) peopleType,
max(case field_code when 'nation' then field_value end) nation,
max(case field_code when 'birthdayTime' then field_value end) birthdayTime,
max(case field_code when 'maritalStatus' then field_value end) maritalStatus,
max(case field_code when 'nativePlace' then field_value end) nativePlace,
max(case field_code when 'nativePlaceVal' then field_value end) nativePlaceVal,
max(case field_code when 'politicalOutlook' then field_value end) politicalOutlook,
max(case field_code when 'residenceDetails' then field_value end) residenceDetails,
max(case field_code when 'residenceDetailVal' then field_value end) residenceDetailVal,
max(case field_code when 'airportAccommodation' then field_value end) airportAccommodation
FROM cb_dynamic_form_instance GROUP BY instance_id) b
on b.instance_id=a.sequence_nbr where a.biz_org_name is not null and a.is_delete = 0 and a.biz_org_type = 'PERSON'
on b.instance_id=a.sequence_nbr
LEFT JOIN cb_firefighters_contacts fc ON a.sequence_nbr = fc.org_usr_id
LEFT JOIN cb_firefighters_workexperience fw ON a.sequence_nbr = fw.org_usr_id
LEFT JOIN cb_firefighters_education fe ON a.sequence_nbr = fe.org_usr_id
LEFT JOIN cb_firefighters_post fp ON a.sequence_nbr = fp.org_usr_id
where a.biz_org_name is not null and a.is_delete = 0 and a.biz_org_type = 'PERSON'
<if test="parentId != null and parentId != '' and parentId != '-1'">
and a.parent_id = #{parentId}
</if>
......
......@@ -378,8 +378,9 @@ public class OrgPersonController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/people/checkCertificates/{certificatesNumber}", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "查询身份证号码是否重复", notes = "查询身份证号码是否重复")
public ResponseModel<Boolean> checkCertificatesNumber(@PathVariable String certificatesNumber) {
return ResponseHelper.buildResponse(iOrgUsrService.checkCertificatesNumber(certificatesNumber));
public ResponseModel<Boolean> checkCertificatesNumber(@PathVariable String certificatesNumber,
@RequestParam(required = false) Long orgUserId) {
return ResponseHelper.buildResponse(iOrgUsrService.checkCertificatesNumber(certificatesNumber, orgUserId));
}
/**
......
......@@ -135,6 +135,25 @@ public class FirefightersServiceImpl extends BaseService<FirefightersDto, Firefi
jobTitle,bizOrgCode);
}
/**
* 导出列表
*/
public List<OrgUsrFireExcelDto> exportToExcelNew(@Condition(Operator.eq) Boolean isDelete, Map par) {
if (par == null || par.size() < 1) {
return firefightersMapper.exportToExcelNew(isDelete, null, null, null, null, null, null,null);
}
String name = par.containsKey("name") ? par.get("name").toString() : null;
String postQualification = par.containsKey("postQualification") ? par.get("postQualification").toString()
: null;
String fireTeamId = par.containsKey("fireTeamId") ? par.get("fireTeamId").toString() : null;
String state = par.containsKey("state") ? par.get("state").toString() : null;
String areasExpertise = par.containsKey("areasExpertise") ? par.get("areasExpertise").toString() : null;
String jobTitle = par.containsKey("jobTitle") ? par.get("jobTitle").toString() : null;
String bizOrgCode = par.containsKey("bizOrgCode") ? par.get("bizOrgCode").toString() : null;
return firefightersMapper.exportToExcelNew(isDelete, name, postQualification, fireTeamId, state, areasExpertise,
jobTitle,bizOrgCode);
}
@Override
public List<Menu> getFirefightersJobTitleCount(String bizOrgCode) throws Exception {
......
......@@ -3,7 +3,6 @@ package com.yeejoin.amos.boot.module.common.biz.service.impl;
import java.io.Serializable;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.Type;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
......@@ -18,10 +17,8 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.common.api.dto.*;
import com.yeejoin.amos.boot.module.common.api.entity.*;
import com.yeejoin.amos.boot.module.common.api.mapper.*;
import com.yeejoin.amos.boot.module.common.api.service.IFireCompanyInfoService;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.checkerframework.checker.units.qual.C;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
......@@ -2843,8 +2840,27 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
String key = dynamicFormInstanceDto.getFieldCode();
Object value = map.get(key);
if (value != null) {
Object o = null;
if (key.contains("Code")) {
String code = key.substring(0, key.indexOf("Code"));
o = map.get(code);
}
if (!ObjectUtils.isEmpty(o)) {
dynamicFormInstanceDto.setFieldValue(value.toString());
dynamicFormInstanceDto.setFieldValueLabel(o.toString());
} else {
dynamicFormInstanceDto.setFieldValue(value.toString());
}
if ("birthdayTime".equals(key)) {
SimpleDateFormat ft = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
String date = ft.format(value);
dynamicFormInstanceDto.setFieldValue(date);
} catch (Exception e) {
logger.error("日期转换失败");
}
}
}
DynamicFormInstance dynamicFormInstance = new DynamicFormInstance();
BeanUtils.copyProperties(dynamicFormInstanceDto, dynamicFormInstance);
dynamicFormInstancelist.add(dynamicFormInstance);
......@@ -2950,7 +2966,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
if ("Date".equals(genericType)) {
if (!ObjectUtils.isEmpty(value)) {
Date date;
SimpleDateFormat ft = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy", Locale.US);
SimpleDateFormat ft = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
date = ft.parse(value.toString());
field.set(peopleBasicInfoDto, date);
......@@ -3133,12 +3149,13 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
}
@Override
public boolean checkCertificatesNumber(String certificatesNumber) {
QueryWrapper<DynamicFormInstance> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("field_code", "certificatesNumber");
queryWrapper.eq("field_value", certificatesNumber);
public boolean checkCertificatesNumber(String certificatesNumber, Long orgUserId) {
LambdaQueryWrapper<DynamicFormInstance> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(DynamicFormInstance::getFieldCode, "certificatesNumber");
queryWrapper.eq(DynamicFormInstance::getFieldValue, certificatesNumber);
queryWrapper.ne(orgUserId !=null, DynamicFormInstance::getInstanceId, orgUserId);
List<DynamicFormInstance> list = dynamicFormInstanceService.list(queryWrapper);
return !ObjectUtils.isEmpty(list) && list.size() > 1;
return !list.isEmpty();
}
@Override
......
......@@ -30,7 +30,7 @@ public interface EquipmentSpecificAlarmLogMapper extends BaseMapper<EquipmentSpe
List<AppAlarmExtVo> findByIdListNoBuildId(@Param("list") List<Long> idBNullList);
List<EquipmentSpecificAlarmLog> getIsConfirmByAlarmId(@Param("equipmentSpecificAlarmId") Long equipmentSpecificAlarmId, @Param("isConfirm") String isConfirm);
List<EquipmentSpecificAlarmLog> getIsConfirmByAlarmId(@Param("equipmentSpecificId") Long equipmentSpecificId, @Param("equipmentSpecificIndexKey")String equipmentSpecificIndexKey,@Param("isConfirm") String isConfirm);
List<FireEquipmentFireAlarm> getFireEquipAlarmLogDetailsById(@Param("list") List<Long> ids);
......
......@@ -27,5 +27,5 @@ public interface IEquipmentSpecificAlarmLogService extends IService<EquipmentSpe
* @param isConfirm '' 为全部数据 0 为未确认 1为已确认
* @return
*/
List<EquipmentSpecificAlarmLog> getIsConfirmByAlarmId(Long equipmentSpecificAlarmId, String isConfirm);
List<EquipmentSpecificAlarmLog> getIsConfirmByAlarmId(Long equipmentSpecificId,String equipmentSpecificIndexKey, String isConfirm);
}
......@@ -189,7 +189,7 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
// 如果是批量确警,先查询,再确警,用于批量消息推送
isBatch = ent.getIsBatch();
if (isBatch == 1) {
list = equipmentSpecificAlarmLogService.getIsConfirmByAlarmId(equipmentSpecificAlarmId, "0");
list = equipmentSpecificAlarmLogService.getIsConfirmByAlarmId(alarmLog.getEquipmentSpecificId(),alarmLog.getEquipmentSpecificIndexKey(), "0");
}
}
if (ent.getType() != null) {
......@@ -202,8 +202,10 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
if (ent.getIsBatch() == 0){
i = equipmentSpecificAlarmLogMapper.updateById(ent);
}else {
LambdaUpdateWrapper<EquipmentSpecificAlarmLog> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(EquipmentSpecificAlarmLog::getEquipmentSpecificAlarmId,ent.getEquipmentSpecificAlarmId());
LambdaUpdateWrapper<EquipmentSpecificAlarmLog> updateWrapper = new LambdaUpdateWrapper<EquipmentSpecificAlarmLog>().
set(EquipmentSpecificAlarmLog::getEquipmentSpecificId,ent.getEquipmentSpecificId()).
set(EquipmentSpecificAlarmLog::getConfirmDate,null).
eq(EquipmentSpecificAlarmLog::getEquipmentSpecificIndexKey,ent.getEquipmentSpecificIndexKey());
i = equipmentSpecificAlarmLogMapper.update(ent, updateWrapper);
}
//int i = confirmAlarmMapper.confirmAlam(ent);
......
......@@ -32,8 +32,8 @@ public class EquipmentSpecificAlarmLogServiceImpl extends ServiceImpl<EquipmentS
}
@Override
public List<EquipmentSpecificAlarmLog> getIsConfirmByAlarmId(Long equipmentSpecificAlarmId, String isConfirm) {
List<EquipmentSpecificAlarmLog> list = equipmentSpecificAlarmLogMapper.getIsConfirmByAlarmId(equipmentSpecificAlarmId, isConfirm);
public List<EquipmentSpecificAlarmLog> getIsConfirmByAlarmId(Long equipmentSpecificId, String equipmentSpecificIndexKey, String isConfirm) {
List<EquipmentSpecificAlarmLog> list = equipmentSpecificAlarmLogMapper.getIsConfirmByAlarmId(equipmentSpecificId, equipmentSpecificIndexKey, isConfirm);
if (CollectionUtils.isNotEmpty(list)) {
return list;
}
......
......@@ -10,6 +10,7 @@ import java.util.stream.Collectors;
import javax.servlet.http.HttpServletResponse;
import com.yeejoin.amos.boot.module.common.api.dto.*;
import com.yeejoin.amos.boot.module.common.api.excel.ExplicitConstraint;
import org.apache.commons.beanutils.ConvertUtils;
import org.apache.poi.ss.usermodel.Cell;
......@@ -46,33 +47,6 @@ import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.biz.common.utils.QRCodeUtil;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
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.DutyFireFightingDto;
import com.yeejoin.amos.boot.module.common.api.dto.DutyFirstAidDto;
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.DynamicFormInitDto;
import com.yeejoin.amos.boot.module.common.api.dto.DynamicFormInstanceDto;
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.LinkageUnitDto;
import com.yeejoin.amos.boot.module.common.api.dto.LinkageUnitVo;
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.OrgUsrExcelDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgUsrFormDto;
import com.yeejoin.amos.boot.module.common.api.dto.RescueEquipmentDto;
import com.yeejoin.amos.boot.module.common.api.dto.SpecialPositionStaffDto;
import com.yeejoin.amos.boot.module.common.api.dto.WaterResourceDto;
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;
......@@ -322,7 +296,10 @@ public class ExcelServiceImpl {
null, FirefightersExcelDto.class, null, false);
break;
}
List<FirefightersExcelDto> firefightersExcelDtoList = firefightersService.exportToExcel(false, par);
// List<FirefightersExcelDto> firefightersExcelDtoList = firefightersService.exportToExcel(false, par);
List<OrgUsrFireExcelDto> firefightersExcelDtoList = firefightersService.exportToExcelNew(false, par);
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(),
firefightersExcelDtoList, OrgUsrFireExcelDto.class, null, false);
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(),
firefightersExcelDtoList, FirefightersExcelDto.class, null, false);
break;
......@@ -766,6 +743,20 @@ public class ExcelServiceImpl {
}
}
}
if ("birthdayTime".equals(key) && !ObjectUtils.isEmpty(value)) {
SimpleDateFormat ft = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
String date = ft.format(value);
dynamicFormInstanceDto.setFieldValue(date);
} catch (Exception e) {
logger.error("日期转换失败");
}
}
if ("peopleType".equals(key)) {
dynamicFormInstanceDto.setFieldValue("1");
dynamicFormInstanceDto.setFieldValueLabel("非消防人员");
orgUsrExcelDto.setPeopleType("1");
}
DynamicFormInstance dynamicFormInstance = new DynamicFormInstance();
BeanUtils.copyProperties(dynamicFormInstanceDto, dynamicFormInstance);
dynamicFormInstancelist.add(dynamicFormInstance);
......@@ -778,7 +769,7 @@ public class ExcelServiceImpl {
if (!set.add(orgUsrExcelDto.getCertificatesNumber())) {
throw new RuntimeException("身份证号码重复!");
} else {
boolean b = orgUsrService.checkCertificatesNumber(orgUsrExcelDto.getCertificatesNumber());
boolean b = orgUsrService.checkCertificatesNumber(orgUsrExcelDto.getCertificatesNumber(), null);
if (b) {
throw new RuntimeException("身份证号码重复!");
}
......@@ -1383,7 +1374,7 @@ public class ExcelServiceImpl {
fireExpertsServiceImpl.saveBatch(excelEntityList);
}
@Async
private void excelImportDutyPerson(MultipartFile multipartFile, String dutyType,String uuidString) throws Exception {
private void excelImportDutyPerson(MultipartFile multipartFile, String dutyType,String uuidString) {
try {
ImportDutyPerson(multipartFile,dutyType);
if(redisUtils.hasKey(uuidString)){
......
......@@ -99,8 +99,11 @@
FROM
wl_equipment_specific_alarm_log weal
<where>
<if test="equipmentSpecificAlarmId != null">
weal.equipment_specific_alarm_id = #{equipmentSpecificAlarmId}
<if test="equipmentSpecificId != null and equipmentSpecificId != ''">
AND weal.equipment_specific_id = #{equipmentSpecificId}
</if>
<if test="equipmentSpecificIndexKey != null and equipmentSpecificIndexKey != ''">
AND weal.equipment_specific_index_key = #{equipmentSpecificIndexKey}
</if>
<if test="isConfirm != null and isConfirm != '' and isConfirm == 0">
AND weal.confirm_date IS NULL
......
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