Browse Source
# Conflicts: # epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.javamaster
188 changed files with 11081 additions and 369 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,61 @@ |
|||
package com.epmet.dto.screen.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 项目分类字典上报 |
|||
* @Auther: zhangyong |
|||
* @Date: 2021-03-22 |
|||
*/ |
|||
@Data |
|||
public class CategoryDictFormDTO implements Serializable { |
|||
|
|||
|
|||
private static final long serialVersionUID = 1245827825857891963L; |
|||
/** |
|||
* 客户内自己的分类编码 |
|||
*/ |
|||
private String categoryCode; |
|||
|
|||
/** |
|||
* 客户内自己的分类名称 |
|||
*/ |
|||
private String categoryName; |
|||
|
|||
/** |
|||
* 父类分类编码,如果是一级分类,此列赋值为0 |
|||
*/ |
|||
private String parentCategoryCode; |
|||
|
|||
/** |
|||
* 分类等级:1、2....; |
|||
*/ |
|||
private Integer level; |
|||
|
|||
/** |
|||
* 排序 |
|||
*/ |
|||
private Integer sort; |
|||
|
|||
/** |
|||
* 当前分类对应产品内的分类编码,如果对应不上,此列传空 |
|||
*/ |
|||
private String epmetCategoryCode; |
|||
|
|||
/** |
|||
* 原始创建时间yyyy-MM-dd HH:mm:ss |
|||
*/ |
|||
private String originCreatedTime; |
|||
|
|||
/** |
|||
* 原始更新时间yyyy-MM-dd HH:mm:ss |
|||
*/ |
|||
private String orginUpdatedTime; |
|||
|
|||
/** |
|||
* 分类字典表主键 |
|||
*/ |
|||
private String categoryId; |
|||
} |
@ -0,0 +1,56 @@ |
|||
package com.epmet.dto.screen.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @DateTime 2021/3/23 下午2:38 |
|||
* @DESC |
|||
*/ |
|||
@Data |
|||
public class CategoryProjectResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = -5774330825880917524L; |
|||
|
|||
private String pid; |
|||
private String pids; |
|||
|
|||
/** |
|||
* 组织ID |
|||
*/ |
|||
private String orgId; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 分类码 |
|||
*/ |
|||
private String categoryCode; |
|||
|
|||
/** |
|||
* 项目总数 |
|||
*/ |
|||
private Integer projectTotal; |
|||
|
|||
/** |
|||
* 分类级别 |
|||
*/ |
|||
private Integer level; |
|||
|
|||
/** |
|||
* 日期ID |
|||
*/ |
|||
private String dateId; |
|||
|
|||
/** |
|||
* 组织级别 |
|||
*/ |
|||
private String orgType; |
|||
|
|||
private Boolean status = false; |
|||
} |
@ -0,0 +1,46 @@ |
|||
/** |
|||
* 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.dto.screen.ScreenProjectCategoryGridDailyDTO; |
|||
import com.epmet.entity.evaluationindex.extract.FactOriginProjectCategoryDailyEntity; |
|||
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 FactOriginProjectCategoryDailyDao extends BaseDao<FactOriginProjectCategoryDailyEntity> { |
|||
|
|||
void deleteOldData(@Param("customerId") String customerId,@Param("dateId") String dateId); |
|||
|
|||
/** |
|||
* @param customerId |
|||
* @author yinzuomei |
|||
* @description 计算当前客户下,各个网格内,各项目分类下项目数量 |
|||
* @Date 2021/3/23 9:58 |
|||
**/ |
|||
List<ScreenProjectCategoryGridDailyDTO> selectListProjectCategoryGridDailyDTO(@Param("customerId") String customerId); |
|||
} |
@ -0,0 +1,41 @@ |
|||
/** |
|||
* 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); |
|||
|
|||
IssueProjectCategoryDictEntity getById(@Param("customerId")String customerId, @Param("id")String id);; |
|||
} |
@ -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,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.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); |
|||
|
|||
IssueProjectCategoryDictEntity getById(String customerId,String id); |
|||
} |
@ -0,0 +1,42 @@ |
|||
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.apache.ibatis.annotations.Param; |
|||
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); |
|||
} |
|||
|
|||
@Override |
|||
public IssueProjectCategoryDictEntity getById(String customerId, String id) { |
|||
return issueProjectCategoryDictDao.getById(customerId,id); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,50 @@ |
|||
/** |
|||
* 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.dto.extract.form.ExtractOriginFormDTO; |
|||
import com.epmet.dto.screen.ScreenProjectCategoryGridDailyDTO; |
|||
import com.epmet.entity.evaluationindex.extract.FactOriginProjectCategoryDailyEntity; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 项目所属分类表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-03-19 |
|||
*/ |
|||
public interface FactOriginProjectCategoryDailyService extends BaseService<FactOriginProjectCategoryDailyEntity> { |
|||
/** |
|||
* @Description 将epmet_gov_project库中的项目分类信息(project_category)同步到统计库epmet_data_statistical |
|||
* @param paramNew |
|||
* @return void |
|||
* @Author liushaowen |
|||
* @Date 2021/3/22 15:28 |
|||
*/ |
|||
void extractProjectCategory(ExtractOriginFormDTO paramNew); |
|||
|
|||
/** |
|||
* @param customerId |
|||
* @author yinzuomei |
|||
* @description 计算当前客户下,各个网格内,各项目分类下项目数量 |
|||
* @Date 2021/3/23 9:56 |
|||
**/ |
|||
List<ScreenProjectCategoryGridDailyDTO> selectListProjectCategoryGridDailyDTO(String customerId); |
|||
} |
@ -0,0 +1,122 @@ |
|||
/** |
|||
* 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.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
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.evaluationindex.extract.FactOriginProjectCategoryDailyDao; |
|||
import com.epmet.dto.ProjectCategoryDTO; |
|||
import com.epmet.dto.extract.form.ExtractOriginFormDTO; |
|||
import com.epmet.dto.screen.ScreenProjectCategoryGridDailyDTO; |
|||
import com.epmet.entity.evaluationindex.extract.FactOriginProjectCategoryDailyEntity; |
|||
import com.epmet.entity.issue.IssueProjectCategoryDictEntity; |
|||
import com.epmet.service.Issue.IssueProjectCategoryDictService; |
|||
import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectCategoryDailyService; |
|||
import com.epmet.service.project.ProjectService; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
import org.springframework.util.CollectionUtils; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 项目所属分类表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-03-19 |
|||
*/ |
|||
@Service |
|||
@DataSource(DataSourceConstant.STATS) |
|||
@Slf4j |
|||
public class FactOriginProjectCategoryDailyServiceImpl extends BaseServiceImpl<FactOriginProjectCategoryDailyDao, FactOriginProjectCategoryDailyEntity> implements FactOriginProjectCategoryDailyService { |
|||
@Autowired |
|||
private ProjectService projectService; |
|||
@Autowired |
|||
private IssueProjectCategoryDictService issueProjectCategoryDictService; |
|||
/** |
|||
* @param extractOriginFormDTO |
|||
* @return void |
|||
* @Description 将epmet_gov_project库中的项目分类信息(project_category)同步到统计库epmet_data_statistical |
|||
* @Author liushaowen |
|||
* @Date 2021/3/22 15:28 |
|||
*/ |
|||
@Override |
|||
public void extractProjectCategory(ExtractOriginFormDTO extractOriginFormDTO) { |
|||
String dateString = extractOriginFormDTO.getDateId(); |
|||
String customerId = extractOriginFormDTO.getCustomerId(); |
|||
List<FactOriginProjectCategoryDailyEntity> entities = new ArrayList<>(); |
|||
Integer count = baseDao.selectCount(new QueryWrapper<FactOriginProjectCategoryDailyEntity>().eq("customer_id",customerId)); |
|||
//如果count = 0 初始化该customer所有数据
|
|||
if (NumConstant.ZERO == count){ |
|||
dateString = null; |
|||
} |
|||
List<ProjectCategoryDTO> projectCategoryData = projectService.getProjectCategoryData(customerId, dateString); |
|||
if (!CollectionUtils.isEmpty(projectCategoryData)){ |
|||
projectCategoryData.forEach(data->{ |
|||
FactOriginProjectCategoryDailyEntity insertEntity = new FactOriginProjectCategoryDailyEntity(); |
|||
IssueProjectCategoryDictEntity categoryDictEntity = issueProjectCategoryDictService.getById(customerId, data.getCategoryId()); |
|||
if (categoryDictEntity == null){ |
|||
log.warn("categoryDict not found : customerId:{},categoryId:{}",customerId,data.getCategoryId()); |
|||
} |
|||
insertEntity.setProjectId(data.getProjectId()); |
|||
insertEntity.setCategoryCode(categoryDictEntity.getCategoryCode()); |
|||
insertEntity.setParentCategoryCode(categoryDictEntity.getParentCategoryCode()); |
|||
insertEntity.setCustomerId(customerId); |
|||
insertEntity.setLevel(Integer.valueOf(categoryDictEntity.getCategoryType())); |
|||
insertEntity.setCreatedTime(data.getCreatedTime()); |
|||
entities.add(insertEntity); |
|||
}); |
|||
if (!CollectionUtils.isEmpty(entities)){ |
|||
delAndInsert(customerId,dateString,entities); |
|||
} |
|||
} |
|||
} |
|||
/** |
|||
* @Description category表删除插入 |
|||
* @param customerId |
|||
* @param dateId |
|||
* @param result |
|||
* @return void |
|||
* @Author liushaowen |
|||
* @Date 2021/3/22 17:01 |
|||
*/ |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void delAndInsert(String customerId,String dateId,List<FactOriginProjectCategoryDailyEntity> result){ |
|||
baseDao.deleteOldData(customerId, dateId); |
|||
insertBatch(result); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* @param customerId |
|||
* @author yinzuomei |
|||
* @description 计算当前客户下,各个网格内,各项目分类下项目数量 |
|||
* @Date 2021/3/23 9:56 |
|||
**/ |
|||
@Override |
|||
public List<ScreenProjectCategoryGridDailyDTO> selectListProjectCategoryGridDailyDTO(String customerId) { |
|||
List<ScreenProjectCategoryGridDailyDTO> list=baseDao.selectListProjectCategoryGridDailyDTO(customerId); |
|||
return list; |
|||
} |
|||
} |
@ -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.form.CategoryDictFormDTO; |
|||
import com.epmet.dto.screencoll.ScreenCollFormDTO; |
|||
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 formDTO |
|||
* @return void |
|||
* @Author zhangyong |
|||
* @Date 16:03 2021-03-22 |
|||
**/ |
|||
void uploadCategoryDict(ScreenCollFormDTO<CategoryDictFormDTO> formDTO); |
|||
} |
@ -0,0 +1,119 @@ |
|||
/** |
|||
* 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.form.CategoryDictFormDTO; |
|||
import com.epmet.dto.screencoll.ScreenCollFormDTO; |
|||
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.apache.commons.collections4.CollectionUtils; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
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()); |
|||
if (StringUtils.isNotBlank(updatedEntity.getCategoryType())) { |
|||
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,datasourceNameFromArg = true) |
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void uploadCategoryDict(ScreenCollFormDTO<CategoryDictFormDTO> formDTO) { |
|||
if (formDTO.getIsFirst()) { |
|||
int deleteNum; |
|||
do { |
|||
deleteNum = baseDao.deleteCustomerProjectCategoryDict(formDTO.getCustomerId()); |
|||
} while (deleteNum > NumConstant.ZERO); |
|||
} |
|||
if (!CollectionUtils.isEmpty(formDTO.getDataList())) { |
|||
baseDao.batchInsertCustomerProjectCategoryDict(formDTO.getDataList(), formDTO.getCustomerId()); |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,47 @@ |
|||
-- epmet_data_statistical 库: |
|||
drop table if exists fact_origin_project_category_daily; |
|||
CREATE TABLE `fact_origin_project_category_daily` ( |
|||
`ID` varchar(64) NOT NULL COMMENT '主键', |
|||
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', |
|||
`PROJECT_ID` varchar(64) NOT NULL COMMENT '项目id', |
|||
`CATEGORY_CODE` varchar(50) NOT NULL COMMENT '分类编码', |
|||
`PARENT_CATEGORY_CODE` varchar(50) NOT NULL COMMENT '所属父类分类编码', |
|||
`LEVEL` int(11) NOT NULL COMMENT '分类等级:1、2....;产品目前只有2级分类', |
|||
`DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除', |
|||
`REVISION` int(11) NOT NULL COMMENT '乐观锁', |
|||
`CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', |
|||
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间', |
|||
`UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', |
|||
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', |
|||
PRIMARY KEY (`ID`) |
|||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='项目所属分类表'; |
|||
|
|||
-- epmet_data_statistical_display 、epmet_evaluation_index: |
|||
drop table if exists customer_project_category_dict; |
|||
CREATE TABLE `customer_project_category_dict` ( |
|||
`ID` varchar(64) NOT NULL COMMENT '主键', |
|||
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', |
|||
`CUSTOMER_TYPE` varchar(20) NOT NULL COMMENT '外部客户:external;内部客户:internal', |
|||
`CATEGORY_CODE` varchar(64) NOT NULL COMMENT '客户自己的分类编码', |
|||
`CATEGORY_NAME` varchar(500) CHARACTER SET utf8 NOT NULL COMMENT '客户自己的分类名称', |
|||
`PARENT_CATEGORY_CODE` varchar(64) NOT NULL COMMENT '父类分类编码,如果是一级分类,此列赋值为0', |
|||
`LEVEL` int(11) NOT NULL COMMENT '分类等级:1、2....;产品只有2级分类', |
|||
`SORT` int(11) unsigned NOT NULL COMMENT '排序', |
|||
`IS_DISABLE` varchar(32) CHARACTER SET utf8 NOT NULL COMMENT '是否禁用(enable:启用 disable:禁用)', |
|||
`EPMET_CATEGORY_CODE` varchar(64) DEFAULT NULL COMMENT '对应e世通中的分类编码,没有此列为空', |
|||
`ORIGIN_CREATED_TIME` datetime DEFAULT NULL COMMENT '原始创建时间', |
|||
`ORIGIN_UPDATED_TIME` datetime DEFAULT NULL COMMENT '原始更新时间', |
|||
`CATEGORY_ID` varchar(64) NOT NULL COMMENT '分类字典表主键', |
|||
`DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除', |
|||
`REVISION` int(11) NOT NULL COMMENT '乐观锁', |
|||
`CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', |
|||
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间', |
|||
`UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', |
|||
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', |
|||
PRIMARY KEY (`ID`) USING BTREE, |
|||
UNIQUE KEY `UN_KEY` (`CUSTOMER_ID`,`CATEGORY_CODE`) USING BTREE |
|||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='客户项目分类字典表'; |
|||
-- epmet_data_statistical_display 、epmet_evaluation_index: |
|||
|
|||
alter table screen_project_category_org_daily add column `LEVEL` int(11) NOT NULL COMMENT '分类等级1、2....'; |
|||
alter table screen_project_category_grid_daily add column `LEVEL` int(11) NOT NULL COMMENT '分类等级1、2....'; |
@ -0,0 +1,65 @@ |
|||
<?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"> |
|||
|
|||
<delete id="deleteOldData"> |
|||
DELETE |
|||
FROM |
|||
fact_origin_project_category_daily |
|||
WHERE |
|||
CUSTOMER_ID = #{customerId} |
|||
<if test="dateId != null"> |
|||
AND DATE_FORMAT(CREATED_TIME,'%Y%m%d') = #{dateId} |
|||
</if> |
|||
</delete> |
|||
|
|||
<!-- 计算当前客户下,各个网格内,各项目分类下项目数量 --> |
|||
<!-- 先算出二级分类的 + 一级分类 --> |
|||
<select id="selectListProjectCategoryGridDailyDTO" parameterType="map" resultType="com.epmet.dto.screen.ScreenProjectCategoryGridDailyDTO"> |
|||
SELECT |
|||
c.CUSTOMER_ID, |
|||
c.CATEGORY_CODE, |
|||
c.`LEVEL`, |
|||
p.GRID_ID, |
|||
p.AGENCY_ID AS PID, |
|||
P.PIDS, |
|||
count(1)as projectTotal |
|||
FROM |
|||
fact_origin_project_category_daily c |
|||
LEFT JOIN fact_origin_project_main_daily p ON ( c.PROJECT_Id = p.id and p.del_flag='0') |
|||
WHERE |
|||
c.DEL_FLAG = '0' |
|||
AND c.CUSTOMER_ID = #{customerId} |
|||
AND c.`LEVEL` = '2' |
|||
GROUP BY |
|||
c.CUSTOMER_ID, |
|||
c.CATEGORY_CODE, |
|||
c.`LEVEL`, |
|||
p.GRID_ID, |
|||
p.AGENCY_ID, |
|||
P.PIDS |
|||
union all |
|||
SELECT |
|||
c.CUSTOMER_ID, |
|||
left(c.CATEGORY_CODE, 4) as CATEGORY_CODE, |
|||
'1'as `LEVEL`, |
|||
p.GRID_ID, |
|||
p.AGENCY_ID AS PID, |
|||
P.PIDS, |
|||
count(distinct c.project_id)as projectTotal |
|||
FROM |
|||
fact_origin_project_category_daily c |
|||
LEFT JOIN fact_origin_project_main_daily p ON ( c.PROJECT_Id = p.id and p.del_flag='0') |
|||
WHERE |
|||
c.DEL_FLAG = '0' |
|||
AND c.CUSTOMER_ID = #{customerId} |
|||
GROUP BY |
|||
c.CUSTOMER_ID, |
|||
left(c.CATEGORY_CODE, 4), |
|||
c.`LEVEL`, |
|||
p.GRID_ID, |
|||
p.AGENCY_ID, |
|||
P.PIDS |
|||
</select> |
|||
</mapper> |
@ -0,0 +1,51 @@ |
|||
<?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> |
|||
|
|||
<select id="getById" resultType="com.epmet.entity.issue.IssueProjectCategoryDictEntity"> |
|||
select * |
|||
from issue_project_category_dict |
|||
where del_flag = '0' |
|||
and customer_id = #{customerId} |
|||
and id = #{id} |
|||
</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> |
@ -0,0 +1,12 @@ |
|||
截止到2021-03-25数据对接外部客户: |
|||
1、市北党建 |
|||
2、安宁e家 |
|||
3、大美孔村街道 |
|||
4、e锦水街道(没有自己的大屏) |
|||
5、微笑榆山街道(没有自己的大屏) |
|||
产品自己的客户上线的大屏: |
|||
1、城阳 |
|||
2、临沂龙湾社区 |
|||
3、平阴县 |
|||
孔村、锦水、榆山这三个街道的数据上报时间要早于平阴县计算的时间,目前已经按天上报和按月上报的,让孔村、榆山、锦水调整到2点前推送了。 |
|||
|
@ -0,0 +1,101 @@ |
|||
/** |
|||
* 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; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import lombok.Data; |
|||
|
|||
|
|||
/** |
|||
* 议题所属分类表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-12-08 |
|||
*/ |
|||
@Data |
|||
public class IssueCategoryDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 客户id |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 网格ID: 议题所属网格Id |
|||
*/ |
|||
private String gridId; |
|||
|
|||
/** |
|||
* 议题id |
|||
*/ |
|||
private String issueId; |
|||
|
|||
/** |
|||
* 分类id |
|||
*/ |
|||
private String categoryId; |
|||
|
|||
/** |
|||
* 分类对应的所有上级,英文逗号隔开 |
|||
*/ |
|||
private String categoryPids; |
|||
|
|||
/** |
|||
* 分类编码,分类编码+customer_id唯一 |
|||
*/ |
|||
private String categoryCode; |
|||
|
|||
/** |
|||
* 删除标识 0未删除、1已删除 |
|||
*/ |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
} |
@ -0,0 +1,116 @@ |
|||
/** |
|||
* 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; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import lombok.Data; |
|||
|
|||
|
|||
/** |
|||
* 议题项目分类字典 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-12-08 |
|||
*/ |
|||
@Data |
|||
public class IssueProjectCategoryDictDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 客户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未删除、1已删除 |
|||
*/ |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
} |
@ -0,0 +1,106 @@ |
|||
/** |
|||
* 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; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import lombok.Data; |
|||
|
|||
|
|||
/** |
|||
* 议题、项目标签字典表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-12-08 |
|||
*/ |
|||
@Data |
|||
public class IssueProjectTagDictDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键ID |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 标签名称 |
|||
*/ |
|||
private String tagName; |
|||
|
|||
/** |
|||
* 分类id, 用户自己添加的标签此列可为空 |
|||
*/ |
|||
private String categoryId; |
|||
|
|||
/** |
|||
* 是否是默认标签(0:是 1:否) |
|||
*/ |
|||
private String isDefault; |
|||
|
|||
/** |
|||
* 议题对标签的引用次数 |
|||
*/ |
|||
private Integer issueUseCount; |
|||
|
|||
/** |
|||
* 项目对标签的引用次数 |
|||
*/ |
|||
private Integer projectUseCount; |
|||
|
|||
/** |
|||
* 是否禁用(enable:启用 disable:禁用) |
|||
*/ |
|||
private String isDisable; |
|||
|
|||
/** |
|||
* 删除标识 0.未删除 1.已删除 |
|||
*/ |
|||
private Integer delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
} |
@ -0,0 +1,96 @@ |
|||
/** |
|||
* 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; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import lombok.Data; |
|||
|
|||
|
|||
/** |
|||
* 议题关联标签表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-12-08 |
|||
*/ |
|||
@Data |
|||
public class IssueTagsDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键ID |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 议题所属网格id |
|||
*/ |
|||
private String gridId; |
|||
|
|||
/** |
|||
* 议题ID |
|||
*/ |
|||
private String issueId; |
|||
|
|||
/** |
|||
* 标签ID |
|||
*/ |
|||
private String tagId; |
|||
|
|||
/** |
|||
* 标签名称 |
|||
*/ |
|||
private String tagName; |
|||
|
|||
/** |
|||
* 删除标识 0.未删除 1.已删除 |
|||
*/ |
|||
private Integer delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
} |
@ -0,0 +1,24 @@ |
|||
package com.epmet.dto.form; |
|||
|
|||
import com.google.gson.internal.$Gson$Types; |
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @DateTime 2020/12/9 下午3:25 |
|||
*/ |
|||
@Data |
|||
public class AddTagFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = -3245317956853388308L; |
|||
|
|||
public interface AddTag{} |
|||
|
|||
@NotBlank(message = "标签名称不能为空",groups = AddTag.class) |
|||
private String tagName; |
|||
|
|||
private String customerId; |
|||
} |
@ -0,0 +1,16 @@ |
|||
package com.epmet.dto.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @author zhaoqifeng |
|||
* @dscription |
|||
* @date 2020/12/10 10:00 |
|||
*/ |
|||
@Data |
|||
public class CategoryTagInitFormDTO implements Serializable { |
|||
private static final long serialVersionUID = -3420775041990761296L; |
|||
private String customerId; |
|||
} |
@ -0,0 +1,47 @@ |
|||
package com.epmet.dto.form; |
|||
|
|||
import lombok.Data; |
|||
import org.hibernate.validator.constraints.Length; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Description 一级分类 新增/修改 |
|||
* @Auth zy |
|||
* @Date 2021-03-22 09:17 |
|||
*/ |
|||
@Data |
|||
public class FirstCategoryFormDTO implements Serializable { |
|||
private static final long serialVersionUID = 3188828578545996470L; |
|||
|
|||
/** |
|||
* 客户Id |
|||
**/ |
|||
@NotBlank(message = "customerId不能为空") |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 分类Id |
|||
* issue_project_category_dict 表主键,只有执行修改操作时,才会传入 |
|||
**/ |
|||
private String categoryId; |
|||
|
|||
/** |
|||
* 分类名称 |
|||
**/ |
|||
@Length(max=20,message = "分类名称不能超过20个字") |
|||
@Length(min=2,message = "分类名称不能少于2个字") |
|||
private String categoryName; |
|||
|
|||
/** |
|||
* 排序 |
|||
**/ |
|||
private Integer sort; |
|||
|
|||
/** |
|||
* 操作类型(add:新增 edit:编辑) |
|||
**/ |
|||
@NotBlank(message = "操作类型不能为空") |
|||
private String type; |
|||
} |
@ -0,0 +1,21 @@ |
|||
package com.epmet.dto.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 获取议题的分类、标签列表-接口入参 |
|||
* @Author sun |
|||
*/ |
|||
@Data |
|||
public class IssueCategoryTagListFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 2599592072265715951L; |
|||
@NotBlank(message = "议题ID不能为空",groups = {ProjectCategoryTagListFormDTO.CategoryTag.class}) |
|||
private String issueId; |
|||
|
|||
public interface CategoryTag{} |
|||
|
|||
} |
@ -0,0 +1,34 @@ |
|||
package com.epmet.dto.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 议题:保存/修改分类-接口入参 |
|||
* @Author sun |
|||
*/ |
|||
@Data |
|||
public class IssueSaveCategoryFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 2599592072265715951L; |
|||
/** |
|||
* 议题Id |
|||
*/ |
|||
@NotBlank(message = "议题ID不能为空",groups = {ProjectSaveCategoryFormDTO.SaveCategory.class}) |
|||
private String issueId; |
|||
/** |
|||
* 议题分类集合 |
|||
*/ |
|||
private List<SaveIssueCategoryFormDTO> categoryList; |
|||
|
|||
/** |
|||
* 客户Id |
|||
*/ |
|||
private String customerId; |
|||
|
|||
public interface SaveCategory{} |
|||
|
|||
} |
@ -0,0 +1,26 @@ |
|||
package com.epmet.dto.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @DateTime 2020/12/10 上午9:31 |
|||
*/ |
|||
@Data |
|||
public class IssueTagFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = -8678756265520573631L; |
|||
|
|||
private String id; |
|||
|
|||
private String name; |
|||
|
|||
private String categoryId; |
|||
|
|||
private String tagId; |
|||
|
|||
private String isDisable; |
|||
|
|||
} |
@ -0,0 +1,72 @@ |
|||
package com.epmet.dto.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @DateTime 2020/12/10 上午9:31 |
|||
*/ |
|||
@Data |
|||
public class IssueTagsFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = -8678756265520570931L; |
|||
|
|||
/** |
|||
* 主键ID |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 议题所属网格id |
|||
*/ |
|||
private String gridId; |
|||
|
|||
/** |
|||
* 议题ID |
|||
*/ |
|||
private String issueId; |
|||
|
|||
/** |
|||
* 标签ID |
|||
*/ |
|||
private String tagId; |
|||
|
|||
/** |
|||
* 标签名称 |
|||
*/ |
|||
private String name; |
|||
|
|||
/** |
|||
* 删除标识 0.未删除 1.已删除 |
|||
*/ |
|||
private Integer delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
public IssueTagsFormDTO() { |
|||
this.delFlag = 0; |
|||
this.revision = 0; |
|||
this.createdBy = "APP_USER"; |
|||
this.updatedBy = "APP_USER"; |
|||
} |
|||
} |
@ -0,0 +1,28 @@ |
|||
package com.epmet.dto.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @DateTime 2020/12/10 上午9:29 |
|||
*/ |
|||
@Data |
|||
public class IssueTagsSaveFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 4122102633306198151L; |
|||
|
|||
public interface IssueTagsSaveForm{} |
|||
|
|||
@NotBlank(message = "议题ID不能为空",groups = {IssueTagsSaveForm.class}) |
|||
private String issueId; |
|||
|
|||
/** |
|||
* 标签集合 为空,清除此议题标签 |
|||
*/ |
|||
private List<IssueTagFormDTO> tagList; |
|||
|
|||
} |
@ -0,0 +1,27 @@ |
|||
package com.epmet.dto.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 议题:保存/修改分类-接口入参 |
|||
* |
|||
* @Author sun |
|||
*/ |
|||
@Data |
|||
public class SaveIssueCategoryFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 2599592072265715951L; |
|||
/** |
|||
* 分类Id |
|||
*/ |
|||
private String id; |
|||
/** |
|||
* 分类名称 |
|||
*/ |
|||
private String name; |
|||
|
|||
|
|||
} |
@ -0,0 +1,21 @@ |
|||
package com.epmet.dto.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Description 二级分类 新增/修改 |
|||
* @ClassName CommonGridIdListFormDTO |
|||
* @Auth zy |
|||
* @Date 2021-03-22 09:17 |
|||
*/ |
|||
@Data |
|||
public class SecondCategoryFormDTO extends FirstCategoryFormDTO implements Serializable{ |
|||
private static final long serialVersionUID = 3188828578545996470L; |
|||
|
|||
/** |
|||
* 一级分类Id |
|||
**/ |
|||
private String parentCategoryId; |
|||
} |
@ -0,0 +1,28 @@ |
|||
package com.epmet.dto.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Description 更新标签使用率入参DTO |
|||
* @ClassName TagDifferentSetFormDTO |
|||
* @Auth wangc |
|||
* @Date 2020-12-11 14:03 |
|||
*/ |
|||
@Data |
|||
public class TagDifferentSetFormDTO implements Serializable { |
|||
private static final long serialVersionUID = -5232943723252172322L; |
|||
|
|||
private List<String> plus; |
|||
|
|||
private List<String> minus; |
|||
|
|||
@NotBlank(message = "客户Id不能为空") |
|||
private String customerId; |
|||
|
|||
@NotBlank(message = "用户Id不能为空") |
|||
private String userId; |
|||
} |
@ -0,0 +1,17 @@ |
|||
package com.epmet.dto.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author zhaoqifeng |
|||
* @dscription |
|||
* @date 2020/12/9 15:32 |
|||
*/ |
|||
@Data |
|||
public class TagListFormDTO implements Serializable { |
|||
private static final long serialVersionUID = -6448213704058150588L; |
|||
private List<String> categoryIdList; |
|||
} |
@ -0,0 +1,23 @@ |
|||
package com.epmet.dto.result; |
|||
|
|||
import lombok.AllArgsConstructor; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @DateTime 2020/12/9 下午5:09 |
|||
*/ |
|||
@Data |
|||
@AllArgsConstructor |
|||
public class AddTagResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 4769136806332933579L; |
|||
|
|||
private String tagId; |
|||
|
|||
public AddTagResultDTO() { |
|||
this.tagId = ""; |
|||
} |
|||
} |
@ -0,0 +1,48 @@ |
|||
package com.epmet.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 客户分类列表 |
|||
* |
|||
* @Author ZY |
|||
* @DateTime 2021/03/23 |
|||
*/ |
|||
@Data |
|||
public class CustomerCategoryResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 4769136806332933579L; |
|||
|
|||
/** |
|||
* 分类Id |
|||
*/ |
|||
private String categoryId; |
|||
|
|||
/** |
|||
* 分类名称 |
|||
*/ |
|||
private String categoryName; |
|||
|
|||
/** |
|||
* 排序 |
|||
*/ |
|||
private Integer sort; |
|||
|
|||
/** |
|||
* 是否禁用(enable:启用 disable:禁用) |
|||
*/ |
|||
private String isDisable; |
|||
|
|||
/** |
|||
* 二级分类 |
|||
*/ |
|||
private List<CustomerCategoryResultDTO> children; |
|||
|
|||
/** |
|||
* pid |
|||
*/ |
|||
private String pid; |
|||
} |
@ -0,0 +1,27 @@ |
|||
package com.epmet.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Description 获取议题的分类、标签列表-接口返参 |
|||
* @Author sun |
|||
*/ |
|||
@Data |
|||
public class IssueCategoryTagListResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 5957826616179876849L; |
|||
|
|||
/** |
|||
* 类别集合 |
|||
*/ |
|||
private List<IssueCategoryTagResultDTO> categoryList = new ArrayList<>(); |
|||
/** |
|||
* 标签集合 |
|||
*/ |
|||
private List<IssueCategoryTagResultDTO> tagList = new ArrayList<>(); |
|||
|
|||
} |
@ -0,0 +1,45 @@ |
|||
package com.epmet.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Objects; |
|||
|
|||
/** |
|||
* @Description 获取议题的分类、标签列表-接口返参 |
|||
* @Author sun |
|||
*/ |
|||
@Data |
|||
public class IssueCategoryTagResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 5957826616179876849L; |
|||
|
|||
/** |
|||
* 分类或标签Id |
|||
*/ |
|||
private String id; |
|||
/** |
|||
* 分类或标签名称 |
|||
*/ |
|||
private String name; |
|||
|
|||
/** |
|||
* 是否禁用(enable:启用 disable:禁用) |
|||
*/ |
|||
private String isDisable; |
|||
|
|||
//equals计算时忽略isDisable属性
|
|||
@Override |
|||
public boolean equals(Object o) { |
|||
if (this == o) return true; |
|||
if (o == null || getClass() != o.getClass()) return false; |
|||
IssueCategoryTagResultDTO that = (IssueCategoryTagResultDTO) o; |
|||
return Objects.equals(id, that.id) && |
|||
Objects.equals(name, that.name); |
|||
} |
|||
|
|||
@Override |
|||
public int hashCode() { |
|||
return Objects.hash(id, name); |
|||
} |
|||
} |
@ -0,0 +1,21 @@ |
|||
package com.epmet.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @DateTime 2020/12/10 下午2:13 |
|||
*/ |
|||
@Data |
|||
public class IssueProjectTagsResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = -5035269596436047038L; |
|||
|
|||
private String tagId; |
|||
|
|||
private String tagName; |
|||
|
|||
private String categoryId; |
|||
} |
@ -0,0 +1,18 @@ |
|||
package com.epmet.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author zhaoqifeng |
|||
* @dscription |
|||
* @date 2020/12/9 15:33 |
|||
*/ |
|||
@Data |
|||
public class TagListResultDTO implements Serializable { |
|||
private static final long serialVersionUID = -4247291364077634874L; |
|||
List<IssueCategoryTagResultDTO> defaulted; |
|||
List<IssueCategoryTagResultDTO> customized; |
|||
} |
@ -0,0 +1,138 @@ |
|||
/** |
|||
* 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.controller; |
|||
|
|||
import com.epmet.commons.tools.annotation.LoginUser; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.commons.tools.security.dto.TokenDto; |
|||
import com.epmet.commons.tools.utils.ExcelUtils; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.commons.tools.validator.AssertUtils; |
|||
import com.epmet.commons.tools.validator.ValidatorUtils; |
|||
import com.epmet.commons.tools.validator.group.AddGroup; |
|||
import com.epmet.commons.tools.validator.group.DefaultGroup; |
|||
import com.epmet.commons.tools.validator.group.UpdateGroup; |
|||
import com.epmet.dto.IssueCategoryDTO; |
|||
import com.epmet.dto.form.IssueCategoryTagListFormDTO; |
|||
import com.epmet.dto.form.IssueSaveCategoryFormDTO; |
|||
import com.epmet.dto.form.ProjectCategoryTagListFormDTO; |
|||
import com.epmet.dto.result.IssueCategoryTagListResultDTO; |
|||
import com.epmet.dto.result.ProjectCategoryTagResultDTO; |
|||
import com.epmet.excel.IssueCategoryExcel; |
|||
import com.epmet.service.IssueCategoryService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import javax.servlet.http.HttpServletResponse; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
|
|||
/** |
|||
* 议题所属分类表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-12-08 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("issuecategory") |
|||
public class IssueCategoryController { |
|||
|
|||
@Autowired |
|||
private IssueCategoryService issueCategoryService; |
|||
|
|||
@GetMapping("page") |
|||
public Result<PageData<IssueCategoryDTO>> page(@RequestParam Map<String, Object> params) { |
|||
PageData<IssueCategoryDTO> page = issueCategoryService.page(params); |
|||
return new Result<PageData<IssueCategoryDTO>>().ok(page); |
|||
} |
|||
|
|||
@GetMapping("{id}") |
|||
public Result<IssueCategoryDTO> get(@PathVariable("id") String id) { |
|||
IssueCategoryDTO data = issueCategoryService.get(id); |
|||
return new Result<IssueCategoryDTO>().ok(data); |
|||
} |
|||
|
|||
@PostMapping |
|||
public Result save(@RequestBody IssueCategoryDTO dto) { |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|||
issueCategoryService.save(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@PutMapping |
|||
public Result update(@RequestBody IssueCategoryDTO dto) { |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|||
issueCategoryService.update(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@DeleteMapping |
|||
public Result delete(@RequestBody String[] ids) { |
|||
//效验数据
|
|||
AssertUtils.isArrayEmpty(ids, "id"); |
|||
issueCategoryService.delete(ids); |
|||
return new Result(); |
|||
} |
|||
|
|||
@GetMapping("export") |
|||
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
|||
List<IssueCategoryDTO> list = issueCategoryService.list(params); |
|||
ExcelUtils.exportExcelToTarget(response, null, list, IssueCategoryExcel.class); |
|||
} |
|||
|
|||
/** |
|||
* @param formDTO |
|||
* @return |
|||
* @Description 获取议题的分类、标签列表 |
|||
* @Author sun |
|||
**/ |
|||
@PostMapping("categorytaglist") |
|||
public Result<IssueCategoryTagListResultDTO> categoryTagList(@RequestBody IssueCategoryTagListFormDTO formDTO) { |
|||
ValidatorUtils.validateEntity(formDTO, IssueCategoryTagListFormDTO.CategoryTag.class); |
|||
return new Result<IssueCategoryTagListResultDTO>().ok(issueCategoryService.categoryTagList(formDTO)); |
|||
} |
|||
|
|||
/** |
|||
* @param formDTO |
|||
* @return |
|||
* @Description 查询分类Id集合对应的分类名称,按分类升序排列 |
|||
* @Author sun |
|||
**/ |
|||
@PostMapping("projectcategorylist") |
|||
public Result<List<ProjectCategoryTagResultDTO>> projectCategoryList(@RequestBody ProjectCategoryTagListFormDTO formDTO) { |
|||
return new Result<List<ProjectCategoryTagResultDTO>>().ok(issueCategoryService.projectCategoryList(formDTO)); |
|||
} |
|||
|
|||
/** |
|||
* @param formDTO |
|||
* @return |
|||
* @Description 议题:保存/修改分类 |
|||
* @Author sun |
|||
**/ |
|||
@PostMapping("save") |
|||
public Result saveCategory(@LoginUser TokenDto tokenDto, @RequestBody IssueSaveCategoryFormDTO formDTO) { |
|||
formDTO.setCustomerId(tokenDto.getCustomerId()); |
|||
ValidatorUtils.validateEntity(formDTO, IssueSaveCategoryFormDTO.SaveCategory.class); |
|||
issueCategoryService.saveCategory(formDTO); |
|||
return new Result(); |
|||
} |
|||
|
|||
} |
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue