|  |  | @ -3,12 +3,12 @@ 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.tools.constant.FieldConstant; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.exception.EpmetException; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.page.PageData; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.redis.common.CustomerStaffRedis; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.utils.ConvertUtils; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.constant.FieldConstant; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.dao.IcEmployeeRegisterDao; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.dto.IcEmployeeRegisterDTO; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.dto.form.EmployeeRegisterListFormDTO; | 
			
		
	
	
		
			
				
					|  |  | @ -25,7 +25,6 @@ import org.springframework.beans.factory.annotation.Autowired; | 
			
		
	
		
			
				
					|  |  |  | import org.springframework.stereotype.Service; | 
			
		
	
		
			
				
					|  |  |  | import org.springframework.transaction.annotation.Transactional; | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | import java.util.Arrays; | 
			
		
	
		
			
				
					|  |  |  | import java.util.List; | 
			
		
	
		
			
				
					|  |  |  | import java.util.Map; | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
	
		
			
				
					|  |  | @ -81,17 +80,19 @@ public class IcEmployeeRegisterServiceImpl extends BaseServiceImpl<IcEmployeeReg | 
			
		
	
		
			
				
					|  |  |  |     @Override | 
			
		
	
		
			
				
					|  |  |  |     @Transactional(rollbackFor = Exception.class) | 
			
		
	
		
			
				
					|  |  |  |     public void save(IcEmployeeRegisterDTO dto) { | 
			
		
	
		
			
				
					|  |  |  |         IcEmployeeRegisterDetailEntity detailEntity = ConvertUtils.sourceToTarget(dto, IcEmployeeRegisterDetailEntity.class); | 
			
		
	
		
			
				
					|  |  |  |         // 先看看存在不
 | 
			
		
	
		
			
				
					|  |  |  |         IcEmployeeRegisterEntity employeeRegisterEntity = baseDao.getEmployeeRegisterByIdCard(dto.getIdCard()); | 
			
		
	
		
			
				
					|  |  |  |         IcEmployeeRegisterEntity entity; | 
			
		
	
		
			
				
					|  |  |  |         if (null == employeeRegisterEntity){ | 
			
		
	
		
			
				
					|  |  |  |             entity = ConvertUtils.sourceToTarget(dto, IcEmployeeRegisterEntity.class); | 
			
		
	
		
			
				
					|  |  |  |             insert(entity); | 
			
		
	
		
			
				
					|  |  |  |         IcEmployeeRegisterEntity origin = baseDao.getEmployeeRegisterByIdCard(dto.getIdCard()); | 
			
		
	
		
			
				
					|  |  |  |         if (null == origin){ | 
			
		
	
		
			
				
					|  |  |  |             IcEmployeeRegisterEntity insertEntity = ConvertUtils.sourceToTarget(dto, IcEmployeeRegisterEntity.class); | 
			
		
	
		
			
				
					|  |  |  |             insert(insertEntity); | 
			
		
	
		
			
				
					|  |  |  |             detailEntity.setRegisterId(insertEntity.getId()); | 
			
		
	
		
			
				
					|  |  |  |         }else { | 
			
		
	
		
			
				
					|  |  |  |             entity = employeeRegisterEntity; | 
			
		
	
		
			
				
					|  |  |  |             origin.setMobile(dto.getMobile()); | 
			
		
	
		
			
				
					|  |  |  |             origin.setName(dto.getName()); | 
			
		
	
		
			
				
					|  |  |  |             updateById(origin); | 
			
		
	
		
			
				
					|  |  |  |             detailEntity.setRegisterId(origin.getId()); | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |         IcEmployeeRegisterDetailEntity detailEntity = ConvertUtils.sourceToTarget(dto, IcEmployeeRegisterDetailEntity.class); | 
			
		
	
		
			
				
					|  |  |  |         detailEntity.setRegisterId(entity.getId()); | 
			
		
	
		
			
				
					|  |  |  |         icEmployeeRegisterDetailService.insert(detailEntity); | 
			
		
	
		
			
				
					|  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
	
		
			
				
					|  |  | 
 |