From 044e41bbe78c530b9e7eabe7d84c5be9ea2bdeb4 Mon Sep 17 00:00:00 2001 From: dongdingding <207595406@qq.com> Date: Fri, 22 Nov 2024 22:18:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E6=A8=A1=E5=9D=97=E7=BC=96?= =?UTF-8?q?=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tc/controller/AssetTaskController.java | 1 + .../tc/mapper/AssetBasicNetWorkMapper.java | 3 ++- .../tc/mapper/AssetBusinessFormMapper.java | 3 ++- .../ruoyi/tc/mapper/AssetCurrentMapper.java | 2 +- .../tc/mapper/AssetSupplyChainMapper.java | 3 ++- .../tc/mapper/UnitOtherConcatMapper.java | 3 ++- .../tc/service/impl/AssetTaskServiceImpl.java | 27 +++++++++++++++---- .../mapper/AssetSupplyChainMapper.xml | 2 +- .../main/resources/mapper/UnitOtherConcat.xml | 2 +- .../framework/config/SecurityConfig.java | 2 +- 10 files changed, 35 insertions(+), 13 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/AssetTaskController.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/AssetTaskController.java index d95c4c1..12d4155 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/AssetTaskController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/AssetTaskController.java @@ -34,6 +34,7 @@ import java.time.LocalDateTime; */ @Api(tags = "任务主表") @RestController +@Transactional(rollbackFor = Exception.class) @RequestMapping("/unit/assetTask") public class AssetTaskController extends BaseController { /** diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetBasicNetWorkMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetBasicNetWorkMapper.java index ac76f1a..1dc9425 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetBasicNetWorkMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetBasicNetWorkMapper.java @@ -2,6 +2,7 @@ package com.ruoyi.tc.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ruoyi.tc.entity.AssetBasicNetwork; +import org.apache.ibatis.annotations.Param; import java.io.Serializable; import java.util.List; @@ -27,7 +28,7 @@ public interface AssetBasicNetWorkMapper extends BaseMapper { * 删除 * @param idList */ - void deleteIdList(List idList); + void deleteIdList(@Param("idList") List idList); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetBusinessFormMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetBusinessFormMapper.java index 9af09b8..5b372d6 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetBusinessFormMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetBusinessFormMapper.java @@ -2,6 +2,7 @@ package com.ruoyi.tc.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ruoyi.tc.entity.AssetBusinessForm; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -22,6 +23,6 @@ public interface AssetBusinessFormMapper extends BaseMapper { * 删除 * @param idList */ - void deleteIdList(List idList); + void deleteIdList(@Param("idList") List idList); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetCurrentMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetCurrentMapper.java index a3c57a6..e76bc97 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetCurrentMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetCurrentMapper.java @@ -40,6 +40,6 @@ public interface AssetCurrentMapper extends BaseMapper { * 删除 * @param idList */ - void deleteIdList(List idList); + void deleteIdList(@Param("idList") List idList); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetSupplyChainMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetSupplyChainMapper.java index 86eea26..9272637 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetSupplyChainMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetSupplyChainMapper.java @@ -2,6 +2,7 @@ package com.ruoyi.tc.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ruoyi.tc.entity.AssetSupplyChain; +import org.apache.ibatis.annotations.Param; import java.io.Serializable; import java.util.List; @@ -35,6 +36,6 @@ public interface AssetSupplyChainMapper extends BaseMapper { * 删除 * @param idList */ - void deleteIdList(List idList); + void deleteIdList(@Param("idList") List idList); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/UnitOtherConcatMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/UnitOtherConcatMapper.java index e9cc1e3..6faff43 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/UnitOtherConcatMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/UnitOtherConcatMapper.java @@ -2,6 +2,7 @@ package com.ruoyi.tc.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ruoyi.tc.entity.UnitOtherConcat; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -26,5 +27,5 @@ public interface UnitOtherConcatMapper extends BaseMapper * 删除 * @param idList */ - void deleteIdList(List idList); + void deleteIdList(@Param("idList") List idList); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetTaskServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetTaskServiceImpl.java index dbfd86f..13c031b 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetTaskServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetTaskServiceImpl.java @@ -1,5 +1,6 @@ package com.ruoyi.tc.service.impl; +import cn.hutool.core.collection.CollectionUtil; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.common.utils.bean.BeanUtils; @@ -13,11 +14,13 @@ import com.ruoyi.tc.entity.response.AssetdwHcResponse; import com.ruoyi.tc.mapper.AssetTaskMapper; import com.ruoyi.tc.service.*; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; import javax.annotation.Resource; import java.time.LocalDateTime; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collection; import java.util.List; import java.util.stream.Collectors; @@ -296,7 +299,10 @@ public class AssetTaskServiceImpl extends ServiceImpl currentNewList = currentList.stream() .map(cpPo -> { @@ -312,7 +318,10 @@ public class AssetTaskServiceImpl extends ServiceImpl bussinessNewList = bussinessList.stream() .map(cpPo -> { @@ -328,7 +337,10 @@ public class AssetTaskServiceImpl extends ServiceImpl netWorkNewList = netWorkList.stream() .map(cpPo -> { @@ -344,7 +356,10 @@ public class AssetTaskServiceImpl extends ServiceImpl SupplyChainNewList = SupplyChainList.stream() .map(cpPo -> { AssetSupplyChain supplyChain = new AssetSupplyChain(); @@ -360,7 +375,9 @@ public class AssetTaskServiceImpl extends ServiceImpl UnitOtherConcatNewList = UnitOtherConcatList.stream() .map(cpPo -> { UnitOtherConcat unitOtherConcat = new UnitOtherConcat(); diff --git a/ruoyi-admin/src/main/resources/mapper/AssetSupplyChainMapper.xml b/ruoyi-admin/src/main/resources/mapper/AssetSupplyChainMapper.xml index 7d1f2f7..c2605fd 100644 --- a/ruoyi-admin/src/main/resources/mapper/AssetSupplyChainMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/AssetSupplyChainMapper.xml @@ -6,7 +6,7 @@ DELETE FROM asset_supply_chain - WHERE id IN + WHERE asset_id IN #{id} diff --git a/ruoyi-admin/src/main/resources/mapper/UnitOtherConcat.xml b/ruoyi-admin/src/main/resources/mapper/UnitOtherConcat.xml index 0cc4550..f17ea45 100644 --- a/ruoyi-admin/src/main/resources/mapper/UnitOtherConcat.xml +++ b/ruoyi-admin/src/main/resources/mapper/UnitOtherConcat.xml @@ -12,7 +12,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" DELETE FROM unit_other_contact - WHERE id IN + WHERE asset_id IN #{id} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java index dad24b0..34a0d7e 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java @@ -115,7 +115,7 @@ public class SecurityConfig // 静态资源,可匿名访问 .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll() .antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll() - .antMatchers("/unit/assetTask/**","/tc/**","/unit/assetLc/**").permitAll() +// .antMatchers("/unit/assetTask/**","/tc/**","/unit/assetLc/**","/tc/unit/**").permitAll() // 除上面外的所有请求全部需要鉴权认证 .anyRequest().authenticated(); })