Compare commits

..

3 Commits

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

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

@ -150,9 +150,10 @@ public class AssetEmailController extends BaseController {
//如果有任务也修改任务这边 //如果有任务也修改任务这边
AssetEmailJyPo one = assetEmailJyService.lambdaQuery() AssetEmailJyPo one = assetEmailJyService.lambdaQuery()
.isNotNull(AssetEmailJyPo::getTaskId) .isNotNull(AssetEmailJyPo::getTaskId)
.eq(AssetEmailJyPo::getStatus,"1") .ne(AssetEmailJyPo::getStatus, 5)
.eq(AssetEmailJyPo::getAssetId, byId.getAssetId()).one(); .eq(AssetEmailJyPo::getAssetId, byId.getAssetId()).one();
if(one!=null){ if(one!=null){
Integer status = one.getStatus();
Integer taskId = one.getTaskId(); Integer taskId = one.getTaskId();
Long appId = one.getEmailId(); Long appId = one.getEmailId();
BeanUtil.copyProperties(byId, one); BeanUtil.copyProperties(byId, one);
@ -160,6 +161,7 @@ public class AssetEmailController extends BaseController {
one.setTaskId(taskId); one.setTaskId(taskId);
one.setAuditState(null); one.setAuditState(null);
one.setAuditYy(null); one.setAuditYy(null);
one.setStatus(status);
assetEmailJyService.updateById(one); 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.AssetEmail;
import com.ruoyi.tc.entity.AssetMiniPrograms; import com.ruoyi.tc.entity.AssetMiniPrograms;
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.AssetEmailJyPo; import com.ruoyi.tc.entity.po.AssetEmailJyPo;
import com.ruoyi.tc.entity.po.AssetMiniProgramsJyPo; import com.ruoyi.tc.entity.po.AssetMiniProgramsJyPo;
import com.ruoyi.tc.entity.request.AssetAuditPageRequest; import com.ruoyi.tc.entity.request.AssetAuditPageRequest;
@ -152,16 +153,18 @@ public class AssetMiniProgramsController extends BaseController {
//如果有任务也修改任务这边 //如果有任务也修改任务这边
AssetMiniProgramsJyPo one = assetMiniProgramsJyService.lambdaQuery() AssetMiniProgramsJyPo one = assetMiniProgramsJyService.lambdaQuery()
.isNotNull(AssetMiniProgramsJyPo::getTaskId) .isNotNull(AssetMiniProgramsJyPo::getTaskId)
.eq(AssetMiniProgramsJyPo::getStatus,"1") .ne(AssetMiniProgramsJyPo::getStatus, 5)
.eq(AssetMiniProgramsJyPo::getAssetId, byId.getAssetId()).one(); .eq(AssetMiniProgramsJyPo::getAssetId, byId.getAssetId()).one();
if(one!=null){ if(one!=null){
Integer taskId = one.getTaskId(); Integer taskId = one.getTaskId();
Long appId = one.getMiniId(); Long appId = one.getMiniId();
Integer status = one.getStatus();
BeanUtil.copyProperties(byId, one); BeanUtil.copyProperties(byId, one);
one.setMiniId(appId); one.setMiniId(appId);
one.setTaskId(taskId); one.setTaskId(taskId);
one.setAuditState(null); one.setAuditState(null);
one.setAuditYy(null); one.setAuditYy(null);
one.setStatus(status);
assetMiniProgramsJyService.updateById(one); assetMiniProgramsJyService.updateById(one);
} }
} }

@ -166,9 +166,10 @@ public class AssetOfficialAccountController {
//如果有任务也修改任务这边 //如果有任务也修改任务这边
AssetOfficialAccountJyPo one = assetOfficialAccountJyService.lambdaQuery() AssetOfficialAccountJyPo one = assetOfficialAccountJyService.lambdaQuery()
.isNotNull(AssetOfficialAccountJyPo::getTaskId) .isNotNull(AssetOfficialAccountJyPo::getTaskId)
.eq(AssetOfficialAccountJyPo::getStatus,"1") .ne(AssetOfficialAccountJyPo::getStatus, 5)
.eq(AssetOfficialAccountJyPo::getAssetId, byId.getAssetId()).one(); .eq(AssetOfficialAccountJyPo::getAssetId, byId.getAssetId()).one();
if(one!=null){ if(one!=null){
Integer status = one.getStatus();
Integer taskId = one.getTaskId(); Integer taskId = one.getTaskId();
Long appId = one.getAccountId(); Long appId = one.getAccountId();
BeanUtil.copyProperties(byId, one); BeanUtil.copyProperties(byId, one);
@ -176,6 +177,7 @@ public class AssetOfficialAccountController {
one.setTaskId(taskId); one.setTaskId(taskId);
one.setAuditState(null); one.setAuditState(null);
one.setAuditYy(null); one.setAuditYy(null);
one.setStatus(status);
assetOfficialAccountJyService.updateById(one); 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.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 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.AssetApp;
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.AssetAppJyPo;
import com.ruoyi.tc.entity.po.AssetEmailCpPo; import com.ruoyi.tc.entity.po.AssetEmailCpPo;
@ -87,6 +89,11 @@ public class AssetAppServiceImpl extends ServiceImpl<AssetAppMapper, AssetApp> i
*/ */
@Override @Override
public Boolean add(AssetApp assetApp) { 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); save(assetApp);
AssetAppCpPo a = new AssetAppCpPo(); AssetAppCpPo a = new AssetAppCpPo();
BeanUtil.copyProperties(assetApp, a); BeanUtil.copyProperties(assetApp, a);
@ -111,14 +118,18 @@ public class AssetAppServiceImpl extends ServiceImpl<AssetAppMapper, AssetApp> i
updateById(assetApp); updateById(assetApp);
AssetAppCpPo one = assetAppCpService.lambdaQuery() AssetAppCpPo one = assetAppCpService.lambdaQuery()
.eq(AssetAppCpPo::getAssetId, assetApp.getId()) .eq(AssetAppCpPo::getAssetId, assetApp.getId())
.eq(AssetAppCpPo::getStatus,"1") .ne(AssetAppCpPo::getStatus, 5)
.isNotNull(AssetAppCpPo::getTaskId) .isNotNull(AssetAppCpPo::getTaskId)
.one(); .one();
if (one != null) { if (one != null) {
Integer status = one.getStatus();
Integer taskId = one.getTaskId();
Long appId = one.getAppId();
BeanUtil.copyProperties(assetApp, one); BeanUtil.copyProperties(assetApp, one);
one.setTaskId(unitService.selectTaskId(assetApp.getSsdw(), "4")); one.setStatus(status);
one.setTaskId(taskId);
one.setAssetId(assetApp.getId()); one.setAssetId(assetApp.getId());
one.setStatus(0); one.setAppId(appId);
return assetAppCpService.updateById(one); return assetAppCpService.updateById(one);
}else { }else {
return true; return true;

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

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

@ -4,7 +4,10 @@ import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 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.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.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.po.AssetOfficialAccountJyPo;
@ -83,6 +86,11 @@ public class AssetOfficialAccountServiceImpl extends ServiceImpl<AssetOfficialAc
*/ */
@Override @Override
public Boolean add(AssetOfficialAccount assetOfficialAccount) { 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); save(assetOfficialAccount);
AssetOfficialAccountCpPo a = new AssetOfficialAccountCpPo(); AssetOfficialAccountCpPo a = new AssetOfficialAccountCpPo();
BeanUtil.copyProperties(assetOfficialAccount, a); BeanUtil.copyProperties(assetOfficialAccount, a);
@ -106,14 +114,18 @@ public class AssetOfficialAccountServiceImpl extends ServiceImpl<AssetOfficialAc
updateById(assetOfficialAccount); updateById(assetOfficialAccount);
AssetOfficialAccountCpPo one = assetOfficialAccountCpService.lambdaQuery() AssetOfficialAccountCpPo one = assetOfficialAccountCpService.lambdaQuery()
.eq(AssetOfficialAccountCpPo::getAssetId, assetOfficialAccount.getId()) .eq(AssetOfficialAccountCpPo::getAssetId, assetOfficialAccount.getId())
.eq(AssetOfficialAccountCpPo::getStatus,"1") .ne(AssetOfficialAccountCpPo::getStatus, 5)
.isNotNull(AssetOfficialAccountCpPo::getTaskId) .isNotNull(AssetOfficialAccountCpPo::getTaskId)
.one(); .one();
if (one != null) { if (one != null) {
Integer status = one.getStatus();
Integer taskId = one.getTaskId();
Long appId = one.getAccountId();
BeanUtil.copyProperties(assetOfficialAccount, one); BeanUtil.copyProperties(assetOfficialAccount, one);
one.setTaskId(unitService.selectTaskId(assetOfficialAccount.getSsdw(), "2")); one.setTaskId(taskId);
one.setAssetId(assetOfficialAccount.getId()); one.setAssetId(assetOfficialAccount.getId());
one.setStatus(0); one.setStatus(status);
one.setAccountId(appId);
return assetOfficialAccountCpService.updateById(one); return assetOfficialAccountCpService.updateById(one);
}else { }else {
return true; return true;

Loading…
Cancel
Save