|  | @ -1,23 +1,19 @@ | 
			
		
	
		
		
			
				
					|  |  | package com.epmet.service.impl; |  |  | package com.epmet.service.impl; | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |  |  |  | 
			
		
	
		
		
			
				
					|  |  | import com.baomidou.mybatisplus.core.metadata.IPage; |  |  |  | 
			
		
	
		
		
			
				
					|  |  | import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |  |  | import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; | 
			
		
	
		
		
			
				
					
					|  |  | import com.epmet.commons.tools.page.PageData; |  |  | import com.epmet.commons.tools.security.dto.TokenDto; | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  | import com.epmet.commons.tools.utils.ConvertUtils; |  |  | import com.epmet.commons.tools.utils.ConvertUtils; | 
			
		
	
		
		
			
				
					|  |  | import com.epmet.commons.tools.constant.FieldConstant; |  |  |  | 
			
		
	
		
		
			
				
					|  |  | import com.epmet.dao.IcIndividualCategoryManageDao; |  |  | import com.epmet.dao.IcIndividualCategoryManageDao; | 
			
		
	
		
		
			
				
					
					|  |  | import com.epmet.dto.IcIndividualCategoryManageDTO; |  |  | import com.epmet.dto.form.EditIndividualCategoryFormDTO; | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  |  |  |  | import com.epmet.dto.result.IndividualCategoryListResultDTO; | 
			
		
	
		
		
			
				
					|  |  | import com.epmet.entity.IcIndividualCategoryManageEntity; |  |  | import com.epmet.entity.IcIndividualCategoryManageEntity; | 
			
		
	
		
		
			
				
					|  |  | import com.epmet.service.IcIndividualCategoryManageService; |  |  | import com.epmet.service.IcIndividualCategoryManageService; | 
			
		
	
		
		
			
				
					
					|  |  | import org.apache.commons.lang3.StringUtils; |  |  | import org.apache.commons.collections4.CollectionUtils; | 
			
				
				
			
		
	
		
		
			
				
					|  |  | import org.springframework.beans.factory.annotation.Autowired; |  |  |  | 
			
		
	
		
		
	
		
		
			
				
					|  |  | import org.springframework.stereotype.Service; |  |  | import org.springframework.stereotype.Service; | 
			
		
	
		
		
			
				
					|  |  | import org.springframework.transaction.annotation.Transactional; |  |  | import org.springframework.transaction.annotation.Transactional; | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  | import java.util.Arrays; |  |  | import java.util.ArrayList; | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  | import java.util.List; |  |  | import java.util.List; | 
			
		
	
		
		
			
				
					|  |  | import java.util.Map; |  |  |  | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  | /** |  |  | /** | 
			
		
	
		
		
			
				
					|  |  |  * 个人分类管理 |  |  |  * 个人分类管理 | 
			
		
	
	
		
		
			
				
					|  | @ -28,18 +24,39 @@ import java.util.Map; | 
			
		
	
		
		
			
				
					|  |  | @Service |  |  | @Service | 
			
		
	
		
		
			
				
					|  |  | public class IcIndividualCategoryManageServiceImpl extends BaseServiceImpl<IcIndividualCategoryManageDao, IcIndividualCategoryManageEntity> implements IcIndividualCategoryManageService { |  |  | public class IcIndividualCategoryManageServiceImpl extends BaseServiceImpl<IcIndividualCategoryManageDao, IcIndividualCategoryManageEntity> implements IcIndividualCategoryManageService { | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  |     /** | 
			
		
	
		
		
			
				
					|  |  |  |  |  |      * @Description 【人员分类管理】查询个人分类列表 | 
			
		
	
		
		
			
				
					|  |  |  |  |  |      * @param tokenDto | 
			
		
	
		
		
			
				
					|  |  |  |  |  |      * @author zxc | 
			
		
	
		
		
			
				
					|  |  |  |  |  |      * @date 2022/1/17 10:55 上午 | 
			
		
	
		
		
			
				
					|  |  |  |  |  |      */ | 
			
		
	
		
		
			
				
					|  |  |     @Override |  |  |     @Override | 
			
		
	
		
		
			
				
					
					|  |  |     @Transactional(rollbackFor = Exception.class) |  |  |     public List<IndividualCategoryListResultDTO> individualCategoryList(TokenDto tokenDto) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |     public void save(IcIndividualCategoryManageDTO dto) { |  |  |         List<IndividualCategoryListResultDTO> result = baseDao.individualCategoryList(tokenDto.getUserId()); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |         IcIndividualCategoryManageEntity entity = ConvertUtils.sourceToTarget(dto, IcIndividualCategoryManageEntity.class); |  |  |         if (CollectionUtils.isNotEmpty(result)){ | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |         insert(entity); |  |  |             return result; | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					|  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					|  |  |  |  |  |         return new ArrayList<>(); | 
			
		
	
		
		
			
				
					|  |  |     } |  |  |     } | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  |     /** | 
			
		
	
		
		
			
				
					|  |  |  |  |  |      * @Description 【人员分类管理】个人分类修改(添加修改一个接口) | 
			
		
	
		
		
			
				
					|  |  |  |  |  |      * @param formDTOS | 
			
		
	
		
		
			
				
					|  |  |  |  |  |      * @param tokenDto | 
			
		
	
		
		
			
				
					|  |  |  |  |  |      * @author zxc | 
			
		
	
		
		
			
				
					|  |  |  |  |  |      * @date 2022/1/17 11:04 上午 | 
			
		
	
		
		
			
				
					|  |  |  |  |  |      */ | 
			
		
	
		
		
			
				
					|  |  |     @Override |  |  |     @Override | 
			
		
	
		
		
			
				
					|  |  |     @Transactional(rollbackFor = Exception.class) |  |  |     @Transactional(rollbackFor = Exception.class) | 
			
		
	
		
		
			
				
					
					|  |  |     public void update(IcIndividualCategoryManageDTO dto) { |  |  |     public void editIndividualCategory(List<EditIndividualCategoryFormDTO> formDTOS, TokenDto tokenDto) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |         IcIndividualCategoryManageEntity entity = ConvertUtils.sourceToTarget(dto, IcIndividualCategoryManageEntity.class); |  |  |         if (CollectionUtils.isNotEmpty(formDTOS)){ | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |         updateById(entity); |  |  |             baseDao.deleteOldData(tokenDto.getUserId(),tokenDto.getCustomerId()); | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					|  |  |  |  |  |             List<IcIndividualCategoryManageEntity> entities = ConvertUtils.sourceToTarget(formDTOS, IcIndividualCategoryManageEntity.class); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             entities.forEach(e -> { | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                 e.setCustomerId(tokenDto.getCustomerId()); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                 e.setUserId(tokenDto.getUserId()); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             }); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             insertBatch(entities); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					|  |  |     } |  |  |     } | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  |  | 
			
		
	
		
		
			
				
					|  |  | } |  |  | } |