|
|
|
@ -2,6 +2,7 @@ package com.ruoyi.tc.controller;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
|
import com.ruoyi.common.annotation.Log;
|
|
|
|
|
import com.ruoyi.common.core.controller.BaseController;
|
|
|
|
@ -10,17 +11,15 @@ import com.ruoyi.common.enums.BusinessType;
|
|
|
|
|
import com.ruoyi.common.exception.ServiceException;
|
|
|
|
|
import com.ruoyi.common.utils.SecurityUtils;
|
|
|
|
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
|
|
|
import com.ruoyi.tc.entity.AssetApp;
|
|
|
|
|
import com.ruoyi.tc.entity.AssetTask;
|
|
|
|
|
import com.ruoyi.tc.entity.po.AssetAppCpPo;
|
|
|
|
|
import com.ruoyi.tc.entity.po.AssetAppJyPo;
|
|
|
|
|
import com.ruoyi.tc.entity.*;
|
|
|
|
|
import com.ruoyi.tc.entity.po.*;
|
|
|
|
|
import com.ruoyi.tc.entity.request.Acomma;
|
|
|
|
|
import com.ruoyi.tc.entity.request.AssetAppPageRequest;
|
|
|
|
|
import com.ruoyi.tc.entity.request.AssetAuditPageRequest;
|
|
|
|
|
import com.ruoyi.tc.entity.request.AssetAuditRequest;
|
|
|
|
|
import com.ruoyi.tc.service.AssetAppCpService;
|
|
|
|
|
import com.ruoyi.tc.service.AssetAppJyService;
|
|
|
|
|
import com.ruoyi.tc.service.AssetAppService;
|
|
|
|
|
import com.ruoyi.tc.service.AssetTaskService;
|
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
|
@ -31,8 +30,12 @@ import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
import javax.validation.Valid;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
import static com.ruoyi.common.core.domain.AjaxResult.success;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 资产移动应用程序表(asset_app)表控制层
|
|
|
|
|
*
|
|
|
|
@ -57,6 +60,8 @@ public class AssetAppController extends BaseController {
|
|
|
|
|
@Resource
|
|
|
|
|
private AssetAppCpService assetAppCpService;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private UnitService unitService;
|
|
|
|
|
/**
|
|
|
|
|
* 分页查询
|
|
|
|
|
*
|
|
|
|
@ -79,7 +84,6 @@ public class AssetAppController extends BaseController {
|
|
|
|
|
return success(assetAppService.page(page, req));
|
|
|
|
|
}
|
|
|
|
|
//=================================================
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 单位自编辑进行校验
|
|
|
|
|
*/
|
|
|
|
@ -87,8 +91,20 @@ public class AssetAppController extends BaseController {
|
|
|
|
|
@PreAuthorize("@ss.hasAnyRoles('unit')")
|
|
|
|
|
@PostMapping("/unitEdit")
|
|
|
|
|
public AjaxResult unitEdit(@RequestBody @Valid AssetAppJyPo assetAppJyPo) {
|
|
|
|
|
AssetAppJyPo one = assetAppJyService.lambdaQuery().eq(AssetAppJyPo::getAppName, assetAppJyPo.getAppName())
|
|
|
|
|
.eq(AssetAppJyPo::getSsdw, assetAppJyPo.getSsdw()).isNull(AssetAppJyPo::getTaskId).one();
|
|
|
|
|
List<Unit> list = unitService.lambdaQuery().eq(Unit::getNickName, assetAppJyPo.getSsdw()).eq(Unit::getDelFlag, 0).list();
|
|
|
|
|
if (list == null || list.isEmpty()) {
|
|
|
|
|
throw new ServiceException("请选择已有单位!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<AssetApp> list1 = assetAppService.lambdaQuery().eq(AssetApp::getSsdw, assetAppJyPo.getSsdw())
|
|
|
|
|
.eq(AssetApp::getAppName, assetAppJyPo.getAppName()).list();
|
|
|
|
|
if (list1 != null&& !list1.isEmpty()){
|
|
|
|
|
throw new ServiceException("不允许新增重复资产!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AssetAppJyPo one = assetAppJyService.lambdaQuery().eq(AssetAppJyPo::getAppName,assetAppJyPo.getAppName())
|
|
|
|
|
.eq(AssetAppJyPo::getSsdw,assetAppJyPo.getSsdw()).isNull(AssetAppJyPo::getTaskId).one();
|
|
|
|
|
assetAppJyPo.setAuditState("1");
|
|
|
|
|
assetAppJyPo.setAuditYy(null);
|
|
|
|
|
if (one != null) {
|
|
|
|
@ -161,7 +177,7 @@ public class AssetAppController extends BaseController {
|
|
|
|
|
.isNotNull(AssetAppJyPo::getTaskId)
|
|
|
|
|
.ne(AssetAppJyPo::getStatus, 5)
|
|
|
|
|
.eq(AssetAppJyPo::getAssetId, byId.getAssetId()).one();
|
|
|
|
|
if (one != null) {
|
|
|
|
|
if(one!=null){
|
|
|
|
|
Integer status = one.getStatus();
|
|
|
|
|
Integer taskId = one.getTaskId();
|
|
|
|
|
Long appId = one.getAppId();
|
|
|
|
|