Merge remote-tracking branch 'origin/huacheng_test' into huacheng_test
| | |
| | | wxUtil.sendGuideRepairOrderComplete(submitUser.getOpenid(),accessToken,guideRepairOrderCompleteTemplateId,order); |
| | | } |
| | | else if (order.getSubmitType().equals(2)){ |
| | | smsUtil.sendSmsComplete(order.getSubmitUserPhone(),order.getMatterName()); |
| | | smsUtil.sendSmsComplete(order.getConsultUserPhone(),order.getMatterName()); |
| | | } |
| | | //待评价 |
| | | order.setState("4"); |
| | |
| | | ResultData delete( @RequestParam(value = "id") Integer id){ |
| | | return iAutomessageCommonProblemService.delete(id); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取常见问题列表(分页) |
| | | * @param title |
| | | * @param content |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "获取常见问题列表(分页)(不加token)",response = AutomessageCommonProblem.class) |
| | | @GetMapping("/selectConfigListNoToken") |
| | | public TableDataInfo selectConfigListNoToken(@RequestParam(value = "pageNum",required = false) Integer pageNum, |
| | | @RequestParam(value = "pageSize",required = false) Integer pageSize, |
| | | @RequestParam(value = "title",required = false) String title, |
| | | @RequestParam(value = "content",required = false) String content){ |
| | | Page<AutomessageCommonProblem> pageParam = new Page<>(pageNum,pageSize); |
| | | List<AutomessageCommonProblem> list = iAutomessageCommonProblemService.selectConfigList(pageParam,pageSize,title,content); |
| | | int num=iAutomessageCommonProblemService.countAutomessageCommonProblem(title,content); |
| | | return getDataTable(list,num); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.dg.core.controller; |
| | | |
| | | import cn.hutool.core.date.DateTime; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.dg.core.CorsConfig; |
| | | import com.dg.core.ResultData; |
| | | import com.dg.core.db.gen.AjaxResult; |
| | | import com.dg.core.file.FtpConstants; |
| | | import com.dg.core.file.MimeTypeUtils; |
| | | import com.dg.core.file.SFTPUtil; |
| | | import com.dg.core.util.TestDate; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.InputStream; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | |
| | | |
| | | @Autowired |
| | | private CorsConfig corsConfig; |
| | | |
| | | |
| | | |
| | | // FTP 登录用户名 |
| | |
| | | return ResultData.error("上传文件失败 "+e.getMessage()); |
| | | } |
| | | |
| | | |
| | | // AjaxResult ajax = new AjaxResult(); |
| | | // ajax.put("urls", StringUtils.join(urls, FILE_DELIMETER)); |
| | | // ajax.put("fileNames", StringUtils.join(fileNames, FILE_DELIMETER)); |
| | | // ajax.put("originalFilenames", StringUtils.join(originalFilenames, FILE_DELIMETER)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 通用上传请求(多个) |
| | | */ |
| | | @ApiOperation("判断当前时间是否是工作日,格式为“2022-10-16”,不传默认为今天") |
| | | @GetMapping("/isWeekday") |
| | | public ResultData isWeekday(@RequestParam(value = "dateTime",required = false) String dateTime) |
| | | { |
| | | TestDate td=new TestDate(); |
| | | DateTime dateTimeUser; |
| | | if (dateTime==null) |
| | | dateTimeUser=DateTime.now(); |
| | | else{ |
| | | dateTimeUser=DateUtil.parse(dateTime); |
| | | } |
| | | if (td.isWeekday(dateTimeUser)) |
| | | return success("工作日"); |
| | | else |
| | | return success("休息日或者周末"); |
| | | } |
| | | |
| | | |
| | |
| | | wxUtil.sendGuideRepairOrderComplete(submitUser.getOpenid(),accessToken,guideRepairOrderCompleteTemplateId,order); |
| | | } |
| | | else if (order.getSubmitType().equals(2)){ |
| | | smsUtil.sendSmsComplete(order.getSubmitUserPhone(),order.getMatterName()); |
| | | smsUtil.sendSmsComplete(order.getConsultUserPhone(),order.getMatterName()); |
| | | } |
| | | order.setState("4"); |
| | | entity.setState("9"); |
| | |
| | | |
| | | import com.dg.core.ResultData; |
| | | import com.dg.core.db.gen.entity.*; |
| | | import com.dg.core.db.manual.pojo.AppletUserCount; |
| | | import com.dg.core.service.*; |
| | | import com.dg.core.util.TableDataInfo; |
| | | import io.swagger.annotations.Api; |
| | |
| | | @Autowired |
| | | IAreaCodeService iAreaCodeService; |
| | | |
| | | @Autowired |
| | | private ISysUserRecordService iSysUserRecordService; |
| | | |
| | | |
| | | @ApiOperation("首页统计不同状态工单数") |
| | | @GetMapping("/getWorkOrder") |
| | | public ResultData getWorkOrder() |
| | | public ResultData<WorkOrder> getWorkOrder() |
| | | { |
| | | WorkOrder workOrder=new WorkOrder(); |
| | | //状态(1待分配 2 待办结 3 已办结 4 待评价 5 已取消 6未解决 7已解决) |
| | |
| | | |
| | | @ApiOperation("首页统计不同时间段的工单数量") |
| | | @GetMapping("/getTimeWorkOrder") |
| | | public ResultData getTimeWorkOrder() |
| | | public ResultData<TimeWorkOrder> getTimeWorkOrder() |
| | | { |
| | | //1 今天 2昨天 3本月 4本年度 |
| | | //累计全部 本年 本月 今日 昨日 |
| | |
| | | |
| | | @ApiOperation("根据选择的时间段 筛选导办工单数 timeType:1 本年度 15 近15天的 30 近30天的") |
| | | @GetMapping("/getSelectionTimeOrder") |
| | | public ResultData getSelectionTimeOrder(@RequestParam("timeType") Integer timeType) |
| | | public ResultData<CountList> getSelectionTimeOrder(@RequestParam("timeType") Integer timeType) |
| | | { |
| | | if(timeType<1) |
| | | { |
| | |
| | | |
| | | @ApiOperation("获取效率比值") |
| | | @GetMapping("/getEfficiency") |
| | | public ResultData getEfficiency() |
| | | public ResultData<EfficiencyEntity> getEfficiency() |
| | | { |
| | | EfficiencyEntity entity=new EfficiencyEntity(); |
| | | //总工单数 |
| | |
| | | |
| | | @ApiOperation("工单 办事指南饼状图数据") |
| | | @GetMapping("/getPieChart") |
| | | public ResultData getPieChart() |
| | | public ResultData<PieChartAll> getPieChart() |
| | | { |
| | | PieChartAll pieChartAll=new PieChartAll(); |
| | | pieChartAll.setWorkOrderNum(iGuideRepairOrderService.countStatisticsNum("",null,null,null,null,null)+""); |
| | |
| | | |
| | | @ApiOperation("组织排行榜 type 1 安评价 2 按办结量") |
| | | @GetMapping("/getOrganization") |
| | | public TableDataInfo getOrganization(@RequestParam("type") String type) |
| | | public TableDataInfo<OrganizationEntity> getOrganization(@RequestParam("type") String type) |
| | | { |
| | | List<OrganizationEntity> guidePlates=homeStatisticsService.getDepartment(); |
| | | |
| | |
| | | |
| | | @ApiOperation("导办人员排行榜 type 1 安评价 2 按办结量 3 按超时") |
| | | @GetMapping("/getGuidePlate") |
| | | public TableDataInfo getGuidePlate(@RequestParam("type") String type) |
| | | public TableDataInfo<GuidePlate> getGuidePlate(@RequestParam("type") String type) |
| | | { |
| | | int allNum=homeStatisticsService.staffNum(); |
| | | |
| | |
| | | |
| | | @ApiOperation("办事指南排行榜 type 1 按浏览量 2 按办结量") |
| | | @GetMapping("/getGuidance") |
| | | public TableDataInfo getGuidance(@RequestParam("type") String type) |
| | | public TableDataInfo<Guidance> getGuidance(@RequestParam("type") String type) |
| | | { |
| | | int allNum=homeStatisticsService.countWork(); |
| | | if(StringUtils.equals("1",type)) |
| | |
| | | |
| | | @ApiOperation("导办工单按区域统计") |
| | | @GetMapping("/getRangeStatistics") |
| | | public TableDataInfo getRangeStatistics() |
| | | public TableDataInfo<RangeStatistics> getRangeStatistics() |
| | | { |
| | | List<AreaCode2022> code2022s=iAreaCodeService.getListByPCode("510400000000"); |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 小程序用户访问量统计1.累计访问量2.本年访问量 3.本月访问量 4.今日访问量 5.昨日访问 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "小程序用户访问量统计1.累计访问量2.本年访问量 3.本月访问量 4.今日访问量 5.昨日访问",response = AppletUserCount.class) |
| | | @GetMapping("/selectUserRecordCount") |
| | | public ResultData selectUserRecordCount(){ |
| | | return iSysUserRecordService.selectUserRecordCount(); |
| | | } |
| | | |
| | | /** |
| | | * 小程序用户访问量统计1.近15天 2.近30天 3.近一年 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "小程序用户访问量统计1.近15天 2.近30天 3.近一年",response = AppletUserCount.class) |
| | | @GetMapping("/selectByDateType") |
| | | public ResultData selectByDateType(@RequestParam("dateType") Integer dateType){ |
| | | return iSysUserRecordService.selectByDateType(dateType); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | |
| | | public ResultData updateConfig(@RequestBody OrganizationChartEntity entity,@CurrentUser SysUser sysUser) |
| | | { |
| | | entity.setUpdateTime(LocalDateTime.now()); |
| | | entity.setUpdateUserId(Integer.parseInt(String.valueOf(sysUser.getUserId()))); |
| | | entity.setUpdateUserId(sysUser.getUserId()); |
| | | return toAjax(iOrganizationChartService.updateConfig(entity)); |
| | | } |
| | | |
| | |
| | | return ResultData.error("事件名称不能为空"); |
| | | } |
| | | |
| | | |
| | | |
| | | return toAjax(iTransactionEventService.updateConfig(entity)); |
| | | } |
| | | |
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.annotation.JsonFormat; |
| | | 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-10-15 |
| | | */ |
| | | @TableName("automessage_sys_user_record") |
| | | @Data |
| | | @ApiModel("用户访问记录类") |
| | | public class AutomessageSysUserRecord implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @ApiModelProperty("主键") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 用户id |
| | | */ |
| | | @ApiModelProperty("用户id") |
| | | private Long userId; |
| | | |
| | | /** |
| | | * 访问时间 |
| | | */ |
| | | @ApiModelProperty("访问时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | | * 进入方式(1.扫码进入 2.花城进入 3.分享进入) |
| | | */ |
| | | @ApiModelProperty("进入方式(1.扫码进入 2.花城进入 3.分享进入)") |
| | | private Integer joinType; |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(name = "serviceState", value = "服务状态(1.已解决 2.未解决)") |
| | | private Integer serviceState; |
| | | |
| | | /** |
| | | * 超时时间 |
| | | */ |
| | | @ApiModelProperty("超时时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime timeoutTime; |
| | | |
| | | /** |
| | | * 是否推送过(1 是 2 否) |
| | | */ |
| | | @ApiModelProperty("是否推送过(1 是 2 否)") |
| | | private Integer isPush; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(name = "sumClassifyName", value = "完整分类名称") |
| | | private String sumClassifyName; |
| | |
| | | * 修改人 |
| | | */ |
| | | @ApiModelProperty("修改人") |
| | | private Integer updateUserId; |
| | | private Long updateUserId; |
| | | |
| | | /** |
| | | * 修改人 |
| | |
| | | /** |
| | | * 导办工单统计类 |
| | | */ |
| | | |
| | | @ApiModel("不同时间段的工单数量") |
| | | @Data |
| | | public class TimeWorkOrder implements Serializable |
| | |
| | | @ApiModelProperty("部门所属区域") |
| | | private String departmentArea; |
| | | |
| | | /** |
| | | * 部门电话 |
| | | */ |
| | | @TableField(exist = false) |
| | | @ApiModelProperty("部门电话") |
| | | private String contactNumber; |
| | | |
| | | /** |
| | | * 分类id |
| | | */ |
New file |
| | |
| | | package com.dg.core.db.gen.mapper; |
| | | |
| | | import com.dg.core.db.gen.entity.AutomessageSysUserRecord; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dg.core.db.manual.pojo.AppletUserCount; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author fengjin |
| | | * @since 2022-10-15 |
| | | */ |
| | | public interface AutomessageSysUserRecordMapper extends BaseMapper<AutomessageSysUserRecord> { |
| | | |
| | | /** |
| | | * 小程序用户访问量统计1.累计访问量2.本年访问量 3.本月访问量 4.今日访问量 5.昨日访问 |
| | | * @return |
| | | */ |
| | | List<AppletUserCount> selectUserRecordCount(); |
| | | |
| | | /** |
| | | * 小程序用户访问量统计近15天 |
| | | * @return |
| | | */ |
| | | List<AppletUserCount> selectByDay(); |
| | | |
| | | /** |
| | | * 小程序用户访问量统计近30天 |
| | | * @return |
| | | */ |
| | | List<AppletUserCount> selectByMonth(); |
| | | |
| | | /** |
| | | * 小程序用户访问量统计近一年 |
| | | * @return |
| | | */ |
| | | List<AppletUserCount> selectByYear(); |
| | | |
| | | } |
| | |
| | | List<TransactionEvent> queryMatterNameList(@Param("matterName") String matterName,@Param("classifyId") String classifyId); |
| | | |
| | | /** |
| | | * 导办事务搜索(不带分页)(关联词) |
| | | * @param associateNames |
| | | * @return |
| | | */ |
| | | List<TransactionEvent> queryAssociateNamesList(@Param("associateNames") String associateNames,@Param("classifyId") String classifyId); |
| | | |
| | | /** |
| | | * 导办事务搜索统计数量 |
| | | * @param matterName |
| | | * @return |
| | |
| | | }) |
| | | .strategyConfig(builder -> { |
| | | // builder.addInclude(""); |
| | | builder.addInclude("automessage_sys_settings_record") // 设置需要生成的表名 |
| | | builder.addInclude("automessage_sys_user_record") // 设置需要生成的表名 |
| | | .addTablePrefix("t_", "c_"); // 设置过滤表前缀 |
| | | }) |
| | | .templateConfig(builder -> { |
New file |
| | |
| | | package com.dg.core.db.manual.pojo; |
| | | |
| | | import com.dg.core.annotation.Authorization; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @ApiModel("小程序用户统计结果") |
| | | @Data |
| | | public class AppletUserCount { |
| | | |
| | | @ApiModelProperty("日期,可以是月也可以是日") |
| | | private String date; |
| | | |
| | | @ApiModelProperty("访问量") |
| | | private Long visits; |
| | | |
| | | @ApiModelProperty("类型1.累计访问量2.本年访问量 3.本月访问量 4.今日访问量 5.昨日访问量") |
| | | private Integer type; |
| | | } |
| | |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | import com.dg.core.manager.TokenManager; |
| | | import com.dg.core.service.IHuaChengSysUserService; |
| | | import com.dg.core.service.ISysUserRecordService; |
| | | import org.apache.catalina.connector.ResponseFacade; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | @Autowired |
| | | IHuaChengSysUserService iHuaChengSysUserService; |
| | | |
| | | @Autowired |
| | | private ISysUserRecordService iSysUserRecordService; |
| | | |
| | | @Override |
| | | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { |
| | | //如果不是映射到方法直接通过 |
| | |
| | | |
| | | 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)+"",null); |
| | | if(ss==null && ss.getUserId()<0) |
| | | HuaChengSysUser huaChengSysUser=iHuaChengSysUserService.selectData(manager.getHCUserId(HCtoken)+"","",""); |
| | | if(huaChengSysUser!=null && huaChengSysUser.getUserId()!=0 ) |
| | | { |
| | | HuaChengSysUser huaChengSysUser=iHuaChengSysUserService.selectData(manager.getHCUserId(HCtoken)+"","",""); |
| | | if(huaChengSysUser!=null && huaChengSysUser.getUserId()<0 ) |
| | | SysUser sysUser = IUserService.selectData(null,huaChengSysUser.getPhone()); |
| | | if(sysUser==null) |
| | | { |
| | | //本地没有此用户 新用户 |
| | | SysUser newSysUser=new SysUser(); |
| | |
| | | newSysUser.setOpenid(huaChengSysUser.getOpenid()); |
| | | IUserService.insertConfig(newSysUser); |
| | | } |
| | | iSysUserRecordService.add(sysUser); |
| | | } |
| | | |
| | | return true; |
| | | } |
| | | |
| | |
| | | |
| | | import com.dg.core.Constant; |
| | | import com.dg.core.annotation.CurrentUser; |
| | | import com.dg.core.db.gen.entity.HuaChengSysUser; |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | import com.dg.core.service.IHuaChengSysUserService; |
| | | import com.dg.core.service.ISysUserService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.core.MethodParameter; |
| | |
| | | @Autowired |
| | | private ISysUserService userService; |
| | | |
| | | /** |
| | | * 花城e+用户接口 |
| | | */ |
| | | @Autowired |
| | | IHuaChengSysUserService iHuaChengSysUserService; |
| | | |
| | | @Override |
| | | public boolean supportsParameter(MethodParameter parameter) { |
| | | //如果参数类型是User并且有CurrentUser注解则支持 |
| | |
| | | Long currentUserId = (Long) webRequest.getAttribute(Constant.CURRENT_USER_ID, RequestAttributes.SCOPE_REQUEST); |
| | | if (currentUserId != null) { |
| | | //从数据库中查询并返回 |
| | | return userService.selectData(currentUserId+"",null); |
| | | SysUser sysUser=userService.selectData(currentUserId+"",null); |
| | | if(sysUser!=null) |
| | | { |
| | | return sysUser; |
| | | } |
| | | |
| | | HuaChengSysUser huaChengSysUser=iHuaChengSysUserService.selectData(currentUserId+"","",""); |
| | | if(huaChengSysUser!=null) |
| | | { |
| | | sysUser=userService.selectData(null,huaChengSysUser.getPhone()); |
| | | if(sysUser!=null) |
| | | { |
| | | return sysUser; |
| | | } |
| | | } |
| | | } |
| | | return null; |
| | | // throw new MissingServletRequestPartException(Constant.CURRENT_USER_ID); |
New file |
| | |
| | | package com.dg.core.service; |
| | | |
| | | import com.dg.core.ResultData; |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | |
| | | |
| | | public interface ISysUserRecordService { |
| | | |
| | | /** |
| | | * 增加用户访问记录 |
| | | * |
| | | * @return 参数配置信息 |
| | | */ |
| | | ResultData add(SysUser sysUser); |
| | | |
| | | |
| | | /** |
| | | * 小程序用户访问量统计1.累计访问量2.本年访问量 3.本月访问量 4.今日访问量 5.昨日访问 |
| | | * @return |
| | | */ |
| | | ResultData selectUserRecordCount(); |
| | | |
| | | /** |
| | | * 小程序用户访问量统计1.近15天 2.近30天 3.近一年 |
| | | * @return |
| | | */ |
| | | ResultData selectByDateType(Integer dateType); |
| | | } |
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.ResultData; |
| | | import com.dg.core.db.gen.entity.AutomessageSysUserRecord; |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | import com.dg.core.db.gen.mapper.AutomessageSysUserRecordMapper; |
| | | import com.dg.core.db.gen.mapper.SysUserMapper; |
| | | import com.dg.core.service.ISysUserRecordService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Service |
| | | public class SysUserRecordServiceImpl extends ServiceImpl<AutomessageSysUserRecordMapper, AutomessageSysUserRecord> implements ISysUserRecordService { |
| | | |
| | | @Resource |
| | | private SysUserMapper sysUserMapper; |
| | | |
| | | @Override |
| | | public ResultData add(SysUser sysUser){ |
| | | if (sysUser!=null){ |
| | | LocalDateTime startTime = LocalDate.now().atTime(0, 0, 0); |
| | | LocalDateTime endTime = LocalDate.now().atTime(23, 59, 59); |
| | | AutomessageSysUserRecord automessageSysUserRecord = baseMapper.selectOne(new QueryWrapper<AutomessageSysUserRecord>() |
| | | .lambda().eq(AutomessageSysUserRecord::getUserId, sysUser.getUserId()) |
| | | .orderByDesc(AutomessageSysUserRecord::getCreateTime) |
| | | .last("limit 1")); |
| | | //判断上次访问时间是不是今天 如果是今天不增加浏览次数 |
| | | if (automessageSysUserRecord==null||(!(automessageSysUserRecord.getCreateTime().isAfter(startTime)&&automessageSysUserRecord.getCreateTime().isBefore(endTime)))) { |
| | | AutomessageSysUserRecord automessageSysUserRecordNew = new AutomessageSysUserRecord(); |
| | | automessageSysUserRecordNew.setUserId(sysUser.getUserId()); |
| | | automessageSysUserRecordNew.setCreateTime(LocalDateTime.now()); |
| | | sysUser.setLoginDate(LocalDateTime.now()); |
| | | sysUserMapper.updateById(sysUser); |
| | | return ResultData.success(baseMapper.insert(automessageSysUserRecordNew)); |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public ResultData selectUserRecordCount() { |
| | | return ResultData.success(baseMapper.selectUserRecordCount()); |
| | | } |
| | | |
| | | @Override |
| | | public ResultData selectByDateType(Integer dateType) { |
| | | if (dateType.equals(1)) |
| | | return ResultData.success(baseMapper.selectByDay()); |
| | | if (dateType.equals(2)) |
| | | return ResultData.success(baseMapper.selectByMonth()); |
| | | if (dateType.equals(3)) |
| | | return ResultData.success(baseMapper.selectByYear()); |
| | | return null; |
| | | } |
| | | |
| | | } |
| | |
| | | queryResults.setSearchList(searches); |
| | | List<Search> searchesAssociate = baseMapper.selectSearchAssociateDistinct(keyWord); |
| | | for (Search search:searchesAssociate) { |
| | | search.setTransactionEventList(baseMapper.queryMatterNameList(keyWord,search.getClassifyId().toString())); |
| | | search.setTransactionEventList(baseMapper.queryAssociateNamesList(keyWord,search.getClassifyId().toString())); |
| | | } |
| | | queryResults.setTransactionEventList(searchesAssociate); |
| | | queryResults.setKeywordEntityList( keywordMapper.selectByName(keyWord)); |
| | |
| | | package com.dg.core.util; |
| | | |
| | | import com.dg.core.ResultData; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class TableDataInfo implements Serializable |
| | | public class TableDataInfo<T> implements Serializable |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | |
| | | private long total; |
| | | |
| | | /** 列表数据 */ |
| | | private List<?> rows; |
| | | private List<T> rows; |
| | | |
| | | /** 消息状态码 */ |
| | | private int result; |
| | |
| | | * @param list 列表数据 |
| | | * @param total 总记录数 |
| | | */ |
| | | public TableDataInfo(List<?> list, long total) |
| | | public TableDataInfo(List<T> list, long total) |
| | | { |
| | | this.rows = list; |
| | | this.total = total; |
| | |
| | | this.total = total; |
| | | } |
| | | |
| | | public List<?> getRows() |
| | | public List<T> getRows() |
| | | { |
| | | return rows; |
| | | } |
| | | |
| | | public void setRows(List<?> rows) |
| | | public void setRows(List<T> rows) |
| | | { |
| | | this.rows = rows; |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 工单超时推送 |
| | | * |
| | | * @param openId |
| | | * 用户openid |
| | | * @param accessToken |
| | | * token会话标识 |
| | | */ |
| | | public void sendGuideRepairOrderOvertime(String openId, String accessToken, String templateId, GuideRepairOrder guideRepairOrder){ |
| | | WxSubscribeDTO subscribeDTO = new WxSubscribeDTO(); |
| | | subscribeDTO.setTouser(openId); |
| | | subscribeDTO.setTemplate_id(templateId); |
| | | subscribeDTO.setMiniprogram_state("formal");//测试,部署正式版本时候需要更改为formal |
| | | List<TemplateParam> paras=new ArrayList<TemplateParam>(); |
| | | Calendar calendar = Calendar.getInstance(); |
| | | paras.add(new TemplateParam("thing4","给您分配的工单:'"+guideRepairOrder.getMatterName()+"',已超时请即使处理"));//超时提示内容 |
| | | paras.add(new TemplateParam("thing2",guideRepairOrder.getConsultUserName()));//咨询人 |
| | | paras.add(new TemplateParam("thing3",guideRepairOrder.getConsultContent()));//咨询内容 |
| | | subscribeDTO.setTemplateParamList(paras); |
| | | try { |
| | | sendSubscribe(accessToken,subscribeDTO); |
| | | }catch (Exception e){ |
| | | System.out.println(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | } |
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.AutomessageSysUserRecordMapper"> |
| | | <resultMap type="com.dg.core.db.gen.entity.AutomessageSysUserRecord" id="AutomessageSysUserRecordResult"> |
| | | <id property="id" column="id" /> |
| | | <id property="userId" column="user_id" /> |
| | | <id property="createTime" column="create_time" /> |
| | | <id property="joinType" column="join_type" /> |
| | | </resultMap> |
| | | |
| | | <sql id="selectAgreement"> |
| | | select id,user_id, |
| | | (select user_name from automessage_sys_user where user_id=a.user_id)userName, |
| | | create_time,join_type FROM automessage_sys_user_record a |
| | | </sql> |
| | | <!-- 小程序用户访问量统计1.累计访问量2.本年访问量 3.本月访问量 4.今日访问量 5.昨日访问--> |
| | | <select id="selectUserRecordCount" resultType="com.dg.core.db.manual.pojo.AppletUserCount"> |
| | | select count(*)visits,1 type from automessage_sys_user_record UNION |
| | | select count(*)visits,2 type from automessage_sys_user_record where year(create_time)=year(SYSDATE()) UNION |
| | | select count(*)visits,3 type from automessage_sys_user_record where DATE_FORMAT(create_time, '%Y%m' ) = DATE_FORMAT( CURDATE( ) ,'%Y%m' ) UNION |
| | | select count(*)visits,4 type from automessage_sys_user_record where to_days(create_time) = to_days(now()) UNION |
| | | select count(*)visits,5 type from automessage_sys_user_record where TO_DAYS( SYSDATE() ) - TO_DAYS(create_time) = 1 |
| | | </select> |
| | | |
| | | <select id="selectByDay" resultType="com.dg.core.db.manual.pojo.AppletUserCount"> |
| | | select d.date, IFNULL(T.score,0) visits from |
| | | ( |
| | | SELECT CURDATE() AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 1 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 2 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 3 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 4 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 5 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 6 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 7 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 8 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 9 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 10 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 11 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 12 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 13 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 14 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 15 DAY) AS date |
| | | ) d |
| | | left join( |
| | | select DATE_FORMAT(create_time,'%Y-%m-%d')create_time, COUNT(*) as score |
| | | from automessage_sys_user_record |
| | | group by DATE_FORMAT(create_time,'%Y-%m-%d') |
| | | ) T on T.create_time = d.date |
| | | GROUP BY d.date |
| | | </select> |
| | | |
| | | <select id="selectByMonth" resultType="com.dg.core.db.manual.pojo.AppletUserCount"> |
| | | select d.date, IFNULL(T.score,0) visits from |
| | | ( |
| | | SELECT CURDATE() AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 1 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 2 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 3 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 4 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 5 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 6 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 7 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 8 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 9 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 10 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 11 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 12 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 13 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 14 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 15 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 16 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 17 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 18 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 19 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 20 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 21 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 22 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 23 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 24 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 25 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 26 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 27 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 28 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 29 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 30 DAY) AS date |
| | | ) d |
| | | left join( |
| | | select DATE_FORMAT(create_time,'%Y-%m-%d')create_time, COUNT(*) as score |
| | | from automessage_sys_user_record |
| | | group by DATE_FORMAT(create_time,'%Y-%m-%d') |
| | | ) T on T.create_time = d.date |
| | | GROUP BY d.date |
| | | </select> |
| | | |
| | | <select id="selectByYear" resultType="com.dg.core.db.manual.pojo.AppletUserCount"> |
| | | select d.date, IFNULL(T.score,0) visits from |
| | | ( |
| | | SELECT DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 11 month),"%Y-%m") date UNION |
| | | SELECT DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 10 month),"%Y-%m") date UNION |
| | | SELECT DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 9 month),"%Y-%m") date UNION |
| | | SELECT DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 8 month),"%Y-%m") date UNION |
| | | SELECT DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 7 month),"%Y-%m") date UNION |
| | | SELECT DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 6 month),"%Y-%m") date UNION |
| | | SELECT DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 5 month),"%Y-%m") date UNION |
| | | SELECT DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 4 month),"%Y-%m") date UNION |
| | | SELECT DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 3 month),"%Y-%m") date UNION |
| | | SELECT DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 2 month),"%Y-%m") date UNION |
| | | SELECT DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 month),"%Y-%m") date UNION |
| | | select DATE_FORMAT(NOW(),"%Y-%m") FROM DUAL |
| | | ) d |
| | | left join( |
| | | select DATE_FORMAT(create_time,'%Y-%m')create_time, COUNT(*) as score |
| | | from automessage_sys_user_record |
| | | group by DATE_FORMAT(create_time,'%Y-%m') |
| | | ) T on T.create_time = d.date |
| | | GROUP BY d.date |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <select id="selectByKeyWord" resultMap="OrganizationChartResult"> |
| | | <include refid="selectOrganizationChartVo"/> |
| | | where organization_name like concat('%', #{keyWord}, '%') or #{keyWord} like concat('%', organization_name, '%') |
| | | or detailed_address like concat('%', #{keyWord}, '%') or #{keyWord} like concat('%', detailed_address, '%') |
| | | or resume like concat('%', #{keyWord}, '%') or #{keyWord} like concat('%', resume, '%') |
| | | or((detailed_address like concat('%', #{keyWord}, '%') or #{keyWord} like concat('%', detailed_address, '%')) and TRIM(detailed_address) != '') |
| | | or((resume like concat('%', #{keyWord}, '%') or #{keyWord} like concat('%', resume, '%')) and TRIM(resume) != '' ) |
| | | </select> |
| | | |
| | | <select id="selectByCode" resultMap="OrganizationChartResult"> |
| | |
| | | <include refid="selectSysUserVo"/> |
| | | <where> |
| | | user_type=#{userType} |
| | | <if test="keyWord!=null and keyWord!=''"> |
| | | and (transaction_names like concat('%',#{keyWord}, '%') or user_name like concat('%',#{keyWord}, '%')) |
| | | </if> |
| | | </where> |
| | | ORDER BY department_id |
| | | </select> |
| | |
| | | SELECT |
| | | id, |
| | | department_id, |
| | | department_area, |
| | | (select detailed_address from automessage_organization_chart |
| | | where automessage_organization_chart.id=department_id) department_area, |
| | | (select contact_number from automessage_organization_chart where automessage_organization_chart.id=department_id) as contactNumber, |
| | | classify_id, |
| | | matter_name, |
| | | associate_ids, |
| | |
| | | order by create_time desc |
| | | </select> |
| | | |
| | | <select id="queryAssociateNamesList" resultMap="TransactionEventEntityResult"> |
| | | <include refid="selectTransactionEventEntityVo"/> |
| | | <where> |
| | | <if test="associateNames != null and associateNames != ''"> |
| | | AND (associate_names like concat('%', #{associateNames}, '%') or #{associateNames} like concat('%', associate_names, '%')) |
| | | </if> |
| | | <if test="classifyId != null and classifyId != ''"> |
| | | and (classify_id= #{classifyId} or classify_id in (select id FROM automessage_classify_administration where parent_id =#{classifyId} )) |
| | | </if> |
| | | |
| | | </where> |
| | | order by create_time desc |
| | | </select> |
| | | |
| | | <select id="sumTransactionNum" resultMap="TransactionEventEntityResult"> |
| | | select sum(transaction_num)sumTransactionNum,count(*) counttransaction FROM automessage_transaction_event |
| | | </select> |