Browse Source

工作日志大屏API

master
yinzuomei 5 years ago
parent
commit
7911880c62
  1. 4
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/ScreenCustomerAgencyDTO.java
  2. 127
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/ScreenCustomerWorkRecordDictDTO.java
  3. 112
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/ScreenWorkRecordOrgDailyDTO.java
  4. 112
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/ScreenWorkRecordOrgMonthlyDTO.java
  5. 38
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/form/WorkRecordRankFormDTO.java
  6. 30
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/result/WorkRecordRankResultDTO.java
  7. 34
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/result/WorkRecordSubRank.java
  8. 19
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/plugins/WorkRecordController.java
  9. 33
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/plugins/ScreenCustomerWorkRecordDictDao.java
  10. 51
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/plugins/ScreenWorkRecordOrgDailyDao.java
  11. 33
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/plugins/ScreenWorkRecordOrgMonthlyDao.java
  12. 93
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/plugins/ScreenCustomerWorkRecordDictEntity.java
  13. 78
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/plugins/ScreenWorkRecordOrgDailyEntity.java
  14. 78
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/plugins/ScreenWorkRecordOrgMonthlyEntity.java
  15. 3
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java
  16. 7
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java
  17. 95
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/ScreenCustomerWorkRecordDictService.java
  18. 99
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/ScreenWorkRecordOrgDailyService.java
  19. 94
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/ScreenWorkRecordOrgMonthlyService.java
  20. 101
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/impl/ScreenCustomerWorkRecordDictServiceImpl.java
  21. 122
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/impl/ScreenWorkRecordOrgDailyServiceImpl.java
  22. 101
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/impl/ScreenWorkRecordOrgMonthlyServiceImpl.java
  23. 28
      epmet-module/data-report/data-report-server/src/main/resources/mapper/plugins/ScreenCustomerWorkRecordDictDao.xml
  24. 32
      epmet-module/data-report/data-report-server/src/main/resources/mapper/plugins/ScreenWorkRecordOrgDailyDao.xml
  25. 8
      epmet-module/data-report/data-report-server/src/main/resources/mapper/plugins/ScreenWorkRecordOrgMonthlyDao.xml

4
epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/ScreenCustomerAgencyDTO.java

@ -42,4 +42,8 @@ public class ScreenCustomerAgencyDTO implements Serializable {
*/ */
private String areaCode; private String areaCode;
/**
* 当前组织的上级行政地区编码add0204;举例平阴县对应的是济南市3701
*/
private String parentAreaCode;
} }

127
epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/ScreenCustomerWorkRecordDictDTO.java

@ -0,0 +1,127 @@
/**
* 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.epmet.plugins;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 工作日志资源字典表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-02-23
*/
@Data
public class ScreenCustomerWorkRecordDictDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键客户每次上传直接根据customerId全删全增
*/
private String id;
/**
* 客户Id
*/
private String customerId;
/**
* 数据更新至日期eg:20200101
*/
private String dateId;
/**
* 资源id
*/
private String dictId;
/**
* 父资源ID如果是一级分类pid=0
*/
private String pid;
/**
* 资源类型
*/
private String resourceType;
/**
* 资源编码
*/
private String resourceCode;
/**
* 资源标签名
*/
private String resourceLabel;
/**
* 显示标识0否1是
*/
private String showFlag;
/**
* 排序
*/
private Integer sort;
/**
* 数据类别 party:支部建设; union:联合建设党员志愿服务voluntaryservice所有的一级分类需要对应到这三个key中
*/
private String dataType;
/**
* 当前资源属于几级例如1234....
*/
private Integer level;
/**
* 逻辑删除标识
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

112
epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/ScreenWorkRecordOrgDailyDTO.java

@ -0,0 +1,112 @@
/**
* 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.epmet.plugins;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 工作日志-组织按日统计(累计值)
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-02-23
*/
@Data
public class ScreenWorkRecordOrgDailyDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* ID 主键
*/
private String id;
/**
* 客户Id
*/
private String customerId;
/**
* 日期IdyyyyMMdd
*/
private String dateId;
/**
* 组织Idor网格id
*/
private String orgId;
/**
* 会议类型编码对应screen_customer_work_record_dict的资源编码
*/
private String meetingCode;
/**
* 随手记类型编码对应screen_customer_work_record_dict的资源编码
*/
private String typeCode;
/**
* 组织次数
*/
private Integer organizeTotal;
/**
* 参与人数
*/
private Integer participateUserTotal;
/**
* 平均参与人数
*/
private Integer avgParticipateUserTotal;
/**
* 删除标识 0未删除1已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

112
epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/ScreenWorkRecordOrgMonthlyDTO.java

@ -0,0 +1,112 @@
/**
* 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.epmet.plugins;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 工作日志-组织按月统计(增量)
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-02-23
*/
@Data
public class ScreenWorkRecordOrgMonthlyDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* ID 主键
*/
private String id;
/**
* 客户Id
*/
private String customerId;
/**
* 月份IdyyyyMM
*/
private String monthId;
/**
* 组织Idor网格id
*/
private String orgId;
/**
* 会议类型编码对应screen_customer_work_record_dict的资源编码
*/
private String meetingCode;
/**
* 随手记类型编码对应screen_customer_work_record_dict的资源编码
*/
private String typeCode;
/**
* 组织次数
*/
private Integer organizeTotal;
/**
* 参与人数
*/
private Integer participateUserTotal;
/**
* 平均参与人数
*/
private Integer avgParticipateUserTotal;
/**
* 删除标识 0未删除1已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

38
epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/form/WorkRecordRankFormDTO.java

@ -0,0 +1,38 @@
package com.epmet.plugins.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* 5工作日志本机及下级排名 通用入参
*
* @author yinzuomei@elink-cn.com
* @date 2021/2/23 23:08
*/
@Data
public class WorkRecordRankFormDTO implements Serializable {
private static final long serialVersionUID = -2934835714413031036L;
/**
* party:支部建设; union:联建共建党员志愿服务voluntaryservice
*/
@NotBlank(message = "dataType不能为空;可选值:party:支部建设; union:联建共建;党员志愿服务:voluntaryservice")
private String dataType;
/**
* 当前组织id
*/
@NotBlank(message = "agencyId不能为空")
private String agencyId;
/**
* 默认显示前3
*/
@NotNull(message = "topRow不能为空")
private Integer topRow;
@NotBlank(message = "customerId不能为空")
private String customerId;
}

30
epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/result/WorkRecordRankResultDTO.java

@ -0,0 +1,30 @@
package com.epmet.plugins.result;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 5工作日志本机及下级排名 返参
*
* @author yinzuomei@elink-cn.com
* @date 2021/2/23 23:11
*/
@Data
public class WorkRecordRankResultDTO implements Serializable {
/**
* 总参与人数
*/
private Integer participateUserTotal;
/**
*组织次数
*/
private Integer participateTotal;
/**
*下级排行列表
*/
private List<WorkRecordSubRank> subRankList;
}

34
epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/result/WorkRecordSubRank.java

@ -0,0 +1,34 @@
package com.epmet.plugins.result;
import lombok.Data;
import java.io.Serializable;
/**
* 下级排行列表
*
* @author yinzuomei@elink-cn.com
* @date 2021/2/23 23:21
*/
@Data
public class WorkRecordSubRank implements Serializable {
private static final long serialVersionUID = -2450978606865910110L;
private String orgId;
/**
* 组织名称或者是网格名称
*/
private String name;
/**
* 总参与人数
*/
private Integer participateUserTotal;
/**
* 组织次数
*/
private Integer participateTotal;
}

19
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/plugins/WorkRecordController.java

@ -1,7 +1,12 @@
package com.epmet.datareport.controller.plugins; package com.epmet.datareport.controller.plugins;
import org.springframework.web.bind.annotation.RequestMapping; import com.epmet.commons.tools.utils.Result;
import org.springframework.web.bind.annotation.RestController; import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.datareport.service.plugins.ScreenWorkRecordOrgDailyService;
import com.epmet.plugins.form.WorkRecordRankFormDTO;
import com.epmet.plugins.result.WorkRecordRankResultDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/** /**
* 大屏工作日志相关输出接口 * 大屏工作日志相关输出接口
@ -12,6 +17,8 @@ import org.springframework.web.bind.annotation.RestController;
@RestController @RestController
@RequestMapping("plugins/workrecord") @RequestMapping("plugins/workrecord")
public class WorkRecordController { public class WorkRecordController {
@Autowired
private ScreenWorkRecordOrgDailyService screenWorkRecordOrgDailyService;
//todo //todo
//5、【工作日志】本机及下级排名 //5、【工作日志】本机及下级排名
//NEI接口地址:https://nei.netease.com/interface/detail/?pid=57068&id=348966 //NEI接口地址:https://nei.netease.com/interface/detail/?pid=57068&id=348966
@ -19,8 +26,12 @@ public class WorkRecordController {
//下级根据当前组织的areaCode查询下级列表,再去查询screen_work_record_org_daily //下级根据当前组织的areaCode查询下级列表,再去查询screen_work_record_org_daily
//legend来源于screen_customer_work_record_dict表 level=2,dataType=party //legend来源于screen_customer_work_record_dict表 level=2,dataType=party
@PostMapping("ranklist")
public Result<WorkRecordRankResultDTO> rankList(@RequestHeader("CustomerId")String customerId, @RequestBody WorkRecordRankFormDTO formDTO){
formDTO.setCustomerId(customerId);
ValidatorUtils.validateEntity(formDTO);
return new Result<WorkRecordRankResultDTO>().ok(screenWorkRecordOrgDailyService.rankList(formDTO));
}
//6、【工作日志】近12月趋势图 //6、【工作日志】近12月趋势图

33
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/plugins/ScreenCustomerWorkRecordDictDao.java

@ -0,0 +1,33 @@
/**
* 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.epmet.datareport.dao.plugins;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.datareport.entity.plugins.ScreenCustomerWorkRecordDictEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 工作日志资源字典表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-02-23
*/
@Mapper
public interface ScreenCustomerWorkRecordDictDao extends BaseDao<ScreenCustomerWorkRecordDictEntity> {
}

51
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/plugins/ScreenWorkRecordOrgDailyDao.java

@ -0,0 +1,51 @@
/**
* 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.epmet.datareport.dao.plugins;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.datareport.entity.plugins.ScreenWorkRecordOrgDailyEntity;
import com.epmet.plugins.result.WorkRecordSubRank;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 工作日志-组织按日统计(累计值)
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-02-23
*/
@Mapper
public interface ScreenWorkRecordOrgDailyDao extends BaseDao<ScreenWorkRecordOrgDailyEntity> {
/**
* @param areaCode 当前组织对应的areaCode;
* @param dataType
* @param topRow
* @return com.epmet.plugins.result.WorkRecordRankResultDTO
* @author yinzuomei
* @description 5工作日志本机及下级排名
* @Date 2021/2/23 23:37
**/
List<WorkRecordSubRank> selectSubList(@Param("areaCode") String areaCode,
@Param("dataType") String dataType,
@Param("topRow") Integer topRow,
@Param("dateId")String dateId);
String selectLatestDateId(String customerId);
}

33
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/plugins/ScreenWorkRecordOrgMonthlyDao.java

@ -0,0 +1,33 @@
/**
* 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.epmet.datareport.dao.plugins;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.datareport.entity.plugins.ScreenWorkRecordOrgMonthlyEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 工作日志-组织按月统计(增量)
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-02-23
*/
@Mapper
public interface ScreenWorkRecordOrgMonthlyDao extends BaseDao<ScreenWorkRecordOrgMonthlyEntity> {
}

93
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/plugins/ScreenCustomerWorkRecordDictEntity.java

@ -0,0 +1,93 @@
/**
* 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.epmet.datareport.entity.plugins;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 工作日志资源字典表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-02-23
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("screen_customer_work_record_dict")
public class ScreenCustomerWorkRecordDictEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户Id
*/
private String customerId;
/**
* 数据更新至日期eg:20200101
*/
private String dateId;
/**
* 资源id
*/
private String dictId;
/**
* 父资源ID如果是一级分类pid=0
*/
private String pid;
/**
* 资源类型
*/
private String resourceType;
/**
* 资源编码
*/
private String resourceCode;
/**
* 资源标签名
*/
private String resourceLabel;
/**
* 显示标识0否1是
*/
private String showFlag;
/**
* 排序
*/
private Integer sort;
/**
* 数据类别 party:支部建设; union:联合建设党员志愿服务voluntaryservice所有的一级分类需要对应到这三个key中
*/
private String dataType;
/**
* 当前资源属于几级例如1234....
*/
private Integer level;
}

78
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/plugins/ScreenWorkRecordOrgDailyEntity.java

@ -0,0 +1,78 @@
/**
* 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.epmet.datareport.entity.plugins;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 工作日志-组织按日统计(累计值)
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-02-23
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("screen_work_record_org_daily")
public class ScreenWorkRecordOrgDailyEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户Id
*/
private String customerId;
/**
* 日期IdyyyyMMdd
*/
private String dateId;
/**
* 组织Idor网格id
*/
private String orgId;
/**
* 会议类型编码对应screen_customer_work_record_dict的资源编码
*/
private String meetingCode;
/**
* 随手记类型编码对应screen_customer_work_record_dict的资源编码
*/
private String typeCode;
/**
* 组织次数
*/
private Integer organizeTotal;
/**
* 参与人数
*/
private Integer participateUserTotal;
/**
* 平均参与人数
*/
private Integer avgParticipateUserTotal;
}

78
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/plugins/ScreenWorkRecordOrgMonthlyEntity.java

@ -0,0 +1,78 @@
/**
* 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.epmet.datareport.entity.plugins;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 工作日志-组织按月统计(增量)
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-02-23
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("screen_work_record_org_monthly")
public class ScreenWorkRecordOrgMonthlyEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户Id
*/
private String customerId;
/**
* 月份IdyyyyMM
*/
private String monthId;
/**
* 组织Idor网格id
*/
private String orgId;
/**
* 会议类型编码对应screen_customer_work_record_dict的资源编码
*/
private String meetingCode;
/**
* 随手记类型编码对应screen_customer_work_record_dict的资源编码
*/
private String typeCode;
/**
* 组织次数
*/
private Integer organizeTotal;
/**
* 参与人数
*/
private Integer participateUserTotal;
/**
* 平均参与人数
*/
private Integer avgParticipateUserTotal;
}

3
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java

@ -2,6 +2,7 @@ package com.epmet.datareport.service.evaluationindex.screen;
import com.epmet.dto.form.AreaCodeDictFormDTO; import com.epmet.dto.form.AreaCodeDictFormDTO;
import com.epmet.dto.result.AreaCodeDictResultDTO; import com.epmet.dto.result.AreaCodeDictResultDTO;
import com.epmet.dto.result.ScreenCustomerAgencyDTO;
import com.epmet.dto.result.plugins.AgencyNodeDTO; import com.epmet.dto.result.plugins.AgencyNodeDTO;
import com.epmet.evaluationindex.screen.dto.form.CompartmentByBizTypeFormDTO; import com.epmet.evaluationindex.screen.dto.form.CompartmentByBizTypeFormDTO;
import com.epmet.evaluationindex.screen.dto.form.CompartmentFormDTO; import com.epmet.evaluationindex.screen.dto.form.CompartmentFormDTO;
@ -55,4 +56,6 @@ public interface AgencyService {
* @Date 2021/2/3 22:19 * @Date 2021/2/3 22:19
**/ **/
AgencyNodeDTO queryStaffAgencyTree(String agencyId); AgencyNodeDTO queryStaffAgencyTree(String agencyId);
ScreenCustomerAgencyDTO queryAgencyInfo(String agencyId);
} }

7
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java

@ -262,6 +262,7 @@ public class AgencyServiceImpl implements AgencyService {
* @description 查询当前组织及下级组织树 * @description 查询当前组织及下级组织树
* @Date 2021/2/3 22:19 * @Date 2021/2/3 22:19
**/ **/
@DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true)
@Override @Override
public AgencyNodeDTO queryStaffAgencyTree(String agencyId) { public AgencyNodeDTO queryStaffAgencyTree(String agencyId) {
ScreenCustomerAgencyDTO agencyDTO = screenCustomerAgencyDao.selectByAgencyId(agencyId); ScreenCustomerAgencyDTO agencyDTO = screenCustomerAgencyDao.selectByAgencyId(agencyId);
@ -277,4 +278,10 @@ public class AgencyServiceImpl implements AgencyService {
log.info(JSON.toJSONString(treeList)); log.info(JSON.toJSONString(treeList));
return treeList.get(NumConstant.ZERO); return treeList.get(NumConstant.ZERO);
} }
@DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true)
@Override
public ScreenCustomerAgencyDTO queryAgencyInfo(String agencyId) {
return screenCustomerAgencyDao.selectByAgencyId(agencyId);
}
} }

95
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/ScreenCustomerWorkRecordDictService.java

@ -0,0 +1,95 @@
/**
* 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.epmet.datareport.service.plugins;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.datareport.entity.plugins.ScreenCustomerWorkRecordDictEntity;
import com.epmet.plugins.ScreenCustomerWorkRecordDictDTO;
import java.util.List;
import java.util.Map;
/**
* 工作日志资源字典表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-02-23
*/
public interface ScreenCustomerWorkRecordDictService extends BaseService<ScreenCustomerWorkRecordDictEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<ScreenCustomerWorkRecordDictDTO>
* @author generator
* @date 2021-02-23
*/
PageData<ScreenCustomerWorkRecordDictDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<ScreenCustomerWorkRecordDictDTO>
* @author generator
* @date 2021-02-23
*/
List<ScreenCustomerWorkRecordDictDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return ScreenCustomerWorkRecordDictDTO
* @author generator
* @date 2021-02-23
*/
ScreenCustomerWorkRecordDictDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2021-02-23
*/
void save(ScreenCustomerWorkRecordDictDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2021-02-23
*/
void update(ScreenCustomerWorkRecordDictDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2021-02-23
*/
void delete(String[] ids);
}

99
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/ScreenWorkRecordOrgDailyService.java

@ -0,0 +1,99 @@
/**
* 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.epmet.datareport.service.plugins;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.datareport.entity.plugins.ScreenWorkRecordOrgDailyEntity;
import com.epmet.plugins.ScreenWorkRecordOrgDailyDTO;
import com.epmet.plugins.form.WorkRecordRankFormDTO;
import com.epmet.plugins.result.WorkRecordRankResultDTO;
import java.util.List;
import java.util.Map;
/**
* 工作日志-组织按日统计(累计值)
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-02-23
*/
public interface ScreenWorkRecordOrgDailyService extends BaseService<ScreenWorkRecordOrgDailyEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<ScreenWorkRecordOrgDailyDTO>
* @author generator
* @date 2021-02-23
*/
PageData<ScreenWorkRecordOrgDailyDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<ScreenWorkRecordOrgDailyDTO>
* @author generator
* @date 2021-02-23
*/
List<ScreenWorkRecordOrgDailyDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return ScreenWorkRecordOrgDailyDTO
* @author generator
* @date 2021-02-23
*/
ScreenWorkRecordOrgDailyDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2021-02-23
*/
void save(ScreenWorkRecordOrgDailyDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2021-02-23
*/
void update(ScreenWorkRecordOrgDailyDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2021-02-23
*/
void delete(String[] ids);
WorkRecordRankResultDTO rankList(WorkRecordRankFormDTO formDTO);
}

94
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/ScreenWorkRecordOrgMonthlyService.java

@ -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.epmet.datareport.service.plugins;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.datareport.entity.plugins.ScreenWorkRecordOrgMonthlyEntity;
import com.epmet.plugins.ScreenWorkRecordOrgMonthlyDTO;
import java.util.List;
import java.util.Map;
/**
* 工作日志-组织按月统计(增量)
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-02-23
*/
public interface ScreenWorkRecordOrgMonthlyService extends BaseService<ScreenWorkRecordOrgMonthlyEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<ScreenWorkRecordOrgMonthlyDTO>
* @author generator
* @date 2021-02-23
*/
PageData<ScreenWorkRecordOrgMonthlyDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<ScreenWorkRecordOrgMonthlyDTO>
* @author generator
* @date 2021-02-23
*/
List<ScreenWorkRecordOrgMonthlyDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return ScreenWorkRecordOrgMonthlyDTO
* @author generator
* @date 2021-02-23
*/
ScreenWorkRecordOrgMonthlyDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2021-02-23
*/
void save(ScreenWorkRecordOrgMonthlyDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2021-02-23
*/
void update(ScreenWorkRecordOrgMonthlyDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2021-02-23
*/
void delete(String[] ids);
}

101
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/impl/ScreenCustomerWorkRecordDictServiceImpl.java

@ -0,0 +1,101 @@
/**
* 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.epmet.datareport.service.plugins.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.datareport.dao.plugins.ScreenCustomerWorkRecordDictDao;
import com.epmet.datareport.entity.plugins.ScreenCustomerWorkRecordDictEntity;
import com.epmet.datareport.service.plugins.ScreenCustomerWorkRecordDictService;
import com.epmet.plugins.ScreenCustomerWorkRecordDictDTO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 工作日志资源字典表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-02-23
*/
@Slf4j
@Service
public class ScreenCustomerWorkRecordDictServiceImpl extends BaseServiceImpl<ScreenCustomerWorkRecordDictDao, ScreenCustomerWorkRecordDictEntity> implements ScreenCustomerWorkRecordDictService {
@Override
public PageData<ScreenCustomerWorkRecordDictDTO> page(Map<String, Object> params) {
IPage<ScreenCustomerWorkRecordDictEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, ScreenCustomerWorkRecordDictDTO.class);
}
@Override
public List<ScreenCustomerWorkRecordDictDTO> list(Map<String, Object> params) {
List<ScreenCustomerWorkRecordDictEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, ScreenCustomerWorkRecordDictDTO.class);
}
private QueryWrapper<ScreenCustomerWorkRecordDictEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<ScreenCustomerWorkRecordDictEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public ScreenCustomerWorkRecordDictDTO get(String id) {
ScreenCustomerWorkRecordDictEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, ScreenCustomerWorkRecordDictDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(ScreenCustomerWorkRecordDictDTO dto) {
ScreenCustomerWorkRecordDictEntity entity = ConvertUtils.sourceToTarget(dto, ScreenCustomerWorkRecordDictEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(ScreenCustomerWorkRecordDictDTO dto) {
ScreenCustomerWorkRecordDictEntity entity = ConvertUtils.sourceToTarget(dto, ScreenCustomerWorkRecordDictEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
}

122
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/impl/ScreenWorkRecordOrgDailyServiceImpl.java

@ -0,0 +1,122 @@
/**
* 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.epmet.datareport.service.plugins.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.datareport.dao.plugins.ScreenWorkRecordOrgDailyDao;
import com.epmet.datareport.entity.plugins.ScreenWorkRecordOrgDailyEntity;
import com.epmet.datareport.service.evaluationindex.screen.AgencyService;
import com.epmet.datareport.service.plugins.ScreenWorkRecordOrgDailyService;
import com.epmet.dto.result.ScreenCustomerAgencyDTO;
import com.epmet.plugins.ScreenWorkRecordOrgDailyDTO;
import com.epmet.plugins.form.WorkRecordRankFormDTO;
import com.epmet.plugins.result.WorkRecordRankResultDTO;
import lombok.extern.slf4j.Slf4j;
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 generator generator@elink-cn.com
* @since v1.0.0 2021-02-23
*/
@Slf4j
@Service
public class ScreenWorkRecordOrgDailyServiceImpl extends BaseServiceImpl<ScreenWorkRecordOrgDailyDao, ScreenWorkRecordOrgDailyEntity> implements ScreenWorkRecordOrgDailyService {
@Autowired
private AgencyService agencyService;
@Override
public PageData<ScreenWorkRecordOrgDailyDTO> page(Map<String, Object> params) {
IPage<ScreenWorkRecordOrgDailyEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, ScreenWorkRecordOrgDailyDTO.class);
}
@Override
public List<ScreenWorkRecordOrgDailyDTO> list(Map<String, Object> params) {
List<ScreenWorkRecordOrgDailyEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, ScreenWorkRecordOrgDailyDTO.class);
}
private QueryWrapper<ScreenWorkRecordOrgDailyEntity> getWrapper(Map<String, Object> params) {
String id = (String) params.get(FieldConstant.ID_HUMP);
QueryWrapper<ScreenWorkRecordOrgDailyEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public ScreenWorkRecordOrgDailyDTO get(String id) {
ScreenWorkRecordOrgDailyEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, ScreenWorkRecordOrgDailyDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(ScreenWorkRecordOrgDailyDTO dto) {
ScreenWorkRecordOrgDailyEntity entity = ConvertUtils.sourceToTarget(dto, ScreenWorkRecordOrgDailyEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(ScreenWorkRecordOrgDailyDTO dto) {
ScreenWorkRecordOrgDailyEntity entity = ConvertUtils.sourceToTarget(dto, ScreenWorkRecordOrgDailyEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
@Override
public WorkRecordRankResultDTO rankList(WorkRecordRankFormDTO formDTO) {
ScreenCustomerAgencyDTO agencyDTO=agencyService.queryAgencyInfo(formDTO.getAgencyId());
if(null==agencyDTO){
throw new RenException(String.format("获取组织信息异常,agencyId:%s",formDTO.getAgencyId()));
}
WorkRecordRankResultDTO resultDTO=new WorkRecordRankResultDTO();
String dateId=baseDao.selectLatestDateId(formDTO.getCustomerId());
resultDTO.setSubRankList(baseDao.selectSubList(agencyDTO.getAreaCode(),formDTO.getDataType(),formDTO.getTopRow(),dateId));
//todo 待完善
return resultDTO;
}
}

101
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/impl/ScreenWorkRecordOrgMonthlyServiceImpl.java

@ -0,0 +1,101 @@
/**
* 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.epmet.datareport.service.plugins.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.datareport.dao.plugins.ScreenWorkRecordOrgMonthlyDao;
import com.epmet.datareport.entity.plugins.ScreenWorkRecordOrgMonthlyEntity;
import com.epmet.datareport.service.plugins.ScreenWorkRecordOrgMonthlyService;
import com.epmet.plugins.ScreenWorkRecordOrgMonthlyDTO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 工作日志-组织按月统计(增量)
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-02-23
*/
@Slf4j
@Service
public class ScreenWorkRecordOrgMonthlyServiceImpl extends BaseServiceImpl<ScreenWorkRecordOrgMonthlyDao, ScreenWorkRecordOrgMonthlyEntity> implements ScreenWorkRecordOrgMonthlyService {
@Override
public PageData<ScreenWorkRecordOrgMonthlyDTO> page(Map<String, Object> params) {
IPage<ScreenWorkRecordOrgMonthlyEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, ScreenWorkRecordOrgMonthlyDTO.class);
}
@Override
public List<ScreenWorkRecordOrgMonthlyDTO> list(Map<String, Object> params) {
List<ScreenWorkRecordOrgMonthlyEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, ScreenWorkRecordOrgMonthlyDTO.class);
}
private QueryWrapper<ScreenWorkRecordOrgMonthlyEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<ScreenWorkRecordOrgMonthlyEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public ScreenWorkRecordOrgMonthlyDTO get(String id) {
ScreenWorkRecordOrgMonthlyEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, ScreenWorkRecordOrgMonthlyDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(ScreenWorkRecordOrgMonthlyDTO dto) {
ScreenWorkRecordOrgMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, ScreenWorkRecordOrgMonthlyEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(ScreenWorkRecordOrgMonthlyDTO dto) {
ScreenWorkRecordOrgMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, ScreenWorkRecordOrgMonthlyEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
}

28
epmet-module/data-report/data-report-server/src/main/resources/mapper/plugins/ScreenCustomerWorkRecordDictDao.xml

@ -0,0 +1,28 @@
<?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.epmet.datareport.dao.plugins.ScreenCustomerWorkRecordDictDao">
<resultMap type="com.epmet.datareport.entity.plugins.ScreenCustomerWorkRecordDictEntity" id="screenCustomerWorkRecordDictMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="dateId" column="DATE_ID"/>
<result property="dictId" column="DICT_ID"/>
<result property="pid" column="PID"/>
<result property="resourceType" column="RESOURCE_TYPE"/>
<result property="resourceCode" column="RESOURCE_CODE"/>
<result property="resourceLabel" column="RESOURCE_LABEL"/>
<result property="showFlag" column="SHOW_FLAG"/>
<result property="sort" column="SORT"/>
<result property="dataType" column="DATA_TYPE"/>
<result property="level" column="LEVEL"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<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>
</mapper>

32
epmet-module/data-report/data-report-server/src/main/resources/mapper/plugins/ScreenWorkRecordOrgDailyDao.xml

@ -0,0 +1,32 @@
<?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.epmet.datareport.dao.plugins.ScreenWorkRecordOrgDailyDao">
<select id="selectLatestDateId" resultType="java.lang.String" parameterType="java.lang.String">
SELECT
max( m.DATE_ID ) AS maxDateId
FROM
screen_work_record_org_daily m
WHERE
m.DEL_FLAG = '0'
AND m.CUSTOMER_ID = #{customerId}
</select>
<select id="selectSubList" parameterType="map" resultType="com.epmet.plugins.result.WorkRecordSubRank">
SELECT
sca.AGENCY_ID as orgId,
sca.AGENCY_NAME as `NAME`,
IFNULL(sum(m.PARTICIPATE_USER_TOTAL),0) as participateUserTotal,
IFNULL(sum(m.ORGANIZE_TOTAL) ,0)as participateTotal
FROM
screen_customer_agency sca
LEFT JOIN screen_work_record_org_daily m ON ( sca.AGENCY_ID = m.ORG_ID AND m.DEL_FLAG = '0' and m.DATE_ID=#{dateId})
left join screen_customer_work_record_dict dict on(m.TYPE_CODE=dict.RESOURCE_CODE and dict.DEL_FLAG='0')
WHERE
sca.DEL_FLAG = '0'
AND sca.PARENT_AREA_CODE = #{areaCode}
and dict.DATA_TYPE=#{dataType}
group by sca.AGENCY_ID,sca.AGENCY_NAME
order by participateUserTotal desc,participateTotal desc limit #{topRow}
</select>
</mapper>

8
epmet-module/data-report/data-report-server/src/main/resources/mapper/plugins/ScreenWorkRecordOrgMonthlyDao.xml

@ -0,0 +1,8 @@
<?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.epmet.datareport.dao.plugins.ScreenWorkRecordOrgMonthlyDao">
</mapper>
Loading…
Cancel
Save