|
@@ -16,6 +16,7 @@ import com.om.entity.vo.DiaMenuQueryPageVO;
|
|
|
import com.om.entity.vo.DiaMenuUploadVO;
|
|
|
import com.om.entity.vo.DistributorQueryPageVO;
|
|
|
import com.om.exception.BadReqException;
|
|
|
+import com.om.exception.BizException;
|
|
|
import com.om.mapper.DiagnosticMenuMapper;
|
|
|
import com.om.service.IClientService;
|
|
|
import com.om.service.IDiagnosticMenuService;
|
|
@@ -28,6 +29,7 @@ import org.springframework.web.multipart.MultipartFile;
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
|
import java.io.IOException;
|
|
|
+import java.lang.reflect.Array;
|
|
|
import java.time.LocalDate;
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.util.ArrayList;
|
|
@@ -62,6 +64,19 @@ public class DiagnosticMenuServiceImpl extends ServiceImpl<DiagnosticMenuMapper,
|
|
|
if (BeanUtil.isEmpty(dto)) {
|
|
|
throw new BadReqException("数据为空");
|
|
|
}
|
|
|
+ List<Integer> clientIds = new ArrayList<>();
|
|
|
+ try{
|
|
|
+ clientIds = Arrays.stream(dto.getClientIds().split(","))
|
|
|
+ .map(Integer::parseInt)
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ }catch (Exception e){
|
|
|
+ throw new BizException("字符串转换数组错误,请检查字符串是否正确");
|
|
|
+ }
|
|
|
+ //查询 客户端id
|
|
|
+ List<Client> clients = clientService.listByIds(clientIds);
|
|
|
+ if (clients.isEmpty()){
|
|
|
+ throw new BadReqException("客户端查询错误");
|
|
|
+ }
|
|
|
|
|
|
DiagnosticMenu diagnosticMenu = BeanUtil.copyProperties(dto, DiagnosticMenu.class);
|
|
|
diagnosticMenu.setCreateTime(LocalDateTime.now());
|
|
@@ -152,10 +167,15 @@ public class DiagnosticMenuServiceImpl extends ServiceImpl<DiagnosticMenuMapper,
|
|
|
List<DiagnosticMenuVO> voList = new ArrayList<>();
|
|
|
for (DiagnosticMenu diagnosticMenu : records) {
|
|
|
DiagnosticMenuVO diagnosticMenuVO = BeanUtil.copyProperties(diagnosticMenu, DiagnosticMenuVO.class);
|
|
|
+ List<Integer> clientIds = new ArrayList<>();
|
|
|
+ try{
|
|
|
+ clientIds = Arrays.stream(diagnosticMenu.getClientIds().split(","))
|
|
|
+ .map(Integer::parseInt)
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ }catch (Exception e){
|
|
|
+ throw new BizException("字符串转换数组错误,请检查字符串是否正确");
|
|
|
+ }
|
|
|
|
|
|
- List<Integer> clientIds = Arrays.stream(diagnosticMenu.getClientIds().split(","))
|
|
|
- .map(Integer::parseInt)
|
|
|
- .collect(Collectors.toList());
|
|
|
|
|
|
//根据id集合批量查询 客户端
|
|
|
List<Client> clients = clientService.listByIds(clientIds);
|