Merge remote-tracking branch 'origin/huacheng_test' into huacheng_test
| | |
| | | @Value("${aliyun.TemplateCode}") |
| | | private String TemplateCode; |
| | | |
| | | @Value("${aliyun.TemplateCodeOvertime}") |
| | | private String TemplateCodeOvertime; |
| | | |
| | | @Value("${aliyun.TemplateCodeComplete}") |
| | | private String TemplateCodeComplete; |
| | | |
| | | |
| | | public String getKey() { |
| | | return key; |
| | | } |
| | | |
| | | public String getTemplateCodeComplete() { |
| | | return TemplateCodeComplete; |
| | | } |
| | | |
| | | public void setTemplateCodeComplete(String templateCodeComplete) { |
| | | TemplateCodeComplete = templateCodeComplete; |
| | | } |
| | | |
| | | public void setKey(String key) { |
| | | this.key = key; |
| | | } |
| | | |
| | | public String getTemplateCodeOvertime() { |
| | | return TemplateCodeOvertime; |
| | | } |
| | | |
| | | public void setTemplateCodeOvertime(String templateCodeOvertime) { |
| | | TemplateCodeOvertime = templateCodeOvertime; |
| | | } |
| | | |
| | | public String getScrect() { |
| | | return screct; |
| | | } |
| | |
| | | */ |
| | | @ApiOperation(value = "获取常见问题列表(不分页查找)",response = AutomessageCommonProblem.class) |
| | | @GetMapping("/queryList") |
| | | public ResultData queryList(@RequestParam(value = "title") String title){ |
| | | public ResultData queryList(@RequestParam(value = "title",required = false) String title){ |
| | | return ResultData.success(iAutomessageCommonProblemService.selectConfigList(title,null)); |
| | | } |
| | | |
| | |
| | | package com.dg.core.api; |
| | | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.dg.core.ResultData; |
| | | import com.dg.core.annotation.Authorization; |
| | | import com.dg.core.annotation.CurrentUser; |
| | |
| | | import com.dg.core.db.gen.entity.GuideEvolveEntity; |
| | | import com.dg.core.db.gen.entity.GuideRepairOrder; |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | import com.dg.core.db.manual.mapper.util.ConstantPropertiesUtil; |
| | | import com.dg.core.service.IGuideEvolveService; |
| | | import com.dg.core.service.IGuideRepairOrderService; |
| | | import com.dg.core.util.SmsUtil; |
| | | import com.dg.core.util.WxUtil; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.commons.lang3.StringUtils; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.IOException; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Map; |
| | | |
| | | import static com.dg.core.util.WxUtil.httpGet; |
| | | |
| | | |
| | | /** |
| | | * 工单管理 |
| | |
| | | @Autowired |
| | | private IGuideEvolveService iGuideEvolveService; |
| | | |
| | | private static String guideRepairOrderCompleteTemplateId = "7ZCHHii87rWPwVkdhZnvNiYbYi_Buq0NXO10cmUhAFk"; |
| | | |
| | | @Resource |
| | | SmsUtil smsUtil; |
| | | |
| | | /** |
| | | * 提交导办订单 |
| | | * @return |
| | |
| | | public ResultData addOrder(@RequestBody GuideRepairOrder guideRepairOrder,@CurrentUser SysUser sysUser) { |
| | | guideRepairOrder.setSubmitUserId(sysUser.getUserId().toString()); |
| | | guideRepairOrder.setSubmitUserPhone(sysUser.getPhonenumber()); |
| | | guideRepairOrder.setSubmitType(1); |
| | | int i = iGuideRepairOrderService.addOrder(guideRepairOrder); |
| | | if (i>0){ |
| | | iGuideEvolveService.updateGuid(); |
| | |
| | | entity.setState("8"); |
| | | } |
| | | else if(StringUtils.equals(entity.getState(),"4")){ |
| | | if (order.getSubmitType().equals(1))//小程序提交 |
| | | { |
| | | WxUtil wxUtil=new WxUtil(); |
| | | String accessToken="0"; |
| | | try { |
| | | accessToken= wxUtil.getBatteryCarAccessToken(); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | SysUser submitUser = iGuideRepairOrderService.getSubmitUser(order); |
| | | wxUtil.sendGuideRepairOrderComplete(submitUser.getOpenid(),accessToken,guideRepairOrderCompleteTemplateId,order); |
| | | } |
| | | else if (order.getSubmitType().equals(2)){ |
| | | smsUtil.sendSmsComplete(order.getSubmitUserPhone(),order.getMatterName()); |
| | | } |
| | | //待评价 |
| | | order.setState("4"); |
| | | entity.setState("9"); |
| | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | import com.dg.core.service.IGuideEvolveService; |
| | | import com.dg.core.service.IGuideRepairOrderService; |
| | | import com.dg.core.service.IOrganizationChartService; |
| | | import com.dg.core.util.SmsUtil; |
| | | import com.dg.core.util.TableDataInfo; |
| | | import com.dg.core.util.WxUtil; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.commons.lang3.StringUtils; |
| | |
| | | @Autowired |
| | | IOrganizationChartService iOrganizationChartService; |
| | | |
| | | private static String guideRepairOrderCompleteTemplateId = "7ZCHHii87rWPwVkdhZnvNiYbYi_Buq0NXO10cmUhAFk"; |
| | | |
| | | |
| | | @Resource |
| | | SmsUtil smsUtil; |
| | | |
| | | |
| | | /** |
| | | * 提交导办订单 |
| | | * @return |
| | |
| | | guideRepairOrder.setSubmitUserId(sysUser.getUserId().toString()); |
| | | guideRepairOrder.setSubmitUserPhone(sysUser.getPhonenumber()); |
| | | guideRepairOrder.setSubmitUserPhone(sysUser.getPhonenumber()); |
| | | guideRepairOrder.setSubmitType(2); |
| | | int i = iGuideRepairOrderService.addOrder(guideRepairOrder); |
| | | if (i>0){ |
| | | iGuideEvolveService.updateGuid(); |
| | |
| | | } |
| | | else if(StringUtils.equals(entity.getState(),"4")){ |
| | | //待评价 |
| | | if (order.getSubmitType().equals(1))//小程序提交 |
| | | { |
| | | WxUtil wxUtil=new WxUtil(); |
| | | String accessToken="0"; |
| | | try { |
| | | accessToken= wxUtil.getBatteryCarAccessToken(); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | SysUser submitUser = iGuideRepairOrderService.getSubmitUser(order); |
| | | wxUtil.sendGuideRepairOrderComplete(submitUser.getOpenid(),accessToken,guideRepairOrderCompleteTemplateId,order); |
| | | } |
| | | else if (order.getSubmitType().equals(2)){ |
| | | smsUtil.sendSmsComplete(order.getSubmitUserPhone(),order.getMatterName()); |
| | | } |
| | | order.setState("4"); |
| | | entity.setState("9"); |
| | | } |
| | |
| | | |
| | | import com.dg.core.ResultData; |
| | | import com.dg.core.db.gen.entity.*; |
| | | import com.dg.core.service.IClassifyAdministrationService; |
| | | import com.dg.core.service.IGuideEvolveService; |
| | | import com.dg.core.service.IGuideRepairOrderService; |
| | | import com.dg.core.service.ITransactionEventService; |
| | | import com.dg.core.service.*; |
| | | 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.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Calendar; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | |
| | | @Api(tags = {"首页统计接口"}) |
| | | @RestController |
| | | @RequestMapping("/Home") |
| | | public class HomeStatisticsController |
| | | public class HomeStatisticsController extends BaseController |
| | | { |
| | | //导办工单接口 |
| | | @Autowired |
| | |
| | | |
| | | @Autowired |
| | | ITransactionEventService iTransactionEventService; |
| | | |
| | | @Autowired |
| | | HomeStatisticsService homeStatisticsService; |
| | | |
| | | |
| | | @Autowired |
| | | com.dg.core.service.ISysUserService IUserService; |
| | | |
| | | |
| | | @Autowired |
| | | IOrganizationChartService iOrganizationChartService; |
| | | |
| | | |
| | | @ApiOperation("首页统计不同状态工单数") |
| | | @GetMapping("/getWorkOrder") |
| | |
| | | } |
| | | |
| | | |
| | | @ApiOperation("组织排行榜") |
| | | |
| | | |
| | | |
| | | @ApiOperation("组织排行榜 type 1 安评价 2 按办结量") |
| | | @GetMapping("/getOrganization") |
| | | public ResultData getOrganization() |
| | | public TableDataInfo getOrganization(@RequestParam("type") String type) |
| | | { |
| | | List<OrganizationEntity> guidePlates=homeStatisticsService.getDepartment(); |
| | | |
| | | if(StringUtils.equals("1",type)) |
| | | { |
| | | for (OrganizationEntity bean:guidePlates) |
| | | { |
| | | bean.setNum(0+""); |
| | | List<String> ids=iOrganizationChartService.getIds(bean.getId()+""); |
| | | |
| | | return ResultData.success(); |
| | | //总评分 |
| | | String scoreNum=homeStatisticsService.organizationScore(ids)+""; |
| | | int score=0; |
| | | if(!StringUtils.isEmpty(scoreNum) && !StringUtils.equals("null",scoreNum)) |
| | | { |
| | | score=Integer.valueOf(scoreNum); |
| | | } |
| | | |
| | | //总数量 |
| | | int allNum=homeStatisticsService.organizationNum(ids); |
| | | |
| | | if(allNum>0 && score>0) |
| | | { |
| | | java.text.DecimalFormat weekDf=new java.text.DecimalFormat("##.##");//传入格式模板 |
| | | String workEfficiency=weekDf.format((float)(score/allNum)); |
| | | bean.setNum(workEfficiency); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | for (OrganizationEntity bean:guidePlates) |
| | | { |
| | | bean.setNum(0+""); |
| | | List<String> ids=iOrganizationChartService.getIds(bean.getId()+""); |
| | | //总数量 |
| | | int allNum=homeStatisticsService.organizationNum(ids); |
| | | if(allNum>0) |
| | | { |
| | | bean.setNum(allNum+""); |
| | | } |
| | | } |
| | | } |
| | | |
| | | OrganizationEntity entity=null; |
| | | for(int i = 0 ;i< guidePlates.size() -1; i++) { |
| | | for (int j = 0; j < guidePlates.size() - 1 - i; j++) { |
| | | |
| | | if(Float.valueOf(guidePlates.get(j).getNum())>Float.valueOf(guidePlates.get(j+1).getNum())) |
| | | { |
| | | entity=guidePlates.get(j); |
| | | guidePlates.set(j,guidePlates.get(j+1)); |
| | | guidePlates.set(j+1,entity); |
| | | } |
| | | } |
| | | } |
| | | |
| | | Collections.reverse(guidePlates); |
| | | |
| | | return getDataTable(guidePlates,guidePlates.size()); |
| | | } |
| | | |
| | | |
| | | |
| | | @ApiOperation("导办人员排行榜 type 1 安评价 2 按办结量 3 按超时") |
| | | @GetMapping("/getGuidePlate") |
| | | public TableDataInfo getGuidePlate(@RequestParam("type") String type) |
| | | { |
| | | int allNum=homeStatisticsService.staffNum(); |
| | | |
| | | if(StringUtils.equals("1",type)) |
| | | { |
| | | //安评价 |
| | | return getDataTable(homeStatisticsService.score(),allNum); |
| | | } |
| | | else if(StringUtils.equals("2",type)) |
| | | { |
| | | //2 按办结量 |
| | | return getDataTable(homeStatisticsService.guidePlatePeople(),allNum); |
| | | } |
| | | else |
| | | { |
| | | //3 按超时 |
| | | return getDataTable(homeStatisticsService.timeout(),allNum); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @ApiOperation("办事指南排行榜 type 1 按浏览量 2 按办结量") |
| | | @GetMapping("/getGuidance") |
| | | public TableDataInfo getGuidance(@RequestParam("type") String type) |
| | | { |
| | | int allNum=homeStatisticsService.countWork(); |
| | | if(StringUtils.equals("1",type)) |
| | | { |
| | | return getDataTable(homeStatisticsService.guidanceBrowse(),allNum); |
| | | } |
| | | else |
| | | { |
| | | return getDataTable(homeStatisticsService.guidanceTransaction(),allNum); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | */ |
| | | @ApiOperation(value = "导办事务搜索",response = QueryResults.class) |
| | | @GetMapping("/queryKeyWordList") |
| | | @Authorization |
| | | public QueryResults queryMatterNameList(@RequestParam(value = "pageNum",required = false) Integer pageNum, |
| | | @RequestParam(value = "pageSize",required = false) Integer pageSize, |
| | | @RequestParam(value = "recommendSize",required = false) Integer recommendSize, |
| | |
| | | return error("该账户已存在!"); |
| | | } |
| | | |
| | | config.setUserType("1"); |
| | | config.setUserType("3"); |
| | | |
| | | config.setCreateTime(LocalDateTime.now()); |
| | | config.setUpdateTime(LocalDateTime.now()); |
| | |
| | | return error("账户不能为空"); |
| | | } |
| | | |
| | | config.setUserType("1"); |
| | | config.setUserType("3"); |
| | | |
| | | return toAjax(IUserService.updateConfig(config)); |
| | | } |
New file |
| | |
| | | package com.dg.core.db.gen.entity; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @ApiModel("办事指南表") |
| | | @Data |
| | | public class Guidance implements Serializable |
| | | { |
| | | |
| | | @ApiModelProperty(name = "name", value = "名称") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(name = "num", value = "内容") |
| | | private String num; |
| | | } |
New file |
| | |
| | | package com.dg.core.db.gen.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @ApiModel("导办工单进展记录表") |
| | | @Data |
| | | public class GuidePlate implements Serializable |
| | | { |
| | | |
| | | @ApiModelProperty(name = "userName", value = "用户名") |
| | | private String userName; |
| | | |
| | | @ApiModelProperty(name = "departmentNmae", value = "部门") |
| | | private String departmentNmae; |
| | | |
| | | @ApiModelProperty(name = "num", value = "内容") |
| | | private String num; |
| | | } |
| | |
| | | private String detailedAddress; |
| | | |
| | | /** |
| | | * 提交方式(1 小程序 2.门户网) |
| | | */ |
| | | @ApiModelProperty("提交方式(1 小程序 2.门户网)") |
| | | private Integer submitType; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @ApiModelProperty("创建时间") |
New file |
| | |
| | | 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 io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @ApiModel("组织排行榜") |
| | | @Data |
| | | public class OrganizationEntity implements Serializable { |
| | | @ApiModelProperty("id") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | |
| | | @ApiModelProperty(name = "departmentNmae", value = "部门") |
| | | private String departmentNmae; |
| | | |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(name = "num", value = "内容") |
| | | private String num="0"; |
| | | } |
New file |
| | |
| | | package com.dg.core.db.gen.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dg.core.db.gen.entity.Guidance; |
| | | import com.dg.core.db.gen.entity.GuidePlate; |
| | | import com.dg.core.db.gen.entity.OrganizationEntity; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface HomeStatisticsMapper extends BaseMapper<GuidePlate> |
| | | { |
| | | /** |
| | | * 按办结量排序 |
| | | * @return |
| | | */ |
| | | List<GuidePlate> guidePlatePeople(); |
| | | |
| | | /** |
| | | *按评分排序 |
| | | * @return |
| | | */ |
| | | List<GuidePlate> score(); |
| | | |
| | | /** |
| | | * 按超时 |
| | | * @return |
| | | */ |
| | | List<GuidePlate> timeout(); |
| | | |
| | | /** |
| | | * 导办人员统计数 |
| | | * @return |
| | | */ |
| | | Integer staffNum(); |
| | | |
| | | /** |
| | | * 办事指南数量统计 |
| | | * @return |
| | | */ |
| | | Integer countWork(); |
| | | |
| | | /** |
| | | * 获取一级部门 |
| | | * @return |
| | | */ |
| | | List<OrganizationEntity> getDepartment(); |
| | | |
| | | /** |
| | | * 评分 |
| | | * @return |
| | | */ |
| | | Integer organizationScore(List<String> ids); |
| | | |
| | | /** |
| | | * 办结量 |
| | | * @return |
| | | */ |
| | | Integer organizationNum(List<String> ids); |
| | | |
| | | /** |
| | | * 办事指南根据导办数量排序 |
| | | * @return |
| | | */ |
| | | List<Guidance> guidanceTransaction(); |
| | | |
| | | /** |
| | | * 办事指南根据浏览数量排序 |
| | | * @return |
| | | */ |
| | | List<Guidance> guidanceBrowse(); |
| | | } |
New file |
| | |
| | | package com.dg.core.service; |
| | | |
| | | import com.dg.core.db.gen.entity.Guidance; |
| | | import com.dg.core.db.gen.entity.GuidePlate; |
| | | import com.dg.core.db.gen.entity.OrganizationEntity; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface HomeStatisticsService |
| | | { |
| | | /** |
| | | * 按办结量排序 |
| | | * @return |
| | | */ |
| | | List<GuidePlate> guidePlatePeople(); |
| | | |
| | | /** |
| | | *按评分排序 |
| | | * @return |
| | | */ |
| | | List<GuidePlate> score(); |
| | | |
| | | /** |
| | | * 按超时 |
| | | * @return |
| | | */ |
| | | List<GuidePlate> timeout(); |
| | | |
| | | /** |
| | | * 评分 |
| | | * @return |
| | | */ |
| | | Integer organizationScore(List<String> ids); |
| | | |
| | | /** |
| | | * 办结量 |
| | | * @return |
| | | */ |
| | | Integer organizationNum(List<String> ids); |
| | | /** |
| | | * 获取一级部门 |
| | | * @return |
| | | */ |
| | | List<OrganizationEntity> getDepartment(); |
| | | |
| | | /** |
| | | * 办事指南根据导办数量排序 |
| | | * @return |
| | | */ |
| | | List<Guidance> guidanceTransaction(); |
| | | |
| | | /** |
| | | * 办事指南根据浏览数量排序 |
| | | * @return |
| | | */ |
| | | List<Guidance> guidanceBrowse(); |
| | | |
| | | /** |
| | | * 导办人员统计数 |
| | | * @return |
| | | */ |
| | | Integer staffNum(); |
| | | |
| | | /** |
| | | * 办事指南数量统计 |
| | | * @return |
| | | */ |
| | | Integer countWork(); |
| | | } |
| | |
| | | package com.dg.core.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.dg.core.db.gen.entity.AutomessageCommonProblem; |
| | | import com.dg.core.db.gen.entity.CountListNum; |
| | | import com.dg.core.db.gen.entity.GuideEvolveEntity; |
| | | import com.dg.core.db.gen.entity.GuideRepairOrder; |
| | | import com.dg.core.db.gen.entity.*; |
| | | import org.springframework.data.repository.query.Param; |
| | | |
| | | import java.util.List; |
| | |
| | | List<String> ids, |
| | | Integer time); |
| | | |
| | | /** |
| | | * 获取提工单提交交人员信息 |
| | | * @return |
| | | */ |
| | | SysUser getSubmitUser(GuideRepairOrder guideRepairOrder); |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dg.core.db.gen.entity.GuideEvolveEntity; |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | import com.dg.core.db.gen.mapper.ElseAccessoryMapper; |
| | | import com.dg.core.db.gen.mapper.GuideEvolveMapper; |
| | | import com.dg.core.db.gen.mapper.TransactionEventMapper; |
| | |
| | | public int countStatisticsNum(String state, String isTimeout) { |
| | | return baseMapper.countStatisticsNum(state,isTimeout); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import com.dg.core.db.gen.entity.*; |
| | | import com.dg.core.db.gen.mapper.*; |
| | | import com.dg.core.service.IGuideRepairOrderService; |
| | | import com.dg.core.util.SmsUtil; |
| | | import com.dg.core.util.Snowflake; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | |
| | | @Resource |
| | | private GuideEvolveMapper guideEvolveMapper; |
| | | |
| | | @Resource |
| | | SmsUtil smsUtil; |
| | | |
| | | @Override |
| | | public int addOrder(GuideRepairOrder guideRepairOrder){ |
| | |
| | | entity.setFromUserId(guideRepairOrder.getSubmitUserId()); |
| | | entity.setFromDepartmentalId(guideRepairOrder.getGuideDepartmentId()); |
| | | entity.setGuidOrderNum(guideRepairOrder.getOrderNum()); |
| | | // smsUtil.sendSmsOvertime(sysUser.getPhonenumber(),guideRepairOrder.getMatterName()); |
| | | guideEvolveMapper.insertConfig(entity); |
| | | } |
| | | } |
| | |
| | | guideRepairOrderImageMapper.insert(guideRepairOrderImage); |
| | | } |
| | | } |
| | | |
| | | int ans= baseMapper.insert(guideRepairOrder); |
| | | int i = transactionEventMapper.updateById(transactionEvent); |
| | | if (ans>0&&i>0) |
| | |
| | | return baseMapper.countListNum(state, ids,time); |
| | | } |
| | | |
| | | @Override |
| | | public SysUser getSubmitUser(GuideRepairOrder guideRepairOrder){ |
| | | return sysUserMapper.selectOne(new QueryWrapper<SysUser>().lambda().eq(SysUser::getUserId,guideRepairOrder.getSubmitUserId())); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dg.core.db.gen.entity.Guidance; |
| | | import com.dg.core.db.gen.entity.GuidePlate; |
| | | import com.dg.core.db.gen.entity.OrganizationEntity; |
| | | import com.dg.core.db.gen.mapper.HomeStatisticsMapper; |
| | | import com.dg.core.service.HomeStatisticsService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | @Service |
| | | public class HomeStatisticsImpl extends ServiceImpl<HomeStatisticsMapper, GuidePlate> |
| | | implements HomeStatisticsService |
| | | { |
| | | |
| | | @Override |
| | | public List<GuidePlate> guidePlatePeople() { |
| | | return baseMapper.guidePlatePeople(); |
| | | } |
| | | |
| | | @Override |
| | | public List<GuidePlate> score() { |
| | | return baseMapper.score(); |
| | | } |
| | | |
| | | @Override |
| | | public List<GuidePlate> timeout() { |
| | | return baseMapper.timeout(); |
| | | } |
| | | |
| | | @Override |
| | | public Integer organizationScore(List<String> ids) { |
| | | return baseMapper.organizationScore(ids); |
| | | } |
| | | |
| | | @Override |
| | | public Integer organizationNum(List<String> ids) { |
| | | return baseMapper.organizationNum(ids); |
| | | } |
| | | |
| | | @Override |
| | | public List<OrganizationEntity> getDepartment() { |
| | | return baseMapper.getDepartment(); |
| | | } |
| | | |
| | | @Override |
| | | public List<Guidance> guidanceTransaction() { |
| | | return baseMapper.guidanceTransaction(); |
| | | } |
| | | |
| | | @Override |
| | | public List<Guidance> guidanceBrowse() { |
| | | return baseMapper.guidanceBrowse(); |
| | | } |
| | | |
| | | @Override |
| | | public Integer staffNum() { |
| | | return baseMapper.staffNum(); |
| | | } |
| | | |
| | | @Override |
| | | public Integer countWork() { |
| | | return baseMapper.countWork(); |
| | | } |
| | | |
| | | } |
| | |
| | | { |
| | | if(sysStreet!=null&&sysStreet.getId()!=null) |
| | | { |
| | | ids.add(sysStreet.getId()+""); |
| | | if(sysStreet.getChild()!=null && sysStreet.getChild().size()>0) |
| | | { |
| | | ids.addAll(disposestreetId(sysStreet.getChild())); |
| | |
| | | List<TransactionEvent> transactionEventEntities = baseMapper.queryMatterNameList(keyWord); |
| | | recommendResult.setTransactionEventList(transactionEventEntities); |
| | | for (TransactionEvent transactionEvent: transactionEventEntities) { |
| | | String[] associateNames = transactionEvent.getAssociateNames().split(","); |
| | | for (String associateName: associateNames) { |
| | | KeywordEntity keywordEntity = new KeywordEntity(); |
| | | keywordEntity.setName(associateName); |
| | | keywordEntityList.add(keywordEntity); |
| | | if (transactionEvent.getAssociateNames()!=null) { |
| | | String[] associateNames = transactionEvent.getAssociateNames().split(","); |
| | | for (String associateName : associateNames) { |
| | | KeywordEntity keywordEntity = new KeywordEntity(); |
| | | keywordEntity.setName(associateName); |
| | | keywordEntityList.add(keywordEntity); |
| | | } |
| | | } |
| | | |
| | | } |
| | | recommendResult.setKeywordEntityList(keywordEntityList); |
| | | List<OrganizationChartEntity> organizationChartEntities = organizationChartMapper.selectByKeyWord(keyWord); |
| | |
| | | @Resource |
| | | RedisTemplate<String, Object> redisTemplate; |
| | | |
| | | // 发送短信 |
| | | /** |
| | | * 发送短信登录验证码 |
| | | * |
| | | * @param tel |
| | | * 电话 |
| | | */ |
| | | public ResultData<Object> sendSms(String tel) { |
| | | //cn-hangzhou 是阿里定义的签名固定值。填写阿里云申请短信签名的key和secret值 |
| | | DefaultProfile profile = DefaultProfile.getProfile("cn-hangzhou", aliyunConfig.getKey(), aliyunConfig.getScrect()); |
| | |
| | | // 接收人电话 |
| | | request.putQueryParameter("PhoneNumbers", tel); |
| | | // 短信签名 |
| | | request.putQueryParameter("SignName", aliyunConfig.getSignName()); |
| | | request.putQueryParameter("SignName", "集慧科技"); |
| | | // 短信模板 |
| | | request.putQueryParameter("TemplateCode", aliyunConfig.getTemplateCode()); |
| | | Random rd = new Random(); |
| | |
| | | } |
| | | return ResultData.error("短信发送失败"); |
| | | } |
| | | |
| | | /** |
| | | * 发送工单超时短信 |
| | | * |
| | | * @param tel |
| | | * 电话 |
| | | * @param name |
| | | * 工单名 |
| | | */ |
| | | public ResultData<Object> sendSmsOvertime(String tel,String name) { |
| | | //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", "集慧科技"); |
| | | // 短信模板 |
| | | request.putQueryParameter("TemplateCode", aliyunConfig.getTemplateCodeOvertime()); |
| | | Random rd = new Random(); |
| | | // 短信内容 |
| | | request.putQueryParameter("TemplateParam", "{name:'" + name + "'}"); |
| | | // 获取短信发送的响应结果 |
| | | 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")) { |
| | | return ResultData.success("短信发送成功!"); |
| | | } |
| | | } catch (JsonProcessingException e) { |
| | | e.printStackTrace(); |
| | | return ResultData.error("短信发送失败"); |
| | | } |
| | | } catch (ClientException e) { |
| | | e.printStackTrace(); |
| | | return ResultData.error("短信发送失败"); |
| | | } |
| | | return ResultData.error("短信发送失败"); |
| | | } |
| | | |
| | | /** |
| | | * 发送工单完成短信 |
| | | * |
| | | * @param tel |
| | | * 电话 |
| | | * @param name |
| | | * 工单名 |
| | | */ |
| | | public ResultData<Object> sendSmsComplete(String tel,String name) { |
| | | //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", "集慧科技"); |
| | | // 短信模板 |
| | | request.putQueryParameter("TemplateCode", aliyunConfig.getTemplateCodeComplete()); |
| | | Random rd = new Random(); |
| | | // 短信内容 |
| | | request.putQueryParameter("TemplateParam", "{name:'" + name + "'}"); |
| | | // 获取短信发送的响应结果 |
| | | 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")) { |
| | | return ResultData.success("短信发送成功!"); |
| | | } |
| | | } catch (JsonProcessingException e) { |
| | | e.printStackTrace(); |
| | | return ResultData.error("短信发送失败"); |
| | | } |
| | | } catch (ClientException e) { |
| | | e.printStackTrace(); |
| | | return ResultData.error("短信发送失败"); |
| | | } |
| | | return ResultData.error("短信发送失败"); |
| | | } |
| | | } |
New file |
| | |
| | | package com.dg.core.util; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class TemplateParam { |
| | | |
| | | private String key; |
| | | private String value; |
| | | |
| | | public TemplateParam(String key, String value) { |
| | | this.key = key; |
| | | this.value = value; |
| | | } |
| | | public TemplateParam() { |
| | | |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.util; |
| | | |
| | | import java.util.List; |
| | | |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | |
| | | @ApiModel("微信订阅消息请求参数") |
| | | @Data |
| | | public class WxSubscribeDTO { |
| | | |
| | | @ApiModelProperty("用户在小程序的openid") |
| | | private String touser; |
| | | |
| | | @ApiModelProperty("所需下发的订阅模板id") |
| | | private String template_id; |
| | | |
| | | @ApiModelProperty("点击模板卡片后的跳转页面,仅限本小程序内的页面。支持带参数,(示例index?foo=bar)。该字段不填则模板无跳转。") |
| | | private String page; |
| | | |
| | | @ApiModelProperty("模板内容,格式形如 { \"key1\": { \"value\": any }, \"key2\": { \"value\": any } }") |
| | | private Object data; |
| | | |
| | | @ApiModelProperty("跳转小程序类型:developer为开发版;trial为体验版;formal为正式版;默认为正式版") |
| | | private String miniprogram_state; |
| | | |
| | | @ApiModelProperty("进入小程序查看”的语言类型,支持zh_CN(简体中文)、en_US(英文)、zh_HK(繁体中文)、zh_TW(繁体中文),默认为zh_CN") |
| | | private String lang; |
| | | |
| | | private List<TemplateParam> templateParamList; |
| | | |
| | | public String toJSON() { |
| | | StringBuffer buffer = new StringBuffer(); |
| | | buffer.append("{"); |
| | | buffer.append(String.format("\"touser\":\"%s\"", this.touser)).append(","); |
| | | buffer.append(String.format("\"template_id\":\"%s\"", this.template_id)).append(","); |
| | | if (StringUtils.isNotEmpty(this.page)) { |
| | | buffer.append(String.format("\"page\":\"%s\"", this.page)).append(","); |
| | | } |
| | | if (StringUtils.isNotEmpty(this.miniprogram_state)) { |
| | | buffer.append(String.format("\"miniprogram_state\":\"%s\"", this.miniprogram_state)).append(","); |
| | | } |
| | | buffer.append("\"data\":{"); |
| | | TemplateParam param = null; |
| | | for (int i = 0; i < this.templateParamList.size(); i++) { |
| | | param = templateParamList.get(i); |
| | | // 判断是否追加逗号 |
| | | if (i < this.templateParamList.size() - 1) { |
| | | buffer.append(String.format("\"%s\": {\"value\":\"%s\"},", param.getKey(), param.getValue())); |
| | | } else { |
| | | buffer.append(String.format("\"%s\": {\"value\":\"%s\"}", param.getKey(), param.getValue())); |
| | | } |
| | | } |
| | | buffer.append("}"); |
| | | buffer.append("}"); |
| | | return buffer.toString(); |
| | | } |
| | | } |
| | |
| | | package com.dg.core.util; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.dg.core.db.gen.entity.GuideRepairOrder; |
| | | import com.dg.core.db.manual.mapper.util.ConstantPropertiesUtil; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.http.HttpEntity; |
| | | import org.apache.http.HttpResponse; |
| | | import org.apache.http.client.methods.HttpGet; |
| | | import org.apache.http.client.methods.HttpPost; |
| | | import org.apache.http.entity.StringEntity; |
| | | import org.apache.http.impl.client.DefaultHttpClient; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.io.BufferedReader; |
| | | import java.io.IOException; |
| | | import java.io.InputStreamReader; |
| | | import java.util.Iterator; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | |
| | | @Slf4j |
| | | @Component |
| | | public class WxUtil { |
| | | |
| | | private static String ACCESS_TOKEN_URL = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential"; |
| | |
| | | * |
| | | * @return |
| | | */ |
| | | public String getBatteryCarAccessToken() throws Exception { |
| | | public String getBatteryCarAccessToken() throws Exception { |
| | | String accessToken = "0"; |
| | | try { |
| | | // 此处APP_ID APP_SECRET 在微信小程序后端可见 |
| | | // String accessTokenUrl = String.format(TEMP_URL, APP_ID, APP_SECRET); |
| | | String accessTokenUrl = ACCESS_TOKEN_URL + "&appid=" + ConstantPropertiesUtil.WX_OPEN_APP_ID |
| | | + "&secret=" + ConstantPropertiesUtil.WX_OPEN_APP_SECRET; |
| | | String result = this.httpGet(accessTokenUrl, null, null); |
| | | + "&secret=" +ConstantPropertiesUtil.WX_OPEN_APP_SECRET; |
| | | String result = httpGet(accessTokenUrl, null, null); |
| | | Map<String, Object> resultMap = JSON.parseObject(result, Map.class); |
| | | if (resultMap.containsKey("access_token")) { |
| | | accessToken = resultMap.get("access_token").toString(); |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * http请求工具类,post请求 |
| | | * |
| | | * @param url url |
| | | * @param param 参数值 仅支持String |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static String httpPost(String url, String param) throws Exception { |
| | | DefaultHttpClient defaultHttpClient = null; |
| | | BufferedReader bufferedReader = null; |
| | | try { |
| | | defaultHttpClient = new DefaultHttpClient(); |
| | | HttpPost httpPost = new HttpPost(url); |
| | | httpPost.setHeader("Content-Type", "application/json;charset=ut-8"); |
| | | if (StringUtils.isNotBlank(param)) { |
| | | HttpEntity httpEntity = new StringEntity(param, "utf-8"); |
| | | httpPost.setEntity(httpEntity); |
| | | } |
| | | HttpResponse httpResponse = defaultHttpClient.execute(httpPost); |
| | | if (httpResponse.getStatusLine().getStatusCode() != 200) { |
| | | String errorLog = "请求失败,errorCode:" + httpResponse.getStatusLine().getStatusCode(); |
| | | throw new Exception(url + errorLog); |
| | | } |
| | | // 读取返回信息 |
| | | String output; |
| | | bufferedReader = new BufferedReader(new InputStreamReader(httpResponse.getEntity().getContent(), "utf-8")); |
| | | StringBuilder stringBuilder = new StringBuilder(); |
| | | while ((output = bufferedReader.readLine()) != null) { |
| | | stringBuilder.append(output); |
| | | } |
| | | return stringBuilder.toString(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | throw e; |
| | | } finally { |
| | | if (defaultHttpClient != null) |
| | | defaultHttpClient.getConnectionManager().shutdown(); |
| | | if (bufferedReader != null) |
| | | bufferedReader.close(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | public static String wxMessageModeSendUrl(String token, WxSubscribeDTO subscribeDTO) throws Exception { |
| | | String tmpurl = "https://api.weixin.qq.com/cgi-bin/message/subscribe/send?access_token=ACCESS_TOKEN"; |
| | | String url = tmpurl.replace("ACCESS_TOKEN", token); |
| | | return httpPost(url, subscribeDTO.toJSON()); |
| | | } |
| | | |
| | | /** |
| | | * 订阅消息推送 |
| | | * |
| | | * @param accessToken |
| | | * 获取会话token |
| | | * @return 消息推送结果 |
| | | */ |
| | | static void sendSubscribe(String accessToken, WxSubscribeDTO subscribeDTO) throws Exception { |
| | | String resultString = wxMessageModeSendUrl(accessToken, subscribeDTO); |
| | | JSONObject jsonResult = JSON.parseObject(resultString); |
| | | if (jsonResult != null) { |
| | | int errorCode = jsonResult.getIntValue("errcode"); |
| | | String errorMessage = jsonResult.getString("errmsg"); |
| | | if (errorCode == 0) { |
| | | System.out.println("订阅消息推送成功,openId:" + subscribeDTO.getTouser()); |
| | | } else { |
| | | System.out.println( |
| | | "订阅消息发送失败,错误码:" + errorCode + ",错误信息:" + errorMessage + "用户openid:" + subscribeDTO.getTouser()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 工单完成推送 |
| | | * |
| | | * @param openId |
| | | * 用户openid |
| | | * @param accessToken |
| | | * token会话标识 |
| | | */ |
| | | public void sendGuideRepairOrderComplete(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("thing1",guideRepairOrder.getMatterName()));//业务办理类型 |
| | | paras.add(new TemplateParam("thing3","已完成")); |
| | | paras.add(new TemplateParam("phrase8","待评价")); |
| | | calendar.setTime(new Date()); |
| | | paras.add(new TemplateParam("time4",calendar.get(Calendar.YEAR)+"年"+(calendar.get(Calendar.MONTH)+1)+"月"+calendar.get(Calendar.DATE)+"日"));//结束日期 |
| | | subscribeDTO.setTemplateParamList(paras); |
| | | try { |
| | | sendSubscribe(accessToken,subscribeDTO); |
| | | }catch (Exception e){ |
| | | System.out.println(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | #\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 |
| | | aliyun.key=LTAI4Frqq9fpJek6d3bC7Rn1 |
| | | aliyun.screct=wkyvU72m6JmCFepCzGVuSpsJOsbRV0 |
| | | aliyun.SignName=???? |
| | | aliyun.TemplateCode=SMS_254326275 |
| | | aliyun.TemplateCodeOvertime=SMS_254460011 |
| | | aliyun.TemplateCodeComplete=SMS_254875101 |
| | | |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | wx.open.app_id=wx118de8a734d269f0 |
| | | wx.open.app_id=wx118de8a734d269f0 |
| | | wx.open.app_secret=0264342daefde5cd70a6adada09ee5b1 |
| | | wx.open.redirect_url=http://yq.cdnhxx.com:8080/ucenter/wx/callback |
| | | yygh.baseUrl=http://localhost:8080 |
| | |
| | | <id property="images" column="images" /> |
| | | <id property="video" column="video" /> |
| | | <id property="isTimeout" column="is_timeout" /> |
| | | <id property="submitType" column="submit_type" /> |
| | | </resultMap> |
| | | |
| | | <sql id="selectGuideRepairOrderVo"> |
| | |
| | | id, |
| | | order_num, |
| | | matter_id, |
| | | submit_type, |
| | | matter_name, |
| | | (select organization_name from automessage_organization_chart where a.department_id=id)organizationName, |
| | | concat( |
| | |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <!-- 首页统计 勿动 --> |
| | | <select id="countListNum" resultType="com.dg.core.db.gen.entity.CountListNum"> |
| | | select create_time,count(id) as num from automessage_guide_repair_order |
| | | <where> |
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.HomeStatisticsMapper"> |
| | | |
| | | <!-- 按办结量排序 --> |
| | | <select id="guidePlatePeople" resultType="com.dg.core.db.gen.entity.GuidePlate"> |
| | | SELECT |
| | | user_name as userName, |
| | | (SELECT organization_name FROM automessage_organization_chart WHERE automessage_organization_chart.id=department_id) as departmentNmae, |
| | | (select count(id) from automessage_guide_repair_order WHERE automessage_guide_repair_order.guide_user_id=automessage_sys_user.user_id) as num |
| | | FROM automessage_sys_user WHERE user_type=2 ORDER BY |
| | | num DESC |
| | | LIMIT 10 |
| | | </select> |
| | | |
| | | <!-- 按评分排序 --> |
| | | <select id="score" resultType="com.dg.core.db.gen.entity.GuidePlate"> |
| | | SELECT |
| | | user_name, |
| | | (SELECT organization_name FROM automessage_organization_chart WHERE automessage_organization_chart.id=department_id) as departmentNmae, |
| | | ((select sum(IF(evaluate_state='1',10,IF(evaluate_state='2',5,0))) from automessage_guide_repair_order WHERE automessage_guide_repair_order.guide_user_id=automessage_sys_user.user_id)/(select count(id) from automessage_guide_repair_order WHERE automessage_guide_repair_order.guide_user_id=automessage_sys_user.user_id)) as num |
| | | FROM automessage_sys_user WHERE user_type=2 ORDER BY |
| | | num DESC |
| | | LIMIT 10 |
| | | </select> |
| | | |
| | | <!-- 按超时 --> |
| | | <select id="timeout" resultType="com.dg.core.db.gen.entity.GuidePlate"> |
| | | SELECT |
| | | user_name as userName, |
| | | (SELECT organization_name FROM automessage_organization_chart WHERE automessage_organization_chart.id=department_id) as departmentNmae, |
| | | (select count(id) from automessage_guide_repair_order WHERE automessage_guide_repair_order.guide_user_id=automessage_sys_user.user_id and automessage_guide_repair_order.is_timeout=2 |
| | | ) as num |
| | | FROM automessage_sys_user WHERE user_type=2 ORDER BY |
| | | num DESC |
| | | LIMIT 10 |
| | | </select> |
| | | |
| | | |
| | | <!-- 导办人员统计数 --> |
| | | <select id="staffNum" resultType="integer"> |
| | | SELECT count(id) |
| | | FROM automessage_sys_user WHERE user_type=2 |
| | | </select> |
| | | |
| | | <!-- 获取一级组织 --> |
| | | <select id="getDepartment" resultType="com.dg.core.db.gen.entity.OrganizationEntity"> |
| | | SELECT |
| | | organization_name as departmentNmae, |
| | | id |
| | | FROM automessage_organization_chart |
| | | WHERE grade=1 |
| | | </select> |
| | | |
| | | |
| | | <!-- 组织排行榜 按评价 --> |
| | | <select id="organizationScore" resultType="integer"> |
| | | SELECT sum(IF(evaluate_state='1',10,IF(evaluate_state='2',5,0))) |
| | | FROM automessage_guide_repair_order |
| | | WHERE department_id in |
| | | <foreach collection="ids" item="param" open="(" close=")" separator=","> |
| | | #{param} |
| | | </foreach> |
| | | </select> |
| | | |
| | | |
| | | |
| | | <!-- 组织排行榜 按办结量 --> |
| | | <select id="organizationNum" resultType="integer"> |
| | | SELECT count(id) FROM automessage_guide_repair_order WHERE department_id in |
| | | <foreach collection="ids" item="param" open="(" close=")" separator=","> |
| | | #{param} |
| | | </foreach> |
| | | </select> |
| | | |
| | | <!-- 办事指南 根据导办数量排序 --> |
| | | <select id="guidanceTransaction" resultType="com.dg.core.db.gen.entity.Guidance"> |
| | | SELECT matter_name as name ,transaction_num as num from |
| | | automessage_transaction_event ORDER BY |
| | | num DESC |
| | | LIMIT 10 |
| | | </select> |
| | | |
| | | <!-- 办事指南 根据导办数量排序 --> |
| | | <select id="guidanceBrowse" resultType="com.dg.core.db.gen.entity.Guidance"> |
| | | SELECT matter_name as name ,browse_num as num from |
| | | automessage_transaction_event ORDER BY |
| | | num DESC |
| | | LIMIT 10 |
| | | </select> |
| | | |
| | | |
| | | <!-- 办事指南 统计数量 --> |
| | | <select id="countWork" resultType="integer"> |
| | | SELECT count(id) from automessage_transaction_event |
| | | </select> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | </mapper> |
| | |
| | | delete from automessage_sys_user where user_id= #{id} |
| | | </delete> |
| | | |
| | | |
| | | |
| | | |
| | | </mapper> |