Browse Source

Merge branch 'dev_grid_platform' into develop

dev_shibei_match
zhaoqifeng 4 years ago
parent
commit
7a055f3d22
  1. 2
      epmet-gateway/src/main/resources/bootstrap.yml
  2. 5
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/result/CustomerAgencyDTO.java
  3. 5
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/result/CustomerGridDTO.java
  4. 2
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java
  5. 5
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml
  6. 5
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml
  7. 2
      epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/GridBaseInfoFormDTO.java
  8. 28
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/ExDeptDao.java
  9. 5
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/ExDeptEntity.java
  10. 48
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseGridInfoServiceImpl.java
  11. 74
      epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/ExDeptDao.xml

2
epmet-gateway/src/main/resources/bootstrap.yml

@ -1,4 +1,4 @@
basedisputeprocessserver:
server:
tomcat:
max-swallow-size: 100MB
port: @server.port@

5
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/result/CustomerAgencyDTO.java

@ -78,6 +78,11 @@ public class CustomerAgencyDTO implements Serializable {
*/
private String areaCode;
/**
* 省组织编码
*/
private String code;
/**
* 删除标识
*/

5
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/result/CustomerGridDTO.java

@ -67,6 +67,11 @@ public class CustomerGridDTO implements Serializable {
*/
private String areaCode;
/**
* 省网格编码
*/
private String code;
/**
* 删除标识:0.未删除 1.已删除
*/

2
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java

@ -37,7 +37,7 @@ import java.util.List;
*/
//url="http://localhost:8108"
//@FeignClient(name = ServiceConstant.DATA_STATISTICAL_SERVER, fallback = DataStatisticalOpenFeignClientFallBack.class, url = "http://localhost:6666")
@FeignClient(name = ServiceConstant.DATA_STATISTICAL_SERVER, fallbackFactory = DataStatisticalOpenFeignClientFallBackFactory.class)
@FeignClient(name = ServiceConstant.DATA_STATISTICAL_SERVER, fallbackFactory = DataStatisticalOpenFeignClientFallBackFactory.class,url="http://localhost:8108")
public interface DataStatisticalOpenFeignClient {
/**

5
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml

@ -132,10 +132,7 @@
*
FROM
customer_grid
WHERE 1=1
<if test="orgIdList == null">
AND del_flag = '0'
</if>
WHERE del_flag = '0'
AND customer_id = #{customerId}
<if test="orgIdList != null and orgIdList.size() > 0">
<foreach collection="orgIdList" item="gridId" open="AND id IN (" separator="," close=")">

5
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml

@ -210,10 +210,7 @@
*
FROM
customer_agency
WHERE 1=1
<if test="orgIdList == null">
AND del_flag = '0'
</if>
WHERE del_flag = '0'
AND customer_id = #{customerId}
<if test="orgIdList != null and orgIdList.size() > 0">
<foreach collection="orgIdList" item="agencyId" open="AND id IN (" separator="," close=")">

2
epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/GridBaseInfoFormDTO.java

@ -25,7 +25,7 @@ public class GridBaseInfoFormDTO implements Serializable {
*/
private List<String> orgIdList;
/**
* 操作类型新增:add 修改删除:edit
* 操作类型新增:add 修改删除:edit 初始化所有数据:all
*/
private String type;

28
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/ExDeptDao.java

@ -18,16 +18,38 @@
package com.epmet.opendata.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.opendata.entity.BaseGridInfoEntity;
import com.epmet.opendata.entity.ExDeptEntity;
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-10-19
* @since v1.0.0 2021-10-15
*/
@Mapper
public interface ExDeptDao extends BaseDao<ExDeptEntity> {
/**
* @Author sun
* @Description 网格基础信息批量更新部分字段
**/
int updateBatch(@Param("list") List<ExDeptEntity> entityList);
/**
* @Author sun
* @Description 网格基础信息批量更新部分字段
**/
int insertBatch(@Param("list") List<ExDeptEntity> entityList);
/**
* @Author sun
* @Description 网格基础信息批量更新部分字段
**/
int updateBatchGrid(@Param("list") List<ExDeptEntity> entityList);
}

5
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/ExDeptEntity.java

@ -18,7 +18,6 @@
package com.epmet.opendata.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
@ -31,7 +30,7 @@ import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("ex_dept")
public class ExDeptEntity extends BaseEpmetEntity {
public class ExDeptEntity {
private static final long serialVersionUID = 1L;
@ -66,7 +65,7 @@ public class ExDeptEntity extends BaseEpmetEntity {
private String deptCode;
/**
*
*
*/
private String gridCode;

48
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseGridInfoServiceImpl.java

@ -18,14 +18,17 @@
package com.epmet.opendata.service.impl;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.org.result.CustomerAgencyDTO;
import com.epmet.dto.org.result.CustomerGridDTO;
import com.epmet.feign.DataStatisticalOpenFeignClient;
import com.epmet.opendata.dao.BaseGridInfoDao;
import com.epmet.opendata.dao.ExDeptDao;
import com.epmet.opendata.dto.form.GridBaseInfoFormDTO;
import com.epmet.opendata.entity.BaseGridInfoEntity;
import com.epmet.opendata.entity.ExDeptEntity;
import com.epmet.opendata.service.BaseGridInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -44,6 +47,8 @@ import java.util.List;
public class BaseGridInfoServiceImpl extends BaseServiceImpl<BaseGridInfoDao, BaseGridInfoEntity> implements BaseGridInfoService {
@Autowired
private DataStatisticalOpenFeignClient dataStatisticalOpenFeignClient;
@Autowired
private ExDeptDao exDeptDao;
/**
* @Author sun
@ -52,13 +57,16 @@ public class BaseGridInfoServiceImpl extends BaseServiceImpl<BaseGridInfoDao, Ba
@Override
@Transactional(rollbackFor = Exception.class)
public void getAgencyBaseInfo(GridBaseInfoFormDTO formDTO) {
//1.查询网格基础信息
//1.查询组织基础信息
Result<List<CustomerAgencyDTO>> result = dataStatisticalOpenFeignClient.getAgencyBaseInfo(formDTO);
if (!result.success()) {
throw new RenException(result.getInternalMsg());
}
if (null == result.getData() || result.getData().size() < NumConstant.ONE) {
return;
}
//2.中间库新增/修改数据
List<BaseGridInfoEntity> entityList = new ArrayList<>();
/*List<BaseGridInfoEntity> entityList = new ArrayList<>();
result.getData().forEach(ag->{
BaseGridInfoEntity entity = new BaseGridInfoEntity();
entity.setCustomerId(ag.getCustomerId());
@ -76,13 +84,22 @@ public class BaseGridInfoServiceImpl extends BaseServiceImpl<BaseGridInfoDao, Ba
entity.setUpdatedBy(ag.getUpdatedBy());
entity.setUpdatedTime(ag.getUpdatedTime());
entityList.add(entity);
});*/
List<ExDeptEntity> ExList = new ArrayList<>();
result.getData().forEach(ag->{
ExDeptEntity entity = new ExDeptEntity();
entity.setDeptIdQx(ag.getId());
entity.setDeptNameQx(ag.getOrganizationName());
entity.setGridCode(ag.getCode());
ExList.add(entity);
});
if("add".equals(formDTO.getType())){
insertBatch(entityList);
if(null!=formDTO.getType()&& "all".equals(formDTO.getType())){
exDeptDao.updateBatch(ExList);
}else {
baseDao.updateBatch(entityList);
exDeptDao.insertBatch(ExList);
}
}
/**
@ -97,8 +114,11 @@ public class BaseGridInfoServiceImpl extends BaseServiceImpl<BaseGridInfoDao, Ba
if (!result.success()) {
throw new RenException(result.getInternalMsg());
}
if (null == result.getData() || result.getData().size() < NumConstant.ONE) {
return;
}
//2.中间库新增/修改数据
List<BaseGridInfoEntity> entityList = new ArrayList<>();
/*List<BaseGridInfoEntity> entityList = new ArrayList<>();
result.getData().forEach(ag->{
BaseGridInfoEntity entity = new BaseGridInfoEntity();
entity.setCustomerId(ag.getCustomerId());
@ -111,11 +131,19 @@ public class BaseGridInfoServiceImpl extends BaseServiceImpl<BaseGridInfoDao, Ba
entity.setUpdatedBy(ag.getUpdatedBy());
entity.setUpdatedTime(ag.getUpdatedTime());
entityList.add(entity);
});*/
List<ExDeptEntity> ExList = new ArrayList<>();
result.getData().forEach(ag -> {
ExDeptEntity entity = new ExDeptEntity();
entity.setDeptIdQx(ag.getId());
entity.setDeptNameQx(ag.getGridName());
entity.setGridCode(ag.getCode());
ExList.add(entity);
});
if("add".equals(formDTO.getType())){
insertBatch(entityList);
}else {
baseDao.updateBatch(entityList);
if (null != formDTO.getType() && "all".equals(formDTO.getType())) {
exDeptDao.updateBatchGrid(ExList);
} else {
exDeptDao.insertBatch(ExList);
}
}

74
epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/ExDeptDao.xml

@ -14,6 +14,80 @@
<result property="deptIdQx" column="dept_id_qx"/>
<result property="deptNameQx" column="dept_name_qx"/>
</resultMap>
<update id="updateBatch">
UPDATE ex_dept
<trim prefix="set" suffixOverrides=",">
<trim prefix="dept_id_qx =(case" suffix="end),">
<foreach collection="list" item="item">
<if test='null != item.deptIdQx'>
when grid_code = #{item.gridCode} then #{item.deptIdQx}
</if>
</foreach>
</trim>
<trim prefix="dept_name_qx =(case" suffix="end),">
<foreach collection="list" item="item">
<if test='null != item.deptNameQx'>
when grid_code = #{item.gridCode} then #{item.deptNameQx}
</if>
</foreach>
</trim>
</trim>
WHERE
1=1
<foreach collection="list" item="item" open="AND( " separator=" OR " index="index" close=")">
grid_code = #{item.gridCode}
</foreach>
</update>
<insert id="insertBatch">
INSERT INTO ex_dept
(
dept_id_qx,
dept_name_qx
)
VALUES
<foreach collection="list" item="i" separator=",">
(
#{i.deptIdQx},
#{i.deptNameQx}
)
</foreach>
ON DUPLICATE KEY
UPDATE
dept_id_qx = values(dept_id_qx),
dept_name_qx = values(dept_name_qx)
</insert>
<update id="updateBatchGrid">
UPDATE ex_dept
<trim prefix="set" suffixOverrides=",">
<trim prefix="dept_id_qx =(case" suffix="end),">
<foreach collection="list" item="item">
<if test='null != item.deptIdQx'>
when dept_name LIKE CONCAT(left(#{item.deptNameQx},2),'%',right(#{item.deptNameQx},2),if(LOCATE('第二', #{item.deptNameQx})>0,'%2','%1')) then #{item.deptIdQx}
</if>
</foreach>
</trim>
<trim prefix="dept_name_qx =(case" suffix="end),">
<foreach collection="list" item="item">
<if test='null != item.deptNameQx'>
when dept_name LIKE CONCAT(left(#{item.deptNameQx},2),'%',right(#{item.deptNameQx},2),if(LOCATE('第二', #{item.deptNameQx})>0,'%2','%1')) then #{item.deptNameQx}
</if>
</foreach>
</trim>
</trim>
WHERE
1=1
<foreach collection="list" item="item" open="AND( " separator=" OR " index="index" close=")">
dept_name LIKE CONCAT(left(#{item.deptNameQx},2),'%',right(#{item.deptNameQx},2),if(LOCATE('第二', #{item.deptNameQx})>0,'%2','%1'))
</foreach>
</update>
</mapper>
Loading…
Cancel
Save