|
@@ -191,14 +191,68 @@ public class BackTrackService {
|
|
|
if (CollectionUtils.isEmpty(list)) {
|
|
if (CollectionUtils.isEmpty(list)) {
|
|
|
return PageRes.build(pageInfo, list);
|
|
return PageRes.build(pageInfo, list);
|
|
|
}
|
|
}
|
|
|
|
|
+ for(IntegrationVo vo : list){
|
|
|
|
|
+ List<Object> stringList = new ArrayList<>();
|
|
|
|
|
|
|
|
- return PageRes.build(pageInfo, list);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
|
|
+ String[] partNames = vo.getPartNames().split(",");
|
|
|
|
|
+ for(int i=0;i<partNames.length;i++){
|
|
|
|
|
+ Map<String,Object> strArray = new HashMap<>();
|
|
|
|
|
+ if(DictItemEnum.getData(partNames[i]).getName().equals("ISNULL")){
|
|
|
|
|
+ strArray.put("name",partNames[i]);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ strArray.put("name",DictItemEnum.getData(partNames[i]).getName());
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
+ stringList.add(strArray);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
+ vo.setPartTrueNames(stringList);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ return PageRes.build(pageInfo, list);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
+ public HttpResult getIntegrationDetail(String integrationId) {
|
|
|
|
|
+ KwsIntegration integration = integrationMapper.selectOne(new LambdaQueryWrapper<KwsIntegration>()
|
|
|
|
|
+ .eq(KwsIntegration::getId, integrationId)
|
|
|
|
|
+ .eq(KwsIntegration::getDelFlag, 0)
|
|
|
|
|
+ );
|
|
|
|
|
+ return HttpResult.ok(integration);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 新增设备
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param vo 请求参数
|
|
|
|
|
+ * @param request http流
|
|
|
|
|
+ * @return 返回值
|
|
|
|
|
+ */
|
|
|
|
|
+ @Transactional
|
|
|
|
|
+ public HttpResult integrationAdd(IntegrationVo vo, HttpServletRequest request) {
|
|
|
|
|
+ KwsIntegration has = integrationMapper.selectOne(new LambdaQueryWrapper<KwsIntegration>()
|
|
|
|
|
+ .eq(KwsIntegration::getIntegrationName, vo.getIntegrationName())
|
|
|
|
|
+ .eq(KwsIntegration::getDelFlag, 0)
|
|
|
|
|
+ );
|
|
|
|
|
+ if (!Objects.isNull(has)) {
|
|
|
|
|
+ throw new SystemException(HttpStatus.QUERY_FAIL_CODE, HttpStatus.INTEGRATION_EXISTS);
|
|
|
|
|
+ }
|
|
|
|
|
+ HeaderData headerData = commonService.getHeaderData(request);
|
|
|
|
|
+ KwsIntegration integration = new KwsIntegration();
|
|
|
|
|
+ BeanUtils.copyProperties(vo, integration);
|
|
|
|
|
+ Date now = new Date();
|
|
|
|
|
+ long id = new IdWorker(NumberConstant.ONE).nextId();
|
|
|
|
|
+ integration.setId(id);
|
|
|
|
|
+ integration.setCreateBy(Long.parseLong(headerData.getCreateBy()));
|
|
|
|
|
+ integration.setCreateTime(now);
|
|
|
|
|
+ byte b = (byte) NumberConstant.ONE;
|
|
|
|
|
+ byte zero = (byte) NumberConstant.ZERO;
|
|
|
|
|
+ integration.setStatus(b);
|
|
|
|
|
+ integration.setUpdateBy(Long.parseLong(headerData.getUpdateBy()));
|
|
|
|
|
+ integration.setUpdateTime(now);
|
|
|
|
|
+ integration.setDelFlag(zero);
|
|
|
|
|
+ integration.setMountainId(headerData.getCompanyId());
|
|
|
|
|
+ integrationMapper.insert(integration);
|
|
|
|
|
+ return HttpResult.ok();
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|