编辑同步任务

dongdingding
杜函宇 5 days ago
parent 813bc40735
commit d5b109a551

@ -9,57 +9,18 @@ import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.tc.entity.AssetBasicNetwork; import com.ruoyi.tc.entity.*;
import com.ruoyi.tc.entity.AssetBusinessForm; import com.ruoyi.tc.entity.po.*;
import com.ruoyi.tc.entity.AssetCurrent;
import com.ruoyi.tc.entity.AssetExport;
import com.ruoyi.tc.entity.AssetSupplyChain;
import com.ruoyi.tc.entity.Unit;
import com.ruoyi.tc.entity.UnitOtherConcat;
import com.ruoyi.tc.entity.po.AssetBasicNetworkCpPo;
import com.ruoyi.tc.entity.po.AssetBasicNetworkJyPo;
import com.ruoyi.tc.entity.po.AssetBusinessFormCpPo;
import com.ruoyi.tc.entity.po.AssetBusinessFormJyPo;
import com.ruoyi.tc.entity.po.AssetCurrentCpPo;
import com.ruoyi.tc.entity.po.AssetCurrentJyPo;
import com.ruoyi.tc.entity.po.AssetSupplyChainCpPo;
import com.ruoyi.tc.entity.po.AssetSupplyChainJyPo;
import com.ruoyi.tc.entity.po.UnitOtherConcatCpPo;
import com.ruoyi.tc.entity.po.UnitOtherConcatJyPo;
import com.ruoyi.tc.entity.request.Acomma; import com.ruoyi.tc.entity.request.Acomma;
import com.ruoyi.tc.entity.request.AssetAuditPageRequest; import com.ruoyi.tc.entity.request.AssetAuditPageRequest;
import com.ruoyi.tc.entity.request.AssetAuditRequest; import com.ruoyi.tc.entity.request.AssetAuditRequest;
import com.ruoyi.tc.entity.request.AssetCurrentPageRequest; import com.ruoyi.tc.entity.request.AssetCurrentPageRequest;
import com.ruoyi.tc.service.AssetBasicNetworkCpService; import com.ruoyi.tc.service.*;
import com.ruoyi.tc.service.AssetBasicNetworkJyService;
import com.ruoyi.tc.service.AssetBasicNetworkService;
import com.ruoyi.tc.service.AssetBusinessFormCpService;
import com.ruoyi.tc.service.AssetBusinessFormJyService;
import com.ruoyi.tc.service.AssetBusinessFormService;
import com.ruoyi.tc.service.AssetCurrentCpService;
import com.ruoyi.tc.service.AssetCurrentJyService;
import com.ruoyi.tc.service.AssetCurrentService;
import com.ruoyi.tc.service.AssetSupplyChainCpService;
import com.ruoyi.tc.service.AssetSupplyChainJyService;
import com.ruoyi.tc.service.AssetSupplyChainService;
import com.ruoyi.tc.service.AssetTaskService;
import com.ruoyi.tc.service.UnitOtherConcatCpService;
import com.ruoyi.tc.service.UnitOtherConcatJyservice;
import com.ruoyi.tc.service.UnitOtherConcatService;
import com.ruoyi.tc.service.UnitService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource; import javax.annotation.Resource;
@ -183,8 +144,7 @@ public class AssetCurrentController extends BaseController {
@PreAuthorize("@ss.hasAnyRoles('admin,common')") @PreAuthorize("@ss.hasAnyRoles('admin,common')")
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public AjaxResult insert(@RequestBody @Valid AssetCurrent assetCurrent) { public AjaxResult insert(@RequestBody @Valid AssetCurrent assetCurrent) {
List<Unit> list = unitService.lambdaQuery().eq(Unit::getNickName, assetCurrent.getDwmc()) List<Unit> list = unitService.lambdaQuery().eq(Unit::getNickName, assetCurrent.getDwmc()).eq(Unit::getDelFlag, 0).list();
.eq(Unit::getDelFlag, 0).list();
if (list == null || list.isEmpty()) { if (list == null || list.isEmpty()) {
throw new ServiceException("请选择已有单位!"); throw new ServiceException("请选择已有单位!");
} }
@ -292,8 +252,7 @@ public class AssetCurrentController extends BaseController {
@PreAuthorize("@ss.hasAnyRoles('unit')") @PreAuthorize("@ss.hasAnyRoles('unit')")
@PostMapping("/unitEdit") @PostMapping("/unitEdit")
public AjaxResult unitEdit(@RequestBody @Valid AssetCurrentJyPo assetCurrentJyPo) { public AjaxResult unitEdit(@RequestBody @Valid AssetCurrentJyPo assetCurrentJyPo) {
AssetCurrentJyPo one = assetCurrentJyService.lambdaQuery().eq(AssetCurrentJyPo::getXtmc, assetCurrentJyPo.getXtmc()) AssetCurrentJyPo one = assetCurrentJyService.lambdaQuery().eq(AssetCurrentJyPo::getXtmc, assetCurrentJyPo.getXtmc()).eq(AssetCurrentJyPo::getDwmc, assetCurrentJyPo.getDwmc()).isNull(AssetCurrentJyPo::getTaskId).one();
.eq(AssetCurrentJyPo::getDwmc, assetCurrentJyPo.getDwmc()).isNull(AssetCurrentJyPo::getTaskId).one();
assetCurrentJyPo.setAuditState("1"); assetCurrentJyPo.setAuditState("1");
assetCurrentJyPo.setAuditYy(null); assetCurrentJyPo.setAuditYy(null);
if (one != null) { if (one != null) {
@ -484,10 +443,7 @@ public class AssetCurrentController extends BaseController {
unitOtherConcatService.save(a4); unitOtherConcatService.save(a4);
}); });
//如果有任务也修改任务这边 //如果有任务也修改任务这边
AssetCurrentCpPo one = assetCurrentCpService.lambdaQuery() AssetCurrentCpPo one = assetCurrentCpService.lambdaQuery().isNotNull(AssetCurrentCpPo::getTaskId).ne(AssetCurrentCpPo::getStatus, 5).eq(AssetCurrentCpPo::getId, byId.getId()).one();
.isNotNull(AssetCurrentCpPo::getTaskId)
.ne(AssetCurrentCpPo::getStatus, 5)
.eq(AssetCurrentCpPo::getId, byId.getId()).one();
if (one != null) { if (one != null) {
Integer taskId = one.getTaskId(); Integer taskId = one.getTaskId();
Long appId = one.getCurrentId(); Long appId = one.getCurrentId();
@ -549,6 +505,8 @@ public class AssetCurrentController extends BaseController {
@PreAuthorize("@ss.hasAnyRoles('admin,common')") @PreAuthorize("@ss.hasAnyRoles('admin,common')")
@PutMapping @PutMapping
public AjaxResult update(@RequestBody @Valid AssetCurrent assetCurrent) { public AjaxResult update(@RequestBody @Valid AssetCurrent assetCurrent) {
//保存未修改之前的单位名称
AssetCurrent byId = assetCurrentService.getById(assetCurrent.getId());
StringBuilder a = new StringBuilder(); StringBuilder a = new StringBuilder();
if (assetCurrent.getGlymList() != null) { if (assetCurrent.getGlymList() != null) {
assetCurrent.getGlymList().forEach(x -> { assetCurrent.getGlymList().forEach(x -> {
@ -569,7 +527,13 @@ public class AssetCurrentController extends BaseController {
}); });
} }
assetCurrent.setGlIp(b.toString()); assetCurrent.setGlIp(b.toString());
List<Unit> list = unitService.lambdaQuery().eq(Unit::getNickName, assetCurrent.getDwmc()).eq(Unit::getDelFlag, 0).list();
if (list == null || list.isEmpty()) {
throw new ServiceException("请选择已有单位!");
}
assetCurrentService.updateById(assetCurrent); assetCurrentService.updateById(assetCurrent);
assetSupplyChainService.deleteByAssetIds(assetCurrent.getId()); assetSupplyChainService.deleteByAssetIds(assetCurrent.getId());
assetBasicNetworkService.deleteByAssetIds(assetCurrent.getId()); assetBasicNetworkService.deleteByAssetIds(assetCurrent.getId());
assetBusinessFormService.deleteByAssetIds(assetCurrent.getId()); assetBusinessFormService.deleteByAssetIds(assetCurrent.getId());
@ -603,50 +567,67 @@ public class AssetCurrentController extends BaseController {
//新增其他联系人 //新增其他联系人
unitOtherConcatService.saveBatch(assetCurrent.getOtherConcat()); unitOtherConcatService.saveBatch(assetCurrent.getOtherConcat());
} }
//================================
Integer i = unitService.selectTaskId(assetCurrent.getDwmc(), "0"); //================================
if (i != null) { //根据未修改之前的单位名称去寻找正在进行中的任务,报废的任务,单位自编辑的任务
QueryWrapper<AssetCurrentCpPo> queryWrapper1 = new QueryWrapper<>(); List<AssetCurrentCpPo> list1 = assetCurrentCpService.lambdaQuery().eq(AssetCurrentCpPo::getId, assetCurrent.getId()).list();
queryWrapper1.eq("id", assetCurrent.getId()); list1.forEach(x -> {
queryWrapper1.eq("task_id", i); Integer taskId = x.getTaskId();
queryWrapper1.ne("status", 5);
AssetCurrentCpPo x = assetCurrentCpService.getOne(queryWrapper1);
if (BeanUtil.isEmpty(x)) {
Integer status = x.getStatus();
Long currentId = x.getCurrentId(); Long currentId = x.getCurrentId();
Integer status = x.getStatus();
String auditState = x.getAuditState();
String auditYy = x.getAuditYy();
AssetCurrentCpPo assetCurrentCpPo = new AssetCurrentCpPo(); AssetCurrentCpPo assetCurrentCpPo = new AssetCurrentCpPo();
BeanUtil.copyProperties(assetCurrent, assetCurrentCpPo); BeanUtil.copyProperties(assetCurrent, assetCurrentCpPo);
assetCurrentCpPo.setTaskId(i); assetCurrentCpPo.setTaskId(taskId);
assetCurrentCpPo.setCurrentId(currentId); assetCurrentCpPo.setCurrentId(currentId);
assetCurrentCpPo.setStatus(status); assetCurrentCpPo.setStatus(status);
assetCurrentCpPo.setAuditState(auditState);
assetCurrentCpPo.setAuditYy(auditYy);
assetCurrentCpService.updateById(assetCurrentCpPo); assetCurrentCpService.updateById(assetCurrentCpPo);
QueryWrapper<AssetSupplyChainCpPo> queryWrapper2 = new QueryWrapper<>(); QueryWrapper<AssetSupplyChainCpPo> queryWrapper2 = new QueryWrapper<>();
queryWrapper2.eq("asset_id", assetCurrent.getId()); queryWrapper2.eq("asset_id", assetCurrent.getId());
queryWrapper2.eq("task_id", i); if (taskId == null) {
queryWrapper2.isNull("task_id");
} else {
queryWrapper2.eq("task_id", taskId);
}
assetSupplyChainCpService.remove(queryWrapper2); assetSupplyChainCpService.remove(queryWrapper2);
QueryWrapper<AssetBasicNetworkCpPo> queryWrapper3 = new QueryWrapper<>(); QueryWrapper<AssetBasicNetworkCpPo> queryWrapper3 = new QueryWrapper<>();
queryWrapper3.eq("task_id", i); if (taskId == null) {
queryWrapper3.isNull("task_id");
} else {
queryWrapper3.eq("task_id", taskId);
}
queryWrapper3.eq("asset_id", assetCurrent.getId()); queryWrapper3.eq("asset_id", assetCurrent.getId());
assetBasicNetworkCpService.remove(queryWrapper3); assetBasicNetworkCpService.remove(queryWrapper3);
QueryWrapper<AssetBusinessFormCpPo> queryWrapper4 = new QueryWrapper<>(); QueryWrapper<AssetBusinessFormCpPo> queryWrapper4 = new QueryWrapper<>();
queryWrapper4.eq("task_id", i); if (taskId == null) {
queryWrapper4.isNull("task_id");
} else {
queryWrapper4.eq("task_id", taskId);
}
queryWrapper4.eq("asset_id", assetCurrent.getId()); queryWrapper4.eq("asset_id", assetCurrent.getId());
assetBusinessFormCpService.remove(queryWrapper4); assetBusinessFormCpService.remove(queryWrapper4);
QueryWrapper<UnitOtherConcatCpPo> queryWrapper5 = new QueryWrapper<>(); QueryWrapper<UnitOtherConcatCpPo> queryWrapper5 = new QueryWrapper<>();
queryWrapper5.eq("asset_id", assetCurrent.getId()); queryWrapper5.eq("asset_id", assetCurrent.getId());
queryWrapper5.eq("task_id", i); if (taskId == null) {
queryWrapper5.isNull("task_id");
} else {
queryWrapper5.eq("task_id", taskId);
}
unitOtherConcatCpService.remove(queryWrapper5); unitOtherConcatCpService.remove(queryWrapper5);
if (assetCurrent.getXjgywxt() != null) { if (assetCurrent.getXjgywxt() != null) {
assetCurrentCpPo.getXjgywxt().setAssetId(assetCurrent.getId()); assetCurrentCpPo.getXjgywxt().setAssetId(assetCurrent.getId());
assetCurrentCpPo.getXjgywxt().setTaskId(i); assetCurrentCpPo.getXjgywxt().setTaskId(taskId);
assetBusinessFormCpService.save(assetCurrentCpPo.getXjgywxt()); assetBusinessFormCpService.save(assetCurrentCpPo.getXjgywxt());
} }
if (assetCurrent.getGylxxList() != null) { if (assetCurrent.getGylxxList() != null) {
for (AssetSupplyChainCpPo items : assetCurrentCpPo.getGylxxList()) { for (AssetSupplyChainCpPo items : assetCurrentCpPo.getGylxxList()) {
items.setAssetId(assetCurrent.getId()); items.setAssetId(assetCurrent.getId());
items.setTaskId(i); items.setTaskId(taskId);
} }
//新增供应链 //新增供应链
assetSupplyChainCpService.saveBatch(assetCurrentCpPo.getGylxxList()); assetSupplyChainCpService.saveBatch(assetCurrentCpPo.getGylxxList());
@ -654,7 +635,7 @@ public class AssetCurrentController extends BaseController {
if (assetCurrent.getJcwlList() != null) { if (assetCurrent.getJcwlList() != null) {
for (AssetBasicNetworkCpPo items : assetCurrentCpPo.getJcwlList()) { for (AssetBasicNetworkCpPo items : assetCurrentCpPo.getJcwlList()) {
items.setAssetId(assetCurrent.getId()); items.setAssetId(assetCurrent.getId());
items.setTaskId(i); items.setTaskId(taskId);
} }
//新增基础网络 //新增基础网络
assetBasicNetworkCpService.saveBatch(assetCurrentCpPo.getJcwlList()); assetBasicNetworkCpService.saveBatch(assetCurrentCpPo.getJcwlList());
@ -662,13 +643,12 @@ public class AssetCurrentController extends BaseController {
if (assetCurrent.getOtherConcat() != null) { if (assetCurrent.getOtherConcat() != null) {
for (UnitOtherConcatCpPo items : assetCurrentCpPo.getOtherConcat()) { for (UnitOtherConcatCpPo items : assetCurrentCpPo.getOtherConcat()) {
items.setAssetId(assetCurrent.getId()); items.setAssetId(assetCurrent.getId());
items.setTaskId(i); items.setTaskId(taskId);
} }
//新增其他联系人 //新增其他联系人
unitOtherConcatCpService.saveBatch(assetCurrentCpPo.getOtherConcat()); unitOtherConcatCpService.saveBatch(assetCurrentCpPo.getOtherConcat());
} }
} });
}
return success(); return success();
} }
@ -754,8 +734,7 @@ public class AssetCurrentController extends BaseController {
AssetCurrent as = new AssetCurrent(); AssetCurrent as = new AssetCurrent();
//copy新增到新的现有资产表里面 //copy新增到新的现有资产表里面
BeanUtil.copyProperties(items, as); BeanUtil.copyProperties(items, as);
AssetCurrent one = assetCurrentService.lambdaQuery().eq(AssetCurrent::getXtmc, as.getXtmc()) AssetCurrent one = assetCurrentService.lambdaQuery().eq(AssetCurrent::getXtmc, as.getXtmc()).eq(AssetCurrent::getDwmc, as.getDwmc()).one();
.eq(AssetCurrent::getDwmc, as.getDwmc()).one();
if (one != null) { if (one != null) {
as.setId(one.getId()); as.setId(one.getId());
assetCurrentService.updateById(as); assetCurrentService.updateById(as);
@ -764,8 +743,7 @@ public class AssetCurrentController extends BaseController {
assetSupplyChainService.deleteIdList(a1); assetSupplyChainService.deleteIdList(a1);
assetBasicNetworkService.deleteIdList(a1); assetBasicNetworkService.deleteIdList(a1);
} else { } else {
List<Unit> list = unitService.lambdaQuery().eq(Unit::getNickName, items.getDwmc()) List<Unit> list = unitService.lambdaQuery().eq(Unit::getNickName, items.getDwmc()).eq(Unit::getDelFlag, 0).list();
.eq(Unit::getDelFlag, 0).list();
if (list == null || list.isEmpty()) { if (list == null || list.isEmpty()) {
throw new ServiceException(j + "行单位未入库!"); throw new ServiceException(j + "行单位未入库!");
} }
@ -834,8 +812,7 @@ public class AssetCurrentController extends BaseController {
BeanUtil.copyProperties(as, assetCurrentCpPo); BeanUtil.copyProperties(as, assetCurrentCpPo);
assetCurrentCpPo.setTaskId(i); assetCurrentCpPo.setTaskId(i);
assetCurrentCpPo.setStatus(0); assetCurrentCpPo.setStatus(0);
AssetCurrentCpPo two = assetCurrentCpService.lambdaQuery().eq(AssetCurrentCpPo::getXtmc, as.getXtmc()) AssetCurrentCpPo two = assetCurrentCpService.lambdaQuery().eq(AssetCurrentCpPo::getXtmc, as.getXtmc()).eq(AssetCurrentCpPo::getDwmc, as.getDwmc()).isNotNull(AssetCurrentCpPo::getTaskId).one();
.eq(AssetCurrentCpPo::getDwmc, as.getDwmc()).isNotNull(AssetCurrentCpPo::getTaskId).one();
if (two != null) { if (two != null) {
assetCurrentCpPo.setId(two.getId()); assetCurrentCpPo.setId(two.getId());
assetCurrentCpService.updateById(assetCurrentCpPo); assetCurrentCpService.updateById(assetCurrentCpPo);

@ -8,9 +8,6 @@ import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.tc.entity.AssetApp; import com.ruoyi.tc.entity.AssetApp;
import com.ruoyi.tc.entity.Unit; import com.ruoyi.tc.entity.Unit;
import com.ruoyi.tc.entity.po.AssetAppCpPo; import com.ruoyi.tc.entity.po.AssetAppCpPo;
import com.ruoyi.tc.entity.po.AssetAppJyPo;
import com.ruoyi.tc.entity.po.AssetEmailCpPo;
import com.ruoyi.tc.entity.po.AssetOfficialAccountCpPo;
import com.ruoyi.tc.entity.request.AssetAppPageRequest; import com.ruoyi.tc.entity.request.AssetAppPageRequest;
import com.ruoyi.tc.mapper.AssetAppMapper; import com.ruoyi.tc.mapper.AssetAppMapper;
import com.ruoyi.tc.service.AssetAppCpService; import com.ruoyi.tc.service.AssetAppCpService;
@ -28,7 +25,7 @@ import java.util.List;
* @since 2024-11-28 17:13:07 * @since 2024-11-28 17:13:07
*/ */
@Service("assetAppService") @Service("assetAppService")
public class AssetAppServiceImpl extends ServiceImpl<AssetAppMapper, AssetApp> implements AssetAppService{ public class AssetAppServiceImpl extends ServiceImpl<AssetAppMapper, AssetApp> implements AssetAppService {
@Resource @Resource
private UnitService unitService; private UnitService unitService;
@ -44,7 +41,7 @@ public class AssetAppServiceImpl extends ServiceImpl<AssetAppMapper, AssetApp> i
*/ */
@Override @Override
public Page<AssetApp> page(Page<AssetApp> page, AssetAppPageRequest as) { public Page<AssetApp> page(Page<AssetApp> page, AssetAppPageRequest as) {
return baseMapper.page(page,as); return baseMapper.page(page, as);
} }
/** /**
@ -91,14 +88,14 @@ public class AssetAppServiceImpl extends ServiceImpl<AssetAppMapper, AssetApp> i
public Boolean add(AssetApp assetApp) { public Boolean add(AssetApp assetApp) {
List<Unit> list = unitService.lambdaQuery().eq(Unit::getNickName, assetApp.getSsdw()) List<Unit> list = unitService.lambdaQuery().eq(Unit::getNickName, assetApp.getSsdw())
.eq(Unit::getDelFlag, 0).list(); .eq(Unit::getDelFlag, 0).list();
if(list==null || list.isEmpty()){ if (list == null || list.isEmpty()) {
throw new ServiceException("请选择已有单位!"); throw new ServiceException("请选择已有单位!");
} }
save(assetApp); save(assetApp);
AssetAppCpPo a = new AssetAppCpPo(); AssetAppCpPo a = new AssetAppCpPo();
BeanUtil.copyProperties(assetApp, a); BeanUtil.copyProperties(assetApp, a);
Integer i = unitService.selectTaskId(assetApp.getSsdw(), "4"); Integer i = unitService.selectTaskId(assetApp.getSsdw(), "4");
if(i!=null){ if (i != null) {
a.setTaskId(i); a.setTaskId(i);
a.setAssetId(assetApp.getId()); a.setAssetId(assetApp.getId());
assetAppCpService.save(a); assetAppCpService.save(a);
@ -116,25 +113,24 @@ public class AssetAppServiceImpl extends ServiceImpl<AssetAppMapper, AssetApp> i
@Override @Override
public Boolean edit(AssetApp assetApp) { public Boolean edit(AssetApp assetApp) {
updateById(assetApp); updateById(assetApp);
AssetAppCpPo one = assetAppCpService.lambdaQuery() List<AssetAppCpPo> list = assetAppCpService.lambdaQuery()
.eq(AssetAppCpPo::getAssetId, assetApp.getId()) .eq(AssetAppCpPo::getAssetId, assetApp.getId()).list();
.ne(AssetAppCpPo::getStatus, 5) list.forEach(x -> {
.isNotNull(AssetAppCpPo::getTaskId) Integer status = x.getStatus();
.one(); Integer taskId = x.getTaskId();
if (one != null) { Long appId = x.getAppId();
Integer status = one.getStatus(); String auditState = x.getAuditState();
Integer taskId = one.getTaskId(); String auditYy = x.getAuditYy();
Long appId = one.getAppId(); BeanUtil.copyProperties(assetApp, x);
BeanUtil.copyProperties(assetApp, one); x.setStatus(status);
one.setStatus(status); x.setTaskId(taskId);
one.setTaskId(taskId); x.setAssetId(assetApp.getId());
one.setAssetId(assetApp.getId()); x.setAppId(appId);
one.setAppId(appId); x.setAuditYy(auditYy);
return assetAppCpService.updateById(one); x.setAuditState(auditState);
}else { assetAppCpService.updateById(x);
});
return true; return true;
} }
}
} }

@ -8,8 +8,6 @@ import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.tc.entity.AssetEmail; import com.ruoyi.tc.entity.AssetEmail;
import com.ruoyi.tc.entity.Unit; import com.ruoyi.tc.entity.Unit;
import com.ruoyi.tc.entity.po.AssetEmailCpPo; import com.ruoyi.tc.entity.po.AssetEmailCpPo;
import com.ruoyi.tc.entity.po.AssetEmailJyPo;
import com.ruoyi.tc.entity.po.AssetMiniProgramsCpPo;
import com.ruoyi.tc.entity.request.AssetEmailPageRequest; import com.ruoyi.tc.entity.request.AssetEmailPageRequest;
import com.ruoyi.tc.mapper.AssetEmailMapper; import com.ruoyi.tc.mapper.AssetEmailMapper;
import com.ruoyi.tc.service.AssetEmailCpService; import com.ruoyi.tc.service.AssetEmailCpService;
@ -91,14 +89,14 @@ public class AssetEmailServiceImpl extends ServiceImpl<AssetEmailMapper, AssetEm
public Boolean add(AssetEmail assetEmail) { public Boolean add(AssetEmail assetEmail) {
List<Unit> list = unitService.lambdaQuery().eq(Unit::getNickName, assetEmail.getSsdw()) List<Unit> list = unitService.lambdaQuery().eq(Unit::getNickName, assetEmail.getSsdw())
.eq(Unit::getDelFlag, 0).list(); .eq(Unit::getDelFlag, 0).list();
if(list==null || list.isEmpty()){ if (list == null || list.isEmpty()) {
throw new ServiceException("请选择已有单位!"); throw new ServiceException("请选择已有单位!");
} }
save(assetEmail); save(assetEmail);
AssetEmailCpPo a = new AssetEmailCpPo(); AssetEmailCpPo a = new AssetEmailCpPo();
BeanUtil.copyProperties(assetEmail, a); BeanUtil.copyProperties(assetEmail, a);
Integer i = unitService.selectTaskId(assetEmail.getSsdw(), "3"); Integer i = unitService.selectTaskId(assetEmail.getSsdw(), "3");
if(i!=null){ if (i != null) {
a.setTaskId(i); a.setTaskId(i);
a.setAssetId(assetEmail.getId()); a.setAssetId(assetEmail.getId());
assetEmailCpService.save(a); assetEmailCpService.save(a);
@ -115,22 +113,23 @@ public class AssetEmailServiceImpl extends ServiceImpl<AssetEmailMapper, AssetEm
@Override @Override
public Boolean edit(AssetEmail assetEmail) { public Boolean edit(AssetEmail assetEmail) {
updateById(assetEmail); updateById(assetEmail);
AssetEmailCpPo one = assetEmailCpService.lambdaQuery() List<AssetEmailCpPo> list = assetEmailCpService.lambdaQuery()
.eq(AssetEmailCpPo::getAssetId, assetEmail.getId()) .eq(AssetEmailCpPo::getAssetId, assetEmail.getId()).list();
.ne(AssetEmailCpPo::getStatus, 5) list.forEach(x -> {
.isNotNull(AssetEmailCpPo::getTaskId).one(); Integer status = x.getStatus();
if (one != null) { Integer taskId = x.getTaskId();
Integer status = one.getStatus(); Long appId = x.getEmailId();
Integer taskId = one.getTaskId(); String auditState = x.getAuditState();
Long appId = one.getEmailId(); String auditYy = x.getAuditYy();
BeanUtil.copyProperties(assetEmail, one); BeanUtil.copyProperties(assetEmail, x);
one.setStatus(status); x.setStatus(status);
one.setTaskId(taskId); x.setTaskId(taskId);
one.setAssetId(assetEmail.getId()); x.setAssetId(assetEmail.getId());
one.setEmailId(appId); x.setEmailId(appId);
return assetEmailCpService.updateById(one); x.setAuditYy(auditYy);
}else { x.setAuditState(auditState);
assetEmailCpService.updateById(x);
});
return true; return true;
} }
}
} }

@ -7,9 +7,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.tc.entity.AssetMiniPrograms; import com.ruoyi.tc.entity.AssetMiniPrograms;
import com.ruoyi.tc.entity.Unit; 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.AssetMiniProgramsCpPo;
import com.ruoyi.tc.entity.po.AssetMiniProgramsJyPo;
import com.ruoyi.tc.entity.request.AssetMiniProgramsPageRequest; import com.ruoyi.tc.entity.request.AssetMiniProgramsPageRequest;
import com.ruoyi.tc.mapper.AssetMiniProgramsMapper; import com.ruoyi.tc.mapper.AssetMiniProgramsMapper;
import com.ruoyi.tc.service.AssetMiniProgramsCpService; import com.ruoyi.tc.service.AssetMiniProgramsCpService;
@ -27,13 +25,14 @@ import java.util.List;
* @since 2024-11-28 17:13:07 * @since 2024-11-28 17:13:07
*/ */
@Service("assetMiniProgramsService") @Service("assetMiniProgramsService")
public class AssetMiniProgramsServiceImpl extends ServiceImpl<AssetMiniProgramsMapper, AssetMiniPrograms> implements AssetMiniProgramsService{ public class AssetMiniProgramsServiceImpl extends ServiceImpl<AssetMiniProgramsMapper, AssetMiniPrograms> implements AssetMiniProgramsService {
@Resource @Resource
private AssetMiniProgramsCpService assetMiniProgramsCpService; private AssetMiniProgramsCpService assetMiniProgramsCpService;
@Resource @Resource
private UnitService unitService; private UnitService unitService;
/** /**
* *
* *
@ -43,7 +42,7 @@ public class AssetMiniProgramsServiceImpl extends ServiceImpl<AssetMiniProgramsM
*/ */
@Override @Override
public Page<AssetMiniPrograms> page(Page<AssetMiniPrograms> page, AssetMiniProgramsPageRequest as) { public Page<AssetMiniPrograms> page(Page<AssetMiniPrograms> page, AssetMiniProgramsPageRequest as) {
return baseMapper.page(page,as); return baseMapper.page(page, as);
} }
/** /**
@ -84,14 +83,14 @@ public class AssetMiniProgramsServiceImpl extends ServiceImpl<AssetMiniProgramsM
public Boolean add(AssetMiniPrograms assetMiniPrograms) { public Boolean add(AssetMiniPrograms assetMiniPrograms) {
List<Unit> list = unitService.lambdaQuery().eq(Unit::getNickName, assetMiniPrograms.getSsdw()) List<Unit> list = unitService.lambdaQuery().eq(Unit::getNickName, assetMiniPrograms.getSsdw())
.eq(Unit::getDelFlag, 0).list(); .eq(Unit::getDelFlag, 0).list();
if(list==null || list.isEmpty()){ if (list == null || list.isEmpty()) {
throw new ServiceException("请选择已有单位!"); throw new ServiceException("请选择已有单位!");
} }
save(assetMiniPrograms); save(assetMiniPrograms);
AssetMiniProgramsCpPo assetMiniProgramsCpPo = new AssetMiniProgramsCpPo(); AssetMiniProgramsCpPo assetMiniProgramsCpPo = new AssetMiniProgramsCpPo();
BeanUtil.copyProperties(assetMiniPrograms,assetMiniProgramsCpPo); BeanUtil.copyProperties(assetMiniPrograms, assetMiniProgramsCpPo);
Integer i = unitService.selectTaskId(assetMiniPrograms.getSsdw(), "1"); Integer i = unitService.selectTaskId(assetMiniPrograms.getSsdw(), "1");
if(i!=null){ if (i != null) {
assetMiniProgramsCpPo.setTaskId(i); assetMiniProgramsCpPo.setTaskId(i);
assetMiniProgramsCpPo.setAssetId(assetMiniPrograms.getId()); assetMiniProgramsCpPo.setAssetId(assetMiniPrograms.getId());
assetMiniProgramsCpService.save(assetMiniProgramsCpPo); assetMiniProgramsCpService.save(assetMiniProgramsCpPo);
@ -108,24 +107,25 @@ public class AssetMiniProgramsServiceImpl extends ServiceImpl<AssetMiniProgramsM
@Override @Override
public Boolean edit(AssetMiniPrograms assetMiniPrograms) { public Boolean edit(AssetMiniPrograms assetMiniPrograms) {
updateById(assetMiniPrograms); updateById(assetMiniPrograms);
AssetMiniProgramsCpPo one = assetMiniProgramsCpService.lambdaQuery() List<AssetMiniProgramsCpPo> list = assetMiniProgramsCpService.lambdaQuery()
.eq(AssetMiniProgramsCpPo::getAssetId, assetMiniPrograms.getId()) .eq(AssetMiniProgramsCpPo::getAssetId, assetMiniPrograms.getId()).list();
.ne(AssetMiniProgramsCpPo::getStatus, 5) list.forEach(x -> {
.isNotNull(AssetMiniProgramsCpPo::getTaskId).one(); Integer status = x.getStatus();
if (one!=null){ Integer taskId = x.getTaskId();
Integer status = one.getStatus(); Long miniId = x.getMiniId();
Integer taskId = one.getTaskId(); String auditState = x.getAuditState();
Long miniId = one.getMiniId(); String auditYy = x.getAuditYy();
BeanUtil.copyProperties(assetMiniPrograms,one); BeanUtil.copyProperties(assetMiniPrograms, x);
one.setTaskId(taskId); x.setTaskId(taskId);
one.setAssetId(assetMiniPrograms.getId()); x.setAssetId(assetMiniPrograms.getId());
one.setStatus(status); x.setStatus(status);
one.setMiniId(miniId); x.setMiniId(miniId);
return assetMiniProgramsCpService.updateById(one); x.setAuditYy(auditYy);
}else{ x.setAuditState(auditState);
assetMiniProgramsCpService.updateById(x);
});
return true; return true;
} }
}
@Override @Override

@ -7,10 +7,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.tc.entity.AssetOfficialAccount; import com.ruoyi.tc.entity.AssetOfficialAccount;
import com.ruoyi.tc.entity.Unit; 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.AssetOfficialAccountCpPo;
import com.ruoyi.tc.entity.po.AssetOfficialAccountJyPo;
import com.ruoyi.tc.entity.request.AssetOfficialAccountPageRequest; import com.ruoyi.tc.entity.request.AssetOfficialAccountPageRequest;
import com.ruoyi.tc.mapper.AssetOfficialAccountMapper; import com.ruoyi.tc.mapper.AssetOfficialAccountMapper;
import com.ruoyi.tc.service.AssetOfficialAccountCpService; import com.ruoyi.tc.service.AssetOfficialAccountCpService;
@ -88,14 +85,14 @@ public class AssetOfficialAccountServiceImpl extends ServiceImpl<AssetOfficialAc
public Boolean add(AssetOfficialAccount assetOfficialAccount) { public Boolean add(AssetOfficialAccount assetOfficialAccount) {
List<Unit> list = unitService.lambdaQuery().eq(Unit::getNickName, assetOfficialAccount.getSsdw()) List<Unit> list = unitService.lambdaQuery().eq(Unit::getNickName, assetOfficialAccount.getSsdw())
.eq(Unit::getDelFlag, 0).list(); .eq(Unit::getDelFlag, 0).list();
if(list==null || list.isEmpty()){ if (list == null || list.isEmpty()) {
throw new ServiceException("请选择已有单位!"); throw new ServiceException("请选择已有单位!");
} }
save(assetOfficialAccount); save(assetOfficialAccount);
AssetOfficialAccountCpPo a = new AssetOfficialAccountCpPo(); AssetOfficialAccountCpPo a = new AssetOfficialAccountCpPo();
BeanUtil.copyProperties(assetOfficialAccount, a); BeanUtil.copyProperties(assetOfficialAccount, a);
Integer i = unitService.selectTaskId(assetOfficialAccount.getSsdw(), "2"); Integer i = unitService.selectTaskId(assetOfficialAccount.getSsdw(), "2");
if(i!=null){ if (i != null) {
a.setTaskId(i); a.setTaskId(i);
a.setAssetId(assetOfficialAccount.getId()); a.setAssetId(assetOfficialAccount.getId());
assetOfficialAccountCpService.save(a); assetOfficialAccountCpService.save(a);
@ -112,27 +109,26 @@ public class AssetOfficialAccountServiceImpl extends ServiceImpl<AssetOfficialAc
@Override @Override
public Boolean edit(AssetOfficialAccount assetOfficialAccount) { public Boolean edit(AssetOfficialAccount assetOfficialAccount) {
updateById(assetOfficialAccount); updateById(assetOfficialAccount);
AssetOfficialAccountCpPo one = assetOfficialAccountCpService.lambdaQuery() List<AssetOfficialAccountCpPo> list = assetOfficialAccountCpService.lambdaQuery()
.eq(AssetOfficialAccountCpPo::getAssetId, assetOfficialAccount.getId()) .eq(AssetOfficialAccountCpPo::getAssetId, assetOfficialAccount.getId()).list();
.ne(AssetOfficialAccountCpPo::getStatus, 5) list.forEach(x -> {
.isNotNull(AssetOfficialAccountCpPo::getTaskId) Integer status = x.getStatus();
.one(); Integer taskId = x.getTaskId();
if (one != null) { Long appId = x.getAccountId();
Integer status = one.getStatus(); String auditState = x.getAuditState();
Integer taskId = one.getTaskId(); String auditYy = x.getAuditYy();
Long appId = one.getAccountId(); BeanUtil.copyProperties(assetOfficialAccount, x);
BeanUtil.copyProperties(assetOfficialAccount, one); x.setTaskId(taskId);
one.setTaskId(taskId); x.setAssetId(assetOfficialAccount.getId());
one.setAssetId(assetOfficialAccount.getId()); x.setStatus(status);
one.setStatus(status); x.setAccountId(appId);
one.setAccountId(appId); x.setAuditYy(auditYy);
return assetOfficialAccountCpService.updateById(one); x.setAuditState(auditState);
}else { assetOfficialAccountCpService.updateById(x);
});
return true; return true;
} }
}
@Override @Override
public Integer findBydwmc(String part) { public Integer findBydwmc(String part) {

Loading…
Cancel
Save