同步任务

main
杜函宇 2 weeks ago
parent 285e716e75
commit 379e191d10

@ -153,6 +153,20 @@ public class AssetAppController extends BaseController {
aa.setId(byId.getAssetId());
//修改主表
assetAppService.updateById(aa);
//如果有任务也修改任务这边
AssetAppJyPo one = assetAppJyService.lambdaQuery()
.isNotNull(AssetAppJyPo::getTaskId)
.eq(AssetAppJyPo::getAssetId, byId.getAssetId()).one();
if(one!=null){
Integer taskId = one.getTaskId();
Long appId = one.getAppId();
BeanUtil.copyProperties(byId, one);
one.setAppId(appId);
one.setTaskId(taskId);
one.setAuditState(null);
one.setAuditYy(null);
assetAppJyService.updateById(one);
}
}
return success();
}

@ -258,14 +258,18 @@ public class AssetCurrentController extends BaseController {
QueryWrapper<AssetSupplyChainJyPo> queryWrapper2 = new QueryWrapper<>();
queryWrapper2.eq("asset_id", assetCurrentJyPo.getId());
queryWrapper2.isNull("task_id");
assetSupplyChainJyService.remove(queryWrapper2);
QueryWrapper<AssetBasicNetworkJyPo> queryWrapper3 = new QueryWrapper<>();
queryWrapper3.eq("asset_id", assetCurrentJyPo.getId());
queryWrapper3.isNull("task_id");
assetBasicNetworkJyService.remove(queryWrapper3);
QueryWrapper<AssetBusinessFormJyPo> queryWrapper4 = new QueryWrapper<>();
queryWrapper4.eq("asset_id", assetCurrentJyPo.getId());
queryWrapper4.isNull("task_id");
assetBusinessFormJyService.remove(queryWrapper4);
QueryWrapper<UnitOtherConcatJyPo> queryWrapper5 = new QueryWrapper<>();
queryWrapper5.isNull("task_id");
queryWrapper5.eq("asset_id", assetCurrentJyPo.getId());
unitOtherConcatJyservice.remove(queryWrapper5);
if (assetCurrentJyPo.getXjgywxt() != null) {
@ -435,6 +439,55 @@ public class AssetCurrentController extends BaseController {
BeanUtil.copyProperties(x, a4);
unitOtherConcatService.save(a4);
});
//如果有任务也修改任务这边
AssetCurrentCpPo one = assetCurrentCpService.lambdaQuery()
.isNotNull(AssetCurrentCpPo::getTaskId)
.eq(AssetCurrentCpPo::getId, byId.getId()).one();
if(one!=null){
Integer taskId = one.getTaskId();
Long appId = one.getCurrentId();
BeanUtil.copyProperties(byId, one);
one.setCurrentId(appId);
one.setTaskId(taskId);
one.setAuditState(null);
one.setAuditYy(null);
assetCurrentCpService.updateById(one);
QueryWrapper<AssetSupplyChainCpPo> queryWrapper2 = new QueryWrapper<>();
queryWrapper2.eq("asset_id", one.getId());
queryWrapper2.isNull("task_id");
assetSupplyChainCpService.remove(queryWrapper2);
QueryWrapper<AssetBasicNetworkCpPo> queryWrapper3 = new QueryWrapper<>();
queryWrapper3.eq("asset_id", one.getId());
queryWrapper3.isNull("task_id");
assetBasicNetworkCpService.remove(queryWrapper3);
QueryWrapper<AssetBusinessFormCpPo> queryWrapper4 = new QueryWrapper<>();
queryWrapper4.eq("asset_id", one.getId());
queryWrapper4.isNull("task_id");
assetBusinessFormCpService.remove(queryWrapper4);
QueryWrapper<UnitOtherConcatCpPo> queryWrapper5 = new QueryWrapper<>();
queryWrapper5.isNull("task_id");
queryWrapper5.eq("asset_id", one.getId());
unitOtherConcatCpService.remove(queryWrapper5);
list.forEach(x -> {
x.setTaskId(taskId);
assetSupplyChainCpService.save(x);
});
list1.forEach(x -> {
x.setTaskId(taskId);
assetBasicNetworkCpService.save(x);
});
list2.forEach(x -> {
x.setTaskId(taskId);
assetBusinessFormCpService.save(x);
});
list3.forEach(x -> {
x.setTaskId(taskId);
unitOtherConcatCpService.save(x);
});
}
}
return success();
}
@ -519,15 +572,19 @@ public class AssetCurrentController extends BaseController {
QueryWrapper<AssetSupplyChainCpPo> queryWrapper2 = new QueryWrapper<>();
queryWrapper2.eq("asset_id", assetCurrent.getId());
queryWrapper2.isNotNull("task_id");
assetSupplyChainCpService.remove(queryWrapper2);
QueryWrapper<AssetBasicNetworkCpPo> queryWrapper3 = new QueryWrapper<>();
queryWrapper3.isNotNull("task_id");
queryWrapper3.eq("asset_id", assetCurrent.getId());
assetBasicNetworkCpService.remove(queryWrapper3);
QueryWrapper<AssetBusinessFormCpPo> queryWrapper4 = new QueryWrapper<>();
queryWrapper4.isNotNull("task_id");
queryWrapper4.eq("asset_id", assetCurrent.getId());
assetBusinessFormCpService.remove(queryWrapper4);
QueryWrapper<UnitOtherConcatCpPo> queryWrapper5 = new QueryWrapper<>();
queryWrapper5.eq("asset_id", assetCurrent.getId());
queryWrapper5.isNotNull("task_id");
unitOtherConcatCpService.remove(queryWrapper5);
if (assetCurrent.getXjgywxt() != null) {

@ -147,6 +147,20 @@ public class AssetEmailController extends BaseController {
aa.setId(byId.getAssetId());
//修改主表
assetEmailService.updateById(aa);
//如果有任务也修改任务这边
AssetEmailJyPo one = assetEmailJyService.lambdaQuery()
.isNotNull(AssetEmailJyPo::getTaskId)
.eq(AssetEmailJyPo::getAssetId, byId.getAssetId()).one();
if(one!=null){
Integer taskId = one.getTaskId();
Long appId = one.getEmailId();
BeanUtil.copyProperties(byId, one);
one.setEmailId(appId);
one.setTaskId(taskId);
one.setAuditState(null);
one.setAuditYy(null);
assetEmailJyService.updateById(one);
}
}
return success();
}

@ -148,6 +148,20 @@ public class AssetMiniProgramsController extends BaseController {
aa.setId(byId.getAssetId());
//修改主表
assetMiniProgramsService.updateById(aa);
//如果有任务也修改任务这边
AssetMiniProgramsJyPo one = assetMiniProgramsJyService.lambdaQuery()
.isNotNull(AssetMiniProgramsJyPo::getTaskId)
.eq(AssetMiniProgramsJyPo::getAssetId, byId.getAssetId()).one();
if(one!=null){
Integer taskId = one.getTaskId();
Long appId = one.getMiniId();
BeanUtil.copyProperties(byId, one);
one.setMiniId(appId);
one.setTaskId(taskId);
one.setAuditState(null);
one.setAuditYy(null);
assetMiniProgramsJyService.updateById(one);
}
}
return success();
}

@ -162,6 +162,20 @@ public class AssetOfficialAccountController {
aa.setId(byId.getAssetId());
//修改主表
assetOfficialAccountService.updateById(aa);
//如果有任务也修改任务这边
AssetOfficialAccountJyPo one = assetOfficialAccountJyService.lambdaQuery()
.isNotNull(AssetOfficialAccountJyPo::getTaskId)
.eq(AssetOfficialAccountJyPo::getAssetId, byId.getAssetId()).one();
if(one!=null){
Integer taskId = one.getTaskId();
Long appId = one.getAccountId();
BeanUtil.copyProperties(byId, one);
one.setAccountId(appId);
one.setTaskId(taskId);
one.setAuditState(null);
one.setAuditYy(null);
assetOfficialAccountJyService.updateById(one);
}
}
return success();
}

@ -31,7 +31,7 @@ public class AssetCurrentJyPo extends BaseClass implements Serializable {
private static final long serialVersionUID = 1L;
/**
AssetCurrentCpPo
* id
*/
@TableId(type = IdType.AUTO,value = "current_id")

Loading…
Cancel
Save