Compare commits

..

No commits in common. '0a8be55162203947da3a078a0ceed8e3a846661b' and 'ac4db0939e50a9ddb08f64c04e1f940c9b849e0c' have entirely different histories.

@ -156,10 +156,9 @@ public class AssetAppController extends BaseController {
//如果有任务也修改任务这边 //如果有任务也修改任务这边
AssetAppJyPo one = assetAppJyService.lambdaQuery() AssetAppJyPo one = assetAppJyService.lambdaQuery()
.isNotNull(AssetAppJyPo::getTaskId) .isNotNull(AssetAppJyPo::getTaskId)
.ne(AssetAppJyPo::getStatus, 5) .eq(AssetAppJyPo::getStatus,"1")
.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);
@ -167,7 +166,6 @@ 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,11 +144,6 @@ 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 -> {
@ -447,34 +442,32 @@ public class AssetCurrentController extends BaseController {
//如果有任务也修改任务这边 //如果有任务也修改任务这边
AssetCurrentCpPo one = assetCurrentCpService.lambdaQuery() AssetCurrentCpPo one = assetCurrentCpService.lambdaQuery()
.isNotNull(AssetCurrentCpPo::getTaskId) .isNotNull(AssetCurrentCpPo::getTaskId)
.ne(AssetCurrentCpPo::getStatus, 5) .eq(AssetCurrentCpPo::getStatus,"1")
.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 -> {
@ -567,37 +560,35 @@ 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("task_id", i); queryWrapper1.eq("status","1");
queryWrapper1.ne("status", 5); queryWrapper1.eq("task_id",i);
AssetCurrentCpPo x = assetCurrentCpService.getOne(queryWrapper1); assetCurrentCpService.remove(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.setCurrentId(currentId); assetCurrentCpPo.setStatus(1);
assetCurrentCpPo.setStatus(status); assetCurrentCpService.save(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); 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) {
@ -629,6 +620,7 @@ public class AssetCurrentController extends BaseController {
//新增其他联系人 //新增其他联系人
unitOtherConcatCpService.saveBatch(assetCurrentCpPo.getOtherConcat()); unitOtherConcatCpService.saveBatch(assetCurrentCpPo.getOtherConcat());
} }
} }
return success(); return success();
} }
@ -709,9 +701,7 @@ 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);
@ -725,11 +715,6 @@ 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,10 +150,9 @@ public class AssetEmailController extends BaseController {
//如果有任务也修改任务这边 //如果有任务也修改任务这边
AssetEmailJyPo one = assetEmailJyService.lambdaQuery() AssetEmailJyPo one = assetEmailJyService.lambdaQuery()
.isNotNull(AssetEmailJyPo::getTaskId) .isNotNull(AssetEmailJyPo::getTaskId)
.ne(AssetEmailJyPo::getStatus, 5) .eq(AssetEmailJyPo::getStatus,"1")
.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);
@ -161,7 +160,6 @@ 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,7 +13,6 @@ 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;
@ -153,18 +152,16 @@ public class AssetMiniProgramsController extends BaseController {
//如果有任务也修改任务这边 //如果有任务也修改任务这边
AssetMiniProgramsJyPo one = assetMiniProgramsJyService.lambdaQuery() AssetMiniProgramsJyPo one = assetMiniProgramsJyService.lambdaQuery()
.isNotNull(AssetMiniProgramsJyPo::getTaskId) .isNotNull(AssetMiniProgramsJyPo::getTaskId)
.ne(AssetMiniProgramsJyPo::getStatus, 5) .eq(AssetMiniProgramsJyPo::getStatus,"1")
.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,10 +166,9 @@ public class AssetOfficialAccountController {
//如果有任务也修改任务这边 //如果有任务也修改任务这边
AssetOfficialAccountJyPo one = assetOfficialAccountJyService.lambdaQuery() AssetOfficialAccountJyPo one = assetOfficialAccountJyService.lambdaQuery()
.isNotNull(AssetOfficialAccountJyPo::getTaskId) .isNotNull(AssetOfficialAccountJyPo::getTaskId)
.ne(AssetOfficialAccountJyPo::getStatus, 5) .eq(AssetOfficialAccountJyPo::getStatus,"1")
.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);
@ -177,7 +176,6 @@ 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,9 +4,7 @@ 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;
@ -89,11 +87,6 @@ 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);
@ -118,18 +111,14 @@ 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())
.ne(AssetAppCpPo::getStatus, 5) .eq(AssetAppCpPo::getStatus,"1")
.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.setStatus(status); one.setTaskId(unitService.selectTaskId(assetApp.getSsdw(), "4"));
one.setTaskId(taskId);
one.setAssetId(assetApp.getId()); one.setAssetId(assetApp.getId());
one.setAppId(appId); one.setStatus(0);
return assetAppCpService.updateById(one); return assetAppCpService.updateById(one);
}else { }else {
return true; return true;

@ -4,9 +4,7 @@ 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;
@ -89,11 +87,6 @@ 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);
@ -117,17 +110,13 @@ 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())
.ne(AssetEmailCpPo::getStatus, 5) .eq(AssetEmailCpPo::getStatus,"1")
.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.setStatus(status); one.setTaskId(unitService.selectTaskId(assetEmail.getSsdw(), "3"));
one.setTaskId(taskId);
one.setAssetId(assetEmail.getId()); one.setAssetId(assetEmail.getId());
one.setEmailId(appId); one.setStatus(0);
return assetEmailCpService.updateById(one); return assetEmailCpService.updateById(one);
}else { }else {
return true; return true;

@ -4,10 +4,7 @@ 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;
@ -82,11 +79,6 @@ 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);
@ -110,17 +102,13 @@ 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())
.ne(AssetMiniProgramsCpPo::getStatus, 5) .eq(AssetMiniProgramsCpPo::getStatus,"1")
.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(taskId); one.setTaskId(unitService.selectTaskId(assetMiniPrograms.getSsdw(),"1"));
one.setAssetId(assetMiniPrograms.getId()); one.setAssetId(assetMiniPrograms.getId());
one.setStatus(status); one.setStatus(0);
one.setMiniId(miniId);
return assetMiniProgramsCpService.updateById(one); return assetMiniProgramsCpService.updateById(one);
}else{ }else{
return true; return true;

@ -4,10 +4,7 @@ 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;
@ -86,11 +83,6 @@ 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);
@ -114,18 +106,14 @@ 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())
.ne(AssetOfficialAccountCpPo::getStatus, 5) .eq(AssetOfficialAccountCpPo::getStatus,"1")
.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(taskId); one.setTaskId(unitService.selectTaskId(assetOfficialAccount.getSsdw(), "2"));
one.setAssetId(assetOfficialAccount.getId()); one.setAssetId(assetOfficialAccount.getId());
one.setStatus(status); one.setStatus(0);
one.setAccountId(appId);
return assetOfficialAccountCpService.updateById(one); return assetOfficialAccountCpService.updateById(one);
}else { }else {
return true; return true;

Loading…
Cancel
Save