|
@@ -13,8 +13,10 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.om.utils.CommonUtil;
|
|
import com.om.utils.CommonUtil;
|
|
import com.om.utils.Result;
|
|
import com.om.utils.Result;
|
|
import com.om.utils.UserContext;
|
|
import com.om.utils.UserContext;
|
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
import org.apache.commons.lang.StringUtils;
|
|
import org.apache.commons.lang.StringUtils;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
@@ -29,6 +31,7 @@ import java.util.List;
|
|
* @since 2024-03-11
|
|
* @since 2024-03-11
|
|
*/
|
|
*/
|
|
@Service
|
|
@Service
|
|
|
|
+@Slf4j
|
|
public class AppServiceImpl extends ServiceImpl<AppMapper, App> implements IAppService {
|
|
public class AppServiceImpl extends ServiceImpl<AppMapper, App> implements IAppService {
|
|
|
|
|
|
@Resource
|
|
@Resource
|
|
@@ -125,9 +128,12 @@ public class AppServiceImpl extends ServiceImpl<AppMapper, App> implements IAppS
|
|
List<AppsClients> list = clientsService.list(queryWrapper);
|
|
List<AppsClients> list = clientsService.list(queryWrapper);
|
|
String [] n = new String[list.size()];
|
|
String [] n = new String[list.size()];
|
|
for (int j = 0; j < n.length; j++) {
|
|
for (int j = 0; j < n.length; j++) {
|
|
|
|
+
|
|
n[j] = list.get(j).getClientNum();
|
|
n[j] = list.get(j).getClientNum();
|
|
|
|
+
|
|
}
|
|
}
|
|
appVO.setClientNums(n);
|
|
appVO.setClientNums(n);
|
|
|
|
+
|
|
appInfoVOS.add(appVO);
|
|
appInfoVOS.add(appVO);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -139,15 +145,18 @@ public class AppServiceImpl extends ServiceImpl<AppMapper, App> implements IAppS
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
+ @Transactional
|
|
public Result edit(AppVO appVO) {
|
|
public Result edit(AppVO appVO) {
|
|
App app = getById(appVO.getId());
|
|
App app = getById(appVO.getId());
|
|
LambdaQueryWrapper<App> infoQueryWapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<App> infoQueryWapper = new LambdaQueryWrapper<>();
|
|
infoQueryWapper.eq(App::getId,app.getId());
|
|
infoQueryWapper.eq(App::getId,app.getId());
|
|
BeanUtil.copyProperties(appVO,app);
|
|
BeanUtil.copyProperties(appVO,app);
|
|
|
|
+
|
|
this.update(app,infoQueryWapper);
|
|
this.update(app,infoQueryWapper);
|
|
|
|
|
|
//修改客户端id
|
|
//修改客户端id
|
|
String[] clientNum = appVO.getClientNums();
|
|
String[] clientNum = appVO.getClientNums();
|
|
|
|
+
|
|
LambdaQueryWrapper<AppsClients> clientQueryWrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<AppsClients> clientQueryWrapper = new LambdaQueryWrapper<>();
|
|
clientQueryWrapper.eq(AppsClients::getAppId,appVO.getId());
|
|
clientQueryWrapper.eq(AppsClients::getAppId,appVO.getId());
|
|
clientsService.remove(clientQueryWrapper);
|
|
clientsService.remove(clientQueryWrapper);
|
|
@@ -155,9 +164,23 @@ public class AppServiceImpl extends ServiceImpl<AppMapper, App> implements IAppS
|
|
AppsClients clients = new AppsClients();
|
|
AppsClients clients = new AppsClients();
|
|
clients.setAppId(appVO.getId());
|
|
clients.setAppId(appVO.getId());
|
|
clients.setClientNum(clientNum[i]);
|
|
clients.setClientNum(clientNum[i]);
|
|
|
|
+ log.info("修改之后添加的");
|
|
|
|
+ clientsService.save(clients);
|
|
}
|
|
}
|
|
|
|
|
|
//没有进行描述和语言进行修改
|
|
//没有进行描述和语言进行修改
|
|
|
|
+ String[] language = appVO.getLanguage();
|
|
|
|
+ String[] description = appVO.getDescription();
|
|
|
|
+ LambdaQueryWrapper<AppVersionDescribe> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
+ queryWrapper.eq(AppVersionDescribe::getAppId,appVO.getId());
|
|
|
|
+ describeService.remove(queryWrapper);
|
|
|
|
+ for (int i = 0; i < language.length; i++) {
|
|
|
|
+ AppVersionDescribe describe = new AppVersionDescribe();
|
|
|
|
+ describe.setAppId(appVO.getId());
|
|
|
|
+ describe.setDescription(description[i]);
|
|
|
|
+ describe.setLanguage(language[i]);
|
|
|
|
+ describeService.save(describe);
|
|
|
|
+ }
|
|
|
|
|
|
return Result.ok();
|
|
return Result.ok();
|
|
}
|
|
}
|