Merge branch 'huacheng_test' of http://gitlab.nhys.cdnhxx.com/root/zhihuishequ into huacheng_test
| | |
| | | </dependency> |
| | | |
| | | |
| | | <dependency> |
| | | <groupId>io.jsonwebtoken</groupId> |
| | | <artifactId>jjwt</artifactId> |
| | | <version>0.9.1</version> |
| | | </dependency> |
| | | |
| | | |
| | | </dependencies> |
| | | |
| | |
| | | /** |
| | | * token有效期(小时) |
| | | */ |
| | | public static final int TOKEN_EXPIRES_HOUR = 1; |
| | | public static final int TOKEN_EXPIRES_HOUR = 10; |
| | | |
| | | /** |
| | | * redis存储手机验证码过期时间(10分钟) |
| | |
| | | */ |
| | | public static final String AUTHORIZATION = "Authorization"; |
| | | |
| | | /** |
| | | * 小程序 花城e+token |
| | | */ |
| | | public static final String HCAUTHORIZATION = "HCAuthorization"; |
| | | |
| | | } |
| | |
| | | * @param orderNum |
| | | * @return |
| | | */ |
| | | @ApiOperation("获取订单详情") |
| | | @ApiOperation(value = "获取订单详情",response = GuideRepairOrder.class) |
| | | @GetMapping("/orderdata") |
| | | @Authorization |
| | | public ResultData selectConfigData(@RequestParam(value = "Id",required = false) String Id, |
| | |
| | | * @param order |
| | | * @return |
| | | */ |
| | | @ApiOperation("转派人员") |
| | | @ApiOperation(value = "转派人员",response = GuideRepairOrder.class) |
| | | @PostMapping("/redeploy") |
| | | @Authorization |
| | | public ResultData redeploy(@RequestBody GuideRepairOrder order, @CurrentUser SysUser sysUser) |
| | |
| | | return ResultData.error("导办人员id不能为空"); |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(order.getGuideUserPhone())) |
| | | { |
| | | return ResultData.error("导办人员电话不能为空"); |
| | | } |
| | | |
| | | //已分配 |
| | | order.setState("2"); |
| | |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | @ApiOperation("去处理") |
| | | @ApiOperation(value = "去处理",response = GuideRepairOrder.class) |
| | | @PostMapping("/dispose") |
| | | @Authorization |
| | | public ResultData dispose(@RequestBody GuideEvolveEntity entity, @CurrentUser SysUser sysUser) |
| | |
| | | { |
| | | return ResultData.error("该工单已办结!"); |
| | | } |
| | | |
| | | if(!StringUtils.equals(order.getState(),"2")) |
| | | { |
| | | return ResultData.error("该工单非是待办状态!"); |
| | | if(StringUtils.equals(entity.getState(),"2")){//如果用户选择未解决则状态改为待办 |
| | | order.setState("2"); |
| | | entity.setState("8"); |
| | | } |
| | | //待评价 |
| | | order.setState("4"); |
| | | else if(StringUtils.equals(entity.getState(),"4")){ |
| | | //待评价 |
| | | order.setState("4"); |
| | | entity.setState("9"); |
| | | } |
| | | //新增已办结记录 |
| | | entity.setCreateTime(LocalDateTime.now()); |
| | | entity.setUpdateTime(LocalDateTime.now()); |
| | | entity.setState("4"); |
| | | entity.setFromDepartmentalId(sysUser.getDepartmentId()); |
| | | entity.setFromUserId(sysUser.getUserId()+""); |
| | | entity.setGuideId(order.getId().toString()); |
| | | iGuideEvolveService.insertConfig(entity); |
| | | return toAjax(iGuideRepairOrderService.updateConfig(order)); |
| | | } |
| | |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | @ApiOperation("取消导办工单") |
| | | @ApiOperation(value = "取消导办工单",response = GuideRepairOrder.class) |
| | | @PostMapping("/cancel") |
| | | @Authorization |
| | | public ResultData cancel(@RequestBody GuideEvolveEntity entity, @CurrentUser SysUser sysUser) |
| | |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | @ApiOperation("工单评价") |
| | | @ApiOperation(value = "工单评价",response = GuideRepairOrder.class) |
| | | @PostMapping("/evaluate") |
| | | @Authorization |
| | | public ResultData evaluate(@RequestBody GuideRepairOrder entity, @CurrentUser SysUser sysUser) |
| | |
| | | { |
| | | return ResultData.error("满意程度不能为空!"); |
| | | } |
| | | |
| | | //已办结 |
| | | entity.setState("3"); |
| | | //新增已办结记录 |
| | |
| | | * @param sysUser 当前登录人员信息 |
| | | * @return |
| | | */ |
| | | @ApiOperation("获取个人中心工单数据") |
| | | @ApiOperation(value = "获取个人中心工单数据",response = GuideRepairOrder.class) |
| | | @GetMapping("/personalCenter") |
| | | @Authorization |
| | | public ResultData selectBySubmitId(@CurrentUser SysUser sysUser){ |
| | |
| | | */ |
| | | @ApiOperation("查询导办事务详情") |
| | | @GetMapping("/getData") |
| | | @Authorization |
| | | public ResultData selectConfigData(@RequestParam("Id") String Id,@CurrentUser SysUser sysUser) |
| | | { |
| | | Assert.notNull(Id, "Id 不能为空"); |
| | |
| | | |
| | | import com.dg.core.ResultData; |
| | | import com.dg.core.db.gen.entity.AreaCode2022; |
| | | import com.dg.core.db.gen.entity.OrganizationChartEntity; |
| | | import com.dg.core.service.IAreaCodeService; |
| | | import com.dg.core.util.TableDataInfo; |
| | | import io.swagger.annotations.Api; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | @Api(tags = {"所属地区接口"}) |
| | | @RestController |
| | |
| | | public TableDataInfo getAreaCodeByTransactionId(@RequestParam("transactionId") Integer transactionId){ |
| | | return getDataTable(iAreaCodeService.getAreaCodeByTransactionId(transactionId)); |
| | | } |
| | | |
| | | /** |
| | | * 获取攀枝花所有所属地区 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "获取攀枝花所有所属地区",response = AreaCode2022.class) |
| | | @GetMapping("/getListByPCode") |
| | | public TableDataInfo getListByPCode(){ |
| | | return getDataTable(iAreaCodeService.getListByPCode("510400000000")); |
| | | } |
| | | } |
| | |
| | | import com.dg.core.annotation.Authorization; |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | import com.dg.core.service.ISysUserService; |
| | | import com.dg.core.util.Snowflake; |
| | | import com.dg.core.util.TableDataInfo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | |
| | | config.setCreateTime(LocalDateTime.now()); |
| | | config.setUpdateTime(LocalDateTime.now()); |
| | | |
| | | config.setUserId(Snowflake.getId()); |
| | | return toAjax(IUserService.insertConfig(config)); |
| | | } |
| | | |
| | |
| | | @ApiOperation("根据部门id及分类id获取导办用户") |
| | | @GetMapping("/selectListByDepartmentId") |
| | | @Authorization |
| | | public ResultData selectListByDepartmentId(@RequestParam("departmentId") String departmentId, @RequestParam("classifyId") String classifyId){ |
| | | public ResultData selectListByDepartmentId(@RequestParam("departmentId") String departmentId, |
| | | @RequestParam("classifyId") String classifyId){ |
| | | return ResultData.success(IUserService.selectListByDepartmentId(departmentId,classifyId)); |
| | | } |
| | | |
| | |
| | | return ResultData.error("导办人员id不能为空"); |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(order.getGuideUserPhone())) |
| | | { |
| | | return ResultData.error("导办人员电话不能为空"); |
| | | } |
| | | |
| | | |
| | | //已分配 |
| | | order.setState("2"); |
| | |
| | | entity.setToUserId(sysUser.getUserId()+""); |
| | | entity.setFromUserId(order.getGuideUserId()); |
| | | entity.setFromDepartmentalId(order.getGuideDepartmentId()); |
| | | entity.setGuideId(order.getId().toString()); |
| | | |
| | | iGuideEvolveService.insertConfig(entity); |
| | | |
| | |
| | | return ResultData.error("导办人员id不能为空"); |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(order.getGuideUserPhone())) |
| | | { |
| | | return ResultData.error("导办人员电话不能为空"); |
| | | } |
| | | |
| | | //已分配 |
| | | order.setState("2"); |
| | | |
| | |
| | | entity.setToUserId(sysUser.getUserId()+""); |
| | | entity.setFromUserId(order.getGuideUserId()); |
| | | entity.setFromDepartmentalId(order.getGuideDepartmentId()); |
| | | entity.setGuideId(order.getId().toString()); |
| | | |
| | | iGuideEvolveService.insertConfig(entity); |
| | | |
| | |
| | | { |
| | | return ResultData.error("该工单已办结!"); |
| | | } |
| | | |
| | | if(!StringUtils.equals(order.getState(),"2")) |
| | | { |
| | | return ResultData.error("该工单非是待办状态!"); |
| | | if(StringUtils.equals(entity.getState(),"2")){//如果用户选择未解决则状态改为待办 |
| | | order.setState("2"); |
| | | entity.setState("8"); |
| | | } |
| | | //待评价 |
| | | order.setState("4"); |
| | | else if(StringUtils.equals(entity.getState(),"4")){ |
| | | //待评价 |
| | | order.setState("4"); |
| | | entity.setState("9"); |
| | | } |
| | | //新增已办结记录 |
| | | entity.setCreateTime(LocalDateTime.now()); |
| | | entity.setUpdateTime(LocalDateTime.now()); |
| | | entity.setState("4"); |
| | | entity.setFromDepartmentalId(sysUser.getDepartmentId()); |
| | | entity.setFromUserId(sysUser.getUserId()+""); |
| | | entity.setGuideId(order.getId().toString()); |
| | | iGuideEvolveService.insertConfig(entity); |
| | | return toAjax(iGuideRepairOrderService.updateConfig(order)); |
| | | } |
| | |
| | | entity.setState("5"); |
| | | entity.setFromDepartmentalId(sysUser.getDepartmentId()); |
| | | entity.setFromUserId(sysUser.getUserId()+""); |
| | | entity.setGuideId(order.getId().toString()); |
| | | iGuideEvolveService.insertConfig(entity); |
| | | return toAjax(iGuideRepairOrderService.updateConfig(order)); |
| | | } |
| | |
| | | guideEvolveEntity.setState("3"); |
| | | guideEvolveEntity.setFromDepartmentalId(sysUser.getDepartmentId()); |
| | | guideEvolveEntity.setFromUserId(sysUser.getUserId()+""); |
| | | guideEvolveEntity.setGuideId(entity.getId().toString()); |
| | | iGuideEvolveService.insertConfig(guideEvolveEntity); |
| | | |
| | | return toAjax(iGuideRepairOrderService.updateConfig(entity)); |
| | |
| | | * @param sysUser 当前登录人员信息 |
| | | * @return |
| | | */ |
| | | @ApiOperation("获取个人中心工单数据") |
| | | @ApiOperation(value = "获取个人中心工单数据",response = GuideRepairOrder.class) |
| | | @GetMapping("/personalCenter") |
| | | @Authorization |
| | | public ResultData selectBySubmitId(@CurrentUser SysUser sysUser){ |
| | |
| | | package com.dg.core.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dg.core.ResultData; |
| | | import com.dg.core.annotation.Authorization; |
| | | import com.dg.core.annotation.CurrentUser; |
| | | import com.dg.core.db.gen.entity.OrganizationChartEntity; |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | import com.dg.core.service.IOrganizationChartService; |
| | | import com.dg.core.util.TableDataInfo; |
| | | import io.swagger.annotations.Api; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.Assert; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | |
| | | @Api(tags = {"组织架构接口"}) |
| | |
| | | /** |
| | | * 查询机构列表 |
| | | */ |
| | | @ApiOperation("查询机构列表") |
| | | @ApiOperation(value = "查询机构列表",response = OrganizationChartEntity.class) |
| | | @GetMapping("/getList") |
| | | public TableDataInfo selectConfigList() |
| | | { |
| | |
| | | /** |
| | | * 新增机构 |
| | | */ |
| | | @ApiOperation("新增机构") |
| | | @ApiOperation(value = "新增机构",response = OrganizationChartEntity.class) |
| | | @PostMapping("/add") |
| | | @Authorization |
| | | public ResultData insertConfig(@RequestBody OrganizationChartEntity entity) |
| | |
| | | /** |
| | | * 更新机构 |
| | | */ |
| | | @ApiOperation("更新机构") |
| | | @ApiOperation(value = "更新机构",response = OrganizationChartEntity.class) |
| | | @PostMapping("/update") |
| | | @Authorization |
| | | public ResultData updateConfig(@RequestBody OrganizationChartEntity entity) |
| | | public ResultData updateConfig(@RequestBody OrganizationChartEntity entity,@CurrentUser SysUser sysUser) |
| | | { |
| | | entity.setUpdateTime(LocalDateTime.now()); |
| | | entity.setUpdateUserId(Integer.parseInt(String.valueOf(sysUser.getUserId()))); |
| | | return toAjax(iOrganizationChartService.updateConfig(entity)); |
| | | } |
| | | |
| | |
| | | */ |
| | | @ApiOperation("删除机构") |
| | | @DeleteMapping("/delete") |
| | | @Authorization |
| | | // @Authorization |
| | | public ResultData deleteConfigById(@RequestParam(value = "Id",required = false) String Id) |
| | | { |
| | | Assert.notNull(Id, "Id 不能为空"); |
| | | List<OrganizationChartEntity> list=iOrganizationChartService.selectParentList(Id,""); |
| | | |
| | | if(list!=null && list.size()>0) |
| | | { |
| | | return ResultData.error("该机构下存在其他部门!请先删除子部门"); |
| | | } |
| | | return toAjax(iOrganizationChartService.deleteConfigById(Id)); |
| | | } |
| | | |
| | |
| | | return ResultData.success(iOrganizationChartService.selectConfigById(id)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询机构列表(分页) |
| | | */ |
| | | @ApiOperation(value = "查询机构列表(分页)(部门应用)",response = OrganizationChartEntity.class) |
| | | @GetMapping("/queryList") |
| | | @Authorization |
| | | public TableDataInfo queryList(@RequestParam(value = "pageNum",required = false) Integer pageNum, |
| | | @RequestParam(value = "pageSize",required = false) Integer pageSize, |
| | | @RequestParam(value = "organizationName",required = false)String organizationName){ |
| | | Assert.notNull(pageNum, "pageNum can not be empty"); |
| | | Assert.notNull(pageSize, "pageSize can not be empty"); |
| | | Page<OrganizationChartEntity> pageParam = new Page<>(pageNum,pageSize); |
| | | return getDataTable(iOrganizationChartService.queryList(pageParam,pageSize,organizationName),iOrganizationChartService.countList(organizationName)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 通过父级id查询对应机构下的全部部门id |
| | | * @param departmentId |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "通过父级id查询对应机构下的全部部门",response = OrganizationChartEntity.class) |
| | | @GetMapping("/getdepartment") |
| | | public TableDataInfo getOrganizations(@RequestParam(value = "department",required = false) String departmentId) |
| | | { |
| | | List<OrganizationChartEntity> ids=new ArrayList<>(); |
| | | List<OrganizationChartEntity> lists = iOrganizationChartService.selectParentList(departmentId,""); |
| | | if(lists.size()<1) |
| | | { |
| | | lists.add(iOrganizationChartService.selectConfigById(departmentId)); |
| | | } |
| | | ids=disposestreet(lists); |
| | | if(ids.size()<1) |
| | | { |
| | | return null; |
| | | } |
| | | ids.add(iOrganizationChartService.selectConfigById(departmentId)); |
| | | return getDataTable(ids); |
| | | } |
| | | |
| | | //递归取id |
| | | private List<OrganizationChartEntity> disposestreet(List<OrganizationChartEntity> lists) |
| | | { |
| | | List<OrganizationChartEntity> ids=new ArrayList<>(); |
| | | for (OrganizationChartEntity sysStreet:lists) |
| | | { |
| | | ids.add(sysStreet); |
| | | if(sysStreet.getChild()!=null && sysStreet.getChild().size()>0) |
| | | { |
| | | ids.addAll(disposestreet(sysStreet.getChild())); |
| | | } |
| | | else |
| | | { |
| | | ids.add(sysStreet); |
| | | } |
| | | } |
| | | return ids; |
| | | } |
| | | |
| | | } |
| | |
| | | */ |
| | | @ApiOperation("查询导办事务详情") |
| | | @GetMapping("/getData") |
| | | @Authorization |
| | | public ResultData selectConfigData(@RequestParam("Id") String Id,@CurrentUser SysUser sysUser) |
| | | { |
| | | Assert.notNull(Id, "Id 不能为空"); |
| | |
| | | import com.dg.core.HttpStatus; |
| | | import com.dg.core.ResultData; |
| | | import com.dg.core.annotation.Authorization; |
| | | import com.dg.core.db.gen.entity.HuaChengSysUser; |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | import com.dg.core.manager.TokenManager; |
| | | import com.dg.core.service.IHuaChengSysUserService; |
| | | import com.dg.core.util.SmsUtil; |
| | | import com.dg.core.util.TableDataInfo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.data.repository.query.Param; |
| | | import org.springframework.util.Assert; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.time.LocalDateTime; |
| | | import java.util.HashMap; |
| | |
| | | @Autowired |
| | | SmsUtil smsUtil; |
| | | |
| | | |
| | | |
| | | @Autowired |
| | | TokenManager tokenManager; |
| | | |
| | | /** |
| | | * 花城e+用户接口 |
| | | */ |
| | | @Autowired |
| | | IHuaChengSysUserService iHuaChengSysUserService; |
| | | |
| | | @ApiOperation("登录接口") |
| | | @PostMapping(path = "/login") |
| | |
| | | Assert.notNull(account, "username can not be empty"); |
| | | Assert.notNull(password, "password can not be empty"); |
| | | |
| | | SysUser user = IUserService.getUserByAccount(account); |
| | | if (user == null || !password.equals(user.getPassword())) { |
| | | SysUser user=null; |
| | | //管理员登录 |
| | | if(StringUtils.equals("zigonggaoadmin",account)) |
| | | { |
| | | user= IUserService.getUserByAccount(account); |
| | | |
| | | if(user==null || !password.equals(user.getPassword())) |
| | | { |
| | | //提示用户名或密码错误 |
| | | return ResultData.fail(HttpStatus.UNAUTHORIZED, "用户名或密码错误"); |
| | | } |
| | | String token = tokenManager.getTokenByUserId(user.getUserId()); |
| | | System.out.println("token "+token); |
| | | if (token == null) { |
| | | //生成一个token,保存用户登录状态 |
| | | token = tokenManager.createToken(user.getUserId(), user.getUserId()); |
| | | } |
| | | |
| | | user.setLoginDate(LocalDateTime.now()); |
| | | //更新登录时间 |
| | | IUserService.updateConfig(user); |
| | | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("token", token); |
| | | map.put("userId", user.getUserId()); |
| | | map.put("userName", user.getUserName()); |
| | | |
| | | return ResultData.success(map); |
| | | } |
| | | |
| | | HuaChengSysUser huaChengSysUser=iHuaChengSysUserService.selectData("",account,""); |
| | | if(huaChengSysUser==null || !password.equals(huaChengSysUser.getPassword())) |
| | | { |
| | | //提示用户名或密码错误 |
| | | return ResultData.fail(HttpStatus.UNAUTHORIZED, "用户名或密码错误"); |
| | | } |
| | | |
| | | //本地表查询用户 |
| | | user = IUserService.selectData(huaChengSysUser.getUserId()+""); |
| | | if (user == null) { |
| | | //本地没有此用户 新用户 |
| | | SysUser newSysUser=new SysUser(); |
| | | //默认 1系统后台用户 |
| | | newSysUser.setUserType("1"); |
| | | newSysUser.setPhonenumber(huaChengSysUser.getPhone()); |
| | | newSysUser.setUserId(huaChengSysUser.getUserId()); |
| | | newSysUser.setUserName(huaChengSysUser.getNickName()); |
| | | newSysUser.setSex(huaChengSysUser.getSex()); |
| | | newSysUser.setAvatar(huaChengSysUser.getImageUrl()); |
| | | newSysUser.setCreateTime(LocalDateTime.now()); |
| | | newSysUser.setUpdateTime(LocalDateTime.now()); |
| | | IUserService.insertConfig(newSysUser); |
| | | } |
| | | |
| | | user = IUserService.selectData(huaChengSysUser.getUserId()+""); |
| | | |
| | | if (user == null) { |
| | | return ResultData.error("用户不存在!请联系管理员"); |
| | | } |
| | | |
| | | String token = tokenManager.getTokenByUserId(user.getUserId()); |
| | | // String token = tokenManager.createToken(user.getUserId(), user.getRoleId()); |
| | | System.out.println("token "+token); |
| | | if (token == null) { |
| | | //生成一个token,保存用户登录状态 |
| | |
| | | return error("userId不能为空"); |
| | | } |
| | | |
| | | SysUser sysUser=IUserService.getUserById(Long.valueOf(userId)); |
| | | SysUser sysUser=IUserService.selectData(userId); |
| | | //删除标志(0代表存在 2代表删除) |
| | | sysUser.setDelFlag("2"); |
| | | return toAjax(IUserService.updateConfig(sysUser)); |
| | |
| | | return error("密码不能为空"); |
| | | } |
| | | |
| | | SysUser sysUser=IUserService.getUserById(config.getUserId()); |
| | | SysUser sysUser=IUserService.selectData(config.getUserId()+""); |
| | | if(sysUser==null) |
| | | { |
| | | return error("用户不存在"); |
| | |
| | | package com.dg.core.db.gen.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * 级别1-5,省市县镇村 |
| | | */ |
| | | @ApiModelProperty("级别1-5,省市县镇村") |
| | | private Boolean level; |
| | | private Integer level; |
| | | |
| | | /** |
| | | * 父级区划代码 |
| | |
| | | @ApiModelProperty("父级区划代码") |
| | | private Long pcode; |
| | | |
| | | /** |
| | | * 子节点 |
| | | */ |
| | | @TableField(exist = false) |
| | | @ApiModelProperty("子节点") |
| | | private List<AreaCode2022> child; |
| | | |
| | | |
| | | } |
| | |
| | | package com.dg.core.db.gen.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | 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 java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel("导办工单进展记录表") |
| | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | |
| | | |
| | | /** |
| | | * 视频url |
| | | */ |
| | | @ApiModelProperty(name = "videoUrl", value = "视频url") |
| | | private String videoUrl; |
| | | |
| | | /** |
| | | * 图片url |
| | | */ |
| | | @ApiModelProperty(name = "pictureUrl", value = "图片url") |
| | | private String pictureUrl; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(name = "toUserName", value = "发起人名字") |
| | | private String toUserName; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(name = "toUserName", value = "接收人名字") |
| | | private String fromUserName; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(name = "elseAccessoryEntities", value = "其他附件列表") |
| | | private List<ElseAccessoryEntity> elseAccessoryEntities; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(name = "transactionEvents", value = "推荐办事指南列表") |
| | | private List<TransactionEvent> transactionEvents; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(name = "suggest", value = "建议") |
| | | private String suggest; |
| | | |
| | | @ApiModelProperty(name = "evaluateState", value = "评价状态") |
| | | @ApiModelProperty(name = "evaluateState", value = "评价状态(1 满意 2不满意)") |
| | | private String evaluateState; |
| | | |
| | | @ApiModelProperty(name = "serviceState", value = "服务状态(1.已解决 2.未解决)") |
New file |
| | |
| | | package com.dg.core.db.gen.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | |
| | | /** |
| | | * 此类为花城e+主体类 |
| | | * 不可修改 切记!!!!!!!!!!!!!!!!!! |
| | | * 不可修改 切记!!!!!!!!!!!!!!!!!! |
| | | * 不可修改 切记!!!!!!!!!!!!!!!!!! |
| | | * 不可修改 切记!!!!!!!!!!!!!!!!!! |
| | | * 不可修改 切记!!!!!!!!!!!!!!!!!! |
| | | * 不可修改 切记!!!!!!!!!!!!!!!!!! |
| | | */ |
| | | @ApiModel("花城用户信息实体类") |
| | | @Data |
| | | @TableName("sys_user") |
| | | public class HuaChengSysUser implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 用户ID |
| | | */ |
| | | @ApiModelProperty(name = "userId", value = "主键用户id") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | @TableId(value = "user_id", type = IdType.AUTO) |
| | | private Long userId; |
| | | |
| | | /** |
| | | * 登录账户 |
| | | */ |
| | | @ApiModelProperty(name = "account", value = "登录账户") |
| | | private String account; |
| | | |
| | | /** |
| | | * 登录密码 |
| | | */ |
| | | @ApiModelProperty(name = "password", value = "登录密码") |
| | | private String password; |
| | | |
| | | /** |
| | | * 微信小程序唯一标识 |
| | | */ |
| | | @ApiModelProperty(name = "openid", value = "微信小程序唯一标识") |
| | | private String openid; |
| | | |
| | | /** |
| | | * 会话密钥 |
| | | */ |
| | | @ApiModelProperty(name = "sessionKey", value = "会话密钥") |
| | | private String sessionKey; |
| | | |
| | | /** |
| | | * 用户在开放平台的唯一标识符 |
| | | */ |
| | | @ApiModelProperty(name = "unionid", value = "用户在开放平台的唯一标识符") |
| | | private String unionid; |
| | | |
| | | /** |
| | | * 手机号 |
| | | */ |
| | | @ApiModelProperty(name = "phone", value = "手机号") |
| | | private String phone; |
| | | |
| | | /** |
| | | * 昵称 |
| | | */ |
| | | @ApiModelProperty(name = "nickName", value = "昵称") |
| | | private String nickName; |
| | | |
| | | /** |
| | | * 真实名字 |
| | | */ |
| | | @ApiModelProperty(name = "name", value = "真实名字") |
| | | private String name; |
| | | |
| | | /** |
| | | * 社区ID |
| | | */ |
| | | @ApiModelProperty(name = "communityId", value = "社区ID") |
| | | private String communityId; |
| | | |
| | | /** |
| | | * 性别 1 男 2 女 |
| | | */ |
| | | @ApiModelProperty(name = "sex", value = "性别 1 男 2 女") |
| | | private String sex; |
| | | |
| | | /** |
| | | * 身份证号 |
| | | */ |
| | | @ApiModelProperty(name = "idCard", value = "身份证号") |
| | | private String idCard; |
| | | |
| | | /** |
| | | * 生日 |
| | | */ |
| | | @ApiModelProperty(name = "birthday", value = "生日") |
| | | private String birthday; |
| | | |
| | | /** |
| | | * 头像 |
| | | */ |
| | | @ApiModelProperty(name = "imageUrl", value = "头像") |
| | | private String imageUrl; |
| | | |
| | | /** |
| | | * 用户类型 1 小程序 2 运营平台 3 社区平台 5 商家后台 6 网格综治APP 7 网格综治后台 8大屏 9城管后台 10 便民服务商家后台 11三说会堂后台 12行业分中心后台 |
| | | */ |
| | | @ApiModelProperty(name = "type", value = "用户类型 1 小程序 2 运营平台 3 社区平台 5 商家后台 6 网格综治APP 7 网格综治后台 8大屏 9城管后台 10 便民服务商家后台 11三说会堂后台 12行业分中心后台") |
| | | private String type; |
| | | |
| | | /** |
| | | * 职业 |
| | | */ |
| | | @ApiModelProperty(name = "job", value = "职业") |
| | | private String job; |
| | | |
| | | /** |
| | | * 是否志愿者 0 否 1 是 |
| | | */ |
| | | @ApiModelProperty(name = "isVolunteer", value = "是否志愿者 0 否 1 是") |
| | | private String isVolunteer; |
| | | |
| | | /** |
| | | * 是否党员 0 否 1 是 |
| | | */ |
| | | @ApiModelProperty(name = "isPartymember", value = "是否党员 0 否 1 是") |
| | | private String isPartymember; |
| | | |
| | | /** |
| | | * 1 启用 2 禁用 |
| | | */ |
| | | @ApiModelProperty(name = "status", value = "1 启用 2 禁用") |
| | | private String status; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @ApiModelProperty(name = "createAt", value = "创建时间") |
| | | private String createAt; |
| | | |
| | | /** |
| | | * 最后登录时间 |
| | | */ |
| | | @ApiModelProperty(name = "lastLoginTime", value = "最后登录时间") |
| | | private String lastLoginTime; |
| | | |
| | | /** |
| | | * 标签多个用,隔开 |
| | | */ |
| | | @ApiModelProperty(name = "tags", value = "标签多个用,隔开") |
| | | private String tags; |
| | | |
| | | /** |
| | | * 家庭id |
| | | */ |
| | | @ApiModelProperty(name = "familyId", value = "家庭id") |
| | | private String familyId; |
| | | |
| | | /** |
| | | * 人脸采集照片url |
| | | */ |
| | | @ApiModelProperty(name = "faceUrl", value = "人脸采集照片url") |
| | | private String faceUrl; |
| | | |
| | | /** |
| | | * 人脸采集审核状态 0 待审核 1 审核通过 2驳回 |
| | | */ |
| | | @ApiModelProperty(name = "faceState", value = "人脸采集审核状态 0 待审核 1 审核通过 2驳回") |
| | | private String faceState; |
| | | |
| | | /** |
| | | * 驳回原因 |
| | | */ |
| | | @ApiModelProperty(name = "rejectReson", value = "驳回原因") |
| | | private String rejectReson; |
| | | |
| | | /** |
| | | * 小区id |
| | | */ |
| | | @ApiModelProperty(name = "areaId", value = "小区id") |
| | | private String areaId; |
| | | |
| | | /** |
| | | * 证件照(人相面)照片 |
| | | */ |
| | | @ApiModelProperty(name = "cardPhotoFront", value = "证件照(人相面)照片") |
| | | private String cardPhotoFront; |
| | | |
| | | /** |
| | | * 证件照(国徽面)照片 |
| | | */ |
| | | @ApiModelProperty(name = "cardPhotoBack", value = "证件照(国徽面)照片") |
| | | private String cardPhotoBack; |
| | | |
| | | /** |
| | | * 户口本 |
| | | */ |
| | | @ApiModelProperty(name = "familyBook", value = "户口本") |
| | | private String familyBook; |
| | | |
| | | /** |
| | | * 连续登陆天数 每天凌晨定时任务更新 |
| | | */ |
| | | @ApiModelProperty(name = "continuousLandingDays", value = "连续登陆天数 每天凌晨定时任务更新") |
| | | private String continuousLandingDays; |
| | | |
| | | /** |
| | | * 小程序首页是否显示公告(1.是 2.否) |
| | | */ |
| | | @ApiModelProperty(name = "isTips", value = "小程序首页是否显示公告(1.是 2.否)") |
| | | private String isTips; |
| | | |
| | | /** |
| | | * 网格员工作状态(1.在岗 2.脱岗 3.已下班) |
| | | */ |
| | | @ApiModelProperty(name = "workStatus", value = "网格员工作状态(1.在岗 2.脱岗 3.已下班)") |
| | | private String workStatus; |
| | | |
| | | /** |
| | | * 网格员上班开始时间 |
| | | */ |
| | | @ApiModelProperty(name = "workStartTime", value = "网格员上班开始时间") |
| | | private String workStartTime; |
| | | |
| | | /** |
| | | * 网格员上班结束时间 |
| | | */ |
| | | @ApiModelProperty(name = "workEndTime", value = "网格员上班结束时间") |
| | | private String workEndTime; |
| | | |
| | | /** |
| | | * 高龄认证显示提示(1.是 2.否) |
| | | */ |
| | | @ApiModelProperty(name = "bigAgeTips", value = "高龄认证显示提示(1.是 2.否)") |
| | | private String bigAgeTips; |
| | | |
| | | /** |
| | | * 明文密码 |
| | | */ |
| | | @ApiModelProperty(name = "plaintextPassword", value = "明文密码") |
| | | private String plaintextPassword; |
| | | |
| | | /** |
| | | * 街道id |
| | | */ |
| | | @ApiModelProperty(name = "streetId", value = "街道id") |
| | | private String streetId; |
| | | |
| | | /** |
| | | * 绑定单位 |
| | | */ |
| | | @ApiModelProperty(name = "relationName", value = "绑定单位") |
| | | private String relationName; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @ApiModelProperty(name = "appId", value = "") |
| | | private String appId; |
| | | |
| | | /** |
| | | * 是否接收推送 |
| | | */ |
| | | @ApiModelProperty(name = "isAccept", value = "是否接收推送") |
| | | private String isAccept; |
| | | |
| | | /** |
| | | * 报到单位id |
| | | */ |
| | | @ApiModelProperty(name = "bindingCheckUnitId", value = "报到单位id") |
| | | private String bindingCheckUnitId; |
| | | |
| | | } |
| | |
| | | private String contactNumber; |
| | | |
| | | /** |
| | | * areaList |
| | | */ |
| | | @ApiModelProperty("areaList") |
| | | private String areaList; |
| | | |
| | | /** |
| | | * 机构等级 |
| | | */ |
| | | @ApiModelProperty("部门应用") |
| | | private String departmentalApplication; |
| | | |
| | | /** |
| | | * 修改人 |
| | | */ |
| | | @ApiModelProperty("修改人") |
| | | private Integer updateUserId; |
| | | |
| | | /** |
| | | * 修改人 |
| | | */ |
| | | @TableField(exist = false) |
| | | @ApiModelProperty("修改人姓名") |
| | | private String updateUserName; |
| | | |
| | | |
| | | /** |
| | | * 下属机构 |
| | | */ |
| | | @TableField(exist = false) |
| | |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | /** |
| | | * 用户ID |
| | | * 主键id |
| | | */ |
| | | @ApiModelProperty("主键id") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | @TableId(value = "user_id", type = IdType.AUTO) |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | |
| | | /** |
| | | * 用户id |
| | | */ |
| | | @ApiModelProperty("用户id") |
| | | private Long userId; |
| | | |
| | | |
| | |
| | | private String phonenumber; |
| | | |
| | | /** |
| | | * 用户性别(0男 1女 2未知) |
| | | * 性别 1 男 2 女 |
| | | */ |
| | | @ApiModelProperty("用户性别(0男 1女 2未知)") |
| | | @ApiModelProperty("性别 1 男 2 女") |
| | | private String sex; |
| | | |
| | | /** |
| | |
| | | */ |
| | | public int countNum(String Name); |
| | | |
| | | /** |
| | | * 按ids查找相关附件列表 |
| | | * @param list |
| | | * @return |
| | | */ |
| | | List<ElseAccessoryEntity> selectListByIds(String[] list); |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.db.gen.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dg.core.db.gen.entity.HuaChengSysUser; |
| | | import org.springframework.data.repository.query.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户信息表 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author xiang |
| | | * @since 2022-07-11 |
| | | */ |
| | | public interface HuaChengSysUserMapper extends BaseMapper<HuaChengSysUser> |
| | | { |
| | | public List<HuaChengSysUser> selectConfigList(); |
| | | |
| | | public HuaChengSysUser selectData(@Param("userId") String userId,@Param("account") String account,@Param("phone") String phone); |
| | | |
| | | public int selectNum(); |
| | | } |
| | |
| | | package com.dg.core.db.gen.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.dg.core.db.gen.entity.OrganizationChartEntity; |
| | | import org.springframework.data.repository.query.Param; |
| | | |
| | |
| | | OrganizationChartEntity selectConfigById(@Param("id") String id); |
| | | |
| | | |
| | | /** |
| | | * 查询机构列表(分页) |
| | | */ |
| | | List<OrganizationChartEntity> queryList(IPage<OrganizationChartEntity> page, Integer state, String organizationName); |
| | | |
| | | |
| | | /** |
| | | * 统计数量(部门应用) |
| | | */ |
| | | int countList(String organizationName); |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | public List<SysUser> selectConfigList(IPage<SysUser> page, Integer state,@Param("userType") String userType); |
| | | |
| | | |
| | | |
| | | SysUser selectData(String userId); |
| | | |
| | | |
| | | /** |
| | | * 新增聊天记录 |
| | | * |
| | |
| | | * |
| | | * @return 结果 |
| | | */ |
| | | List<SysUser> selectListByDepartmentId(@Param("departmentId") String departmentId,@Param("classifyId") String classifyId); |
| | | List<SysUser> selectListByDepartmentId(@Param("list") List<String> list,@Param("classifyIdFront") String classifyIdFront,@Param("classifyIdAfter") String classifyIdAfter); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | List<Search> selectSearchAssociate( String keyWord); |
| | | |
| | | /** |
| | | * 按ids查找导办事务列表 |
| | | * @param list |
| | | * @return |
| | | */ |
| | | List<TransactionEvent> selectListByIds(String[] list); |
| | | } |
| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.lang.reflect.Method; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.ZoneId; |
| | | import java.util.Calendar; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 自定义拦截器,判断此次请求是否有权限 |
| | |
| | | public class AuthorizationInterceptor extends HandlerInterceptorAdapter { |
| | | @Autowired |
| | | private TokenManager manager; |
| | | |
| | | |
| | | @Autowired |
| | | com.dg.core.service.ISysUserService IUserService; |
| | |
| | | |
| | | //从header中得到token |
| | | String token = request.getHeader(Constant.AUTHORIZATION); |
| | | if (manager.checkToken(token)) { |
| | | //如果token验证成功,权限检查通过,将token对应的用户id存在request中,便于之后注入 |
| | | request.setAttribute(Constant.CURRENT_USER_ID, manager.getUserId(token)); |
| | | SysUser ss = IUserService.getUserById(manager.getUserId(token)); |
| | | //花城token |
| | | String HCtoken = request.getHeader(Constant.HCAUTHORIZATION); |
| | | |
| | | return true; |
| | | if(StringUtils.isEmpty(token)) |
| | | { |
| | | //花城e+ token |
| | | if (manager.checkHCToken(HCtoken)) { |
| | | //如果token验证成功,权限检查通过,将token对应的用户id存在request中,便于之后注入 |
| | | request.setAttribute(Constant.CURRENT_USER_ID, manager.getHCUserId(HCtoken)); |
| | | System.out.println("花城用户id:"+manager.getHCUserId(HCtoken)); |
| | | // SysUser ss = IUserService.selectData(manager.getHCUserId(HCtoken)+""); |
| | | return true; |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |
| | | if (manager.checkToken(token)) { |
| | | //如果token验证成功,权限检查通过,将token对应的用户id存在request中,便于之后注入 |
| | | request.setAttribute(Constant.CURRENT_USER_ID, manager.getUserId(token)); |
| | | // SysUser ss = IUserService.selectData(manager.getUserId(token)+""); |
| | | return true; |
| | | } |
| | | } |
| | | |
| | | //如果验证token失败,并且方法或类注明了Authorization,返回401错误 |
| | | if (method.getAnnotation(Authorization.class) != null || bean.getClass().getAnnotation(Authorization.class) != null) { |
| | | String reponse = "{\"result\": 449, \"message\": \"Overdue token\"}"; |
| | | response.setStatus(200); |
| | | response.setCharacterEncoding(StandardCharsets.UTF_8.toString()); |
| | | ResponseFacade facade = (ResponseFacade) response; |
| | | facade.setContentLength(reponse.getBytes(StandardCharsets.UTF_8).length); |
| | | facade.getWriter().write(reponse); |
| | | return false; |
| | | if(!StringUtils.isEmpty(token)) |
| | | { |
| | | //如果验证token失败,并且方法或类注明了Authorization,返回401错误 |
| | | if (method.getAnnotation(Authorization.class) != null || |
| | | bean.getClass().getAnnotation(Authorization.class) != null) |
| | | { |
| | | String reponse = "{\"result\": 449, \"message\": \"Overdue token\"}"; |
| | | response.setStatus(200); |
| | | response.setCharacterEncoding(StandardCharsets.UTF_8.toString()); |
| | | ResponseFacade facade = (ResponseFacade) response; |
| | | facade.setContentLength(reponse.getBytes(StandardCharsets.UTF_8).length); |
| | | facade.getWriter().write(reponse); |
| | | return false; |
| | | } |
| | | } |
| | | return true; |
| | | } |
New file |
| | |
| | | package com.dg.core.manager; |
| | | |
| | | import com.dg.core.db.gen.entity.HuaChengSysUser; |
| | | import io.jsonwebtoken.Claims; |
| | | import io.jsonwebtoken.Jwts; |
| | | import io.jsonwebtoken.SignatureAlgorithm; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * token验证处理 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Component |
| | | public class JWTTokenUtil implements Serializable { |
| | | /** |
| | | * 从数据声明生成令牌 |
| | | * |
| | | * @param claims |
| | | * 数据声明 |
| | | * @return 令牌 |
| | | */ |
| | | private static String generateToken(Map<String, Object> claims) { |
| | | Date expirationDate = new Date(System.currentTimeMillis() + TokenConstant.EXPIRETIME_LONG * 60 * 1000 * 72); |
| | | return Jwts.builder().setClaims(claims).setExpiration(expirationDate) |
| | | .signWith(SignatureAlgorithm.HS512, TokenConstant.SECRET).compact(); |
| | | } |
| | | |
| | | /** |
| | | * 生成刷新token |
| | | * |
| | | * @param claims |
| | | * tokenbody |
| | | * @return refreshtoken |
| | | */ |
| | | private static String generateTokenRefreshToken(Map<String, Object> claims) { |
| | | Date expirationDate = new Date(System.currentTimeMillis() + TokenConstant.EXPIRETIME_REFRESH * 60 * 60 * 1000); |
| | | return Jwts.builder().setClaims(claims).setExpiration(expirationDate) |
| | | .signWith(SignatureAlgorithm.HS512, TokenConstant.SECRET).compact(); |
| | | } |
| | | |
| | | /** |
| | | * 从令牌中获取数据声明 |
| | | * |
| | | * @param token |
| | | * 令牌 |
| | | * @return 数据声明 |
| | | */ |
| | | public static Claims getClaimsFromToken(String token) { |
| | | Claims claims; |
| | | try { |
| | | claims = Jwts.parser().setSigningKey(TokenConstant.SECRET).parseClaimsJws(token).getBody(); |
| | | } catch (Exception e) { |
| | | claims = null; |
| | | } |
| | | return claims; |
| | | } |
| | | |
| | | /** |
| | | * 生成令牌 |
| | | * |
| | | * @param loginUserInfoVO |
| | | * 用户 |
| | | * @return 令牌 |
| | | */ |
| | | public static String generateToken(HuaChengSysUser loginUserInfoVO) { |
| | | Map<String, Object> claims = new HashMap<>(2); |
| | | claims.put("sub", loginUserInfoVO.getUserId()); |
| | | claims.put("created", new Date()); |
| | | claims.put("type", loginUserInfoVO.getType()); |
| | | return generateToken(claims); |
| | | } |
| | | |
| | | /** |
| | | * 从令牌中获取用户名 |
| | | * |
| | | * @param token |
| | | * 令牌 |
| | | * @return 用户名 |
| | | */ |
| | | public static String getUsernameFromToken(String token) { |
| | | String username; |
| | | try { |
| | | Claims claims = getClaimsFromToken(token); |
| | | username = claims.getSubject(); |
| | | } catch (Exception e) { |
| | | username = null; |
| | | } |
| | | return username; |
| | | } |
| | | |
| | | /** |
| | | * 判断令牌是否过期 |
| | | * |
| | | * @param token |
| | | * 令牌 |
| | | * @return 是否过期 |
| | | */ |
| | | public static Boolean isTokenExpired(String token) { |
| | | try { |
| | | Claims claims = getClaimsFromToken(token); |
| | | Date expiration = claims.getExpiration(); |
| | | return expiration.before(new Date()); |
| | | } catch (Exception e) { |
| | | return true; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 刷新令牌 |
| | | * |
| | | * @param token |
| | | * 原令牌 |
| | | * @return 新令牌 |
| | | */ |
| | | public static String refreshToken(String token) { |
| | | String refreshedToken; |
| | | try { |
| | | Claims claims = getClaimsFromToken(token); |
| | | claims.put("created", new Date()); |
| | | refreshedToken = generateToken(claims); |
| | | } catch (Exception e) { |
| | | refreshedToken = null; |
| | | } |
| | | return refreshedToken; |
| | | } |
| | | |
| | | /** |
| | | * 验证令牌 |
| | | * |
| | | * @param token |
| | | * 令牌 |
| | | * @param loginUserInfoVO |
| | | * 用户 |
| | | * @return 是否有效 |
| | | */ |
| | | public static Boolean validateToken(String token, HuaChengSysUser loginUserInfoVO) { |
| | | String username = getUsernameFromToken(token); |
| | | return (username.equals(loginUserInfoVO.getUserId()) && !isTokenExpired(token)); |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | Claims claims = JWTTokenUtil.getClaimsFromToken( |
| | | "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOjIsInR5cGUiOjEsImV4cCI6MTYwNjM1NzkzOSwiY3JlYXRlZCI6MTYwNjM1NjEzOTEzN30.zIj31TLHk4B9F45OszrJWfOlhZL5CWviP2RgsFP6LZuci6MlPn0iVbekioP01DRsu59mWd5FMyhd9WLvMtfxMg"); |
| | | Boolean tokenExpired = JWTTokenUtil.isTokenExpired( |
| | | "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOjIsInR5cGUiOjEsImV4cCI6MTYwNjM2MDQzNSwiY3JlYXRlZCI6MTYwNjM1ODYzNTI3MX0.7R3SG6hu-sr_KiPpgepubl_1FdaooCNJ0URHWv6Jynr7m8JIar2kUAnhHfWOfHrNILQb5Q-nqxceXdavcuVOXg"); |
| | | System.out.println(claims); |
| | | } |
| | | |
| | | /** |
| | | * 生成刷新token |
| | | * |
| | | * @param loginUserInfoVO |
| | | * 登录用户基本信息 |
| | | * @return refreshtoken |
| | | */ |
| | | public static String generateRefeshToken(HuaChengSysUser loginUserInfoVO) { |
| | | Map<String, Object> claims = new HashMap<>(2); |
| | | claims.put("sub", loginUserInfoVO.getUserId()); |
| | | claims.put("created", new Date()); |
| | | claims.put("type", loginUserInfoVO.getType()); |
| | | return generateTokenRefreshToken(claims); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.dg.core.manager; |
| | | |
| | | import com.dg.core.Constant; |
| | | import io.jsonwebtoken.Claims; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Qualifier; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.data.redis.core.script.DigestUtils; |
| | | import org.springframework.data.redis.serializer.JdkSerializationRedisSerializer; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.util.ObjectUtils; |
| | | |
| | | import java.util.UUID; |
| | | import java.util.concurrent.TimeUnit; |
| | |
| | | * 通过Redis存储和验证token的实现类 |
| | | */ |
| | | @Component |
| | | public class RedisTokenManager implements TokenManager { |
| | | |
| | | public class RedisTokenManager implements TokenManager |
| | | { |
| | | private RedisTemplate<String, String> redis; |
| | | |
| | | @Qualifier("redisTemplate") |
| | |
| | | return token; |
| | | } |
| | | |
| | | |
| | | public boolean checkToken(String token) { |
| | | if (token == null) { |
| | | if (StringUtils.isEmpty(token)) { |
| | | return false; |
| | | } |
| | | String userId = redis.boundValueOps(token).get(); |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 验证花城token |
| | | * @param token |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean checkHCToken(String token) { |
| | | if (StringUtils.isEmpty(token)) { |
| | | return false; |
| | | } |
| | | // token解析 |
| | | Claims claims = JWTTokenUtil.getClaimsFromToken(token); |
| | | if (ObjectUtils.isEmpty(claims)) { |
| | | return false; |
| | | } |
| | | String userId = claims.getSubject(); |
| | | if (ObjectUtils.isEmpty(userId)) |
| | | { |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public long getUserId(String token) { |
| | | if (token == null) { |
| | |
| | | return Long.parseLong(userId); |
| | | } |
| | | |
| | | /** |
| | | * 获取花城e+的 UserId |
| | | * @param token |
| | | * @return |
| | | */ |
| | | @Override |
| | | public long getHCUserId(String token) { |
| | | if (token == null) { |
| | | return -1; |
| | | } |
| | | // token解析 |
| | | Claims claims = JWTTokenUtil.getClaimsFromToken(token); |
| | | if (ObjectUtils.isEmpty(claims)) { |
| | | return -1; |
| | | } |
| | | String userId = claims.getSubject(); |
| | | if (ObjectUtils.isEmpty(userId)) |
| | | { |
| | | return -1; |
| | | } |
| | | return Long.parseLong(userId); |
| | | } |
| | | |
| | | public void deleteToken(String token) { |
| | | redis.delete(token); |
| | | } |
New file |
| | |
| | | package com.dg.core.manager; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | | * @description: token |
| | | * @author: huang.hongfa weixin hhf9596 qq 959656820 |
| | | * @create: 2020-11-24 14:44 |
| | | **/ |
| | | public class TokenConstant { |
| | | |
| | | public static final String TOKEN_HEADER = "Authorization"; |
| | | public static final String TOKEN_LOGOUT = "token_logout"; |
| | | public static final String TOKEN_PRE = "Bearer "; |
| | | public static final String TOKEN_USERINFO = "token_userinfo"; |
| | | /** |
| | | * 30分钟 |
| | | */ |
| | | public static final int EXPIRETIME = 300; |
| | | public static final Long EXPIRETIME_LONG = 300L; |
| | | public static final String SECRET = "UTivpbn%n9O!KnnL"; |
| | | /** |
| | | * 24小时 |
| | | */ |
| | | public static final int EXPIRETIME_REFRESH = 24; |
| | | } |
| | |
| | | */ |
| | | public boolean checkToken(String token); |
| | | |
| | | /** |
| | | * 检查花城token是否有效 |
| | | * @param token |
| | | * @return |
| | | */ |
| | | public boolean checkHCToken(String token); |
| | | |
| | | public long getUserId(String token); |
| | | public long getHCUserId(String token); |
| | | |
| | | public void deleteToken(String token); |
| | | |
| | |
| | | Long currentUserId = (Long) webRequest.getAttribute(Constant.CURRENT_USER_ID, RequestAttributes.SCOPE_REQUEST); |
| | | if (currentUserId != null) { |
| | | //从数据库中查询并返回 |
| | | return userService.getUserById(currentUserId); |
| | | return userService.selectData(currentUserId+""); |
| | | } |
| | | throw new MissingServletRequestPartException(Constant.CURRENT_USER_ID); |
| | | return null; |
| | | // throw new MissingServletRequestPartException(Constant.CURRENT_USER_ID); |
| | | } |
| | | } |
| | |
| | | package com.dg.core.service; |
| | | |
| | | import com.dg.core.db.gen.entity.AreaCode2022; |
| | | import com.dg.core.db.gen.entity.OrganizationChartEntity; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | * @return |
| | | */ |
| | | List<AreaCode2022> getAreaCodeByTransactionId(Integer transactionId); |
| | | |
| | | /** |
| | | * 根据pcode获取所属地区 |
| | | * @return |
| | | */ |
| | | List<AreaCode2022> getListByPCode(String id); |
| | | } |
New file |
| | |
| | | package com.dg.core.service; |
| | | |
| | | import com.dg.core.db.gen.entity.HuaChengSysUser; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface IHuaChengSysUserService |
| | | { |
| | | public List<HuaChengSysUser> selectConfigList(); |
| | | |
| | | public HuaChengSysUser selectData(String userId,String account,String phone); |
| | | |
| | | public int selectNum(); |
| | | } |
| | |
| | | package com.dg.core.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.dg.core.db.gen.entity.OrganizationChartEntity; |
| | | |
| | | import java.util.List; |
| | |
| | | * 根据id查取消组织机构 |
| | | */ |
| | | OrganizationChartEntity selectConfigById(String id); |
| | | |
| | | /** |
| | | * 查询机构列表(分页) |
| | | */ |
| | | List<OrganizationChartEntity> queryList(IPage<OrganizationChartEntity> page, Integer state, String organizationName); |
| | | |
| | | |
| | | /** |
| | | * 统计数量(部门应用) |
| | | */ |
| | | int countList(String organizationName); |
| | | |
| | | /** |
| | | * 获取部门下子部门的全部id |
| | | * @param id |
| | | * @return |
| | | */ |
| | | List<String> getIds(String id); |
| | | |
| | | |
| | | /** |
| | | * 根据id 查询是否有子部门 |
| | | * @param parentId |
| | | * @param grade |
| | | * @return |
| | | */ |
| | | public List<OrganizationChartEntity> selectParentList(String parentId,String grade); |
| | | |
| | | } |
| | |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface ISysUserService { |
| | | SysUser getUserById(Long id); |
| | | public interface ISysUserService |
| | | { |
| | | SysUser getUserByAccount(String account); |
| | | /** |
| | | * 查询聊天列表 |
| | |
| | | */ |
| | | public List<SysUser> selectConfigList(IPage<SysUser> page, Integer state,String userType); |
| | | |
| | | |
| | | SysUser selectData(String userId); |
| | | /** |
| | | * 新增聊天记录 |
| | | * |
| | |
| | | areaCodes.add(organizationChartEntity.getVillage()); |
| | | getAreaCodeIds(areaCodes,organizationChartEntity); |
| | | } |
| | | return baseMapper.selectByIdSet(areaCodes); |
| | | if (areaCodes.size()==0) |
| | | return null; |
| | | else |
| | | return baseMapper.selectByIdSet(areaCodes); |
| | | } |
| | | |
| | | |
| | | public List<String> getAreaCodeIds(List<String> areaCodes, OrganizationChartEntity organizationChartEntity){ |
| | | organizationChartEntity = organizationChartMapper.selectOne(new QueryWrapper<OrganizationChartEntity>().lambda() |
| | | List<OrganizationChartEntity> organizationChartEntitys= organizationChartMapper.selectList(new QueryWrapper<OrganizationChartEntity>().lambda() |
| | | .eq(OrganizationChartEntity::getParentId, organizationChartEntity.getId())); |
| | | if (organizationChartEntity!=null){ |
| | | if (organizationChartEntity.getCity()!=null) |
| | | areaCodes.add(organizationChartEntity.getCity()); |
| | | if (organizationChartEntity.getDistrict()!=null) |
| | | areaCodes.add(organizationChartEntity.getDistrict()); |
| | | if (organizationChartEntity.getVillage()!=null) |
| | | areaCodes.add(organizationChartEntity.getVillage()); |
| | | getAreaCodeIds(areaCodes,organizationChartEntity); |
| | | for (OrganizationChartEntity organizationChart:organizationChartEntitys) { |
| | | if (organizationChart.getCity()!=null) |
| | | areaCodes.add(organizationChart.getCity()); |
| | | if (organizationChart.getDistrict()!=null) |
| | | areaCodes.add(organizationChart.getDistrict()); |
| | | if (organizationChart.getVillage()!=null) |
| | | areaCodes.add(organizationChart.getVillage()); |
| | | getAreaCodeIds(areaCodes,organizationChart); |
| | | } |
| | | return areaCodes; |
| | | } |
| | | |
| | | @Override |
| | | public List<AreaCode2022> getListByPCode(String id){ |
| | | List<AreaCode2022> areaCode2022s = baseMapper.selectList(new QueryWrapper<AreaCode2022>().lambda().eq(AreaCode2022::getPcode, id)); |
| | | for (AreaCode2022 areaCode2022:areaCode2022s) { |
| | | if (areaCode2022.getLevel()!=4) |
| | | areaCode2022.setChild(this.getListByPCode(areaCode2022.getCode().toString())); |
| | | } |
| | | return areaCode2022s; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dg.core.db.gen.entity.GuideEvolveEntity; |
| | | import com.dg.core.db.gen.mapper.ElseAccessoryMapper; |
| | | import com.dg.core.db.gen.mapper.GuideEvolveMapper; |
| | | import com.dg.core.db.gen.mapper.TransactionEventMapper; |
| | | import com.dg.core.service.IGuideEvolveService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class GuideEvolveImpl extends ServiceImpl<GuideEvolveMapper, GuideEvolveEntity> implements IGuideEvolveService |
| | | { |
| | | |
| | | |
| | | @Resource |
| | | private ElseAccessoryMapper elseAccessoryMapper; |
| | | |
| | | @Resource |
| | | private TransactionEventMapper transactionEventMapper; |
| | | |
| | | @Override |
| | | public List<GuideEvolveEntity> selectConfigList(String guideId) { |
| | | return baseMapper.selectConfigList(guideId); |
| | | List<GuideEvolveEntity> guideEvolveEntities = baseMapper.selectConfigList(guideId); |
| | | for (GuideEvolveEntity guideEvolveEntity: guideEvolveEntities) { |
| | | String[] split; |
| | | if (guideEvolveEntity.getAccessoryId()!=null){ |
| | | split = guideEvolveEntity.getAccessoryId().split(","); |
| | | guideEvolveEntity.setElseAccessoryEntities( elseAccessoryMapper.selectListByIds(split)); |
| | | } |
| | | if (guideEvolveEntity.getTransactionId()!=null){ |
| | | split=guideEvolveEntity.getTransactionId().split(","); |
| | | guideEvolveEntity.setTransactionEvents(transactionEventMapper.selectListByIds(split)); |
| | | } |
| | | } |
| | | return guideEvolveEntities; |
| | | } |
| | | |
| | | @Override |
| | |
| | | import com.dg.core.db.gen.entity.*; |
| | | import com.dg.core.db.gen.mapper.GuideRepairOrderImageMapper; |
| | | import com.dg.core.db.gen.mapper.GuideRepairOrderMapper; |
| | | import com.dg.core.db.gen.mapper.SysUserMapper; |
| | | import com.dg.core.db.gen.mapper.TransactionEventMapper; |
| | | import com.dg.core.service.IGuideRepairOrderService; |
| | | import com.dg.core.util.Snowflake; |
| | |
| | | @Resource |
| | | private GuideRepairOrderImageMapper guideRepairOrderImageMapper; |
| | | |
| | | @Resource |
| | | private SysUserMapper sysUserMapper; |
| | | |
| | | @Override |
| | | public int addOrder(GuideRepairOrder guideRepairOrder){ |
| | | |
| | |
| | | guideRepairOrder.setDepartmentId(transactionEvent.getDepartmentId()); |
| | | guideRepairOrder.setClassifyId(transactionEvent.getClassifyId()); |
| | | guideRepairOrder.setState("1"); |
| | | guideRepairOrder.setCreateTime(LocalDateTime.now()); |
| | | guideRepairOrder.setUpdateTime(LocalDateTime.now()); |
| | | transactionEvent.setTransactionNum(transactionEvent.getTransactionNum()+1); |
| | | String[] images = guideRepairOrder.getImages().split(","); |
| | | for (String image: images) { |
| | | if (guideRepairOrder.getImages()!=null){ |
| | | String[] images = guideRepairOrder.getImages().split(","); |
| | | for (String image: images) { |
| | | GuideRepairOrderImage guideRepairOrderImage = new GuideRepairOrderImage(); |
| | | guideRepairOrderImage.setId(Snowflake.getId()); |
| | | guideRepairOrderImage.setGuideRepairOrderId(guideRepairOrder.getOrderNum()); |
| | |
| | | guideRepairOrderImage.setCreateTime(LocalDateTime.now()); |
| | | guideRepairOrderImage.setType(1); |
| | | guideRepairOrderImageMapper.insert(guideRepairOrderImage); |
| | | } |
| | | } |
| | | if (guideRepairOrder.getOrderNum()!=null){ |
| | | GuideRepairOrderImage guideRepairOrderImage = new GuideRepairOrderImage(); |
| | | guideRepairOrderImage.setId(Snowflake.getId()); |
| | | guideRepairOrderImage.setGuideRepairOrderId(guideRepairOrder.getOrderNum()); |
| | | guideRepairOrderImage.setUrl(guideRepairOrder.getVideo()); |
| | | guideRepairOrderImage.setCreateTime(LocalDateTime.now()); |
| | | guideRepairOrderImage.setType(2); |
| | | guideRepairOrderImageMapper.insert(guideRepairOrderImage); |
| | | if (guideRepairOrder.getVideo()!=null){ |
| | | if (guideRepairOrder.getOrderNum()!=null){ |
| | | GuideRepairOrderImage guideRepairOrderImage = new GuideRepairOrderImage(); |
| | | guideRepairOrderImage.setId(Snowflake.getId()); |
| | | guideRepairOrderImage.setGuideRepairOrderId(guideRepairOrder.getOrderNum()); |
| | | guideRepairOrderImage.setUrl(guideRepairOrder.getVideo()); |
| | | guideRepairOrderImage.setCreateTime(LocalDateTime.now()); |
| | | guideRepairOrderImage.setType(2); |
| | | guideRepairOrderImageMapper.insert(guideRepairOrderImage); |
| | | } |
| | | } |
| | | int ans= baseMapper.insert(guideRepairOrder); |
| | | int i = transactionEventMapper.updateById(transactionEvent); |
| | |
| | | |
| | | @Override |
| | | public int updateConfig(GuideRepairOrder order) { |
| | | SysUser sysUser = sysUserMapper.selectOne(new QueryWrapper<SysUser>().lambda().eq(SysUser::getUserId, order.getGuideUserId())); |
| | | order.setGuideUserPhone(sysUser.getPhonenumber()); |
| | | return baseMapper.updateConfig(order); |
| | | } |
| | | |
New file |
| | |
| | | package com.dg.core.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dg.core.db.gen.entity.HuaChengSysUser; |
| | | import com.dg.core.db.gen.mapper.HuaChengSysUserMapper; |
| | | import com.dg.core.service.IHuaChengSysUserService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class HuaChengSysUserImpl extends ServiceImpl<HuaChengSysUserMapper, HuaChengSysUser> implements IHuaChengSysUserService |
| | | { |
| | | |
| | | @Override |
| | | public List<HuaChengSysUser> selectConfigList() { |
| | | return baseMapper.selectConfigList(); |
| | | } |
| | | |
| | | @Override |
| | | public HuaChengSysUser selectData(String userId,String account,String phone) { |
| | | return baseMapper.selectData(userId,account,phone); |
| | | } |
| | | |
| | | @Override |
| | | public int selectNum() { |
| | | return baseMapper.selectNum(); |
| | | } |
| | | } |
| | |
| | | package com.dg.core.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dg.core.db.gen.entity.OrganizationChartEntity; |
| | | import com.dg.core.db.gen.mapper.OrganizationChartMapper; |
| | | import com.dg.core.service.IOrganizationChartService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | |
| | | public OrganizationChartEntity selectConfigById(String id) { |
| | | return baseMapper.selectConfigById(id); |
| | | } |
| | | |
| | | @Override |
| | | public List<OrganizationChartEntity> queryList(IPage<OrganizationChartEntity> page, Integer state, String organizationName) { |
| | | return baseMapper.queryList(page,state,organizationName); |
| | | } |
| | | |
| | | @Override |
| | | public int countList(String organizationName) { |
| | | return baseMapper.countList(organizationName); |
| | | } |
| | | |
| | | /** |
| | | * 递归获取id 内部使用 |
| | | * @param departmentId |
| | | * @return |
| | | */ |
| | | |
| | | @Override |
| | | public List<String> getIds(String id) |
| | | { |
| | | List<String> ids=new ArrayList<>(); |
| | | List<OrganizationChartEntity> lists = baseMapper.selectConfigList(id,""); |
| | | if(lists.size()<1) |
| | | { |
| | | lists.add(baseMapper.selectConfigById(id)); |
| | | } |
| | | ids=disposestreetId(lists); |
| | | if(ids.size()<1) |
| | | { |
| | | return null; |
| | | } |
| | | ids.add(id); |
| | | return ids; |
| | | } |
| | | |
| | | @Override |
| | | public List<OrganizationChartEntity> selectParentList(String parentId, String grade) { |
| | | return baseMapper.selectConfigList(parentId,grade); |
| | | } |
| | | |
| | | //递归取id |
| | | private List<String> disposestreetId(List<OrganizationChartEntity> lists) |
| | | { |
| | | List<String> ids=new ArrayList<>(); |
| | | for (OrganizationChartEntity sysStreet:lists) |
| | | { |
| | | ids.add(sysStreet.getId()+""); |
| | | if(sysStreet.getChild()!=null && sysStreet.getChild().size()>0) |
| | | { |
| | | ids.addAll(disposestreetId(sysStreet.getChild())); |
| | | } |
| | | else |
| | | { |
| | | ids.add(sysStreet.getId()+""); |
| | | } |
| | | } |
| | | return ids; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dg.core.ResultData; |
| | | import com.dg.core.db.gen.entity.HuaChengSysUser; |
| | | import com.dg.core.db.gen.entity.OrganizationChartEntity; |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | import com.dg.core.db.gen.mapper.OrganizationChartMapper; |
| | | import com.dg.core.db.gen.mapper.SysUserMapper; |
| | | import com.dg.core.manager.TokenManager; |
| | | import com.dg.core.service.IHuaChengSysUserService; |
| | | import com.dg.core.service.ISysUserService; |
| | | import com.dg.core.util.SmsUtil; |
| | | import com.dg.core.util.Snowflake; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.data.repository.query.Param; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDateTime; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | @Autowired |
| | | TokenManager tokenManager; |
| | | |
| | | @Override |
| | | public SysUser getUserById(Long id) { |
| | | return baseMapper.selectById(id); |
| | | } |
| | | @Resource |
| | | private OrganizationChartMapper organizationChartMapper; |
| | | |
| | | /** |
| | | * 花城e+用户接口 |
| | | */ |
| | | @Autowired |
| | | IHuaChengSysUserService iHuaChengSysUserService; |
| | | |
| | | @Override |
| | | public SysUser getUserByAccount(String account) { |
| | |
| | | |
| | | @Override |
| | | public ResultData smsSend(SysUser user){ |
| | | SysUser sysUser = baseMapper.selectOne(new QueryWrapper<SysUser>().lambda().eq(SysUser::getPhonenumber, user.getPhonenumber())); |
| | | if (sysUser==null){ |
| | | SysUser newUser = new SysUser(); |
| | | newUser.setLoginName(user.getPhonenumber()); |
| | | newUser.setUserName(user.getPhonenumber().substring(0,3)+"xxxx"+user.getPhonenumber().substring(7,11)+"用户"); |
| | | newUser.setUserType("3"); |
| | | newUser.setPhonenumber(user.getPhonenumber()); |
| | | newUser.setSex("2"); |
| | | newUser.setCreateTime(LocalDateTime.now()); |
| | | newUser.setUpdateTime(LocalDateTime.now()); |
| | | baseMapper.insert(newUser); |
| | | } |
| | | return smsUtil.sendSms(user.getPhonenumber()); |
| | | } |
| | | |
| | | @Override |
| | | public ResultData loginByAccount(String phonenumber, String code){ |
| | | String code1 = redisTemplate.opsForValue().get(phonenumber) + ""; |
| | | |
| | | SysUser sysUser = baseMapper.selectOne(new QueryWrapper<SysUser>().lambda().eq(SysUser::getPhonenumber, phonenumber)); |
| | | if (sysUser==null){ |
| | | //查询花城e+是否存在此用户 |
| | | HuaChengSysUser huaChengSysUser=iHuaChengSysUserService.selectData("","",phonenumber); |
| | | if(huaChengSysUser==null) |
| | | { |
| | | SysUser newUser = new SysUser(); |
| | | newUser.setUserId(Snowflake.getId()); |
| | | newUser.setLoginName(phonenumber); |
| | | newUser.setUserName(phonenumber.substring(0,3)+"xxxx"+phonenumber.substring(7,11)+"用户"); |
| | | newUser.setUserType("3"); |
| | | newUser.setPhonenumber(phonenumber); |
| | | newUser.setSex("1"); |
| | | newUser.setCreateTime(LocalDateTime.now()); |
| | | newUser.setUpdateTime(LocalDateTime.now()); |
| | | baseMapper.insertConfig(newUser); |
| | | } |
| | | else |
| | | { |
| | | SysUser newUser = new SysUser(); |
| | | newUser.setUserId(huaChengSysUser.getUserId()); |
| | | newUser.setLoginName(huaChengSysUser.getPhone()); |
| | | newUser.setUserName(huaChengSysUser.getNickName()); |
| | | newUser.setUserType("3"); |
| | | newUser.setPhonenumber(huaChengSysUser.getPhone()); |
| | | newUser.setSex(huaChengSysUser.getSex()); |
| | | newUser.setAvatar(huaChengSysUser.getImageUrl()); |
| | | newUser.setCreateTime(LocalDateTime.now()); |
| | | newUser.setUpdateTime(LocalDateTime.now()); |
| | | baseMapper.insertConfig(newUser); |
| | | } |
| | | } |
| | | |
| | | if (code.equals(code1)) { |
| | | SysUser sysUser = baseMapper.selectOne(new QueryWrapper<SysUser>().lambda().eq(SysUser::getPhonenumber, phonenumber)); |
| | | sysUser = baseMapper.selectOne(new QueryWrapper<SysUser>().lambda().eq(SysUser::getPhonenumber, phonenumber)); |
| | | if (sysUser!=null){ |
| | | String token = tokenManager.getTokenByUserId(sysUser.getUserId()); |
| | | // String token = tokenManager.createToken(user.getUserId(), user.getRoleId()); |
| | |
| | | |
| | | @Override |
| | | public List<SysUser> selectListByDepartmentId(String departmentId, String classifyId) { |
| | | return baseMapper.selectListByDepartmentId(departmentId,classifyId); |
| | | List<String> departmentIds=new ArrayList<>(); |
| | | departmentIds.add(departmentId); |
| | | List<OrganizationChartEntity> organizationChartEntities = organizationChartMapper.selectList(new QueryWrapper<OrganizationChartEntity>().lambda() |
| | | .eq(OrganizationChartEntity::getParentId, departmentId)); |
| | | if (organizationChartEntities!=null){ |
| | | for (OrganizationChartEntity organizationChart:organizationChartEntities) { |
| | | departmentIds.add(organizationChart.getId().toString()); |
| | | List<OrganizationChartEntity> organizationChartEntitiesUser = organizationChartMapper.selectList(new QueryWrapper<OrganizationChartEntity>().lambda() |
| | | .eq(OrganizationChartEntity::getParentId, organizationChart.getId().toString())); |
| | | if (organizationChartEntitiesUser!=null) |
| | | departmentIds=this.getDepartmentIds(organizationChartEntitiesUser,departmentIds); |
| | | } |
| | | } |
| | | return baseMapper.selectListByDepartmentId(departmentIds,","+classifyId,classifyId+","); |
| | | } |
| | | |
| | | public List<String> getDepartmentIds( List<OrganizationChartEntity> organizationChartEntities,List<String> departmentIds){ |
| | | for (OrganizationChartEntity organizationChart:organizationChartEntities) { |
| | | departmentIds.add(organizationChart.getId().toString()); |
| | | List<OrganizationChartEntity> organizationChartEntitiesUser = organizationChartMapper.selectList(new QueryWrapper<OrganizationChartEntity>().lambda() |
| | | .eq(OrganizationChartEntity::getParentId, organizationChart.getId().toString())); |
| | | if (organizationChartEntitiesUser!=null) |
| | | departmentIds=this.getDepartmentIds(organizationChartEntitiesUser,departmentIds); |
| | | |
| | | } |
| | | return departmentIds; |
| | | } |
| | | |
| | | @Override |
| | |
| | | return baseMapper.selectConfigList(page, state,userType); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public SysUser selectData(String userId) { |
| | | return baseMapper.selectData(userId); |
| | | } |
| | | |
| | | |
| | | /** |
| | |
| | | #password: nahanMysqlPwd&&RemoteRemote2019nahan |
| | | |
| | | |
| | | server.port=8187 |
| | | server.port=8187 |
| | | #server.port=8088 |
| | | |
| | | swagger.enabled=true |
| | |
| | | spring.servlet.multipart.max-file-size=20MB |
| | | spring.servlet.multipart.max-request-size=50MB |
| | | |
| | | # ?????? |
| | | # ???? ??? Windows??D:/ruoyi/uploadPath?Linux?? /home/ruoyi/uploadPath? |
| | | #profile=E:/java/flower_city_automessage/flower_citys/files |
| | | profile=D:/tupianshuju |
| | | |
| | | |
| | | wx.open.app_id=wx118de8a734d269f0 |
| | |
| | | order by create_time desc |
| | | </select> |
| | | |
| | | <select id="selectListByIds" resultMap="ElseAccessoryEntityResult"> |
| | | <include refid="selectElseAccessoryEntityVo"/> |
| | | WHERE id IN |
| | | <foreach collection="array" item="id" index="index" open="(" close=")" separator=","> |
| | | #{id} |
| | | </foreach> |
| | | order by create_time desc |
| | | </select> |
| | | |
| | | |
| | | <insert id="insertConfig" parameterType="com.dg.core.db.gen.entity.ElseAccessoryEntity"> |
| | | insert into automessage_else_accessory ( |
| | |
| | | <id property="createTime" column="create_time" /> |
| | | <id property="updateTime" column="update_time" /> |
| | | <id property="fromDepartmentalId" column="from_departmental_id" /> |
| | | <id property="videoUrl" column="video_url" /> |
| | | <id property="pictureUrl" column="picture_url" /> |
| | | |
| | | </resultMap> |
| | | |
| | |
| | | SELECT |
| | | id, |
| | | departmental_id, |
| | | (select user_name from automessage_sys_user where a.to_user_id=user_id)toUserName, |
| | | (select user_name from automessage_sys_user where a.from_user_id=user_id)fromUserName, |
| | | to_user_id, |
| | | from_user_id, |
| | | state, |
| | |
| | | accessory_name, |
| | | accessory_url, |
| | | from_departmental_id, |
| | | video_url, |
| | | picture_url, |
| | | create_time, |
| | | update_time |
| | | FROM |
| | | automessage_guide_evolve |
| | | automessage_guide_evolve a |
| | | </sql> |
| | | |
| | | <select id="selectConfigList" resultMap="GuideEvolveResult"> |
| | |
| | | |
| | | <insert id="insertConfig" parameterType="com.dg.core.db.gen.entity.GuideEvolveEntity"> |
| | | insert into automessage_guide_evolve ( |
| | | <if test="id != null">id,</if> |
| | | <if test="departmentalId != null and departmentalId != '' ">departmental_id,</if> |
| | | <if test="toUserId != null and toUserId != '' ">to_user_id,</if> |
| | | <if test="fromUserId != null and fromUserId != '' ">from_user_id,</if> |
| | |
| | | <if test="accessoryName != null and accessoryName != '' ">accessory_name,</if> |
| | | <if test="accessoryUrl != null and accessoryUrl != '' ">accessory_url,</if> |
| | | <if test="fromDepartmentalId != null and fromDepartmentalId != '' ">from_departmental_id,</if> |
| | | <if test="videoUrl != null and videoUrl != '' ">video_url,</if> |
| | | <if test="pictureUrl != null and pictureUrl != '' ">picture_url,</if> |
| | | update_time, |
| | | create_time |
| | | )values( |
| | |
| | | <if test="accessoryName != null and accessoryName != '' ">#{accessoryName},</if> |
| | | <if test="accessoryUrl != null and accessoryUrl != '' ">#{accessoryUrl},</if> |
| | | <if test="fromDepartmentalId != null and fromDepartmentalId != '' ">#{fromDepartmentalId},</if> |
| | | <if test="videoUrl != null and videoUrl != '' ">#{videoUrl},</if> |
| | | <if test="pictureUrl != null and pictureUrl != '' ">#{pictureUrl},</if> |
| | | sysdate(), |
| | | sysdate() |
| | | ) |
| | |
| | | <if test="accessoryName != null and accessoryName != '' ">accessory_name=#{accessoryName},</if> |
| | | <if test="accessoryUrl != null and accessoryUrl != '' ">accessory_url=#{accessoryUrl},</if> |
| | | <if test="fromDepartmentalId != null and fromDepartmentalId != '' ">from_departmental_id=#{fromDepartmentalId},</if> |
| | | <if test="videoUrl != null and videoUrl != '' ">video_url=#{videoUrl},</if> |
| | | <if test="pictureUrl != null and pictureUrl != '' ">picture_url=#{pictureUrl},</if> |
| | | update_time=sysdate() |
| | | </set> |
| | | where id= #{Id} |
| | |
| | | <include refid="selectGuideRepairOrderVo"/> |
| | | <where> |
| | | <if test="matterName != null and matterName != ''"> |
| | | AND matterName=#{matterName} |
| | | AND matter_name like concat('%', #{matterName}, '%') |
| | | </if> |
| | | </where> |
| | | order by update_time desc , create_time desc |
| | | </select> |
| | | |
| | | <select id="countConfigList" resultType="integer"> |
| | | select count(id) from automessage_guide_repair_order |
| | | <where> |
| | | <if test="matterName != null and matterName != ''"> |
| | | AND matterName=#{matterName} |
| | | AND matter_name like concat('%', #{matterName}, '%') |
| | | </if> |
| | | </where> |
| | | </select> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.dg.core.db.gen.mapper.HuaChengSysUserMapper"> |
| | | |
| | | <resultMap type="com.dg.core.db.gen.entity.HuaChengSysUser" id="SysUserResult"> |
| | | <id property="userId" column="user_id" /> |
| | | <id property="account" column="account" /> |
| | | <id property="password" column="password" /> |
| | | <id property="openid" column="openid" /> |
| | | <id property="sessionKey" column="session_key" /> |
| | | <id property="unionid" column="unionid" /> |
| | | <id property="phone" column="phone" /> |
| | | <id property="nickName" column="nick_name" /> |
| | | <id property="name" column="name" /> |
| | | <id property="communityId" column="community_id" /> |
| | | <id property="sex" column="sex" /> |
| | | <id property="idCard" column="id_card" /> |
| | | <id property="birthday" column="birthday" /> |
| | | <id property="imageUrl" column="image_url" /> |
| | | <id property="type" column="type" /> |
| | | <id property="job" column="job" /> |
| | | <id property="isVolunteer" column="is_volunteer" /> |
| | | <id property="isPartymember" column="is_partymember" /> |
| | | <id property="status" column="status" /> |
| | | <id property="createAt" column="create_at" /> |
| | | <id property="lastLoginTime" column="last_login_time" /> |
| | | <id property="tags" column="tags" /> |
| | | <id property="familyId" column="family_id" /> |
| | | <id property="faceUrl" column="face_url" /> |
| | | <id property="faceState" column="face_state" /> |
| | | <id property="rejectReson" column="reject_reson" /> |
| | | <id property="areaId" column="area_id" /> |
| | | <id property="cardPhotoFront" column="card_photo_front" /> |
| | | <id property="cardPhotoBack" column="card_photo_back" /> |
| | | <id property="familyBook" column="family_book" /> |
| | | <id property="continuousLandingDays" column="continuous_landing_days" /> |
| | | <id property="isTips" column="is_tips" /> |
| | | <id property="workStatus" column="work_status" /> |
| | | <id property="workStartTime" column="work_start_time" /> |
| | | <id property="workEndTime" column="work_end_time" /> |
| | | <id property="bigAgeTips" column="big_age_tips" /> |
| | | <id property="plaintextPassword" column="plaintext_password" /> |
| | | <id property="streetId" column="street_id" /> |
| | | <id property="relationName" column="relation_name" /> |
| | | <id property="appId" column="app_id" /> |
| | | <id property="isAccept" column="is_accept" /> |
| | | <id property="bindingCheckUnitId" column="binding_check_unit_id" /> |
| | | </resultMap> |
| | | |
| | | <sql id="selectSysUserVo"> |
| | | SELECT |
| | | user_id, |
| | | account, |
| | | password, |
| | | openid, |
| | | session_key, |
| | | unionid, |
| | | phone, |
| | | nick_name, |
| | | name, |
| | | community_id, |
| | | sex, |
| | | id_card, |
| | | birthday, |
| | | image_url, |
| | | type, |
| | | job, |
| | | is_volunteer, |
| | | is_partymember, |
| | | status, |
| | | create_at, |
| | | last_login_time, |
| | | tags, |
| | | family_id, |
| | | face_url, |
| | | face_state, |
| | | reject_reson, |
| | | area_id, |
| | | card_photo_front, |
| | | card_photo_back, |
| | | family_book, |
| | | continuous_landing_days, |
| | | is_tips, |
| | | work_status, |
| | | work_start_time, |
| | | work_end_time, |
| | | big_age_tips, |
| | | plaintext_password, |
| | | street_id, |
| | | relation_name, |
| | | app_id, |
| | | is_accept, |
| | | binding_check_unit_id |
| | | FROM |
| | | sys_user |
| | | </sql> |
| | | |
| | | |
| | | <select id="selectNum" resultType="integer"> |
| | | select count(user_id) from sys_user |
| | | </select> |
| | | |
| | | <select id="selectConfigList" resultMap="SysUserResult"> |
| | | <include refid="selectSysUserVo"/> |
| | | </select> |
| | | |
| | | <select id="selectData" parameterType="string" resultMap="SysUserResult"> |
| | | <include refid="selectSysUserVo"/> |
| | | <where> |
| | | app_id='wx118de8a734d269f0' |
| | | <if test="userId!=null and userId!=''"> |
| | | and user_id=#{userId} |
| | | </if> |
| | | <if test="account!=null and account!=''"> |
| | | and account=#{account} |
| | | </if> |
| | | <if test="phone!=null and phone!=''"> |
| | | and phone=#{phone} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <id property="contactNumber" column="contact_number" /> |
| | | <id property="departmentalApplication" column="departmental_application" /> |
| | | <id property="updateUserId" column="update_user_id" /> |
| | | <id property="areaList" column="area_list" /> |
| | | |
| | | |
| | | </resultMap> |
| | |
| | | create_time, |
| | | update_time, |
| | | parent_id, |
| | | update_user_id, |
| | | (select user_name from automessage_sys_user where user_id=automessage_organization_chart.update_user_id) as updateUserName, |
| | | (select organization_name from automessage_organization_chart as oc where oc.id=automessage_organization_chart.parent_id) as parentName, |
| | | city, |
| | | district, |
| | | village, |
| | | (select name from area_code_2022 where city=area_code_2022.code) as cityName, |
| | | (select name from area_code_2022 where district=area_code_2022.code) as districtName, |
| | | (select name from area_code_2022 where village=area_code_2022.code) as villageName, |
| | | detailed_address, |
| | | grade, |
| | | resume,contact_number |
| | | area_list |
| | | FROM |
| | | automessage_organization_chart |
| | | </sql> |
| | |
| | | <select id="queryList" resultMap="OrganizationChartResult"> |
| | | <include refid="selectOrganizationChartVo"/> |
| | | <where> |
| | | <if test="parentId != null and parentId != ''"> |
| | | AND parent_id=#{parentId} |
| | | <if test="organizationName != null and organizationName != ''"> |
| | | AND organization_name like concat('%', #{organizationName}, '%') |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <if test="grade != null and grade != ''"> |
| | | AND grade=#{grade} |
| | | <select id="countList" resultType="integer"> |
| | | select count(id) from automessage_organization_chart |
| | | <where> |
| | | <if test="organizationName != null and organizationName != ''"> |
| | | AND organization_name like concat('%', #{organizationName}, '%') |
| | | </if> |
| | | </where> |
| | | </select> |
| | |
| | | or resume like concat('%', #{keyWord}, '%') or #{keyWord} like concat('%', resume, '%') |
| | | </select> |
| | | |
| | | |
| | | |
| | | <insert id="insertConfig" parameterType="com.dg.core.db.gen.entity.OrganizationChartEntity"> |
| | | insert into automessage_organization_chart ( |
| | | <if test="id != null">id,</if> |
| | |
| | | <if test="village != null and village != '' ">village,</if> |
| | | <if test="detailedAddress != null and detailedAddress != '' ">detailed_address,</if> |
| | | <if test="grade != null and grade != '' ">grade,</if> |
| | | <if test="areaList != null and areaList != '' ">area_list,</if> |
| | | <if test="contactNumber != null and contactNumber != '' ">contact_number,</if> |
| | | <if test="departmentalApplication != null and departmentalApplication != '' ">departmental_application,</if> |
| | | <if test="updateUserId != null and updateUserId != '' ">update_user_id,</if> |
| | | <if test="resume != null and resume != '' ">resume,</if> |
| | | update_time, |
| | | create_time |
| | | )values( |
| | |
| | | <if test="village != null and village != '' ">#{village},</if> |
| | | <if test="detailedAddress != null and detailedAddress != '' ">#{detailedAddress},</if> |
| | | <if test="grade != null and grade != '' ">#{grade},</if> |
| | | <if test="areaList != null and areaList != '' ">#{areaList},</if> |
| | | <if test="contactNumber != null and contactNumber != '' ">#{contactNumber},</if> |
| | | <if test="departmentalApplication != null and departmentalApplication != '' ">#{departmentalApplication},</if> |
| | | <if test="updateUserId != null and updateUserId != '' ">#{updateUserId},</if> |
| | | <if test="resume != null and resume != '' ">#{resume},</if> |
| | | sysdate(), |
| | | sysdate() |
| | | ) |
| | |
| | | <if test="village != null and village != '' ">village=#{village},</if> |
| | | <if test="detailedAddress != null and detailedAddress != '' ">detailed_address=#{detailedAddress},</if> |
| | | <if test="grade != null and grade != '' ">grade=#{grade},</if> |
| | | <if test="departmentalApplication != null and departmentalApplication != '' ">departmental_application=#{departmentalApplication},</if> |
| | | <if test="updateUserId != null">update_user_id=#{updateUserId},</if> |
| | | <if test="areaList != null and areaList != '' ">area_list=#{areaList},</if> |
| | | <if test="contactNumber != null and contactNumber != '' ">contact_number=#{contactNumber},</if> |
| | | <if test="departmentalApplication != null and departmentalApplication != '' ">departmental_application=#{departmentalApplication},</if> |
| | | <if test="updateUserId != null and updateUserId != '' ">update_user_id=#{updateUserId},</if> |
| | | <if test="resume != null and resume != '' ">resume=#{resume},</if> |
| | | update_time=sysdate() |
| | | </set> |
| | | where id= #{id} |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.dg.core.db.gen.mapper.SysUserMapper"> |
| | | |
| | | <resultMap type="com.dg.core.db.gen.entity.SysUser" id="SysUserResult"> |
| | | <id property="id" column="id" /> |
| | | <id property="userId" column="user_id" /> |
| | | <result property="loginName" column="login_name" /> |
| | | <result property="userName" column="user_name" /> |
| | |
| | | |
| | | <sql id="selectSysUserVo"> |
| | | SELECT |
| | | id, |
| | | user_id, |
| | | login_name, |
| | | user_name, |
| | |
| | | automessage_sys_user |
| | | </sql> |
| | | |
| | | |
| | | <select id="selectNum" parameterType="string" resultType="integer"> |
| | | select count(user_id) from automessage_sys_user |
| | | <where> |
| | |
| | | order by create_time desc |
| | | </select> |
| | | |
| | | |
| | | <select id="selectData" parameterType="string" resultMap="SysUserResult"> |
| | | <include refid="selectSysUserVo"/> |
| | | <where> |
| | | <if test="userId!=null and userId!='' "> |
| | | user_id= #{userId} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | |
| | | <select id="selectListByDepartmentId" resultMap="SysUserResult"> |
| | | <include refid="selectSysUserVo"/> |
| | | where department_id=#{departmentId} and master_ids like concat('%',#{classifyId}, '%') |
| | | <where> |
| | | <if test="list!=null"> |
| | | department_id in |
| | | <foreach collection="list" item="id" index="index" open="(" close=")" separator=","> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | and (master_ids like concat('%',#{classifyIdFront}, '%') or master_ids like concat('%',#{classifyIdAfter}, '%')) |
| | | </where> |
| | | </select> |
| | | |
| | | |
| | |
| | | order by create_time desc |
| | | </select> |
| | | |
| | | <select id="selectListByIds" resultMap="TransactionEventEntityResult"> |
| | | <include refid="selectTransactionEventList"/> |
| | | WHERE id IN |
| | | <foreach collection="array" item="id" index="index" open="(" close=")" separator=","> |
| | | #{id} |
| | | </foreach> |
| | | order by create_time desc |
| | | </select> |
| | | |
| | | <insert id="insertConfig" parameterType="com.dg.core.db.gen.entity.TransactionEvent"> |
| | | insert into automessage_transaction_event ( |
| | | <if test="id != null">id,</if> |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.panzhihua.applets.model.dtos.IDTO; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.R; |
| | |
| | | * @return 单条数据 |
| | | */ |
| | | @ApiOperation("详情接口") |
| | | @PostMapping("/detail") |
| | | public R selectDetail(@RequestBody IDTO idto) { |
| | | return this.propertyService.comPropertyRepairSelectOne(idto.getId()); |
| | | } |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 单条数据 |
| | | */ |
| | | @ApiOperation("详情接口") |
| | | @GetMapping("/{id}") |
| | | public R selectOne(@PathVariable("id") Long id) { |
| | | return this.propertyService.comPropertyRepairSelectOne(id); |
| | |
| | | |
| | | @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) |
New file |
| | |
| | | package com.panzhihua.applets.model.dtos; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class IDTO { |
| | | private Long id; |
| | | } |
| | |
| | | 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; |
| | |
| | | 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、行业分中心") |
| | |
| | | @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; |
| | | } |
| | |
| | | private Long pageNo; |
| | | private Long pageSize; |
| | | private String keyword; |
| | | @ApiModelProperty(value = "查看类型1用户查看自己的调解事件申请2专家查看自己受理的调解事件") |
| | | private Integer userType; |
| | | } |
| | |
| | | private Long pageNo; |
| | | private Long pageSize; |
| | | private String keyword; |
| | | @ApiModelProperty(value = "查看类型1用户查看自己的调解事件申请2专家查看自己受理的调解事件") |
| | | private Integer userType; |
| | | } |
| | |
| | | * 小程序获取可选择专家列表 |
| | | * */ |
| | | @GetMapping("/sanshuo/expert/appletsList") |
| | | R expertAppList(); |
| | | R expertAppList(@RequestParam (value = "type",required = false)Integer type,@RequestParam(value = "id",required = false)Long id); |
| | | |
| | | /** |
| | | * 获取专家详情 |
| | |
| | | * */ |
| | | @GetMapping("/isSanShuoExpert") |
| | | R isExpert(@RequestParam("number") String number); |
| | | |
| | | /** |
| | | * 删除用户专家权限 |
| | | * */ |
| | | @GetMapping("/removeExpertRole") |
| | | R removeExpertRole(@RequestParam(value = "phone",required = false) String phone); |
| | | } |
| | |
| | | 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) { |
| | |
| | | @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)); |
| | | } |
| | | |
| | | /** |
| | |
| | | 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()); |
| | | } |
| | | |
| | | |
| | |
| | | @PostMapping |
| | | public R add(@RequestBody ComSanshuoExpertDTO comSanshuoExpertDTO){ |
| | | comSanshuoExpertDTO.setCreateBy(this.getLoginUserInfo().getName()); |
| | | return comSanShuoExpertService.addExpert(comSanshuoExpertDTO); |
| | | return comSanShuoExpertService.addOrUpdateExpert(comSanshuoExpertDTO); |
| | | } |
| | | |
| | | @GetMapping("/detail") |
| | |
| | | * 小程序获取可选择专家 |
| | | * */ |
| | | @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()); |
| | | } |
| | | |
| | | /** |
| | |
| | | * */ |
| | | @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)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 后台获取列表 |
| | |
| | | * */ |
| | | @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("有未调解完成事件,无法删除!"); |
| | |
| | | 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(); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | * @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(); |
| | | |
| | |
| | | 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; |
| | |
| | | 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") |
| | |
| | | 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、行业分中心") |
| | |
| | | private String result; |
| | | /**已归档处理完毕时间*/ |
| | | @ApiModelProperty(name = "resultDate", value = "已归档处理完毕时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date resultDate; |
| | | /**是否紧急*/ |
| | | @ApiModelProperty(name = "urgent", value = "是否紧急") |
| | |
| | | private Long createBy; |
| | | /**创建时间*/ |
| | | @ApiModelProperty(name = "createAt", value = "创建时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date createAt; |
| | | /**修改人*/ |
| | | @ApiModelProperty(name = "updateBy", value = "修改人") |
| | |
| | | private String eventCategoryName; |
| | | @TableField(exist = false) |
| | | private String keyword; |
| | | @TableField(exist = false) |
| | | private Integer userType; |
| | | |
| | | } |
| | |
| | | private Long industryCenterId; |
| | | |
| | | /** |
| | | * 备用字段1 |
| | | */ |
| | | private String param1; |
| | | |
| | | /** |
| | | * 所属单位 |
| | | */ |
| | | private String unit; |
| | |
| | | @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(); |
| | | } |
| | | } |
| | |
| | | * @param comSanshuoExpertDTO |
| | | * @return 处理结果 |
| | | * */ |
| | | R addExpert(ComSanshuoExpertDTO comSanshuoExpertDTO); |
| | | R addOrUpdateExpert(ComSanshuoExpertDTO comSanshuoExpertDTO); |
| | | |
| | | /** |
| | | * 后台获取专家列表 |
| | |
| | | /** |
| | | * 小程序获取专家列表 |
| | | * */ |
| | | R selectExpertList(); |
| | | R selectExpertList(Integer type,Long id,Long cid); |
| | | |
| | | /** |
| | | * 专家风采列表 |
| | |
| | | * @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 三说会堂事件表列表数据 |
| | |
| | | * @author manailin |
| | | * @date 2022-09-07 11:23:51 |
| | | */ |
| | | List<ComEvent> listByComEvent(ComEvent comEvent); |
| | | List<ComEvent> listByComEvent(ComEvent comEvent,LoginUserInfoVO loginUserInfoVO); |
| | | |
| | | /** |
| | | * description 修改三说会堂事件表状态 |
| | |
| | | @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()); |
| | |
| | | } |
| | | |
| | | @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(); |
| | | } |
| | |
| | | || comEvent.getEventProcessStatus() == SanShuoEventStatusEnum.VALID.getCode().intValue()) { |
| | | comEvent.setId(id); |
| | | comEvent.setUserEventStatus(4); |
| | | comEvent.setEventProcessStatus(SanShuoEventStatusEnum.CANCEL.getCode()); |
| | | comEvent.setEventProcessStatus(8); |
| | | comEvent.setRevokeDes("用户手动取消"); |
| | | int flag = baseMapper.updateById(comEvent); |
| | | return flag > 0 ? R.ok() : R.fail(ReturnMsgConstants.UPDATE_FALSE); |
| | |
| | | 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); |
| | |
| | | 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); |
| | | }); |
| | |
| | | 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); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R archiveRequest(ComEventArchiveVO comEventArchiveVO, LoginUserInfoVO sysUser) { |
| | |
| | | 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; |
| | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import static java.util.Objects.isNull; |
| | | import static java.util.Objects.nonNull; |
| | | |
| | | @Service |
| | |
| | | * @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("操作失败"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 后台获取专家列表 |
| | |
| | | * 小程序获取专家列表 |
| | | * */ |
| | | @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); |
| | | } |
| | | |
| | | |
| | |
| | | <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> |
| | |
| | | <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"> |
| | |
| | | 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 |
| | |
| | | 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 |
| | |
| | | } |
| | | ComPropertyRepairVO vo=comPropertyRepairVO; |
| | | try { |
| | | comPropertyRepairVO.setRepairName(RSAUtils.decrypt(comPropertyRepairVO.getRepairName(), Constants.PRIVATE_KEY)); |
| | | comPropertyRepairVO.setRepairPhone(RSAUtils.decrypt(comPropertyRepairVO.getRepairPhone(), Constants.PRIVATE_KEY)); |
| | | comPropertyRepair.setRepairName(RSAUtils.decrypt(comPropertyRepairVO.getRepairName(), Constants.PRIVATE_KEY)); |
| | | comPropertyRepair.setRepairPhone(RSAUtils.decrypt(comPropertyRepairVO.getRepairPhone(), Constants.PRIVATE_KEY)); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | comPropertyRepairVO.setRepairName(vo.getRepairName()); |
| | | comPropertyRepairVO.setRepairPhone(vo.getRepairPhone()); |
| | | comPropertyRepair.setRepairName(comPropertyRepairVO.getRepairName()); |
| | | comPropertyRepair.setRepairPhone(comPropertyRepairVO.getRepairPhone()); |
| | | } |
| | | return R.ok(this.comPropertyRepairService.save(comPropertyRepair)); |
| | | } |
| | |
| | | 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){ |
| | |
| | | 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; |
| | |
| | | List<CommunityVO> selectCommunityByStreetName(String name); |
| | | |
| | | StreetVOS selectStreetByName(String name); |
| | | |
| | | /** |
| | | * 是否为专家 |
| | | * */ |
| | | ComSanshuoExpertVO isExpert(String phone); |
| | | } |
| | |
| | | R accept(Long userId); |
| | | |
| | | R addComPbCheckUser(ComPbCheckUserDTO comPbCheckUserDTO); |
| | | |
| | | /** |
| | | * 移除专家权限 |
| | | * */ |
| | | R removeExpertRole(String phone); |
| | | } |
| | |
| | | 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; |
| | |
| | | }else if (isNull(loginUserInfoVO.getLevel())){ |
| | | loginUserInfoVO.setLevel(1); |
| | | } |
| | | //是否为三说会堂专家 |
| | | ComSanshuoExpertVO expertVO=userDao.isExpert(loginUserInfoVO.getPhone()); |
| | | if (nonNull(expertVO)){ |
| | | loginUserInfoVO.setType(13); |
| | | } |
| | | return R.ok(loginUserInfoVO); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 修改用户登录密码 |
| | |
| | | //是否存在相同账号 |
| | | 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()); |
| | |
| | | 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)); |
| | | } |
| | |
| | | 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() { |
| | |
| | | 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> |