13 changed files with 313 additions and 1 deletions
@ -0,0 +1,28 @@ |
|||
package com.elink.esua.epdc.dto.item; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 满意度评价部门 |
|||
* @Author LC |
|||
* @Date 2019/9/17 8:58 |
|||
*/ |
|||
@Data |
|||
public class ItemEvaluateDeptDTO implements Serializable { |
|||
private static final long serialVersionUID = 5738279202788300322L; |
|||
|
|||
/** |
|||
* 部门ID |
|||
*/ |
|||
private Long deptId; |
|||
/** |
|||
* 部门名称 |
|||
*/ |
|||
private String deptName; |
|||
/** |
|||
* 评价满意度 |
|||
*/ |
|||
private int evaluationLevel; |
|||
} |
@ -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.elink.esua.epdc.modules.item.dao; |
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; |
|||
import com.elink.esua.epdc.modules.item.entity.ItemEvaluateDeptEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 部门满意度评价表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2019-09-17 |
|||
*/ |
|||
@Mapper |
|||
public interface ItemEvaluateDeptDao extends BaseDao<ItemEvaluateDeptEntity> { |
|||
|
|||
} |
@ -0,0 +1,66 @@ |
|||
/** |
|||
* 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.elink.esua.epdc.modules.item.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 部门满意度评价表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2019-09-17 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("epdc_item_evaluate_dept") |
|||
public class ItemEvaluateDeptEntity extends BaseEpdcEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 项目ID |
|||
*/ |
|||
private String itemId; |
|||
|
|||
/** |
|||
* 被评价部门ID |
|||
*/ |
|||
private Long deptId; |
|||
|
|||
/** |
|||
* 被评价部门名称 |
|||
*/ |
|||
private String deptName; |
|||
|
|||
/** |
|||
* 评价满意度 |
|||
*/ |
|||
private Integer evaluationLevel; |
|||
|
|||
/** |
|||
* 操作人部门ID |
|||
*/ |
|||
private Long createdDeptId; |
|||
|
|||
} |
@ -0,0 +1,52 @@ |
|||
/** |
|||
* 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.elink.esua.epdc.modules.item.service; |
|||
import com.elink.esua.epdc.commons.mybatis.service.BaseService; |
|||
import com.elink.esua.epdc.dto.item.ItemEvaluateDeptDTO; |
|||
import com.elink.esua.epdc.modules.item.entity.ItemEvaluateDeptEntity; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 部门满意度评价表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2019-09-17 |
|||
*/ |
|||
public interface ItemEvaluateDeptService extends BaseService<ItemEvaluateDeptEntity> { |
|||
|
|||
/** |
|||
* 批量删除 |
|||
* |
|||
* @param ids |
|||
* @return void |
|||
* @author generator |
|||
* @date 2019-09-17 |
|||
*/ |
|||
void delete(String[] ids); |
|||
|
|||
/** |
|||
* 保存部门满意度评价 |
|||
* @Params: [evaluateDeptDTOS] |
|||
* @Return: void |
|||
* @Author: liuchuang |
|||
* @Date: 2019/9/17 9:39 |
|||
*/ |
|||
void saveEvaluateDepts(List<ItemEvaluateDeptDTO> evaluateDeptDTOS, String itemId, Long createdDeptId); |
|||
} |
@ -0,0 +1,64 @@ |
|||
/** |
|||
* 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.elink.esua.epdc.modules.item.service.impl; |
|||
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; |
|||
import com.elink.esua.epdc.dto.item.ItemEvaluateDeptDTO; |
|||
import com.elink.esua.epdc.modules.item.dao.ItemEvaluateDeptDao; |
|||
import com.elink.esua.epdc.modules.item.entity.ItemEvaluateDeptEntity; |
|||
import com.elink.esua.epdc.modules.item.service.ItemEvaluateDeptService; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.Arrays; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 部门满意度评价表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2019-09-17 |
|||
*/ |
|||
@Service |
|||
public class ItemEvaluateDeptServiceImpl extends BaseServiceImpl<ItemEvaluateDeptDao, ItemEvaluateDeptEntity> implements ItemEvaluateDeptService { |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void delete(String[] ids) { |
|||
// 逻辑删除(@TableLogic 注解)
|
|||
baseDao.deleteBatchIds(Arrays.asList(ids)); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void saveEvaluateDepts(List<ItemEvaluateDeptDTO> evaluateDeptDTOS, String itemId, Long createdDeptId) { |
|||
List<ItemEvaluateDeptEntity> evaluateDeptEntities = new ArrayList<>(); |
|||
for (ItemEvaluateDeptDTO dto: |
|||
evaluateDeptDTOS) { |
|||
ItemEvaluateDeptEntity entity = new ItemEvaluateDeptEntity(); |
|||
entity.setDeptId(dto.getDeptId()); |
|||
entity.setDeptName(dto.getDeptName()); |
|||
entity.setEvaluationLevel(dto.getEvaluationLevel()); |
|||
entity.setItemId(itemId); |
|||
entity.setCreatedDeptId(createdDeptId); |
|||
evaluateDeptEntities.add(entity); |
|||
} |
|||
this.insertBatch(evaluateDeptEntities); |
|||
} |
|||
|
|||
} |
Loading…
Reference in new issue