|  |  | @ -23,9 +23,12 @@ import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; | 
			
		
	
		
			
				
					|  |  |  | import com.elink.esua.epdc.commons.tools.constant.FieldConstant; | 
			
		
	
		
			
				
					|  |  |  | import com.elink.esua.epdc.commons.tools.page.PageData; | 
			
		
	
		
			
				
					|  |  |  | import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; | 
			
		
	
		
			
				
					|  |  |  | import com.elink.esua.epdc.commons.tools.utils.Result; | 
			
		
	
		
			
				
					|  |  |  | import com.elink.esua.epdc.dto.PersonTestingDTO; | 
			
		
	
		
			
				
					|  |  |  | import com.elink.esua.epdc.dto.UploadFormDTO; | 
			
		
	
		
			
				
					|  |  |  | import com.elink.esua.epdc.modules.epidemic.dao.PersonTestingDao; | 
			
		
	
		
			
				
					|  |  |  | import com.elink.esua.epdc.modules.epidemic.entity.PersonTestingEntity; | 
			
		
	
		
			
				
					|  |  |  | import com.elink.esua.epdc.modules.epidemic.feign.OssFeignClient; | 
			
		
	
		
			
				
					|  |  |  | import com.elink.esua.epdc.modules.epidemic.redis.PersonTestingRedis; | 
			
		
	
		
			
				
					|  |  |  | import com.elink.esua.epdc.modules.epidemic.service.PersonTestingService; | 
			
		
	
		
			
				
					|  |  |  | import org.apache.commons.lang3.StringUtils; | 
			
		
	
	
		
			
				
					|  |  | @ -36,6 +39,7 @@ import org.springframework.transaction.annotation.Transactional; | 
			
		
	
		
			
				
					|  |  |  | import java.text.ParseException; | 
			
		
	
		
			
				
					|  |  |  | import java.text.SimpleDateFormat; | 
			
		
	
		
			
				
					|  |  |  | import java.util.Arrays; | 
			
		
	
		
			
				
					|  |  |  | import java.util.Date; | 
			
		
	
		
			
				
					|  |  |  | import java.util.List; | 
			
		
	
		
			
				
					|  |  |  | import java.util.Map; | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
	
		
			
				
					|  |  | @ -51,6 +55,9 @@ public class PersonTestingServiceImpl extends BaseServiceImpl<PersonTestingDao, | 
			
		
	
		
			
				
					|  |  |  |     @Autowired | 
			
		
	
		
			
				
					|  |  |  |     private PersonTestingRedis personTestingRedis; | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     @Autowired | 
			
		
	
		
			
				
					|  |  |  |     private OssFeignClient ossFeignClient; | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     @Override | 
			
		
	
		
			
				
					|  |  |  |     public PageData<PersonTestingDTO> page(Map<String, Object> params) { | 
			
		
	
		
			
				
					|  |  |  | //        IPage<PersonTestingEntity> page = baseDao.selectPage(
 | 
			
		
	
	
		
			
				
					|  |  | @ -142,4 +149,22 @@ public class PersonTestingServiceImpl extends BaseServiceImpl<PersonTestingDao, | 
			
		
	
		
			
				
					|  |  |  |         baseDao.deleteBatchIds(Arrays.asList(ids)); | 
			
		
	
		
			
				
					|  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     @Transactional | 
			
		
	
		
			
				
					|  |  |  |     @Override | 
			
		
	
		
			
				
					|  |  |  |     public Result saveScanningInfo(PersonTestingDTO dto) { | 
			
		
	
		
			
				
					|  |  |  |         UploadFormDTO form = new UploadFormDTO(); | 
			
		
	
		
			
				
					|  |  |  |         form.setBase64String(dto.getImgCode()); | 
			
		
	
		
			
				
					|  |  |  |         PersonTestingEntity entity = ConvertUtils.sourceToTarget(dto, PersonTestingEntity.class); | 
			
		
	
		
			
				
					|  |  |  |         Result<String> uploadResult = ossFeignClient.uploadBase64(form); | 
			
		
	
		
			
				
					|  |  |  |         if(!uploadResult.success()){ | 
			
		
	
		
			
				
					|  |  |  |             return new Result().error("上传图片错误"); | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |         if(StringUtils.isNotBlank(uploadResult.getData())){ | 
			
		
	
		
			
				
					|  |  |  |             entity.setImgUrl(uploadResult.getData()); | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |         entity.setTestingTime(new Date()); | 
			
		
	
		
			
				
					|  |  |  |         insert(entity); | 
			
		
	
		
			
				
					|  |  |  |         return new Result().ok("录入成功"); | 
			
		
	
		
			
				
					|  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | } |