同步任务

main
杜函宇 7 days ago
parent c059da1f28
commit 1686af3f41

@ -156,9 +156,10 @@ public class AssetAppController extends BaseController {
//如果有任务也修改任务这边
AssetAppJyPo one = assetAppJyService.lambdaQuery()
.isNotNull(AssetAppJyPo::getTaskId)
.eq(AssetAppJyPo::getStatus,"1")
.ne(AssetAppJyPo::getStatus, 5)
.eq(AssetAppJyPo::getAssetId, byId.getAssetId()).one();
if(one!=null){
Integer status = one.getStatus();
Integer taskId = one.getTaskId();
Long appId = one.getAppId();
BeanUtil.copyProperties(byId, one);
@ -166,6 +167,7 @@ public class AssetAppController extends BaseController {
one.setTaskId(taskId);
one.setAuditState(null);
one.setAuditYy(null);
one.setStatus(status);
assetAppJyService.updateById(one);
}
}

@ -144,6 +144,11 @@ public class AssetCurrentController extends BaseController {
@PreAuthorize("@ss.hasAnyRoles('admin,common')")
@Transactional(rollbackFor = Exception.class)
public AjaxResult insert(@RequestBody @Valid AssetCurrent assetCurrent) {
List<Unit> list = unitService.lambdaQuery().eq(Unit::getNickName, assetCurrent.getDwmc())
.eq(Unit::getDelFlag, 0).list();
if (list == null || list.isEmpty()) {
throw new ServiceException("请选择已有单位!");
}
StringBuilder a = new StringBuilder();
if (assetCurrent.getGlymList() != null) {
assetCurrent.getGlymList().forEach(x -> {
@ -442,32 +447,34 @@ public class AssetCurrentController extends BaseController {
//如果有任务也修改任务这边
AssetCurrentCpPo one = assetCurrentCpService.lambdaQuery()
.isNotNull(AssetCurrentCpPo::getTaskId)
.eq(AssetCurrentCpPo::getStatus,"1")
.ne(AssetCurrentCpPo::getStatus, 5)
.eq(AssetCurrentCpPo::getId, byId.getId()).one();
if(one!=null){
if (one != null) {
Integer taskId = one.getTaskId();
Long appId = one.getCurrentId();
Integer status = one.getStatus();
BeanUtil.copyProperties(byId, one);
one.setCurrentId(appId);
one.setTaskId(taskId);
one.setAuditState(null);
one.setAuditYy(null);
one.setStatus(status);
assetCurrentCpService.updateById(one);
QueryWrapper<AssetSupplyChainCpPo> queryWrapper2 = new QueryWrapper<>();
queryWrapper2.eq("asset_id", one.getId());
queryWrapper2.eq("task_id",taskId);
queryWrapper2.eq("task_id", taskId);
assetSupplyChainCpService.remove(queryWrapper2);
QueryWrapper<AssetBasicNetworkCpPo> queryWrapper3 = new QueryWrapper<>();
queryWrapper3.eq("asset_id", one.getId());
queryWrapper3.eq("task_id",taskId);
queryWrapper3.eq("task_id", taskId);
assetBasicNetworkCpService.remove(queryWrapper3);
QueryWrapper<AssetBusinessFormCpPo> queryWrapper4 = new QueryWrapper<>();
queryWrapper4.eq("asset_id", one.getId());
queryWrapper4.eq("task_id",taskId);
queryWrapper4.eq("task_id", taskId);
assetBusinessFormCpService.remove(queryWrapper4);
QueryWrapper<UnitOtherConcatCpPo> queryWrapper5 = new QueryWrapper<>();
queryWrapper5.eq("task_id",taskId);
queryWrapper5.eq("task_id", taskId);
queryWrapper5.eq("asset_id", one.getId());
unitOtherConcatCpService.remove(queryWrapper5);
list.forEach(x -> {
@ -560,35 +567,37 @@ public class AssetCurrentController extends BaseController {
//================================
Integer i = unitService.selectTaskId(assetCurrent.getDwmc(), "0");
if(i!=null){
if (i != null) {
QueryWrapper<AssetCurrentCpPo> queryWrapper1 = new QueryWrapper<>();
queryWrapper1.eq("id", assetCurrent.getId());
queryWrapper1.eq("status","1");
queryWrapper1.eq("task_id",i);
assetCurrentCpService.remove(queryWrapper1);
queryWrapper1.eq("task_id", i);
queryWrapper1.ne("status", 5);
AssetCurrentCpPo x = assetCurrentCpService.getOne(queryWrapper1);
Integer status = x.getStatus();
Long currentId = x.getCurrentId();
AssetCurrentCpPo assetCurrentCpPo = new AssetCurrentCpPo();
BeanUtil.copyProperties(assetCurrent, assetCurrentCpPo);
assetCurrentCpPo.setTaskId(i);
assetCurrentCpPo.setStatus(1);
assetCurrentCpService.save(assetCurrentCpPo);
assetCurrentCpPo.setCurrentId(currentId);
assetCurrentCpPo.setStatus(status);
assetCurrentCpService.updateById(assetCurrentCpPo);
QueryWrapper<AssetSupplyChainCpPo> queryWrapper2 = new QueryWrapper<>();
queryWrapper2.eq("asset_id", assetCurrent.getId());
queryWrapper2.eq("task_id",i);
queryWrapper2.eq("task_id", i);
assetSupplyChainCpService.remove(queryWrapper2);
QueryWrapper<AssetBasicNetworkCpPo> queryWrapper3 = new QueryWrapper<>();
queryWrapper3.eq("task_id",i);
queryWrapper3.eq("task_id", i);
queryWrapper3.eq("asset_id", assetCurrent.getId());
assetBasicNetworkCpService.remove(queryWrapper3);
QueryWrapper<AssetBusinessFormCpPo> queryWrapper4 = new QueryWrapper<>();
queryWrapper4.eq("task_id",i);
queryWrapper4.eq("task_id", i);
queryWrapper4.eq("asset_id", assetCurrent.getId());
assetBusinessFormCpService.remove(queryWrapper4);
QueryWrapper<UnitOtherConcatCpPo> queryWrapper5 = new QueryWrapper<>();
queryWrapper5.eq("asset_id", assetCurrent.getId());
queryWrapper5.eq("task_id",i);
queryWrapper5.eq("task_id", i);
unitOtherConcatCpService.remove(queryWrapper5);
if (assetCurrent.getXjgywxt() != null) {
@ -620,7 +629,6 @@ public class AssetCurrentController extends BaseController {
//新增其他联系人
unitOtherConcatCpService.saveBatch(assetCurrentCpPo.getOtherConcat());
}
}
return success();
}
@ -701,7 +709,9 @@ public class AssetCurrentController extends BaseController {
//读取所有的字段
ExcelUtil<AssetExport> util = new ExcelUtil<>(AssetExport.class);
List<AssetExport> proList = util.importExcel(file.getInputStream());
int j = 0;
for (AssetExport items : proList) {
j++;
AssetCurrent as = new AssetCurrent();
//copy新增到新的现有资产表里面
BeanUtil.copyProperties(items, as);
@ -715,6 +725,11 @@ public class AssetCurrentController extends BaseController {
assetSupplyChainService.deleteIdList(a1);
assetBasicNetworkService.deleteIdList(a1);
} else {
List<Unit> list = unitService.lambdaQuery().eq(Unit::getNickName, items.getDwmc())
.eq(Unit::getDelFlag, 0).list();
if (list == null || list.isEmpty()) {
throw new ServiceException(j + "行单位未入库!");
}
assetCurrentService.save(as);
}

@ -150,9 +150,10 @@ public class AssetEmailController extends BaseController {
//如果有任务也修改任务这边
AssetEmailJyPo one = assetEmailJyService.lambdaQuery()
.isNotNull(AssetEmailJyPo::getTaskId)
.eq(AssetEmailJyPo::getStatus,"1")
.ne(AssetEmailJyPo::getStatus, 5)
.eq(AssetEmailJyPo::getAssetId, byId.getAssetId()).one();
if(one!=null){
Integer status = one.getStatus();
Integer taskId = one.getTaskId();
Long appId = one.getEmailId();
BeanUtil.copyProperties(byId, one);
@ -160,6 +161,7 @@ public class AssetEmailController extends BaseController {
one.setTaskId(taskId);
one.setAuditState(null);
one.setAuditYy(null);
one.setStatus(status);
assetEmailJyService.updateById(one);
}
}

@ -13,6 +13,7 @@ import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.tc.entity.AssetEmail;
import com.ruoyi.tc.entity.AssetMiniPrograms;
import com.ruoyi.tc.entity.po.AssetAppCpPo;
import com.ruoyi.tc.entity.po.AssetAppJyPo;
import com.ruoyi.tc.entity.po.AssetEmailJyPo;
import com.ruoyi.tc.entity.po.AssetMiniProgramsJyPo;
import com.ruoyi.tc.entity.request.AssetAuditPageRequest;
@ -152,16 +153,18 @@ public class AssetMiniProgramsController extends BaseController {
//如果有任务也修改任务这边
AssetMiniProgramsJyPo one = assetMiniProgramsJyService.lambdaQuery()
.isNotNull(AssetMiniProgramsJyPo::getTaskId)
.eq(AssetMiniProgramsJyPo::getStatus,"1")
.ne(AssetMiniProgramsJyPo::getStatus, 5)
.eq(AssetMiniProgramsJyPo::getAssetId, byId.getAssetId()).one();
if(one!=null){
Integer taskId = one.getTaskId();
Long appId = one.getMiniId();
Integer status = one.getStatus();
BeanUtil.copyProperties(byId, one);
one.setMiniId(appId);
one.setTaskId(taskId);
one.setAuditState(null);
one.setAuditYy(null);
one.setStatus(status);
assetMiniProgramsJyService.updateById(one);
}
}

@ -166,9 +166,10 @@ public class AssetOfficialAccountController {
//如果有任务也修改任务这边
AssetOfficialAccountJyPo one = assetOfficialAccountJyService.lambdaQuery()
.isNotNull(AssetOfficialAccountJyPo::getTaskId)
.eq(AssetOfficialAccountJyPo::getStatus,"1")
.ne(AssetOfficialAccountJyPo::getStatus, 5)
.eq(AssetOfficialAccountJyPo::getAssetId, byId.getAssetId()).one();
if(one!=null){
Integer status = one.getStatus();
Integer taskId = one.getTaskId();
Long appId = one.getAccountId();
BeanUtil.copyProperties(byId, one);
@ -176,6 +177,7 @@ public class AssetOfficialAccountController {
one.setTaskId(taskId);
one.setAuditState(null);
one.setAuditYy(null);
one.setStatus(status);
assetOfficialAccountJyService.updateById(one);
}
}

@ -4,7 +4,9 @@ import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.tc.entity.AssetApp;
import com.ruoyi.tc.entity.Unit;
import com.ruoyi.tc.entity.po.AssetAppCpPo;
import com.ruoyi.tc.entity.po.AssetAppJyPo;
import com.ruoyi.tc.entity.po.AssetEmailCpPo;
@ -87,6 +89,11 @@ public class AssetAppServiceImpl extends ServiceImpl<AssetAppMapper, AssetApp> i
*/
@Override
public Boolean add(AssetApp assetApp) {
List<Unit> list = unitService.lambdaQuery().eq(Unit::getNickName, assetApp.getSsdw())
.eq(Unit::getDelFlag, 0).list();
if(list==null || list.isEmpty()){
throw new ServiceException("请选择已有单位!");
}
save(assetApp);
AssetAppCpPo a = new AssetAppCpPo();
BeanUtil.copyProperties(assetApp, a);
@ -111,14 +118,18 @@ public class AssetAppServiceImpl extends ServiceImpl<AssetAppMapper, AssetApp> i
updateById(assetApp);
AssetAppCpPo one = assetAppCpService.lambdaQuery()
.eq(AssetAppCpPo::getAssetId, assetApp.getId())
.eq(AssetAppCpPo::getStatus,"1")
.ne(AssetAppCpPo::getStatus, 5)
.isNotNull(AssetAppCpPo::getTaskId)
.one();
if (one != null) {
Integer status = one.getStatus();
Integer taskId = one.getTaskId();
Long appId = one.getAppId();
BeanUtil.copyProperties(assetApp, one);
one.setTaskId(unitService.selectTaskId(assetApp.getSsdw(), "4"));
one.setStatus(status);
one.setTaskId(taskId);
one.setAssetId(assetApp.getId());
one.setStatus(0);
one.setAppId(appId);
return assetAppCpService.updateById(one);
}else {
return true;

@ -4,7 +4,9 @@ import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.tc.entity.AssetEmail;
import com.ruoyi.tc.entity.Unit;
import com.ruoyi.tc.entity.po.AssetEmailCpPo;
import com.ruoyi.tc.entity.po.AssetEmailJyPo;
import com.ruoyi.tc.entity.po.AssetMiniProgramsCpPo;
@ -87,6 +89,11 @@ public class AssetEmailServiceImpl extends ServiceImpl<AssetEmailMapper, AssetEm
*/
@Override
public Boolean add(AssetEmail assetEmail) {
List<Unit> list = unitService.lambdaQuery().eq(Unit::getNickName, assetEmail.getSsdw())
.eq(Unit::getDelFlag, 0).list();
if(list==null || list.isEmpty()){
throw new ServiceException("请选择已有单位!");
}
save(assetEmail);
AssetEmailCpPo a = new AssetEmailCpPo();
BeanUtil.copyProperties(assetEmail, a);
@ -110,13 +117,17 @@ public class AssetEmailServiceImpl extends ServiceImpl<AssetEmailMapper, AssetEm
updateById(assetEmail);
AssetEmailCpPo one = assetEmailCpService.lambdaQuery()
.eq(AssetEmailCpPo::getAssetId, assetEmail.getId())
.eq(AssetEmailCpPo::getStatus,"1")
.ne(AssetEmailCpPo::getStatus, 5)
.isNotNull(AssetEmailCpPo::getTaskId).one();
if (one != null) {
Integer status = one.getStatus();
Integer taskId = one.getTaskId();
Long appId = one.getEmailId();
BeanUtil.copyProperties(assetEmail, one);
one.setTaskId(unitService.selectTaskId(assetEmail.getSsdw(), "3"));
one.setStatus(status);
one.setTaskId(taskId);
one.setAssetId(assetEmail.getId());
one.setStatus(0);
one.setEmailId(appId);
return assetEmailCpService.updateById(one);
}else {
return true;

@ -4,7 +4,10 @@ import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.tc.entity.AssetMiniPrograms;
import com.ruoyi.tc.entity.Unit;
import com.ruoyi.tc.entity.po.AssetAppCpPo;
import com.ruoyi.tc.entity.po.AssetMiniProgramsCpPo;
import com.ruoyi.tc.entity.po.AssetMiniProgramsJyPo;
import com.ruoyi.tc.entity.request.AssetMiniProgramsPageRequest;
@ -79,6 +82,11 @@ public class AssetMiniProgramsServiceImpl extends ServiceImpl<AssetMiniProgramsM
*/
@Override
public Boolean add(AssetMiniPrograms assetMiniPrograms) {
List<Unit> list = unitService.lambdaQuery().eq(Unit::getNickName, assetMiniPrograms.getSsdw())
.eq(Unit::getDelFlag, 0).list();
if(list==null || list.isEmpty()){
throw new ServiceException("请选择已有单位!");
}
save(assetMiniPrograms);
AssetMiniProgramsCpPo assetMiniProgramsCpPo = new AssetMiniProgramsCpPo();
BeanUtil.copyProperties(assetMiniPrograms,assetMiniProgramsCpPo);
@ -102,13 +110,17 @@ public class AssetMiniProgramsServiceImpl extends ServiceImpl<AssetMiniProgramsM
updateById(assetMiniPrograms);
AssetMiniProgramsCpPo one = assetMiniProgramsCpService.lambdaQuery()
.eq(AssetMiniProgramsCpPo::getAssetId, assetMiniPrograms.getId())
.eq(AssetMiniProgramsCpPo::getStatus,"1")
.ne(AssetMiniProgramsCpPo::getStatus, 5)
.isNotNull(AssetMiniProgramsCpPo::getTaskId).one();
if (one!=null){
Integer status = one.getStatus();
Integer taskId = one.getTaskId();
Long miniId = one.getMiniId();
BeanUtil.copyProperties(assetMiniPrograms,one);
one.setTaskId(unitService.selectTaskId(assetMiniPrograms.getSsdw(),"1"));
one.setTaskId(taskId);
one.setAssetId(assetMiniPrograms.getId());
one.setStatus(0);
one.setStatus(status);
one.setMiniId(miniId);
return assetMiniProgramsCpService.updateById(one);
}else{
return true;

@ -4,7 +4,10 @@ import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.tc.entity.AssetOfficialAccount;
import com.ruoyi.tc.entity.Unit;
import com.ruoyi.tc.entity.po.AssetAppCpPo;
import com.ruoyi.tc.entity.po.AssetEmailCpPo;
import com.ruoyi.tc.entity.po.AssetOfficialAccountCpPo;
import com.ruoyi.tc.entity.po.AssetOfficialAccountJyPo;
@ -83,6 +86,11 @@ public class AssetOfficialAccountServiceImpl extends ServiceImpl<AssetOfficialAc
*/
@Override
public Boolean add(AssetOfficialAccount assetOfficialAccount) {
List<Unit> list = unitService.lambdaQuery().eq(Unit::getNickName, assetOfficialAccount.getSsdw())
.eq(Unit::getDelFlag, 0).list();
if(list==null || list.isEmpty()){
throw new ServiceException("请选择已有单位!");
}
save(assetOfficialAccount);
AssetOfficialAccountCpPo a = new AssetOfficialAccountCpPo();
BeanUtil.copyProperties(assetOfficialAccount, a);
@ -106,14 +114,18 @@ public class AssetOfficialAccountServiceImpl extends ServiceImpl<AssetOfficialAc
updateById(assetOfficialAccount);
AssetOfficialAccountCpPo one = assetOfficialAccountCpService.lambdaQuery()
.eq(AssetOfficialAccountCpPo::getAssetId, assetOfficialAccount.getId())
.eq(AssetOfficialAccountCpPo::getStatus,"1")
.ne(AssetOfficialAccountCpPo::getStatus, 5)
.isNotNull(AssetOfficialAccountCpPo::getTaskId)
.one();
if (one != null) {
Integer status = one.getStatus();
Integer taskId = one.getTaskId();
Long appId = one.getAccountId();
BeanUtil.copyProperties(assetOfficialAccount, one);
one.setTaskId(unitService.selectTaskId(assetOfficialAccount.getSsdw(), "2"));
one.setTaskId(taskId);
one.setAssetId(assetOfficialAccount.getId());
one.setStatus(0);
one.setStatus(status);
one.setAccountId(appId);
return assetOfficialAccountCpService.updateById(one);
}else {
return true;

Loading…
Cancel
Save