任务模块编写

main
dongdingding 2 months ago
parent 1912b34d3a
commit 044e41bbe7

@ -34,6 +34,7 @@ import java.time.LocalDateTime;
*/
@Api(tags = "任务主表")
@RestController
@Transactional(rollbackFor = Exception.class)
@RequestMapping("/unit/assetTask")
public class AssetTaskController extends BaseController {
/**

@ -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<AssetBasicNetwork> {
*
* @param idList
*/
void deleteIdList(List<Long> idList);
void deleteIdList(@Param("idList") List<Long> idList);
}

@ -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<AssetBusinessForm> {
*
* @param idList
*/
void deleteIdList(List<Long> idList);
void deleteIdList(@Param("idList") List<Long> idList);
}

@ -40,6 +40,6 @@ public interface AssetCurrentMapper extends BaseMapper<AssetCurrent> {
*
* @param idList
*/
void deleteIdList(List<Long> idList);
void deleteIdList(@Param("idList") List<Long> idList);
}

@ -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<AssetSupplyChain> {
*
* @param idList
*/
void deleteIdList(List<Long> idList);
void deleteIdList(@Param("idList") List<Long> idList);
}

@ -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<UnitOtherConcat>
*
* @param idList
*/
void deleteIdList(List<Long> idList);
void deleteIdList(@Param("idList") List<Long> idList);
}

@ -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<AssetTaskMapper, AssetTask
.map(AssetCurrentCpPo::getId)
.collect(Collectors.toList());
//删除原有数据
if (CollectionUtil.isNotEmpty(idList)) {
assetCurrentService.deleteIdList(idList);
}
//将子表数据复制到主表中
List<AssetCurrent> currentNewList = currentList.stream()
.map(cpPo -> {
@ -312,7 +318,10 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
.map(AssetBusinessFormCpPo::getAssetId)
.collect(Collectors.toList());
//删除原有数据
if (CollectionUtil.isNotEmpty(bussinessidList)) {
assetBusinessFormService.deleteIdList(bussinessidList);
}
//将子表数据复制到主表中
List<AssetBusinessForm> bussinessNewList = bussinessList.stream()
.map(cpPo -> {
@ -328,7 +337,10 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
.map(AssetBasicNetworkCpPo::getAssetId)
.collect(Collectors.toList());
//删除原有数据
if (CollectionUtil.isNotEmpty(netWorkidList)) {
assetBasicNetworkService.deleteIdList(netWorkidList);
}
//将子表数据复制到主表中
List<AssetBasicNetwork> netWorkNewList = netWorkList.stream()
.map(cpPo -> {
@ -344,7 +356,10 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
.map(AssetSupplyChainCpPo::getAssetId)
.collect(Collectors.toList());
//删除原有数据
if (CollectionUtil.isNotEmpty(SupplyChainidList)) {
assetSupplyChainService.deleteIdList(SupplyChainidList);
}
List<AssetSupplyChain> SupplyChainNewList = SupplyChainList.stream()
.map(cpPo -> {
AssetSupplyChain supplyChain = new AssetSupplyChain();
@ -360,7 +375,9 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
.map(UnitOtherConcatCpPo::getAssetId)
.collect(Collectors.toList());
//删除原有数据
if (CollectionUtil.isNotEmpty(UnitOtherConcatidList)) {
unitOtherConcatService.deleteIdList(UnitOtherConcatidList);
}
List<UnitOtherConcat> UnitOtherConcatNewList = UnitOtherConcatList.stream()
.map(cpPo -> {
UnitOtherConcat unitOtherConcat = new UnitOtherConcat();

@ -6,7 +6,7 @@
</update>
<delete id="deleteIdList">
DELETE FROM asset_supply_chain
WHERE id IN
WHERE asset_id IN
<foreach item="id" index="index" collection="idList" open="(" separator="," close=")">
#{id}
</foreach>

@ -12,7 +12,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update>
<delete id="deleteIdList">
DELETE FROM unit_other_contact
WHERE id IN
WHERE asset_id IN
<foreach item="id" index="index" collection="idList" open="(" separator="," close=")">
#{id}
</foreach>

@ -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();
})

Loading…
Cancel
Save