Browse Source

workrecord接口

master
wangchao 5 years ago
parent
commit
b8271c2638
  1. 126
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/plugins/ScreenCustomerWorkRecordDictDTO.java
  2. 121
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/plugins/ScreenWorkRecordGridMonthlyDTO.java
  3. 121
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/plugins/ScreenWorkRecordOrgMonthlyDTO.java
  4. 87
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/plugins/WorkRecordColController.java
  5. 41
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/plugins/ScreenCustomerWorkRecordDictDao.java
  6. 41
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/plugins/ScreenWorkRecordGridMonthlyDao.java
  7. 42
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/plugins/ScreenWorkRecordOrgMonthlyDao.java
  8. 96
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/plugins/ScreenCustomerWorkRecordDictEntity.java
  9. 91
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/plugins/ScreenWorkRecordGridMonthlyEntity.java
  10. 91
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/plugins/ScreenWorkRecordOrgMonthlyEntity.java
  11. 106
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/ScreenCustomerWorkRecordDictService.java
  12. 106
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/ScreenWorkRecordGridMonthlyService.java
  13. 106
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/ScreenWorkRecordOrgMonthlyService.java
  14. 122
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/impl/ScreenCustomerWorkRecordDictServiceImpl.java
  15. 126
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/impl/ScreenWorkRecordGridMonthlyServiceImpl.java
  16. 126
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/impl/ScreenWorkRecordOrgMonthlyServiceImpl.java
  17. 98
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/plugins/ScreenCustomerWorkRecordDictDao.xml
  18. 94
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/plugins/ScreenWorkRecordGridMonthlyDao.xml
  19. 96
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/plugins/ScreenWorkRecordOrgMonthlyDao.xml

126
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/plugins/ScreenCustomerWorkRecordDictDTO.java

@ -0,0 +1,126 @@
/**
* 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.dto.plugins;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 工作日志资源字典表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-02-04
*/
@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;
}

121
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/plugins/ScreenWorkRecordGridMonthlyDTO.java

@ -0,0 +1,121 @@
/**
* 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.dto.plugins;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 工作日志-网格按月统计
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-02-04
*/
@Data
public class ScreenWorkRecordGridMonthlyDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* ID 主键
*/
private String id;
/**
* 客户Id
*/
private String customerId;
/**
* 月份IdyyyyMM
*/
private String monthId;
/**
* 网格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;
/**
* 删除标识 0未删除1已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

121
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/plugins/ScreenWorkRecordOrgMonthlyDTO.java

@ -0,0 +1,121 @@
/**
* 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.dto.plugins;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 工作日志-组织按月统计
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-02-04
*/
@Data
public class ScreenWorkRecordOrgMonthlyDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* ID 主键
*/
private String id;
/**
* 客户Id
*/
private String customerId;
/**
* 月份IdyyyyMM
*/
private String monthId;
/**
* 组织Id
*/
private String orgId;
/**
* 当前组织所属上级组织如果是跟组织此列为0
*/
private String parentId;
/**
* 会议类型编码对应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;
/**
* 删除标识 0未删除1已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

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

@ -1,7 +1,20 @@
package com.epmet.controller.plugins;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.exception.ValidateException;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.plugins.ScreenCustomerWorkRecordDictDTO;
import com.epmet.dto.plugins.ScreenWorkRecordGridMonthlyDTO;
import com.epmet.dto.plugins.ScreenWorkRecordOrgMonthlyDTO;
import com.epmet.dto.screencoll.ScreenCollFormDTO;
import com.epmet.service.plugins.ScreenCustomerWorkRecordDictService;
import com.epmet.service.plugins.ScreenWorkRecordGridMonthlyService;
import com.epmet.service.plugins.impl.ScreenWorkRecordOrgMonthlyServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
/**
* 工作日志数据采集
@ -11,6 +24,74 @@ import org.springframework.web.bind.annotation.RestController;
*/
@RestController
@RequestMapping("plugins/workrecord")
@Slf4j
public class WorkRecordColController {
//todo
@Autowired
ScreenCustomerWorkRecordDictService dictService;
@Autowired
ScreenWorkRecordGridMonthlyService gridMonthlyService;
@Autowired
ScreenWorkRecordOrgMonthlyServiceImpl orgMonthlyService;
/**
* @Description 工作日志客户资源字典信息上传
*
* 按月上传工作日志统计数据时同步调用此接口上传字典信息
* @param customerId
* @param data
* @return com.epmet.commons.tools.utils.Result
* @author wangc
* @date 2021.02.04 16:16
*/
@PostMapping("resource-dict")
public Result resourceDict(@RequestHeader("CustomerId")String customerId, @RequestBody ScreenCollFormDTO<ScreenCustomerWorkRecordDictDTO> data){
if(StringUtils.isBlank(customerId) || CollectionUtils.isEmpty(data.getDataList()) ||
StringUtils.isBlank(data.getDateId())) {
log.error("com.epmet.controller.plugins.WorkRecordColController.resourceDict,param:{}", JSON.toJSONString(data));
throw new ValidateException("客户Id、上传数据列表、日期Id不可为空");
}
dictService.collect(customerId,data);
return new Result();
}
/**
* @Description 工作日志网格按月统计
* @param customerId
* @param data
* @return com.epmet.commons.tools.utils.Result
* @author wangc
* @date 2021.02.04 16:16
*/
@PostMapping("grid-monthly")
public Result collectGrid(@RequestHeader("CustomerId")String customerId, @RequestBody ScreenCollFormDTO<ScreenWorkRecordGridMonthlyDTO> data){
if(StringUtils.isBlank(customerId) || CollectionUtils.isEmpty(data.getDataList()) ||
StringUtils.isBlank(data.getMonthId())) {
log.error("com.epmet.controller.plugins.WorkRecordColController.resourceDict,param:{}", JSON.toJSONString(data));
throw new ValidateException("客户Id、上传数据列表、月份Id不可为空");
}
gridMonthlyService.collect(customerId,data);
return new Result();
}
/**
* @Description 工作日志组织按月统计
* @param customerId
* @param data
* @return com.epmet.commons.tools.utils.Result
* @author wangc
* @date 2021.02.04 16:16
*/
@PostMapping("org-monthly")
public Result collectOrg(@RequestHeader("CustomerId")String customerId, @RequestBody ScreenCollFormDTO<ScreenWorkRecordOrgMonthlyDTO> data){
if(StringUtils.isBlank(customerId) || CollectionUtils.isEmpty(data.getDataList()) ||
StringUtils.isBlank(data.getMonthId())) {
log.error("com.epmet.controller.plugins.WorkRecordColController.resourceDict,param:{}", JSON.toJSONString(data));
throw new ValidateException("客户Id、上传数据列表、月份Id不可为空");
}
orgMonthlyService.collect(customerId,data);
return new Result();
}
}

41
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/plugins/ScreenCustomerWorkRecordDictDao.java

@ -0,0 +1,41 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao.plugins;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.plugins.ScreenCustomerWorkRecordDictDTO;
import com.epmet.entity.plugins.ScreenCustomerWorkRecordDictEntity;
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-04
*/
@Mapper
public interface ScreenCustomerWorkRecordDictDao extends BaseDao<ScreenCustomerWorkRecordDictEntity> {
int deleteBatch(@Param("customerId") String customerId);
void insertBatch(@Param("list") List<ScreenCustomerWorkRecordDictDTO> list,@Param("customerId") String customerId,@Param("dateId") String dateId);
}

41
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/plugins/ScreenWorkRecordGridMonthlyDao.java

@ -0,0 +1,41 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao.plugins;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.plugins.ScreenWorkRecordGridMonthlyDTO;
import com.epmet.entity.plugins.ScreenWorkRecordGridMonthlyEntity;
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-04
*/
@Mapper
public interface ScreenWorkRecordGridMonthlyDao extends BaseDao<ScreenWorkRecordGridMonthlyEntity> {
int deleteBatch(@Param("customerId") String customerId,@Param("monthId") String monthId);
void insertBatch(@Param("list") List<ScreenWorkRecordGridMonthlyDTO> list, @Param("customerId") String customerId, @Param("monthId") String monthId);
}

42
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/plugins/ScreenWorkRecordOrgMonthlyDao.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.ScreenWorkRecordOrgMonthlyDTO;
import com.epmet.entity.plugins.ScreenWorkRecordOrgMonthlyEntity;
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-04
*/
@Mapper
public interface ScreenWorkRecordOrgMonthlyDao extends BaseDao<ScreenWorkRecordOrgMonthlyEntity> {
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);
}

96
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/plugins/ScreenCustomerWorkRecordDictEntity.java

@ -0,0 +1,96 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity.plugins;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 工作日志资源字典表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-02-04
*/
@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;
}

91
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/plugins/ScreenWorkRecordGridMonthlyEntity.java

@ -0,0 +1,91 @@
/**
* 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;
import java.util.Date;
/**
* 工作日志-网格按月统计
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-02-04
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("screen_work_record_grid_monthly")
public class ScreenWorkRecordGridMonthlyEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户Id
*/
private String customerId;
/**
* 月份IdyyyyMM
*/
private String monthId;
/**
* 网格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;
}

91
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/plugins/ScreenWorkRecordOrgMonthlyEntity.java

@ -0,0 +1,91 @@
/**
* 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;
import java.util.Date;
/**
* 工作日志-组织按月统计
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-02-04
*/
@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;
/**
* 组织Id
*/
private String orgId;
/**
* 当前组织所属上级组织如果是跟组织此列为0
*/
private String parentId;
/**
* 会议类型编码对应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;
}

106
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/ScreenCustomerWorkRecordDictService.java

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

106
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/ScreenWorkRecordGridMonthlyService.java

@ -0,0 +1,106 @@
/**
* 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.commons.tools.page.PageData;
import com.epmet.dto.plugins.ScreenWorkRecordGridMonthlyDTO;
import com.epmet.dto.screencoll.ScreenCollFormDTO;
import com.epmet.entity.plugins.ScreenWorkRecordGridMonthlyEntity;
import java.util.List;
import java.util.Map;
/**
* 工作日志-网格按月统计
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-02-04
*/
public interface ScreenWorkRecordGridMonthlyService extends BaseService<ScreenWorkRecordGridMonthlyEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<ScreenWorkRecordGridMonthlyDTO>
* @author generator
* @date 2021-02-04
*/
PageData<ScreenWorkRecordGridMonthlyDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<ScreenWorkRecordGridMonthlyDTO>
* @author generator
* @date 2021-02-04
*/
List<ScreenWorkRecordGridMonthlyDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return ScreenWorkRecordGridMonthlyDTO
* @author generator
* @date 2021-02-04
*/
ScreenWorkRecordGridMonthlyDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2021-02-04
*/
void save(ScreenWorkRecordGridMonthlyDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2021-02-04
*/
void update(ScreenWorkRecordGridMonthlyDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2021-02-04
*/
void delete(String[] ids);
/**
* @Description 数据录入
* @param customerId
* @param data
* @return void
* @author wangc
* @date 2021.02.04 15:27
*/
void collect(String customerId, ScreenCollFormDTO<ScreenWorkRecordGridMonthlyDTO> data);
}

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

@ -0,0 +1,106 @@
/**
* 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.commons.tools.page.PageData;
import com.epmet.dto.plugins.ScreenWorkRecordOrgMonthlyDTO;
import com.epmet.dto.screencoll.ScreenCollFormDTO;
import com.epmet.entity.plugins.ScreenWorkRecordOrgMonthlyEntity;
import java.util.List;
import java.util.Map;
/**
* 工作日志-组织按月统计
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-02-04
*/
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
* @param data
* @return void
* @author wangc
* @date 2021.02.04 15:27
*/
void collect(String customerId, ScreenCollFormDTO<ScreenWorkRecordOrgMonthlyDTO> data);
}

122
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/impl/ScreenCustomerWorkRecordDictServiceImpl.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.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.ScreenCustomerWorkRecordDictDao;
import com.epmet.dto.plugins.ScreenCustomerWorkRecordDictDTO;
import com.epmet.dto.screencoll.ScreenCollFormDTO;
import com.epmet.entity.plugins.ScreenCustomerWorkRecordDictEntity;
import com.epmet.service.plugins.ScreenCustomerWorkRecordDictService;
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;
/**
* 工作日志资源字典表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-02-04
*/
@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));
}
@Transactional(rollbackFor = Exception.class)
@DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true)
@Override
public void collect(String customerId, ScreenCollFormDTO<ScreenCustomerWorkRecordDictDTO> data) {
if(data.getIsFirst()){
int affectedRows = baseDao.deleteBatch(customerId);
while(affectedRows > 0){
affectedRows = baseDao.deleteBatch(customerId);
}
}
Lists.partition(data.getDataList(), NumConstant.ONE_HUNDRED).forEach(list -> {
baseDao.insertBatch(list,customerId,data.getDateId());
});
}
}

126
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/impl/ScreenWorkRecordGridMonthlyServiceImpl.java

@ -0,0 +1,126 @@
/**
* 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.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.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.dao.plugins.ScreenWorkRecordGridMonthlyDao;
import com.epmet.dto.plugins.ScreenWorkRecordGridMonthlyDTO;
import com.epmet.dto.screencoll.ScreenCollFormDTO;
import com.epmet.entity.plugins.ScreenWorkRecordGridMonthlyEntity;
import com.epmet.service.plugins.ScreenWorkRecordGridMonthlyService;
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;
/**
* 工作日志-网格按月统计
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-02-04
*/
@Service
public class ScreenWorkRecordGridMonthlyServiceImpl extends BaseServiceImpl<ScreenWorkRecordGridMonthlyDao, ScreenWorkRecordGridMonthlyEntity> implements ScreenWorkRecordGridMonthlyService {
@Override
public PageData<ScreenWorkRecordGridMonthlyDTO> page(Map<String, Object> params) {
IPage<ScreenWorkRecordGridMonthlyEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, ScreenWorkRecordGridMonthlyDTO.class);
}
@Override
public List<ScreenWorkRecordGridMonthlyDTO> list(Map<String, Object> params) {
List<ScreenWorkRecordGridMonthlyEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, ScreenWorkRecordGridMonthlyDTO.class);
}
private QueryWrapper<ScreenWorkRecordGridMonthlyEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<ScreenWorkRecordGridMonthlyEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public ScreenWorkRecordGridMonthlyDTO get(String id) {
ScreenWorkRecordGridMonthlyEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, ScreenWorkRecordGridMonthlyDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(ScreenWorkRecordGridMonthlyDTO dto) {
ScreenWorkRecordGridMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, ScreenWorkRecordGridMonthlyEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(ScreenWorkRecordGridMonthlyDTO dto) {
ScreenWorkRecordGridMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, ScreenWorkRecordGridMonthlyEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
/**
* @Description 数据录入
* @param customerId
* @param data
* @return void
* @author wangc
* @date 2021.02.04 15:27
*/
@Override
public void collect(String customerId, ScreenCollFormDTO<ScreenWorkRecordGridMonthlyDTO> data) {
if(data.getIsFirst()){
int affectedRows = baseDao.deleteBatch(customerId,data.getMonthId());
while(affectedRows > 0){
affectedRows = baseDao.deleteBatch(customerId,data.getMonthId());
}
}
Lists.partition(data.getDataList(), NumConstant.ONE_HUNDRED).forEach(list -> {
baseDao.insertBatch(list,customerId,data.getMonthId());
});
}
}

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

@ -0,0 +1,126 @@
/**
* 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.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.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.dao.plugins.ScreenWorkRecordOrgMonthlyDao;
import com.epmet.dto.plugins.ScreenWorkRecordOrgMonthlyDTO;
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;
/**
* 工作日志-组织按月统计
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-02-04
*/
@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
* @param data
* @return void
* @author wangc
* @date 2021.02.04 15:27
*/
@Override
public void collect(String customerId, ScreenCollFormDTO<ScreenWorkRecordOrgMonthlyDTO> data) {
if(data.getIsFirst()){
int affectedRows = baseDao.deleteBatch(customerId,data.getMonthId());
while(affectedRows > 0){
affectedRows = baseDao.deleteBatch(customerId,data.getMonthId());
}
}
Lists.partition(data.getDataList(), NumConstant.ONE_HUNDRED).forEach(list -> {
baseDao.insertBatch(list,customerId,data.getMonthId());
});
}
}

98
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/plugins/ScreenCustomerWorkRecordDictDao.xml

@ -0,0 +1,98 @@
<?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.ScreenCustomerWorkRecordDictDao">
<resultMap type="com.epmet.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>
<insert id="insertBatch">
INSERT INTO screen_customer_work_record_dict
(
id,
customer_id,
date_id,
dict_id,
pid,
resource_type,
resource_code,
resource_label,
show_flag,
sort,
data_type,
`level`,
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.dictId},
#{item.pid},
#{item.resourceType},
#{item.resourceCode},
#{item.resourceLabel},
#{item.showFlag},
#{item.closedTotal},
#{item.sort},
#{item.dataType},
#{item.level},
'0',
0,
'APP_USER',
now(),
'APP_USER',
now()
)
</foreach>
</insert>
<delete id="deleteBatch">
delete from screen_customer_work_record_dict
where customer_id = #{customerId}
limit 1000
</delete>
</mapper>

94
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/plugins/ScreenWorkRecordGridMonthlyDao.xml

@ -0,0 +1,94 @@
<?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.ScreenWorkRecordGridMonthlyDao">
<resultMap type="com.epmet.entity.plugins.ScreenWorkRecordGridMonthlyEntity" id="screenWorkRecordGridMonthlyMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="monthId" column="MONTH_ID"/>
<result property="gridId" column="GRID_ID"/>
<result property="agencyId" column="AGENCY_ID"/>
<result property="meetingCode" column="MEETING_CODE"/>
<result property="typeCode" column="TYPE_CODE"/>
<result property="organizeTotal" column="ORGANIZE_TOTAL"/>
<result property="participateTotal" column="PARTICIPATE_TOTAL"/>
<result property="participateUserTotal" column="PARTICIPATE_USER_TOTAL"/>
<result property="avgParticipateUserTotal" column="AVG_PARTICIPATE_USER_TOTAL"/>
<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>
<insert id="insertBatch">
INSERT INTO screen_work_record_grid_monthly
(
id,
customer_id,
month_id,
grid_id,
agency_id,
meeting_code,
type_code,
organize_total,
participate_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},
#{monthId},
#{item.gridId},
#{item.agencyId},
#{item.meetingCode},
#{item.typeCode},
#{item.organizeTotal},
#{item.participateTotal},
#{item.participateUserTotal},
#{item.avgParticipateUserTotal},
'0',
0,
'APP_USER',
now(),
'APP_USER',
now()
)
</foreach>
</insert>
<delete id="deleteBatch">
delete from screen_work_record_grid_monthly
where customer_id = #{customerId}
and month_id = #{monthId}
limit 1000
</delete>
</mapper>

96
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/plugins/ScreenWorkRecordOrgMonthlyDao.xml

@ -0,0 +1,96 @@
<?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.ScreenWorkRecordOrgMonthlyDao">
<resultMap type="com.epmet.entity.plugins.ScreenWorkRecordOrgMonthlyEntity" id="screenWorkRecordOrgMonthlyMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="monthId" column="MONTH_ID"/>
<result property="orgId" column="ORG_ID"/>
<result property="parentId" column="PARENT_ID"/>
<result property="meetingCode" column="MEETING_CODE"/>
<result property="typeCode" column="TYPE_CODE"/>
<result property="organizeTotal" column="ORGANIZE_TOTAL"/>
<result property="participateTotal" column="PARTICIPATE_TOTAL"/>
<result property="participateUserTotal" column="PARTICIPATE_USER_TOTAL"/>
<result property="avgParticipateUserTotal" column="AVG_PARTICIPATE_USER_TOTAL"/>
<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>
<insert id="insertBatch">
INSERT INTO screen_work_record_org_monthly
(
id,
customer_id,
month_id,
org_id,
parent_id,
meeting_code,
type_code,
organize_total,
participate_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},
#{monthId},
#{item.orgId},
#{item.parentId},
#{item.meetingCode},
#{item.typeCode},
#{item.organizeTotal},
#{item.participateTotal},
#{item.participateUserTotal},
#{item.avgParticipateUserTotal},
'0',
0,
'APP_USER',
now(),
'APP_USER',
now()
)
</foreach>
</insert>
<delete id="deleteBatch">
delete from screen_work_record_org_monthly
where customer_id = #{customerId}
and month_id = #{monthId}
limit 1000
</delete>
</mapper>
Loading…
Cancel
Save