Browse Source

Merge remote-tracking branch 'origin/dev_screen_data' into dev_screen_data

dev_shibei_match
yinzuomei 5 years ago
parent
commit
9eee71251e
  1. 61
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/VoluntaryActivityDataFormDTO.java
  2. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenCollController.java
  3. 62
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenVoluntaryActivityDataDao.java
  4. 86
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenVoluntaryActivityDataEntity.java
  5. 12
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/ScreenCollService.java
  6. 20
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/ScreenCollServiceImpl.java
  7. 57
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenVoluntaryActivityDataDao.xml

61
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/VoluntaryActivityDataFormDTO.java

@ -1,61 +0,0 @@
package com.epmet.dto.screencoll.form;
import lombok.Data;
import java.io.Serializable;
/**
* 13党建引领-志愿活动服务数据 入参
* @Auther: zhangyong
* @Date: 2020-08-18 09:59
*/
@Data
public class VoluntaryActivityDataFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 客户id
*/
private String customerId;
/**
* yyyy
*/
private String yearId;
/**
* yyyyMM
*/
private String monthId;
/**
* 组织类别 agency组织部门department网格grid
*/
private String orgType;
/**
* 组织Id 可以为网格机关id
*/
private String orgId;
/**
* 上级组织Id
*/
private String parentId;
/**
* 组织名称
*/
private String orgName;
/**
* 组织活动次数
*/
private Integer activetyCount;
/**
* 活动参与人数
*/
private Integer joinUserCount;
}

13
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenCollController.java

@ -186,19 +186,6 @@ public class ScreenCollController {
return screenCollService.insertCustomerAgency(formDTO);
}
/**
* 13党建引领-志愿活动服务数据
*
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @Author zhangyong
* @Date 10:52 2020-08-18
**/
@PostMapping("voluntaryactivitydata")
public Result voluntaryActivityData(@RequestBody List<VoluntaryActivityDataFormDTO> formDTO) {
return screenCollService.insertVoluntaryActivityData(formDTO);
}
/**
* 12中央区各类总数
*

62
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenVoluntaryActivityDataDao.java

@ -1,62 +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.screen;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.screencoll.form.VoluntaryActivityDataFormDTO;
import com.epmet.entity.screen.ScreenVoluntaryActivityDataEntity;
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 2020-08-18
*/
@Mapper
public interface ScreenVoluntaryActivityDataDao extends BaseDao<ScreenVoluntaryActivityDataEntity> {
/**
* 13党建引领-志愿活动服务数据
* 1) 根据CUSTOMER_IDYEAR_IDMONTH_IDORG_ID进行查询如果有数据则先进行物理删除
*
* @param customerId
* @param yearId
* @param monthId
* @param orgIds 组织Id集合
* @Author zhangyong
* @Date 10:52 2020-08-18
**/
void deleteVoluntaryActivityData(@Param("customerId") String customerId,
@Param("yearId") String yearId,
@Param("monthId") String monthId,
@Param("orgIds") String[] orgIds);
/**
* 13党建引领-志愿活动服务数据
* 2) 在批量新增
*
* @param list
* @Author zhangyong
* @Date 10:52 2020-08-18
**/
void batchInsertVoluntaryActivityData(@Param("list") List<VoluntaryActivityDataFormDTO> list);
}

86
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenVoluntaryActivityDataEntity.java

@ -1,86 +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.screen;
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 2020-08-18
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("screen_voluntary_activity_data")
public class ScreenVoluntaryActivityDataEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户Id
*/
private String customerId;
/**
* 年Id
*/
private String yearId;
/**
* 月份Id
*/
private String monthId;
/**
* 组织类别 agency组织部门department网格grid
*/
private String orgType;
/**
* 组织Id 可以为网格机关id
*/
private String orgId;
/**
* 上级组织Id
*/
private String parentId;
/**
* 组织名称
*/
private String orgName;
/**
* 组织活动次数
*/
private Integer activetyCount;
/**
* 活动参与人数
*/
private Integer joinUserCount;
}

12
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/ScreenCollService.java

@ -151,18 +151,6 @@ public interface ScreenCollService {
**/
Result insertCustomerAgency(List<CustomerAgencyFormDTO> formDTO);
/**
* 13党建引领-志愿活动服务数据
* 1) 根据CUSTOMER_IDYEAR_IDMONTH_IDORG_ID进行查询如果有数据则先进行物理删除
* 2) 在新增
*
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @Author zhangyong
* @Date 10:52 2020-08-18
**/
Result insertVoluntaryActivityData(List<VoluntaryActivityDataFormDTO> formDTO);
/**
* 12中央区各类总数
* 1) 根据CUSTOMER_IDORG_ID进行查询如果有数据则先进行物理删除

20
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/ScreenCollServiceImpl.java

@ -65,8 +65,6 @@ public class ScreenCollServiceImpl implements ScreenCollService {
@Autowired
private ScreenCustomerAgencyDao screenCustomerAgencyDao;
@Autowired
private ScreenVoluntaryActivityDataDao screenVoluntaryActivityDataDao;
@Autowired
private ScreenUserTotalDataDao screenUserTotalDataDao;
@Autowired
private ScreenUserJoinDao screenUserJoinDao;
@ -277,24 +275,6 @@ public class ScreenCollServiceImpl implements ScreenCollService {
return new Result();
}
@Override
@Transactional(rollbackFor = Exception.class)
public Result insertVoluntaryActivityData(List<VoluntaryActivityDataFormDTO> formDTO) {
if (null != formDTO && formDTO.size() > NumConstant.ZERO){
String[] orgIds = new String[formDTO.size()];
for (int i = NumConstant.ZERO; i < formDTO.size(); i++){
orgIds[i] = formDTO.get(i).getOrgId();
}
screenVoluntaryActivityDataDao.deleteVoluntaryActivityData(formDTO.get(NumConstant.ZERO).getCustomerId(),
formDTO.get(NumConstant.ZERO).getYearId(),
formDTO.get(NumConstant.ZERO).getMonthId(),
orgIds);
screenVoluntaryActivityDataDao.batchInsertVoluntaryActivityData(formDTO);
}
return new Result();
}
@Override
@Transactional(rollbackFor = Exception.class)
public Result insertUserTotalData(List<UserTotalDataFormDTO> formDTO) {

57
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenVoluntaryActivityDataDao.xml

@ -1,57 +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.screen.ScreenVoluntaryActivityDataDao">
<delete id="deleteVoluntaryActivityData">
delete from screen_voluntary_activity_data
where CUSTOMER_ID = #{customerId} AND YEAR_ID = #{yearId} AND MONTH_ID = #{monthId}
AND ORG_ID IN
<foreach item="item" collection="orgIds" open="(" separator="," close=")">
#{item}
</foreach>
</delete>
<insert id="batchInsertVoluntaryActivityData" parameterType="java.util.List">
insert into screen_voluntary_activity_data
(
ID,
CUSTOMER_ID,
YEAR_ID,
MONTH_ID,
ORG_TYPE,
ORG_ID,
PARENT_ID,
ORG_NAME,
ACTIVETY_COUNT,
JOIN_USER_COUNT,
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),
#{item.customerId},
#{item.yearId},
#{item.monthId},
#{item.orgType},
#{item.orgId},
#{item.parentId},
#{item.orgName},
#{item.activetyCount},
#{item.joinUserCount},
0,
0,
'APP_USER',
now(),
'APP_USER',
now()
)
</foreach>
</insert>
</mapper>
Loading…
Cancel
Save