18 changed files with 786 additions and 1 deletions
@ -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,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.stats; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.dao.BaseDao; |
||||
|
import com.epmet.entity.stats.CustomerProjectCategoryDictEntity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
/** |
||||
|
* 客户项目分类字典表 |
||||
|
* |
||||
|
* @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); |
||||
|
} |
@ -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.stats; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.dao.BaseDao; |
||||
|
import com.epmet.entity.stats.FactOrginProjectCategoryEntity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
|
||||
|
/** |
||||
|
* 项目所属分类表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-03-19 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface FactOrginProjectCategoryDao extends BaseDao<FactOrginProjectCategoryEntity> { |
||||
|
|
||||
|
} |
@ -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,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.stats; |
||||
|
|
||||
|
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_orgin_project_category") |
||||
|
public class FactOrginProjectCategoryEntity 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,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,45 @@ |
|||||
|
/** |
||||
|
* 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.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(); |
||||
|
} |
@ -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.stats; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.service.BaseService; |
||||
|
import com.epmet.entity.stats.FactOrginProjectCategoryEntity; |
||||
|
|
||||
|
/** |
||||
|
* 项目所属分类表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-03-19 |
||||
|
*/ |
||||
|
public interface FactOrginProjectCategoryService extends BaseService<FactOrginProjectCategoryEntity> { |
||||
|
|
||||
|
} |
@ -0,0 +1,97 @@ |
|||||
|
/** |
||||
|
* 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.constant.DataSourceConstant; |
||||
|
import com.epmet.dao.stats.CustomerProjectCategoryDictDao; |
||||
|
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 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(); |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,35 @@ |
|||||
|
/** |
||||
|
* 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.mybatis.service.impl.BaseServiceImpl; |
||||
|
import com.epmet.dao.stats.FactOrginProjectCategoryDao; |
||||
|
import com.epmet.entity.stats.FactOrginProjectCategoryEntity; |
||||
|
import com.epmet.service.stats.FactOrginProjectCategoryService; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
/** |
||||
|
* 项目所属分类表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-03-19 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class FactOrginProjectCategoryServiceImpl extends BaseServiceImpl<FactOrginProjectCategoryDao, FactOrginProjectCategoryEntity> implements FactOrginProjectCategoryService { |
||||
|
|
||||
|
} |
@ -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,41 @@ |
|||||
|
<?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> |
||||
|
</mapper> |
@ -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.stats.FactOrginProjectCategoryDao"> |
||||
|
|
||||
|
|
||||
|
|
||||
|
</mapper> |
Loading…
Reference in new issue