|
@@ -10,10 +10,12 @@ import com.dragoninfo.dcuc.app.cons.ServiceStatusCons;
|
|
|
import com.dragoninfo.dcuc.app.dto.*;
|
|
|
import com.dragoninfo.dcuc.app.entity.ApplyInfo;
|
|
|
import com.dragoninfo.dcuc.app.entity.ResourceSync;
|
|
|
+import com.dragoninfo.dcuc.app.entity.ServiceResource;
|
|
|
import com.dragoninfo.dcuc.app.enumresources.ResourceTypeEnum;
|
|
|
import com.dragoninfo.dcuc.app.service.IApplyInfoService;
|
|
|
import com.dragoninfo.dcuc.app.service.IResourceService;
|
|
|
import com.dragoninfo.dcuc.app.service.IResourceSyncService;
|
|
|
+import com.dragoninfo.dcuc.app.service.IServiceResourceService;
|
|
|
import com.dragoninfo.dcuc.auth.auth.enumresources.YesNotEnum;
|
|
|
import com.dragoninfo.dcuc.common.http.HttpUtil;
|
|
|
import com.dragoninfo.duceap.core.response.Result;
|
|
@@ -64,6 +66,9 @@ public class ResourceBusiness implements IResourceBusiness {
|
|
|
@Autowired
|
|
|
IApplyInfoService applyInfoService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ IServiceResourceService serviceResourceService;
|
|
|
+
|
|
|
/**
|
|
|
* 使用线程池异步获取应用菜单
|
|
|
*/
|
|
@@ -172,6 +177,46 @@ public class ResourceBusiness implements IResourceBusiness {
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public boolean startService(String serviceCode) {
|
|
|
+ ServiceResource serviceResource = serviceResourceService.detailByCode(serviceCode);
|
|
|
+ if (null == serviceResource) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ ServiceResourceDTO dto = new ServiceResourceDTO();
|
|
|
+ BeanUtils.copyProperties(serviceResource, dto);
|
|
|
+ dto.setServiceStatus(BooleanEnum.TRUE.getValue());
|
|
|
+ serviceResourceService.updateById(dto);
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public boolean stopService(String serviceCode) {
|
|
|
+ ServiceResource serviceResource = serviceResourceService.detailByCode(serviceCode);
|
|
|
+ if (null == serviceResource) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ ServiceResourceDTO dto = new ServiceResourceDTO();
|
|
|
+ BeanUtils.copyProperties(serviceResource, dto);
|
|
|
+ dto.setServiceStatus(BooleanEnum.FALSE.getValue());
|
|
|
+ serviceResourceService.updateById(dto);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public boolean cancelService(String serviceCode) {
|
|
|
+ ServiceResource serviceResource = serviceResourceService.detailByCode(serviceCode);
|
|
|
+ if (null == serviceResource) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ ServiceResourceDTO dto = new ServiceResourceDTO();
|
|
|
+ BeanUtils.copyProperties(serviceResource, dto);
|
|
|
+ dto.setServiceStatus(ServiceStatusCons.STATUS_DELETED);
|
|
|
+ dto.setDeleted(BooleanEnum.TRUE.getValue());
|
|
|
+ serviceResourceService.updateById(dto);
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
private String getServiceRemoteDetailByCode(String serviceCode) {
|
|
|
String busSraId = resourceConfig.getBusSraId();
|
|
|
String busSreIdcard = resourceConfig.getBusSreIdcard();
|