|
@@ -8,6 +8,7 @@ import com.om.entity.vo.AppVO;
|
|
|
import com.om.entity.vo.DignosisPageVO;
|
|
|
import com.om.entity.vo.PcbInfoVO;
|
|
|
import com.om.mapper.AppMapper;
|
|
|
+import com.om.mapper.ClientMapper;
|
|
|
import com.om.service.*;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.om.utils.CommonUtil;
|
|
@@ -15,6 +16,7 @@ import com.om.utils.Result;
|
|
|
import com.om.utils.UserContext;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
@@ -41,6 +43,8 @@ public class AppServiceImpl extends ServiceImpl<AppMapper, App> implements IAppS
|
|
|
|
|
|
@Resource
|
|
|
private IAppsClientsService clientsService;
|
|
|
+ @Resource
|
|
|
+ private ClientMapper clientMapper;
|
|
|
|
|
|
@Override
|
|
|
public Result add(AppVO appVO) {
|
|
@@ -121,6 +125,13 @@ public class AppServiceImpl extends ServiceImpl<AppMapper, App> implements IAppS
|
|
|
}
|
|
|
appVO.setDescription(d);
|
|
|
appVO.setLanguage(l);
|
|
|
+ String fileName = appVO.getFileName();
|
|
|
+ int lastIndexOf = fileName.lastIndexOf(".");
|
|
|
+ if (lastIndexOf != -1) {
|
|
|
+ appVO.setVersionNum(fileName.substring(0,lastIndexOf));
|
|
|
+ }else {
|
|
|
+ appVO.setVersionNum("");
|
|
|
+ }
|
|
|
|
|
|
//在取出来客户端编号
|
|
|
LambdaQueryWrapper<AppsClients> queryWrapper = new LambdaQueryWrapper<>();
|
|
@@ -128,17 +139,25 @@ public class AppServiceImpl extends ServiceImpl<AppMapper, App> implements IAppS
|
|
|
List<AppsClients> list = clientsService.list(queryWrapper);
|
|
|
String [] n = new String[list.size()];
|
|
|
for (int j = 0; j < n.length; j++) {
|
|
|
-
|
|
|
- n[j] = list.get(j).getClientNum();
|
|
|
+ String clientNum = list.get(j).getClientNum();
|
|
|
+ LambdaQueryWrapper<Client> clientLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ clientLambdaQueryWrapper.eq(Client::getNumber,clientNum);
|
|
|
+ Client client = clientMapper.selectOne(clientLambdaQueryWrapper);
|
|
|
+ if (client != null) {
|
|
|
+ n[j] = client.getName();
|
|
|
+ }else {
|
|
|
+ n[j] = "";
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
- appVO.setClientNums(n);
|
|
|
+ appVO.setClientNames(n);
|
|
|
|
|
|
appInfoVOS.add(appVO);
|
|
|
}
|
|
|
|
|
|
Page<AppVO> appVOPage = new Page<>();
|
|
|
BeanUtil.copyProperties(page,appVOPage);
|
|
|
+
|
|
|
appVOPage.setRecords(appInfoVOS);
|
|
|
|
|
|
return Result.ok(appVOPage);
|