springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/api/AnalyticStatisticsController.java
@@ -5,7 +5,7 @@ import com.panzhihua.common.controller.BaseController; import com.panzhihua.common.exceptions.ServiceException; import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.vos.sangeshenbian.SystemUserVo; import com.panzhihua.common.model.vos.west.SystemUserVo; import com.panzhihua.westcommittee.model.entity.*; import com.panzhihua.westcommittee.model.query.AnalyticStatisticsQuery; import com.panzhihua.westcommittee.model.vo.*; @@ -57,8 +57,8 @@ @PostMapping("/data") @ApiOperation(value = "分析统计", tags = {"西区纪委后台-分析统计"}) public R<AnalyticStatisticsDataVo> data(@Valid @RequestBody AnalyticStatisticsQuery query){ SystemUserVo loginUserInfoSanGeShenBian = getLoginUserInfoWest(); Integer id = loginUserInfoSanGeShenBian.getId(); SystemUserVo loginUserInfo = getLoginUserInfoWest(); Integer id = loginUserInfo.getId(); List<SystemUserLevel> listBySystemUsers = systemUserLevelService.getListBySystemUserId(id); if(listBySystemUsers.size()==0){ // 没有权限 @@ -194,8 +194,8 @@ @GetMapping("/getRegion") @ApiOperation(value = "分析统计--获取市-区县-街道-社区", tags = {"西区纪委后台-分析统计--获取市-区县-街道-社区"}) public R<AnalyticStatisticsRegionVo> getRegion(){ SystemUserVo loginUserInfoSanGeShenBian = getLoginUserInfoWest(); Integer id = loginUserInfoSanGeShenBian.getId(); SystemUserVo loginUserInfo = getLoginUserInfoWest(); Integer id = loginUserInfo.getId(); List<SystemUserLevel> listBySystemUsers = systemUserLevelService.getListBySystemUserId(id); // 如果有市级权限 展示所有 SystemUserLevel systemUserLevel = listBySystemUsers.stream().filter(e -> e.getLevel() == 1).findFirst().orElse(null); springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/api/ComplaintRejectController.java
@@ -4,7 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.panzhihua.common.controller.BaseController; import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.vos.sangeshenbian.SystemUserVo; import com.panzhihua.common.model.vos.west.SystemUserVo; import com.panzhihua.westcommittee.model.entity.SystemUserLevel; import com.panzhihua.westcommittee.model.query.ComplaintRejectQuery; import com.panzhihua.westcommittee.model.vo.ComplaintRejectVo; @@ -42,8 +42,8 @@ @GetMapping("/list") @ApiOperation(value = "获取问题驳回统计列表", tags = {"西区纪委后台-问题驳回统计"}) public R<IPage<ComplaintRejectVo>> list(ComplaintRejectQuery query){ SystemUserVo loginUserInfoSanGeShenBian = getLoginUserInfoWest(); Integer id = loginUserInfoSanGeShenBian.getId(); SystemUserVo loginUserInfo = getLoginUserInfoWest(); Integer id = loginUserInfo.getId(); List<SystemUserLevel> listBySystemUsers = systemUserLevelService.getListBySystemUserId(id); SystemUserLevel systemUserLevel = listBySystemUsers.stream().filter(e -> e.getLevel() == 1).findFirst().orElse(null); List<String> districtsCodes=new ArrayList<>(); springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/api/DepartmentController.java
@@ -5,7 +5,7 @@ import com.panzhihua.common.controller.BaseController; import com.panzhihua.common.interfaces.OperLog; import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.vos.sangeshenbian.SystemUserVo; import com.panzhihua.common.model.vos.west.SystemUserVo; import com.panzhihua.common.utlis.StringUtils; import com.panzhihua.westcommittee.model.dto.UpdateStatusDeptDto; import com.panzhihua.westcommittee.model.entity.Department; springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/api/MgtComplaintController.java
@@ -3,7 +3,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.panzhihua.common.controller.BaseController; import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.vos.sangeshenbian.SystemUserVo; import com.panzhihua.common.model.vos.west.SystemUserVo; import com.panzhihua.westcommittee.annotation.SysLog; import com.panzhihua.westcommittee.model.dto.ComplaintProcessUpdateDto; import com.panzhihua.westcommittee.model.vo.ComplaintVO; springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/api/MgtPartyMemberController.java
@@ -4,7 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.panzhihua.common.controller.BaseController; import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.vos.sangeshenbian.SystemUserVo; import com.panzhihua.common.model.vos.west.SystemUserVo; import com.panzhihua.westcommittee.annotation.SysLog; import com.panzhihua.westcommittee.model.entity.PartyMember; import com.panzhihua.westcommittee.service.IPartyMemberService; springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/api/ScreenComplaintController.java
New file @@ -0,0 +1,41 @@ package com.panzhihua.westcommittee.api; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.panzhihua.common.controller.BaseController; import com.panzhihua.common.model.vos.R; import com.panzhihua.westcommittee.model.vo.ComplaintVO; import com.panzhihua.westcommittee.service.IComplaintService; import com.panzhihua.westcommittee.warpper.ScreenComplaintQuery; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import org.springframework.context.annotation.Lazy; import org.springframework.web.bind.annotation.*; import javax.validation.Valid; /** * @author mitao * @date 2025/3/14 */ @Api(tags = {"西区纪委大屏-诉求"}) @RequestMapping("/screen-complaint") @RestController @RequiredArgsConstructor(onConstructor_ = {@Lazy}) public class ScreenComplaintController extends BaseController { private final IComplaintService complaintService; @ApiOperation("诉求列表") @PostMapping("/page") public R<Page<ComplaintVO>> pageScreenList(@RequestBody @Valid ScreenComplaintQuery query) { return R.ok(complaintService.pageScreenList(query)); } @GetMapping("/detail") @ApiOperation("工单详情") public R<ComplaintVO> detailScreen(Long id) { return R.ok(complaintService.detailScreen(id)); } } springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/api/SystemUserController.java
@@ -7,7 +7,7 @@ import com.panzhihua.common.interfaces.OperLog; import com.panzhihua.common.model.vos.LoginReturnVO; import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.vos.sangeshenbian.SystemUserVo; import com.panzhihua.common.model.vos.west.SystemUserVo; import com.panzhihua.common.service.auth.TokenService; import com.panzhihua.westcommittee.annotation.SysLog; import com.panzhihua.westcommittee.model.entity.*; @@ -433,7 +433,7 @@ String jsapiTicket = SignatureUtil.getJsApiTicket(accessToken); String nonceStr = UUID.randomUUID().toString().replace("-", ""); String timestamp = String.valueOf(System.currentTimeMillis() / 1000); // String url = "https://huacheng.psciio.com/web/sangeshenbian/"; // 当前页面的URL,不包含#及其后面部分 // String url = "https://huacheng.psciio.com/web/west/"; // 当前页面的URL,不包含#及其后面部分 String url = "http://192.168.110.91:8080/#/pages/Appeal/Appeal/"; // 当前页面的URL,不包含#及其后面部分 String signature = SignatureUtil.getSignature(jsapiTicket, nonceStr, timestamp, url); springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/aspectj/OperLogAspect.java
@@ -2,7 +2,7 @@ import com.alibaba.fastjson.JSONObject; import com.panzhihua.common.controller.BaseController; import com.panzhihua.common.model.vos.sangeshenbian.SystemUserVo; import com.panzhihua.common.model.vos.west.SystemUserVo; import com.panzhihua.common.utlis.StringUtils; import com.panzhihua.westcommittee.annotation.SysLog; import com.panzhihua.westcommittee.model.entity.*; @@ -131,20 +131,14 @@ // 拿到返回原来的数据 JSONObject configData = jsonResult.getJSONObject("data"); String targetName=""; // 判断是否修改了诉求处理时间 if(workOrderItemConfig.getDemandProcessingTime()!=configData.getInteger("demandProcessingTime")){ targetName += "修改诉求处理时间、"; } // 判断是否修改了市级账号诉求处理时间 if(workOrderItemConfig.getCityHandlingTime()!=configData.getInteger("cityHandlingTime") || workOrderItemConfig.getDistrictHandlingTime()!=configData.getInteger("districtHandlingTime") if( workOrderItemConfig.getDistrictHandlingTime()!=configData.getInteger("districtHandlingTime") || workOrderItemConfig.getStreetHandlingTime()!=configData.getInteger("streetHandlingTime") || workOrderItemConfig.getCommunityHandlingTime()!=configData.getInteger("communityHandlingTime") || workOrderItemConfig.getPartyMemberHandlingTime()!=configData.getInteger("partyMemberHandlingTime")){ ){ targetName += "修改处理超时时间、"; } if(workOrderItemConfig.getCityDeadlineReminder()!=configData.getInteger("cityDeadlineReminder") || workOrderItemConfig.getDistrictDeadlineReminder()!=configData.getInteger("districtDeadlineReminder") if( workOrderItemConfig.getDistrictDeadlineReminder()!=configData.getInteger("districtDeadlineReminder") || workOrderItemConfig.getStreetDeadlineReminder()!=configData.getInteger("streetDeadlineReminder") || workOrderItemConfig.getCommunityDeadlineReminder()!=configData.getInteger("communityDeadlineReminder") ){ springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/controller/ComplaintController.java
@@ -16,6 +16,7 @@ import com.panzhihua.westcommittee.service.IComplaintCommentService; import com.panzhihua.westcommittee.service.IComplaintService; import com.panzhihua.westcommittee.service.IProblemTypeService; import com.panzhihua.westcommittee.warpper.GetHouseAddressQuery; import io.swagger.annotations.*; import lombok.RequiredArgsConstructor; import org.checkerframework.checker.units.qual.C; @@ -63,6 +64,14 @@ public R<?> save(@Valid @RequestBody Complaint complaint) { complaintService.saveComplaint(complaint, getLoginUserInfo()); return R.ok(); } @GetMapping("/getHouseAddress") @ApiOperation(value = "录入诉求-获取详细地址") public R<Page<String>> getHouseAddress(GetHouseAddressQuery query) { Page<String> addressList = complaintService.getHouseAddress(query); return R.ok(addressList); } /** @@ -281,6 +290,8 @@ complaint1.setCompletionVideos(null); complaint1.setCompletionOtherDescription(null); complaint1.setRemark(null); complaint1.setNowLevelTime(new Date()); complaint1.setRedispatch(1); complaintService.save(complaint1); } springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/dao/ComplaintAuditRecordMapper.java
@@ -17,10 +17,9 @@ */ public interface ComplaintAuditRecordMapper extends BaseMapper<ComplaintAuditRecord> { public List<ComplaintTimeout> getComplaintTimeout(@Param("cityDay") Integer cityDay, public List<ComplaintTimeout> getComplaintTimeout( @Param("districtDay") Integer districtDay, @Param("streetDay") Integer streetDay, @Param("communityDay") Integer communityDay, @Param("partyMemberDay") Integer partyMemberDay); @Param("communityDay") Integer communityDay); } springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/dao/ComplaintMapper.java
@@ -2,7 +2,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.panzhihua.common.model.vos.LoginUserInfoVO; import com.panzhihua.common.model.vos.sangeshenbian.SystemUserVo; import com.panzhihua.common.model.vos.west.SystemUserVo; import com.panzhihua.westcommittee.model.entity.Complaint; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.panzhihua.westcommittee.model.query.AppStaticsQuery; @@ -10,9 +10,12 @@ import com.panzhihua.westcommittee.model.vo.AppComplaintRejectVO; import com.panzhihua.westcommittee.model.vo.ComplaintTodoVO; import com.panzhihua.westcommittee.model.vo.ComplaintVO; import com.panzhihua.westcommittee.warpper.GetHouseAddressQuery; import com.panzhihua.westcommittee.warpper.MgtComplaintQuery; import com.panzhihua.westcommittee.warpper.ScreenComplaintQuery; import org.apache.ibatis.annotations.Param; import javax.validation.constraints.NotBlank; import java.util.List; /** @@ -125,4 +128,12 @@ Page<ComplaintVO> selectComplaintPage6(@Param("page") Page<ComplaintVO> page, @Param("query") ComplaintQuery query, @Param("communityId") Long communityId, @Param("ids") List<Integer> ids); Page<ComplaintVO> pageScreenList(@Param("page") Page<ComplaintVO> page, @Param("query") ScreenComplaintQuery query); Page<String> getHouseAddress(@Param("page") Page<String> page, @Param("address") String address); String getHouseAddressFromId(@Param("houseId") String houseId); } springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/dao/PartyMemberMapper.java
@@ -1,7 +1,7 @@ package com.panzhihua.westcommittee.dao; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.panzhihua.common.model.vos.sangeshenbian.SystemUserVo; import com.panzhihua.common.model.vos.west.SystemUserVo; import com.panzhihua.westcommittee.model.entity.PartyMember; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.panzhihua.westcommittee.warpper.PartyMemberQuery; springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/model/dto/ComplaintTimeout.java
@@ -12,4 +12,6 @@ private Integer reportType; private Integer superiorId; private Date closingTime; private Integer nowLevel; } springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/model/entity/Complaint.java
@@ -250,4 +250,14 @@ @ApiModelProperty("分配说明") private String remark; @ApiModelProperty("当前层级时间") @TableField("now_level_time") private Date nowLevelTime; @ApiModelProperty("是否重新派单 0否 1是") @TableField("redispatch") private Integer redispatch; } springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/model/entity/WorkOrderItemConfig.java
@@ -20,12 +20,6 @@ @TableId(value = "id", type = IdType.AUTO) private Integer id; /** * 市级账号诉求处理时间 */ @TableField("city_handling_time") @ApiModelProperty(value = "市级账号诉求处理时间", required = true) private Integer cityHandlingTime; /** * 区县级账号诉求处理时间 */ @TableField("district_handling_time") @@ -44,18 +38,6 @@ @ApiModelProperty(value = "社区级账号诉求处理时间", required = true) private Integer communityHandlingTime; /** * 党员级账号诉求处理时间 */ @TableField("party_member_handling_time") @ApiModelProperty(value = "党员级账号诉求处理时间", required = true) private Integer partyMemberHandlingTime; /** * 市级账号临期提醒 */ @TableField("city_deadline_reminder") @ApiModelProperty(value = "市级账号临期提醒", required = true) private Integer cityDeadlineReminder; /** * 区县级账号临期提醒 */ @TableField("district_deadline_reminder") @@ -73,16 +55,4 @@ @TableField("community_deadline_reminder") @ApiModelProperty(value = "社区级账号临期提醒", required = true) private Integer communityDeadlineReminder; /** * 党员级账号临期提醒 */ @TableField("party_member_deadline_reminder") @ApiModelProperty(value = "党员级账号临期提醒", required = true) private Integer partyMemberDeadlineReminder; /** * 诉求处理时间 */ @TableField("demand_processing_time") @ApiModelProperty(value = "诉求处理时间", required = true) private Integer demandProcessingTime; } springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/scheduled/ComplaintTasks.java
@@ -39,43 +39,39 @@ public void complaintTimeout() { WorkOrderItemConfig config = workOrderItemConfigService.getById(1); Integer demandProcessingTime = config.getDemandProcessingTime(); // 超时未处理短信发送及告会上一级督办 timeOutHandle(config,demandProcessingTime); timeOutHandle(config); // 临期提醒 reminderHandle(config, demandProcessingTime); // 诉求超时提醒 List<Complaint> complaintList = complaintService.list(new LambdaQueryWrapper<Complaint>() .le(Complaint::getClosingTime, new Date()) .eq(Complaint::getStatus, 0)); List<MessageNotification> messageNotificationList = new ArrayList<>(); complaintList.forEach(complaint -> { complaint.setStatus(2); complaint.setCompletionTime(new Date()); // 代办信息 R<LoginUserInfoVO> uR = userService.getUserInfoByUserId(String.valueOf(complaint.getCreateBy())); if (!R.isOk(uR)){ log.error("未查询到用户信息"); } LoginUserInfoVO data = uR.getData(); MessageNotification messageNotification = new MessageNotification(); messageNotification.setTitle(complaint.getDescriptionTitle()); messageNotification.setUndertakerUserId(String.valueOf(complaint.getSuperiorId())); messageNotification.setUndertakerType(1); messageNotification.setPhone(data.getPhone()); messageNotification.setResponseTime(complaint.getClosingTime()); messageNotification.setPromptType(1); messageNotification.setReadStatus(0); messageNotification.setCreateTime(new Date()); messageNotificationList.add(messageNotification); }); complaintService.updateBatchById(complaintList); messageNotificationService.saveBatch(messageNotificationList); // // 诉求超时提醒 // List<Complaint> complaintList = complaintService.list(new LambdaQueryWrapper<Complaint>() // .le(Complaint::getClosingTime, new Date()) // .eq(Complaint::getStatus, 0)); // List<MessageNotification> messageNotificationList = new ArrayList<>(); // complaintList.forEach(complaint -> { // complaint.setStatus(2); // complaint.setCompletionTime(new Date()); // // // // 代办信息 // R<LoginUserInfoVO> uR = userService.getUserInfoByUserId(String.valueOf(complaint.getCreateBy())); // if (!R.isOk(uR)){ // log.error("未查询到用户信息"); // } // LoginUserInfoVO data = uR.getData(); // MessageNotification messageNotification = new MessageNotification(); // messageNotification.setTitle(complaint.getDescriptionTitle()); // messageNotification.setUndertakerUserId(String.valueOf(complaint.getSuperiorId())); // messageNotification.setUndertakerType(1); // messageNotification.setPhone(data.getPhone()); // messageNotification.setResponseTime(complaint.getClosingTime()); // messageNotification.setPromptType(1); // messageNotification.setReadStatus(0); // messageNotification.setCreateTime(new Date()); // messageNotificationList.add(messageNotification); // }); // complaintService.updateBatchById(complaintList); // messageNotificationService.saveBatch(messageNotificationList); } @@ -100,43 +96,26 @@ // 诉求超时处理 private void timeOutHandle(WorkOrderItemConfig config,Integer demandProcessingTime) { private void timeOutHandle(WorkOrderItemConfig config) { List<ComplaintTimeout> complaintTimeoutList = complaintAuditRecordMapper.getComplaintTimeout( config.getCityHandlingTime() + demandProcessingTime, config.getDistrictHandlingTime() + demandProcessingTime, config.getStreetHandlingTime() + demandProcessingTime, config.getCommunityHandlingTime() + demandProcessingTime, config.getPartyMemberHandlingTime() + demandProcessingTime); config.getDistrictHandlingTime() , config.getStreetHandlingTime(), config.getCommunityHandlingTime() ); Map<Integer, List<ComplaintTimeout>> timeOutMap = complaintTimeoutList.stream() .collect(Collectors.groupingBy(ComplaintTimeout::getReportType)); // 市超时 List<ComplaintTimeout> cityTimeOutList = timeOutMap.get(1); if (!CollectionUtils.isEmpty(cityTimeOutList)){ List<SystemUser> cityUserList = systemUserService.list(new LambdaQueryWrapper<SystemUser>() .eq(SystemUser::getAccountLevel, 1) .eq(SystemUser::getStatus, 1)); List<String> cityPhoneList = cityUserList.stream().map(SystemUser::getPhone).collect(Collectors.toList()); cityTimeOutList.forEach(complaintTimeout -> { // 发送短信 AliSmsUtil.sendTimeoutMessage(cityPhoneList,complaintTimeout.getTitle()); }); } .collect(Collectors.groupingBy(ComplaintTimeout::getNowLevel)); // 区县超时 List<ComplaintTimeout> districtTimeOutList = timeOutMap.get(2); if (!CollectionUtils.isEmpty(districtTimeOutList)){ districtTimeOutList.forEach(complaintTimeout -> { // 查询状态正常 是区纪委和管理员 List<SystemUser> districtUserList = systemUserService.list(new LambdaQueryWrapper<SystemUser>() .eq(SystemUser::getAccountLevel, 2) .eq(SystemUser::getDistrictsCode, complaintTimeout.getSuperiorId()) .in(SystemUser::getSystemRoleId,1,2) .eq(SystemUser::getStatus, 1)); List<String> districtPhoneList = districtUserList.stream().map(SystemUser::getPhone).collect(Collectors.toList()); @@ -151,10 +130,9 @@ streetTimeOutList.forEach(complaintTimeout -> { List<SystemUser> streetUserList = systemUserService.list(new LambdaQueryWrapper<SystemUser>() .eq(SystemUser::getAccountLevel, 3) .eq(SystemUser::getStreetId, complaintTimeout.getSuperiorId()) .in(SystemUser::getSystemRoleId,1,2) .eq(SystemUser::getStatus, 1)); List<String> streetPhoneList = streetUserList.stream().map(SystemUser::getPhone).collect(Collectors.toList()); // 发送短信 AliSmsUtil.sendTimeoutMessage(streetPhoneList,complaintTimeout.getTitle()); @@ -167,7 +145,7 @@ communityTimeOutList.forEach(complaintTimeout -> { List<SystemUser> communityUserList = systemUserService.list(new LambdaQueryWrapper<SystemUser>() .eq(SystemUser::getAccountLevel, 4) .eq(SystemUser::getCommunityId, complaintTimeout.getSuperiorId()) .in(SystemUser::getSystemRoleId,1,2) .eq(SystemUser::getStatus, 1)); List<String> communityPhoneList = communityUserList.stream().map(SystemUser::getPhone).collect(Collectors.toList()); @@ -176,190 +154,6 @@ }); } // 党员超时 List<ComplaintTimeout> partyMemberTimeOutList = timeOutMap.get(5); if (!CollectionUtils.isEmpty(partyMemberTimeOutList)){ partyMemberTimeOutList.forEach(complaintTimeout -> { R<LoginUserInfoVO> uR = userService.getUserInfoByUserId(String.valueOf(complaintTimeout.getCreateBy())); if (!R.isOk(uR)){ throw new ServiceException("获取用户信息失败"); } LoginUserInfoVO data = uR.getData(); AliSmsUtil.sendTimeoutMessage(Collections.singletonList(data.getPhone()),complaintTimeout.getTitle()); }); } } // 临期提醒 private void reminderHandle(WorkOrderItemConfig config,Integer demandProcessingTime) { List<ComplaintTimeout> complaintTimeoutList = complaintAuditRecordMapper.getComplaintTimeout( demandProcessingTime - config.getCityDeadlineReminder(), demandProcessingTime - config.getDistrictDeadlineReminder(), demandProcessingTime - config.getStreetDeadlineReminder(), demandProcessingTime - config.getCommunityDeadlineReminder(), demandProcessingTime - config.getPartyMemberDeadlineReminder()); Map<Integer, List<ComplaintTimeout>> timeOutMap = complaintTimeoutList.stream() .collect(Collectors.groupingBy(ComplaintTimeout::getReportType)); // 市超时 List<ComplaintTimeout> cityTimeOutList = timeOutMap.get(1); if (!CollectionUtils.isEmpty(cityTimeOutList)){ List<SystemUser> cityUserList = systemUserService.list(new LambdaQueryWrapper<SystemUser>() .eq(SystemUser::getAccountLevel, 1) .eq(SystemUser::getStatus, 1)); List<String> cityPhoneList = cityUserList.stream().map(SystemUser::getPhone).collect(Collectors.toList()); cityTimeOutList.forEach(complaintTimeout -> { // 发送短信 Date closingTime = complaintTimeout.getClosingTime(); int daysRemaining = DateUtils.retrieveRemainingDays(closingTime); AliSmsUtil.sendExpireMessage(cityPhoneList,complaintTimeout.getTitle(),closingTime, daysRemaining); // 代办信息 List<MessageNotification> messageNotificationList = new ArrayList<>(); for (String phone : cityPhoneList) { MessageNotification messageNotification = new MessageNotification(); messageNotification.setTitle(complaintTimeout.getTitle()); messageNotification.setUndertakerUserId(String.valueOf(complaintTimeout.getSuperiorId())); messageNotification.setUndertakerType(1); messageNotification.setPhone(phone); messageNotification.setResponseTime(complaintTimeout.getClosingTime()); messageNotification.setPromptType(1); messageNotification.setReadStatus(0); messageNotification.setCreateTime(new Date()); } messageNotificationService.saveBatch(messageNotificationList); }); } // 区县超时 List<ComplaintTimeout> districtTimeOutList = timeOutMap.get(2); if (!CollectionUtils.isEmpty(districtTimeOutList)){ districtTimeOutList.forEach(complaintTimeout -> { List<SystemUser> districtUserList = systemUserService.list(new LambdaQueryWrapper<SystemUser>() .eq(SystemUser::getAccountLevel, 2) .eq(SystemUser::getDistrictsCode, complaintTimeout.getSuperiorId()) .eq(SystemUser::getStatus, 1)); List<String> districtPhoneList = districtUserList.stream().map(SystemUser::getPhone).collect(Collectors.toList()); // 发送短信 Date closingTime = complaintTimeout.getClosingTime(); int daysRemaining = DateUtils.retrieveRemainingDays(closingTime); AliSmsUtil.sendExpireMessage(districtPhoneList,complaintTimeout.getTitle(),closingTime, daysRemaining); // 代办信息 List<MessageNotification> messageNotificationList = new ArrayList<>(); for (String phone : districtPhoneList) { MessageNotification messageNotification = new MessageNotification(); messageNotification.setTitle(complaintTimeout.getTitle()); messageNotification.setUndertakerUserId(String.valueOf(complaintTimeout.getSuperiorId())); messageNotification.setUndertakerType(1); messageNotification.setPhone(phone); messageNotification.setResponseTime(complaintTimeout.getClosingTime()); messageNotification.setPromptType(1); messageNotification.setReadStatus(0); messageNotification.setCreateTime(new Date()); } messageNotificationService.saveBatch(messageNotificationList); }); } // 街道超时 List<ComplaintTimeout> streetTimeOutList = timeOutMap.get(3); if (!CollectionUtils.isEmpty(streetTimeOutList)){ streetTimeOutList.forEach(complaintTimeout -> { List<SystemUser> streetUserList = systemUserService.list(new LambdaQueryWrapper<SystemUser>() .eq(SystemUser::getAccountLevel, 3) .eq(SystemUser::getStreetId, complaintTimeout.getSuperiorId()) .eq(SystemUser::getStatus, 1)); List<String> streetPhoneList = streetUserList.stream().map(SystemUser::getPhone).collect(Collectors.toList()); // 发送短信 Date closingTime = complaintTimeout.getClosingTime(); int daysRemaining = DateUtils.retrieveRemainingDays(closingTime); AliSmsUtil.sendExpireMessage(streetPhoneList,complaintTimeout.getTitle(),closingTime, daysRemaining); // 代办信息 List<MessageNotification> messageNotificationList = new ArrayList<>(); for (String phone : streetPhoneList) { MessageNotification messageNotification = new MessageNotification(); messageNotification.setTitle(complaintTimeout.getTitle()); messageNotification.setUndertakerUserId(String.valueOf(complaintTimeout.getSuperiorId())); messageNotification.setUndertakerType(1); messageNotification.setPhone(phone); messageNotification.setResponseTime(complaintTimeout.getClosingTime()); messageNotification.setPromptType(1); messageNotification.setReadStatus(0); messageNotification.setCreateTime(new Date()); } messageNotificationService.saveBatch(messageNotificationList); }); } // 社区超时 List<ComplaintTimeout> communityTimeOutList = timeOutMap.get(4); if (!CollectionUtils.isEmpty(communityTimeOutList)){ communityTimeOutList.forEach(complaintTimeout -> { List<SystemUser> communityUserList = systemUserService.list(new LambdaQueryWrapper<SystemUser>() .eq(SystemUser::getAccountLevel, 4) .eq(SystemUser::getCommunityId, complaintTimeout.getSuperiorId()) .eq(SystemUser::getStatus, 1)); List<String> communityPhoneList = communityUserList.stream().map(SystemUser::getPhone).collect(Collectors.toList()); // 发送短信 Date closingTime = complaintTimeout.getClosingTime(); int daysRemaining = DateUtils.retrieveRemainingDays(closingTime); AliSmsUtil.sendExpireMessage(communityPhoneList,complaintTimeout.getTitle(),closingTime, daysRemaining); // 代办信息 List<MessageNotification> messageNotificationList = new ArrayList<>(); for (String phone : communityPhoneList) { MessageNotification messageNotification = new MessageNotification(); messageNotification.setTitle(complaintTimeout.getTitle()); messageNotification.setUndertakerUserId(String.valueOf(complaintTimeout.getSuperiorId())); messageNotification.setUndertakerType(1); messageNotification.setPhone(phone); messageNotification.setResponseTime(complaintTimeout.getClosingTime()); messageNotification.setPromptType(1); messageNotification.setReadStatus(0); messageNotification.setCreateTime(new Date()); } messageNotificationService.saveBatch(messageNotificationList); }); } // 党员超时 List<ComplaintTimeout> partyMemberTimeOutList = timeOutMap.get(5); if (!CollectionUtils.isEmpty(partyMemberTimeOutList)){ partyMemberTimeOutList.forEach(complaintTimeout -> { R<LoginUserInfoVO> uR = userService.getUserInfoByUserId(String.valueOf(complaintTimeout.getCreateBy())); if (!R.isOk(uR)){ throw new ServiceException("获取用户信息失败"); } LoginUserInfoVO data = uR.getData(); // 发送短信 Date closingTime = complaintTimeout.getClosingTime(); int daysRemaining = DateUtils.retrieveRemainingDays(closingTime); AliSmsUtil.sendExpireMessage(Collections.singletonList(data.getPhone()),complaintTimeout.getTitle(),closingTime, daysRemaining); // 代办信息 MessageNotification messageNotification = new MessageNotification(); messageNotification.setTitle(complaintTimeout.getTitle()); messageNotification.setUndertakerUserId(String.valueOf(complaintTimeout.getSuperiorId())); messageNotification.setUndertakerType(1); messageNotification.setPhone(data.getPhone()); messageNotification.setResponseTime(complaintTimeout.getClosingTime()); messageNotification.setPromptType(1); messageNotification.setReadStatus(0); messageNotification.setCreateTime(new Date()); messageNotificationService.save(messageNotification); }); } } } springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/service/IComplaintService.java
@@ -2,7 +2,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.panzhihua.common.model.vos.LoginUserInfoVO; import com.panzhihua.common.model.vos.sangeshenbian.SystemUserVo; import com.panzhihua.common.model.vos.west.SystemUserVo; import com.panzhihua.westcommittee.model.dto.ComplaintCompletionDTO; import com.panzhihua.westcommittee.model.dto.ComplaintProcessDTO; import com.panzhihua.westcommittee.model.dto.*; @@ -15,7 +15,9 @@ import com.panzhihua.westcommittee.model.query.BasePage; import com.panzhihua.westcommittee.model.query.ComplaintQuery; import com.panzhihua.westcommittee.model.vo.*; import com.panzhihua.westcommittee.warpper.GetHouseAddressQuery; import com.panzhihua.westcommittee.warpper.MgtComplaintQuery; import com.panzhihua.westcommittee.warpper.ScreenComplaintQuery; import javax.validation.Valid; import java.io.IOException; @@ -238,4 +240,22 @@ List<DispatchVO> getAllocationList(LoginUserInfoVO loginUserInfo); /** * 诉求详情大屏 * @param id * @return */ ComplaintVO detailScreen(Long id); /** * 诉求列表大屏 * @param query * @return */ Page<ComplaintVO> pageScreenList(ScreenComplaintQuery query); Page<String> getHouseAddress(GetHouseAddressQuery query); } springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/service/IPartyMemberService.java
@@ -2,7 +2,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.panzhihua.common.model.vos.LoginUserInfoVO; import com.panzhihua.common.model.vos.sangeshenbian.SystemUserVo; import com.panzhihua.common.model.vos.west.SystemUserVo; import com.panzhihua.westcommittee.model.entity.PartyMember; import com.baomidou.mybatisplus.extension.service.IService; import com.panzhihua.westcommittee.warpper.PartyMemberApplicationRequest; springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/service/ISystemUserService.java
@@ -2,7 +2,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.IService; import com.panzhihua.common.model.vos.sangeshenbian.SystemUserVo; import com.panzhihua.common.model.vos.west.SystemUserVo; import com.panzhihua.westcommittee.model.entity.SystemUser; import com.panzhihua.westcommittee.model.vo.RegionVO; import com.panzhihua.westcommittee.warpper.SystemUserList; springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/service/impl/ComplaintServiceImpl.java
@@ -11,7 +11,7 @@ import com.deepoove.poi.XWPFTemplate; import com.panzhihua.common.exceptions.ServiceException; import com.panzhihua.common.model.vos.LoginUserInfoVO; import com.panzhihua.common.model.vos.sangeshenbian.SystemUserVo; import com.panzhihua.common.model.vos.west.SystemUserVo; import com.panzhihua.common.redis.RedisUtils; import com.panzhihua.common.utlis.DateUtils; import com.panzhihua.common.utlis.StringUtils; @@ -27,9 +27,7 @@ import com.panzhihua.westcommittee.model.query.ComplaintQuery; import com.panzhihua.westcommittee.model.vo.*; import com.panzhihua.westcommittee.service.*; import com.panzhihua.westcommittee.warpper.IdentityInformation; import com.panzhihua.westcommittee.warpper.MgtComplaintQuery; import com.panzhihua.westcommittee.warpper.PermissionsVO; import com.panzhihua.westcommittee.warpper.*; import jodd.util.StringUtil; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -212,7 +210,7 @@ if (Objects.isNull(config)) { throw new ServiceException("工单事项未配置,请联系管理员"); } complaint.setClosingTime(new Date(System.currentTimeMillis() + config.getDemandProcessingTime() * 24 * 60 * 60 * 1000)); complaint.setNowLevelTime(new Date()); // 保存诉求记录 save(complaint); } @@ -666,10 +664,14 @@ } } } else { if (detail.getFirstStatus() == 1) { if (detail.getFirstStatus() == 1 && detail.getStatus() != 3 && detail.getStatus() != 8) { detail.setStatus(0); } else { } else if(detail.getFirstStatus()==0){ detail.setStatus(-2); }else if(detail.getFirstStatus() == 1 && detail.getStatus() == 3 ){ detail.setStatus(3); }else if(detail.getFirstStatus() == 1 && detail.getStatus() == 8){ detail.setStatus(8); } } @@ -712,6 +714,38 @@ } return detail; } @Override public ComplaintVO detailScreen(Long id) { //获取当前身份,1=党员,2=管理员 ComplaintVO detail = baseMapper.getDetail(id); // 更新状态 此时status是表中的状态 未做变动 if (detail.getFirstStatus() == 1 && detail.getStatus() != 3 && detail.getStatus() != 8) { detail.setStatus(0); } else if(detail.getFirstStatus()==0){ detail.setStatus(-2); }else if(detail.getFirstStatus() == 1 && detail.getStatus() == 3 ){ detail.setStatus(3); }else if(detail.getFirstStatus() == 1 && detail.getStatus() == 8){ detail.setStatus(8); } List<ComplaintFlow> list = complaintFlowService.lambdaQuery().eq(ComplaintFlow::getComplaintId, id).orderByAsc(ComplaintFlow::getSort).list(); detail.setComplaintFlows(list); //查询办理进度 List<ComplaintProgress> list1 = complaintProgressService.lambdaQuery().eq(ComplaintProgress::getComplaintId, id) .orderByAsc(ComplaintProgress::getCreateTime).list(); detail.setComplaintProgresses(list1); return detail; } /** * 办理进度录入 @@ -900,6 +934,7 @@ complaint.setNowLevel(nowLevel); complaint.setLastLevel(nowLevel + 1); complaint.setAssignStatus(0); complaint.setNowLevelTime(new Date()); updateById(complaint); // 标记最新 @@ -1044,6 +1079,7 @@ complaint.setAssignStatus(0); complaint.setNowLevel(nowLevel); complaint.setLastLevel(nowLevel); complaint.setNowLevelTime(new Date()); this.updateById(complaint); complaintAuditRecord.setSuperiorId(superiorId); @@ -1116,6 +1152,7 @@ complaint.setLastSuperiorId(complaint.getSuperiorId()); complaint.setLastLevel(complaint.getNowLevel()); complaint.setRemark(complaintReporAuditDTO.getRemark()); complaint.setNowLevelTime(new Date()); this.updateById(complaint); @@ -1131,6 +1168,7 @@ complaint.setAssignStatus(1); complaint.setSuperiorId(complaint.getLastSuperiorId()); complaint.setNowLevel(complaint.getLastLevel()); complaint.setNowLevelTime(new Date()); this.updateById(complaint); } @@ -1974,6 +2012,7 @@ complaint.setFirstStatus(1); complaint.setAssignStatus(1); complaint.setRemark(remark); complaint.setNowLevelTime(new Date()); baseMapper.updateById(complaint); } else { throw new ServiceException("你没有分配权限"); @@ -1982,5 +2021,34 @@ } @Override public Page<ComplaintVO> pageScreenList(ScreenComplaintQuery query) { // 已分派了的 Page<ComplaintVO> page = new Page<>(query.getPageNum(), query.getPageSize()); String address = this.baseMapper.getHouseAddressFromId(query.getHouseId()); query.setAddress(address); page = baseMapper.pageScreenList(page, query); page.getRecords().forEach(detail -> { if (detail.getFirstStatus() == 1 && detail.getStatus() != 3 && detail.getStatus() != 8) { detail.setStatus(0); } else if(detail.getFirstStatus()==0){ detail.setStatus(-2); }else if(detail.getFirstStatus() == 1 && detail.getStatus() == 3 ){ detail.setStatus(3); }else if(detail.getFirstStatus() == 1 && detail.getStatus() == 8){ detail.setStatus(8); } }); return page; } @Override public Page<String> getHouseAddress(GetHouseAddressQuery query) { Page<String> page = new Page<>(query.getPageNum(), query.getPageSize()); return this.baseMapper.getHouseAddress(page,query.getAddress()); } } springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/service/impl/PartyMemberServiceImpl.java
@@ -10,7 +10,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.panzhihua.common.exceptions.ServiceException; import com.panzhihua.common.model.vos.LoginUserInfoVO; import com.panzhihua.common.model.vos.sangeshenbian.SystemUserVo; import com.panzhihua.common.model.vos.west.SystemUserVo; import com.panzhihua.common.redis.RedisUtils; import com.panzhihua.westcommittee.dao.PartyMemberMapper; import com.panzhihua.westcommittee.enums.AuditStatusEnum; springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/service/impl/SystemUserServiceImpl.java
@@ -5,7 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.beust.jcommander.internal.Lists; import com.panzhihua.common.model.vos.sangeshenbian.SystemUserVo; import com.panzhihua.common.model.vos.west.SystemUserVo; import com.panzhihua.common.utlis.StringUtils; import com.panzhihua.westcommittee.dao.SystemUserLevelMapper; import com.panzhihua.westcommittee.dao.SystemUserMapper; springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/utils/BaiduMapUtil.java
@@ -22,7 +22,7 @@ public static String URL = "https://api.map.baidu.com/place/v2/search?"; public static String GEOCONV_URL = "https://api.map.baidu.com/geoconv/v2/?"; public static String AK = "3mHKIXMArjgIkgADzOlTYp4XssNSNkwr"; public static String AK = "M9euJ9B9wPdl2tK5ODnNMMYKb66tkZtA"; public static void main(String[] args) throws Exception { springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/warpper/GetHouseAddressQuery.java
New file @@ -0,0 +1,13 @@ package com.panzhihua.westcommittee.warpper; import com.panzhihua.westcommittee.model.query.BasePage; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @Data @ApiModel("获取详细地址查询数据传输对象") public class GetHouseAddressQuery extends BasePage { @ApiModelProperty(value = "地址") private String address; } springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/warpper/ScreenComplaintQuery.java
New file @@ -0,0 +1,27 @@ package com.panzhihua.westcommittee.warpper; import com.panzhihua.westcommittee.model.query.BasePage; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import javax.validation.constraints.NotBlank; /** * @author mitao * @date 2025/3/15 */ @Data @ApiModel("管理后台诉求管理查询数据传输对象") public class ScreenComplaintQuery extends BasePage { @ApiModelProperty(value = "问题类型") private String problemType; @ApiModelProperty(value = "houseId") @NotBlank(message = "houseId不能为空") private String houseId; @ApiModelProperty(value = "不传") private String address; } springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/resources/bootstrap.yml
@@ -1,15 +1,15 @@ spring: application: name: huacheng-westcommittee name: xiqu-westcommittee cloud: config: discovery: enabled: true service-id: huacheng-config # 注册中心的服务名 profile: ${ENV:dev} # 指定配置文件的环境 uri: http://${CONFIG_URL:127.0.0.1}:6193/ service-id: xiqu-config # 注册中心的服务名 profile: ${ENV:prod} # 指定配置文件的环境 uri: http://${CONFIG_URL:127.0.0.1}:8193/ profiles: active: ${ENV:dev} active: ${ENV:prod} servlet: multipart: max-file-size: 10MB @@ -41,4 +41,4 @@ metrics: tags: application: huacheng-westcommittee application: xiqu-westcommittee springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/resources/logback-spring.xml
@@ -19,7 +19,7 @@ <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <!--日志文件输出的文件名--> <FileNamePattern>${LOG_HOME}/huachengservice_sangeshenbian.log.%d{yyyy-MM-dd}.log</FileNamePattern> <FileNamePattern>${LOG_HOME}/xiquservice_west.log.%d{yyyy-MM-dd}.log</FileNamePattern> <!--日志文件保留天数--> <MaxHistory>30</MaxHistory> </rollingPolicy> springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/resources/mapper/ComplaintAuditRecordMapper.xml
@@ -3,26 +3,32 @@ <mapper namespace="com.panzhihua.westcommittee.dao.ComplaintAuditRecordMapper"> <select id="getComplaintTimeout" resultType="com.panzhihua.westcommittee.model.dto.ComplaintTimeout"> SELECT id complaintId, description_title title, create_by, create_time, now_level AS nowLevel FROM west_complaint WHERE NOW() > now_level_time + INTERVAL CASE now_level WHEN 2 THEN ${districtDay} WHEN 3 THEN ${streetDay} WHEN 4 THEN ${communityDay} END DAY </select> <select id="getComplaintTimeout1" resultType="com.panzhihua.westcommittee.model.dto.ComplaintTimeout"> SELECT sc.id complaintId, sc.description_title title, sc.create_by, scar.report_type, scar.superior_id, sc.create_time, sc.closingTime id complaintId, FROM west_complaint_audit_record scar LEFT JOIN west_complaint sc ON scar.complaint_id = sc.id WHERE scar.latest_flag = 1 AND sc.create_time <![CDATA[ < ]]> NOW() - INTERVAL CASE scar.report_type WHEN 1 THEN ${cityDay} WHEN 2 THEN ${districtDay} WHEN 3 THEN ${streetDay} WHEN 4 THEN ${communityDay} WHEN 5 THEN ${partyMemberDay} west_complaint WHERE NOW() <![CDATA[ > ]]> now_level_time + INTERVAL CASE sc.now_level WHEN 2 THEN ${districtDay} WHEN 3 THEN ${streetDay} WHEN 4 THEN ${communityDay} END DAY </select> </mapper> springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/resources/mapper/ComplaintMapper.xml
@@ -209,6 +209,7 @@ sc.over_time_days, sc.latitude, sc.longitude, sc.redispatch, sc.report_user_name, sc.report_user_phone, sc.superior_id, @@ -846,6 +847,7 @@ sc.over_time_days, sc.latitude, sc.longitude, sc.redispatch, scar.audit_type, scar.audit_status, scar.reporter_level, @@ -913,6 +915,7 @@ sc.over_time_days, sc.latitude, sc.longitude, sc.redispatch, scar.audit_type, scar.audit_status, scar.reporter_level, @@ -980,6 +983,7 @@ sc.over_time_days, sc.latitude, sc.longitude, sc.redispatch, scar.audit_type, scar.audit_status, scar.reporter_level, @@ -1047,6 +1051,7 @@ sc.over_time_days, sc.latitude, sc.longitude, sc.redispatch, scar.audit_type, scar.audit_status, scar.reporter_level, @@ -1116,6 +1121,7 @@ sc.over_time_days, sc.latitude, sc.longitude, sc.redispatch, scar.audit_type, scar.audit_status, scar.reporter_level, @@ -1139,4 +1145,79 @@ </if> ORDER BY t1.create_time DESC </select> <select id="pageScreenList" resultType="com.panzhihua.westcommittee.model.vo.ComplaintVO"> 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.first_status = 1 and sc.status != 3 and sc.status != 8 and sc.first_status=1 THEN 0 WHEN sc.first_status = 1 and sc.status = 8 THEN 3 WHEN sc.first_status = 0 and sc.assign_status = 0 THEN -2 WHEN sc.assign_status = 0 and sc.first_status = 1 THEN -1 ELSE sc.status END AS status, CASE WHEN sc.status = 3 THEN 0 ELSE 1 END AS evaluateButtonStatus, sc.report_type, sc.superior_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.reporter_level, scar.comment, scar.create_time AS reportTime, scar.system_user_id, scar.create_by as auditCreateBy, scar.reporter, scar.reporter_id, scar.superior_id superiorId2, scar.department_name, scar.department_id FROM west_complaint sc LEFT JOIN west_complaint_audit_record scar ON scar.complaint_id = sc.id and scar.latest_flag = 1 WHERE sc.detailed_address =#{query.address} ) as t1 where 1=1 <if test="query.problemType !=null"> and t1.problem_type = #{query.problemType} </if> ORDER BY t1.create_time DESC </select> <select id="getHouseAddress" resultType="java.lang.String"> select address from com_mng_population_house where 1=1 <if test="address !=null"> and address like concat('%',#{address},'%') </if> </select> <select id="getHouseAddressFromId" resultType="java.lang.String"> select address from com_mng_population_house where id=#{id} </select> </mapper>