main
杜函宇 2 months ago
parent 09b1bb6259
commit 50bfa2575e

@ -172,30 +172,34 @@ public class AssetCurrentController extends BaseController {
} }
assetCurrent.setGlIp(b.toString()); assetCurrent.setGlIp(b.toString());
assetCurrentService.updateById(assetCurrent); assetCurrentService.updateById(assetCurrent);
assetSupplyChainService.deleteByAssetIds(assetCurrent.getId());
assetBasicNetworkService.deleteByAssetIds(assetCurrent.getId());
assetBusinessFormService.deleteByAssetIds(assetCurrent.getId());
unitOtherConcatService.deleteByAssetIds(assetCurrent.getId());
if (assetCurrent.getXjgywxt() != null) { if (assetCurrent.getXjgywxt() != null) {
assetCurrent.getXjgywxt().setAssetId(assetCurrent.getId()); assetCurrent.getXjgywxt().setAssetId(assetCurrent.getId());
assetBusinessFormService.saveOrUpdate(assetCurrent.getXjgywxt()); assetBusinessFormService.save(assetCurrent.getXjgywxt());
} }
if (!assetCurrent.getGylxxList().isEmpty()) { if (!assetCurrent.getGylxxList().isEmpty()) {
for (AssetSupplyChain items : assetCurrent.getGylxxList()) { for (AssetSupplyChain items : assetCurrent.getGylxxList()) {
items.setAssetId(assetCurrent.getId()); items.setAssetId(assetCurrent.getId());
} }
//新增供应链 //新增供应链
assetSupplyChainService.saveOrUpdateBatch(assetCurrent.getGylxxList()); assetSupplyChainService.saveBatch(assetCurrent.getGylxxList());
} }
if (!assetCurrent.getJcwlList().isEmpty()) { if (!assetCurrent.getJcwlList().isEmpty()) {
for (AssetBasicNetwork items : assetCurrent.getJcwlList()) { for (AssetBasicNetwork items : assetCurrent.getJcwlList()) {
items.setAssetId(assetCurrent.getId()); items.setAssetId(assetCurrent.getId());
} }
//新增基础网络 //新增基础网络
assetBasicNetworkService.saveOrUpdateBatch(assetCurrent.getJcwlList()); assetBasicNetworkService.saveBatch(assetCurrent.getJcwlList());
} }
if (!assetCurrent.getOtherConcat().isEmpty()) { if (!assetCurrent.getOtherConcat().isEmpty()) {
for (UnitOtherConcat items : assetCurrent.getOtherConcat()) { for (UnitOtherConcat items : assetCurrent.getOtherConcat()) {
items.setAssetId(assetCurrent.getId()); items.setAssetId(assetCurrent.getId());
} }
//新增其他联系人 //新增其他联系人
unitOtherConcatService.saveOrUpdateBatch(assetCurrent.getOtherConcat()); unitOtherConcatService.saveBatch(assetCurrent.getOtherConcat());
} }
return success(); return success();
} }

@ -121,9 +121,19 @@ public class UnitController {
//新增单位到单位信息表 //新增单位到单位信息表
unitService.save(unit); unitService.save(unit);
//新增其他联系人 //新增其他联系人
if(!unit.getOtherConcat().isEmpty()){
unit.getOtherConcat().forEach(x->{
x.setUnitId(unit.getId());
});
unitOtherConcatService.saveBatch(unit.getOtherConcat()); unitOtherConcatService.saveBatch(unit.getOtherConcat());
}
//新增检查信息 //新增检查信息
if(!unit.getJcxxList().isEmpty()){
unit.getJcxxList().forEach(x->{
x.setUnitId(unit.getId());
});
examineInfoService.saveBatch(unit.getJcxxList()); examineInfoService.saveBatch(unit.getJcxxList());
}
//查询用户表是否存在该用户 //查询用户表是否存在该用户
unitService.validUser(unit); unitService.validUser(unit);
return AjaxResult.success(); return AjaxResult.success();
@ -140,18 +150,21 @@ public class UnitController {
//查询用户表是否存在该用户 //查询用户表是否存在该用户
unitService.validUser(x); unitService.validUser(x);
unitService.updateById(x); unitService.updateById(x);
//先删除
unitOtherConcatService.deleteByUnitIds(x.getId());
examineInfoService.deleteByUnitIds(x.getId());
if(!x.getOtherConcat().isEmpty()){ if(!x.getOtherConcat().isEmpty()){
x.getOtherConcat().forEach(y->{ x.getOtherConcat().forEach(y->{
y.setUnitId(x.getId()); y.setUnitId(x.getId());
}); });
unitOtherConcatService.saveBatch(x.getOtherConcat());
} }
unitOtherConcatService.saveOrUpdateBatch(x.getOtherConcat());
if(!x.getJcxxList().isEmpty()){ if(!x.getJcxxList().isEmpty()){
x.getJcxxList().forEach(y->{ x.getJcxxList().forEach(y->{
y.setUnitId(x.getId()); y.setUnitId(x.getId());
}); });
examineInfoService.saveBatch(x.getJcxxList());
} }
examineInfoService.saveOrUpdateBatch(x.getJcxxList());
return AjaxResult.success(); return AjaxResult.success();
} }

@ -10,6 +10,8 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date; import java.util.Date;
/** /**
@ -36,7 +38,7 @@ public class ExamineInfo extends BaseClass {
@ApiModelProperty("时间") @ApiModelProperty("时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8") @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd") @DateTimeFormat(pattern = "yyyy-MM-dd")
private Date sj; private LocalDate sj;
/** /**

@ -12,8 +12,8 @@ import lombok.Data;
public class UnitRequest { public class UnitRequest {
@ApiModelProperty("1 查询已有资产的单位") // @ApiModelProperty("1 查询已有资产的单位")
private String isSearch; // private String isSearch;
@ApiModelProperty("统一社会信用代码") @ApiModelProperty("统一社会信用代码")
private String userName; private String userName;

@ -87,9 +87,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select a.* from unit_info a select a.* from unit_info a
<where> <where>
a.del_flag = '0' a.del_flag = '0'
<if test="req.isSearch == '1' ">
and a.nick_name IN (SELECT dwmc FROM asset_current);
</if>
<if test="req.nickName != null and req.nickName != '' "> <if test="req.nickName != null and req.nickName != '' ">
and a.nick_name like concat('%',#{req.nickName},'%') and a.nick_name like concat('%',#{req.nickName},'%')
</if> </if>

Loading…
Cancel
Save