添加短信登录功能 添加常见问题表模块 办事指南访问模块 并给相应的所有接口加token验证
| | |
| | | <version>2.3.30</version> |
| | | </dependency> |
| | | |
| | | <!-- 阿里短信 --> |
| | | <dependency> |
| | | <groupId>com.aliyun</groupId> |
| | | <artifactId>aliyun-java-sdk-core</artifactId> |
| | | <version>4.5.3</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>cn.afterturn</groupId> |
| | | <artifactId>easypoi-annotation</artifactId> |
New file |
| | |
| | | package com.dg.core; |
| | | |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.context.annotation.PropertySource; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * 阿里云短信配置 |
| | | */ |
| | | @Component |
| | | @PropertySource(value = "classpath:application-sms.properties",encoding = "UTF-8") |
| | | public class AliyunConfig { |
| | | |
| | | @Value("${aliyun.key}") |
| | | private String key; |
| | | |
| | | @Value("${aliyun.screct}") |
| | | |
| | | private String screct; |
| | | @Value("${aliyun.SignName}") |
| | | private String SignName; |
| | | |
| | | @Value("${aliyun.TemplateCode}") |
| | | private String TemplateCode; |
| | | |
| | | |
| | | public String getKey() { |
| | | return key; |
| | | } |
| | | |
| | | public void setKey(String key) { |
| | | this.key = key; |
| | | } |
| | | |
| | | public String getScrect() { |
| | | return screct; |
| | | } |
| | | |
| | | public void setScrect(String screct) { |
| | | this.screct = screct; |
| | | } |
| | | |
| | | public String getSignName() { |
| | | return SignName; |
| | | } |
| | | |
| | | public void setSignName(String signName) { |
| | | SignName = signName; |
| | | } |
| | | |
| | | public String getTemplateCode() { |
| | | return TemplateCode; |
| | | } |
| | | |
| | | public void setTemplateCode(String templateCode) { |
| | | TemplateCode = templateCode; |
| | | } |
| | | } |
| | |
| | | */ |
| | | @ApiOperation(value = "通过协议名获取相关协议",response = Agreement.class) |
| | | @GetMapping(value = "/queryByAgreement") |
| | | @Authorization |
| | | public ResultData queryByAgreement(@RequestParam("agreement") String agreement) { |
| | | return ResultData.success(agreementService.queryByAgreement(agreement)); |
| | | } |
| | |
| | | */ |
| | | @ApiOperation(value = "获取相关附件列表(不分页)",response = Agreement.class) |
| | | @GetMapping(value = "/getList") |
| | | @Authorization |
| | | public ResultData selectConfigList(){ |
| | | return ResultData.success(agreementService.selectConfigList()); |
| | | } |
New file |
| | |
| | | package com.dg.core.controller; |
| | | |
| | | |
| | | import com.dg.core.ResultData; |
| | | import com.dg.core.db.gen.entity.AreaCode2022; |
| | | import com.dg.core.db.gen.entity.AutomessageCommonProblem; |
| | | import com.dg.core.service.IAutomessageCommonProblemService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | @Api(tags = {"常见问题接口"}) |
| | | @RestController |
| | | @RequestMapping("/automessageCommonProblem") |
| | | public class AutomessageCommonProblemController extends BaseController{ |
| | | |
| | | @Resource |
| | | private IAutomessageCommonProblemService iAutomessageCommonProblemService; |
| | | |
| | | |
| | | /** |
| | | * 获取常见问题列表(不分页) |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "根据指南id获取所属地区",response = AutomessageCommonProblem.class) |
| | | @GetMapping("/selectList") |
| | | public ResultData selectList(){ |
| | | return ResultData.success(iAutomessageCommonProblemService.selectList()); |
| | | } |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dg.core.ResultData; |
| | | import com.dg.core.annotation.Authorization; |
| | | import com.dg.core.db.gen.entity.ClassifyAdministration; |
| | | import com.dg.core.db.gen.entity.TransactionEvent; |
| | | import com.dg.core.service.IClassifyAdministrationService; |
| | |
| | | */ |
| | | @ApiOperation(value = "获取管理菜单列表(无分页)",response = ClassifyAdministration.class) |
| | | @GetMapping("/getList") |
| | | @Authorization |
| | | public TableDataInfo selectConfigList(@RequestParam(value = "classifyGrade",required = false) String classifyGrade) |
| | | { |
| | | int num=iClassifyAdministrationService.countNum("",classifyGrade); |
| | |
| | | */ |
| | | @ApiOperation(value = " 获取管理菜单列表(已分级)",response = ClassifyAdministration.class) |
| | | @GetMapping("/getListByParentId") |
| | | @Authorization |
| | | public TableDataInfo selectConfigListByParentId(@RequestParam(value = "pageNum",required = false) Integer pageNum, |
| | | @RequestParam(value = "pageSize",required = false) Integer pageSize, |
| | | @RequestParam(value = "parentId",required = false) String parentId, |
| | |
| | | */ |
| | | @ApiOperation(value = "获取管理菜单列表",response = ClassifyAdministration.class) |
| | | @GetMapping("/getListPage") |
| | | @Authorization |
| | | public TableDataInfo selectConfigList(@RequestParam(value = "pageNum",required = false) Integer pageNum, |
| | | @RequestParam(value = "pageSize",required = false) Integer pageSize, |
| | | @RequestParam(value = "name",required = false) String name) |
| | |
| | | */ |
| | | @ApiOperation(value = "新增分类",response = ClassifyAdministration.class) |
| | | @PostMapping("/add") |
| | | @Authorization |
| | | public ResultData insertConfig(@RequestBody ClassifyAdministration entity) { |
| | | Assert.notNull(entity, "参数不能为空"); |
| | | Assert.notNull(entity.getClassifyName(), "分类名称不能为空"); |
| | |
| | | */ |
| | | @ApiOperation("编辑分类") |
| | | @PostMapping("/update") |
| | | @Authorization |
| | | public ResultData updateConfig(@RequestBody ClassifyAdministration entity) |
| | | { |
| | | return toAjax(iClassifyAdministrationService.updateConfig(entity)); |
| | |
| | | */ |
| | | @ApiOperation("删除分类") |
| | | @DeleteMapping("/delete/{Id}") |
| | | @Authorization |
| | | public ResultData deleteConfigById(@PathVariable("Id") String Id) |
| | | { |
| | | if(StringUtils.isEmpty(Id)) |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dg.core.ResultData; |
| | | import com.dg.core.annotation.Authorization; |
| | | import com.dg.core.db.gen.entity.ElseAccessoryEntity; |
| | | import com.dg.core.service.IElseAccessoryService; |
| | | import com.dg.core.util.TableDataInfo; |
| | |
| | | */ |
| | | @ApiOperation("获取附件列表接口") |
| | | @GetMapping(path = "/getList") |
| | | @Authorization |
| | | public TableDataInfo selectConfigList(@RequestParam(value = "pageNum",required = false) Integer pageNum, |
| | | @RequestParam(value = "pageSize",required = false) Integer pageSize, |
| | | @RequestParam(value = "Name",required = false) String Name) |
| | |
| | | */ |
| | | @ApiOperation("新增附件") |
| | | @PostMapping(path = "/add") |
| | | @Authorization |
| | | public ResultData insertConfig(@RequestBody ElseAccessoryEntity entity) |
| | | { |
| | | if(entity==null) |
| | |
| | | */ |
| | | @ApiOperation("更新附件") |
| | | @PostMapping(path = "/update") |
| | | @Authorization |
| | | public ResultData updateConfig(@RequestBody ElseAccessoryEntity entity) |
| | | { |
| | | return toAjax(iElseAccessoryService.updateConfig(entity)); |
| | |
| | | */ |
| | | @ApiOperation("删除附件") |
| | | @DeleteMapping(path = "/delete") |
| | | @Authorization |
| | | public ResultData deleteConfigById(@RequestParam(value = "Id",required = false) String Id) |
| | | { |
| | | return toAjax(iElseAccessoryService.deleteConfigById(Id)); |
| | |
| | | */ |
| | | @ApiOperation("用户列表接口") |
| | | @GetMapping("/getlist") |
| | | @Authorization |
| | | public TableDataInfo selectConfigList(@RequestParam(value = "pageNum",required = false) Integer pageNum, |
| | | @RequestParam(value = "pageSize",required = false) Integer pageSize) |
| | | { |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dg.core.ResultData; |
| | | import com.dg.core.annotation.Authorization; |
| | | import com.dg.core.db.gen.entity.KeywordEntity; |
| | | import com.dg.core.service.IKeywordService; |
| | | import com.dg.core.util.TableDataInfo; |
| | |
| | | */ |
| | | @ApiOperation("关键词列表接口") |
| | | @GetMapping("/getlist") |
| | | @Authorization |
| | | public TableDataInfo selectConfigList(@RequestParam(value = "pageNum",required = false) Integer pageNum, |
| | | @RequestParam(value = "pageSize",required = false) Integer pageSize) |
| | | { |
| | |
| | | */ |
| | | @ApiOperation("关键词详情接口") |
| | | @GetMapping("/getData") |
| | | @Authorization |
| | | public ResultData selectConfigData(@RequestParam(value = "id",required = false) String id, |
| | | @RequestParam(value = "name",required = false) String name) |
| | | { |
| | |
| | | */ |
| | | @ApiOperation("关键词添加接口") |
| | | @PostMapping("/add") |
| | | @Authorization |
| | | public ResultData insertConfig(@RequestBody KeywordEntity entity) |
| | | { |
| | | KeywordEntity enti=iKeywordService.selectConfigData("",entity.getName()); |
| | |
| | | */ |
| | | @ApiOperation("关键词编辑接口") |
| | | @PostMapping("/update") |
| | | @Authorization |
| | | public ResultData updateConfig(@RequestBody KeywordEntity entity) |
| | | { |
| | | return toAjax(iKeywordService.updateConfig(entity)); |
| | |
| | | */ |
| | | @ApiOperation("关键词删除接口") |
| | | @DeleteMapping("/delete") |
| | | @Authorization |
| | | public ResultData deleteConfigById(String Id) |
| | | { |
| | | return toAjax(iKeywordService.deleteConfigById(Id)); |
| | |
| | | package com.dg.core.controller; |
| | | |
| | | import com.dg.core.ResultData; |
| | | import com.dg.core.annotation.Authorization; |
| | | import com.dg.core.db.gen.entity.OrganizationChartEntity; |
| | | import com.dg.core.service.IOrganizationChartService; |
| | | import com.dg.core.util.TableDataInfo; |
| | |
| | | */ |
| | | @ApiOperation("新增机构") |
| | | @PostMapping("/add") |
| | | @Authorization |
| | | public ResultData insertConfig(@RequestBody OrganizationChartEntity entity) |
| | | { |
| | | Assert.notNull(entity.getGrade(), "等级 grade 不能为空"); |
| | |
| | | */ |
| | | @ApiOperation("更新机构") |
| | | @PostMapping("/update") |
| | | @Authorization |
| | | public ResultData updateConfig(@RequestBody OrganizationChartEntity entity) |
| | | { |
| | | return toAjax(iOrganizationChartService.updateConfig(entity)); |
| | |
| | | */ |
| | | @ApiOperation("删除机构") |
| | | @DeleteMapping("/delete") |
| | | @Authorization |
| | | public ResultData deleteConfigById(@RequestParam(value = "Id",required = false) String Id) |
| | | { |
| | | Assert.notNull(Id, "Id 不能为空"); |
| | |
| | | */ |
| | | @ApiOperation(value = "根据id查取消组织机构",response = OrganizationChartEntity.class) |
| | | @GetMapping("/selectById") |
| | | @Authorization |
| | | ResultData selectConfigById(@RequestParam("id") String id){ |
| | | return ResultData.success(iOrganizationChartService.selectConfigById(id)); |
| | | } |
| | |
| | | */ |
| | | @ApiOperation("获取模板列表") |
| | | @GetMapping("/getlist") |
| | | @Authorization |
| | | public TableDataInfo selectConfigList(@RequestParam(value = "pageNum",required = false) Integer pageNum, |
| | | @RequestParam(value = "pageSize",required = false) Integer pageSize, |
| | | @RequestParam(value = "Name",required = false) String Name) |
| | |
| | | */ |
| | | @ApiOperation("获取详情") |
| | | @GetMapping("/getdata") |
| | | @Authorization |
| | | public ResultData selectConfigData(@RequestParam(value = "Id",required = false) String Id) |
| | | { |
| | | if(StringUtils.isEmpty(Id)) |
| | |
| | | */ |
| | | @ApiOperation("更新模板") |
| | | @PostMapping("/update") |
| | | @Authorization |
| | | public ResultData updateConfig(@RequestBody ReplyTemplateEntity entity) |
| | | { |
| | | if(entity==null) |
| | |
| | | */ |
| | | @ApiOperation("删除模板") |
| | | @DeleteMapping("/delete") |
| | | @Authorization |
| | | public ResultData deleteConfigById(@RequestParam(value = "Id",required = false) String Id) |
| | | { |
| | | return toAjax(iReplyTemplateService.deleteConfigById(Id)); |
| | |
| | | */ |
| | | @ApiOperation("复制模板") |
| | | @PostMapping("/copy") |
| | | @Authorization |
| | | public ResultData copy(@RequestParam(value = "Id",required = false) String Id) |
| | | { |
| | | if(StringUtils.isEmpty(Id)) |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dg.core.ResultData; |
| | | import com.dg.core.annotation.Authorization; |
| | | import com.dg.core.db.gen.entity.RoleManagementEntity; |
| | | import com.dg.core.service.IRoleManagementService; |
| | | import com.dg.core.util.TableDataInfo; |
| | |
| | | */ |
| | | @ApiOperation("查询角色列表") |
| | | @GetMapping("/getList") |
| | | @Authorization |
| | | public TableDataInfo selectConfigList(@RequestParam(value = "pageNum",required = false) Integer pageNum, |
| | | @RequestParam(value = "pageSize",required = false) Integer pageSize) |
| | | { |
| | |
| | | */ |
| | | @ApiOperation("新增角色") |
| | | @PostMapping("/add") |
| | | @Authorization |
| | | public ResultData insertConfig(@RequestBody RoleManagementEntity entity) |
| | | { |
| | | // entity.setCreateUserId(sysUser.getUserId()+""); |
| | |
| | | */ |
| | | @ApiOperation("编辑角色") |
| | | @PostMapping("/update") |
| | | @Authorization |
| | | public ResultData updateConfig(@RequestBody RoleManagementEntity entity) |
| | | { |
| | | // entity.setUpdateUserId(sysUser.getUserId()+""); |
| | |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/delete") |
| | | @Authorization |
| | | public ResultData deleteConfigById(@RequestParam(value = "Id",required = false) String Id) |
| | | { |
| | | if(StringUtils.isEmpty(Id)) |
| | |
| | | package com.dg.core.controller; |
| | | |
| | | import com.dg.core.ResultData; |
| | | import com.dg.core.annotation.Authorization; |
| | | import com.dg.core.db.gen.entity.Agreement; |
| | | import com.dg.core.db.gen.entity.OrganizationChartEntity; |
| | | import com.dg.core.db.gen.entity.Slideshow; |
| | |
| | | */ |
| | | @ApiOperation(value = "修改轮播图数据",response = Slideshow.class) |
| | | @PostMapping("/update") |
| | | @Authorization |
| | | public ResultData update(@RequestBody Slideshow slideshow){ |
| | | return iSlideshowService.update(slideshow); |
| | | } |
| | |
| | | */ |
| | | @ApiOperation(value = "删除轮播图数据",response = Slideshow.class) |
| | | @GetMapping("/delete") |
| | | @Authorization |
| | | public ResultData delete(@RequestParam("id") Integer id){ |
| | | return iSlideshowService.delete(id); |
| | | } |
| | |
| | | |
| | | 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.Slideshow; |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | import com.dg.core.db.gen.entity.TransactionEvent; |
| | | import com.dg.core.db.manual.pojo.QueryResults; |
| | | import com.dg.core.db.manual.pojo.RecommendResult; |
| | |
| | | */ |
| | | @ApiOperation("查询导办事务详情") |
| | | @GetMapping("/getData") |
| | | public ResultData selectConfigData(@RequestParam("Id") String Id) |
| | | @Authorization |
| | | public ResultData selectConfigData(@RequestParam("Id") String Id,@CurrentUser SysUser sysUser) |
| | | { |
| | | Assert.notNull(Id, "Id 不能为空"); |
| | | return ResultData.success(iTransactionEventService.selectConfigData(Id)); |
| | | return ResultData.success(iTransactionEventService.selectConfigData(Id,sysUser)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @ApiOperation("新增导办事务") |
| | | @PostMapping("/add") |
| | | @Authorization |
| | | public ResultData insertConfig(@RequestBody TransactionEvent entity) |
| | | { |
| | | return toAjax(iTransactionEventService.insertConfig(entity)); |
| | |
| | | */ |
| | | @ApiOperation("修改导办事务") |
| | | @PostMapping("/update") |
| | | @Authorization |
| | | public ResultData updateConfig(@RequestBody TransactionEvent entity) |
| | | { |
| | | return toAjax(iTransactionEventService.updateConfig(entity)); |
| | |
| | | */ |
| | | @ApiOperation("删除导办事务") |
| | | @DeleteMapping("/delete") |
| | | @Authorization |
| | | public ResultData deleteConfigById(@RequestParam(value = "Id",required = false) String Id) |
| | | { |
| | | |
| | |
| | | */ |
| | | @ApiOperation(value = "智能咨询",response = RecommendResult.class) |
| | | @GetMapping("/smartConsulting") |
| | | @Authorization |
| | | public RecommendResult smartConsulting(@RequestParam("keyWord") String keyWord){ |
| | | return iTransactionEventService.smartConsulting(keyWord); |
| | | |
| | |
| | | import com.dg.core.annotation.Authorization; |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | import com.dg.core.manager.TokenManager; |
| | | 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.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; |
| | |
| | | public class UserController extends BaseController{ |
| | | @Autowired |
| | | com.dg.core.service.ISysUserService IUserService; |
| | | |
| | | @Autowired |
| | | SmsUtil smsUtil; |
| | | |
| | | |
| | | |
| | | @Autowired |
| | |
| | | return ResultData.success(map); |
| | | } |
| | | |
| | | @ApiOperation("发送登录短信验证码") |
| | | @PostMapping(value = "/sendSms", consumes = "application/json") |
| | | public ResultData smsSend(@RequestBody SysUser user) { |
| | | return IUserService.smsSend(user); |
| | | } |
| | | |
| | | @ApiOperation("账号密码验证登录") |
| | | @GetMapping(value = "/loginByAccount") |
| | | public ResultData loginByAccount(@RequestParam String phonenumber,@RequestParam String code) { |
| | | return IUserService.loginByAccount(phonenumber,code); |
| | | } |
| | | |
| | | /** |
| | | * 查询列表 |
| | | * |
| | |
| | | */ |
| | | @ApiOperation("用户列表接口") |
| | | @GetMapping("/getlist") |
| | | @Authorization |
| | | public TableDataInfo selectConfigList(@RequestParam(value = "pageNum",required = false) Integer pageNum, |
| | | @RequestParam(value = "pageSize",required = false) Integer pageSize) |
| | | { |
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 io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * 常见问题表 |
| | | * </p> |
| | | * |
| | | * @author fengjin |
| | | * @since 2022-09-23 |
| | | */ |
| | | @TableName("automessage_common_problem") |
| | | @Data |
| | | @ApiModel("常见问题实体类") |
| | | public class AutomessageCommonProblem implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @ApiModelProperty("主键") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 常见问题标题 |
| | | */ |
| | | @ApiModelProperty("常见问题标题") |
| | | private String title; |
| | | |
| | | /** |
| | | * 常见问题解答内容 |
| | | */ |
| | | @ApiModelProperty("常见问题解答内容") |
| | | private String content; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @ApiModelProperty("创建时间") |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | @ApiModelProperty("修改时间") |
| | | private LocalDateTime updateTime; |
| | | |
| | | /** |
| | | * 修改人id |
| | | */ |
| | | @ApiModelProperty("修改人id") |
| | | private String updateUserId; |
| | | |
| | | /** |
| | | * 创建人id |
| | | */ |
| | | @ApiModelProperty("创建人id") |
| | | private String createUserId; |
| | | |
| | | |
| | | } |
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 io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * 办事指南访问表 |
| | | * </p> |
| | | * |
| | | * @author fengjin |
| | | * @since 2022-09-26 |
| | | */ |
| | | @TableName("automessage_transaction_event_interview") |
| | | @Data |
| | | @ApiModel("办事指南访问表实体类") |
| | | public class AutomessageTransactionEventInterview implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @ApiModelProperty("主键") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 办事指南id |
| | | */ |
| | | @ApiModelProperty("办事指南id") |
| | | private Integer transactionEventId; |
| | | |
| | | /** |
| | | * 用户id |
| | | */ |
| | | @ApiModelProperty("用户id") |
| | | private Long userId; |
| | | |
| | | /** |
| | | * 访问时间 |
| | | */ |
| | | @ApiModelProperty("访问时间") |
| | | private LocalDateTime interviewTime; |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | package com.dg.core.db.gen.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @ApiModelProperty("类型1,视频 2.图片") |
| | | private Integer type; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @ApiModelProperty("创建时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | |
| | | |
| | | @Override |
New file |
| | |
| | | package com.dg.core.db.gen.mapper; |
| | | |
| | | import com.dg.core.db.gen.entity.AutomessageCommonProblem; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * 常见问题表 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author fengjin |
| | | * @since 2022-09-23 |
| | | */ |
| | | public interface AutomessageCommonProblemMapper extends BaseMapper<AutomessageCommonProblem> { |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.db.gen.mapper; |
| | | |
| | | import com.dg.core.db.gen.entity.AutomessageTransactionEventInterview; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * 办事指南访问表 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author fengjin |
| | | * @since 2022-09-26 |
| | | */ |
| | | public interface AutomessageTransactionEventInterviewMapper extends BaseMapper<AutomessageTransactionEventInterview> { |
| | | |
| | | } |
| | |
| | | |
| | | public class MapperGenerator { |
| | | @Value("spring.datasource.url") |
| | | String url = "jdbc:mysql://10.8.0.74:3306/flower_city_automessage?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&allowMultiQueries=true&serverTimezone=GMT%2B8"; |
| | | String url = "jdbc:mysql://10.8.0.74:3306/huacheng_smart_life?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&allowMultiQueries=true&serverTimezone=GMT%2B8"; |
| | | @Value("spring.datasource.username") |
| | | String username = "root"; |
| | | @Value("spring.datasource.password") |
| | |
| | | }) |
| | | .strategyConfig(builder -> { |
| | | // builder.addInclude(""); |
| | | builder.addInclude("agreement") // 设置需要生成的表名 |
| | | builder.addInclude("automessage_transaction_event_interview") // 设置需要生成的表名 |
| | | .addTablePrefix("t_", "c_"); // 设置过滤表前缀 |
| | | }) |
| | | .templateConfig(builder -> { |
| | |
| | | @Data |
| | | public class Search { |
| | | |
| | | @ApiModelProperty("id") |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty("搜索结果标题") |
| | | private String title; |
| | | |
| | |
| | | |
| | | @ApiModelProperty("浏览次数") |
| | | private Integer views; |
| | | |
| | | @ApiModelProperty("搜索数据类型1.办事部门2.办事指南 3.推荐办事指南") |
| | | private Integer type; |
| | | } |
New file |
| | |
| | | package com.dg.core.service; |
| | | |
| | | import com.dg.core.db.gen.entity.AutomessageCommonProblem; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface IAutomessageCommonProblemService { |
| | | |
| | | /** |
| | | * 获取常见问题列表(不分页) |
| | | * @return |
| | | */ |
| | | List<AutomessageCommonProblem> selectList(); |
| | | } |
| | |
| | | package com.dg.core.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.dg.core.ResultData; |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | import org.springframework.data.repository.query.Param; |
| | | |
| | |
| | | */ |
| | | public int selectNum(String userType); |
| | | |
| | | /** |
| | | * 发送验证码(如果没有该用户则新建用户) |
| | | * |
| | | * @return 结果 |
| | | */ |
| | | ResultData smsSend(SysUser user); |
| | | |
| | | /** |
| | | * 验证码登录 |
| | | * |
| | | * @return 结果 |
| | | */ |
| | | ResultData loginByAccount(String phonenumber, String code); |
| | | |
| | | |
| | | } |
| | |
| | | package com.dg.core.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | import com.dg.core.db.gen.entity.TransactionEvent; |
| | | import com.dg.core.db.manual.pojo.QueryResults; |
| | | import com.dg.core.db.manual.pojo.RecommendResult; |
| | |
| | | * @param Id |
| | | * @return |
| | | */ |
| | | public TransactionEvent selectConfigData(String Id); |
| | | public TransactionEvent selectConfigData(String Id, SysUser sysUser); |
| | | |
| | | /** |
| | | * 导办事物列表 |
New file |
| | |
| | | package com.dg.core.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dg.core.db.gen.entity.AutomessageCommonProblem; |
| | | import com.dg.core.db.gen.mapper.AutomessageCommonProblemMapper; |
| | | import com.dg.core.service.IAutomessageCommonProblemService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class AutomessageCommonProblemServiceImpl extends ServiceImpl<AutomessageCommonProblemMapper, AutomessageCommonProblem> implements IAutomessageCommonProblemService { |
| | | |
| | | @Override |
| | | public List<AutomessageCommonProblem> selectList(){ |
| | | return baseMapper.selectList(new QueryWrapper<AutomessageCommonProblem>().lambda()); |
| | | } |
| | | } |
| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | |
| | | guideRepairOrderImage.setId(Snowflake.getId()); |
| | | guideRepairOrderImage.setGuideRepairOrderId(guideRepairOrder.getOrderNum()); |
| | | guideRepairOrderImage.setUrl(image); |
| | | guideRepairOrderImage.setCreateTime(LocalDateTime.now()); |
| | | guideRepairOrderImage.setType(1); |
| | | guideRepairOrderImageMapper.insert(guideRepairOrderImage); |
| | | } |
| | |
| | | guideRepairOrderImage.setId(Snowflake.getId()); |
| | | guideRepairOrderImage.setGuideRepairOrderId(guideRepairOrder.getOrderNum()); |
| | | guideRepairOrderImage.setUrl(guideRepairOrder.getVideo()); |
| | | guideRepairOrderImage.setCreateTime(LocalDateTime.now()); |
| | | guideRepairOrderImage.setType(2); |
| | | guideRepairOrderImageMapper.insert(guideRepairOrderImage); |
| | | } |
| | |
| | | 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.ResultData; |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | import com.dg.core.db.gen.mapper.SysUserMapper; |
| | | import com.dg.core.manager.TokenManager; |
| | | import com.dg.core.service.ISysUserService; |
| | | import com.dg.core.util.SmsUtil; |
| | | 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.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Service |
| | | public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements ISysUserService |
| | | { |
| | | |
| | | @Resource |
| | | SmsUtil smsUtil; |
| | | |
| | | @Resource |
| | | RedisTemplate<String, Object> redisTemplate; |
| | | |
| | | @Autowired |
| | | TokenManager tokenManager; |
| | | |
| | | @Override |
| | | public SysUser getUserById(Long id) { |
| | |
| | | } |
| | | |
| | | @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) + ""; |
| | | if (code.equals(code1)) { |
| | | SysUser 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()); |
| | | System.out.println("token "+token); |
| | | if (token == null) { |
| | | //生成一个token,保存用户登录状态 |
| | | token = tokenManager.createToken(sysUser.getUserId(), sysUser.getUserId()); |
| | | } |
| | | |
| | | sysUser.setLoginDate(LocalDateTime.now()); |
| | | //更新登录时间 |
| | | this.updateConfig(sysUser); |
| | | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("token", token); |
| | | map.put("userId", sysUser.getUserId()); |
| | | map.put("userName", sysUser.getUserName()); |
| | | |
| | | return ResultData.success(map); |
| | | } |
| | | else { |
| | | return ResultData.error("验证码错误"); |
| | | } |
| | | |
| | | } |
| | | return ResultData.error("验证码错误"); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public List<SysUser> selectConfigList(IPage<SysUser> page, Integer state,String userType) { |
| | | return baseMapper.selectConfigList(page, state,userType); |
| | | } |
| | |
| | | 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.KeywordEntity; |
| | | import com.dg.core.db.gen.entity.OrganizationChartEntity; |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | import com.dg.core.db.gen.entity.TransactionEvent; |
| | | import com.dg.core.db.gen.entity.*; |
| | | import com.dg.core.db.gen.mapper.AutomessageTransactionEventInterviewMapper; |
| | | import com.dg.core.db.gen.mapper.KeywordMapper; |
| | | import com.dg.core.db.gen.mapper.OrganizationChartMapper; |
| | | import com.dg.core.db.gen.mapper.TransactionEventMapper; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | |
| | | @Resource |
| | | private KeywordMapper keywordMapper; |
| | | |
| | | @Resource |
| | | private AutomessageTransactionEventInterviewMapper automessageTransactionEventInterviewMapper; |
| | | |
| | | @Override |
| | | public TransactionEvent selectConfigData(String Id) { |
| | | return baseMapper.selectConfigData(Id); |
| | | public TransactionEvent selectConfigData(String Id,SysUser sysUser) { |
| | | TransactionEvent transactionEvent = baseMapper.selectConfigData(Id); |
| | | LocalDateTime startTime = LocalDate.now().atTime(0, 0, 0); |
| | | LocalDateTime endTime = LocalDate.now().atTime(23, 59, 59); |
| | | AutomessageTransactionEventInterview automessageTransactionEventInterview = automessageTransactionEventInterviewMapper.selectOne(new QueryWrapper<AutomessageTransactionEventInterview>() |
| | | .lambda().eq(AutomessageTransactionEventInterview::getTransactionEventId, Id) |
| | | .eq(AutomessageTransactionEventInterview::getUserId, sysUser.getUserId()) |
| | | .orderByDesc(AutomessageTransactionEventInterview::getInterviewTime) |
| | | .last("limit 1")); |
| | | transactionEvent.setQueryTime(LocalDateTime.now()); |
| | | //判断上次访问时间是不是今天 如果 |
| | | if (automessageTransactionEventInterview==null||(!(transactionEvent.getQueryTime().isAfter(startTime)&&transactionEvent.getQueryTime().isBefore(endTime)))) { |
| | | transactionEvent.setBrowseNum(transactionEvent.getBrowseNum()+1); |
| | | baseMapper.updateById(transactionEvent); |
| | | AutomessageTransactionEventInterview automessageTransactionEventInterviewNew = |
| | | new AutomessageTransactionEventInterview(); |
| | | automessageTransactionEventInterviewNew.setTransactionEventId(Integer.valueOf(Id)); |
| | | automessageTransactionEventInterviewNew.setUserId(new Long(sysUser.getUserId())); |
| | | automessageTransactionEventInterviewNew.setInterviewTime(LocalDateTime.now()); |
| | | automessageTransactionEventInterviewMapper.insert(automessageTransactionEventInterviewNew); |
| | | } |
| | | return transactionEvent; |
| | | } |
| | | |
| | | @Override |
New file |
| | |
| | | package com.dg.core.util; |
| | | |
| | | import com.aliyuncs.CommonRequest; |
| | | import com.aliyuncs.CommonResponse; |
| | | import com.aliyuncs.DefaultAcsClient; |
| | | import com.aliyuncs.IAcsClient; |
| | | import com.aliyuncs.exceptions.ClientException; |
| | | import com.aliyuncs.http.MethodType; |
| | | import com.aliyuncs.profile.DefaultProfile; |
| | | import com.dg.core.AliyunConfig; |
| | | import com.dg.core.ResultData; |
| | | import com.fasterxml.jackson.core.JsonProcessingException; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.HashMap; |
| | | import java.util.Random; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | /** |
| | | * 阿里云短信工具类 |
| | | */ |
| | | @Component |
| | | public class SmsUtil { |
| | | |
| | | private static final Logger LOGGER = LoggerFactory.getLogger(SmsUtil.class); |
| | | |
| | | // 注入阿里云配置 |
| | | @Resource |
| | | AliyunConfig aliyunConfig; |
| | | |
| | | // 注入redisTemplate |
| | | @Resource |
| | | RedisTemplate<String, Object> redisTemplate; |
| | | |
| | | // 发送短信 |
| | | public ResultData<Object> sendSms(String tel) { |
| | | //cn-hangzhou 是阿里定义的签名固定值。填写阿里云申请短信签名的key和secret值 |
| | | DefaultProfile profile = DefaultProfile.getProfile("cn-hangzhou", aliyunConfig.getKey(), aliyunConfig.getScrect()); |
| | | /*阿里云提供的短信发送api的近期的相关代码,代码以最新的阿里api提供为准*/ |
| | | IAcsClient client = new DefaultAcsClient(profile); |
| | | CommonRequest request = new CommonRequest(); |
| | | request.setSysMethod(MethodType.POST); |
| | | request.setSysDomain("dysmsapi.aliyuncs.com"); |
| | | request.setSysVersion("2017-05-25"); |
| | | request.setSysAction("SendSms"); |
| | | request.putQueryParameter("RegionId", "cn-hangzhou"); |
| | | // 接收人电话 |
| | | request.putQueryParameter("PhoneNumbers", tel); |
| | | // 短信签名 |
| | | request.putQueryParameter("SignName", aliyunConfig.getSignName()); |
| | | // 短信模板 |
| | | request.putQueryParameter("TemplateCode", aliyunConfig.getTemplateCode()); |
| | | Random rd = new Random(); |
| | | int code = rd.nextInt(900000) + 100000; |
| | | // 短信内容 |
| | | request.putQueryParameter("TemplateParam", "{code:" + code + "}"); |
| | | // 获取短信发送的响应结果 |
| | | try { |
| | | CommonResponse rs = client.getCommonResponse(request); |
| | | LOGGER.debug(rs.getData().toString()); |
| | | // 把json格式的字符串装换成java的map的数据类型 |
| | | ObjectMapper mapper = new ObjectMapper(); |
| | | try { |
| | | HashMap<String, Object> m = mapper.readValue(rs.getData().toString(), HashMap.class); |
| | | if (m.get("Message").equals("OK")) { |
| | | redisTemplate.opsForValue().set(tel, code + "", 5, TimeUnit.MINUTES); |
| | | return ResultData.success("短信发送成功!"); |
| | | } |
| | | } catch (JsonProcessingException e) { |
| | | e.printStackTrace(); |
| | | return ResultData.error("短信发送失败"); |
| | | } |
| | | } catch (ClientException e) { |
| | | e.printStackTrace(); |
| | | return ResultData.error("短信发送失败"); |
| | | } |
| | | return ResultData.error("短信发送失败"); |
| | | } |
| | | } |
New file |
| | |
| | | #\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u01B6\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD |
| | | aliyun.key=LTAI4G3V2Ku9oaEMKyzaY93U |
| | | aliyun.screct=HJKHAl2I7ZGtoGK3t3xXahaQSEMmys |
| | | aliyun.SignName=\u84C9\u57CE\u9633\u5149 |
| | | aliyun.TemplateCode=SMS_205623177 |
| | | |
| | | |
| | | |
| | | |
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.AutomessageCommonProblemMapper"> |
| | | |
| | | </mapper> |
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.AutomessageTransactionEventInterviewMapper"> |
| | | |
| | | </mapper> |
| | |
| | | </select> |
| | | |
| | | <select id="selectSearch" resultType="com.dg.core.db.manual.pojo.Search"> |
| | | select title,content,views FROM( |
| | | select organization_name title,resume content,null views from automessage_organization_chart UNION |
| | | select matter_name title,concat((select classify_name from automessage_classify_administration |
| | | where id=(select parent_id from automessage_classify_administration where id=automessage_transaction_event.classify_id)), |
| | | '>',(select classify_name from automessage_classify_administration where id=automessage_transaction_event.classify_id)) content, |
| | | transaction_num views from automessage_transaction_event |
| | | ) k |
| | | select id,title,content,views, type FROM( |
| | | select id,organization_name title,resume content,null views,1 type from automessage_organization_chart UNION |
| | | select id,matter_name title,concat((select classify_name from automessage_classify_administration |
| | | where id=(select parent_id from automessage_classify_administration where id=automessage_transaction_event.classify_id)), |
| | | '>',(select classify_name from automessage_classify_administration where id=automessage_transaction_event.classify_id)) content, |
| | | transaction_num views,2 type from automessage_transaction_event |
| | | ) k |
| | | where k.title like concat('%',#{keyWord}, '%') or k.content like concat('%', #{keyWord}, '%') |
| | | </select> |
| | | |
| | | <select id="selectSearch" resultType="com.dg.core.db.manual.pojo.Search"> |
| | | select id,title,content,views, type FROM( |
| | | select id,organization_name title,resume content,null views,1 type from automessage_organization_chart UNION |
| | | select id,classify_name title,null content,null views,4 type from automessage_classify_administration UNION |
| | | select id,matter_name title,null content,transaction_num views,2 type from automessage_transaction_event |
| | | ) k |
| | | where k.title like concat('%',#{keyWord}, '%') or k.content like concat('%', #{keyWord}, '%') |
| | | </select> |
| | | |
| | | <select id="selectSearchAssociate" resultType="com.dg.core.db.manual.pojo.Search"> |
| | | select matter_name title,concat((select classify_name from automessage_classify_administration |
| | | select id,matter_name title,concat((select classify_name from automessage_classify_administration |
| | | where id=(select parent_id from automessage_classify_administration where id=automessage_transaction_event.classify_id)), |
| | | '>',(select classify_name from automessage_classify_administration where id=automessage_transaction_event.classify_id)) content, |
| | | transaction_num views from automessage_transaction_event where associate_names like concat('%',#{keyWord}, '%') |
| | | transaction_num views ,3 type from automessage_transaction_event where associate_names like concat('%',#{keyWord}, '%') |
| | | </select> |
| | | |
| | | |