New file |
| | |
| | | package com.panzhihua.common.listen; |
| | | |
| | | import com.alibaba.excel.context.AnalysisContext; |
| | | import com.alibaba.excel.event.AnalysisEventListener; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.panzhihua.common.exceptions.ServiceException; |
| | | import com.panzhihua.common.model.dtos.civil.ComActSocialWorkerExcelVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComCvtServeExcelVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @description: 便民服务导入监听 |
| | | * @author: Null |
| | | * @date: 2021/3/11 13:26 |
| | | */ |
| | | @Slf4j |
| | | public class ComActSocialWorkerExcelListen extends AnalysisEventListener<ComActSocialWorkerExcelVO> { |
| | | |
| | | private CommunityService communityService; |
| | | |
| | | private Long communityId; |
| | | |
| | | public ComActSocialWorkerExcelListen(CommunityService communityService, Long communityId) { |
| | | this.communityService = communityService; |
| | | this.communityId = communityId; |
| | | } |
| | | |
| | | |
| | | private static final int BATCH_COUNT = 5000; |
| | | private List<ComActSocialWorkerExcelVO> list = new ArrayList<>(); |
| | | |
| | | @Override |
| | | public void invoke(ComActSocialWorkerExcelVO comActSocialWorkerExcelVO, AnalysisContext analysisContext) { |
| | | list.add(comActSocialWorkerExcelVO); |
| | | // 达到BATCH_COUNT了,需要去存储一次数据库,防止数据几万条数据在内存,容易OOM |
| | | if (list.size() >= BATCH_COUNT) { |
| | | log.info("excel导入数据【{}】", JSONObject.toJSONString(list)); |
| | | R r = this.communityService.listSaveSocialWorkerExcelVO(list, this.communityId); |
| | | if (!R.isOk(r)) { |
| | | throw new ServiceException(r.getMsg()); |
| | | } |
| | | //清空list |
| | | list.clear(); |
| | | } |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void doAfterAllAnalysed(AnalysisContext analysisContext) { |
| | | log.info("excel导入数据【{}】", JSONObject.toJSONString(list)); |
| | | R r = this.communityService.listSaveSocialWorkerExcelVO(list, this.communityId);//确保最后遗留的数据保存在数据库中 |
| | | if (!R.isOk(r)) { |
| | | throw new ServiceException(r.getMsg()); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.civil; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zzj |
| | | */ |
| | | @Data |
| | | public class ComActSocialExportVO { |
| | | /** |
| | | * 姓名 列: name |
| | | */ |
| | | @ExcelProperty(value = "姓名") |
| | | private String name; |
| | | /** |
| | | * 联系电话 列: telephone |
| | | */ |
| | | @ExcelProperty(value = "联系电话",index = 4) |
| | | private String telephone; |
| | | /** |
| | | * 性别0女1男 列: gen |
| | | */ |
| | | @ExcelProperty(value = "性别",index = 2) |
| | | private Integer gen; |
| | | /** |
| | | * 出生日期 列: birthday |
| | | */ |
| | | @ExcelProperty(value = "出生日期",index = 3) |
| | | private String birthday; |
| | | /** |
| | | * 社工证编号 列: social_worker_code |
| | | */ |
| | | @ExcelProperty(value = "社工证号码",index = 1) |
| | | private String socialWorkerCode; |
| | | |
| | | /** |
| | | * 所属街道 列: street_id |
| | | */ |
| | | @ExcelProperty(value = "所属街道",index = 5) |
| | | private Long streetId; |
| | | /** |
| | | * 所属社区 列: community_id |
| | | */ |
| | | @ExcelProperty(value = "所属社区",index = 6) |
| | | private Long communityId; |
| | | |
| | | /** |
| | | * 技能领域 列: skill_field |
| | | */ |
| | | @ExcelProperty(value = "技能领域",index = 9) |
| | | private String skillField; |
| | | /** |
| | | * 业务范围 列: business_scope |
| | | */ |
| | | @ExcelProperty(value = "业务范围",index = 10) |
| | | private String businessScope; |
| | | |
| | | /** |
| | | * 所属组织ID 列: social_org_id |
| | | */ |
| | | @ExcelProperty(value = "所属机构",index = 7) |
| | | private Long socialOrgId; |
| | | |
| | | /** |
| | | * 社工资质 列: social_qua |
| | | */ |
| | | @ExcelProperty(value = "社工资质",index = 8) |
| | | private Long socialQua; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.civil; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import java.math.BigDecimal; |
| | | import javax.validation.constraints.Digits; |
| | | import javax.validation.constraints.*; |
| | | |
| | | import javax.validation.constraints.Max; |
| | | import javax.validation.constraints.NotNull; |
| | | import javax.validation.constraints.NotBlank; |
| | | import java.util.Date; |
| | | import org.hibernate.validator.constraints.Length; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | |
| | | |
| | | /** |
| | | * 创建表单 |
| | | * |
| | | * @author cedoo email:cedoo(a)qq.com |
| | | * @version 1.0 |
| | | * @since 1.0 |
| | | * @date 2021-06-03 |
| | | * */ |
| | | @Data |
| | | @ApiModel("创建社工请求参数") |
| | | public class ComActSocialWorkerAddDTO { |
| | | |
| | | @Max(9223372036854775807L) |
| | | @ApiModelProperty(value = "所属组织ID", hidden = false, example = "1") |
| | | private Long socialOrgId; |
| | | |
| | | @NotBlank() @Length(max=32) |
| | | @ApiModelProperty(value = "姓名", hidden = false, example = "") |
| | | private String name; |
| | | |
| | | @NotBlank() @Length(max=32) |
| | | @ApiModelProperty(value = "联系电话", hidden = false, example = "") |
| | | private String telephone; |
| | | |
| | | @ApiModelProperty(value = "性别0女1男", hidden = false, example = "") |
| | | private Integer gen; |
| | | |
| | | @ApiModelProperty(value = "所属街道", hidden = false, example = "") |
| | | private Long streetId; |
| | | |
| | | @Max(9223372036854775807L) |
| | | @ApiModelProperty(value = "所属社区", hidden = false, example = "1") |
| | | private Long communityId; |
| | | |
| | | @ApiModelProperty(value = "(当前操作)用户ID", hidden = true, example = "1") |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty(value = "(当前操作)用户名称", hidden = true, example = "张三") |
| | | private String userName; |
| | | |
| | | /** |
| | | * 身份证 |
| | | */ |
| | | @ApiModelProperty(value = "身份证") |
| | | private String idCard; |
| | | |
| | | /** |
| | | * 分类id |
| | | */ |
| | | @ApiModelProperty(value = "分类id") |
| | | private Long skillType; |
| | | |
| | | /** |
| | | * 入职时间 |
| | | */ |
| | | @ApiModelProperty(value = "入职时间") |
| | | private Date joinTime; |
| | | |
| | | /** |
| | | * 住址 |
| | | */ |
| | | @ApiModelProperty(value = "住址") |
| | | private String address; |
| | | |
| | | /** |
| | | * 图片 |
| | | */ |
| | | @ApiModelProperty(value = "图片") |
| | | private String image; |
| | | |
| | | /** |
| | | * 学历 |
| | | */ |
| | | @ApiModelProperty(value = "学历") |
| | | private String education; |
| | | |
| | | /** |
| | | * 政治面貌 |
| | | */ |
| | | @ApiModelProperty(value = "政治面貌") |
| | | private String politicalOutlook; |
| | | |
| | | /** |
| | | * 民族 |
| | | */ |
| | | @ApiModelProperty(value = "民族") |
| | | private String nation; |
| | | |
| | | /** |
| | | * 是否证件 0否 1是 |
| | | */ |
| | | @ApiModelProperty(value = "是否证件 0否 1是") |
| | | private Integer credential; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.civil; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | * 删除表单 |
| | | * |
| | | * @author cedoo email:cedoo(a)qq.com |
| | | * @version 1.0 |
| | | * @since 1.0 |
| | | * @date 2021-06-03 |
| | | * */ |
| | | @Data |
| | | @ApiModel("删除社工请求参数") |
| | | public class ComActSocialWorkerDeleteDTO { |
| | | |
| | | @ApiModelProperty(value = "ID", hidden = false, example = "1") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "(当前操作)用户ID", hidden = true, example = "1") |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty(value = "(当前操作)用户名称", hidden = true, example = "张三") |
| | | private String userName; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.civil; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import org.hibernate.validator.constraints.Length; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import javax.validation.constraints.*; |
| | | import java.math.*; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 编辑表单 |
| | | * |
| | | * @author cedoo email:cedoo(a)qq.com |
| | | * @version 1.0 |
| | | * @since 1.0 |
| | | * @date 2021-06-03 |
| | | * */ |
| | | @Data |
| | | @ApiModel("编辑社工请求参数") |
| | | public class ComActSocialWorkerEditDTO { |
| | | |
| | | @Max(9223372036854775807L) |
| | | @ApiModelProperty(value = "ID", hidden = false, example = "1") |
| | | private Long id; |
| | | |
| | | @NotNull() @Max(9223372036854775807L) |
| | | @ApiModelProperty(value = "所属组织ID", hidden = false, example = "1") |
| | | private Long socialOrgId; |
| | | |
| | | @NotBlank() @Length(max=32) |
| | | @ApiModelProperty(value = "姓名", hidden = false, example = "") |
| | | private String name; |
| | | |
| | | @NotBlank() @Length(max=32) |
| | | @ApiModelProperty(value = "联系电话", hidden = false, example = "") |
| | | private String telephone; |
| | | |
| | | @ApiModelProperty(value = "性别0女1男", hidden = false, example = "") |
| | | private Integer gen; |
| | | |
| | | @ApiModelProperty(value = "所属街道", hidden = false, example = "") |
| | | private Long streetId; |
| | | |
| | | @ApiModelProperty(value = "所属社区", hidden = false, example = "1") |
| | | private Long communityId; |
| | | |
| | | @ApiModelProperty(value = "(当前操作)用户ID", hidden = true, example = "1") |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty(value = "(当前操作)用户名称", hidden = true, example = "张三") |
| | | private String userName; |
| | | |
| | | /** |
| | | * 身份证 |
| | | */ |
| | | @ApiModelProperty(value = "身份证") |
| | | private String idCard; |
| | | |
| | | /** |
| | | * 分类id |
| | | */ |
| | | @ApiModelProperty(value = "分类id") |
| | | private Long skillType; |
| | | |
| | | /** |
| | | * 入职时间 |
| | | */ |
| | | @ApiModelProperty(value = "入职时间") |
| | | private Date joinTime; |
| | | |
| | | /** |
| | | * 住址 |
| | | */ |
| | | @ApiModelProperty(value = "住址") |
| | | private String address; |
| | | |
| | | /** |
| | | * 图片 |
| | | */ |
| | | @ApiModelProperty(value = "图片") |
| | | private String image; |
| | | |
| | | /** |
| | | * 学历 |
| | | */ |
| | | @ApiModelProperty(value = "学历") |
| | | private String education; |
| | | |
| | | /** |
| | | * 政治面貌 |
| | | */ |
| | | @ApiModelProperty(value = "政治面貌") |
| | | private String politicalOutlook; |
| | | |
| | | /** |
| | | * 民族 |
| | | */ |
| | | @ApiModelProperty(value = "民族") |
| | | private String nation; |
| | | |
| | | /** |
| | | * 是否证件 0否 1是 |
| | | */ |
| | | @ApiModelProperty(value = "是否证件 0否 1是") |
| | | private Integer credential; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.civil; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author zzj |
| | | */ |
| | | @Data |
| | | public class ComActSocialWorkerExcelVO { |
| | | |
| | | /** |
| | | * 姓名 列: name |
| | | */ |
| | | @ExcelProperty(value = "姓名",index = 0) |
| | | private String name; |
| | | /** |
| | | * 社工证编号 列: social_worker_code |
| | | */ |
| | | @ExcelProperty(value = "社工证号码",index = 1) |
| | | private String socialWorkerCode; |
| | | |
| | | /** |
| | | * 性别0女1男 列: gen |
| | | */ |
| | | @ExcelProperty(value = "性别0女1男",index = 2) |
| | | private String gen; |
| | | /** |
| | | * 出生日期 列: birthday |
| | | */ |
| | | @ExcelProperty(value = "出生日期",index = 3) |
| | | private Date birthday; |
| | | /** |
| | | * 联系电话 列: telephone |
| | | */ |
| | | @ExcelProperty(value = "联系电话",index = 4) |
| | | private String telephone; |
| | | |
| | | /** |
| | | * 所属街道 列: street_id |
| | | */ |
| | | @ExcelProperty(value = "所属街道",index = 5) |
| | | private String streetId; |
| | | /** |
| | | * 所属社区 列: community_id |
| | | */ |
| | | @ExcelProperty(value = "所属社区",index = 6) |
| | | private String communityId; |
| | | |
| | | /** |
| | | * 所属组织ID 列: social_org_id |
| | | */ |
| | | @ExcelProperty(value = "所属机构",index = 7) |
| | | private String socialOrgId; |
| | | |
| | | |
| | | /** |
| | | * 社工资质 列: social_qua |
| | | */ |
| | | @ExcelProperty(value = "社工资质",index = 8) |
| | | private String socialQua; |
| | | /** |
| | | * 技能领域 列: skill_field |
| | | */ |
| | | @ExcelProperty(value = "技能领域",index = 9) |
| | | private String skillField; |
| | | /** |
| | | * 业务范围 列: business_scope |
| | | */ |
| | | @ExcelProperty(value = "业务范围",index = 10) |
| | | private String businessScope; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.civil; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import org.hibernate.validator.constraints.Length; |
| | | |
| | | import javax.validation.constraints.*; |
| | | import java.util.Date; |
| | | import java.math.BigDecimal; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.google.common.base.CaseFormat; |
| | | |
| | | /** |
| | | * 分页查询表单 |
| | | * |
| | | * @author cedoo email:cedoo(a)qq.com |
| | | * @version 1.0 |
| | | * @since 1.0 |
| | | * @date 2021-06-03 |
| | | * */ |
| | | @Data |
| | | @ApiModel("查询社工请求参数") |
| | | public class PageComActSocialWorkerDTO { |
| | | |
| | | @ApiModelProperty(value = "分页-当前页数,默认:1", example = "1", position = 1) |
| | | private Long pageNum = 1L; |
| | | |
| | | @ApiModelProperty(value = "分页-每页记录数,默认:10", example = "10", position = 2) |
| | | private Long pageSize = 10L; |
| | | |
| | | @Max(9223372036854775807L) |
| | | @ApiModelProperty(value = "ID", hidden = false, example = "1") |
| | | private Long id; |
| | | |
| | | |
| | | @Max(9223372036854775807L) |
| | | @ApiModelProperty(value = "所属组织ID", hidden = false, example = "1") |
| | | private Long socialOrgId; |
| | | |
| | | |
| | | @Length(max=32) |
| | | @ApiModelProperty(value = "姓名", hidden = false, example = "") |
| | | private String name; |
| | | |
| | | |
| | | @Length(max=32) |
| | | @ApiModelProperty(value = "联系电话", hidden = false, example = "") |
| | | private String telephone; |
| | | |
| | | |
| | | @Length(max=1) |
| | | @ApiModelProperty(value = "性别0女1男", hidden = false, example = "") |
| | | private String gen; |
| | | |
| | | @Length(max=32) |
| | | @ApiModelProperty(value = "所属街道", hidden = false, example = "") |
| | | private String streetId; |
| | | |
| | | |
| | | @Max(9223372036854775807L) |
| | | @ApiModelProperty(value = "所属社区", hidden = false, example = "1") |
| | | private Long communityId; |
| | | |
| | | @Max(9223372036854775807L) |
| | | @ApiModelProperty(value = "创建人", hidden = false, example = "1") |
| | | private Long createBy; |
| | | |
| | | @Max(9223372036854775807L) |
| | | @ApiModelProperty(value = "更新人", hidden = false, example = "1") |
| | | private Long updateBy; |
| | | |
| | | @ApiModelProperty(value = "(当前操作)用户ID", hidden = true, example = "1") |
| | | private Long userId; |
| | | @ApiModelProperty(value = "(当前操作)用户名称", hidden = true, example = "张三") |
| | | private String userName; |
| | | |
| | | /** |
| | | * 身份证 |
| | | */ |
| | | @ApiModelProperty(value = "身份证") |
| | | private String idCard; |
| | | |
| | | /** |
| | | * 分类id |
| | | */ |
| | | @ApiModelProperty(value = "分类id") |
| | | private Long skillType; |
| | | |
| | | /** |
| | | * 入职时间 |
| | | */ |
| | | @ApiModelProperty(value = "入职时间") |
| | | private Date joinTime; |
| | | |
| | | /** |
| | | * 住址 |
| | | */ |
| | | @ApiModelProperty(value = "住址") |
| | | private String address; |
| | | |
| | | /** |
| | | * 图片 |
| | | */ |
| | | @ApiModelProperty(value = "图片") |
| | | private String image; |
| | | |
| | | /** |
| | | * 学历 |
| | | */ |
| | | @ApiModelProperty(value = "学历") |
| | | private String education; |
| | | |
| | | /** |
| | | * 政治面貌 |
| | | */ |
| | | @ApiModelProperty(value = "政治面貌") |
| | | private String politicalOutlook; |
| | | |
| | | /** |
| | | * 民族 |
| | | */ |
| | | @ApiModelProperty(value = "民族") |
| | | private String nation; |
| | | |
| | | /** |
| | | * 是否证件 0否 1是 |
| | | */ |
| | | @ApiModelProperty(value = "是否证件 0否 1是") |
| | | private Integer credential; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.civil; |
| | | |
| | | import java.util.*; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import java.math.BigDecimal; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | |
| | | /** |
| | | * |
| | | * @author cedoo email:cedoo(a)qq.com |
| | | * @version 1.0 |
| | | * @since 1.0 |
| | | * @date 2021-06-03 |
| | | * */ |
| | | @Data |
| | | @ApiModel("社工详细返回参数") |
| | | public class ComActSocialWorkerDetailsVO { |
| | | |
| | | @ApiModelProperty(value = "ID") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "所属组织ID") |
| | | private Long socialOrgId; |
| | | |
| | | @ApiModelProperty(value = "姓名") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "联系电话") |
| | | private String telephone; |
| | | |
| | | @ApiModelProperty(value = "性别0女1男") |
| | | private Integer gen; |
| | | |
| | | @ApiModelProperty(value = "所属街道") |
| | | private Long streetId; |
| | | |
| | | @ApiModelProperty(value = "所属社区") |
| | | private Long communityId; |
| | | |
| | | @ApiModelProperty(value = "创建人") |
| | | private Long createBy; |
| | | |
| | | @ApiModelProperty(value = "创建时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createAt; |
| | | |
| | | @ApiModelProperty(value = "更新人") |
| | | private Long updateBy; |
| | | |
| | | @ApiModelProperty(value = "更新时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date updateAt; |
| | | |
| | | /** |
| | | * 身份证 |
| | | */ |
| | | @ApiModelProperty(value = "身份证") |
| | | private String idCard; |
| | | |
| | | /** |
| | | * 分类id |
| | | */ |
| | | @ApiModelProperty(value = "分类id") |
| | | private Long skillType; |
| | | |
| | | /** |
| | | * 入职时间 |
| | | */ |
| | | @ApiModelProperty(value = "入职时间") |
| | | private Date joinTime; |
| | | |
| | | /** |
| | | * 住址 |
| | | */ |
| | | @ApiModelProperty(value = "住址") |
| | | private String address; |
| | | |
| | | /** |
| | | * 图片 |
| | | */ |
| | | @ApiModelProperty(value = "图片") |
| | | private String image; |
| | | |
| | | /** |
| | | * 学历 |
| | | */ |
| | | @ApiModelProperty(value = "学历") |
| | | private String education; |
| | | |
| | | /** |
| | | * 政治面貌 |
| | | */ |
| | | @ApiModelProperty(value = "政治面貌") |
| | | private String politicalOutlook; |
| | | |
| | | /** |
| | | * 民族 |
| | | */ |
| | | @ApiModelProperty(value = "民族") |
| | | private String nation; |
| | | |
| | | /** |
| | | * 是否证件 0否 1是 |
| | | */ |
| | | @ApiModelProperty(value = "是否证件 0否 1是") |
| | | private Integer credential; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.civil; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * |
| | | * @author cedoo email:cedoo(a)qq.com |
| | | * @version 1.0 |
| | | * @since 1.0 |
| | | * @date 2021-06-03 |
| | | * */ |
| | | @Data |
| | | @ApiModel("社工返回参数") |
| | | public class ComActSocialWorkerVO { |
| | | |
| | | @ApiModelProperty(value = "ID") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "所属组织ID") |
| | | private String socialOrgId; |
| | | |
| | | @ApiModelProperty(value = "姓名") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "联系电话") |
| | | private String telephone; |
| | | |
| | | @ApiModelProperty(value = "性别0女1男") |
| | | private String gen; |
| | | |
| | | @ApiModelProperty(value = "所属街道") |
| | | private String streetId; |
| | | |
| | | @ApiModelProperty(value = "所属社区") |
| | | private String communityId; |
| | | |
| | | @ApiModelProperty(value = "创建人") |
| | | private Long createBy; |
| | | |
| | | @ApiModelProperty(value = "创建时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createAt; |
| | | |
| | | @ApiModelProperty(value = "更新人") |
| | | private Long updateBy; |
| | | |
| | | @ApiModelProperty(value = "更新时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date updateAt; |
| | | |
| | | /** |
| | | * 身份证 |
| | | */ |
| | | @ApiModelProperty(value = "身份证") |
| | | private String idCard; |
| | | |
| | | /** |
| | | * 分类id |
| | | */ |
| | | @ApiModelProperty(value = "分类id") |
| | | private Long skillType; |
| | | |
| | | /** |
| | | * 入职时间 |
| | | */ |
| | | @ApiModelProperty(value = "入职时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date joinTime; |
| | | |
| | | /** |
| | | * 住址 |
| | | */ |
| | | @ApiModelProperty(value = "住址") |
| | | private String address; |
| | | |
| | | /** |
| | | * 图片 |
| | | */ |
| | | @ApiModelProperty(value = "图片") |
| | | private String image; |
| | | |
| | | /** |
| | | * 学历 |
| | | */ |
| | | @ApiModelProperty(value = "学历") |
| | | private String education; |
| | | |
| | | /** |
| | | * 政治面貌 |
| | | */ |
| | | @ApiModelProperty(value = "政治面貌") |
| | | private String politicalOutlook; |
| | | |
| | | /** |
| | | * 民族 |
| | | */ |
| | | @ApiModelProperty(value = "民族") |
| | | private String nation; |
| | | |
| | | /** |
| | | * 是否证件 0否 1是 |
| | | */ |
| | | @ApiModelProperty(value = "是否证件 0否 1是") |
| | | private Integer credential; |
| | | |
| | | @ApiModelProperty(value = "分类名称") |
| | | private String skillName; |
| | | } |
| | |
| | | |
| | | @ApiModelProperty("社区名称") |
| | | private String communityName; |
| | | |
| | | @ApiModelProperty("政策分类: 1-社工人才政策 2-社会组织培育政策 3-其他政策") |
| | | private Integer policyType; |
| | | } |
| | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | import com.panzhihua.common.model.dtos.civil.*; |
| | | import com.panzhihua.common.model.dtos.community.warehouse.ComActWarehouseApplyDTO; |
| | | import com.panzhihua.common.model.dtos.community.GetIdentityEidTokenDTO; |
| | | import com.panzhihua.common.model.dtos.community.*; |
| | |
| | | import com.panzhihua.common.model.dtos.community.elder.SignElderAuthStatisticDTO; |
| | | import com.panzhihua.common.model.dtos.neighbor.*; |
| | | import com.panzhihua.common.model.vos.*; |
| | | import com.panzhihua.common.model.vos.civil.ComActSocialWorkerDetailsVO; |
| | | import com.panzhihua.common.model.vos.community.*; |
| | | import com.panzhihua.common.model.vos.community.cluster.admin.ComClusterMemberExcelVO; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | */ |
| | | @GetMapping("/comActSocialMember/del") |
| | | public R comActSocialMemberDelete(@RequestParam("id") Long id); |
| | | |
| | | /** |
| | | * 新增社工 |
| | | * @param comActSocialWorkerAddDTO |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping("/comactsocialworker/add") |
| | | R addComactsocialworker(@RequestBody ComActSocialWorkerAddDTO comActSocialWorkerAddDTO); |
| | | |
| | | /** |
| | | * 修改社工 |
| | | * @param comActSocialWorkerEditDTO |
| | | * @return 维护结果 |
| | | */ |
| | | @PostMapping("/comactsocialworker/edit") |
| | | R editComactsocialworker(@RequestBody ComActSocialWorkerEditDTO comActSocialWorkerEditDTO); |
| | | |
| | | /** |
| | | * 分页查找社工 |
| | | * @param pageComActSocialWorkerDTO |
| | | * @return 维护结果 |
| | | */ |
| | | @PostMapping("/comactsocialworker/page") |
| | | R queryComactsocialworker(@RequestBody PageComActSocialWorkerDTO pageComActSocialWorkerDTO);//返回 R<IPage<ComActSocialWorkerVO>> |
| | | |
| | | /** |
| | | * 删除社工 |
| | | * @param comActSocialWorkerDeleteDTO |
| | | * @return 平台用户信息 |
| | | */ |
| | | @PostMapping("/comactsocialworker/delete") |
| | | R deleteComactsocialworker(@RequestBody ComActSocialWorkerDeleteDTO comActSocialWorkerDeleteDTO); |
| | | |
| | | /** |
| | | * 查询社工详细信息 |
| | | * @param id 社工 id |
| | | * @return 查找结果 |
| | | */ |
| | | @PostMapping("/comactsocialworker/{id}") |
| | | R<ComActSocialWorkerDetailsVO> comActSocialWorkerDetails(@PathVariable("id") Long id); |
| | | |
| | | /** |
| | | * 批量导入社工 |
| | | * |
| | | * @param list 社工集合 |
| | | */ |
| | | @PostMapping("/comactsocialworker/input") |
| | | R listSaveSocialWorkerExcelVO(@RequestBody List<ComActSocialWorkerExcelVO> list, @RequestParam("communityId") Long communityId); |
| | | } |
New file |
| | |
| | | package com.panzhihua.community_backstage.api; |
| | | |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.alibaba.excel.ExcelWriter; |
| | | import com.alibaba.excel.write.metadata.WriteSheet; |
| | | import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.listen.ComActSocialWorkerExcelListen; |
| | | import com.panzhihua.common.listen.ComCvtServeExcelListen; |
| | | import com.panzhihua.common.model.dtos.civil.*; |
| | | import com.panzhihua.common.model.dtos.community.ExportUserDTO; |
| | | import com.panzhihua.common.model.dtos.user.EexcelUserDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.civil.ComActSocialWorkerDetailsVO; |
| | | import com.panzhihua.common.model.vos.civil.ComActSocialWorkerVO; |
| | | import com.panzhihua.common.model.vos.community.ComCvtServeExcelVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.utlis.ClazzUtils; |
| | | import com.panzhihua.common.utlis.SFTPUtil; |
| | | import com.panzhihua.community_backstage.excel.CustomSheetWriteHandler; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.io.File; |
| | | import java.io.FileInputStream; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.util.List; |
| | | import java.util.UUID; |
| | | |
| | | /** |
| | | * |
| | | * @author cedoo email:cedoo(a)qq.com |
| | | * @version 1.0 |
| | | * @since 1.0 |
| | | * @date 2021-06-03 |
| | | * */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/comactsocialworker") |
| | | @Api(tags = {"社工"}) |
| | | public class ComActSocialWorkerApi extends BaseController { |
| | | |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | @Value("${excel.comactsocialworkerUrl}") |
| | | private String comactsocialworkerUrl; |
| | | /** |
| | | * 新增社工 |
| | | * @param {classNameFirstLower}AddDTO 添加社工传递对象 |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping() |
| | | @ApiOperation(value = "新增社工", response = R.class) |
| | | R add(@Validated @RequestBody ComActSocialWorkerAddDTO comActSocialWorkerAddDTO){ |
| | | ClazzUtils.setIfStringIsEmpty(comActSocialWorkerAddDTO); |
| | | comActSocialWorkerAddDTO.setUserId(getUserId()); |
| | | comActSocialWorkerAddDTO.setCommunityId(getCommunityId()); |
| | | return communityService.addComactsocialworker(comActSocialWorkerAddDTO); |
| | | } |
| | | |
| | | /** |
| | | * 修改 |
| | | * @param comActSocialWorkerEditDTO 修改社工传递对象 |
| | | * @return 修改结果 |
| | | */ |
| | | @PutMapping() |
| | | @ApiOperation(value = "编辑社工", response = R.class) |
| | | R edit(@Validated @RequestBody ComActSocialWorkerEditDTO comActSocialWorkerEditDTO){ |
| | | ClazzUtils.setIfStringIsEmpty(comActSocialWorkerEditDTO); |
| | | comActSocialWorkerEditDTO.setUserId(getUserId()); |
| | | return communityService.editComactsocialworker(comActSocialWorkerEditDTO); |
| | | } |
| | | |
| | | /** |
| | | * 分页查找 |
| | | * @param pageComActSocialWorkerDTO 查找社工传递对象 |
| | | * @return 查找结果 |
| | | */ |
| | | @GetMapping() |
| | | @ApiOperation(value = "查询社工", response= ComActSocialWorkerVO.class) |
| | | R query(@Validated @ModelAttribute PageComActSocialWorkerDTO pageComActSocialWorkerDTO){ |
| | | ClazzUtils.setIfStringIsEmpty(pageComActSocialWorkerDTO); |
| | | pageComActSocialWorkerDTO.setCommunityId(this.getCommunityId()); |
| | | return communityService.queryComactsocialworker(pageComActSocialWorkerDTO); |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | * @param comActSocialWorkerDeleteDTO 删除社工传递对象 |
| | | * @return 删除结果 |
| | | */ |
| | | @DeleteMapping() |
| | | @ApiOperation(value = "删除社工", response = R.class) |
| | | R delete(@Validated @RequestBody ComActSocialWorkerDeleteDTO comActSocialWorkerDeleteDTO){ |
| | | ClazzUtils.setIfStringIsEmpty(comActSocialWorkerDeleteDTO); |
| | | return communityService.deleteComactsocialworker(comActSocialWorkerDeleteDTO); |
| | | } |
| | | |
| | | /** |
| | | * 查询社工详细信息 |
| | | * @param id 社工 id |
| | | * @return 查找结果 |
| | | */ |
| | | @GetMapping("/{id}") |
| | | @ApiOperation(value = "查询社工详细信息") |
| | | R<ComActSocialWorkerDetailsVO> details(@PathVariable("id") Long id){ |
| | | return communityService.comActSocialWorkerDetails(id); |
| | | } |
| | | |
| | | /** |
| | | * 导入社工名单 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "导入社工名单") |
| | | @PostMapping(value = "/import", consumes = "multipart/*", headers = "content-type=multipart/form-data") |
| | | public R downloadTemplate(@RequestParam MultipartFile file, HttpServletRequest request) { |
| | | String fileName = file.getOriginalFilename(); //获取文件名 |
| | | log.info("传入文件名字【{}】",fileName); |
| | | InputStream inputStream = null; |
| | | try { |
| | | inputStream = file.getInputStream(); |
| | | EasyExcel.read(inputStream, ComActSocialWorkerExcelVO.class, new ComActSocialWorkerExcelListen(communityService,this.getCommunityId())).sheet().doRead(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | log.error("导入模板失败【{}】", e.getMessage()); |
| | | return R.fail("信息有误"); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/getTemplate") |
| | | @ApiOperation("获取模板") |
| | | public R getTemplate(){ |
| | | return R.ok(comactsocialworkerUrl); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.api; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.api.ApiController; |
| | | import com.panzhihua.common.model.dtos.civil.*; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.vos.civil.ComActSocialWorkerDetailsVO; |
| | | import com.panzhihua.common.model.vos.civil.ComActSocialWorkerVO; |
| | | import com.panzhihua.service_community.entity.ComActSocialWorker; |
| | | import com.panzhihua.service_community.service.ComActSocialWorkerService; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 社工(ComActSocialWorker)表控制层 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-10-25 10:56:48 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("comActSocialWorker") |
| | | public class ComActSocialWorkerApi { |
| | | /** |
| | | * 服务对象 |
| | | */ |
| | | @Resource |
| | | private ComActSocialWorkerService comActSocialWorkerService; |
| | | |
| | | /** |
| | | * 新增社工 |
| | | * @param comActSocialWorkerAddDTO |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping("/add") |
| | | R add(@RequestBody ComActSocialWorkerAddDTO comActSocialWorkerAddDTO){ |
| | | return comActSocialWorkerService.add(comActSocialWorkerAddDTO); |
| | | }; |
| | | |
| | | /** |
| | | * 修改社工 |
| | | * @param comActSocialWorkerEditDTO |
| | | * @return 维护结果 |
| | | */ |
| | | @PostMapping("/edit") |
| | | R edit(@RequestBody ComActSocialWorkerEditDTO comActSocialWorkerEditDTO){ |
| | | return comActSocialWorkerService.edit(comActSocialWorkerEditDTO); |
| | | }; |
| | | |
| | | /** |
| | | * 分页查找社工 |
| | | * @param pageComActSocialWorkerDTO |
| | | * @return 维护结果 |
| | | */ |
| | | @PostMapping("/page") |
| | | R<IPage<ComActSocialWorkerVO>> query(@RequestBody PageComActSocialWorkerDTO pageComActSocialWorkerDTO){ |
| | | return comActSocialWorkerService.query(pageComActSocialWorkerDTO); |
| | | }; |
| | | |
| | | /** |
| | | * 删除社工 |
| | | * @param ComActSocialWorkerDeleteDTO |
| | | * @return 平台用户信息 |
| | | */ |
| | | @PostMapping("/delete") |
| | | R delete(@RequestBody ComActSocialWorkerDeleteDTO ComActSocialWorkerDeleteDTO){ |
| | | return comActSocialWorkerService.delete(ComActSocialWorkerDeleteDTO); |
| | | }; |
| | | |
| | | /** |
| | | * 查询社工详细信息 |
| | | * @param id 社工 id |
| | | * @return 查找结果 |
| | | */ |
| | | @PostMapping("/{id}") |
| | | R<ComActSocialWorkerDetailsVO> comActSocialWorkerDetails(@PathVariable("id") Long id){ |
| | | return comActSocialWorkerService.comActSocialWorkerDetails(id); |
| | | } |
| | | |
| | | /** |
| | | * 导入社工名单 |
| | | * @param list |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | @PostMapping("/input") |
| | | R export(@RequestBody List<ComActSocialWorkerExcelVO> list, @RequestParam("communityId") Long communityId){ |
| | | return comActSocialWorkerService.export(list,communityId); |
| | | }} |
New file |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.civil.ComActSocialExportVO; |
| | | import com.panzhihua.common.model.dtos.civil.ComActSocialWorkerExcelVO; |
| | | import com.panzhihua.common.model.dtos.civil.PageComActSocialWorkerDTO; |
| | | import com.panzhihua.common.model.vos.civil.ComActSocialWorkerVO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import com.panzhihua.service_community.entity.ComActSocialWorker; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 社工(ComActSocialWorker)表数据库访问层 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-10-25 10:56:47 |
| | | */ |
| | | @Mapper |
| | | public interface ComActSocialWorkerDao extends BaseMapper<ComActSocialWorker> { |
| | | /** |
| | | * 分页查询 |
| | | * @param pageComActSocialWorkerDTO |
| | | * @return |
| | | */ |
| | | IPage<ComActSocialWorkerVO> findByPage(Page page, @Param("pageComActSocialWorkerDTO") PageComActSocialWorkerDTO pageComActSocialWorkerDTO); |
| | | |
| | | List<ComActSocialWorkerExcelVO> queryAll(ComActSocialExportVO comActSocialWorkerDO); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.entity; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Builder; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | |
| | | /** |
| | | * 社工(ComActSocialWorker)表实体类 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-10-25 13:50:43 |
| | | */ |
| | | @Data |
| | | @Builder |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | @ApiModel("社工") |
| | | public class ComActSocialWorker implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 624699365201103858L; |
| | | |
| | | /** |
| | | * ID |
| | | */ |
| | | @ApiModelProperty(value = "ID") |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 所属组织ID |
| | | */ |
| | | @ApiModelProperty(value = "所属组织ID") |
| | | private Long socialOrgId; |
| | | |
| | | /** |
| | | * 姓名 |
| | | */ |
| | | @ApiModelProperty(value = "姓名") |
| | | private String name; |
| | | |
| | | /** |
| | | * 联系电话 |
| | | */ |
| | | @ApiModelProperty(value = "联系电话") |
| | | private String telephone; |
| | | |
| | | /** |
| | | * 性别0女1男 |
| | | */ |
| | | @ApiModelProperty(value = "性别0女1男") |
| | | private Integer gen; |
| | | |
| | | /** |
| | | * 所属街道 |
| | | */ |
| | | @ApiModelProperty(value = "所属街道") |
| | | private Long streetId; |
| | | |
| | | /** |
| | | * 所属社区 |
| | | */ |
| | | @ApiModelProperty(value = "所属社区") |
| | | private Long communityId; |
| | | |
| | | /** |
| | | * 创建人 |
| | | */ |
| | | @ApiModelProperty(value = "创建人") |
| | | private Long createBy; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @ApiModelProperty(value = "创建时间") |
| | | private Date createAt; |
| | | |
| | | /** |
| | | * 更新人 |
| | | */ |
| | | @ApiModelProperty(value = "更新人") |
| | | private Long updateBy; |
| | | |
| | | /** |
| | | * 更新时间 |
| | | */ |
| | | @ApiModelProperty(value = "更新时间") |
| | | private Date updateAt; |
| | | |
| | | /** |
| | | * 身份证 |
| | | */ |
| | | @ApiModelProperty(value = "身份证") |
| | | private String idCard; |
| | | |
| | | /** |
| | | * 分类id |
| | | */ |
| | | @ApiModelProperty(value = "分类id") |
| | | private Long skillType; |
| | | |
| | | /** |
| | | * 入职时间 |
| | | */ |
| | | @ApiModelProperty(value = "入职时间") |
| | | private Date joinTime; |
| | | |
| | | /** |
| | | * 住址 |
| | | */ |
| | | @ApiModelProperty(value = "住址") |
| | | private String address; |
| | | |
| | | /** |
| | | * 图片 |
| | | */ |
| | | @ApiModelProperty(value = "图片") |
| | | private String image; |
| | | |
| | | /** |
| | | * 学历 |
| | | */ |
| | | @ApiModelProperty(value = "学历") |
| | | private String education; |
| | | |
| | | /** |
| | | * 政治面貌 |
| | | */ |
| | | @ApiModelProperty(value = "政治面貌") |
| | | private String politicalOutlook; |
| | | |
| | | /** |
| | | * 民族 |
| | | */ |
| | | @ApiModelProperty(value = "民族") |
| | | private String nation; |
| | | |
| | | /** |
| | | * 是否证件 0否 1是 |
| | | */ |
| | | @ApiModelProperty(value = "是否证件 0否 1是") |
| | | private Integer credential; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.panzhihua.common.model.dtos.civil.*; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.common.model.vos.civil.ComActSocialWorkerDetailsVO; |
| | | import com.panzhihua.common.model.vos.civil.ComActSocialWorkerVO; |
| | | import com.panzhihua.service_community.entity.ComActSocialWorker; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 社工(ComActSocialWorker)表服务接口 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-10-25 10:56:47 |
| | | */ |
| | | public interface ComActSocialWorkerService extends IService<ComActSocialWorker> { |
| | | /** |
| | | * 新增社工 |
| | | * @param comActSocialWorkerAddDTO |
| | | * @return 新增结果 |
| | | */ |
| | | R add(ComActSocialWorkerAddDTO comActSocialWorkerAddDTO); |
| | | |
| | | /** |
| | | * 修改社工 |
| | | * @param comActSocialWorkerEditDTO |
| | | * @return 维护结果 |
| | | */ |
| | | R edit(ComActSocialWorkerEditDTO comActSocialWorkerEditDTO); |
| | | |
| | | /** |
| | | * 分页查找社工 |
| | | * @param pageComActSocialWorkerDTO |
| | | * @return 维护结果 |
| | | */ |
| | | R<IPage<ComActSocialWorkerVO>> query(PageComActSocialWorkerDTO pageComActSocialWorkerDTO); |
| | | |
| | | /** |
| | | * 删除社工 |
| | | * @param ComActSocialWorkerDeleteDTO |
| | | * @return 平台用户信息 |
| | | */ |
| | | R delete(ComActSocialWorkerDeleteDTO ComActSocialWorkerDeleteDTO); |
| | | |
| | | /** |
| | | * 查询社工详细信息 |
| | | * @param id 社工 id |
| | | * @return 查找结果 |
| | | */ |
| | | R<ComActSocialWorkerDetailsVO> comActSocialWorkerDetails(Long id); |
| | | |
| | | R export(List<ComActSocialWorkerExcelVO> lis, Long communityId); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.dtos.civil.*; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.civil.ComActSocialWorkerDetailsVO; |
| | | import com.panzhihua.common.model.vos.civil.ComActSocialWorkerVO; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import com.panzhihua.service_community.dao.ComActDAO; |
| | | import com.panzhihua.service_community.dao.ComActSocialOrgDao; |
| | | import com.panzhihua.service_community.dao.ComStreetDAO; |
| | | import com.panzhihua.service_community.entity.ComActSocialOrg; |
| | | import com.panzhihua.service_community.entity.ComActSocialWorker; |
| | | import com.panzhihua.service_community.dao.ComActSocialWorkerDao; |
| | | import com.panzhihua.service_community.model.dos.ComActDO; |
| | | import com.panzhihua.service_community.model.dos.ComStreetDO; |
| | | import com.panzhihua.service_community.service.ComActSocialWorkerService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 社工(ComActSocialWorker)表服务实现类 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-10-25 10:56:48 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class ComActSocialWorkerServiceImpl extends ServiceImpl<ComActSocialWorkerDao, ComActSocialWorker> implements ComActSocialWorkerService { |
| | | @Resource |
| | | private ComActSocialWorkerDao comActSocialWorkerMapper; |
| | | @Resource |
| | | private ComStreetDAO comStreetDAO; |
| | | @Resource |
| | | private ComActSocialOrgDao comActSocialOrgMapper; |
| | | @Resource |
| | | private ComActDAO comActDAO; |
| | | /** |
| | | * 新增社工 |
| | | * @param comActSocialWorkerAddDTO |
| | | * @return 新增结果 |
| | | */ |
| | | @Override |
| | | public R add(ComActSocialWorkerAddDTO comActSocialWorkerAddDTO){ |
| | | ComActSocialWorker comActSocialWorkerDO = new ComActSocialWorker(); |
| | | BeanUtils.copyProperties(comActSocialWorkerAddDTO, comActSocialWorkerDO); |
| | | comActSocialWorkerDO.setCreateBy(comActSocialWorkerAddDTO.getUserId()); |
| | | if(comActSocialWorkerMapper.insert(comActSocialWorkerDO)>0){ |
| | | return R.ok(); |
| | | } |
| | | return R.fail(); |
| | | } |
| | | |
| | | /** |
| | | * 修改社工 |
| | | * @param comActSocialWorkerEditDTO |
| | | * @return 维护结果 |
| | | */ |
| | | @Override |
| | | public R edit(ComActSocialWorkerEditDTO comActSocialWorkerEditDTO){ |
| | | ComActSocialWorker comActSocialWorkerDO = new ComActSocialWorker(); |
| | | BeanUtils.copyProperties(comActSocialWorkerEditDTO, comActSocialWorkerDO); |
| | | //comActSocialWorkerDO.setUpdateAt(new Date()); |
| | | if(comActSocialWorkerMapper.updateById(comActSocialWorkerDO)>0){ |
| | | return R.ok(); |
| | | } |
| | | return R.fail(); |
| | | } |
| | | |
| | | /** |
| | | * 分页查找社工 |
| | | * @param pageComActSocialWorkerDTO |
| | | * @return 维护结果 |
| | | */ |
| | | @Override |
| | | public R<IPage<ComActSocialWorkerVO>> query(PageComActSocialWorkerDTO pageComActSocialWorkerDTO){ |
| | | Page page = new Page(1,10); |
| | | if(pageComActSocialWorkerDTO.getPageNum()!=null) { |
| | | page.setCurrent(pageComActSocialWorkerDTO.getPageNum()); |
| | | } |
| | | if(pageComActSocialWorkerDTO.getPageSize()!=null) { |
| | | page.setSize(pageComActSocialWorkerDTO.getPageSize()); |
| | | } |
| | | return R.ok(comActSocialWorkerMapper.findByPage(page, pageComActSocialWorkerDTO)); |
| | | } |
| | | |
| | | /** |
| | | * 删除社工 |
| | | * @param ComActSocialWorkerDeleteDTO |
| | | * @return 平台用户信息 |
| | | */ |
| | | @Override |
| | | public R delete(ComActSocialWorkerDeleteDTO ComActSocialWorkerDeleteDTO){ |
| | | return R.ok(this.comActSocialWorkerMapper.deleteById(ComActSocialWorkerDeleteDTO.getId())); |
| | | } |
| | | |
| | | /** |
| | | * 查询社工详细信息 |
| | | * @param id 社工 id |
| | | * @return 查找结果 |
| | | */ |
| | | @Override |
| | | public R<ComActSocialWorkerDetailsVO> comActSocialWorkerDetails(Long id){ |
| | | ComActSocialWorker comActSocialWorkerDO = comActSocialWorkerMapper.selectById(id); |
| | | if(comActSocialWorkerDO!=null) { |
| | | ComActSocialWorkerDetailsVO comActSocialWorkerDetailsVO = new ComActSocialWorkerDetailsVO(); |
| | | BeanUtils.copyProperties(comActSocialWorkerDO, comActSocialWorkerDetailsVO); |
| | | return R.ok(comActSocialWorkerDetailsVO); |
| | | } |
| | | return R.fail(); |
| | | } |
| | | |
| | | @Override |
| | | public R export(List<ComActSocialWorkerExcelVO> lis, Long communityId) { |
| | | if(!CollectionUtils.isEmpty(lis)){ |
| | | List<ComActSocialWorker> list=new ArrayList<>(); |
| | | for(ComActSocialWorkerExcelVO comActSocialWorkerExcelVO:lis) { |
| | | ComActSocialWorker comActSocialWorkerDO = new ComActSocialWorker(); |
| | | BeanUtils.copyProperties(comActSocialWorkerExcelVO,comActSocialWorkerDO); |
| | | if (StringUtils.isNotEmpty(comActSocialWorkerExcelVO.getStreetId())) { |
| | | ComStreetDO comStreetDO=comStreetDAO.selectOne(new QueryWrapper<ComStreetDO>().eq("name",comActSocialWorkerExcelVO.getStreetId())); |
| | | if(comStreetDO!=null){ |
| | | comActSocialWorkerDO.setStreetId(comStreetDO.getStreetId()); |
| | | } |
| | | } |
| | | if (StringUtils.isNotEmpty(comActSocialWorkerExcelVO.getSocialOrgId())) { |
| | | ComActSocialOrg comActSocialOrgDO=comActSocialOrgMapper.selectOne(new QueryWrapper<ComActSocialOrg>().eq("name",comActSocialWorkerExcelVO.getSocialOrgId())); |
| | | if(comActSocialOrgDO!=null){ |
| | | comActSocialWorkerDO.setSocialOrgId(comActSocialOrgDO.getId()); |
| | | } |
| | | } |
| | | if(StringUtils.isNotEmpty(comActSocialWorkerExcelVO.getCommunityId())){ |
| | | ComActDO comActDO= comActDAO.selectOne(new QueryWrapper<ComActDO>().eq("name",comActSocialWorkerExcelVO.getCommunityId())); |
| | | if(comActDO!=null){ |
| | | comActSocialWorkerDO.setCommunityId(comActDO.getCommunityId()); |
| | | } |
| | | } |
| | | if(StringUtils.isNotEmpty(comActSocialWorkerExcelVO.getGen())){ |
| | | if("男".equals(comActSocialWorkerExcelVO.getGen())){ |
| | | comActSocialWorkerDO.setGen(1); |
| | | } |
| | | else { |
| | | comActSocialWorkerDO.setGen(0); |
| | | } |
| | | } |
| | | list.add(comActSocialWorkerDO); |
| | | } |
| | | this.saveBatch(list); |
| | | } |
| | | |
| | | return R.ok(); |
| | | } |
| | | } |
New file |
| | |
| | | <?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.panzhihua.service_community.dao.ComActSocialWorkerDao"> |
| | | |
| | | <resultMap type="com.panzhihua.service_community.entity.ComActSocialWorker" id="ComActSocialWorkerBaseResultMap"> |
| | | <result property="id" column="id"/> |
| | | <result property="socialOrgId" column="social_org_id"/> |
| | | <result property="name" column="name"/> |
| | | <result property="telephone" column="telephone"/> |
| | | <result property="gen" column="gen"/> |
| | | <result property="streetId" column="street_id"/> |
| | | <result property="communityId" column="community_id"/> |
| | | <result property="createBy" column="create_by"/> |
| | | <result property="createAt" column="create_at"/> |
| | | <result property="updateBy" column="update_by"/> |
| | | <result property="updateAt" column="update_at"/> |
| | | <result property="idCard" column="id_card"/> |
| | | <result property="skillType" column="skill_type"/> |
| | | <result property="joinTime" column="join_time"/> |
| | | <result property="address" column="address"/> |
| | | <result property="image" column="image"/> |
| | | </resultMap> |
| | | |
| | | <!-- 分页查询 --> |
| | | <select id="findByPage" resultType="com.panzhihua.common.model.vos.civil.ComActSocialWorkerVO" |
| | | parameterType="com.panzhihua.common.model.dtos.civil.PageComActSocialWorkerDTO"> |
| | | SELECT a.*,b.name as socialOrgId,c.name as communityId,e.name as streetId,f.name as skillName |
| | | FROM com_act_social_worker a left join com_act_social_org b on a.social_org_id = b.id |
| | | left join com_act c on a.community_id = c.community_id |
| | | left join com_street e on a.street_id = e.street_id |
| | | left join com_act_column f on a.skill_type = f.id |
| | | <where> |
| | | <if test="pageComActSocialWorkerDTO.id!=null"> |
| | | AND a.id = #{pageComActSocialWorkerDTO.id} |
| | | </if> |
| | | <if test="pageComActSocialWorkerDTO.socialOrgId!=null"> |
| | | AND a.social_org_id = #{pageComActSocialWorkerDTO.socialOrgId} |
| | | </if> |
| | | <if test="pageComActSocialWorkerDTO.name!=null"> |
| | | AND a.name = #{pageComActSocialWorkerDTO.name} |
| | | </if> |
| | | <if test="pageComActSocialWorkerDTO.telephone!=null"> |
| | | AND a.telephone = #{pageComActSocialWorkerDTO.telephone} |
| | | </if> |
| | | <if test="pageComActSocialWorkerDTO.gen!=null"> |
| | | AND a.gen = #{pageComActSocialWorkerDTO.gen} |
| | | </if> |
| | | <if test="pageComActSocialWorkerDTO.streetId!=null"> |
| | | AND a.street_id = #{pageComActSocialWorkerDTO.streetId} |
| | | </if> |
| | | <if test="pageComActSocialWorkerDTO.communityId!=null and pageComActSocialWorkerDTO.communityId!=0"> |
| | | AND a.community_id = #{pageComActSocialWorkerDTO.communityId} |
| | | </if> |
| | | <if test="pageComActSocialWorkerDTO.createBy!=null"> |
| | | AND a.create_by = #{pageComActSocialWorkerDTO.createBy} |
| | | </if> |
| | | <if test="pageComActSocialWorkerDTO.createAtBegin!=null"> |
| | | AND a.create_at >= #{pageComActSocialWorkerDTO.createAtBegin} |
| | | </if> |
| | | <if test="pageComActSocialWorkerDTO.createAtEnd!=null"> |
| | | AND a.create_at <= #{pageComActSocialWorkerDTO.createAtEnd} |
| | | </if> |
| | | <if test="pageComActSocialWorkerDTO.updateBy!=null"> |
| | | AND a.update_by = #{pageComActSocialWorkerDTO.updateBy} |
| | | </if> |
| | | <if test="pageComActSocialWorkerDTO.updateAtBegin!=null"> |
| | | AND a.update_at >= #{pageComActSocialWorkerDTO.updateAtBegin} |
| | | </if> |
| | | <if test="pageComActSocialWorkerDTO.updateAtEnd!=null"> |
| | | AND a.update_at <= #{pageComActSocialWorkerDTO.updateAtEnd} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="queryAll" resultType="com.panzhihua.common.model.dtos.civil.ComActSocialWorkerExcelVO"> |
| | | SELECT a.social_org_id,a.name as name,a.birthday,a.telephone,a.gen,a.social_worker_code,a.skill_field,a.business_scope,b.name as socialOrgId,c.name as communityId,e.name as streetId |
| | | FROM com_act_social_worker a left join com_act_social_org b on a.social_org_id = b.id |
| | | left join com_act c on a.community_id = c.community_id |
| | | left join com_street e on a.street_id = e.street_id |
| | | <where> |
| | | <if test="socialOrgId!=null"> |
| | | AND a.social_org_id = #{socialOrgId} |
| | | </if> |
| | | <if test="name!=null and name !=''"> |
| | | AND a.name like concat('%',#{name},'%') |
| | | </if> |
| | | <if test="streetId!=null"> |
| | | AND a.street_id = #{streetId} |
| | | </if> |
| | | <if test="communityId!=null and communityId!=0"> |
| | | AND a.community_id = #{communityId} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | </mapper> |
| | |
| | | // "</script>") |
| | | |
| | | @Select("<script> " + "SELECT\n" + "d.id,\n" + "d.title,\n" + "COUNT( u.id ) readingVolume,\n" + "d.`status`,\n" |
| | | + "d.publish_at,\n" + "d.content,\n" + "d.cover,\n" + "d.cover_mode,\n" + "d.dyn_type,\n" + "d.create_at \n" |
| | | + "d.publish_at,\n" + "d.content,\n" + "d.cover,\n" + "d.cover_mode,\n" + "d.dyn_type,\n" + "d.create_at,d.policy_type \n" |
| | | + "FROM\n" + "com_pb_dyn d\n" + "LEFT JOIN com_pb_dyn_user u ON d.id = u.dyn_id \n" |
| | | + "where d.type=#{partyBuildingComPbDynVO.type} \n" |
| | | + "<if test='partyBuildingComPbDynVO.communityId != null and partyBuildingComPbDynVO.communityId != 0'>" |
| | | + "and d.community_id = #{partyBuildingComPbDynVO.communityId} \n" + " </if> " |
| | | + "<if test='partyBuildingComPbDynVO.dynType != null and partyBuildingComPbDynVO.dynType != 0'>" |
| | | + "and d.dyn_type = #{partyBuildingComPbDynVO.dynType} \n" + " </if> " |
| | | + "<if test='partyBuildingComPbDynVO.policyType != null and partyBuildingComPbDynVO.policyType != 0'>" |
| | | + "and d.policy_type = #{partyBuildingComPbDynVO.policyType} \n" + " </if> " |
| | | + "<if test='partyBuildingComPbDynVO.title != null and partyBuildingComPbDynVO.title.trim() != ""'>" |
| | | + "and d.title like concat(#{partyBuildingComPbDynVO.title},'%') \n" + " </if> " |
| | | + "<if test='partyBuildingComPbDynVO.status != null and partyBuildingComPbDynVO.status != 0'>" |
| | |
| | | int timedTaskPartyBuildingStatus(); |
| | | |
| | | @Select("<script> " + "SELECT\n" + " distinct COUNT( u.id ) readingVolume,\n" |
| | | + " d.community_id, d.content, d.cover, d.cover_mode, d.create_at, d.create_by, d.dyn_type, d.id, d.publish_at, d.status, d.title, d.type, \n" |
| | | + " d.community_id, d.content, d.cover, d.cover_mode, d.create_at, d.create_by, d.dyn_type, d.id, d.publish_at, d.status, d.title, d.type,a.policy_type, \n" |
| | | + " act.name as createByName " + "FROM\n" |
| | | + "com_pb_dyn d LEFT JOIN com_act act ON d.community_id = act.community_id \n" |
| | | + "LEFT JOIN com_pb_dyn_user u ON d.id = u.dyn_id " + "where d.id = #{id} " + " group by d.id " + "</script>") |
| | |
| | | * 封面模式:1-小图展示 2-大图展示 |
| | | */ |
| | | private Integer coverMode; |
| | | /** |
| | | * 政策分类: 1-社工人才政策 2-社会组织培育政策 3-其他政策 |
| | | */ |
| | | private Integer policyType; |
| | | } |