7 changed files with 0 additions and 524 deletions
@ -1,41 +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.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); |
|
||||
|
|
||||
} |
|
@ -1,88 +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.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-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; |
|
||||
|
|
||||
/** |
|
||||
* 月份Id:yyyyMM |
|
||||
*/ |
|
||||
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; |
|
||||
|
|
||||
} |
|
@ -1,106 +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.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); |
|
||||
} |
|
@ -1,130 +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.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.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 |
|
||||
*/ |
|
||||
@Transactional(rollbackFor = Exception.class) |
|
||||
@DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) |
|
||||
@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()); |
|
||||
}); |
|
||||
} |
|
||||
|
|
||||
} |
|
@ -1,94 +0,0 @@ |
|||||
<?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> |
|
Loading…
Reference in new issue