forked from luyan/epmet-cloud-lingshan
				
			
				 12 changed files with 212 additions and 373 deletions
			
			
		@ -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; | 
				
			|||
 | 
				
			|||
} | 
				
			|||
@ -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; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 月份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; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 删除标识 0未删除;1已删除 | 
				
			|||
     */ | 
				
			|||
	private String delFlag; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 乐观锁 | 
				
			|||
     */ | 
				
			|||
	private Integer revision; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 创建人 | 
				
			|||
     */ | 
				
			|||
	private String createdBy; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 创建时间 | 
				
			|||
     */ | 
				
			|||
	private Date createdTime; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 更新人 | 
				
			|||
     */ | 
				
			|||
	private String updatedBy; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 更新时间 | 
				
			|||
     */ | 
				
			|||
	private Date updatedTime; | 
				
			|||
 | 
				
			|||
} | 
				
			|||
@ -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); | 
				
			|||
} | 
				
			|||
@ -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); | 
				
			|||
} | 
				
			|||
@ -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()); | 
				
			|||
        }); | 
				
			|||
    } | 
				
			|||
} | 
				
			|||
@ -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…
					
					
				
		Reference in new issue