springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/ComSanShuoApi.java
@@ -29,8 +29,8 @@ @ApiOperation(value = "小程序获取可选择行专家列表",response = ComSanshuoExpertVO.class ) @GetMapping("/expert/appletsList") public R expertAppList(){ return communityService.expertAppList(); public R expertAppList(@RequestParam (value = "type",required = false)Integer type,@RequestParam(value = "id",required = false)Long id){ return communityService.expertAppList(type,id); } @ApiOperation(value = "专家风采",response = ExpertShowVO.class) springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/sanshuo/ComEventDetailVO.java
@@ -1,5 +1,6 @@ package com.panzhihua.common.model.vos.sanshuo; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -76,6 +77,7 @@ private String specialistTel; /**专家受理时间*/ @ApiModelProperty(name = "specialistAcceptTime", value = "专家受理时间") @JsonFormat(pattern = "yyy-MM-dd HH:mm:ss") private Date specialistAcceptTime; /**撤销类型 1 用户 2 社区3、街道4、行业分中心*/ @ApiModelProperty(name = "revokeType", value = "撤销类型 1 用户 2 社区3、街道4、行业分中心") @@ -114,13 +116,25 @@ @ApiModelProperty(name = "result", value = "归档结案报告") private String result; /**已归档处理完毕时间*/ @JsonFormat(pattern = "yyy-MM-dd HH:mm:ss") @ApiModelProperty(name = "resultDate", value = "已归档处理完毕时间") private Date resultDate; /**创建时间*/ @JsonFormat(pattern = "yyy-MM-dd HH:mm:ss") @ApiModelProperty(name = "createAt", value = "创建时间") private Date createAt; /**调解上传图片地址列表,逗号进行分割*/ @ApiModelProperty(name = "images", value = "调解上传图片地址列表,逗号进行分割") private List<ComEventRequestImageVO> images; @ApiModelProperty("时间类型名称") private String categoryName; @ApiModelProperty("当前调解部门") private String currentOrgName; @ApiModelProperty("用户取消时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date revokeDate; @ApiModelProperty("调解站电话") private String contact; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/sanshuo/ComEventPageRequestVO.java
@@ -50,4 +50,6 @@ private Long pageNo; private Long pageSize; private String keyword; @ApiModelProperty(value = "查看类型1用户查看自己的调解事件申请2专家查看自己受理的调解事件") private Integer userType; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/sanshuo/ComEventVO.java
@@ -151,4 +151,6 @@ private Long pageNo; private Long pageSize; private String keyword; @ApiModelProperty(value = "查看类型1用户查看自己的调解事件申请2专家查看自己受理的调解事件") private Integer userType; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java
@@ -10430,7 +10430,7 @@ * 小程序获取可选择专家列表 * */ @GetMapping("/sanshuo/expert/appletsList") R expertAppList(); R expertAppList(@RequestParam (value = "type",required = false)Integer type,@RequestParam(value = "id",required = false)Long id); /** * 获取专家详情 springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/user/UserService.java
@@ -1302,4 +1302,10 @@ * */ @GetMapping("/isSanShuoExpert") R isExpert(@RequestParam("number") String number); /** * 删除用户专家权限 * */ @GetMapping("/removeExpertRole") R removeExpertRole(@RequestParam(value = "phone",required = false) String phone); } springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/CommunityConvenientApi.java
@@ -229,9 +229,13 @@ String name = UUID.randomUUID().toString().replaceAll("-", "")+".jpg"; try { SFTPUtil sftp = new SFTPUtil(userName, password, host, port); log.info("创建sftp"); sftp.login(); log.info("sftp登陆成功"); InputStream is = BaseUtils.base64StrToInputStream(file.getFile().replace("data:image/png;base64,","").replace("data:image/jpg;base64,","").replace("data:image/jpeg;base64,","")); log.info("解析图片转换成功"); sftp.uploadMore(FtpConstants.FTPFILEPATH_IDCARD, name, is); log.info("上传成功"); sftp.logout(); return R.ok(url + "/idcard/" + name); } catch (Exception e) { springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComSanShuoEventController.java
@@ -131,7 +131,7 @@ @PostMapping("/list") public R<List<ComEventVO>> listByComEvent(@RequestBody ComEventVO comEventVO) { ComEvent comEvent = CopyUtil.copyProperties(comEventVO, ComEvent.class); return R.ok(CopyUtil.beanCopyList(comEventService.listByComEvent(comEvent), ComEventVO.class)); return R.ok(CopyUtil.beanCopyList(comEventService.listByComEvent(comEvent,this.getLoginUserInfo()), ComEventVO.class)); } /** @@ -154,7 +154,7 @@ public R page(@RequestBody ComEventVO comEventVO, Long pageNo, Long pageSize) { Page pagination = new Page(pageNo, pageSize); ComEvent comEvent = CopyUtil.copyProperties(comEventVO, ComEvent.class); return comEventService.pageByComEvent(comEvent, pagination); return comEventService.pageByComEvent(comEvent, pagination,this.getLoginUserInfo()); } @@ -248,7 +248,7 @@ public R rejectRequest(@RequestParam("id") Long id) { ComEvent comEvent = new ComEvent(); comEvent.setId(id); comEvent.setEventProcessStatus(SanShuoEventStatusEnum.REJECT.getCode()); comEvent.setEventProcessStatus(SanShuoEventStatusEnum.VALID.getCode()); return comEventService.updateComEvent(comEvent); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComSanShuoExpertApi.java
@@ -46,7 +46,7 @@ @PostMapping public R add(@RequestBody ComSanshuoExpertDTO comSanshuoExpertDTO){ comSanshuoExpertDTO.setCreateBy(this.getLoginUserInfo().getName()); return comSanShuoExpertService.addExpert(comSanshuoExpertDTO); return comSanShuoExpertService.addOrUpdateExpert(comSanshuoExpertDTO); } @GetMapping("/detail") @@ -58,9 +58,8 @@ * 小程序获取可选择专家 * */ @GetMapping("/appletsList") public R appList(){ comSanShuoExpertService.selectExpertList(); return R.ok(comSanShuoExpertService.list(new QueryWrapper<ComSanshuoExpert>().eq("status",1).eq("del_flag",1))); public R appList(@RequestParam (value = "type",required = false)Integer type,@RequestParam(value = "id",required = false)Long id){ return comSanShuoExpertService.selectExpertList(type, id,this.getLoginUserInfo().getCommunityId()); } /** @@ -68,10 +67,7 @@ * */ @PutMapping public R update(@RequestBody ComSanshuoExpertDTO comSanshuoExpertDTO){ ComSanshuoExpert expert=new ComSanshuoExpert(); BeanUtil.copyProperties(comSanshuoExpertDTO,expert); expert.setUpdateTime(new Date()); return R.ok(comSanShuoExpertService.updateById(expert)); return R.ok(comSanShuoExpertService.addOrUpdateExpert(comSanshuoExpertDTO)); } /** @@ -90,7 +86,6 @@ * */ @DeleteMapping("/remove") public R remove(@RequestParam("id")Long id){ //TODO 是否有为解决事件 List<ComEvent> list = comEventService.list(new QueryWrapper<ComEvent>().lambda().eq(ComEvent::getSpecialistId, id).in(ComEvent::getEventProcessStatus, (1), (2), (5))); if (list.size()!=0){ return R.fail("有未调解完成事件,无法删除!"); @@ -98,7 +93,12 @@ ComSanshuoExpert expert = comSanShuoExpertService.getById(id); expert.setStatus(0); expert.setDelFlag(0); return R.ok(comSanShuoExpertService.updateById(expert)); boolean b = comSanShuoExpertService.updateById(expert); if (b){ //删除专家账号的权限 userService.removeExpertRole(expert.getPhone()); } return R.ok(); } /** springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComEventMapper.java
@@ -42,7 +42,7 @@ * @author manailin * @date 2022-09-07 11:23:51 */ List<ComEvent> listByComEvent(@Param("comEvent") ComEvent comEvent); List<ComEvent> listByComEvent(@Param("comEvent") ComEvent comEvent,@Param("requestUserId") Long requestUserId); List<ComEventCalculateVO> calculate(); springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/entity/ComEvent.java
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.annotation.JsonFormat; import com.panzhihua.common.model.vos.sanshuo.ComEventRequestImageVO; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -52,9 +53,11 @@ private String type; /**上报提交时间*/ @ApiModelProperty(name = "submitDate", value = "上报提交时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date submitDate; /**选择预约调解时间*/ @ApiModelProperty(name = "appointmentTime", value = "选择预约调解时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date appointmentTime; /**申请人选择的社区ID*/ @ApiModelProperty(name = "requestUserCommunity", value = "申请人选择的社区ID") @@ -82,6 +85,7 @@ private String specialistTel; /**专家受理时间*/ @ApiModelProperty(name = "specialistAcceptTime", value = "专家受理时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date specialistAcceptTime; /**撤销类型 1 用户 2 社区3、街道4、行业分中心*/ @ApiModelProperty(name = "revokeType", value = "撤销类型 1 用户 2 社区3、街道4、行业分中心") @@ -110,7 +114,7 @@ /**当前调解处理结果*/ @ApiModelProperty(name = "currentEventProcessResult", value = "当前调解处理结果") private String currentEventProcessResult; /**调解是否成果1未成果2已成果*/ /**调解是否成果1未成功2已成果*/ @ApiModelProperty(name = "eventSucceed", value = "调解是否成果1未成功2已成功") private Integer eventSucceed; /**事件结果(1、调解失败2、调解成功)*/ @@ -124,6 +128,7 @@ private String result; /**已归档处理完毕时间*/ @ApiModelProperty(name = "resultDate", value = "已归档处理完毕时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date resultDate; /**是否紧急*/ @ApiModelProperty(name = "urgent", value = "是否紧急") @@ -148,6 +153,7 @@ private Long createBy; /**创建时间*/ @ApiModelProperty(name = "createAt", value = "创建时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date createAt; /**修改人*/ @ApiModelProperty(name = "updateBy", value = "修改人") @@ -166,4 +172,8 @@ private String eventCategoryName; @TableField(exist = false) private String keyword; @TableField(exist = false) private Integer userType; @ApiModelProperty("取消时间") private Date revokeDate; } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/entity/ComEventTransferRecord.java
@@ -65,6 +65,7 @@ private String processResultData; /**处理时间*/ @ApiModelProperty(name = "processDate", value = "处理时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date processDate; /**(1、行业分中心2、社区3、是街道4、区)下的处理人ID*/ @ApiModelProperty(name = "processBy", value = "(1、行业分中心2、社区3、是街道4、区)下的处理人ID") springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/entity/ComSanshuoExpert.java
@@ -111,11 +111,6 @@ private Long industryCenterId; /** * 备用字段1 */ private String param1; /** * 所属单位 */ private String unit; @@ -131,95 +126,5 @@ @TableField(exist = false) private static final long serialVersionUID = 1L; @Override public boolean equals(Object that) { if (this == that) { return true; } if (that == null) { return false; } if (getClass() != that.getClass()) { return false; } ComSanshuoExpert other = (ComSanshuoExpert) that; return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) && (this.getLevel() == null ? other.getLevel() == null : this.getLevel().equals(other.getLevel())) && (this.getCommunityId() == null ? other.getCommunityId() == null : this.getCommunityId().equals(other.getCommunityId())) && (this.getWorkTime() == null ? other.getWorkTime() == null : this.getWorkTime().equals(other.getWorkTime())) && (this.getGoodAt() == null ? other.getGoodAt() == null : this.getGoodAt().equals(other.getGoodAt())) && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName())) && (this.getAvatar() == null ? other.getAvatar() == null : this.getAvatar().equals(other.getAvatar())) && (this.getPhone() == null ? other.getPhone() == null : this.getPhone().equals(other.getPhone())) && (this.getAccount() == null ? other.getAccount() == null : this.getAccount().equals(other.getAccount())) && (this.getPassword() == null ? other.getPassword() == null : this.getPassword().equals(other.getPassword())) && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) && (this.getDelFlag() == null ? other.getDelFlag() == null : this.getDelFlag().equals(other.getDelFlag())) && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) && (this.getCreateBy() == null ? other.getCreateBy() == null : this.getCreateBy().equals(other.getCreateBy())) && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())) && (this.getIntroduction() == null ? other.getIntroduction() == null : this.getIntroduction().equals(other.getIntroduction())) && (this.getStreetId() == null ? other.getStreetId() == null : this.getStreetId().equals(other.getStreetId())) && (this.getIndustryCenterId() == null ? other.getIndustryCenterId() == null : this.getIndustryCenterId().equals(other.getIndustryCenterId())) && (this.getParam1() == null ? other.getParam1() == null : this.getParam1().equals(other.getParam1())) && (this.getUnit() == null ? other.getUnit() == null : this.getUnit().equals(other.getUnit())); } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); result = prime * result + ((getLevel() == null) ? 0 : getLevel().hashCode()); result = prime * result + ((getCommunityId() == null) ? 0 : getCommunityId().hashCode()); result = prime * result + ((getWorkTime() == null) ? 0 : getWorkTime().hashCode()); result = prime * result + ((getGoodAt() == null) ? 0 : getGoodAt().hashCode()); result = prime * result + ((getName() == null) ? 0 : getName().hashCode()); result = prime * result + ((getAvatar() == null) ? 0 : getAvatar().hashCode()); result = prime * result + ((getPhone() == null) ? 0 : getPhone().hashCode()); result = prime * result + ((getAccount() == null) ? 0 : getAccount().hashCode()); result = prime * result + ((getPassword() == null) ? 0 : getPassword().hashCode()); result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); result = prime * result + ((getDelFlag() == null) ? 0 : getDelFlag().hashCode()); result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); result = prime * result + ((getCreateBy() == null) ? 0 : getCreateBy().hashCode()); result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode()); result = prime * result + ((getIntroduction() == null) ? 0 : getIntroduction().hashCode()); result = prime * result + ((getStreetId() == null) ? 0 : getStreetId().hashCode()); result = prime * result + ((getIndustryCenterId() == null) ? 0 : getIndustryCenterId().hashCode()); result = prime * result + ((getParam1() == null) ? 0 : getParam1().hashCode()); result = prime * result + ((getUnit() == null) ? 0 : getUnit().hashCode()); return result; } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(getClass().getSimpleName()); sb.append(" ["); sb.append("Hash = ").append(hashCode()); sb.append(", id=").append(id); sb.append(", level=").append(level); sb.append(", communityId=").append(communityId); sb.append(", workTime=").append(workTime); sb.append(", goodAt=").append(goodAt); sb.append(", name=").append(name); sb.append(", avatar=").append(avatar); sb.append(", phone=").append(phone); sb.append(", account=").append(account); sb.append(", password=").append(password); sb.append(", status=").append(status); sb.append(", delFlag=").append(delFlag); sb.append(", createTime=").append(createTime); sb.append(", createBy=").append(createBy); sb.append(", updateTime=").append(updateTime); sb.append(", introduction=").append(introduction); sb.append(", streetId=").append(streetId); sb.append(", industryCenterId=").append(industryCenterId); sb.append(", param1=").append(param1); sb.append(", unit=").append(unit); sb.append(", serialVersionUID=").append(serialVersionUID); sb.append("]"); return sb.toString(); } } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComSanShuoExpertService.java
@@ -14,7 +14,7 @@ * @param comSanshuoExpertDTO * @return 处理结果 * */ R addExpert(ComSanshuoExpertDTO comSanshuoExpertDTO); R addOrUpdateExpert(ComSanshuoExpertDTO comSanshuoExpertDTO); /** * 后台获取专家列表 @@ -39,7 +39,7 @@ /** * 小程序获取专家列表 * */ R selectExpertList(); R selectExpertList(Integer type,Long id,Long cid); /** * 专家风采列表 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/IComEventService.java
@@ -50,7 +50,7 @@ * @author manailin * @date 2022-09-07 11:23:51 */ R<List<ComEvent>> pageByComEvent(ComEvent comEvent, Page pagination); R<List<ComEvent>> pageByComEvent(ComEvent comEvent, Page pagination,LoginUserInfoVO loginUserInfoVO); /** * description 三说会堂事件表列表数据 @@ -60,7 +60,7 @@ * @author manailin * @date 2022-09-07 11:23:51 */ List<ComEvent> listByComEvent(ComEvent comEvent); List<ComEvent> listByComEvent(ComEvent comEvent,LoginUserInfoVO loginUserInfoVO); /** * description 修改三说会堂事件表状态 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComEventServiceImpl.java
@@ -73,8 +73,19 @@ @Resource private CommediateTypeService commediateTypeService; @Override public R pageByComEvent(ComEvent comEvent, Page pagination) { public R pageByComEvent(ComEvent comEvent, Page pagination,LoginUserInfoVO loginUserInfoVO) { if (nonNull(comEvent.getUserType())){ if (comEvent.getUserType().equals(1)){ comEvent.setRequestUserId(loginUserInfoVO.getUserId()); }else if (comEvent.getUserType().equals(2)){ ComSanshuoExpert expert = comSanShuoExpertService.getOne(new QueryWrapper<ComSanshuoExpert>().lambda().eq(ComSanshuoExpert::getPhone, loginUserInfoVO.getPhone())); if (nonNull(expert)){ comEvent.setSpecialistId(expert.getId()); } } } IPage<ComEvent> list = baseMapper.pageByComEvent(comEvent, pagination); if (list.getRecords().size() < 1) { return R.ok(Collections.emptyList()); @@ -93,8 +104,8 @@ } @Override public List<ComEvent> listByComEvent(ComEvent comEvent) { List<ComEvent> list = baseMapper.listByComEvent(comEvent); public List<ComEvent> listByComEvent(ComEvent comEvent,LoginUserInfoVO loginUserInfoVO) { List<ComEvent> list = baseMapper.listByComEvent(comEvent,null); if (list.size() < 1) { return Collections.emptyList(); } @@ -188,7 +199,7 @@ comEvent.setEventSucceed(comEventConciliationVO.getEventSucceed()); comEvent.setEventResult(comEventConciliationVO.getEventResult()); comEvent.setReportSuperior(comEventConciliationVO.getReportSuperior()); if(comEventConciliationVO.getEventSucceed() ==2){ if(comEventConciliationVO.getEventSucceed().equals(2)){ comEvent.setEventProcessStatus(6); } comEvent.setCurrentEventProcessResult(comEventConciliationVO.getCurrentEventProcessResult()); @@ -240,8 +251,9 @@ || comEvent.getEventProcessStatus() == SanShuoEventStatusEnum.VALID.getCode().intValue()) { comEvent.setId(id); comEvent.setUserEventStatus(4); comEvent.setEventProcessStatus(SanShuoEventStatusEnum.CANCEL.getCode()); comEvent.setEventProcessStatus(8); comEvent.setRevokeDes("用户手动取消"); comEvent.setRevokeDate(new Date()); int flag = baseMapper.updateById(comEvent); return flag > 0 ? R.ok() : R.fail(ReturnMsgConstants.UPDATE_FALSE); } else { @@ -256,6 +268,7 @@ ComEvent comEvent = baseMapper.selectById(id); ComSanshuoExpert specter = comSanShuoExpertService.getById(comEvent.getSpecialistId()); CopyUtil.copyProperties(comEvent, comEventDetailVO); comEventDetailVO.setCategoryName(commediateTypeService.getById(comEventDetailVO.getEventCategory()).getName()); List<ComEventResource> resourceList = comEventResourceService.list(new QueryWrapper<ComEventResource>().lambda().eq(ComEventResource::getRefId, id) .eq(ComEventResource::getStatus,1)); List<ComEventRequestImageVO> comEventRequestImageVO = CopyUtil.deepCopyListObject(resourceList, ComEventRequestImageVO.class); @@ -264,7 +277,7 @@ map.put("eventDetail", comEventDetailVO); List<ComEventTransferRecord> transferRecord = comEventTransferRecordService.list(new QueryWrapper<ComEventTransferRecord>().lambda().eq(ComEventTransferRecord::getEventId, id)); transferRecord.forEach(comEventTransferRecord -> { List<ComEventResource> list = comEventResourceService.list(new QueryWrapper<ComEventResource>().lambda().eq(ComEventResource::getTransferId, comEventTransferRecord.getId())); List<ComEventResource> list = comEventResourceService.list(new QueryWrapper<ComEventResource>().lambda().eq(ComEventResource::getRefId, comEvent.getId())); List<ComEventRequestImageVO> ImageVO = CopyUtil.deepCopyListObject(list, ComEventRequestImageVO.class); comEventTransferRecord.setImages(ImageVO); }); @@ -308,7 +321,7 @@ List<ComEventCalculateVO> calculateList = baseMapper.calculate(); ComEventCalculateVO comEventCalculateVO =new ComEventCalculateVO(); comEventCalculateVO.setStatus("0"); comEventCalculateVO.setSum(baseMapper.selectCount(new QueryWrapper<ComEvent>().lambda()).toString()); comEventCalculateVO.setSum(baseMapper.selectCount(new QueryWrapper<ComEvent>().lambda().notIn(ComEvent::getEventProcessStatus,(9))).toString()); calculateList.add(comEventCalculateVO); return R.ok(calculateList); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComSanShuoExpertServiceImpl.java
@@ -28,6 +28,7 @@ import com.panzhihua.service_community.service.ComStreetService; import com.panzhihua.service_community.util.MyAESUtil; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import java.math.BigDecimal; @@ -35,6 +36,7 @@ import java.util.Date; import java.util.List; import static java.util.Objects.isNull; import static java.util.Objects.nonNull; @Service @@ -60,51 +62,75 @@ * @return 处理结果 * */ @Override public R addExpert(ComSanshuoExpertDTO comSanshuoExpertDTO) { //是否重名 List<ComSanshuoExpert> checkExpert=comSanshuoExpertDao.selectExpertByNameOrPhoneOrAccount(comSanshuoExpertDTO); if (checkExpert.size() != 0){ return R.fail("账号信息有重复"); } ComSanshuoExpert expert=new ComSanshuoExpert(); BeanUtil.copyProperties(comSanshuoExpertDTO,expert); if (nonNull(comSanshuoExpertDTO.getUnit())){ String id = comSanshuoExpertDTO.getUnit(); String[] split = id.split(","); expert.setUnitId(split[split.length-1]); } expert.setId(Snowflake.getId()); expert.setCreateTime(new Date()); if (expert.getLevel()==2){ expert.setIndustryCenterId(Long.parseLong(comSanshuoExpertDTO.getUnitId())); expert.setUnit(comSanshuoIndustryCenterDao.selectById(expert.getUnitId()).getName()+"调解站"); }else if(expert.getLevel()==3){ expert.setStreetId(Long.parseLong(comSanshuoExpertDTO.getUnitId())); expert.setUnit(comStreetDAO.selectById(expert.getUnitId()).getName()+"调解站"); }else if(expert.getLevel()==4){ expert.setCommunityId(Long.parseLong(comSanshuoExpertDTO.getUnitId())); expert.setUnit(comActDAO.selectById(expert.getUnitId()).getName()+"调解站"); } expert.setStatus(1); expert.setDelFlag(1); int insert = comSanshuoExpertDao.insert(expert); if (insert>0){ try { comSanshuoExpertDTO.setPassword(comSanshuoExpertDTO.getPassword()); } catch (Exception e) { e.printStackTrace(); @Transactional(rollbackFor = Exception.class) public R addOrUpdateExpert(ComSanshuoExpertDTO comSanshuoExpertDTO) { if (isNull(comSanshuoExpertDTO.getId())){ //是否重名 List<ComSanshuoExpert> checkExpert=comSanshuoExpertDao.selectExpertByNameOrPhoneOrAccount(comSanshuoExpertDTO); if (checkExpert.size() != 0){ return R.fail("账号信息有重复"); } //生成后台账号 AdministratorsUserVO user=new AdministratorsUserVO(); user.setUserId(Snowflake.getId()); user.setAccount(comSanshuoExpertDTO.getAccount()); user.setPassword(comSanshuoExpertDTO.getPassword()); user.setName(comSanshuoExpertDTO.getName()); user.setType(11); user.setImageUrl(comSanshuoExpertDTO.getAvatar()); return userService.sanShuoAddUser(user); ComSanshuoExpert expert=new ComSanshuoExpert(); BeanUtil.copyProperties(comSanshuoExpertDTO,expert); if (nonNull(comSanshuoExpertDTO.getUnit())){ String id = comSanshuoExpertDTO.getUnit(); String[] split = id.split(","); expert.setUnitId(split[split.length-1]); } expert.setId(Snowflake.getId()); expert.setCreateTime(new Date()); if (expert.getLevel()==2){ expert.setIndustryCenterId(Long.parseLong(expert.getUnitId())); expert.setUnit(comSanshuoIndustryCenterDao.selectById(expert.getUnitId()).getName()+"调解站"); }else if(expert.getLevel()==3){ expert.setStreetId(Long.parseLong(expert.getUnitId())); expert.setUnit(comStreetDAO.selectById(expert.getUnitId()).getName()+"调解站"); }else if(expert.getLevel()==4){ expert.setCommunityId(Long.parseLong(expert.getUnitId())); expert.setUnit(comActDAO.selectById(expert.getUnitId()).getName()+"调解站"); } expert.setStatus(1); expert.setDelFlag(1); int insert = comSanshuoExpertDao.insert(expert); if (insert>0){ try { comSanshuoExpertDTO.setPassword(comSanshuoExpertDTO.getPassword()); } catch (Exception e) { e.printStackTrace(); } //生成后台账号 AdministratorsUserVO user=new AdministratorsUserVO(); user.setUserId(Snowflake.getId()); user.setAccount(comSanshuoExpertDTO.getAccount()); user.setPassword(comSanshuoExpertDTO.getPassword()); user.setName(comSanshuoExpertDTO.getName()); user.setType(11); user.setImageUrl(comSanshuoExpertDTO.getAvatar()); return R.ok(userService.sanShuoAddUser(user)); } }else { ComSanshuoExpert expert=new ComSanshuoExpert(); BeanUtil.copyProperties(comSanshuoExpertDTO,expert); if (nonNull(comSanshuoExpertDTO.getUnit())){ String id = comSanshuoExpertDTO.getUnit(); String[] split = id.split(","); expert.setUnitId(split[split.length-1]); } expert.setUpdateTime(new Date()); if (expert.getLevel()==2){ expert.setIndustryCenterId(Long.parseLong(expert.getUnitId())); expert.setUnit(comSanshuoIndustryCenterDao.selectById(expert.getUnitId()).getName()+"调解站"); }else if(expert.getLevel()==3){ expert.setStreetId(Long.parseLong(expert.getUnitId())); expert.setUnit(comStreetDAO.selectById(expert.getUnitId()).getName()+"调解站"); }else if(expert.getLevel()==4){ expert.setCommunityId(Long.parseLong(expert.getUnitId())); expert.setUnit(comActDAO.selectById(expert.getUnitId()).getName()+"调解站"); } return R.ok(comSanshuoExpertDao.updateById(expert)); } return R.fail("添加失败"); return R.fail("操作失败"); } /** @@ -255,28 +281,28 @@ * 小程序获取专家列表 * */ @Override public R selectExpertList() { List<ComSanshuoExpert> comSanshuoExperts = comSanshuoExpertDao.selectList(new QueryWrapper<ComSanshuoExpert>().lambda().eq(ComSanshuoExpert::getStatus, 1).eq(ComSanshuoExpert::getDelFlag, 1)); //设置成功率 for (ComSanshuoExpert comSanshuoExpert : comSanshuoExperts) { //查询成功率 Integer count = comEventMapper.selectCount(new QueryWrapper<ComEvent>().lambda().eq(ComEvent::getSpecialistId, comSanshuoExpert.getId()).eq(ComEvent::getEventProcessStatus, 6)); Integer successCount = comEventMapper.selectCount(new QueryWrapper<ComEvent>().lambda().eq(ComEvent::getSpecialistId, comSanshuoExpert.getId()).eq(ComEvent::getEventProcessStatus, 6).eq(ComEvent::getEventResult, 2)); comSanshuoExpert.setCount(count); if (nonNull(count) && !count.equals(0)){ comSanshuoExpert.setCount(count); if (nonNull(successCount) && !count.equals(successCount)){ //计算成功率 comSanshuoExpert.setRate(NumberUtil.div(successCount, count,2)); }else { comSanshuoExpert.setRate(new BigDecimal(0)); } public R selectExpertList(Integer type,Long id,Long cid) { List<ComSanshuoExpert> list=new ArrayList<>(); if (type.equals(1)){ //行业分中心下属专家 list=comSanshuoExpertDao.selectList(new QueryWrapper<ComSanshuoExpert>().lambda(). eq(ComSanshuoExpert::getStatus, 1). eq(ComSanshuoExpert::getDelFlag,1 ). eq(ComSanshuoExpert::getIndustryCenterId, id)); }else { if (nonNull(id)){ list=comSanshuoExpertDao.selectList(new QueryWrapper<ComSanshuoExpert>().lambda(). eq(ComSanshuoExpert::getStatus, 1). eq(ComSanshuoExpert::getDelFlag,1 ). eq(ComSanshuoExpert::getCommunityId, id)); }else { comSanshuoExpert.setCount(0); list=comSanshuoExpertDao.selectList(new QueryWrapper<ComSanshuoExpert>().lambda(). eq(ComSanshuoExpert::getStatus, 1). eq(ComSanshuoExpert::getDelFlag,1 ). eq(ComSanshuoExpert::getCommunityId,cid )); } } return R.ok(comSanshuoExperts); return R.ok(list); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComEventMapper.xml
@@ -78,6 +78,12 @@ <if test="comEvent.currentOrgName != null"> AND current_org_name = #{comEvent.currentOrgName} </if> <if test="comEvent.userType == 1"> AND request_user_id=#{comEvent.requestUserId} </if> <if test="comEvent.userType == 2"> AND specialist_id=#{comEvent.specialistId} </if> </where> order by create_at desc </select> @@ -85,6 +91,9 @@ <select id="listByComEvent" resultType="com.panzhihua.service_community.entity.ComEvent"> SELECT <include refid="columns" /> FROM com_sanshuo_event_info <if test="requestUserId != null and requestUserId != ''"> where request_user_id=#{requestUserId} </if> </select> <select id="calculate" resultType="com.panzhihua.common.model.vos.sanshuo.ComEventCalculateVO"> @@ -379,6 +388,7 @@ left join com_sanshuo_expert t1 on t.specialist_id=t1.id where t.event_process_status not in(7.8) group by t1.level having type is not null </select> <select id="mediateTypeRate" resultType="com.panzhihua.common.model.vos.sanshuo.EventRateVO"> select count(t.id) as count,t1.name from com_sanshuo_event_info t springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComSanshuoExpertDao.xml
@@ -34,7 +34,7 @@ password,status,del_flag, create_time,create_by,update_time, introduction,street_id,industry_center_id, param1,unit from com_sanshuo_expert unit_id,unit from com_sanshuo_expert </sql> <select id="expertShow" resultType="com.panzhihua.common.model.vos.sanshuo.ExpertShowVO"> select count(id) as 'count',level from com_sanshuo_expert where status=1 and del_flag=1 group by level springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComSanshuoIndustryCenterDao.xml
@@ -38,9 +38,10 @@ select id,name from com_sanshuo_industry_center where status=1 and del_flag=1 </select> <select id="streetList" resultType="com.panzhihua.common.model.vos.sanshuo.ExpertRangeVO"> select street_id as id,name from com_street select street_id as id,name from com_street where app_id='wx0cef797390444b75' </select> <select id="communityList" resultType="com.panzhihua.common.model.vos.sanshuo.ExpertRangeVO"> select community_id as id,name from com_act where app_id='wx0cef797390444b75' </select> </mapper> springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/api/UserApi.java
@@ -1470,6 +1470,14 @@ return userService.resetPassExpertOrIndustryCenter(account,password); } /** * 移除账号专家权限 * */ @GetMapping("/removeExpertRole") public R removeExpertRole(@RequestParam(value = "phone",required = false)String phone){ return userService.removeExpertRole(phone); } @GetMapping("/accept") public R accept(@RequestParam("userId")Long userId){ springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/dao/UserDao.java
@@ -8,6 +8,7 @@ import com.panzhihua.common.model.vos.community.acid.ComActAcidCheckRecordVO; import com.panzhihua.common.model.vos.community.acid.ComActAcidMemberVO; import com.panzhihua.common.model.vos.community.acid.ComActAcidRecordVO; import com.panzhihua.common.model.vos.sanshuo.ComSanshuoExpertVO; import com.panzhihua.common.model.vos.user.*; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -370,4 +371,9 @@ List<CommunityVO> selectCommunityByStreetName(String name); StreetVOS selectStreetByName(String name); /** * 是否为专家 * */ ComSanshuoExpertVO isExpert(String phone); } springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/UserService.java
@@ -940,4 +940,9 @@ R accept(Long userId); R addComPbCheckUser(ComPbCheckUserDTO comPbCheckUserDTO); /** * 移除专家权限 * */ R removeExpertRole(String phone); } springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java
@@ -28,7 +28,9 @@ import com.panzhihua.common.model.vos.community.acid.ComActAcidMemberVO; import com.panzhihua.common.model.vos.community.acid.ComActAcidRecordVO; import com.panzhihua.common.model.vos.community.microCommercialStreet.McsLoginUserInfoVO; import com.panzhihua.common.model.vos.sanshuo.ComSanshuoExpertVO; import com.panzhihua.common.model.vos.user.*; import com.panzhihua.common.service.community.CommunityService; import com.panzhihua.common.utlis.*; import com.panzhihua.service_user.dao.*; import com.panzhihua.service_user.entity.SysAppConfig; @@ -492,6 +494,11 @@ loginUserInfoVO.setLevel(2); }else if (isNull(loginUserInfoVO.getLevel())){ loginUserInfoVO.setLevel(1); } //是否为三说会堂专家 ComSanshuoExpertVO expertVO=userDao.isExpert(loginUserInfoVO.getPhone()); if (nonNull(expertVO)){ loginUserInfoVO.setType(13); } return R.ok(loginUserInfoVO); } @@ -3754,6 +3761,7 @@ //是否存在相同账号 SysUserDO userDO = userDao.selectOne(new QueryWrapper<SysUserDO>().eq("account", administratorsUserVO.getAccount())); if (isNull(userDO)){ sysUserDO.setAppId("wx0cef797390444b75"); sysUserDO.setCreateAt(new Date()); sysUserDO.setUserId(administratorsUserVO.getUserId()); sysUserDO.setAccount(administratorsUserVO.getAccount()); @@ -3771,6 +3779,13 @@ sysUserRole.setUserId(sysUserDO.getUserId()); if (sysUserDO.getType().equals(11)){ sysUserRole.setRoleId(Long.parseLong(UserConstants.SANSHUO_EXPERT_ROLE)); //将专家小程序账号设置为专家权限 SysUserDO sysUserDO1 = userDao.selectOne(new QueryWrapper<SysUserDO>().lambda().eq(SysUserDO::getType, 1).eq(SysUserDO::getPhone, administratorsUserVO.getPhone())); if (nonNull(sysUserDO1)){ sysUserDO1.setType(13); userDao.updateById(sysUserDO1); log.info("添加专家小程序账号权限"); } }else{ sysUserRole.setRoleId(Long.parseLong(UserConstants.SANSHUO_INDUSTRY_CENTER_ROLE)); } @@ -3795,6 +3810,31 @@ return R.fail("修改失败"); } /** * 移除专家权限 * */ @Override public R removeExpertRole(String phone) { if (nonNull(phone)){ //是否有权限为专家的账号 SysUserDO sysUserDO = userDao.selectOne(new QueryWrapper<SysUserDO>().lambda().eq(SysUserDO::getType, 11).eq(SysUserDO::getPhone, phone)); if (nonNull(sysUserDO)){ //删除后台账号 sysUserDO.setStatus(2); userDao.updateById(sysUserDO); log.info("禁用专家后台账号成功"); } //小程序账号移除专家权限 SysUserDO sysUserDO1 = userDao.selectOne(new QueryWrapper<SysUserDO>().lambda().eq(SysUserDO::getType, 13).eq(SysUserDO::getPhone, phone)); if (nonNull(sysUserDO1)){ sysUserDO1.setType(1); userDao.updateById(sysUserDO1); log.info("移除专家权限成功"); } } return R.ok(); } @Override public R getAreaAndStreet() { springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/UserDao.xml
@@ -774,4 +774,7 @@ where su.account=#{name} limit 1 </select> <select id="isExpert" resultType="com.panzhihua.common.model.vos.sanshuo.ComSanshuoExpertVO"> select * from com_sanshuo_expert where phone=#{phone} </select> </mapper>