Browse Source

Merge remote-tracking branch 'origin/dev_areaCode' into dev_pyscreen

# Conflicts:
#	epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java
#	epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java
master
yinzuomei 5 years ago
parent
commit
3db7624cd6
  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. 26
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/ScreenWorkRecordOrgDailyDTO.java
  4. 8
      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
  26. 4
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/plugins/ScreenWorkRecordCommonFormDTO.java
  27. 57
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/plugins/ScreenWorkRecordGridDailyFormDTO.java
  28. 20
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/plugins/WorkRecordColController.java
  29. 42
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/plugins/ScreenWorkRecordOrgDailyDao.java
  30. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/plugins/ScreenWorkRecordOrgMonthlyDao.java
  31. 78
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/plugins/ScreenWorkRecordOrgDailyEntity.java
  32. 34
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/ScreenWorkRecordOrgDailyService.java
  33. 68
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/ScreenWorkRecordOrgMonthlyService.java
  34. 51
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/impl/ScreenWorkRecordOrgDailyServiceImpl.java
  35. 69
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/impl/ScreenWorkRecordOrgMonthlyServiceImpl.java
  36. 52
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/plugins/ScreenWorkRecordOrgDailyDao.xml
  37. 1
      epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/AreaCodeDao.java
  38. 40
      epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/AreaCodeServiceImpl.java
  39. 6
      epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/AreaCodeDao.xml
  40. 4
      epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/impl/OpenUpServiceImpl.java

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;
/**
* 当前组织的上级行政地区编码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;
}

26
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/plugins/ScreenWorkRecordGridMonthlyDTO.java → epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/ScreenWorkRecordOrgDailyDTO.java

@ -15,7 +15,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto.plugins;
package com.epmet.plugins;
import lombok.Data;
@ -24,13 +24,13 @@ import java.util.Date;
/**
* 工作日志-网格按月统计
* 工作日志-组织按日统计(累计值)
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-02-04
* @since v1.0.0 2021-02-23
*/
@Data
public class ScreenWorkRecordGridMonthlyDTO implements Serializable {
public class ScreenWorkRecordOrgDailyDTO implements Serializable {
private static final long serialVersionUID = 1L;
@ -45,19 +45,14 @@ public class ScreenWorkRecordGridMonthlyDTO implements Serializable {
private String customerId;
/**
* 月份IdyyyyMM
* 日期IdyyyyMMdd
*/
private String monthId;
private String dateId;
/**
* 网格id
* 组织Idor网格id
*/
private String gridId;
/**
* 网格所属的组织id
*/
private String agencyId;
private String orgId;
/**
* 会议类型编码对应screen_customer_work_record_dict的资源编码
@ -74,11 +69,6 @@ public class ScreenWorkRecordGridMonthlyDTO implements Serializable {
*/
private Integer organizeTotal;
/**
* 当前组织参与的总次数
*/
private Integer participateTotal;
/**
* 参与人数
*/

8
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/plugins/ScreenWorkRecordOrgMonthlyDTO.java → epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/ScreenWorkRecordOrgMonthlyDTO.java

@ -15,7 +15,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto.plugins;
package com.epmet.plugins;
import lombok.Data;
@ -24,10 +24,10 @@ import java.util.Date;
/**
* 工作日志-组织按月统计
* 工作日志-组织按月统计(增量)
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-02-04
* @since v1.0.0 2021-02-23
*/
@Data
public class ScreenWorkRecordOrgMonthlyDTO implements Serializable {
@ -50,7 +50,7 @@ public class ScreenWorkRecordOrgMonthlyDTO implements Serializable {
private String monthId;
/**
* 组织Id
* 组织Idor网格id
*/
private String orgId;

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;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.epmet.commons.tools.utils.Result;
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
@RequestMapping("plugins/workrecord")
public class WorkRecordController {
@Autowired
private ScreenWorkRecordOrgDailyService screenWorkRecordOrgDailyService;
//todo
//5、【工作日志】本机及下级排名
//NEI接口地址:https://nei.netease.com/interface/detail/?pid=57068&id=348966
@ -19,8 +26,12 @@ public class WorkRecordController {
//下级根据当前组织的areaCode查询下级列表,再去查询screen_work_record_org_daily
//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月趋势图

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

@ -4,6 +4,7 @@ import com.epmet.dto.form.AddAreaCodeDictFormDTO;
import com.epmet.dto.form.AreaCodeDictFormDTO;
import com.epmet.dto.result.AreaCodeDictResultDTO;
import com.epmet.dto.result.commonservice.AddAreaCodeDictResultDTO;
import com.epmet.dto.result.ScreenCustomerAgencyDTO;
import com.epmet.dto.result.plugins.AgencyNodeDTO;
import com.epmet.evaluationindex.screen.dto.form.CompartmentByBizTypeFormDTO;
import com.epmet.evaluationindex.screen.dto.form.CompartmentFormDTO;
@ -58,4 +59,6 @@ public interface AgencyService {
* @Date 2021/2/3 22:19
**/
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

@ -275,6 +275,7 @@ public class AgencyServiceImpl implements AgencyService {
* @description 查询当前组织及下级组织树
* @Date 2021/2/3 22:19
**/
@DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true)
@Override
public AgencyNodeDTO queryStaffAgencyTree(String agencyId) {
ScreenCustomerAgencyDTO agencyDTO = screenCustomerAgencyDao.selectByAgencyId(agencyId);
@ -290,4 +291,10 @@ public class AgencyServiceImpl implements AgencyService {
log.info(JSON.toJSONString(treeList));
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>

4
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/plugins/ScreenWorkRecordOrgDailyFormDTO.java → epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/plugins/ScreenWorkRecordCommonFormDTO.java

@ -5,13 +5,13 @@ import lombok.Data;
import java.io.Serializable;
/**
* 工作日志-组织按日统计(累计值)
* 工作日志-数据采集通用DTO
*
* @author yinzuomei@elink-cn.com
* @date 2021/2/21 18:49
*/
@Data
public class ScreenWorkRecordOrgDailyFormDTO implements Serializable {
public class ScreenWorkRecordCommonFormDTO implements Serializable {
private static final long serialVersionUID = 819322082786098071L;
/**

57
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/plugins/ScreenWorkRecordGridDailyFormDTO.java

@ -1,57 +0,0 @@
package com.epmet.dto.plugins;
import lombok.Data;
import java.io.Serializable;
/**
* 工作日志-网格按日统计(累计值)
*
* @author yinzuomei@elink-cn.com
* @date 2021/2/21 18:48
*/
@Data
public class ScreenWorkRecordGridDailyFormDTO implements Serializable {
private static final long serialVersionUID = 5993623581944585517L;
/**
* 网格id
*/
private String gridId;
/**
* 网格所属的组织id
*/
private String agencyId;
/**
* 会议类型编码对应screen_customer_work_record_dict的资源编码
*/
private String meetingCode;
/**
* 随手记类型编码对应screen_customer_work_record_dict的资源编码
*/
private String typeCode;
/**
* 组织次数
*/
private Integer organizeTotal;
/**
* 当前组织参与的总次数
*/
private Integer participateTotal;
/**
* 参与人数
*/
private Integer participateUserTotal;
/**
* 平均参与人数
*/
private Integer avgParticipateUserTotal;
}

20
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/plugins/WorkRecordColController.java

@ -3,10 +3,12 @@ package com.epmet.controller.plugins;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.exception.ValidateException;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.plugins.*;
import com.epmet.dto.plugins.ScreenCustomerWorkRecordDictDTO;
import com.epmet.dto.plugins.ScreenWorkRecordCommonFormDTO;
import com.epmet.dto.screencoll.ScreenCollFormDTO;
import com.epmet.service.plugins.ScreenCustomerWorkRecordDictService;
import com.epmet.service.plugins.impl.ScreenWorkRecordOrgMonthlyServiceImpl;
import com.epmet.service.plugins.ScreenWorkRecordOrgDailyService;
import com.epmet.service.plugins.ScreenWorkRecordOrgMonthlyService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -27,8 +29,9 @@ public class WorkRecordColController {
@Autowired
ScreenCustomerWorkRecordDictService dictService;
@Autowired
ScreenWorkRecordOrgMonthlyServiceImpl orgMonthlyService;
private ScreenWorkRecordOrgMonthlyService screenWorkRecordOrgMonthlyService;
@Autowired
private ScreenWorkRecordOrgDailyService screenWorkRecordOrgDailyService;
/**
* @Description 工作日志客户资源字典信息上传
*
@ -59,13 +62,13 @@ public class WorkRecordColController {
* @date 2021.02.04 16:16
*/
@PostMapping("org-monthly")
public Result collectOrg(@RequestHeader("CustomerId")String customerId, @RequestBody ScreenCollFormDTO<ScreenWorkRecordOrgMonthlyDTO> data){
public Result collectOrg(@RequestHeader("CustomerId")String customerId, @RequestBody ScreenCollFormDTO<ScreenWorkRecordCommonFormDTO> data){
if(StringUtils.isBlank(customerId) || CollectionUtils.isEmpty(data.getDataList()) ||
StringUtils.isBlank(data.getMonthId())) {
log.error("com.epmet.controller.plugins.WorkRecordColController.collectOrg,param:{}", JSON.toJSONString(data));
throw new ValidateException("客户Id、上传数据列表、月份Id不可为空");
}
orgMonthlyService.collect(customerId,data);
screenWorkRecordOrgMonthlyService.collect(customerId,data);
return new Result();
}
@ -78,14 +81,13 @@ public class WorkRecordColController {
* @date 2021.02.04 16:16
*/
@PostMapping("org-daily")
public Result collectOrgDaily(@RequestHeader("CustomerId")String customerId, @RequestBody ScreenCollFormDTO<ScreenWorkRecordOrgDailyFormDTO> data){
public Result collectOrgDaily(@RequestHeader("CustomerId")String customerId, @RequestBody ScreenCollFormDTO<ScreenWorkRecordCommonFormDTO> data){
if(StringUtils.isBlank(customerId) || CollectionUtils.isEmpty(data.getDataList()) ||
StringUtils.isBlank(data.getDateId())) {
log.error("com.epmet.controller.plugins.WorkRecordColController.collectOrgDaily,param:{}", JSON.toJSONString(data));
throw new ValidateException("客户Id、上传数据列表、日期Id不可为空");
}
//todo
// orgMonthlyService.collectOrgDaily(customerId,data);
screenWorkRecordOrgDailyService.collectOrgDaily(customerId,data);
return new Result();
}
}

42
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/plugins/ScreenWorkRecordOrgDailyDao.java

@ -0,0 +1,42 @@
/**
* 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.dao.plugins;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.plugins.ScreenWorkRecordCommonFormDTO;
import com.epmet.entity.plugins.ScreenWorkRecordOrgDailyEntity;
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> {
int deleteBatch(@Param("customerId") String customerId, @Param("dateId") String dateId);
void insertBatch(@Param("list") List<ScreenWorkRecordCommonFormDTO> list,
@Param("customerId") String customerId,
@Param("dateId") String dateId);
}

4
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/plugins/ScreenWorkRecordOrgMonthlyDao.java

@ -18,7 +18,7 @@
package com.epmet.dao.plugins;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.plugins.ScreenWorkRecordOrgMonthlyDTO;
import com.epmet.dto.plugins.ScreenWorkRecordCommonFormDTO;
import com.epmet.entity.plugins.ScreenWorkRecordOrgMonthlyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -36,7 +36,7 @@ public interface ScreenWorkRecordOrgMonthlyDao extends BaseDao<ScreenWorkRecordO
int deleteBatch(@Param("customerId") String customerId, @Param("monthId") String monthId);
void insertBatch(@Param("list") List<ScreenWorkRecordOrgMonthlyDTO> list, @Param("customerId") String customerId, @Param("monthId") String monthId);
void insertBatch(@Param("list") List<ScreenWorkRecordCommonFormDTO> list, @Param("customerId") String customerId, @Param("monthId") String monthId);
}

78
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/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.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;
}

34
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/ScreenWorkRecordOrgDailyService.java

@ -0,0 +1,34 @@
/**
* 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.service.plugins;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dto.plugins.ScreenWorkRecordCommonFormDTO;
import com.epmet.dto.screencoll.ScreenCollFormDTO;
import com.epmet.entity.plugins.ScreenWorkRecordOrgDailyEntity;
/**
* 工作日志-组织按日统计(累计值)
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-02-23
*/
public interface ScreenWorkRecordOrgDailyService extends BaseService<ScreenWorkRecordOrgDailyEntity> {
void collectOrgDaily(String customerId, ScreenCollFormDTO<ScreenWorkRecordCommonFormDTO> data);
}

68
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/ScreenWorkRecordOrgMonthlyService.java

@ -18,14 +18,10 @@
package com.epmet.service.plugins;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.plugins.ScreenWorkRecordOrgMonthlyDTO;
import com.epmet.dto.plugins.ScreenWorkRecordCommonFormDTO;
import com.epmet.dto.screencoll.ScreenCollFormDTO;
import com.epmet.entity.plugins.ScreenWorkRecordOrgMonthlyEntity;
import java.util.List;
import java.util.Map;
/**
* 工作日志-组织按月统计
*
@ -34,66 +30,6 @@ import java.util.Map;
*/
public interface ScreenWorkRecordOrgMonthlyService extends BaseService<ScreenWorkRecordOrgMonthlyEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<ScreenWorkRecordOrgMonthlyDTO>
* @author generator
* @date 2021-02-04
*/
PageData<ScreenWorkRecordOrgMonthlyDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<ScreenWorkRecordOrgMonthlyDTO>
* @author generator
* @date 2021-02-04
*/
List<ScreenWorkRecordOrgMonthlyDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return ScreenWorkRecordOrgMonthlyDTO
* @author generator
* @date 2021-02-04
*/
ScreenWorkRecordOrgMonthlyDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2021-02-04
*/
void save(ScreenWorkRecordOrgMonthlyDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2021-02-04
*/
void update(ScreenWorkRecordOrgMonthlyDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2021-02-04
*/
void delete(String[] ids);
/**
* @Description 数据录入
* @param customerId
@ -102,5 +38,5 @@ public interface ScreenWorkRecordOrgMonthlyService extends BaseService<ScreenWor
* @author wangc
* @date 2021.02.04 15:27
*/
void collect(String customerId, ScreenCollFormDTO<ScreenWorkRecordOrgMonthlyDTO> data);
void collect(String customerId, ScreenCollFormDTO<ScreenWorkRecordCommonFormDTO> data);
}

51
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/impl/ScreenWorkRecordOrgDailyServiceImpl.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.service.plugins.impl;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.dao.plugins.ScreenWorkRecordOrgDailyDao;
import com.epmet.dto.plugins.ScreenWorkRecordCommonFormDTO;
import com.epmet.dto.screencoll.ScreenCollFormDTO;
import com.epmet.entity.plugins.ScreenWorkRecordOrgDailyEntity;
import com.epmet.service.plugins.ScreenWorkRecordOrgDailyService;
import com.google.common.collect.Lists;
import org.springframework.stereotype.Service;
/**
* 工作日志-组织按日统计(累计值)
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-02-23
*/
@Service
public class ScreenWorkRecordOrgDailyServiceImpl extends BaseServiceImpl<ScreenWorkRecordOrgDailyDao, ScreenWorkRecordOrgDailyEntity> implements ScreenWorkRecordOrgDailyService {
@Override
public void collectOrgDaily(String customerId, ScreenCollFormDTO<ScreenWorkRecordCommonFormDTO> data) {
if(data.getIsFirst()){
int affectedRows = baseDao.deleteBatch(customerId,data.getDateId());
while(affectedRows > 0){
affectedRows = baseDao.deleteBatch(customerId,data.getDateId());
}
}
Lists.partition(data.getDataList(), NumConstant.ONE_HUNDRED).forEach(list -> {
baseDao.insertBatch(list,customerId,data.getDateId());
});
}
}

69
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/impl/ScreenWorkRecordOrgMonthlyServiceImpl.java

@ -17,30 +17,19 @@
package com.epmet.service.plugins.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.plugins.ScreenWorkRecordOrgMonthlyDao;
import com.epmet.dto.plugins.ScreenWorkRecordOrgMonthlyDTO;
import com.epmet.dto.plugins.ScreenWorkRecordCommonFormDTO;
import com.epmet.dto.screencoll.ScreenCollFormDTO;
import com.epmet.entity.plugins.ScreenWorkRecordOrgMonthlyEntity;
import com.epmet.service.plugins.ScreenWorkRecordOrgMonthlyService;
import com.google.common.collect.Lists;
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;
/**
* 工作日志-组织按月统计
*
@ -50,60 +39,6 @@ import java.util.Map;
@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));
}
/**
* @Description 数据录入
* @param customerId
@ -115,7 +50,7 @@ public class ScreenWorkRecordOrgMonthlyServiceImpl extends BaseServiceImpl<Scree
@Transactional(rollbackFor = Exception.class)
@DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true)
@Override
public void collect(String customerId, ScreenCollFormDTO<ScreenWorkRecordOrgMonthlyDTO> data) {
public void collect(String customerId, ScreenCollFormDTO<ScreenWorkRecordCommonFormDTO> data) {
if(data.getIsFirst()){
int affectedRows = baseDao.deleteBatch(customerId,data.getMonthId());
while(affectedRows > 0){

52
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/plugins/ScreenWorkRecordOrgDailyDao.xml

@ -0,0 +1,52 @@
<?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.dao.plugins.ScreenWorkRecordOrgDailyDao">
<delete id="deleteBatch" parameterType="map">
delete from screen_work_record_org_daily
where customer_id = #{customerId}
and DATE_ID = #{dateId}
limit 1000
</delete>
<insert id="insertBatch" parameterType="map">
INSERT INTO screen_work_record_org_daily
(
id,
customer_id,
DATE_ID,
org_id,
meeting_code,
type_code,
organize_total,
participate_user_total,
avg_participate_user_total,
del_flag,
revision,
created_by,
created_time,
updated_by,
updated_time
) values
<foreach collection="list" item="item" index="index" separator=",">
(
(SELECT REPLACE(UUID(), '-', '') AS id),
#{customerId},
#{dateId},
#{item.orgId},
#{item.meetingCode},
#{item.typeCode},
#{item.organizeTotal},
#{item.participateUserTotal},
#{item.avgParticipateUserTotal},
'0',
0,
'APP_USER',
now(),
'APP_USER',
now()
)
</foreach>
</insert>
</mapper>

1
epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/AreaCodeDao.java

@ -35,4 +35,5 @@ public interface AreaCodeDao extends BaseDao<AreaCodeEntity> {
List<AreaCodeDTO> selectAllArea();
AreaCodeDTO selectByCountyCode(String countyCode);
}

40
epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/AreaCodeServiceImpl.java

@ -40,6 +40,7 @@ import com.epmet.entity.AreaCodeEntity;
import com.epmet.redis.AreaCodeRedis;
import com.epmet.service.AreaCodeChildService;
import com.epmet.service.AreaCodeService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -55,6 +56,7 @@ import java.util.stream.Collectors;
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-01-07
*/
@Slf4j
@Service
public class AreaCodeServiceImpl extends BaseServiceImpl<AreaCodeDao, AreaCodeEntity> implements AreaCodeService {
@ -568,6 +570,10 @@ public class AreaCodeServiceImpl extends BaseServiceImpl<AreaCodeDao, AreaCodeEn
**/
@Override
public String addStreetCommAreaCode(AddAreaCodeDictFormDTO formDTO) {
String originalParentCode = formDTO.getParentAreaCode().replaceAll("_UD", "");
if (originalParentCode.length() < NumConstant.SIX) {
throw new RenException("目前只允许添加街道或社区");
}
if (StringUtils.isNotBlank(formDTO.getCode())) {
AreaCodeChildDTO areaCodeChildDTO = childDao.selectByCode(formDTO.getCode().trim());
if (null == areaCodeChildDTO) {
@ -579,7 +585,10 @@ public class AreaCodeServiceImpl extends BaseServiceImpl<AreaCodeDao, AreaCodeEn
}
AreaCodeChildDTO parent = childDao.selectByCode(formDTO.getParentAreaCode().trim());
if (null == parent) {
throw new RenException("parentAreaCode不存在");
AreaCodeDTO areaCodeDTOP = baseDao.selectByCountyCode(formDTO.getParentAreaCode().trim());
if (null == areaCodeDTOP) {
throw new RenException("parentAreaCode不存在");
}
}
//同一级不允许重名
@ -590,8 +599,12 @@ public class AreaCodeServiceImpl extends BaseServiceImpl<AreaCodeDao, AreaCodeEn
AreaCodeChildDTO areaCodeChildDTO = new AreaCodeChildDTO();
areaCodeChildDTO.setName(formDTO.getName().trim());
areaCodeChildDTO.setPCode(formDTO.getParentAreaCode().trim());
//4:街道;5:社区或村委会
areaCodeChildDTO.setLevel(formDTO.getParentAreaCode().length() == NumConstant.SIX ? NumConstant.FOUR : NumConstant.FIVE);
if (formDTO.getParentAreaCode().length() == NumConstant.SIX) {
//如果是增加街道
areaCodeChildDTO.setLevel(NumConstant.FOUR);
} else {
areaCodeChildDTO.setLevel(null != parent && null != parent.getLevel() ? parent.getLevel() + 1 : null);
}
//获取子级中最大的编码
AreaCodeChildDTO maxChildDto = childDao.selectMaxChild(formDTO.getParentAreaCode().trim());
if (null == maxChildDto) {
@ -599,13 +612,28 @@ public class AreaCodeServiceImpl extends BaseServiceImpl<AreaCodeDao, AreaCodeEn
areaCodeChildDTO.setCode(formDTO.getParentAreaCode().concat("001_UD"));
} else {
//去掉_UD +1赋值;370124001225_UD 锦源社区
String[] codeArr = maxChildDto.getCode().split(StrConstant.UNDER_LINE);
/*String[] codeArr = maxChildDto.getCode().split(StrConstant.UNDER_LINE);
long code = Long.parseLong(codeArr[NumConstant.ZERO]) + NumConstant.ONE;
areaCodeChildDTO.setCode(String.valueOf(code).concat("_UD"));
areaCodeChildDTO.setCode(String.valueOf(code).concat("_UD"));*/
String subStr = maxChildDto.getCode().replaceAll(formDTO.getParentAreaCode(), "");
String[] codeArr = subStr.split(StrConstant.UNDER_LINE);
long num = Long.parseLong(codeArr[NumConstant.ZERO]) + NumConstant.ONE;
String numStr = String.valueOf(num);
String temp = "";
if (numStr.length() == 2) {
temp = "0".concat(numStr);
} else if (numStr.length() == 1) {
temp = "00".concat(numStr);
} else {
temp = numStr;
}
areaCodeChildDTO.setCode(formDTO.getParentAreaCode().concat(temp).concat("_UD"));
/*log.info("最大="+maxChildDto.getCode()+";去初父级("+formDTO.getParentAreaCode()+"):"+subStr);
log.info("数字位+1="+num);
log.info("temp="+temp);*/
}
//保存到area_code_child表
areaCodeChildService.save(areaCodeChildDTO);
return areaCodeChildDTO.getCode();
}
}

6
epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/AreaCodeDao.xml

@ -5,6 +5,10 @@
<select id="selectAllArea" resultType="com.epmet.dto.AreaCodeDTO">
select * from area_code;
select * from area_code
</select>
<select id="selectByCountyCode" resultType="com.epmet.dto.AreaCodeDTO">
select * from area_code m where m.COUNTY_CODE=#{countyCode}
</select>
</mapper>

4
epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/impl/OpenUpServiceImpl.java

@ -1,5 +1,6 @@
package com.epmet.service.impl;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.exception.RenException;
@ -188,12 +189,13 @@ public class OpenUpServiceImpl implements OpenUpService {
}
//如果有子客户,根据area_code构造权限树
if (!CollectionUtils.isEmpty(crmResult.getData())) {
log.warn(String.format("当前客户id%s,子客户列表%s", formDTO.getCustomerId(), JSON.toJSONString(crmResult)));
Result<com.epmet.dto.result.plugins.AgencyNodeDTO> dataStatResult=dataReportOpenFeignClient.queryStaffAgencyTree(formDTO.getAgencyId());
if (!dataStatResult.success() && null == dataStatResult) {
throw new RenException("调用data-stats服务的XXX接口异常"+dataStatResult.getInternalMsg());
}
StaffPermissionResultDTO resultDTO = new StaffPermissionResultDTO();
resultDTO.setCustomerIds(Arrays.asList());
resultDTO.setCustomerIds(crmResult.getData());
resultDTO.setAgencyTree(ConvertUtils.sourceToTarget(dataStatResult.getData(), AgencyNodeDTO.class));
return resultDTO;
}

Loading…
Cancel
Save