24 changed files with 980 additions and 24 deletions
@ -0,0 +1,39 @@ |
|||||
|
package com.elink.esua.epdc.modules.backstage.controller; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
||||
|
import com.elink.esua.epdc.dto.analysis.pc.backstage.form.EpdcWorkbenchDataStatisticsFormDTO; |
||||
|
import com.elink.esua.epdc.dto.analysis.pc.backstage.result.EpdcWorkbenchDataStatisticsResultDTO; |
||||
|
import com.elink.esua.epdc.modules.backstage.service.EpdcBackstageService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
/** |
||||
|
* PC端-工作台 |
||||
|
* |
||||
|
* @Author:liuchuang |
||||
|
* @Date:2021/8/25 14:39 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("backstage") |
||||
|
public class EpdcBackstageController { |
||||
|
|
||||
|
@Autowired |
||||
|
private EpdcBackstageService epdcBackstageService; |
||||
|
|
||||
|
/** |
||||
|
* PC端-工作台-数据统计 |
||||
|
* |
||||
|
* @param formDto |
||||
|
* @return com.elink.esua.epdc.dto.analysis.pc.backstage.result.EpdcWorkbenchDataStatisticsResultDTO |
||||
|
* @author lc |
||||
|
* @since 2021/8/24 15:23 |
||||
|
*/ |
||||
|
@GetMapping("dataStatistics") |
||||
|
public Result<EpdcWorkbenchDataStatisticsResultDTO> dataStatistics(EpdcWorkbenchDataStatisticsFormDTO formDto) { |
||||
|
EpdcWorkbenchDataStatisticsResultDTO data = epdcBackstageService.workbenchDataStatistics(formDto); |
||||
|
return new Result<EpdcWorkbenchDataStatisticsResultDTO>().ok(data); |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,27 @@ |
|||||
|
package com.elink.esua.epdc.modules.backstage.dao; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; |
||||
|
import com.elink.esua.epdc.dto.analysis.pc.backstage.form.EpdcWorkbenchDataStatisticsFormDTO; |
||||
|
import com.elink.esua.epdc.dto.analysis.pc.backstage.result.EpdcWorkbenchDataStatisticsResultDTO; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* @Author:liuchuang |
||||
|
* @Date:2021/8/24 13:28 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface EpdcBackstageDao extends BaseDao<EpdcWorkbenchDataStatisticsResultDTO> { |
||||
|
|
||||
|
/** |
||||
|
* 话题数量统计 |
||||
|
* |
||||
|
* @param formDto |
||||
|
* @return com.elink.esua.epdc.dto.analysis.pc.backstage.result.EpdcWorkbenchDataStatisticsResultDTO |
||||
|
* @author lc |
||||
|
* @since 2021/8/24 13:56 |
||||
|
*/ |
||||
|
EpdcWorkbenchDataStatisticsResultDTO workbenchDataStatistics(EpdcWorkbenchDataStatisticsFormDTO formDto, List<Long> deptIdList); |
||||
|
} |
@ -0,0 +1,21 @@ |
|||||
|
package com.elink.esua.epdc.modules.backstage.service; |
||||
|
|
||||
|
import com.elink.esua.epdc.dto.analysis.pc.backstage.form.EpdcWorkbenchDataStatisticsFormDTO; |
||||
|
import com.elink.esua.epdc.dto.analysis.pc.backstage.result.EpdcWorkbenchDataStatisticsResultDTO; |
||||
|
|
||||
|
/** |
||||
|
* @Author:liuchuang |
||||
|
* @Date:2021/8/24 15:21 |
||||
|
*/ |
||||
|
public interface EpdcBackstageService { |
||||
|
|
||||
|
/** |
||||
|
* PC端-工作台-数据统计 |
||||
|
* |
||||
|
* @param formDto |
||||
|
* @return com.elink.esua.epdc.dto.analysis.pc.backstage.result.EpdcWorkbenchDataStatisticsResultDTO |
||||
|
* @author lc |
||||
|
* @since 2021/8/24 15:23 |
||||
|
*/ |
||||
|
EpdcWorkbenchDataStatisticsResultDTO workbenchDataStatistics(EpdcWorkbenchDataStatisticsFormDTO formDto); |
||||
|
} |
@ -0,0 +1,28 @@ |
|||||
|
package com.elink.esua.epdc.modules.backstage.service.impl; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; |
||||
|
import com.elink.esua.epdc.commons.tools.exception.RenException; |
||||
|
import com.elink.esua.epdc.commons.tools.security.user.SecurityUser; |
||||
|
import com.elink.esua.epdc.commons.tools.security.user.UserDetail; |
||||
|
import com.elink.esua.epdc.dto.analysis.pc.backstage.form.EpdcWorkbenchDataStatisticsFormDTO; |
||||
|
import com.elink.esua.epdc.dto.analysis.pc.backstage.result.EpdcWorkbenchDataStatisticsResultDTO; |
||||
|
import com.elink.esua.epdc.modules.backstage.dao.EpdcBackstageDao; |
||||
|
import com.elink.esua.epdc.modules.backstage.service.EpdcBackstageService; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
/** |
||||
|
* @Author:liuchuang |
||||
|
* @Date:2021/8/24 15:22 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class EpdcBackstageServiceImpl extends BaseServiceImpl<EpdcBackstageDao, EpdcWorkbenchDataStatisticsResultDTO> implements EpdcBackstageService { |
||||
|
|
||||
|
@Override |
||||
|
public EpdcWorkbenchDataStatisticsResultDTO workbenchDataStatistics(EpdcWorkbenchDataStatisticsFormDTO formDto) { |
||||
|
UserDetail user = SecurityUser.getUser(); |
||||
|
if (null == user) { |
||||
|
throw new RenException("登陆状态失效,请退出重新登陆"); |
||||
|
} |
||||
|
return baseDao.workbenchDataStatistics(formDto, user.getDeptIdList()); |
||||
|
} |
||||
|
} |
@ -0,0 +1,94 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.modules.user.controller; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.tools.page.PageData; |
||||
|
import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; |
||||
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
||||
|
import com.elink.esua.epdc.commons.tools.validator.AssertUtils; |
||||
|
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; |
||||
|
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; |
||||
|
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; |
||||
|
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; |
||||
|
import com.elink.esua.epdc.dto.analysis.pc.user.GridOpeningJobDTO; |
||||
|
import com.elink.esua.epdc.modules.user.excel.GridOpeningJobExcel; |
||||
|
import com.elink.esua.epdc.modules.user.service.GridOpeningJobService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import javax.servlet.http.HttpServletResponse; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 网格排名情况 |
||||
|
* |
||||
|
* @author qu qu@elink-cn.com |
||||
|
* @since v1.0.0 2021-08-24 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("gridopeningjob") |
||||
|
public class GridOpeningJobController { |
||||
|
|
||||
|
@Autowired |
||||
|
private GridOpeningJobService gridOpeningJobService; |
||||
|
|
||||
|
@GetMapping("page") |
||||
|
public Result<PageData<GridOpeningJobDTO>> page(@RequestParam Map<String, Object> params){ |
||||
|
PageData<GridOpeningJobDTO> page = gridOpeningJobService.page(params); |
||||
|
return new Result<PageData<GridOpeningJobDTO>>().ok(page); |
||||
|
} |
||||
|
|
||||
|
@GetMapping("{id}") |
||||
|
public Result<GridOpeningJobDTO> get(@PathVariable("id") String id){ |
||||
|
GridOpeningJobDTO data = gridOpeningJobService.get(id); |
||||
|
return new Result<GridOpeningJobDTO>().ok(data); |
||||
|
} |
||||
|
|
||||
|
@PostMapping |
||||
|
public Result save(@RequestBody GridOpeningJobDTO dto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
||||
|
gridOpeningJobService.save(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@PutMapping |
||||
|
public Result update(@RequestBody GridOpeningJobDTO dto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
||||
|
gridOpeningJobService.update(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@DeleteMapping |
||||
|
public Result delete(@RequestBody String[] ids){ |
||||
|
//效验数据
|
||||
|
AssertUtils.isArrayEmpty(ids, "id"); |
||||
|
gridOpeningJobService.delete(ids); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@GetMapping("export") |
||||
|
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
||||
|
List<GridOpeningJobDTO> list = gridOpeningJobService.list(params); |
||||
|
ExcelUtils.exportExcelToTarget(response, null, list, GridOpeningJobExcel.class); |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,41 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.modules.user.dao; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; |
||||
|
import com.elink.esua.epdc.modules.user.entity.GridOpeningJobEntity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
|
||||
|
/** |
||||
|
* 网格排名情况 |
||||
|
* |
||||
|
* @author qu qu@elink-cn.com |
||||
|
* @since v1.0.0 2021-08-24 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface GridOpeningJobDao extends BaseDao<GridOpeningJobEntity> { |
||||
|
|
||||
|
/** |
||||
|
* @describe: 删除所有数据 |
||||
|
* @author wangtong |
||||
|
* @date 2021/8/24 16:46 |
||||
|
* @params [] |
||||
|
* @return void |
||||
|
*/ |
||||
|
void deleteAllInfo(); |
||||
|
} |
@ -0,0 +1,133 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.modules.user.entity; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
/** |
||||
|
* 网格排名情况 |
||||
|
* |
||||
|
* @author qu qu@elink-cn.com |
||||
|
* @since v1.0.0 2021-08-24 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper=false) |
||||
|
@TableName("epdc_grid_opening_job") |
||||
|
public class GridOpeningJobEntity extends BaseEpdcEntity { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 网格id |
||||
|
*/ |
||||
|
private String gridId; |
||||
|
|
||||
|
/** |
||||
|
* 街道社区网格 |
||||
|
*/ |
||||
|
private String allDeptName; |
||||
|
|
||||
|
/** |
||||
|
* 用户注册数 |
||||
|
*/ |
||||
|
private Integer registerCount; |
||||
|
|
||||
|
/** |
||||
|
* 居民数(包括认证成功和党员认证失败的居民) |
||||
|
*/ |
||||
|
private Integer residentCount; |
||||
|
|
||||
|
/** |
||||
|
* 认证党员数 |
||||
|
*/ |
||||
|
private Integer partyCount; |
||||
|
|
||||
|
/** |
||||
|
* 未认证用户(根据用户第一次扫码的网格统计) |
||||
|
*/ |
||||
|
private Integer unAuthorizedCount; |
||||
|
|
||||
|
/** |
||||
|
* 居民扫码数 |
||||
|
*/ |
||||
|
private Integer ewmCount; |
||||
|
|
||||
|
/** |
||||
|
* 新闻数 |
||||
|
*/ |
||||
|
private Integer newsCount; |
||||
|
|
||||
|
/** |
||||
|
* 通知数 |
||||
|
*/ |
||||
|
private Integer noticeCount; |
||||
|
|
||||
|
/** |
||||
|
* 议题数 |
||||
|
*/ |
||||
|
private Integer eventCount; |
||||
|
|
||||
|
/** |
||||
|
* 项目数 |
||||
|
*/ |
||||
|
private Integer itemCount; |
||||
|
|
||||
|
/** |
||||
|
* 项目解决数 |
||||
|
*/ |
||||
|
private Integer itemCloseCount; |
||||
|
|
||||
|
/** |
||||
|
* 项目好评数(满意度评价为非常满意) |
||||
|
*/ |
||||
|
private Integer itemPraiseCount; |
||||
|
|
||||
|
/** |
||||
|
* 社群数 |
||||
|
*/ |
||||
|
private Integer communityCount; |
||||
|
|
||||
|
/** |
||||
|
* 社群成员数 |
||||
|
*/ |
||||
|
private Integer communityMemberCount; |
||||
|
|
||||
|
/** |
||||
|
* 社群话题数 |
||||
|
*/ |
||||
|
private Integer communityTopicCount; |
||||
|
|
||||
|
/** |
||||
|
* 企业数 |
||||
|
*/ |
||||
|
private Integer enterpriseCount; |
||||
|
|
||||
|
/** |
||||
|
* 网格长姓名 |
||||
|
*/ |
||||
|
private String gridLeader; |
||||
|
|
||||
|
/** |
||||
|
* 所有网格id |
||||
|
*/ |
||||
|
private String allDeptIds; |
||||
|
|
||||
|
} |
@ -0,0 +1,110 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.modules.user.excel; |
||||
|
|
||||
|
import cn.afterturn.easypoi.excel.annotation.Excel; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 网格排名情况 |
||||
|
* |
||||
|
* @author qu qu@elink-cn.com |
||||
|
* @since v1.0.0 2021-08-24 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class GridOpeningJobExcel { |
||||
|
|
||||
|
@Excel(name = "主键") |
||||
|
private String id; |
||||
|
|
||||
|
@Excel(name = "网格id") |
||||
|
private String gridid; |
||||
|
|
||||
|
@Excel(name = "街道社区网格") |
||||
|
private String alldeptname; |
||||
|
|
||||
|
@Excel(name = "用户注册数") |
||||
|
private Integer registercount; |
||||
|
|
||||
|
@Excel(name = "居民数(包括认证成功和党员认证失败的居民)") |
||||
|
private Integer residentcount; |
||||
|
|
||||
|
@Excel(name = "认证党员数") |
||||
|
private Integer partycount; |
||||
|
|
||||
|
@Excel(name = "未认证用户(根据用户第一次扫码的网格统计)") |
||||
|
private Integer unauthorizedcount; |
||||
|
|
||||
|
@Excel(name = "居民扫码数") |
||||
|
private Integer ewmcount; |
||||
|
|
||||
|
@Excel(name = "新闻数") |
||||
|
private Integer newscount; |
||||
|
|
||||
|
@Excel(name = "通知数") |
||||
|
private Integer noticecount; |
||||
|
|
||||
|
@Excel(name = "议题数") |
||||
|
private Integer eventcount; |
||||
|
|
||||
|
@Excel(name = "项目数") |
||||
|
private Integer itemcount; |
||||
|
|
||||
|
@Excel(name = "项目解决数") |
||||
|
private Integer itemclosecount; |
||||
|
|
||||
|
@Excel(name = "项目好评数(满意度评价为非常满意)") |
||||
|
private Integer itempraisecount; |
||||
|
|
||||
|
@Excel(name = "社群数") |
||||
|
private Integer communitycount; |
||||
|
|
||||
|
@Excel(name = "社群成员数") |
||||
|
private Integer communitymembercount; |
||||
|
|
||||
|
@Excel(name = "社群话题数") |
||||
|
private Integer communitytopiccount; |
||||
|
|
||||
|
@Excel(name = "企业数") |
||||
|
private Integer enterprisecount; |
||||
|
|
||||
|
@Excel(name = "网格长姓名") |
||||
|
private String gridleader; |
||||
|
|
||||
|
@Excel(name = "所有网格id") |
||||
|
private String alldeptids; |
||||
|
|
||||
|
@Excel(name = "删除标记(0-否,1-是)") |
||||
|
private String delFlag; |
||||
|
|
||||
|
@Excel(name = "创建人") |
||||
|
private String createdBy; |
||||
|
|
||||
|
@Excel(name = "创建时间") |
||||
|
private Date createdTime; |
||||
|
|
||||
|
@Excel(name = "更新人") |
||||
|
private String updatedBy; |
||||
|
|
||||
|
@Excel(name = "更新时间") |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,47 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.modules.user.redis; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.tools.redis.RedisUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
/** |
||||
|
* 网格排名情况 |
||||
|
* |
||||
|
* @author qu qu@elink-cn.com |
||||
|
* @since v1.0.0 2021-08-24 |
||||
|
*/ |
||||
|
@Component |
||||
|
public class GridOpeningJobRedis { |
||||
|
@Autowired |
||||
|
private RedisUtils redisUtils; |
||||
|
|
||||
|
public void delete(Object[] ids) { |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public void set(){ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public String get(String id){ |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,96 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.modules.user.service; |
||||
|
|
||||
|
|
||||
|
import com.elink.esua.epdc.commons.mybatis.service.BaseService; |
||||
|
import com.elink.esua.epdc.commons.tools.page.PageData; |
||||
|
import com.elink.esua.epdc.dto.analysis.pc.user.GridOpeningJobDTO; |
||||
|
import com.elink.esua.epdc.modules.user.entity.GridOpeningJobEntity; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 网格排名情况 |
||||
|
* |
||||
|
* @author qu qu@elink-cn.com |
||||
|
* @since v1.0.0 2021-08-24 |
||||
|
*/ |
||||
|
public interface GridOpeningJobService extends BaseService<GridOpeningJobEntity> { |
||||
|
|
||||
|
/** |
||||
|
* 默认分页 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return PageData<GridOpeningJobDTO> |
||||
|
* @author generator |
||||
|
* @date 2021-08-24 |
||||
|
*/ |
||||
|
PageData<GridOpeningJobDTO> page(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 默认查询 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return java.util.List<GridOpeningJobDTO> |
||||
|
* @author generator |
||||
|
* @date 2021-08-24 |
||||
|
*/ |
||||
|
List<GridOpeningJobDTO> list(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 单条查询 |
||||
|
* |
||||
|
* @param id |
||||
|
* @return GridOpeningJobDTO |
||||
|
* @author generator |
||||
|
* @date 2021-08-24 |
||||
|
*/ |
||||
|
GridOpeningJobDTO get(String id); |
||||
|
|
||||
|
/** |
||||
|
* 默认保存 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2021-08-24 |
||||
|
*/ |
||||
|
void save(GridOpeningJobDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 默认更新 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2021-08-24 |
||||
|
*/ |
||||
|
void update(GridOpeningJobDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 批量删除 |
||||
|
* |
||||
|
* @param ids |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2021-08-24 |
||||
|
*/ |
||||
|
void delete(String[] ids); |
||||
|
} |
@ -0,0 +1,104 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.modules.user.service.impl; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; |
||||
|
import com.elink.esua.epdc.commons.tools.constant.FieldConstant; |
||||
|
import com.elink.esua.epdc.commons.tools.page.PageData; |
||||
|
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; |
||||
|
import com.elink.esua.epdc.dto.analysis.pc.user.GridOpeningJobDTO; |
||||
|
import com.elink.esua.epdc.modules.user.dao.GridOpeningJobDao; |
||||
|
import com.elink.esua.epdc.modules.user.entity.GridOpeningJobEntity; |
||||
|
import com.elink.esua.epdc.modules.user.redis.GridOpeningJobRedis; |
||||
|
import com.elink.esua.epdc.modules.user.service.GridOpeningJobService; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
|
||||
|
import java.util.Arrays; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 网格排名情况 |
||||
|
* |
||||
|
* @author qu qu@elink-cn.com |
||||
|
* @since v1.0.0 2021-08-24 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class GridOpeningJobServiceImpl extends BaseServiceImpl<GridOpeningJobDao, GridOpeningJobEntity> implements GridOpeningJobService { |
||||
|
|
||||
|
@Autowired |
||||
|
private GridOpeningJobRedis gridOpeningJobRedis; |
||||
|
|
||||
|
@Override |
||||
|
public PageData<GridOpeningJobDTO> page(Map<String, Object> params) { |
||||
|
IPage<GridOpeningJobEntity> page = baseDao.selectPage( |
||||
|
getPage(params, FieldConstant.CREATED_TIME, false), |
||||
|
getWrapper(params) |
||||
|
); |
||||
|
return getPageData(page, GridOpeningJobDTO.class); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<GridOpeningJobDTO> list(Map<String, Object> params) { |
||||
|
List<GridOpeningJobEntity> entityList = baseDao.selectList(getWrapper(params)); |
||||
|
|
||||
|
return ConvertUtils.sourceToTarget(entityList, GridOpeningJobDTO.class); |
||||
|
} |
||||
|
|
||||
|
private QueryWrapper<GridOpeningJobEntity> getWrapper(Map<String, Object> params){ |
||||
|
String id = (String)params.get(FieldConstant.ID_HUMP); |
||||
|
|
||||
|
QueryWrapper<GridOpeningJobEntity> wrapper = new QueryWrapper<>(); |
||||
|
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
||||
|
|
||||
|
return wrapper; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public GridOpeningJobDTO get(String id) { |
||||
|
GridOpeningJobEntity entity = baseDao.selectById(id); |
||||
|
return ConvertUtils.sourceToTarget(entity, GridOpeningJobDTO.class); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void save(GridOpeningJobDTO dto) { |
||||
|
GridOpeningJobEntity entity = ConvertUtils.sourceToTarget(dto, GridOpeningJobEntity.class); |
||||
|
insert(entity); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void update(GridOpeningJobDTO dto) { |
||||
|
GridOpeningJobEntity entity = ConvertUtils.sourceToTarget(dto, GridOpeningJobEntity.class); |
||||
|
updateById(entity); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void delete(String[] ids) { |
||||
|
// 逻辑删除(@TableLogic 注解)
|
||||
|
baseDao.deleteBatchIds(Arrays.asList(ids)); |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,74 @@ |
|||||
|
<?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.elink.esua.epdc.modules.backstage.dao.EpdcBackstageDao"> |
||||
|
|
||||
|
<select id="workbenchDataStatistics" resultType="com.elink.esua.epdc.dto.analysis.pc.backstage.result.EpdcWorkbenchDataStatisticsResultDTO"> |
||||
|
SELECT |
||||
|
IFNULL(t1.topicNum, 0) topicNum, |
||||
|
IFNULL(t1.topicAddedYesterdayNum, 0) topicAddedYesterdayNum, |
||||
|
IFNULL(t2.issueNum, 0) issueNum, |
||||
|
IFNULL(t2.issueAddedYesterdayNum, 0) issueAddedYesterdayNum, |
||||
|
IFNULL(t3.itemNum, 0) itemNum, |
||||
|
IFNULL(t3.itemAddedYesterdayNum, 0) itemAddedYesterdayNum, |
||||
|
IFNULL(t3.itemCaseClosedNum, 0) itemCaseClosedNum, |
||||
|
IFNULL(t3.itemCaseClosedAddedYesterdayNum, 0) itemCaseClosedAddedYesterdayNum |
||||
|
FROM |
||||
|
( |
||||
|
SELECT |
||||
|
COUNT( t.ID ) AS topicNum, |
||||
|
SUM( |
||||
|
DATE_FORMAT( DATE_SUB( CURDATE(), INTERVAL 1 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( t.CREATED_TIME, '%Y-%m-%d' )) AS topicAddedYesterdayNum |
||||
|
FROM |
||||
|
esua_epdc_group.epdc_topic t |
||||
|
WHERE |
||||
|
t.DEL_FLAG = '0' |
||||
|
<if test="deptId != null and deptId != ''"> |
||||
|
AND find_in_set(#{formDto.deptId}, t.ALL_DEPT_IDS) |
||||
|
</if> |
||||
|
AND t.GRID_ID IN |
||||
|
<foreach collection="deptIdList" index="index" item="id" open="(" separator="," close=")"> |
||||
|
#{id} |
||||
|
</foreach>) t1, |
||||
|
( |
||||
|
SELECT |
||||
|
COUNT( issue.ID ) AS issueNum, |
||||
|
SUM( |
||||
|
DATE_FORMAT( DATE_SUB( CURDATE(), INTERVAL 1 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( issue.CREATED_TIME, '%Y-%m-%d' )) AS issueAddedYesterdayNum |
||||
|
FROM |
||||
|
esua_epdc_events.epdc_issue issue |
||||
|
WHERE |
||||
|
issue.DEL_FLAG = '0' |
||||
|
<if test="deptId != null and deptId != ''"> |
||||
|
AND find_in_set(#{formDto.deptId}, issue.ALL_DEPT_IDS) |
||||
|
</if> |
||||
|
AND issue.GRID_ID IN |
||||
|
<foreach collection="deptIdList" index="index" item="id" open="(" separator="," close=")"> |
||||
|
#{id} |
||||
|
</foreach> |
||||
|
) t2, |
||||
|
( |
||||
|
SELECT |
||||
|
COUNT( item.ID ) AS itemNum, |
||||
|
SUM( |
||||
|
DATE_FORMAT( DATE_SUB( CURDATE(), INTERVAL 1 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( item.CREATED_TIME, '%Y-%m-%d' )) AS itemAddedYesterdayNum, |
||||
|
SUM( item.ITEM_STATE = 10 ) AS itemCaseClosedNum, |
||||
|
SUM( |
||||
|
DATE_FORMAT( DATE_SUB( CURDATE(), INTERVAL 1 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( item.CREATED_TIME, '%Y-%m-%d' ) |
||||
|
AND item.ITEM_STATE = 10 |
||||
|
) AS itemCaseClosedAddedYesterdayNum |
||||
|
FROM |
||||
|
esua_epdc_events.epdc_item item |
||||
|
WHERE |
||||
|
item.DEL_FLAG = '0' |
||||
|
<if test="deptId != null and deptId != ''"> |
||||
|
AND find_in_set(#{formDto.deptId}, item.ALL_DEPT_IDS) |
||||
|
</if> |
||||
|
AND item.GRID_ID IN |
||||
|
<foreach collection="deptIdList" index="index" item="id" open="(" separator="," close=")"> |
||||
|
#{id} |
||||
|
</foreach> |
||||
|
) t3 |
||||
|
</select> |
||||
|
|
||||
|
</mapper> |
@ -0,0 +1,38 @@ |
|||||
|
<?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.elink.esua.epdc.modules.user.dao.GridOpeningJobDao"> |
||||
|
|
||||
|
<resultMap type="com.elink.esua.epdc.modules.user.entity.GridOpeningJobEntity" id="gridOpeningJobMap"> |
||||
|
<result property="id" column="ID"/> |
||||
|
<result property="gridid" column="gridId"/> |
||||
|
<result property="alldeptname" column="allDeptName"/> |
||||
|
<result property="registercount" column="registerCount"/> |
||||
|
<result property="residentcount" column="residentCount"/> |
||||
|
<result property="partycount" column="partyCount"/> |
||||
|
<result property="unauthorizedcount" column="unAuthorizedCount"/> |
||||
|
<result property="ewmcount" column="ewmCount"/> |
||||
|
<result property="newscount" column="newsCount"/> |
||||
|
<result property="noticecount" column="noticeCount"/> |
||||
|
<result property="eventcount" column="eventCount"/> |
||||
|
<result property="itemcount" column="itemCount"/> |
||||
|
<result property="itemclosecount" column="itemCloseCount"/> |
||||
|
<result property="itempraisecount" column="itemPraiseCount"/> |
||||
|
<result property="communitycount" column="communityCount"/> |
||||
|
<result property="communitymembercount" column="communityMemberCount"/> |
||||
|
<result property="communitytopiccount" column="communityTopicCount"/> |
||||
|
<result property="enterprisecount" column="enterpriseCount"/> |
||||
|
<result property="gridleader" column="gridLeader"/> |
||||
|
<result property="alldeptids" column="allDeptIds"/> |
||||
|
<result property="delFlag" column="DEL_FLAG"/> |
||||
|
<result property="createdBy" column="CREATED_BY"/> |
||||
|
<result property="createdTime" column="CREATED_TIME"/> |
||||
|
<result property="updatedBy" column="UPDATED_BY"/> |
||||
|
<result property="updatedTime" column="UPDATED_TIME"/> |
||||
|
</resultMap> |
||||
|
<delete id="deleteAllInfo"> |
||||
|
delete from epdc_grid_opening_job |
||||
|
</delete> |
||||
|
|
||||
|
|
||||
|
</mapper> |
@ -1 +1 @@ |
|||||
Subproject commit 3b4c1c3076a2ea432cafe8ebe21b64eb74db8a5a |
Subproject commit 5b564cde29b3dd3539da42136c9514fdd1463761 |
Loading…
Reference in new issue