Merge remote-tracking branch 'origin/dev-2.0' into dev-2.0
| | |
| | | import org.springframework.validation.annotation.Validated; |
| | | 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.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | |
| | | |
| | | @Api(tags = {"小程序-党员管理"}) |
| | | @Validated |
| | | @RestController("/applet/party-member") |
| | | @RestController |
| | | @RequestMapping("/applet/party-member") |
| | | @RequiredArgsConstructor(onConstructor_ = {@Lazy}) |
| | | public class PartyMemberController extends BaseController { |
| | | private final IPartyMemberService partyMemberService; |
| | |
| | | import cn.idev.excel.metadata.data.WriteCellData; |
| | | import cn.idev.excel.metadata.property.ExcelContentProperty; |
| | | import com.panzhihua.sangeshenbian.annotation.FastExcel; |
| | | import com.panzhihua.sangeshenbian.annotation.TargetEnum; |
| | | |
| | | import java.lang.reflect.Field; |
| | | import java.lang.reflect.Method; |
| | |
| | | //获取字段属性中的注解 |
| | | Field field = contentProperty.getField(); |
| | | //获取该字段所属枚举 |
| | | FastExcel fastExcel = field.getAnnotation(FastExcel.class); |
| | | TargetEnum targetEnum = field.getAnnotation(TargetEnum.class); |
| | | //获取注解中的枚举信息 |
| | | Class<? extends Enum> type = fastExcel.type(); |
| | | Class<? extends Enum> type = targetEnum.type(); |
| | | //获取枚举类的方法名 “getEnumByCode”就是自己编写的函数,Integer.class 指定入参类型 |
| | | Method codeOf = type.getMethod("getEnumByCode", Integer.class); |
| | | //反射执行方法,此方法得到的是一个枚举实例(具体得到什么,结合自身项目) |
| | |
| | | * @param query |
| | | * @param loginUserInfo |
| | | */ |
| | | List<ComplaintVO> getList(MgtComplaintQuery query, SystemUserVo loginUserInfo); |
| | | List<ComplaintVO> getList( @Param("query") MgtComplaintQuery query, @Param("loginUserInfo") SystemUserVo loginUserInfo); |
| | | |
| | | /** |
| | | * 管理后台-获取诉求详情 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | ComplaintVO getDetailBg(Long id); |
| | | } |
New file |
| | |
| | | package com.panzhihua.sangeshenbian.enums; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Getter; |
| | | |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum ComplaintExportEnum { |
| | | PROCESSING(0, "正在办理"), |
| | | EXTENDED(1, "延期办理"), |
| | | OVERDUE(2, "超时办理"), |
| | | COMPLETED(3, "已办结"), |
| | | REPORT_PENDING_AUDIT(4, "上报待审核"); |
| | | private final Integer code; |
| | | private final String desc; |
| | | |
| | | public static ComplaintExportEnum getEnumByCode(Integer code) { |
| | | for (ComplaintExportEnum e : ComplaintExportEnum.values()) { |
| | | if (e.code.equals(code)) { |
| | | return e; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | } |
| | |
| | | PROCESSING(0, "正在办理"), |
| | | EXTENDED(1, "延期办理"), |
| | | OVERDUE(2, "超时办理"), |
| | | COMPLETED(3, "已办结"); |
| | | COMPLETED(3, "已办结"), |
| | | REPORT_PENDING_AUDIT(4, "上报待审核"); |
| | | |
| | | private final int code; |
| | | private final String description; |
| | |
| | | package com.panzhihua.sangeshenbian.model.excel; |
| | | |
| | | import cn.idev.excel.annotation.ExcelProperty; |
| | | import com.panzhihua.sangeshenbian.annotation.TargetEnum; |
| | | import com.panzhihua.sangeshenbian.conveter.EConverter; |
| | | import com.panzhihua.sangeshenbian.enums.ComplaintExportEnum; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | |
| | | @Data |
| | | public class ComplaintExcel { |
| | | @ExcelProperty(value = "录入人") |
| | | private String nickname; |
| | | private String reportUserName; |
| | | |
| | | @ExcelProperty(value = "录入人联系方式") |
| | | private String phone; |
| | | private String reportUserPhone; |
| | | |
| | | @ExcelProperty(value = "群众姓名") |
| | | private String name; |
| | |
| | | @ExcelProperty(value = "详细地址描述") |
| | | private String detailedAddress; |
| | | |
| | | @ExcelProperty(value = "流转状态:0-正在办理 1-延期办理 2-超时办理 3-已办结 4-群众撤销 5-上报待审核 6-上级驳回 7-延期待审核") |
| | | @ExcelProperty(value = "状态",converter = EConverter.class) |
| | | @TargetEnum(type = ComplaintExportEnum.class) |
| | | private Integer status; |
| | | } |
| | |
| | | return this.lambdaQuery() |
| | | .eq(BcRegion::getRegionName, districtName) |
| | | .eq(BcRegion::getDeleteFlag, 0) |
| | | .eq(BcRegion::getHierarchyOrder, 2).last("LIMIT 1").one(); |
| | | .eq(BcRegion::getHierarchyOrder, 3).last("LIMIT 1").one(); |
| | | } |
| | | |
| | | @Override |
| | |
| | | response.setCharacterEncoding("utf-8"); |
| | | String fileName = URLEncoder.encode("诉求数据", "UTF-8").replaceAll("\\+", "%20"); |
| | | response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx"); |
| | | EasyExcel.write(response.getOutputStream(), PartyMemberExcel.class) |
| | | EasyExcel.write(response.getOutputStream(), ComplaintExcel.class) |
| | | .sheet("诉求数据") |
| | | .doWrite(complaintExcels); |
| | | } |
| | | |
| | | @Override |
| | | public void downloadFile(Long id,Integer type) throws IOException { |
| | | Complaint complaint = getById(id); |
| | | Complaint complaint = baseMapper.getDetailBg(id); |
| | | if (Objects.isNull(complaint)) { |
| | | throw new ServiceException("该诉求不存在"); |
| | | } |
| | |
| | | BcRegion region = bcRegionService.getDistrictByCode(complaint.getDistrictsCode().toString()); |
| | | ComStreet street = comStreetService.getById(complaint.getStreetId().toString()); |
| | | ComAct act = comActService.getById(complaint.getCommunityId()); |
| | | String community = region.getRegionName() +"-"+ street.getName() + act.getName(); |
| | | String community = region.getRegionName() +"-"+ street.getName() + "-"+ act.getName(); |
| | | PartyMember partyMember = null; |
| | | if (Objects.nonNull(complaint.getPartyMemberId())){ |
| | | partyMember = partyMemberService.getById(complaint.getPartyMemberId()); |
| | |
| | | map.put("community", community); |
| | | map.put("problemType", complaint.getProblemType()); |
| | | map.put("descriptionContent", complaint.getDescriptionContent()); |
| | | map.put("reportType", ReportTypeEnum.fromCode(complaint.getReportType())); //TODO待修改 |
| | | map.put("reportType", ReportTypeEnum.fromCode(complaint.getReportType()).getDescription()); |
| | | map.put("partyOrganization",Objects.nonNull(partyMember)? partyMember.getPartyOrganization() : ""); |
| | | map.put("name", complaint.getName()); |
| | | map.put("contactNumber", complaint.getContactNumber()); |
| | |
| | | // 验证社区是否存在且属于该街道 |
| | | // 实际代码应该是调用相应的Service查询社区信息 |
| | | ComAct comAct = comActService.getCommunityByNameAndStreet(communityName, comStreet.getStreetId()); |
| | | streetId = comStreet.getStreetId(); |
| | | communityId = comAct.getCommunityId(); |
| | | if (Objects.isNull(comAct)) { |
| | | isValid = false; |
| | | errorMsg.append("社区不存在或不属于所选街道; "); |
| | | } else { |
| | | streetId = comStreet.getStreetId(); |
| | | communityId = comAct.getCommunityId(); |
| | | } |
| | | } |
| | | } |
| | |
| | | @ApiModel("管理后台诉求管理查询数据传输对象") |
| | | public class MgtComplaintQuery extends BasePage { |
| | | @ApiModelProperty(value = "录入人") |
| | | private String nickname; |
| | | private String reportUserName; |
| | | |
| | | @ApiModelProperty(value = "联系方式") |
| | | private String phone; |
| | | @ApiModelProperty(value = "录入人联系方式") |
| | | private String reportUserPhone; |
| | | |
| | | @ApiModelProperty(value = "群众姓名") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "群众联系方式") |
| | | private String contactNumber; |
| | | |
| | | @ApiModelProperty(value = "发生时间-开始") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date startTime; |
| | |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | @Data |
| | | @ApiModel("党员申请传输对象") |
| | |
| | | private String community; |
| | | |
| | | @ApiModelProperty(value = "社区ID") |
| | | @NotBlank(message = "社区ID不能空") |
| | | @NotNull(message = "社区ID不能空") |
| | | private Long communityId; |
| | | |
| | | @ApiModelProperty(value = "服务对象") |
| | |
| | | <if test="query.status!=null and query.status == 0"> |
| | | AND t.status = #{query.status} |
| | | </if> |
| | | <if test="query.nickname != null and query.nickname!=''"> |
| | | |
| | | <if test="query.reportUserName != null and query.reportUserName!=''"> |
| | | AND t.report_user_name LIKE CONCAT('%',#{query.reportUserName},'%') |
| | | </if> |
| | | <if test="query.phone != null and query.phone!=''"> |
| | | |
| | | <if test="query.reportUserPhone != null and query.reportUserPhone!=''"> |
| | | AND t.report_user_phone LIKE CONCAT('%',#{query.phone},'%') |
| | | </if> |
| | | <if test="query.name != null and query.name!=''"> |
| | | AND t.name LIKE CONCAT('%',#{query.name},'%') |
| | | </if> |
| | | <if test="query.contactNumber != null and query.contactNumber!=''"> |
| | | AND t.contact_number LIKE CONCAT('%',#{query.contactNumber},'%') |
| | | </if> |
| | | <if test="query.startTime != null and query.endTime!=null"> |
| | | AND t.create_time BETWEEN #{query.startTime} AND #{query.endTime} |
| | |
| | | AND t.problem_type =#{query.problemType} |
| | | </if> |
| | | </where> |
| | | GROUP BY t.id |
| | | ORDER BY t.create_time DESC |
| | | </select> |
| | | <select id="getList" resultType="com.panzhihua.sangeshenbian.model.vo.ComplaintVO"> |
| | |
| | | sc.images, |
| | | sc.videos, |
| | | CASE |
| | | WHEN sc.status = 0 and scar.audit_type = 1 AND scar.audit_status = 0 THEN 7 |
| | | WHEN sc.status = 0 and scar.audit_type = 2 AND scar.audit_status = 0 THEN 5 |
| | | WHEN sc.status = 0 and scar.audit_status = 2 THEN 6 |
| | | WHEN sc.status = 0 and scar.audit_type = 1 AND scar.audit_status = 0 THEN 4 |
| | | WHEN sc.status = 0 and scar.audit_type = 2 AND scar.audit_status = 0 THEN 4 |
| | | ELSE sc.status |
| | | END AS status, |
| | | sc.report_type, |
| | | sc.report_user_name, |
| | | sc.report_user_phone, |
| | | sc.superior_id, |
| | | sc.city_code, |
| | | sc.districts_code, |
| | |
| | | INNER JOIN sgsb_complaint_audit_record scar ON scar.complaint_id = sc.id and scar.latest_flag = 1 |
| | | ) AS t |
| | | <where> |
| | | scar.latest_flag = 1 |
| | | <if test="1 == loginUserInfo.accountLevel"> |
| | | and t.city_code = 510400 |
| | | </if> |
| | |
| | | <if test="query.status!=null and query.status == 0"> |
| | | AND t.status = #{query.status} |
| | | </if> |
| | | <if test="query.nickname != null and query.nickname!=''"> |
| | | |
| | | <if test="query.reportUserName != null and query.reportUserName!=''"> |
| | | AND t.report_user_name LIKE CONCAT('%',#{query.reportUserName},'%') |
| | | </if> |
| | | <if test="query.phone != null and query.phone!=''"> |
| | | |
| | | <if test="query.reportUserPhone != null and query.reportUserPhone!=''"> |
| | | AND t.report_user_phone LIKE CONCAT('%',#{query.phone},'%') |
| | | </if> |
| | | <if test="query.name != null and query.name!=''"> |
| | | AND t.name LIKE CONCAT('%',#{query.name},'%') |
| | | </if> |
| | | <if test="query.contactNumber != null and query.contactNumber!=''"> |
| | | AND t.contact_number LIKE CONCAT('%',#{query.contactNumber},'%') |
| | | </if> |
| | | <if test="query.startTime != null and query.endTime!=null"> |
| | | AND t.create_time BETWEEN #{query.startTime} AND #{query.endTime} |
| | |
| | | AND t.problem_type =#{query.problemType} |
| | | </if> |
| | | </where> |
| | | GROUP BY t.id |
| | | ORDER BY t.create_time DESC |
| | | </select> |
| | | |
| | |
| | | <select id="getTimeoutAndNotComment" resultType="com.panzhihua.sangeshenbian.model.entity.Complaint"> |
| | | select * from sgsb_complaint where status = 3 and DATE_ADD(completion_time, INTERVAL 10 DAY) <= NOW() and id not in (select complaint_id from sgsb_complaint_comment where del_flag = 0) |
| | | </select> |
| | | <select id="getDetailBg" resultType="com.panzhihua.sangeshenbian.model.vo.ComplaintVO" |
| | | parameterType="java.lang.Long"> |
| | | SELECT * FROM( |
| | | SELECT sc.id, |
| | | sc.serial_number, |
| | | sc.time, |
| | | sc.problem_type, |
| | | sc.name, |
| | | sc.contact_number, |
| | | sc.location, |
| | | sc.detailed_address, |
| | | sc.description_title, |
| | | sc.description_content, |
| | | sc.images, |
| | | sc.videos, |
| | | CASE |
| | | WHEN sc.status = 0 and scar.audit_type = 1 AND scar.audit_status = 0 THEN 4 |
| | | WHEN sc.status = 0 and scar.audit_type = 2 AND scar.audit_status = 0 THEN 4 |
| | | ELSE sc.status |
| | | END AS status, |
| | | sc.report_type, |
| | | sc.report_user_name, |
| | | sc.report_user_phone, |
| | | sc.superior_id, |
| | | sc.city_code, |
| | | sc.districts_code, |
| | | sc.street_id, |
| | | sc.community_id, |
| | | sc.party_member_id, |
| | | sc.create_by, |
| | | sc.create_time, |
| | | sc.update_by, |
| | | sc.update_time, |
| | | sc.completion_description, |
| | | sc.completion_images, |
| | | sc.completion_videos, |
| | | sc.completion_other_description, |
| | | sc.completion_time, |
| | | sc.completion_user_id, |
| | | sc.completion_username, |
| | | sc.completion_user_phone, |
| | | sc.closing_time, |
| | | sc.over_time_days, |
| | | sc.latitude, |
| | | sc.longitude, |
| | | scar.audit_type, |
| | | scar.audit_status, |
| | | scar.comment, |
| | | scar.create_time AS reportTime, |
| | | scar.system_user_id, |
| | | scar.reporter, |
| | | scar.department_name, |
| | | scar.department_id |
| | | FROM sgsb_complaint sc |
| | | INNER JOIN sgsb_complaint_audit_record scar ON scar.complaint_id = sc.id and scar.latest_flag = 1 |
| | | ) AS t |
| | | WHERE t.id = #{id} |
| | | GROUP BY t.id |
| | | </select> |
| | | </mapper> |