杜函宇 2 months ago
commit e7e2c495ee

@ -9,6 +9,10 @@ import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.tc.entity.*;
import com.ruoyi.tc.entity.po.AssetBasicNetworkCpPo;
import com.ruoyi.tc.entity.po.AssetCurrentCpPo;
import com.ruoyi.tc.entity.po.AssetSupplyChainCpPo;
import com.ruoyi.tc.entity.po.UnitOtherConcatCpPo;
import com.ruoyi.tc.entity.request.AssetCurrentPageRequest;
import com.ruoyi.tc.service.*;
import io.swagger.annotations.Api;
@ -52,6 +56,30 @@ public class AssetCurrentController extends BaseController {
@Resource
private UnitOtherConcatService unitOtherConcatService;
@Resource
private AssetTaskService assetTaskService;
@Resource
private AssetCurrentCpService assetCurrentCpService;
@Resource
private AssetBusinessFormCpService assetBusinessFormCpService;
@Resource
private AssetSupplyChainCpService assetSupplyChainCpService;
@Resource
private AssetBasicNetworkCpService assetBasicNetworkCpService;
@Resource
private UnitOtherConcatCpService unitOtherConcatCpService;
/**
*
*
@ -160,6 +188,51 @@ public class AssetCurrentController extends BaseController {
//新增其他联系人
unitOtherConcatService.saveBatch(assetCurrent.getOtherConcat());
}
// 单位有进行中的任务时,管理端新增该单位下的资产则需同步至当前进行中的任务中。
//获取新增资产id
Long id = assetCurrent.getId();
List<AssetTask> assetTasks = assetTaskService.taskList(assetCurrent.getDwmc());
if (assetTasks != null) {
for (AssetTask assetTask : assetTasks) {
//新增资产复制主表
AssetCurrentCpPo assetCurrentCpPo = new AssetCurrentCpPo();
BeanUtil.copyProperties(assetCurrent, assetCurrentCpPo);
assetCurrentCpPo.setTaskId(assetTask.getId());
assetCurrentCpService.save(assetCurrentCpPo);
//新增新监管业务形态
//根据资产id查询新监管业务形态主表id
if (assetCurrent.getXjgywxt() != null) {
assetCurrentCpPo.getXjgywxt().setAssetId(id);
assetCurrentCpPo.getXjgywxt().setTaskId(assetTask.getId());
assetBusinessFormCpService.save(assetCurrentCpPo.getXjgywxt());
}
if (!assetCurrent.getGylxxList().isEmpty()) {
for (AssetSupplyChainCpPo items : assetCurrentCpPo.getGylxxList()) {
items.setAssetId(id);
items.setTaskId(assetTask.getId());
}
//新增供应链
assetSupplyChainCpService.saveBatch(assetCurrentCpPo.getGylxxList());
}
if (!assetCurrent.getJcwlList().isEmpty()) {
for (AssetBasicNetworkCpPo items : assetCurrentCpPo.getJcwlList()) {
items.setAssetId(assetCurrent.getId());
items.setTaskId(assetTask.getId());
}
//新增基础网络
assetBasicNetworkCpService.saveBatch(assetCurrentCpPo.getJcwlList());
}
if (!assetCurrent.getOtherConcat().isEmpty()) {
for (UnitOtherConcatCpPo items : assetCurrentCpPo.getOtherConcat()) {
items.setAssetId(assetCurrent.getId());
items.setTaskId(assetTask.getId());
}
//新增其他联系人
unitOtherConcatCpService.saveBatch(assetCurrentCpPo.getOtherConcat());
}
}
}
return success();
}

@ -165,7 +165,15 @@ public interface AssetTaskMapper extends BaseMapper<AssetTask> {
* @return
*/
int updateByTaskId(@Param("taskStatus") Integer taskStatus, @Param("taskId") Integer taskId,@Param("finishTime") LocalDateTime finishTime );
int updateByTaskId(@Param("taskStatus") Integer taskStatus, @Param("taskId") Integer taskId, @Param("finishTime") LocalDateTime finishTime);
/**
*
*
* @param dwmc
* @return
*/
List<AssetTask> taskList(@Param("dwmc") String dwmc);
}

@ -12,6 +12,8 @@ import com.ruoyi.tc.entity.po.AssetCurrentCpPo;
import com.ruoyi.tc.entity.response.AssetTaskResponse;
import com.ruoyi.tc.entity.response.AssetdwHcResponse;
import java.util.List;
/**
* (AssetTask)
*
@ -95,5 +97,14 @@ public interface AssetTaskService extends IService<AssetTask> {
*
* @return
*/
Page<AssetdwHcResponse> dwHc(Page<AssetdwHcResponse> assetdwHcResponsePage,AssetdwHcRequest req);
Page<AssetdwHcResponse> dwHc(Page<AssetdwHcResponse> assetdwHcResponsePage, AssetdwHcRequest req);
/**
*
*
* @param dwmc
* @return
*/
List<AssetTask> taskList(String dwmc);
}

@ -415,4 +415,9 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
return assetTaskDao.dwHc(assetdwHcResponsePage, req);
}
@Override
public List<AssetTask> taskList(String dwmc) {
return assetTaskDao.taskList(dwmc);
}
}

@ -260,7 +260,7 @@
</if>
<if test="req.taskId!=null and req.taskId!='' ">
and task_id =#{req.taskId}
and task_id =#{req.taskId}
</if>
</where>
GROUP BY
@ -285,6 +285,15 @@
</where>
</select>
<select id="taskList" resultType="com.ruoyi.tc.entity.AssetTask">
select * from asset_task
<where>
<if test="dwmc!=null and dwmc !=''">
and dwmc =#{dwmc}
</if>
and task_status=1
</where>
</select>
<!--新增所有列-->
@ -389,7 +398,7 @@
where id = #{req.assetId} and task_id = #{req.taskId}
</update>
<update id="updateByTaskId">
update asset_task
update asset_task
<set>
<if test="taskStatus != null ">
task_status=#{taskStatus},

Loading…
Cancel
Save