diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/AssetCurrentController.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/AssetCurrentController.java index 00e8a13..6146cca 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/AssetCurrentController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/AssetCurrentController.java @@ -172,30 +172,34 @@ public class AssetCurrentController extends BaseController { } assetCurrent.setGlIp(b.toString()); assetCurrentService.updateById(assetCurrent); + assetSupplyChainService.deleteByAssetIds(assetCurrent.getId()); + assetBasicNetworkService.deleteByAssetIds(assetCurrent.getId()); + assetBusinessFormService.deleteByAssetIds(assetCurrent.getId()); + unitOtherConcatService.deleteByAssetIds(assetCurrent.getId()); if (assetCurrent.getXjgywxt() != null) { assetCurrent.getXjgywxt().setAssetId(assetCurrent.getId()); - assetBusinessFormService.saveOrUpdate(assetCurrent.getXjgywxt()); + assetBusinessFormService.save(assetCurrent.getXjgywxt()); } if (!assetCurrent.getGylxxList().isEmpty()) { for (AssetSupplyChain items : assetCurrent.getGylxxList()) { items.setAssetId(assetCurrent.getId()); } //新增供应链 - assetSupplyChainService.saveOrUpdateBatch(assetCurrent.getGylxxList()); + assetSupplyChainService.saveBatch(assetCurrent.getGylxxList()); } if (!assetCurrent.getJcwlList().isEmpty()) { for (AssetBasicNetwork items : assetCurrent.getJcwlList()) { items.setAssetId(assetCurrent.getId()); } //新增基础网络 - assetBasicNetworkService.saveOrUpdateBatch(assetCurrent.getJcwlList()); + assetBasicNetworkService.saveBatch(assetCurrent.getJcwlList()); } if (!assetCurrent.getOtherConcat().isEmpty()) { for (UnitOtherConcat items : assetCurrent.getOtherConcat()) { items.setAssetId(assetCurrent.getId()); } //新增其他联系人 - unitOtherConcatService.saveOrUpdateBatch(assetCurrent.getOtherConcat()); + unitOtherConcatService.saveBatch(assetCurrent.getOtherConcat()); } return success(); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/UnitController.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/UnitController.java index dd679da..348fafb 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/UnitController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/UnitController.java @@ -121,9 +121,19 @@ public class UnitController { //新增单位到单位信息表 unitService.save(unit); //新增其他联系人 - unitOtherConcatService.saveBatch(unit.getOtherConcat()); + if(!unit.getOtherConcat().isEmpty()){ + unit.getOtherConcat().forEach(x->{ + x.setUnitId(unit.getId()); + }); + unitOtherConcatService.saveBatch(unit.getOtherConcat()); + } //新增检查信息 - examineInfoService.saveBatch(unit.getJcxxList()); + if(!unit.getJcxxList().isEmpty()){ + unit.getJcxxList().forEach(x->{ + x.setUnitId(unit.getId()); + }); + examineInfoService.saveBatch(unit.getJcxxList()); + } //查询用户表是否存在该用户 unitService.validUser(unit); return AjaxResult.success(); @@ -140,18 +150,21 @@ public class UnitController { //查询用户表是否存在该用户 unitService.validUser(x); unitService.updateById(x); + //先删除 + unitOtherConcatService.deleteByUnitIds(x.getId()); + examineInfoService.deleteByUnitIds(x.getId()); if(!x.getOtherConcat().isEmpty()){ x.getOtherConcat().forEach(y->{ y.setUnitId(x.getId()); }); + unitOtherConcatService.saveBatch(x.getOtherConcat()); } - unitOtherConcatService.saveOrUpdateBatch(x.getOtherConcat()); if(!x.getJcxxList().isEmpty()){ x.getJcxxList().forEach(y->{ y.setUnitId(x.getId()); }); + examineInfoService.saveBatch(x.getJcxxList()); } - examineInfoService.saveOrUpdateBatch(x.getJcxxList()); return AjaxResult.success(); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/ExamineInfo.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/ExamineInfo.java index 7c62e84..0f34c5d 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/ExamineInfo.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/ExamineInfo.java @@ -10,6 +10,8 @@ import io.swagger.annotations.ApiModelProperty; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDate; +import java.time.LocalDateTime; import java.util.Date; /** @@ -36,7 +38,7 @@ public class ExamineInfo extends BaseClass { @ApiModelProperty("时间") @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8") @DateTimeFormat(pattern = "yyyy-MM-dd") - private Date sj; + private LocalDate sj; /** diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/request/UnitRequest.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/request/UnitRequest.java index 9c0e2d0..d0fb404 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/request/UnitRequest.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/request/UnitRequest.java @@ -12,8 +12,8 @@ import lombok.Data; public class UnitRequest { - @ApiModelProperty("1 查询已有资产的单位") - private int isSearch; +// @ApiModelProperty("1 查询已有资产的单位") +// private String isSearch; @ApiModelProperty("统一社会信用代码") private String userName; diff --git a/ruoyi-admin/src/main/resources/mapper/UnitMapper.xml b/ruoyi-admin/src/main/resources/mapper/UnitMapper.xml index f771bde..42e420f 100644 --- a/ruoyi-admin/src/main/resources/mapper/UnitMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/UnitMapper.xml @@ -87,9 +87,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select a.* from unit_info a a.del_flag = '0' - - and a.nick_name IN (SELECT dwmc FROM asset_current); - and a.nick_name like concat('%',#{req.nickName},'%')