Browse Source

工作日志采集API

master
yinzuomei 5 years ago
parent
commit
da96b58174
  1. 4
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/plugins/ScreenWorkRecordCommonFormDTO.java
  2. 57
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/plugins/ScreenWorkRecordGridDailyFormDTO.java
  3. 122
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/plugins/ScreenWorkRecordGridMonthlyDTO.java
  4. 20
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/plugins/WorkRecordColController.java
  5. 42
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/plugins/ScreenWorkRecordOrgDailyDao.java
  6. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/plugins/ScreenWorkRecordOrgMonthlyDao.java
  7. 62
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/plugins/ScreenWorkRecordOrgDailyEntity.java
  8. 34
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/ScreenWorkRecordOrgDailyService.java
  9. 68
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/ScreenWorkRecordOrgMonthlyService.java
  10. 51
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/impl/ScreenWorkRecordOrgDailyServiceImpl.java
  11. 69
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/impl/ScreenWorkRecordOrgMonthlyServiceImpl.java
  12. 52
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/plugins/ScreenWorkRecordOrgDailyDao.xml

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;
}

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

@ -1,122 +0,0 @@
/**
* 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 lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 工作日志-网格按月统计
*
* @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;
}

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);
}

62
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/plugins/ScreenWorkRecordOrgMonthlyDTO.java → epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/plugins/ScreenWorkRecordOrgDailyEntity.java

@ -15,29 +15,25 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto.plugins;
package com.epmet.entity.plugins;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import lombok.EqualsAndHashCode;
/**
* 工作日志-组织按月统计
* 工作日志-组织按日统计(累计值)
*
* @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 {
private static final long serialVersionUID = 1L;
@EqualsAndHashCode(callSuper=false)
@TableName("screen_work_record_org_daily")
public class ScreenWorkRecordOrgDailyEntity extends BaseEpmetEntity {
/**
* ID 主键
*/
private String id;
private static final long serialVersionUID = 1L;
/**
* 客户Id
@ -45,12 +41,12 @@ public class ScreenWorkRecordOrgMonthlyDTO implements Serializable {
private String customerId;
/**
* 月份IdyyyyMM
* 日期IdyyyyMMdd
*/
private String monthId;
private String dateId;
/**
* 组织Id
* 组织Idor网格id
*/
private String orgId;
@ -79,34 +75,4 @@ public class ScreenWorkRecordOrgMonthlyDTO implements Serializable {
*/
private Integer avgParticipateUserTotal;
/**
* 删除标识 0未删除1已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}
}

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>
Loading…
Cancel
Save