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

View File

@ -59,7 +59,7 @@ public interface TableNameConstants {
String LNG_B_TAX = "lng_b_tax"; String LNG_B_TAX = "lng_b_tax";
/** /**
* 管道气线表 * 管道气线表
*/ */
String LNG_B_PNG_LINE = "lng_b_png_line"; String LNG_B_PNG_LINE = "lng_b_png_line";

View File

@ -27,6 +27,8 @@ import java.util.Map.Entry;
import java.util.Objects; import java.util.Objects;
import java.util.Set; import java.util.Set;
import java.util.function.Function; import java.util.function.Function;
import java.util.function.Supplier;
import java.util.stream.Collector;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
@ -723,6 +725,27 @@ public class DataLogTools {
return null; return null;
} }
/**
* @Description: 判断是否有子表数据日志
* @param item
* @param pidMap
* @return boolean 返回类型
*/
private static boolean hasChild(DataChangeLog item,Map<String, List<DataChangeLog>> pidMap) {
if(!pidMap.containsKey(item.getId())) {
return false;
}
boolean flag = false;
List<DataChangeLog> childs = pidMap.get(item.getId());
for (DataChangeLog child : childs) {
if(child.hasFieldChanges() || hasChild(child,pidMap)) {
flag = true;
break;
}
}
return flag;
}
/** /**
* @Description: 保存数据日志 * @Description: 保存数据日志
@ -734,20 +757,29 @@ public class DataLogTools {
initTable(tableName); initTable(tableName);
String sql = parseSql(SQL_INSERT, tableName); String sql = parseSql(SQL_INSERT, tableName);
List<List<JdbcParam>> batchParams = CollectionUtils.newArrayList(); List<List<JdbcParam>> batchParams = CollectionUtils.newArrayList();
for (DataChangeLog log : logs) { Map<String, List<DataChangeLog>> pidMap = logs.stream().collect(Collectors.groupingBy(DataChangeLog::getPid));
for (DataChangeLog item : logs) {
//没有改变的属性,且没有子表修改时跳过
if(!item.hasFieldChanges() && !hasChild(item, pidMap)) {
continue;
}
List<JdbcParam> params = CollectionUtils.newArrayList(); List<JdbcParam> params = CollectionUtils.newArrayList();
params.add(JdbcParam.of(Types.VARCHAR,String.class, log.getId())); params.add(JdbcParam.of(Types.VARCHAR,String.class, item.getId()));
params.add(JdbcParam.of(Types.VARCHAR,String.class, log.getFlowId())); params.add(JdbcParam.of(Types.VARCHAR,String.class, item.getFlowId()));
params.add(JdbcParam.of(Types.VARCHAR,String.class, log.getPid())); params.add(JdbcParam.of(Types.VARCHAR,String.class, item.getPid()));
params.add(JdbcParam.of(Types.VARCHAR,String.class, log.getEntityClassName())); params.add(JdbcParam.of(Types.VARCHAR,String.class, item.getEntityClassName()));
params.add(JdbcParam.of(Types.VARCHAR,String.class, log.getBusName())); params.add(JdbcParam.of(Types.VARCHAR,String.class, item.getBusName()));
params.add(JdbcParam.of(Types.BIGINT,long.class, log.getEntityId())); params.add(JdbcParam.of(Types.BIGINT,long.class, item.getEntityId()));
params.add(JdbcParam.of(Types.VARCHAR,String.class,JSON.toJSONString(log.getFieldChanges()))); params.add(JdbcParam.of(Types.VARCHAR,String.class,JSON.toJSONString(item.getFieldChanges())));
params.add(JdbcParam.of(Types.VARCHAR,String.class,log.getOperationType().name())); params.add(JdbcParam.of(Types.VARCHAR,String.class,item.getOperationType().name()));
params.add(JdbcParam.of(Types.VARCHAR,long.class,log.getOperatorId())); params.add(JdbcParam.of(Types.VARCHAR,long.class,item.getOperatorId()));
params.add(JdbcParam.of(Types.VARCHAR,String.class,log.getOperatorName())); params.add(JdbcParam.of(Types.VARCHAR,String.class,item.getOperatorName()));
params.add(JdbcParam.of(Types.TIMESTAMP,Timestamp.class,log.getOperationTime())); params.add(JdbcParam.of(Types.TIMESTAMP,Timestamp.class,item.getOperationTime()));
params.add(JdbcParam.of(Types.VARCHAR,String.class,log.getOperationIp())); params.add(JdbcParam.of(Types.VARCHAR,String.class,item.getOperationIp()));
batchParams.add(params); batchParams.add(params);
} }
executeBatch(sql, batchParams); executeBatch(sql, batchParams);

View File

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

View File

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

View File

@ -65,14 +65,19 @@ public class BankController {
LambdaQueryWrapper<LngBBank> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<LngBBank> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper 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.getBankCode()),LngBBank::getBankCode,dto.getBankCode())
.like(StrUtil.isNotBlank(dto.getRegionCode()),LngBBank::getRegionCode,dto.getRegionCode()) .like(StrUtil.isNotBlank(dto.getRegionCode()),LngBBank::getRegionCode,dto.getRegionCode())
.like(StrUtil.isNotBlank(dto.getValid()),LngBBank::getValid,dto.getValid()) .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.getCode()),LngBBank::getCode,dto.getCode())
.like(StrUtil.isNotBlank(dto.getSwift()),LngBBank::getSwift,dto.getSwift()) .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())); .select(LngBBank.class,x -> VoToColumnUtil.fieldsToColumns(LngBBankPageVo.class).contains(x.getProperty()));
IPage<LngBBank> page = bankService.page(ConventPage.getPage(dto), queryWrapper); IPage<LngBBank> page = bankService.page(ConventPage.getPage(dto), queryWrapper);
PageOutput<LngBBankPageVo> pageOutput = ConventPage.getPageOutput(page, LngBBankPageVo.class); 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()) .eq(ObjectUtil.isNotNull(dto.getPid()),LngBRegion::getPid,dto.getPid())
.like(StrUtil.isNotBlank(dto.getFullPath()),LngBRegion::getFullPath,dto.getFullPath()) .like(StrUtil.isNotBlank(dto.getFullPath()),LngBRegion::getFullPath,dto.getFullPath())
.like(StrUtil.isNotBlank(dto.getValid()),LngBRegion::getValid,dto.getValid()) .like(StrUtil.isNotBlank(dto.getValid()),LngBRegion::getValid,dto.getValid())
.like(StrUtil.isNotBlank(dto.getNote()),LngBRegion::getNote,dto.getNote()) .orderByAsc(LngBRegion::getCode)
.orderByDesc(LngBRegion::getId)
.select(LngBRegion.class,x -> VoToColumnUtil.fieldsToColumns(LngBRegionPageVo.class).contains(x.getProperty())); .select(LngBRegion.class,x -> VoToColumnUtil.fieldsToColumns(LngBRegionPageVo.class).contains(x.getProperty()));
IPage<LngBRegion> page = countryRegionService.page(ConventPage.getPage(dto), queryWrapper); IPage<LngBRegion> page = countryRegionService.page(ConventPage.getPage(dto), queryWrapper);
PageOutput<LngBRegionPageVo> pageOutput = ConventPage.getPageOutput(page, LngBRegionPageVo.class); PageOutput<LngBRegionPageVo> pageOutput = ConventPage.getPageOutput(page, LngBRegionPageVo.class);
@ -171,11 +170,23 @@ public class CountryRegionController {
@GetMapping("/child") @GetMapping("/child")
@ApiOperation(value = "根据id 查询下级区域") @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() List<LngBRegion> regionList = countryRegionService.list(Wrappers.<LngBRegion>query().lambda()
.eq(pid != null, LngBRegion::getPid, pid) .eq(pid != null, LngBRegion::getPid, pid)
.eq(LngBRegion::getValid, ValidEnum.ENABLE.getCode()) .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 -> { .and(StrUtil.isNotBlank(keyword), x -> {
x.like(StrUtil.isNotBlank(keyword), LngBRegion::getFullName, keyword); x.like(StrUtil.isNotBlank(keyword), LngBRegion::getFullName, keyword);
})); }));
@ -185,7 +196,7 @@ public class CountryRegionController {
for(LngBRegion br:regionList) { for(LngBRegion br:regionList) {
LngBRegionVo vo = new LngBRegionVo(); LngBRegionVo vo = new LngBRegionVo();
BeanUtil.copyProperties(br, vo); BeanUtil.copyProperties(br, vo);
Long parentId = br.getPid(); Long parentId = br.getId();
if(parentId == null) { if(parentId == null) {
parentId = 0L; parentId = 0L;
} }

View File

@ -1,38 +1,39 @@
package com.xjrsoft.module.mdm.controller; package com.xjrsoft.module.mdm.controller;
import cn.hutool.core.bean.BeanUtil; import java.util.List;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; 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.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.xjrsoft.common.model.result.R;
import com.xjrsoft.common.constant.GlobalConstant;
import com.baomidou.mybatisplus.core.toolkit.StringPool;
import com.xjrsoft.common.page.ConventPage; import com.xjrsoft.common.page.ConventPage;
import com.xjrsoft.common.page.PageOutput; import com.xjrsoft.common.page.PageOutput;
import com.xjrsoft.common.model.result.R;
import com.xjrsoft.common.utils.VoToColumnUtil; import com.xjrsoft.common.utils.VoToColumnUtil;
import com.xjrsoft.module.mdm.dto.AddLngBFeeDto; import com.xjrsoft.module.datalog.service.DatalogService;
import com.xjrsoft.module.mdm.dto.UpdateLngBFeeDto; import com.xjrsoft.module.datalog.vo.DataChangeLogVo;
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.xjrsoft.module.mdm.dto.LngBFeePageDto; 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.entity.LngBFee;
import com.xjrsoft.module.mdm.service.IExpenseNameService; import com.xjrsoft.module.mdm.service.IExpenseNameService;
import com.xjrsoft.module.mdm.vo.LngBFeePageVo; 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 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.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.util.List;
/** /**
* @title: 费用名称 * @title: 费用名称
@ -60,9 +61,8 @@ public class ExpenseNameController {
.like(StrUtil.isNotBlank(dto.getFullName()),LngBFee::getFullName,dto.getFullName()) .like(StrUtil.isNotBlank(dto.getFullName()),LngBFee::getFullName,dto.getFullName())
.like(StrUtil.isNotBlank(dto.getValid()),LngBFee::getValid,dto.getValid()) .like(StrUtil.isNotBlank(dto.getValid()),LngBFee::getValid,dto.getValid())
.like(StrUtil.isNotBlank(dto.getCode()),LngBFee::getCode,dto.getCode()) .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()) .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())); .select(LngBFee.class,x -> VoToColumnUtil.fieldsToColumns(LngBFeePageVo.class).contains(x.getProperty()));
IPage<LngBFee> page = expenseNameService.page(ConventPage.getPage(dto), queryWrapper); IPage<LngBFee> page = expenseNameService.page(ConventPage.getPage(dto), queryWrapper);
PageOutput<LngBFeePageVo> pageOutput = ConventPage.getPageOutput(page, LngBFeePageVo.class); 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 cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.pictc.utils.CollectionUtils;
import com.xjrsoft.common.model.result.R; import com.xjrsoft.common.model.result.R;
import com.xjrsoft.common.page.ConventPage; import com.xjrsoft.common.page.ConventPage;
import com.xjrsoft.common.page.PageOutput; 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.dto.UpdateLngBStationLngDto;
import com.xjrsoft.module.mdm.entity.LngBStationLng; import com.xjrsoft.module.mdm.entity.LngBStationLng;
import com.xjrsoft.module.mdm.service.ILNGStationService; 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.LngBStationLngPageVo;
import com.xjrsoft.module.mdm.vo.LngBStationLngVo; import com.xjrsoft.module.mdm.vo.LngBStationLngVo;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
@ -110,4 +112,23 @@ public class LNGStationController {
public R disable(@Valid @RequestBody List<Long> ids){ public R disable(@Valid @RequestBody List<Long> ids){
return R.ok(lNGStationService.disable(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.service.DatalogService;
import com.xjrsoft.module.datalog.vo.DataChangeLogVo; import com.xjrsoft.module.datalog.vo.DataChangeLogVo;
import com.xjrsoft.module.mdm.dto.LngBStationPngPageDto; 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.dto.UpdateLngBStationPngDto;
import com.xjrsoft.module.mdm.entity.LngBPngLine;
import com.xjrsoft.module.mdm.entity.LngBStationPng; import com.xjrsoft.module.mdm.entity.LngBStationPng;
import com.xjrsoft.module.mdm.service.IPipeGasDownloadPointService; 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.LngBStationPngPageVo;
import com.xjrsoft.module.mdm.vo.LngBStationPngVo; import com.xjrsoft.module.mdm.vo.LngBStationPngVo;
@ -52,6 +53,8 @@ public class PipeGasDownloadPointController {
private final IPipeGasDownloadPointService pipeGasDownloadPointService; private final IPipeGasDownloadPointService pipeGasDownloadPointService;
private final DatalogService dataService; private final DatalogService dataService;
private final IPipelineGgasLineService pipelineGgasLineService ;
@GetMapping(value = "/page") @GetMapping(value = "/page")
@ApiOperation(value="LngBStationPng列表(分页)") @ApiOperation(value="LngBStationPng列表(分页)")
@SaCheckPermission("pipeGasDownloadPoint:list") @SaCheckPermission("pipeGasDownloadPoint:list")
@ -63,19 +66,14 @@ public class PipeGasDownloadPointController {
.like(StrUtil.isNotBlank(dto.getFullName()),LngBStationPng::getFullName,dto.getFullName()) .like(StrUtil.isNotBlank(dto.getFullName()),LngBStationPng::getFullName,dto.getFullName())
.like(StrUtil.isNotBlank(dto.getPipelineCode()),LngBStationPng::getPipelineCode,dto.getPipelineCode()) .like(StrUtil.isNotBlank(dto.getPipelineCode()),LngBStationPng::getPipelineCode,dto.getPipelineCode())
.like(StrUtil.isNotBlank(dto.getEnterprise()),LngBStationPng::getEnterprise,dto.getEnterprise()) .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.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.getOwnSign()),LngBStationPng::getOwnSign,dto.getOwnSign())
.like(StrUtil.isNotBlank(dto.getStaCodeLng()),LngBStationPng::getStaCodeLng,dto.getStaCodeLng()) .like(StrUtil.isNotBlank(dto.getStaCodeLng()),LngBStationPng::getStaCodeLng,dto.getStaCodeLng())
.like(StrUtil.isNotBlank(dto.getOwnLineSign()),LngBStationPng::getOwnLineSign,dto.getOwnLineSign()) .like(StrUtil.isNotBlank(dto.getOwnLineSign()),LngBStationPng::getOwnLineSign,dto.getOwnLineSign())
//.like(StrUtil.isNotBlank(dto.getSort()),LngBStationPng::getSort,dto.getSort()) //.like(StrUtil.isNotBlank(dto.getSort()),LngBStationPng::getSort,dto.getSort())
.like(StrUtil.isNotBlank(dto.getValid()),LngBStationPng::getValid,dto.getValid()) .like(StrUtil.isNotBlank(dto.getValid()),LngBStationPng::getValid,dto.getValid())
.like(StrUtil.isNotBlank(dto.getNote()),LngBStationPng::getNote,dto.getNote()) .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())); .select(LngBStationPng.class,x -> VoToColumnUtil.fieldsToColumns(LngBStationPngPageVo.class).contains(x.getProperty()));
IPage<LngBStationPng> page = pipeGasDownloadPointService.page(ConventPage.getPage(dto), queryWrapper); IPage<LngBStationPng> page = pipeGasDownloadPointService.page(ConventPage.getPage(dto), queryWrapper);
PageOutput<LngBStationPngPageVo> pageOutput = ConventPage.getPageOutput(page, LngBStationPngPageVo.class); PageOutput<LngBStationPngPageVo> pageOutput = ConventPage.getPageOutput(page, LngBStationPngPageVo.class);
@ -90,7 +88,13 @@ public class PipeGasDownloadPointController {
if (lngBStationPng == null) { if (lngBStationPng == null) {
return R.error("找不到此数据!"); 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数据详细日志") @ApiOperation(value="根据id查询LngBStationPng数据详细日志")
@SaCheckPermission("pipeGasDownloadPoint:datalog") @SaCheckPermission("pipeGasDownloadPoint:datalog")
public R datalog(@RequestParam Long id){ 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); return R.ok(logs);
} }

View File

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

View File

@ -1,20 +1,17 @@
package com.xjrsoft.module.mdm.entity; 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.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic; import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName; 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.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; 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 add(UpdateLngBPngLineDto dto);
Long update(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.pictc.utils.DataLogTools;
import com.xjrsoft.common.exception.BusinessException; import com.xjrsoft.common.exception.BusinessException;
import com.xjrsoft.module.common.db.service.CommonCallService; 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.dto.UpdateLngBBankDto;
import com.xjrsoft.module.mdm.entity.LngBBank; import com.xjrsoft.module.mdm.entity.LngBBank;
import com.xjrsoft.module.mdm.mapper.LngBBankMapper; import com.xjrsoft.module.mdm.mapper.LngBBankMapper;
@ -62,6 +61,7 @@ public class BankServiceImpl extends ServiceImpl<LngBBankMapper, LngBBank> imple
} }
@Override @Override
@Transactional(rollbackFor = Exception.class)
public boolean enable(List<Long> ids) { public boolean enable(List<Long> ids) {
DataLogTools.enable(UpdateLngBBankDto.class,ids); DataLogTools.enable(UpdateLngBBankDto.class,ids);
for (Long id : ids) { for (Long id : ids) {
@ -75,11 +75,12 @@ public class BankServiceImpl extends ServiceImpl<LngBBankMapper, LngBBank> imple
@Override @Override
@Transactional(rollbackFor = Exception.class)
public boolean disable(List<Long> ids) { public boolean disable(List<Long> ids) {
DataLogTools.disable(UpdateLngBBankDto.class,ids); DataLogTools.disable(UpdateLngBBankDto.class,ids);
for (Long id : 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)) { if (StringUtils.isNotBlank(msg)) {
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_EXEC_ERROR, msg)); throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_EXEC_ERROR, msg));
} }

View File

@ -58,6 +58,7 @@ public class CountryRegionServiceImpl extends ServiceImpl<LngBRegionMapper, LngB
} }
@Override @Override
@Transactional(rollbackFor = Exception.class)
public boolean enable(List<Long> ids) { public boolean enable(List<Long> ids) {
dataService.enable(UpdateLngBRegionDto.class,ids); dataService.enable(UpdateLngBRegionDto.class,ids);
for (Long id : ids) { for (Long id : ids) {
@ -71,10 +72,11 @@ public class CountryRegionServiceImpl extends ServiceImpl<LngBRegionMapper, LngB
@Override @Override
@Transactional(rollbackFor = Exception.class)
public boolean disable(List<Long> ids) { public boolean disable(List<Long> ids) {
dataService.disable(UpdateLngBRegionDto.class,ids); dataService.disable(UpdateLngBRegionDto.class,ids);
for (Long id : 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)) { if (StringUtils.isNotBlank(msg)) {
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_EXEC_ERROR, msg)); throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_EXEC_ERROR, msg));
} }
@ -85,6 +87,7 @@ public class CountryRegionServiceImpl extends ServiceImpl<LngBRegionMapper, LngB
@Override @Override
@Transactional(rollbackFor = Exception.class)
public Long update(UpdateLngBRegionDto dto) { public Long update(UpdateLngBRegionDto dto) {
if(!CountryRegionEnum.CONTINENT.getCode().equals(dto.getRegionTypeCode()) ) { if(!CountryRegionEnum.CONTINENT.getCode().equals(dto.getRegionTypeCode()) ) {
if(dto.getPid() != null && dto.getPid() != 0) { 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.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@ -35,14 +36,16 @@ public class ExpenseNameServiceImpl extends ServiceImpl<LngBFeeMapper, LngBFee>
private final CommonCallService commonCallService; private final CommonCallService commonCallService;
@Override @Override
@Transactional(rollbackFor = Exception.class)
public Long add(UpdateLngBFeeDto dto) { public Long add(UpdateLngBFeeDto dto) {
this.checkParams(dto); this.checkParams(dto);
UpdateLngBFeeDto res = DataLogTools.update(dto); UpdateLngBFeeDto res = DataLogTools.insert(dto);
this.addOrUpdateAfter(res.getId()); this.addOrUpdateAfter(res.getId());
return res.getId(); return res.getId();
} }
@Override @Override
@Transactional(rollbackFor = Exception.class)
public Long update(UpdateLngBFeeDto dto) { public Long update(UpdateLngBFeeDto dto) {
this.checkParams(dto); this.checkParams(dto);
UpdateLngBFeeDto res = DataLogTools.update(dto); UpdateLngBFeeDto res = DataLogTools.update(dto);
@ -52,6 +55,7 @@ public class ExpenseNameServiceImpl extends ServiceImpl<LngBFeeMapper, LngBFee>
@Override @Override
@Transactional(rollbackFor = Exception.class)
public Boolean enable(List<Long> ids) { public Boolean enable(List<Long> ids) {
DataLogTools.enable(UpdateLngBBankDto.class,ids); DataLogTools.enable(UpdateLngBBankDto.class,ids);
for (Long id : ids) { for (Long id : ids) {
@ -64,10 +68,11 @@ public class ExpenseNameServiceImpl extends ServiceImpl<LngBFeeMapper, LngBFee>
} }
@Override @Override
@Transactional(rollbackFor = Exception.class)
public Boolean disable(List<Long> ids) { public Boolean disable(List<Long> ids) {
DataLogTools.disable(UpdateLngBBankDto.class,ids); DataLogTools.disable(UpdateLngBBankDto.class,ids);
for (Long id : 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)) { if (StringUtils.isNotBlank(msg)) {
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_EXEC_ERROR, msg)); throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_EXEC_ERROR, msg));
} }

View File

@ -61,6 +61,7 @@ public class PipeGasDownloadPointServiceImpl extends ServiceImpl<LngBStationPngM
} }
@Override @Override
@Transactional(rollbackFor = Exception.class)
public Boolean enable(List<Long> ids) { public Boolean enable(List<Long> ids) {
DataLogTools.enable(UpdateLngBStationPngDto.class,ids); DataLogTools.enable(UpdateLngBStationPngDto.class,ids);
for (Long id : ids) { for (Long id : ids) {
@ -74,11 +75,12 @@ public class PipeGasDownloadPointServiceImpl extends ServiceImpl<LngBStationPngM
@Override @Override
@Transactional(rollbackFor = Exception.class)
public Boolean disable(List<Long> ids) { public Boolean disable(List<Long> ids) {
DataLogTools.disable(UpdateLngBStationPngDto.class,ids); DataLogTools.disable(UpdateLngBStationPngDto.class,ids);
for (Long id : 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)) { if (StringUtils.isNotBlank(msg)) {
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_EXEC_ERROR, 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; 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.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.yulichang.base.MPJBaseServiceImpl;
import com.pictc.constant.FieldNameConstants; import com.pictc.constant.FieldNameConstants;
import com.pictc.constant.TableNameConstants; import com.pictc.constant.TableNameConstants;
import com.pictc.enums.BusinessCode; import com.pictc.enums.BusinessCode;
@ -10,8 +16,6 @@ import com.pictc.utils.DataLogTools;
import com.xjrsoft.common.exception.BusinessException; import com.xjrsoft.common.exception.BusinessException;
import com.xjrsoft.module.common.db.service.CommonCallService; 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.dto.UpdateLngBPngLineDto;
import com.xjrsoft.module.mdm.entity.LngBPngLine;
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.mapper.LngBPngLineMapper;
import com.xjrsoft.module.mdm.service.IPipelineGgasLineService; import com.xjrsoft.module.mdm.service.IPipelineGgasLineService;
@ -19,16 +23,6 @@ import com.xjrsoft.module.system.client.ICodeRuleClient;
import lombok.AllArgsConstructor; 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 * @title: service
* @Author 管理员 * @Author 管理员
@ -68,6 +62,7 @@ public class PipelineGgasLineServiceImpl extends ServiceImpl<LngBPngLineMapper,
} }
@Override @Override
@Transactional(rollbackFor = Exception.class)
public Boolean enable(List<Long> ids) { public Boolean enable(List<Long> ids) {
DataLogTools.enable(UpdateLngBPngLineDto.class,ids); DataLogTools.enable(UpdateLngBPngLineDto.class,ids);
for (Long id : ids) { for (Long id : ids) {
@ -79,13 +74,21 @@ public class PipelineGgasLineServiceImpl extends ServiceImpl<LngBPngLineMapper,
return true; return true;
} }
@Override
public LngBPngLine getByCode(String code) {
LngBPngLine bl = this.baseMapper.selectOne(new LambdaQueryWrapper<LngBPngLine>()
.eq(LngBPngLine::getCode, code));
return bl;
}
@Override @Override
@Transactional(rollbackFor = Exception.class)
public Boolean disable(List<Long> ids) { public Boolean disable(List<Long> ids) {
DataLogTools.disable(UpdateLngBPngLineDto.class,ids); DataLogTools.disable(UpdateLngBPngLineDto.class,ids);
for (Long id : 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)) { if (StringUtils.isNotBlank(msg)) {
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_EXEC_ERROR, 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.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@ -35,14 +36,16 @@ public class TaxRateServiceImpl extends ServiceImpl<LngBTaxMapper, LngBTax> impl
private final CommonCallService commonCallService; private final CommonCallService commonCallService;
@Override @Override
@Transactional(rollbackFor = Exception.class)
public Long add(UpdateLngBTaxDto dto) { public Long add(UpdateLngBTaxDto dto) {
this.checkParams(dto); this.checkParams(dto);
UpdateLngBTaxDto res = DataLogTools.update(dto); UpdateLngBTaxDto res = DataLogTools.insert(dto);
this.addOrUpdateAfter(res.getId()); this.addOrUpdateAfter(res.getId());
return res.getId(); return res.getId();
} }
@Override @Override
@Transactional(rollbackFor = Exception.class)
public Long update(UpdateLngBTaxDto dto) { public Long update(UpdateLngBTaxDto dto) {
this.checkParams(dto); this.checkParams(dto);
UpdateLngBTaxDto res = DataLogTools.update(dto); UpdateLngBTaxDto res = DataLogTools.update(dto);
@ -52,6 +55,7 @@ public class TaxRateServiceImpl extends ServiceImpl<LngBTaxMapper, LngBTax> impl
@Override @Override
@Transactional(rollbackFor = Exception.class)
public Boolean enable(List<Long> ids) { public Boolean enable(List<Long> ids) {
DataLogTools.enable(UpdateLngBTaxDto.class,ids); DataLogTools.enable(UpdateLngBTaxDto.class,ids);
for (Long id : ids) { for (Long id : ids) {
@ -64,10 +68,11 @@ public class TaxRateServiceImpl extends ServiceImpl<LngBTaxMapper, LngBTax> impl
} }
@Override @Override
@Transactional(rollbackFor = Exception.class)
public Boolean disable(List<Long> ids) { public Boolean disable(List<Long> ids) {
DataLogTools.disable(UpdateLngBBankDto.class,ids); DataLogTools.disable(UpdateLngBBankDto.class,ids);
for (Long id : 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)) { if (StringUtils.isNotBlank(msg)) {
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_EXEC_ERROR, msg)); throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_EXEC_ERROR, msg));
} }

View File

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