|
|
|
@ -6,12 +6,14 @@ 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.AssetTask;
|
|
|
|
|
import com.ruoyi.tc.entity.Unit;
|
|
|
|
|
import com.ruoyi.tc.entity.po.AssetAppCpPo;
|
|
|
|
|
import com.ruoyi.tc.entity.request.AssetAppPageRequest;
|
|
|
|
|
import com.ruoyi.tc.mapper.AssetAppMapper;
|
|
|
|
|
import com.ruoyi.tc.service.AssetAppCpService;
|
|
|
|
|
import com.ruoyi.tc.service.AssetAppService;
|
|
|
|
|
import com.ruoyi.tc.service.AssetTaskService;
|
|
|
|
|
import com.ruoyi.tc.service.UnitService;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
@ -32,6 +34,8 @@ public class AssetAppServiceImpl extends ServiceImpl<AssetAppMapper, AssetApp> i
|
|
|
|
|
@Resource
|
|
|
|
|
private AssetAppCpService assetAppCpService;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private AssetTaskService assetTaskService;
|
|
|
|
|
/**
|
|
|
|
|
* 分页查询所有数据
|
|
|
|
|
*
|
|
|
|
@ -112,7 +116,15 @@ public class AssetAppServiceImpl extends ServiceImpl<AssetAppMapper, AssetApp> i
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public Boolean edit(AssetApp assetApp) {
|
|
|
|
|
AssetApp byId = getById(assetApp.getId());
|
|
|
|
|
|
|
|
|
|
List<Unit> list1 = unitService.lambdaQuery().eq(Unit::getNickName, assetApp.getSsdw()).eq(Unit::getDelFlag, 0).list();
|
|
|
|
|
if (list1 == null || list1.isEmpty()) {
|
|
|
|
|
throw new ServiceException("请选择已有单位!");
|
|
|
|
|
}
|
|
|
|
|
updateById(assetApp);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<AssetAppCpPo> list = assetAppCpService.lambdaQuery()
|
|
|
|
|
.eq(AssetAppCpPo::getAssetId, assetApp.getId()).list();
|
|
|
|
|
list.forEach(x -> {
|
|
|
|
|