This commit is contained in:
张秉卓
2025-10-30 15:36:17 +08:00
20 changed files with 206 additions and 115 deletions

View File

@ -43,7 +43,6 @@ public class LngBPortPageVo {
* 所属国家和地区
*/
@ApiModelProperty("所属国家和地区")
@Trans(type = TransType.CASCADE, id = "0772d128d20f4f80aaafc784adba338a", separator = "/", showFormat = "all")
private String regionCode;
/**
* 吞吐量

View File

@ -185,7 +185,8 @@ public class LngBStationPngVo {
private Long ruleUserId;
@ApiModelProperty("")
private String staNameLng;
}

View File

@ -65,14 +65,19 @@ public class BankController {
LambdaQueryWrapper<LngBBank> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper
.like(StrUtil.isNotBlank(dto.getShortName()),LngBBank::getShortName,dto.getShortName())
.and(
StrUtil.isNotBlank(dto.getShortName()), r ->
r.like(LngBBank::getShortName, dto.getShortName())
.or()
.like(LngBBank::getFullName, dto.getShortName())
)
.like(StrUtil.isNotBlank(dto.getBankCode()),LngBBank::getBankCode,dto.getBankCode())
.like(StrUtil.isNotBlank(dto.getRegionCode()),LngBBank::getRegionCode,dto.getRegionCode())
.like(StrUtil.isNotBlank(dto.getValid()),LngBBank::getValid,dto.getValid())
.like(StrUtil.isNotBlank(dto.getFullName()),LngBBank::getFullName,dto.getFullName())
// .like(StrUtil.isNotBlank(dto.getFullName()),LngBBank::getFullName,dto.getFullName())
.like(StrUtil.isNotBlank(dto.getCode()),LngBBank::getCode,dto.getCode())
.like(StrUtil.isNotBlank(dto.getSwift()),LngBBank::getSwift,dto.getSwift())
.orderByDesc(LngBBank::getId)
.orderByAsc(LngBBank::getSort,LngBBank::getCode)
.select(LngBBank.class,x -> VoToColumnUtil.fieldsToColumns(LngBBankPageVo.class).contains(x.getProperty()));
IPage<LngBBank> page = bankService.page(ConventPage.getPage(dto), queryWrapper);
PageOutput<LngBBankPageVo> pageOutput = ConventPage.getPageOutput(page, LngBBankPageVo.class);

View File

@ -72,8 +72,7 @@ public class CountryRegionController {
.eq(ObjectUtil.isNotNull(dto.getPid()),LngBRegion::getPid,dto.getPid())
.like(StrUtil.isNotBlank(dto.getFullPath()),LngBRegion::getFullPath,dto.getFullPath())
.like(StrUtil.isNotBlank(dto.getValid()),LngBRegion::getValid,dto.getValid())
.like(StrUtil.isNotBlank(dto.getNote()),LngBRegion::getNote,dto.getNote())
.orderByDesc(LngBRegion::getId)
.orderByAsc(LngBRegion::getCode)
.select(LngBRegion.class,x -> VoToColumnUtil.fieldsToColumns(LngBRegionPageVo.class).contains(x.getProperty()));
IPage<LngBRegion> page = countryRegionService.page(ConventPage.getPage(dto), queryWrapper);
PageOutput<LngBRegionPageVo> pageOutput = ConventPage.getPageOutput(page, LngBRegionPageVo.class);
@ -171,11 +170,23 @@ public class CountryRegionController {
@GetMapping("/child")
@ApiOperation(value = "根据id 查询下级区域")
public R getRegionByParentId(@RequestParam(required = false) Long pid, @RequestParam(required = false) String keyword) {
public R getRegionByParentId(@RequestParam(required = false) Long pid,@RequestParam(required = false) String excludeType, @RequestParam(required = false) String keyword
) {
List<Long> pidList = CollectionUtils.newArrayList();
if(StrUtil.isNotBlank(excludeType) && (pid == null || pid ==0) ){
List<LngBRegion> pList = countryRegionService.list(Wrappers.<LngBRegion>query()
.lambda().eq(LngBRegion::getRegionTypeCode, excludeType));
if(pList != null && pList.size() > 0) {
for(LngBRegion p:pList) {
pidList.add(p.getId());
}
}
}
List<LngBRegion> regionList = countryRegionService.list(Wrappers.<LngBRegion>query().lambda()
.eq(pid != null, LngBRegion::getPid, pid)
.eq(LngBRegion::getValid, ValidEnum.ENABLE.getCode())
.eq(pid == null, LngBRegion::getPid, GlobalConstant.FIRST_NODE_VALUE)
.in(pid == null, LngBRegion::getPid, pidList)
//.ne(StrUtil.isNotBlank(excludeType), LngBRegion::getRegionTypeCode, excludeType)
.and(StrUtil.isNotBlank(keyword), x -> {
x.like(StrUtil.isNotBlank(keyword), LngBRegion::getFullName, keyword);
}));
@ -185,7 +196,7 @@ public class CountryRegionController {
for(LngBRegion br:regionList) {
LngBRegionVo vo = new LngBRegionVo();
BeanUtil.copyProperties(br, vo);
Long parentId = br.getPid();
Long parentId = br.getId();
if(parentId == null) {
parentId = 0L;
}

View File

@ -1,38 +1,39 @@
package com.xjrsoft.module.mdm.controller;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import java.util.List;
import javax.validation.Valid;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.xjrsoft.common.constant.GlobalConstant;
import com.baomidou.mybatisplus.core.toolkit.StringPool;
import com.xjrsoft.common.model.result.R;
import com.xjrsoft.common.page.ConventPage;
import com.xjrsoft.common.page.PageOutput;
import com.xjrsoft.common.model.result.R;
import com.xjrsoft.common.utils.VoToColumnUtil;
import com.xjrsoft.module.mdm.dto.AddLngBFeeDto;
import com.xjrsoft.module.mdm.dto.UpdateLngBFeeDto;
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.xjrsoft.module.datalog.service.DatalogService;
import com.xjrsoft.module.datalog.vo.DataChangeLogVo;
import com.xjrsoft.module.mdm.dto.LngBFeePageDto;
import com.xjrsoft.module.mdm.dto.UpdateLngBBankDto;
import com.xjrsoft.module.mdm.dto.UpdateLngBFeeDto;
import com.xjrsoft.module.mdm.entity.LngBFee;
import com.xjrsoft.module.mdm.service.IExpenseNameService;
import com.xjrsoft.module.mdm.vo.LngBFeePageVo;
import com.xjrsoft.module.datalog.service.DatalogService;
import com.xjrsoft.module.datalog.vo.DataChangeLogVo;
import com.xjrsoft.module.mdm.vo.LngBFeeVo;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.StrUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.util.List;
/**
* @title: 费用名称
@ -60,9 +61,8 @@ public class ExpenseNameController {
.like(StrUtil.isNotBlank(dto.getFullName()),LngBFee::getFullName,dto.getFullName())
.like(StrUtil.isNotBlank(dto.getValid()),LngBFee::getValid,dto.getValid())
.like(StrUtil.isNotBlank(dto.getCode()),LngBFee::getCode,dto.getCode())
//.like(StrUtil.isNotBlank(dto.getSort()),LngBFee::getSort,dto.getSort())
.like(StrUtil.isNotBlank(dto.getNote()),LngBFee::getNote,dto.getNote())
.orderByDesc(LngBFee::getId)
.orderByAsc(LngBFee::getSort,LngBFee::getCode)
.select(LngBFee.class,x -> VoToColumnUtil.fieldsToColumns(LngBFeePageVo.class).contains(x.getProperty()));
IPage<LngBFee> page = expenseNameService.page(ConventPage.getPage(dto), queryWrapper);
PageOutput<LngBFeePageVo> pageOutput = ConventPage.getPageOutput(page, LngBFeePageVo.class);

View File

@ -5,6 +5,7 @@ import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.pictc.utils.CollectionUtils;
import com.xjrsoft.common.model.result.R;
import com.xjrsoft.common.page.ConventPage;
import com.xjrsoft.common.page.PageOutput;
@ -15,6 +16,7 @@ import com.xjrsoft.module.mdm.dto.LngBStationLngPageDto;
import com.xjrsoft.module.mdm.dto.UpdateLngBStationLngDto;
import com.xjrsoft.module.mdm.entity.LngBStationLng;
import com.xjrsoft.module.mdm.service.ILNGStationService;
import com.xjrsoft.module.mdm.vo.LngBRegionTreeVo;
import com.xjrsoft.module.mdm.vo.LngBStationLngPageVo;
import com.xjrsoft.module.mdm.vo.LngBStationLngVo;
import io.swagger.annotations.Api;
@ -110,4 +112,23 @@ public class LNGStationController {
public R disable(@Valid @RequestBody List<Long> ids){
return R.ok(lNGStationService.disable(ids));
}
@GetMapping(value = "/list")
@ApiOperation(value="LngBStationLng列表(不分页)")
public R list(@Valid LngBStationLngPageDto dto){
LambdaQueryWrapper<LngBStationLng> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper
.like(StrUtil.isNotBlank(dto.getFullName()), LngBStationLng::getFullName, dto.getFullName())
.eq(StrUtil.isNotBlank(dto.getValid()), LngBStationLng::getValid, dto.getValid())
.eq(StrUtil.isNotBlank(dto.getOwnSign()), LngBStationLng::getOwnSign, dto.getOwnSign())
.orderByAsc(LngBStationLng::getSort, LngBStationLng::getCode);
List<LngBStationLng> list = lNGStationService.list(queryWrapper);
List<LngBStationLngVo> voList = CollectionUtils.newArrayList();
for(LngBStationLng s:list) {
LngBStationLngVo vo = new LngBStationLngVo();
BeanUtil.copyProperties(s, vo);
voList.add(vo);
}
return R.ok(voList);
}
}

View File

@ -22,10 +22,11 @@ import com.xjrsoft.common.utils.VoToColumnUtil;
import com.xjrsoft.module.datalog.service.DatalogService;
import com.xjrsoft.module.datalog.vo.DataChangeLogVo;
import com.xjrsoft.module.mdm.dto.LngBStationPngPageDto;
import com.xjrsoft.module.mdm.dto.UpdateLngBBankDto;
import com.xjrsoft.module.mdm.dto.UpdateLngBStationPngDto;
import com.xjrsoft.module.mdm.entity.LngBPngLine;
import com.xjrsoft.module.mdm.entity.LngBStationPng;
import com.xjrsoft.module.mdm.service.IPipeGasDownloadPointService;
import com.xjrsoft.module.mdm.service.IPipelineGgasLineService;
import com.xjrsoft.module.mdm.vo.LngBStationPngPageVo;
import com.xjrsoft.module.mdm.vo.LngBStationPngVo;
@ -51,6 +52,8 @@ public class PipeGasDownloadPointController {
private final IPipeGasDownloadPointService pipeGasDownloadPointService;
private final DatalogService dataService;
private final IPipelineGgasLineService pipelineGgasLineService ;
@GetMapping(value = "/page")
@ApiOperation(value="LngBStationPng列表(分页)")
@ -63,19 +66,14 @@ public class PipeGasDownloadPointController {
.like(StrUtil.isNotBlank(dto.getFullName()),LngBStationPng::getFullName,dto.getFullName())
.like(StrUtil.isNotBlank(dto.getPipelineCode()),LngBStationPng::getPipelineCode,dto.getPipelineCode())
.like(StrUtil.isNotBlank(dto.getEnterprise()),LngBStationPng::getEnterprise,dto.getEnterprise())
.like(StrUtil.isNotBlank(dto.getContact()),LngBStationPng::getContact,dto.getContact())
.like(StrUtil.isNotBlank(dto.getTel()),LngBStationPng::getTel,dto.getTel())
.like(StrUtil.isNotBlank(dto.getEmail()),LngBStationPng::getEmail,dto.getEmail())
.like(StrUtil.isNotBlank(dto.getRegionCode()),LngBStationPng::getRegionCode,dto.getRegionCode())
.like(StrUtil.isNotBlank(dto.getAddr()),LngBStationPng::getAddr,dto.getAddr())
.like(StrUtil.isNotBlank(dto.getAddrMail()),LngBStationPng::getAddrMail,dto.getAddrMail())
.like(StrUtil.isNotBlank(dto.getOwnSign()),LngBStationPng::getOwnSign,dto.getOwnSign())
.like(StrUtil.isNotBlank(dto.getStaCodeLng()),LngBStationPng::getStaCodeLng,dto.getStaCodeLng())
.like(StrUtil.isNotBlank(dto.getOwnLineSign()),LngBStationPng::getOwnLineSign,dto.getOwnLineSign())
//.like(StrUtil.isNotBlank(dto.getSort()),LngBStationPng::getSort,dto.getSort())
.like(StrUtil.isNotBlank(dto.getValid()),LngBStationPng::getValid,dto.getValid())
.like(StrUtil.isNotBlank(dto.getNote()),LngBStationPng::getNote,dto.getNote())
.orderByDesc(LngBStationPng::getId)
.orderByAsc(LngBStationPng::getSort,LngBStationPng::getCode)
.select(LngBStationPng.class,x -> VoToColumnUtil.fieldsToColumns(LngBStationPngPageVo.class).contains(x.getProperty()));
IPage<LngBStationPng> page = pipeGasDownloadPointService.page(ConventPage.getPage(dto), queryWrapper);
PageOutput<LngBStationPngPageVo> pageOutput = ConventPage.getPageOutput(page, LngBStationPngPageVo.class);
@ -90,7 +88,13 @@ public class PipeGasDownloadPointController {
if (lngBStationPng == null) {
return R.error("找不到此数据!");
}
return R.ok(BeanUtil.toBean(lngBStationPng, LngBStationPngVo.class));
LngBStationPngVo vo = new LngBStationPngVo();
BeanUtil.copyProperties(lngBStationPng,vo);
LngBPngLine bl = pipelineGgasLineService.getByCode(vo.getCode());
if(bl != null) {
vo.setStaNameLng(bl.getFullName());
}
return R.ok(vo);
}
@ -135,7 +139,7 @@ public class PipeGasDownloadPointController {
@ApiOperation(value="根据id查询LngBStationPng数据详细日志")
@SaCheckPermission("pipeGasDownloadPoint:datalog")
public R datalog(@RequestParam Long id){
List<DataChangeLogVo> logs = dataService.findLogsByEntityId(UpdateLngBBankDto.class,id);
List<DataChangeLogVo> logs = dataService.findLogsByEntityId(UpdateLngBStationPngDto.class,id);
return R.ok(logs);
}

View File

@ -1,38 +1,39 @@
package com.xjrsoft.module.mdm.controller;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import java.util.List;
import javax.validation.Valid;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.xjrsoft.common.constant.GlobalConstant;
import com.baomidou.mybatisplus.core.toolkit.StringPool;
import com.xjrsoft.common.model.result.R;
import com.xjrsoft.common.page.ConventPage;
import com.xjrsoft.common.page.PageOutput;
import com.xjrsoft.common.model.result.R;
import com.xjrsoft.common.utils.VoToColumnUtil;
import com.xjrsoft.module.mdm.dto.AddLngBPngLineDto;
import com.xjrsoft.module.mdm.dto.UpdateLngBPngLineDto;
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.xjrsoft.module.datalog.service.DatalogService;
import com.xjrsoft.module.datalog.vo.DataChangeLogVo;
import com.xjrsoft.module.mdm.dto.LngBPngLinePageDto;
import com.xjrsoft.module.mdm.dto.UpdateLngBBankDto;
import com.xjrsoft.module.mdm.dto.UpdateLngBPngLineDto;
import com.xjrsoft.module.mdm.entity.LngBPngLine;
import com.xjrsoft.module.mdm.service.IPipelineGgasLineService;
import com.xjrsoft.module.mdm.vo.LngBPngLinePageVo;
import com.xjrsoft.module.datalog.service.DatalogService;
import com.xjrsoft.module.datalog.vo.DataChangeLogVo;
import com.xjrsoft.module.mdm.vo.LngBPngLineVo;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.StrUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.util.List;
/**
* @title: 管道气管线
@ -64,7 +65,7 @@ public class PipelineGgasLineController {
.like(StrUtil.isNotBlank(dto.getStaCodeLng()),LngBPngLine::getStaCodeLng,dto.getStaCodeLng())
//.like(StrUtil.isNotBlank(dto.getSort()),LngBPngLine::getSort,dto.getSort())
.like(StrUtil.isNotBlank(dto.getNote()),LngBPngLine::getNote,dto.getNote())
.orderByDesc(LngBPngLine::getId)
.orderByAsc(LngBPngLine::getSort,LngBPngLine::getCode)
.select(LngBPngLine.class,x -> VoToColumnUtil.fieldsToColumns(LngBPngLinePageVo.class).contains(x.getProperty()));
IPage<LngBPngLine> page = pipelineGgasLineService.page(ConventPage.getPage(dto), queryWrapper);
PageOutput<LngBPngLinePageVo> pageOutput = ConventPage.getPageOutput(page, LngBPngLinePageVo.class);
@ -124,7 +125,7 @@ public class PipelineGgasLineController {
@ApiOperation(value="根据id查询LngBPngLine数据详细日志")
@SaCheckPermission("pipelineGgasLine:datalog")
public R datalog(@RequestParam Long id){
List<DataChangeLogVo> logs = dataService.findLogsByEntityId(UpdateLngBBankDto.class,id);
List<DataChangeLogVo> logs = dataService.findLogsByEntityId(UpdateLngBPngLineDto.class,id);
return R.ok(logs);
}

View File

@ -61,9 +61,8 @@ public class TaxRateController {
.like(StrUtil.isNotBlank(dto.getValid()),LngBTax::getValid,dto.getValid())
.like(StrUtil.isNotBlank(dto.getCode()),LngBTax::getCode,dto.getCode())
.eq(ObjectUtil.isNotNull(dto.getRate()),LngBTax::getRate,dto.getRate())
//.like(StrUtil.isNotBlank(dto.getSort()),LngBTax::getSort,dto.getSort())
.like(StrUtil.isNotBlank(dto.getNote()),LngBTax::getNote,dto.getNote())
.orderByDesc(LngBTax::getId)
.orderByAsc(LngBTax::getSort,LngBTax::getCode)
.select(LngBTax.class,x -> VoToColumnUtil.fieldsToColumns(LngBTaxPageVo.class).contains(x.getProperty()));
IPage<LngBTax> page = taxRateService.page(ConventPage.getPage(dto), queryWrapper);
PageOutput<LngBTaxPageVo> pageOutput = ConventPage.getPageOutput(page, LngBTaxPageVo.class);

View File

@ -1,20 +1,17 @@
package com.xjrsoft.module.mdm.entity;
import java.io.Serializable;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.Version;
import com.github.yulichang.annotation.EntityMapping;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalTime;
import java.time.LocalDateTime;
import java.math.BigDecimal;
import java.util.List;
/**

View File

@ -22,4 +22,6 @@ public interface IPipelineGgasLineService extends IService<LngBPngLine> {
Long add(UpdateLngBPngLineDto dto);
Long update(UpdateLngBPngLineDto dto);
LngBPngLine getByCode(String code);
}

View File

@ -15,7 +15,6 @@ import com.pictc.enums.ExceptionCommonCode;
import com.pictc.utils.DataLogTools;
import com.xjrsoft.common.exception.BusinessException;
import com.xjrsoft.module.common.db.service.CommonCallService;
import com.xjrsoft.module.datalog.service.DatalogService;
import com.xjrsoft.module.mdm.dto.UpdateLngBBankDto;
import com.xjrsoft.module.mdm.entity.LngBBank;
import com.xjrsoft.module.mdm.mapper.LngBBankMapper;
@ -61,7 +60,8 @@ public class BankServiceImpl extends ServiceImpl<LngBBankMapper, LngBBank> imple
return res.getId();
}
@Override
@Override
@Transactional(rollbackFor = Exception.class)
public boolean enable(List<Long> ids) {
DataLogTools.enable(UpdateLngBBankDto.class,ids);
for (Long id : ids) {
@ -75,11 +75,12 @@ public class BankServiceImpl extends ServiceImpl<LngBBankMapper, LngBBank> imple
@Override
@Transactional(rollbackFor = Exception.class)
public boolean disable(List<Long> ids) {
DataLogTools.disable(UpdateLngBBankDto.class,ids);
for (Long id : ids) {
String msg = commonCallService.enableBefore(TableNameConstants.LNG_B_BANK, id);
String msg = commonCallService.disableBefore(TableNameConstants.LNG_B_BANK, id);
if (StringUtils.isNotBlank(msg)) {
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_EXEC_ERROR, msg));
}

View File

@ -57,7 +57,8 @@ public class CountryRegionServiceImpl extends ServiceImpl<LngBRegionMapper, LngB
return res.getId();
}
@Override
@Override
@Transactional(rollbackFor = Exception.class)
public boolean enable(List<Long> ids) {
dataService.enable(UpdateLngBRegionDto.class,ids);
for (Long id : ids) {
@ -71,10 +72,11 @@ public class CountryRegionServiceImpl extends ServiceImpl<LngBRegionMapper, LngB
@Override
@Transactional(rollbackFor = Exception.class)
public boolean disable(List<Long> ids) {
dataService.disable(UpdateLngBRegionDto.class,ids);
for (Long id : ids) {
String msg = commonCallService.enableBefore(TableNameConstants.LNG_B_REGION, id);
String msg = commonCallService.disableBefore(TableNameConstants.LNG_B_REGION, id);
if (StringUtils.isNotBlank(msg)) {
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_EXEC_ERROR, msg));
}
@ -85,6 +87,7 @@ public class CountryRegionServiceImpl extends ServiceImpl<LngBRegionMapper, LngB
@Override
@Transactional(rollbackFor = Exception.class)
public Long update(UpdateLngBRegionDto dto) {
if(!CountryRegionEnum.CONTINENT.getCode().equals(dto.getRegionTypeCode()) ) {
if(dto.getPid() != null && dto.getPid() != 0) {

View File

@ -4,6 +4,7 @@ import java.util.List;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@ -35,14 +36,16 @@ public class ExpenseNameServiceImpl extends ServiceImpl<LngBFeeMapper, LngBFee>
private final CommonCallService commonCallService;
@Override
@Transactional(rollbackFor = Exception.class)
public Long add(UpdateLngBFeeDto dto) {
this.checkParams(dto);
UpdateLngBFeeDto res = DataLogTools.update(dto);
UpdateLngBFeeDto res = DataLogTools.insert(dto);
this.addOrUpdateAfter(res.getId());
return res.getId();
}
@Override
@Transactional(rollbackFor = Exception.class)
public Long update(UpdateLngBFeeDto dto) {
this.checkParams(dto);
UpdateLngBFeeDto res = DataLogTools.update(dto);
@ -52,6 +55,7 @@ public class ExpenseNameServiceImpl extends ServiceImpl<LngBFeeMapper, LngBFee>
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean enable(List<Long> ids) {
DataLogTools.enable(UpdateLngBBankDto.class,ids);
for (Long id : ids) {
@ -64,10 +68,11 @@ public class ExpenseNameServiceImpl extends ServiceImpl<LngBFeeMapper, LngBFee>
}
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean disable(List<Long> ids) {
DataLogTools.disable(UpdateLngBBankDto.class,ids);
for (Long id : ids) {
String msg = commonCallService.enableBefore(TableNameConstants.LNG_B_FEE, id);
String msg = commonCallService.disableBefore(TableNameConstants.LNG_B_FEE, id);
if (StringUtils.isNotBlank(msg)) {
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_EXEC_ERROR, msg));
}

View File

@ -60,7 +60,8 @@ public class PipeGasDownloadPointServiceImpl extends ServiceImpl<LngBStationPngM
return res.getId();
}
@Override
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean enable(List<Long> ids) {
DataLogTools.enable(UpdateLngBStationPngDto.class,ids);
for (Long id : ids) {
@ -74,11 +75,12 @@ public class PipeGasDownloadPointServiceImpl extends ServiceImpl<LngBStationPngM
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean disable(List<Long> ids) {
DataLogTools.disable(UpdateLngBStationPngDto.class,ids);
for (Long id : ids) {
String msg = commonCallService.enableBefore(TableNameConstants.LNG_B_STATION_PNG, id);
String msg = commonCallService.disableBefore(TableNameConstants.LNG_B_STATION_PNG, id);
if (StringUtils.isNotBlank(msg)) {
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_EXEC_ERROR, msg));
}

View File

@ -1,7 +1,13 @@
package com.xjrsoft.module.mdm.service.impl;
import java.util.List;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.yulichang.base.MPJBaseServiceImpl;
import com.pictc.constant.FieldNameConstants;
import com.pictc.constant.TableNameConstants;
import com.pictc.enums.BusinessCode;
@ -10,8 +16,6 @@ import com.pictc.utils.DataLogTools;
import com.xjrsoft.common.exception.BusinessException;
import com.xjrsoft.module.common.db.service.CommonCallService;
import com.xjrsoft.module.mdm.dto.UpdateLngBPngLineDto;
import com.xjrsoft.module.mdm.dto.UpdateLngBPngLineDto;
import com.xjrsoft.module.mdm.entity.LngBPngLine;
import com.xjrsoft.module.mdm.entity.LngBPngLine;
import com.xjrsoft.module.mdm.mapper.LngBPngLineMapper;
import com.xjrsoft.module.mdm.service.IPipelineGgasLineService;
@ -19,16 +23,6 @@ import com.xjrsoft.module.system.client.ICodeRuleClient;
import lombok.AllArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
/**
* @title: service
* @Author 管理员
@ -67,7 +61,8 @@ public class PipelineGgasLineServiceImpl extends ServiceImpl<LngBPngLineMapper,
return res.getId();
}
@Override
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean enable(List<Long> ids) {
DataLogTools.enable(UpdateLngBPngLineDto.class,ids);
for (Long id : ids) {
@ -78,14 +73,22 @@ public class PipelineGgasLineServiceImpl extends ServiceImpl<LngBPngLineMapper,
}
return true;
}
@Override
public LngBPngLine getByCode(String code) {
LngBPngLine bl = this.baseMapper.selectOne(new LambdaQueryWrapper<LngBPngLine>()
.eq(LngBPngLine::getCode, code));
return bl;
}
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean disable(List<Long> ids) {
DataLogTools.disable(UpdateLngBPngLineDto.class,ids);
for (Long id : ids) {
String msg = commonCallService.enableBefore(TableNameConstants.LNG_B_PNG_LINE, id);
String msg = commonCallService.disableBefore(TableNameConstants.LNG_B_PNG_LINE, id);
if (StringUtils.isNotBlank(msg)) {
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_EXEC_ERROR, msg));
}

View File

@ -4,6 +4,7 @@ import java.util.List;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@ -35,14 +36,16 @@ public class TaxRateServiceImpl extends ServiceImpl<LngBTaxMapper, LngBTax> impl
private final CommonCallService commonCallService;
@Override
@Transactional(rollbackFor = Exception.class)
public Long add(UpdateLngBTaxDto dto) {
this.checkParams(dto);
UpdateLngBTaxDto res = DataLogTools.update(dto);
UpdateLngBTaxDto res = DataLogTools.insert(dto);
this.addOrUpdateAfter(res.getId());
return res.getId();
}
@Override
@Transactional(rollbackFor = Exception.class)
public Long update(UpdateLngBTaxDto dto) {
this.checkParams(dto);
UpdateLngBTaxDto res = DataLogTools.update(dto);
@ -52,6 +55,7 @@ public class TaxRateServiceImpl extends ServiceImpl<LngBTaxMapper, LngBTax> impl
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean enable(List<Long> ids) {
DataLogTools.enable(UpdateLngBTaxDto.class,ids);
for (Long id : ids) {
@ -64,10 +68,11 @@ public class TaxRateServiceImpl extends ServiceImpl<LngBTaxMapper, LngBTax> impl
}
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean disable(List<Long> ids) {
DataLogTools.disable(UpdateLngBBankDto.class,ids);
for (Long id : ids) {
String msg = commonCallService.enableBefore(TableNameConstants.LNG_B_TAX, id);
String msg = commonCallService.disableBefore(TableNameConstants.LNG_B_TAX, id);
if (StringUtils.isNotBlank(msg)) {
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_EXEC_ERROR, msg));
}

View File

@ -7,7 +7,7 @@ spring:
main:
allow-bean-definition-overriding: true
profiles:
active: remote
active: dev
cloud:
nacos: #nacos监控
config: