Commit cf1351d8 authored by 赵啸非's avatar 赵啸非

测试流控功能

parent 44daaf65
...@@ -24,7 +24,7 @@ import java.util.List; ...@@ -24,7 +24,7 @@ import java.util.List;
@Aspect @Aspect
@Slf4j @Slf4j
//@Component @Component
public class DataPermissionAspect { public class DataPermissionAspect {
@Autowired @Autowired
...@@ -57,7 +57,6 @@ public class DataPermissionAspect { ...@@ -57,7 +57,6 @@ public class DataPermissionAspect {
List<DimensionResourceRuleEntity> componentRules = dimensionResourceRuleService.getRoleComponentRule(loginUser.getId(), componentRoute); List<DimensionResourceRuleEntity> componentRules = dimensionResourceRuleService.getRoleComponentRule(loginUser.getId(), componentRoute);
if (!ObjectUtils.isEmpty(componentRules)) { if (!ObjectUtils.isEmpty(componentRules)) {
//在request添加属性 //在request添加属性
//todo 构建数据权限sql 并设置到request中。
String permissionSql = RuleQueryGenerator.getPermissionSql(componentRules, loginUser); String permissionSql = RuleQueryGenerator.getPermissionSql(componentRules, loginUser);
log.info("permissionSql:{}", permissionSql); log.info("permissionSql:{}", permissionSql);
......
...@@ -28,8 +28,6 @@ import java.util.List; ...@@ -28,8 +28,6 @@ import java.util.List;
@Service("appInfoTempleteFieldService") @Service("appInfoTempleteFieldService")
public class AppInfoTempleteFieldServiceImpl extends AbstractCRUDServiceImpl<AppInfoTempleteFieldDao, AppInfoTempleteFieldEntity, Long> implements AppInfoTempleteFieldService { public class AppInfoTempleteFieldServiceImpl extends AbstractCRUDServiceImpl<AppInfoTempleteFieldDao, AppInfoTempleteFieldEntity, Long> implements AppInfoTempleteFieldService {
@Autowired
private AppService appService;
@Autowired @Autowired
private AppDatasetService appDatasetService; private AppDatasetService appDatasetService;
@Autowired @Autowired
...@@ -46,7 +44,7 @@ public class AppInfoTempleteFieldServiceImpl extends AbstractCRUDServiceImpl<App ...@@ -46,7 +44,7 @@ public class AppInfoTempleteFieldServiceImpl extends AbstractCRUDServiceImpl<App
AppDatasetQuery appDatasetQuery = new AppDatasetQuery(); AppDatasetQuery appDatasetQuery = new AppDatasetQuery();
appDatasetQuery.setAppId(entity.getAppId()); appDatasetQuery.setAppId(entity.getAppId());
List<AppDatasetEntity> appDatasetEntities = appDatasetService.find(appDatasetQuery, context); List<AppDatasetEntity> appDatasetEntities = appDatasetService.find(appDatasetQuery, context);
// 判断该数据集 是否已经存在 没存在 再添加 // 判断该数据集 是否已经存在 没存在 再添加
ArrayList<AppInfoFieldEntity> fieldSaveList = new ArrayList<>(); ArrayList<AppInfoFieldEntity> fieldSaveList = new ArrayList<>();
for (AppDatasetEntity appDatasetEntity : appDatasetEntities) { for (AppDatasetEntity appDatasetEntity : appDatasetEntities) {
...@@ -65,7 +63,6 @@ public class AppInfoTempleteFieldServiceImpl extends AbstractCRUDServiceImpl<App ...@@ -65,7 +63,6 @@ public class AppInfoTempleteFieldServiceImpl extends AbstractCRUDServiceImpl<App
fieldSaveList.add(fieldEntity); fieldSaveList.add(fieldEntity);
} }
} }
if (!ObjectUtils.isEmpty(fieldSaveList)) { if (!ObjectUtils.isEmpty(fieldSaveList)) {
appInfoFieldService.save(fieldSaveList, context); appInfoFieldService.save(fieldSaveList, context);
} }
......
...@@ -296,12 +296,9 @@ public class AppServiceImpl extends AbstractCRUDCacheServiceImpl<AppDao, AppEnti ...@@ -296,12 +296,9 @@ public class AppServiceImpl extends AbstractCRUDCacheServiceImpl<AppDao, AppEnti
public Rest<String> cloneAppBySameSite(AppEntity appEntity, Context context) { public Rest<String> cloneAppBySameSite(AppEntity appEntity, Context context) {
Long sourceAppId = appEntity.getSourceAppId(); Long sourceAppId = appEntity.getSourceAppId();
Long targetAppId = appEntity.getTargetAppId(); Long targetAppId = appEntity.getTargetAppId();
AppEntity sourceAppEntity = this.get(sourceAppId, context); AppEntity sourceAppEntity = this.get(sourceAppId, context);
AppEntity targetAppEntity = this.get(targetAppId, context); AppEntity targetAppEntity = this.get(targetAppId, context);
//删除应用的数据集 //删除应用的数据集
if (!ObjectUtils.isEmpty(appEntity.getTargetDelete()) && YesNoEnum.YES.getValue() == appEntity.getTargetDelete()) { if (!ObjectUtils.isEmpty(appEntity.getTargetDelete()) && YesNoEnum.YES.getValue() == appEntity.getTargetDelete()) {
Long[] delIds = targetAppEntity.getAppDatasetList().stream().map(i -> i.getId()).toArray(Long[]::new); Long[] delIds = targetAppEntity.getAppDatasetList().stream().map(i -> i.getId()).toArray(Long[]::new);
...@@ -394,9 +391,6 @@ public class AppServiceImpl extends AbstractCRUDCacheServiceImpl<AppDao, AppEnti ...@@ -394,9 +391,6 @@ public class AppServiceImpl extends AbstractCRUDCacheServiceImpl<AppDao, AppEnti
String originFilePath = appEntity.getFilePath(); String originFilePath = appEntity.getFilePath();
String filePath = entity.getFilePath(); String filePath = entity.getFilePath();
String fileName = entity.getFileName(); String fileName = entity.getFileName();
//entity.setFilePath(null);
//entity.setFileName(null);
//判断如果应用下架,通知自助服务终端 //判断如果应用下架,通知自助服务终端
if (entity.getShelves() == YesNoEnum.NO.getValue()) { if (entity.getShelves() == YesNoEnum.NO.getValue()) {
AppPdu appPdu = new AppPdu(); AppPdu appPdu = new AppPdu();
...@@ -445,40 +439,6 @@ public class AppServiceImpl extends AbstractCRUDCacheServiceImpl<AppDao, AppEnti ...@@ -445,40 +439,6 @@ public class AppServiceImpl extends AbstractCRUDCacheServiceImpl<AppDao, AppEnti
} }
/*
@Override
protected void updateAfter(AppEntity entity, Context context) throws AppException {
AppVersionQuery appVersionQuery = new AppVersionQuery();
appVersionQuery.setAppId(entity.getId());
List<OrderCol> orderColList = new ArrayList<>();
orderColList.add(new OrderCol("version", OrderCol.DESCENDING));
appVersionQuery.setOrderColList(orderColList);
List<AppVersionEntity> appVersionEntities = appVersionService.find(appVersionQuery, context);
//获取最大版本号
if (!ObjectUtils.isEmpty(appVersionEntities)) {
AppVersionEntity curAppVersionEntity = appVersionEntities.get(0);
// String versionNum = StrUtil.subAfter(curAppVersionEntity.getVersion(), Constant.VERSION_PREFIX, false);
Integer versionNum = curAppVersionEntity.getVersion();
Integer newVersionNum = ++versionNum;
AppVersionEntity appVersionEntity = new AppVersionEntity();
appVersionEntity.initAttrValue();
AppVersionEntity versionEntity = new AppVersionEntity();
versionEntity.initAttrValue();
versionEntity.setAppId(entity.getId());
versionEntity.setAppName(entity.getAppName());
versionEntity.setVersion(newVersionNum);
versionEntity.setNotes(entity.getNotes());
versionEntity.setFileName(entity.getFileName());
versionEntity.setFilePath(entity.getFilePath());
versionEntity.setDistributeFilePath(entity.getDistributeFilePath());
versionEntity.setCreateTime(new Date());
versionEntity.setCreateUserId(this.getContextUserId(context));
appVersionService.save(versionEntity, context);
}
super.updateAfter(entity, context);
}*/
@Override @Override
protected void removeAfter(Long[] ids, Context context, int result) throws AppException { protected void removeAfter(Long[] ids, Context context, int result) throws AppException {
...@@ -506,7 +466,6 @@ public class AppServiceImpl extends AbstractCRUDCacheServiceImpl<AppDao, AppEnti ...@@ -506,7 +466,6 @@ public class AppServiceImpl extends AbstractCRUDCacheServiceImpl<AppDao, AppEnti
appInfoFieldService.remove(idList, context); appInfoFieldService.remove(idList, context);
} }
} }
super.removeAfter(ids, context, result); super.removeAfter(ids, context, result);
} }
......
...@@ -35,8 +35,6 @@ import static com.mortals.framework.ap.SysConstains.*; ...@@ -35,8 +35,6 @@ import static com.mortals.framework.ap.SysConstains.*;
@RequestMapping("app/category") @RequestMapping("app/category")
public class AppCategoryController extends BaseCRUDJsonBodyMappingController<AppCategoryService,AppCategoryEntity,Long> { public class AppCategoryController extends BaseCRUDJsonBodyMappingController<AppCategoryService,AppCategoryEntity,Long> {
@Autowired
private ParamService paramService;
public AppCategoryController(){ public AppCategoryController(){
super.setModuleDesc( "自助终端应用分类"); super.setModuleDesc( "自助终端应用分类");
......
...@@ -244,8 +244,6 @@ public class AppController extends BaseCRUDJsonBodyMappingController<AppService, ...@@ -244,8 +244,6 @@ public class AppController extends BaseCRUDJsonBodyMappingController<AppService,
public static void main(String[] args) { public static void main(String[] args) {
/* String homeUrl = "app/1/2"; /* String homeUrl = "app/1/2";
String domainUrl = "http://192.168.0.98:11078"; String domainUrl = "http://192.168.0.98:11078";
String s = UrlBuilder.of(domainUrl).addPath("app").addPath("1").addPath("2").toString(); String s = UrlBuilder.of(domainUrl).addPath("app").addPath("1").addPath("2").toString();
......
...@@ -119,8 +119,6 @@ public class AppDatasetController extends BaseCRUDJsonBodyMappingController<AppD ...@@ -119,8 +119,6 @@ public class AppDatasetController extends BaseCRUDJsonBodyMappingController<AppD
appDatasetQuery.setFieldCode(query.getFieldCode()); appDatasetQuery.setFieldCode(query.getFieldCode());
appDatasetQuery.setFieldName(query.getFieldName()); appDatasetQuery.setFieldName(query.getFieldName());
appDatasetQuery.setAppId(query.getAppId()); appDatasetQuery.setAppId(query.getAppId());
// String fieldValue = StrUtil.addPrefixIfNot(query.getFieldValue(), "%");
// fieldValue = StrUtil.addSuffixIfNot(fieldValue, "%");
appDatasetQuery.setFieldValue(query.getFieldValue()); appDatasetQuery.setFieldValue(query.getFieldValue());
PageInfo pageInfo = this.buildPageInfo(query); PageInfo pageInfo = this.buildPageInfo(query);
Result<AppInfoFieldEntity> customResult = this.service.findCustomList(appDatasetQuery, pageInfo, context); Result<AppInfoFieldEntity> customResult = this.service.findCustomList(appDatasetQuery, pageInfo, context);
......
...@@ -80,7 +80,6 @@ public class AppVersionController extends BaseCRUDJsonBodyMappingController<AppV ...@@ -80,7 +80,6 @@ public class AppVersionController extends BaseCRUDJsonBodyMappingController<AppV
List<OrderCol> orderColList = new ArrayList<>(); List<OrderCol> orderColList = new ArrayList<>();
orderColList.add(new OrderCol("version", OrderCol.DESCENDING)); orderColList.add(new OrderCol("version", OrderCol.DESCENDING));
query.setOrderColList(orderColList); query.setOrderColList(orderColList);
super.doListBefore(query, model, context); super.doListBefore(query, model, context);
} }
......
...@@ -34,7 +34,7 @@ public class BusinessMatterServiceImpl extends AbstractCRUDServiceImpl<BusinessM ...@@ -34,7 +34,7 @@ public class BusinessMatterServiceImpl extends AbstractCRUDServiceImpl<BusinessM
super.saveBefore(entity, context); super.saveBefore(entity, context);
int count = this.getDao().getCount(new BusinessMatterQuery().siteBusinessId(entity.getSiteBusinessId()).matterId(entity.getMatterId())); int count = this.getDao().getCount(new BusinessMatterQuery().siteBusinessId(entity.getSiteBusinessId()).matterId(entity.getMatterId()));
if(count>0){ if(count>0){
throw new AppException("当前业务事项已存在,不能新增"); throw new AppException("当前业务事项已存在,不能新增!");
} }
} }
......
...@@ -85,11 +85,7 @@ public class BusinessServiceImpl extends AbstractCRUDCacheServiceImpl<BusinessDa ...@@ -85,11 +85,7 @@ public class BusinessServiceImpl extends AbstractCRUDCacheServiceImpl<BusinessDa
@Override @Override
protected void updateAfter(BusinessEntity entity, Context context) throws AppException { protected void updateAfter(BusinessEntity entity, Context context) throws AppException {
Runnable runnable = new Runnable() { Runnable runnable = new Runnable() {
/**
*
*/
@Override @Override
public void run() { public void run() {
//同步更新所有站点 //同步更新所有站点
...@@ -112,9 +108,7 @@ public class BusinessServiceImpl extends AbstractCRUDCacheServiceImpl<BusinessDa ...@@ -112,9 +108,7 @@ public class BusinessServiceImpl extends AbstractCRUDCacheServiceImpl<BusinessDa
if( !ObjectUtils.isEmpty(windowBusinessEntityList)) { if( !ObjectUtils.isEmpty(windowBusinessEntityList)) {
windowBusinessService.update(windowBusinessEntityList, context); windowBusinessService.update(windowBusinessEntityList, context);
} }
} }
//通知第三方平台 //通知第三方平台
String phpUrl = GlobalSysInfo.getParamValue(PARAM_SERVER_PHP_HTTP_URL, "http://127.0.0.1:11078/zwfw_api"); String phpUrl = GlobalSysInfo.getParamValue(PARAM_SERVER_PHP_HTTP_URL, "http://127.0.0.1:11078/zwfw_api");
phpUrl += "/inter/device/baseDataSave"; phpUrl += "/inter/device/baseDataSave";
...@@ -126,11 +120,9 @@ public class BusinessServiceImpl extends AbstractCRUDCacheServiceImpl<BusinessDa ...@@ -126,11 +120,9 @@ public class BusinessServiceImpl extends AbstractCRUDCacheServiceImpl<BusinessDa
apiThirdPartyReq.setStatus(ThirdPartyStatusEnum.修改.getValue()); apiThirdPartyReq.setStatus(ThirdPartyStatusEnum.修改.getValue());
apiThirdPartyReq.setData(bussinessThirdPartyReq); apiThirdPartyReq.setData(bussinessThirdPartyReq);
messageService.sendThirdParty(phpUrl, JSON.toJSONString(apiThirdPartyReq)); messageService.sendThirdParty(phpUrl, JSON.toJSONString(apiThirdPartyReq));
} }
}; };
ThreadPool.getInstance().execute(runnable); ThreadPool.getInstance().execute(runnable);
super.updateAfter(entity, context); super.updateAfter(entity, context);
} }
...@@ -150,7 +142,7 @@ public class BusinessServiceImpl extends AbstractCRUDCacheServiceImpl<BusinessDa ...@@ -150,7 +142,7 @@ public class BusinessServiceImpl extends AbstractCRUDCacheServiceImpl<BusinessDa
for (BusinessEntity child : childList) { for (BusinessEntity child : childList) {
if (!idSet.contains(child.getId())) { if (!idSet.contains(child.getId())) {
bool = true; bool = true;
break; continue;
} }
if (bool) { if (bool) {
throw new AppException("删除的父业务存在子业务,不能删除"); throw new AppException("删除的父业务存在子业务,不能删除");
...@@ -171,8 +163,6 @@ public class BusinessServiceImpl extends AbstractCRUDCacheServiceImpl<BusinessDa ...@@ -171,8 +163,6 @@ public class BusinessServiceImpl extends AbstractCRUDCacheServiceImpl<BusinessDa
apiThirdPartyReq.setData(bussinessThirdPartyReq); apiThirdPartyReq.setData(bussinessThirdPartyReq);
messageService.sendThirdParty(phpUrl, JSON.toJSONString(apiThirdPartyReq)); messageService.sendThirdParty(phpUrl, JSON.toJSONString(apiThirdPartyReq));
} }
super.removeBefore(ids, context); super.removeBefore(ids, context);
} }
...@@ -233,8 +223,6 @@ public class BusinessServiceImpl extends AbstractCRUDCacheServiceImpl<BusinessDa ...@@ -233,8 +223,6 @@ public class BusinessServiceImpl extends AbstractCRUDCacheServiceImpl<BusinessDa
private void updateOrSave(BusinessEntity item, Long siteId, Context context) { private void updateOrSave(BusinessEntity item, Long siteId, Context context) {
SiteBusinessEntity siteBusinessEntity = new SiteBusinessEntity(); SiteBusinessEntity siteBusinessEntity = new SiteBusinessEntity();
// BeanUtils.copyProperties(item, siteBusinessEntity, BeanUtil.getNullPropertyNames(item));
SiteEntity siteEntity = siteService.get(siteId); SiteEntity siteEntity = siteService.get(siteId);
if (ObjectUtils.isEmpty(siteEntity)) { if (ObjectUtils.isEmpty(siteEntity)) {
throw new AppException("未找到相应站点!"); throw new AppException("未找到相应站点!");
......
...@@ -280,15 +280,9 @@ public class DeptServiceImpl extends AbstractCRUDCacheServiceImpl<DeptDao, DeptE ...@@ -280,15 +280,9 @@ public class DeptServiceImpl extends AbstractCRUDCacheServiceImpl<DeptDao, DeptE
if (!ObjectUtils.isEmpty(siteMatterEntityList)) { if (!ObjectUtils.isEmpty(siteMatterEntityList)) {
siteMatterService.update(siteMatterEntityList, context); siteMatterService.update(siteMatterEntityList, context);
} }
} }
}; };
ThreadPool.getInstance().execute(runnable); ThreadPool.getInstance().execute(runnable);
super.updateAfter(entity, context); super.updateAfter(entity, context);
} }
} }
\ No newline at end of file
package com.mortals.xhx.module.device.web; package com.mortals.xhx.module.device.web;
import com.mortals.framework.annotation.SlideWindowLimit;
import com.mortals.framework.common.Rest;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController; import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService; import com.mortals.xhx.base.system.param.service.ParamService;
...@@ -38,4 +40,13 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe ...@@ -38,4 +40,13 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe
} }
/**
* @param query
* @return
*/
@Override
@SlideWindowLimit
public Rest<Object> list(DeviceEntity query) {
return super.list(query);
}
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment