Browse Source
# Conflicts: # epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java # epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java # epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/OperCrmOpenFeignClient.java # epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/fallback/OperCrmOpenFeignClientFallback.java # epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.javamaster
53 changed files with 1464 additions and 326 deletions
@ -0,0 +1,43 @@ |
|||
/** |
|||
* 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.project.dto; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
import java.util.Date; |
|||
|
|||
@Data |
|||
public class CustomerCategoryDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 父id |
|||
* pid = 0 查询一级分类 |
|||
* pid != 0 查询二级分类 |
|||
*/ |
|||
private String pid; |
|||
|
|||
/** |
|||
* 客户Id |
|||
*/ |
|||
private String customerId; |
|||
|
|||
} |
@ -0,0 +1,41 @@ |
|||
package com.epmet.project.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Author zhangyong |
|||
* @Description 002、项目分类字典查询 |
|||
**/ |
|||
@Data |
|||
public class ProjectCategoryDictResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 8529179932504931368L; |
|||
|
|||
/** |
|||
* 一级分类编码 |
|||
*/ |
|||
private String categoryCode; |
|||
|
|||
/** |
|||
* 一级分类名称 |
|||
*/ |
|||
private String categoryName; |
|||
|
|||
/** |
|||
* 二级分类列表 |
|||
*/ |
|||
private List<ProjectCategoryDictResultDTO> children; |
|||
|
|||
/** |
|||
* 主键 |
|||
**/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 上级分类ID 顶级此列存储0 |
|||
**/ |
|||
private String pid; |
|||
} |
@ -0,0 +1,27 @@ |
|||
package com.epmet.dto.screen; |
|||
|
|||
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; |
|||
import com.epmet.dto.screen.form.CategoryDictFormDTO; |
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 项目分类字典上报 |
|||
* @Auther: zhangyong |
|||
* @Date: 2021-03-22 |
|||
*/ |
|||
@Data |
|||
public class CategoryDictDataFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 当isFirst=true时,直接根据 customerId 删除原有数据,再批量insert。 |
|||
*/ |
|||
private Boolean isFirst; |
|||
|
|||
private List<CategoryDictFormDTO> dataList; |
|||
} |
@ -0,0 +1,72 @@ |
|||
package com.epmet.dto.screen.form; |
|||
|
|||
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; |
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* 项目分类字典上报 |
|||
* @Auther: zhangyong |
|||
* @Date: 2021-03-22 |
|||
*/ |
|||
@Data |
|||
public class CategoryDictFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
// public interface ExtractDailyForm extends CustomerClientShowGroup {}
|
|||
|
|||
/** |
|||
* 客户内自己的分类编码 |
|||
*/ |
|||
// @NotBlank(message = "客户分类编码不能为空", groups = { ExtractDailyForm.class })
|
|||
private String categoryCode; |
|||
|
|||
/** |
|||
* 客户内自己的分类名称 |
|||
*/ |
|||
// @NotBlank(message = "客户分类名称不能为空", groups = { ExtractDailyForm.class })
|
|||
private String categoryName; |
|||
|
|||
/** |
|||
* 父类分类编码,如果是一级分类,此列赋值为0 |
|||
*/ |
|||
// @NotBlank(message = "父类分类编码不能为空", groups = { ExtractDailyForm.class })
|
|||
private String parentCategoryCode; |
|||
|
|||
/** |
|||
* 分类等级:1、2....; |
|||
*/ |
|||
// @NotBlank(message = "分类等级不能为空", groups = { ExtractDailyForm.class })
|
|||
private Integer level; |
|||
|
|||
/** |
|||
* 排序 |
|||
*/ |
|||
// @NotBlank(message = "排序不能为空", groups = { ExtractDailyForm.class })
|
|||
private Integer sort; |
|||
|
|||
/** |
|||
* 当前分类对应产品内的分类编码,如果对应不上,此列传空 |
|||
*/ |
|||
private String epmetCategoryCode; |
|||
|
|||
/** |
|||
* 原始创建时间yyyy-MM-dd HH:mm:ss |
|||
*/ |
|||
private String originCreatedTime; |
|||
|
|||
/** |
|||
* 原始更新时间yyyy-MM-dd HH:mm:ss |
|||
*/ |
|||
private String orginUpdatedTime; |
|||
|
|||
/** |
|||
* 分类字典表主键 |
|||
*/ |
|||
// @NotBlank(message = "分类字典表主键不能为空", groups = { ExtractDailyForm.class })
|
|||
private String categoryId; |
|||
} |
@ -0,0 +1,33 @@ |
|||
/** |
|||
* 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.evaluationindex.extract; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.entity.evaluationindex.extract.FactOriginProjectCategoryDailyEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 项目所属分类表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-03-19 |
|||
*/ |
|||
@Mapper |
|||
public interface FactOriginProjectCategoryDailyDao extends BaseDao<FactOriginProjectCategoryDailyEntity> { |
|||
|
|||
} |
@ -0,0 +1,39 @@ |
|||
/** |
|||
* 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.issue; |
|||
|
|||
import com.epmet.entity.issue.IssueProjectCategoryDictEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 议题项目分类字典 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-12-08 |
|||
*/ |
|||
@Mapper |
|||
public interface IssueProjectCategoryDictDao { |
|||
|
|||
List<IssueProjectCategoryDictEntity> listInsertCategoies(@Param("start") Date start, @Param("end") Date end); |
|||
|
|||
List<IssueProjectCategoryDictEntity> listByUpdatedTime(@Param("start") Date start, @Param("end") Date end); |
|||
} |
@ -0,0 +1,63 @@ |
|||
/** |
|||
* 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.stats; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.dto.screen.form.CategoryDictFormDTO; |
|||
import com.epmet.entity.stats.CustomerProjectCategoryDictEntity; |
|||
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-03-19 |
|||
*/ |
|||
@Mapper |
|||
public interface CustomerProjectCategoryDictDao extends BaseDao<CustomerProjectCategoryDictEntity> { |
|||
|
|||
CustomerProjectCategoryDictEntity getLatestProjectCategory(); |
|||
|
|||
CustomerProjectCategoryDictEntity getLatestUpdatedEntity(); |
|||
|
|||
CustomerProjectCategoryDictEntity selectByCustomerIdAndId(@Param("customerId") String customerId, @Param("categoryId") String categoryId); |
|||
|
|||
/** |
|||
* 当isFirst=true时,直接根据 customerId 删除原有数据,再批量insert。 |
|||
* |
|||
* @param customerId |
|||
* @return java.lang.Integer |
|||
* @Author zhangyong |
|||
* @Date 16:12 2021-03-22 |
|||
**/ |
|||
Integer deleteCustomerProjectCategoryDict(@Param("customerId") String customerId); |
|||
|
|||
/** |
|||
* 批量insert。 |
|||
* |
|||
* @param list |
|||
* @param customerId |
|||
* @return void |
|||
* @Author zhangyong |
|||
* @Date 16:13 2021-03-22 |
|||
**/ |
|||
void batchInsertCustomerProjectCategoryDict(@Param("list") List<CategoryDictFormDTO> list, @Param("customerId")String customerId); |
|||
} |
@ -0,0 +1,63 @@ |
|||
/** |
|||
* 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.evaluationindex.extract; |
|||
|
|||
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-03-19 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("fact_origin_project_category_daily") |
|||
public class FactOriginProjectCategoryDailyEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 客户id |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 项目id |
|||
*/ |
|||
private String projectId; |
|||
|
|||
/** |
|||
* 分类编码 |
|||
*/ |
|||
private String categoryCode; |
|||
|
|||
/** |
|||
* 所属父类分类编码 |
|||
*/ |
|||
private String parentCategoryCode; |
|||
|
|||
/** |
|||
* 分类等级:1、2....;产品目前只有2级分类 |
|||
*/ |
|||
private Integer level; |
|||
|
|||
} |
@ -0,0 +1,83 @@ |
|||
/** |
|||
* 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.issue; |
|||
|
|||
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 2020-12-08 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("issue_project_category_dict") |
|||
public class IssueProjectCategoryDictEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 客户id, 产品默认default |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 上级分类ID 顶级此列存储0 |
|||
*/ |
|||
private String pid; |
|||
|
|||
/** |
|||
* 所有上级分类ID,用逗号分开 |
|||
*/ |
|||
private String pids; |
|||
|
|||
/** |
|||
* 上级分类编码 |
|||
*/ |
|||
private String parentCategoryCode; |
|||
|
|||
/** |
|||
* 分类编码,分类编码+customer_id唯一 |
|||
*/ |
|||
private String categoryCode; |
|||
|
|||
/** |
|||
* 分类名称 |
|||
*/ |
|||
private String categoryName; |
|||
|
|||
/** |
|||
* 分类类别1,2,3,4.... |
|||
*/ |
|||
private String categoryType; |
|||
|
|||
/** |
|||
* 排序 |
|||
*/ |
|||
private Integer sort; |
|||
|
|||
/** |
|||
* 是否禁用(enable:启用 disable:禁用) |
|||
*/ |
|||
private String isDisable; |
|||
|
|||
} |
@ -0,0 +1,95 @@ |
|||
/** |
|||
* 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.stats; |
|||
|
|||
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 2021-03-19 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("customer_project_category_dict") |
|||
public class CustomerProjectCategoryDictEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 客户id |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 外部客户:external;内部客户:internal |
|||
*/ |
|||
private String customerType; |
|||
|
|||
/** |
|||
* 客户自己的分类编码 |
|||
*/ |
|||
private String categoryCode; |
|||
|
|||
/** |
|||
* 客户自己的分类名称 |
|||
*/ |
|||
private String categoryName; |
|||
|
|||
/** |
|||
* 父类分类编码,如果是一级分类,此列赋值为0 |
|||
*/ |
|||
private String parentCategoryCode; |
|||
|
|||
/** |
|||
* 分类等级:1、2....;产品只有2级分类 |
|||
*/ |
|||
private Integer level; |
|||
|
|||
/** |
|||
* 排序 |
|||
*/ |
|||
private Integer sort; |
|||
|
|||
/** |
|||
* 是否禁用(enable:启用 disable:禁用) |
|||
*/ |
|||
private String isDisable; |
|||
|
|||
/** |
|||
* 对应e世通中的分类编码,没有此列为空 |
|||
*/ |
|||
private String epmetCategoryCode; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date originCreatedTime; |
|||
/** |
|||
* 修改时间 |
|||
*/ |
|||
private Date originUpdatedTime; |
|||
|
|||
private String categoryId; |
|||
} |
@ -0,0 +1,37 @@ |
|||
/** |
|||
* 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.Issue; |
|||
|
|||
import com.epmet.entity.issue.IssueProjectCategoryDictEntity; |
|||
|
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 议题项目分类字典 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-12-08 |
|||
*/ |
|||
|
|||
public interface IssueProjectCategoryDictService{ |
|||
|
|||
List<IssueProjectCategoryDictEntity> listInsertCategoies(Date start, Date end); |
|||
|
|||
List<IssueProjectCategoryDictEntity> listByUpdatedTime(Date start, Date end); |
|||
} |
@ -0,0 +1,36 @@ |
|||
package com.epmet.service.Issue.impl; |
|||
|
|||
import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
|||
import com.epmet.constant.DataSourceConstant; |
|||
import com.epmet.dao.issue.IssueProjectCategoryDictDao; |
|||
import com.epmet.entity.issue.IssueProjectCategoryDictEntity; |
|||
import com.epmet.service.Issue.IssueProjectCategoryDictService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 描述一下 |
|||
* |
|||
* @author yinzuomei@elink-cn.com |
|||
* @date 2021/3/19 15:29 |
|||
*/ |
|||
@Service |
|||
@DataSource(DataSourceConstant.GOV_ISSUE) |
|||
public class IssueProjectCategoryDictServiceImpl implements IssueProjectCategoryDictService { |
|||
@Autowired |
|||
private IssueProjectCategoryDictDao issueProjectCategoryDictDao; |
|||
|
|||
@Override |
|||
public List<IssueProjectCategoryDictEntity> listInsertCategoies(Date start, Date end) { |
|||
return issueProjectCategoryDictDao.listInsertCategoies(start, end); |
|||
} |
|||
|
|||
@Override |
|||
public List<IssueProjectCategoryDictEntity> listByUpdatedTime(Date start, Date end) { |
|||
return issueProjectCategoryDictDao.listByUpdatedTime(start, end); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,31 @@ |
|||
/** |
|||
* 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.evaluationindex.extract.todata; |
|||
|
|||
import com.epmet.commons.mybatis.service.BaseService; |
|||
import com.epmet.entity.evaluationindex.extract.FactOriginProjectCategoryDailyEntity; |
|||
|
|||
/** |
|||
* 项目所属分类表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-03-19 |
|||
*/ |
|||
public interface FactOriginProjectCategoryDailyService extends BaseService<FactOriginProjectCategoryDailyEntity> { |
|||
//todo 将epmet_gov_project库中的项目分类信息(project_category)同步到统计库epmet_data_statistical
|
|||
} |
@ -0,0 +1,38 @@ |
|||
/** |
|||
* 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.evaluationindex.extract.todata.impl; |
|||
|
|||
import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
|||
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|||
import com.epmet.constant.DataSourceConstant; |
|||
import com.epmet.dao.evaluationindex.extract.FactOriginProjectCategoryDailyDao; |
|||
import com.epmet.entity.evaluationindex.extract.FactOriginProjectCategoryDailyEntity; |
|||
import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectCategoryDailyService; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
/** |
|||
* 项目所属分类表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-03-19 |
|||
*/ |
|||
@Service |
|||
@DataSource(DataSourceConstant.STATS) |
|||
public class FactOriginProjectCategoryDailyServiceImpl extends BaseServiceImpl<FactOriginProjectCategoryDailyDao, FactOriginProjectCategoryDailyEntity> implements FactOriginProjectCategoryDailyService { |
|||
|
|||
} |
@ -0,0 +1,58 @@ |
|||
/** |
|||
* 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.stats; |
|||
|
|||
import com.epmet.commons.mybatis.service.BaseService; |
|||
import com.epmet.dto.screen.CategoryDictDataFormDTO; |
|||
import com.epmet.entity.issue.IssueProjectCategoryDictEntity; |
|||
import com.epmet.entity.stats.CustomerProjectCategoryDictEntity; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 客户项目分类字典表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-03-19 |
|||
*/ |
|||
public interface CustomerProjectCategoryDictService extends BaseService<CustomerProjectCategoryDictEntity> { |
|||
|
|||
void initProjectCategory(List<IssueProjectCategoryDictEntity> insertCategoies, |
|||
List<IssueProjectCategoryDictEntity> updateCategoies); |
|||
|
|||
/** |
|||
* @author yinzuomei |
|||
* @description 获取内部客户最近一次初始记录 |
|||
* @Date 2021/3/19 14:57 |
|||
**/ |
|||
CustomerProjectCategoryDictEntity getLatestProjectCategory(); |
|||
|
|||
CustomerProjectCategoryDictEntity getLatestUpdatedEntity(); |
|||
|
|||
/** |
|||
* 项目分类字典上报 |
|||
* 目标表:epmet_evaluation_index库的customer_project_category_dict |
|||
* |
|||
* @param customerId |
|||
* @param formDTO |
|||
* @return void |
|||
* @Author zhangyong |
|||
* @Date 16:03 2021-03-22 |
|||
**/ |
|||
void uploadCategoryDict(String customerId, CategoryDictDataFormDTO formDTO); |
|||
} |
@ -0,0 +1,114 @@ |
|||
/** |
|||
* 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.stats.impl; |
|||
|
|||
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.constant.DataSourceConstant; |
|||
import com.epmet.dao.stats.CustomerProjectCategoryDictDao; |
|||
import com.epmet.dto.screen.CategoryDictDataFormDTO; |
|||
import com.epmet.entity.issue.IssueProjectCategoryDictEntity; |
|||
import com.epmet.entity.stats.CustomerProjectCategoryDictEntity; |
|||
import com.epmet.service.stats.CustomerProjectCategoryDictService; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
import org.apache.commons.collections4.CollectionUtils; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 客户项目分类字典表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-03-19 |
|||
*/ |
|||
@Slf4j |
|||
@DataSource(DataSourceConstant.EVALUATION_INDEX) |
|||
@Service |
|||
public class CustomerProjectCategoryDictServiceImpl extends BaseServiceImpl<CustomerProjectCategoryDictDao, CustomerProjectCategoryDictEntity> implements CustomerProjectCategoryDictService { |
|||
|
|||
@DataSource(value = DataSourceConstant.EVALUATION_INDEX) |
|||
@Transactional(rollbackFor = Exception.class) |
|||
@Override |
|||
public void initProjectCategory(List<IssueProjectCategoryDictEntity> insertCategoies, List<IssueProjectCategoryDictEntity> updateCategoies) { |
|||
log.info(String.format("=============需要插入的条数=%s,更新的条数=%s",insertCategoies.size(),updateCategoies.size())); |
|||
insertCategoies.forEach(insertEntity -> { |
|||
CustomerProjectCategoryDictEntity entityInsert=new CustomerProjectCategoryDictEntity(); |
|||
entityInsert.setCustomerId(insertEntity.getCustomerId()); |
|||
entityInsert.setCustomerType("internal"); |
|||
entityInsert.setCategoryCode(insertEntity.getCategoryCode()); |
|||
entityInsert.setCategoryName(insertEntity.getCategoryName()); |
|||
entityInsert.setParentCategoryCode(insertEntity.getParentCategoryCode()); |
|||
entityInsert.setLevel(Integer.valueOf(insertEntity.getCategoryType())); |
|||
entityInsert.setSort(insertEntity.getSort()); |
|||
entityInsert.setIsDisable(insertEntity.getIsDisable()); |
|||
entityInsert.setOriginCreatedTime(insertEntity.getCreatedTime()); |
|||
entityInsert.setOriginUpdatedTime(insertEntity.getUpdatedTime()); |
|||
entityInsert.setCategoryId(insertEntity.getId()); |
|||
baseDao.insert(entityInsert); |
|||
}); |
|||
updateCategoies.forEach(updatedEntity -> { |
|||
CustomerProjectCategoryDictEntity entity=baseDao.selectByCustomerIdAndId(updatedEntity.getCustomerId(),updatedEntity.getId()); |
|||
if(null!=entity){ |
|||
entity.setCategoryCode(updatedEntity.getCategoryCode()); |
|||
entity.setCategoryName(updatedEntity.getCategoryName()); |
|||
entity.setParentCategoryCode(updatedEntity.getParentCategoryCode()); |
|||
entity.setLevel(Integer.valueOf(updatedEntity.getCategoryType())); |
|||
entity.setSort(updatedEntity.getSort()); |
|||
entity.setIsDisable(updatedEntity.getIsDisable()); |
|||
entity.setOriginCreatedTime(updatedEntity.getCreatedTime()); |
|||
entity.setOriginUpdatedTime(updatedEntity.getUpdatedTime()); |
|||
} |
|||
baseDao.updateById(entity); |
|||
}); |
|||
} |
|||
|
|||
/** |
|||
* @author yinzuomei |
|||
* @description 获取内部客户最近一次初始记录 |
|||
* @Date 2021/3/19 14:57 |
|||
**/ |
|||
@DataSource(value = DataSourceConstant.EVALUATION_INDEX) |
|||
@Override |
|||
public CustomerProjectCategoryDictEntity getLatestProjectCategory() { |
|||
return baseDao.getLatestProjectCategory(); |
|||
} |
|||
|
|||
@DataSource(value = DataSourceConstant.EVALUATION_INDEX) |
|||
@Override |
|||
public CustomerProjectCategoryDictEntity getLatestUpdatedEntity() { |
|||
return baseDao.getLatestUpdatedEntity(); |
|||
} |
|||
|
|||
@DataSource(value = DataSourceConstant.EVALUATION_INDEX) |
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void uploadCategoryDict(String customerId, CategoryDictDataFormDTO formDTO) { |
|||
if (formDTO.getIsFirst()) { |
|||
int deleteNum; |
|||
do { |
|||
deleteNum = baseDao.deleteCustomerProjectCategoryDict(customerId); |
|||
} while (deleteNum > NumConstant.ZERO); |
|||
} |
|||
if (!CollectionUtils.isEmpty(formDTO.getDataList())) { |
|||
baseDao.batchInsertCustomerProjectCategoryDict(formDTO.getDataList(), customerId); |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,8 @@ |
|||
<?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.evaluationindex.extract.FactOriginProjectCategoryDailyDao"> |
|||
|
|||
|
|||
|
|||
</mapper> |
@ -0,0 +1,44 @@ |
|||
<?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.issue.IssueProjectCategoryDictDao"> |
|||
|
|||
<!-- 构造需要插入的分类字典数据 --> |
|||
<select id="listInsertCategoies" parameterType="map" resultType="com.epmet.entity.issue.IssueProjectCategoryDictEntity"> |
|||
SELECT |
|||
* |
|||
FROM |
|||
issue_project_category_dict |
|||
<where> |
|||
DEL_FLAG = 0 |
|||
and CUSTOMER_ID !='default' |
|||
<if test="start != null"> |
|||
AND CREATED_TIME > #{start} |
|||
</if> |
|||
<if test="end != null"> |
|||
AND CREATED_TIME < #{end} |
|||
</if> |
|||
</where> |
|||
ORDER BY CREATED_TIME ASC |
|||
</select> |
|||
|
|||
<!-- 构造需要更新的分类字典数据 --> |
|||
<select id="listByUpdatedTime" parameterType="map" resultType="com.epmet.entity.issue.IssueProjectCategoryDictEntity"> |
|||
SELECT |
|||
* |
|||
FROM |
|||
issue_project_category_dict |
|||
<where> |
|||
DEL_FLAG = 0 |
|||
and CUSTOMER_ID !='default' |
|||
<if test="start != null"> |
|||
AND UPDATED_TIME > #{start} |
|||
</if> |
|||
<if test="end != null"> |
|||
AND UPDATED_TIME < #{end} |
|||
</if> |
|||
</where> |
|||
ORDER BY UPDATED_TIME ASC |
|||
</select> |
|||
|
|||
</mapper> |
@ -0,0 +1,95 @@ |
|||
<?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.stats.CustomerProjectCategoryDictDao"> |
|||
<select id="getLatestProjectCategory" resultType="com.epmet.entity.stats.CustomerProjectCategoryDictEntity"> |
|||
SELECT |
|||
* |
|||
FROM |
|||
customer_project_category_dict m |
|||
WHERE |
|||
m.DEL_FLAG = '0' |
|||
AND m.CUSTOMER_TYPE = 'internal' |
|||
ORDER BY |
|||
m.ORIGIN_CREATED_TIME DESC |
|||
LIMIT 1 |
|||
</select> |
|||
|
|||
<select id="getLatestUpdatedEntity" resultType="com.epmet.entity.stats.CustomerProjectCategoryDictEntity"> |
|||
SELECT |
|||
* |
|||
FROM |
|||
customer_project_category_dict m |
|||
WHERE |
|||
m.DEL_FLAG = '0' |
|||
AND m.CUSTOMER_TYPE = 'internal' |
|||
ORDER BY |
|||
m.ORIGIN_UPDATED_TIME DESC |
|||
LIMIT 1 |
|||
</select> |
|||
|
|||
<select id="selectByCustomerIdAndId" parameterType="map" resultType="com.epmet.entity.stats.CustomerProjectCategoryDictEntity"> |
|||
SELECT |
|||
* |
|||
FROM |
|||
customer_project_category_dict m |
|||
WHERE |
|||
m.DEL_FLAG = '0' |
|||
and m.customer_id=#{customerId} |
|||
and m.CATEGORY_ID=#{categoryId} |
|||
</select> |
|||
|
|||
<delete id="deleteCustomerProjectCategoryDict"> |
|||
delete from customer_project_category_dict |
|||
where CUSTOMER_ID = #{customerId} |
|||
limit 1000; |
|||
</delete> |
|||
|
|||
<insert id="batchInsertCustomerProjectCategoryDict" parameterType="map"> |
|||
insert into customer_project_category_dict |
|||
( |
|||
ID, |
|||
CUSTOMER_ID, |
|||
CUSTOMER_TYPE, |
|||
CATEGORY_CODE, |
|||
CATEGORY_NAME, |
|||
PARENT_CATEGORY_CODE, |
|||
`LEVEL`, |
|||
SORT, |
|||
IS_DISABLE, |
|||
EPMET_CATEGORY_CODE, |
|||
ORIGIN_CREATED_TIME, |
|||
ORIGIN_UPDATED_TIME, |
|||
CATEGORY_ID, |
|||
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}, |
|||
'external', |
|||
#{item.categoryCode}, |
|||
#{item.categoryName}, |
|||
#{item.parentCategoryCode}, |
|||
#{item.level}, |
|||
#{item.sort}, |
|||
'enable', |
|||
#{item.epmetCategoryCode}, |
|||
#{item.originCreatedTime}, |
|||
#{item.orginUpdatedTime}, |
|||
#{item.categoryId}, |
|||
0, |
|||
0, |
|||
'APP_USER', |
|||
now(), |
|||
'APP_USER', |
|||
now() |
|||
) |
|||
</foreach> |
|||
</insert> |
|||
</mapper> |
Loading…
Reference in new issue