@ -3,12 +3,16 @@ package com.ruoyi.tc.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page ;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page ;
import com.ruoyi.common.core.controller.BaseController ;
import com.ruoyi.common.core.controller.BaseController ;
import com.ruoyi.common.core.domain.AjaxResult ;
import com.ruoyi.common.core.domain.AjaxResult ;
import com.ruoyi.common.utils.StringUtils ;
import com.ruoyi.tc.entity.AssetCurrent ;
import com.ruoyi.tc.entity.AssetCurrent ;
import com.ruoyi.tc.entity.AssetLc ;
import com.ruoyi.tc.entity.AssetTask ;
import com.ruoyi.tc.entity.AssetTask ;
import com.ruoyi.tc.entity.po.* ;
import com.ruoyi.tc.entity.request.AssestTaskXqRequest ;
import com.ruoyi.tc.entity.request.AssestTaskXqRequest ;
import com.ruoyi.tc.entity.request.AssetCurrentShRequest ;
import com.ruoyi.tc.entity.request.AssetCurrentShRequest ;
import com.ruoyi.tc.entity.request.AssetTaskPageRequest ;
import com.ruoyi.tc.entity.request.AssetTaskPageRequest ;
import com.ruoyi.tc.entity.response.* ;
import com.ruoyi.tc.entity.response.AssestTaskXqresponse ;
import com.ruoyi.tc.entity.response.AssetTaskIdResponse ;
import com.ruoyi.tc.service.* ;
import com.ruoyi.tc.service.* ;
import io.swagger.annotations.Api ;
import io.swagger.annotations.Api ;
import io.swagger.annotations.ApiOperation ;
import io.swagger.annotations.ApiOperation ;
@ -49,6 +53,25 @@ public class AssetTaskController extends BaseController {
@Resource
@Resource
private UnitOtherConcatCpService unitOtherConcatCpService ;
private UnitOtherConcatCpService unitOtherConcatCpService ;
@Resource
private AssetCurrentJyService assetCurrentJyService ;
@Resource
private AssetBusinessFormJyService assetBusinessFormJyService ;
@Resource
private AssetSupplyChainJyService assetSupplyChainJyService ;
@Resource
AssetBasicNetworkJyService assetBasicNetworkJyService ;
@Resource
private UnitOtherConcatJyservice unitOtherConcatJyservice ;
@Resource
private AssetLcService assetLcService ;
/ * *
/ * *
* 分 页 查 询
* 分 页 查 询
*
*
@ -140,7 +163,6 @@ public class AssetTaskController extends BaseController {
@ApiOperation ( value = "资产核查信息" , response = AssestTaskXqresponse . class )
@ApiOperation ( value = "资产核查信息" , response = AssestTaskXqresponse . class )
@GetMapping ( "/zcHc" )
@GetMapping ( "/zcHc" )
public AjaxResult zcHc ( Page < AssestTaskXqresponse > page , AssestTaskXqRequest pageRequest ) {
public AjaxResult zcHc ( Page < AssestTaskXqresponse > page , AssestTaskXqRequest pageRequest ) {
return AjaxResult . success ( assetTaskService . zcHc ( page , pageRequest ) ) ;
return AjaxResult . success ( assetTaskService . zcHc ( page , pageRequest ) ) ;
}
}
@ -154,22 +176,37 @@ public class AssetTaskController extends BaseController {
@ApiOperation ( value = "单位端暂存报废" )
@ApiOperation ( value = "单位端暂存报废" )
@PostMapping ( "/zc" )
@PostMapping ( "/zc" )
@Transactional ( rollbackFor = Exception . class )
@Transactional ( rollbackFor = Exception . class )
public AjaxResult zcHc ( @RequestBody AssetCurrentResponse assetCurrent ) {
public AjaxResult zcHc ( @RequestBody AssetCurrentCpPo assetCurrent ) {
// //根据资产id和任务id删除五张表数据
//根据资产id和任务id删除五张表数据
// assetCurrentCpService.deletByAssetIdandTaskId(assetCurrent.getId(), assetCurrent.getTaskId());
assetCurrentCpService . deletByAssetIdandTaskId ( assetCurrent . getId ( ) , assetCurrent . getTaskId ( ) ) ;
// assetBusinessFormCpService.deletByAssetIdandTaskId(assetCurrent.getId(), assetCurrent.getTaskId());
assetBusinessFormCpService . deletByAssetIdandTaskId ( assetCurrent . getId ( ) , assetCurrent . getTaskId ( ) ) ;
// assetSupplyChainCpService.deletByAssetIdandTaskId(assetCurrent.getId(), assetCurrent.getTaskId());
assetSupplyChainCpService . deletByAssetIdandTaskId ( assetCurrent . getId ( ) , assetCurrent . getTaskId ( ) ) ;
// unitOtherConcatCpService.deletByAssetIdandTaskId(assetCurrent.getId(), assetCurrent.getTaskId());
unitOtherConcatCpService . deletByAssetIdandTaskId ( assetCurrent . getId ( ) , assetCurrent . getTaskId ( ) ) ;
// assetBasicNetworkCpService.deletByAssetIdandTaskId(assetCurrent.getId(), assetCurrent.getTaskId());
assetBasicNetworkCpService . deletByAssetIdandTaskId ( assetCurrent . getId ( ) , assetCurrent . getTaskId ( ) ) ;
if ( assetCurrent . getBfyy ( ) . isEmpty ( ) ) {
if ( StringUtils . isBlank ( assetCurrent . getBfyy ( ) ) ) {
//待审批
//待审批
assetCurrent . setStatus ( 1 ) ;
assetCurrent . setStatus ( 1 ) ;
} else {
} else {
//已报废
//已报废
assetCurrent . setStatus ( 5 ) ;
assetCurrent . setStatus ( 5 ) ;
}
}
assetCurrent . setGlym ( String . join ( "," , assetCurrent . getGlymList ( ) ) ) ;
StringBuilder a = new StringBuilder ( ) ;
assetCurrent . setGlIp ( String . join ( "," , assetCurrent . getGlIpList ( ) ) ) ;
if ( ! assetCurrent . getGlymList ( ) . isEmpty ( ) ) {
assetCurrent . getGlymList ( ) . forEach ( x - > {
a . append ( x ) ;
a . append ( "," ) ;
} ) ;
}
assetCurrent . setGlym ( a . toString ( ) ) ;
StringBuilder b = new StringBuilder ( ) ;
if ( ! assetCurrent . getGlIpList ( ) . isEmpty ( ) ) {
assetCurrent . getGlymList ( ) . forEach ( x - > {
b . append ( x ) ;
b . append ( "," ) ;
} ) ;
}
assetCurrent . setGlIp ( b . toString ( ) ) ;
// assetCurrent.setCurrentId(null);
assetCurrentCpService . save ( assetCurrent ) ;
assetCurrentCpService . save ( assetCurrent ) ;
//新增新监管业务形态
//新增新监管业务形态
if ( assetCurrent . getXjgywxt ( ) ! = null ) {
if ( assetCurrent . getXjgywxt ( ) ! = null ) {
@ -178,25 +215,28 @@ public class AssetTaskController extends BaseController {
assetBusinessFormCpService . save ( assetCurrent . getXjgywxt ( ) ) ;
assetBusinessFormCpService . save ( assetCurrent . getXjgywxt ( ) ) ;
}
}
if ( ! assetCurrent . getGylxxList ( ) . isEmpty ( ) ) {
if ( ! assetCurrent . getGylxxList ( ) . isEmpty ( ) ) {
for ( AssetSupplyChainCp Response items : assetCurrent . getGylxxList ( ) ) {
for ( AssetSupplyChainCp Po items : assetCurrent . getGylxxList ( ) ) {
items . setAssetId ( assetCurrent . getId ( ) ) ;
items . setAssetId ( assetCurrent . getId ( ) ) ;
items . setTaskId ( assetCurrent . getTaskId ( ) ) ;
items . setTaskId ( assetCurrent . getTaskId ( ) ) ;
}
}
//新增供应链
//新增供应链
assetSupplyChainCpService . saveBatch ( assetCurrent . getGylxxList ( ) ) ;
assetSupplyChainCpService . saveBatch ( assetCurrent . getGylxxList ( ) ) ;
}
}
if ( ! assetCurrent . getJcwlList ( ) . isEmpty ( ) ) {
if ( ! assetCurrent . getJcwlList ( ) . isEmpty ( ) ) {
for ( AssetBasicNetworkCp Response items : assetCurrent . getJcwlList ( ) ) {
for ( AssetBasicNetworkCp Po items : assetCurrent . getJcwlList ( ) ) {
items . setAssetId ( assetCurrent . getId ( ) ) ;
items . setAssetId ( assetCurrent . getId ( ) ) ;
items . setTaskId ( assetCurrent . getTaskId ( ) ) ;
items . setTaskId ( assetCurrent . getTaskId ( ) ) ;
}
}
//新增基础网络
//新增基础网络
assetBasicNetworkCpService . saveBatch ( assetCurrent . getJcwlList ( ) ) ;
assetBasicNetworkCpService . saveBatch ( assetCurrent . getJcwlList ( ) ) ;
}
}
if ( ! assetCurrent . getOtherConcat ( ) . isEmpty ( ) ) {
if ( ! assetCurrent . getOtherConcat ( ) . isEmpty ( ) ) {
for ( UnitOtherConcatCp Response items : assetCurrent . getOtherConcat ( ) ) {
for ( UnitOtherConcatCp Po items : assetCurrent . getOtherConcat ( ) ) {
items . setAssetId ( assetCurrent . getId ( ) ) ;
items . setAssetId ( assetCurrent . getId ( ) ) ;
items . setTaskId ( assetCurrent . getTaskId ( ) ) ;
items . setTaskId ( assetCurrent . getTaskId ( ) ) ;
}
}
//新增其他联系人
//新增其他联系人
unitOtherConcatCpService . saveBatch ( assetCurrent . getOtherConcat ( ) ) ;
unitOtherConcatCpService . saveBatch ( assetCurrent . getOtherConcat ( ) ) ;
@ -205,21 +245,85 @@ public class AssetTaskController extends BaseController {
}
}
/ * *
/ * *
* 单 位 端 提交
* 单 位 端 校验 提交
*
*
* @param assetCurrent 现 有 资 产 复 制 表
* @param assetCurrent 现 有 资 产 复 制 表
* @return
* @return
* /
* /
@ApiOperation ( value = "单位端 提交")
@ApiOperation ( value = "单位端 校验 提交")
@PostMapping ( "/ t j")
@PostMapping ( "/ jyT j")
@Transactional ( rollbackFor = Exception . class )
@Transactional ( rollbackFor = Exception . class )
public AjaxResult tj ( @RequestBody AssetCurrentResponse assetCurrent ) {
public AjaxResult tj ( @RequestBody AssetCurrentJyPo assetCurrent ) {
//根据资产id和任务id删除五张表数据
assetCurrentCpService . deletByAssetIdandTaskId ( assetCurrent . getId ( ) , assetCurrent . getTaskId ( ) ) ;
assetBusinessFormCpService . deletByAssetIdandTaskId ( assetCurrent . getId ( ) , assetCurrent . getTaskId ( ) ) ;
assetSupplyChainCpService . deletByAssetIdandTaskId ( assetCurrent . getId ( ) , assetCurrent . getTaskId ( ) ) ;
unitOtherConcatCpService . deletByAssetIdandTaskId ( assetCurrent . getId ( ) , assetCurrent . getTaskId ( ) ) ;
assetBasicNetworkCpService . deletByAssetIdandTaskId ( assetCurrent . getId ( ) , assetCurrent . getTaskId ( ) ) ;
//新增流程节点时间
AssetLc assetLc = new AssetLc ( ) ;
assetLc . setTaskId ( assetCurrent . getTaskId ( ) ) ;
assetLc . setAssetName ( assetCurrent . getXtmc ( ) ) ;
//当审核状态为审核不通过 单位端重新提交
if ( assetCurrent . getStatus ( ) . equals ( 4 ) ) {
assetLc . setDwcxhcTime ( LocalDateTime . now ( ) ) ;
}
return AjaxResult . success ( ) ;
StringBuilder a = new StringBuilder ( ) ;
if ( ! assetCurrent . getGlymList ( ) . isEmpty ( ) ) {
assetCurrent . getGlymList ( ) . forEach ( x - > {
a . append ( x ) ;
a . append ( "," ) ;
} ) ;
}
assetCurrent . setGlym ( a . toString ( ) ) ;
StringBuilder b = new StringBuilder ( ) ;
if ( ! assetCurrent . getGlIpList ( ) . isEmpty ( ) ) {
assetCurrent . getGlymList ( ) . forEach ( x - > {
b . append ( x ) ;
b . append ( "," ) ;
} ) ;
}
assetCurrent . setGlIp ( b . toString ( ) ) ;
assetCurrentJyService . save ( assetCurrent ) ;
//当审核状态为带待核查
if ( assetCurrent . getStatus ( ) . equals ( 1 ) ) {
assetLc . setDwhcTime ( LocalDateTime . now ( ) ) ;
}
//新增新监管业务形态
if ( assetCurrent . getXjgywxt ( ) ! = null ) {
assetCurrent . getXjgywxt ( ) . setAssetId ( assetCurrent . getId ( ) ) ;
assetCurrent . getXjgywxt ( ) . setTaskId ( assetCurrent . getTaskId ( ) ) ;
assetBusinessFormJyService . save ( assetCurrent . getXjgywxt ( ) ) ;
}
if ( ! assetCurrent . getGylxxList ( ) . isEmpty ( ) ) {
for ( AssetSupplyChainJyPo items : assetCurrent . getGylxxList ( ) ) {
items . setAssetId ( assetCurrent . getId ( ) ) ;
items . setTaskId ( assetCurrent . getTaskId ( ) ) ;
}
//新增供应链
assetSupplyChainJyService . saveBatch ( assetCurrent . getGylxxList ( ) ) ;
}
if ( ! assetCurrent . getJcwlList ( ) . isEmpty ( ) ) {
for ( AssetBasicNetworkJyPo items : assetCurrent . getJcwlList ( ) ) {
items . setAssetId ( assetCurrent . getId ( ) ) ;
items . setTaskId ( assetCurrent . getTaskId ( ) ) ;
}
//新增基础网络
assetBasicNetworkJyService . saveBatch ( assetCurrent . getJcwlList ( ) ) ;
}
if ( ! assetCurrent . getOtherConcat ( ) . isEmpty ( ) ) {
for ( UnitOtherConcatJyPo items : assetCurrent . getOtherConcat ( ) ) {
items . setAssetId ( assetCurrent . getId ( ) ) ;
items . setTaskId ( assetCurrent . getTaskId ( ) ) ;
}
//新增其他联系人
unitOtherConcatJyservice . saveBatch ( assetCurrent . getOtherConcat ( ) ) ;
}
return success ( ) ;
}
}
/ * *
/ * *
* 管 理 端 审 核
* 管 理 端 审 核
*
*
@ -231,9 +335,5 @@ public class AssetTaskController extends BaseController {
public AjaxResult sh ( @RequestBody AssetCurrentShRequest req ) {
public AjaxResult sh ( @RequestBody AssetCurrentShRequest req ) {
return AjaxResult . success ( assetTaskService . sh ( req ) ) ;
return AjaxResult . success ( assetTaskService . sh ( req ) ) ;
}
}
}
}