# Conflicts:
#	itc-pcitc-dependencies/itc-pcitc-dependencies-service/src/main/java/com/xjrsoft/module/common/db/utils/CommonCallUtils.java
This commit is contained in:
2025-11-06 17:20:29 +08:00
26 changed files with 801 additions and 824 deletions

View File

@ -1,6 +0,0 @@
██████╗ ███████╗ ██████╗ ██╗████████╗ ██████╗
██╔════╝ ██╔════╝██╔════╝ ██║╚══██╔══╝██╔════╝
██║ ███╗█████╗ ██║ ███╗█████╗██║ ██║ ██║
██║ ██║██╔══╝ ██║ ██║╚════╝██║ ██║ ██║
╚██████╔╝███████╗╚██████╔╝ ██║ ██║ ╚██████╗
╚═════╝ ╚══════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝

View File

@ -1,49 +0,0 @@
spring:
cloud:
nacos: #nacos监控
config:
server-addr: 127.0.0.1:8848 # nacos 配置中心地址
namespace: ITC-MS
group: DNE
username: nacos
password: nacos
extension-configs:
- data-id: global-local.yml
refresh: true
group: DNE
- data-id: discovery-local.yml
refresh: true
group: DNE
- data-id: datasource-local.yml
refresh: true
group: DNE
- data-id: seata-local.yml
refresh: true
group: DNE
- data-id: redis-local.yml
refresh: true
group: DNE
- data-id: magic-api.yml
refresh: true
group: DNE
- data-id: sa-token.yml
refresh: true
group: DNE
- data-id: camunda.yml
refresh: true
group: DNE
- data-id: sentinel-local.yml
refresh: true
group: DNE
datalog:
db:
url: jdbc:kingbase8://127.0.0.1:54321/itc?currentSchema=dne_log_sit

View File

@ -1,56 +0,0 @@
server:
port: 8099
spring:
application:
name: demo-service
main:
allow-bean-definition-overriding: true
profiles:
active: remote
cloud:
nacos: #nacos监控
config:
server-addr: 10.0.252.1:8848 # nacos 配置中心地址
namespace: ITC-MS
group: DNE
username: nacos
password: Yudean@2025
file-extension: yml # 默认配置 ${spring.application.name}-${spring.profiles.active}.${file-extension}
refresh-enabled: true
extension-configs:
- data-id: global.yml
refresh: true
group: DNE
- data-id: discovery.yml
refresh: true
group: DNE
- data-id: datasource.yml
refresh: true
group: DNE
- data-id: seata.yml
refresh: true
group: DNE
- data-id: redis.yml
refresh: true
group: DNE
- data-id: magic-api.yml
refresh: true
group: DNE
- data-id: sa-token.yml
refresh: true
group: DNE
- data-id: camunda.yml
refresh: true
group: DNE
- data-id: sentinel.yml
refresh: true
group: DNE

View File

@ -16,80 +16,77 @@ import com.xjrsoft.module.common.db.service.CommonCallService;
*/
@Component
public class CommonCallUtils {
private static CommonCallService callService;
@Autowired
public void setCallService(CommonCallService callService) {
CommonCallUtils.callService = callService;
}
/**
* @Description:
一、新增、修改记录时,在同一个事务里执行如下过程:
1、更新表
2、调用数据库函数pc_表名.f_save(表主键)
3、函数返回非空、或者数据库异常时rollback函数返回空时commit
* @Description:
* 一、新增、修改记录时,在同一个事务里执行如下过程:
* 1、更新表
* 2、调用数据库函数pc_表名.f_save(表主键)
* 3、函数返回非空、或者数据库异常时rollback函数返回空时commit
* @param table 表名
* @param id 表主键
* @return String 返回类型 函数返回非空、或者数据库异常时rollback函数返回空时commit
* @param id 表主键
* @return String 返回类型 函数返回非空、或者数据库异常时rollback函数返回空时commit
*/
public static String saveAfter(String table,long id) {
String error = callService.saveAfter(table, id);
if(StringUtils.isNotEmpty(error)) {
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_SAVE_EXEC_ERROR,error));
}
return error;
}
/**
* @Description:
二、删除记录时,在同一个事务里执行如下过程:
1、调用数据库函数pc_表名.f_delete(表主键)
2、函数返回非空、或者数据库异常时rollback函数返回空时commit
* @return
* @return String 返回类型
*/
public static String deleteBefore(String table,Long id) {
String error = callService.deleteBefore(table, id);
if(StringUtils.isNotEmpty(error)) {
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_DELETE_EXEC_ERROR,error));
}
return error;
}
/**
* @Description:
二、停用时,在同一个事务里执行如下过程:
1、调用数据库函数pc_表名.f_off(表主键)
2、函数返回非空、或者数据库异常时rollback函数返回空时commit
* @return
* @return String 返回类型
*/
public static String disableBefore(String table,Long id) {
String error = callService.disableBefore(table, id);
if(StringUtils.isNotEmpty(error)) {
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_DISABLE_EXEC_ERROR,error));
}
return error;
}
/**
* @Description:
1、调用数据库函数pc_表名.f_on(表主键)
2、函数返回非空、或者数据库异常时rollback函数返回空时commit
* @return
* @return String 返回类型
*/
public static String enableBefore(String table,Long id) {
String error = callService.enableBefore(table, id);
if(StringUtils.isNotEmpty(error)) {
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_ENABLE_EXEC_ERROR,error));
public static String saveAfter(String table, long id) {
String error = callService.saveAfter(table, id);
if (StringUtils.isNotEmpty(error)) {
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_SAVE_EXEC_ERROR, error));
}
return error;
}
/**
* @Description:
* 二、删除记录时,在同一个事务里执行如下过程:
* 1、调用数据库函数pc_表名.f_delete(表主键)
* 2、函数返回非空、或者数据库异常时rollback函数返回空时commit
* @return
* @return String 返回类型
*/
public static String deleteBefore(String table, Long id) {
String error = callService.deleteBefore(table, id);
if (StringUtils.isNotEmpty(error)) {
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_DELETE_EXEC_ERROR, error));
}
return error;
}
/**
* @Description:
* 二、停用时,在同一个事务里执行如下过程:
* 1、调用数据库函数pc_表名.f_off(表主键)
* 2、函数返回非空、或者数据库异常时rollback函数返回空时commit
* @return
* @return String 返回类型
*/
public static String disableBefore(String table, Long id) {
String error = callService.disableBefore(table, id);
if (StringUtils.isNotEmpty(error)) {
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_DISABLE_EXEC_ERROR, error));
}
return error;
}
/**
* @Description:
* 1、调用数据库函数pc_表名.f_on(表主键)
* 2、函数返回非空、或者数据库异常时rollback函数返回空时commit
* @return
* @return String 返回类型
*/
public static String enableBefore(String table, Long id) {
String error = callService.enableBefore(table, id);
if (StringUtils.isNotEmpty(error)) {
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_ENABLE_EXEC_ERROR, error));
}
return error;
}
}

View File

@ -48,6 +48,7 @@ public class LngBBankPageVo {
* 所属国家和地区
*/
@ApiModelProperty("所属国家和地区")
@Trans(type = TransType.REGION, transToFieldName = "regionName")
private String regionCode;
/**
* SWIFT
@ -66,10 +67,10 @@ public class LngBBankPageVo {
@ApiModelProperty("数据权限id")
private Long ruleUserId;
/**
* 所属国家和地区
*/
@ApiModelProperty("所属国家和地区名称")
private String regionName;
@ApiModelProperty("所属国家和地区名称")
private String regionName;
}

View File

@ -59,5 +59,10 @@ public class LngBRegionTreeVo implements ITreeNode<LngBRegionTreeVo,String>, Ser
private String valid;
private List<LngBRegionTreeVo> children;
private Boolean hasChild;
private Boolean isLeaf;
}

View File

@ -5,6 +5,7 @@ import java.util.List;
import javax.validation.Valid;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@ -16,25 +17,29 @@ import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.pictc.datalog.DataOperationContent;
import com.pictc.datalog.DataOperationListener;
import com.pictc.enums.BusinessCode;
import com.pictc.enums.ExceptionCommonCode;
import com.xjrsoft.common.exception.BusinessException;
import com.xjrsoft.common.model.result.R;
import com.xjrsoft.common.page.ConventPage;
import com.xjrsoft.common.page.PageOutput;
import com.xjrsoft.common.utils.VoToColumnUtil;
import com.xjrsoft.module.authority.dto.BatchSetDataAuthDto;
import com.xjrsoft.module.common.db.utils.CommonCallUtils;
import com.xjrsoft.module.datalog.service.DatalogService;
import com.xjrsoft.module.datalog.vo.DataChangeLogVo;
import com.xjrsoft.module.mdm.dto.LngBBankPageDto;
import com.xjrsoft.module.mdm.dto.UpdateLngBBankDto;
import com.xjrsoft.module.mdm.entity.LngBBank;
import com.xjrsoft.module.mdm.entity.LngBRegion;
import com.xjrsoft.module.mdm.service.IBankService;
import com.xjrsoft.module.mdm.service.ICountryRegionService;
import com.xjrsoft.module.mdm.vo.LngBBankPageVo;
import com.xjrsoft.module.mdm.vo.LngBBankVo;
import com.xjrsoft.module.system.client.ICodeRuleClient;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.StrUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -54,9 +59,12 @@ public class BankController {
private final IBankService bankService;
private final DatalogService dataService;
private final ICountryRegionService regionService;
private final ICodeRuleClient codeRuleClient;
private final String BANK_CODE = "bankCode";
@GetMapping(value = "/page")
@ApiOperation(value="LngBBank列表(分页)")
@ -81,9 +89,6 @@ public class BankController {
.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);
List<LngBBankPageVo> list = pageOutput.getList();
setRegionName(list);
return R.ok(pageOutput);
}
@ -113,15 +118,34 @@ public class BankController {
@ApiOperation(value = "新增LngBBank")
@SaCheckPermission("bank:add")
public R add(@Valid @RequestBody UpdateLngBBankDto dto){
Long res = bankService.add(dto);
return R.ok(res);
return R.ok(dataService.insert(dto,new DataOperationListener<UpdateLngBBankDto>() {
@Override
public UpdateLngBBankDto before(DataOperationContent<UpdateLngBBankDto> content) {
String code = codeRuleClient.genEncode(BANK_CODE);
dto.setCode(code);
return content.getObj();
}
@Override
public UpdateLngBBankDto after(DataOperationContent<UpdateLngBBankDto> content) {
String msg = CommonCallUtils.saveAfter(content.getTableName(),content.getIdValue());
if (StringUtils.isNotBlank(msg)) {
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_EXEC_ERROR, msg));
}
codeRuleClient.useEncode(BANK_CODE);
return content.getObj();
}
}));
}
@PutMapping
@ApiOperation(value = "修改LngBBank")
@SaCheckPermission("bank:edit")
public R update(@Valid @RequestBody UpdateLngBBankDto dto){
return R.ok(bankService.update(dto));
return R.ok(dataService.updateById(dto));
}
@DeleteMapping
@ -162,23 +186,5 @@ public class BankController {
return R.ok(dataService.disable(UpdateLngBBankDto.class,ids));
}
private void setRegionName(List<LngBBankPageVo> list) {
if(CollectionUtil.isNotEmpty(list)) {
for(LngBBankPageVo vo: list) {
if(StrUtil.isNotBlank(vo.getRegionCode())) {
String[] regionArr = vo.getRegionCode().split(",");
if(regionArr != null && regionArr.length > 0) {
String lastRegionCode = regionArr[regionArr.length-1];
LambdaQueryWrapper<LngBRegion> regionQueryWrapper = new LambdaQueryWrapper<>();
regionQueryWrapper.eq(LngBRegion::getCode, lastRegionCode);
LngBRegion lastRegion = regionService.getOne(regionQueryWrapper);
if(lastRegion != null) {
vo.setRegionName(lastRegion.getFullPath());
}
}
}
}
}
}
}

View File

@ -1,9 +1,14 @@
package com.xjrsoft.module.mdm.controller;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
import java.util.stream.Collectors;
import javax.validation.Valid;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@ -16,20 +21,30 @@ 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.esotericsoftware.kryo.kryo5.minlog.Log;
import com.pictc.datalog.DataOperationContent;
import com.pictc.datalog.DataOperationListener;
import com.pictc.enums.BusinessCode;
import com.pictc.enums.ExceptionCommonCode;
import com.pictc.enums.ValidEnum;
import com.pictc.utils.CollectionUtils;
import com.xjrsoft.common.constant.GlobalConstant;
import com.xjrsoft.common.enums.YesOrNoEnum;
import com.xjrsoft.common.exception.BusinessException;
import com.xjrsoft.common.model.result.R;
import com.xjrsoft.common.page.ConventPage;
import com.xjrsoft.common.page.PageOutput;
import com.xjrsoft.common.utils.CacheUtil;
import com.xjrsoft.common.utils.TreeUtil;
import com.xjrsoft.common.utils.VoToColumnUtil;
import com.xjrsoft.module.common.db.utils.CommonCallUtils;
import com.xjrsoft.module.datalog.service.DatalogService;
import com.xjrsoft.module.datalog.vo.DataChangeLogVo;
import com.xjrsoft.module.mdm.dto.LngBRegionPageDto;
import com.xjrsoft.module.mdm.dto.UpdateLngBBankDto;
import com.xjrsoft.module.mdm.dto.UpdateLngBRegionDto;
import com.xjrsoft.module.mdm.entity.LngBRegion;
import com.xjrsoft.module.mdm.enums.CountryRegionEnum;
import com.xjrsoft.module.mdm.service.ICountryRegionService;
import com.xjrsoft.module.mdm.vo.LngBRegionPageVo;
import com.xjrsoft.module.mdm.vo.LngBRegionTreeVo;
@ -42,6 +57,7 @@ import cn.hutool.core.util.StrUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import shade.powerjob.com.google.common.collect.Lists;
/**
* @title: 国家地区
@ -103,17 +119,67 @@ public class CountryRegionController {
@ApiOperation(value = "新增LngBRegion")
@SaCheckPermission("countryRegion:add")
public R add(@Valid @RequestBody UpdateLngBRegionDto dto){
Long res = countryRegionService.add(dto);
return R.ok(res);
return R.ok(dataService.insert(dto,new DataOperationListener<UpdateLngBRegionDto>() {
@Override
public UpdateLngBRegionDto before(DataOperationContent<UpdateLngBRegionDto> content) {
if(!CountryRegionEnum.CONTINENT.getCode().equals(dto.getRegionTypeCode()) ) {
if(dto.getPid() != null && dto.getPid() != 0) {
LngBRegion parentRegion = countryRegionService.getById(dto.getPid());
if(parentRegion != null) {
dto.setFullPath(parentRegion.getFullPath()+dto.getFullName());
}
}
}else {
dto.setFullPath(dto.getFullName());
}
return content.getObj();
}
@Override
public UpdateLngBRegionDto after(DataOperationContent<UpdateLngBRegionDto> content) {
String msg = CommonCallUtils.saveAfter(content.getTableName(),content.getIdValue());
if (StringUtils.isNotBlank(msg)) {
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_EXEC_ERROR, msg));
}
refreshCahe();
return content.getObj();
}
}));
}
@PutMapping
@ApiOperation(value = "修改LngBRegion")
@SaCheckPermission("countryRegion:edit")
public R update(@Valid @RequestBody UpdateLngBRegionDto dto){
return R.ok(countryRegionService.update(dto));
return R.ok(dataService.updateById(dto,new DataOperationListener<UpdateLngBRegionDto>() {
@Override
public UpdateLngBRegionDto before(DataOperationContent<UpdateLngBRegionDto> content) {
if(!CountryRegionEnum.CONTINENT.getCode().equals(dto.getRegionTypeCode()) ) {
if(dto.getPid() != null && dto.getPid() != 0) {
LngBRegion parentRegion = countryRegionService.getById(dto.getPid());
if(parentRegion != null) {
dto.setFullPath(parentRegion.getFullPath()+dto.getFullName());
}
}
}else {
dto.setFullPath(dto.getFullName());
}
return content.getObj();
}
@Override
public UpdateLngBRegionDto after(DataOperationContent<UpdateLngBRegionDto> content) {
String msg = CommonCallUtils.saveAfter(content.getTableName(),content.getIdValue());
if (StringUtils.isNotBlank(msg)) {
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_EXEC_ERROR, msg));
}
refreshCahe();
return content.getObj();
}
}));
}
@DeleteMapping
@ -184,7 +250,6 @@ public class CountryRegionController {
.eq(pid != null, LngBRegion::getPid, pid)
.eq(LngBRegion::getValid, ValidEnum.ENABLE.getCode())
.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);
}));
@ -209,4 +274,21 @@ public class CountryRegionController {
return R.ok(voList);
}
@GetMapping("/getParentByCode")
@ApiOperation(value = "根据id 查询下级区域")
public R getRegionByParentId(@RequestParam(required = true) String code,@RequestParam(required = false) String excludeType
) {
return R.ok(countryRegionService.getRegionByParentId(code,excludeType));
}
private void refreshCahe(){
//异步更新
CompletableFuture.runAsync(() -> {
CacheUtil.refreshRegionList();
});
}
}

View File

@ -42,7 +42,7 @@ import lombok.AllArgsConstructor;
* @Version 1.0
*/
@RestController
@RequestMapping("/mdm" + "/fee")
@RequestMapping("/mdm/fee")
@Api(value = "/mdm" + "/fee",tags = "费用名称代码")
@AllArgsConstructor
public class FeeController {
@ -85,14 +85,14 @@ public class FeeController {
@ApiOperation(value = "新增LngBFee")
@SaCheckPermission("fee:add")
public R add(@Valid @RequestBody UpdateLngBFeeDto dto){
return R.ok(feeService.add(dto));
return R.ok(dataService.insert(dto));
}
@PutMapping
@ApiOperation(value = "修改LngBFee")
@SaCheckPermission("fee:edit")
public R update(@Valid @RequestBody UpdateLngBFeeDto dto){
return R.ok(feeService.update(dto));
return R.ok(dataService.updateById(dto));
}
@DeleteMapping

View File

@ -4,6 +4,7 @@ import java.util.List;
import javax.validation.Valid;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@ -15,10 +16,16 @@ import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.pictc.datalog.DataOperationContent;
import com.pictc.datalog.DataOperationListener;
import com.pictc.enums.BusinessCode;
import com.pictc.enums.ExceptionCommonCode;
import com.xjrsoft.common.exception.BusinessException;
import com.xjrsoft.common.model.result.R;
import com.xjrsoft.common.page.ConventPage;
import com.xjrsoft.common.page.PageOutput;
import com.xjrsoft.common.utils.VoToColumnUtil;
import com.xjrsoft.module.common.db.utils.CommonCallUtils;
import com.xjrsoft.module.datalog.service.DatalogService;
import com.xjrsoft.module.datalog.vo.DataChangeLogVo;
import com.xjrsoft.module.mdm.dto.LngBStationPngPageDto;
@ -29,6 +36,7 @@ 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;
import com.xjrsoft.module.system.client.ICodeRuleClient;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.bean.BeanUtil;
@ -51,9 +59,14 @@ public class PipeGasDownloadPointController {
private final IPipeGasDownloadPointService pipeGasDownloadPointService;
private final DatalogService dataService;
private final IPipelineGgasLineService pipelineGgasLineService ;
private final ICodeRuleClient codeRuleClient;
private final String PNG_DL_POINT_CODE = "pngDlPointCode";
@GetMapping(value = "/page")
@ApiOperation(value="LngBStationPng列表(分页)")
@ -70,7 +83,6 @@ public class PipeGasDownloadPointController {
.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())
.orderByAsc(LngBStationPng::getSort,LngBStationPng::getCode)
@ -102,14 +114,33 @@ public class PipeGasDownloadPointController {
@ApiOperation(value = "新增LngBStationPng")
@SaCheckPermission("pipeGasDownloadPoint:add")
public R add(@Valid @RequestBody UpdateLngBStationPngDto dto){
return R.ok(pipeGasDownloadPointService.add(dto));
return R.ok(dataService.insert(dto,new DataOperationListener<UpdateLngBStationPngDto>() {
@Override
public UpdateLngBStationPngDto before(DataOperationContent<UpdateLngBStationPngDto> content) {
String code = codeRuleClient.genEncode(PNG_DL_POINT_CODE);
dto.setCode(code);
return content.getObj();
}
@Override
public UpdateLngBStationPngDto after(DataOperationContent<UpdateLngBStationPngDto> content) {
String msg = CommonCallUtils.saveAfter(content.getTableName(),content.getIdValue());
if (StringUtils.isNotBlank(msg)) {
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_EXEC_ERROR, msg));
}
codeRuleClient.useEncode(PNG_DL_POINT_CODE);
return content.getObj();
}
}));
}
@PutMapping
@ApiOperation(value = "修改LngBStationPng")
@SaCheckPermission("pipeGasDownloadPoint:edit")
public R update(@Valid @RequestBody UpdateLngBStationPngDto dto){
return R.ok(pipeGasDownloadPointService.update(dto));
return R.ok(dataService.updateById(dto));
}
@DeleteMapping

View File

@ -4,6 +4,7 @@ import java.util.List;
import javax.validation.Valid;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@ -15,10 +16,16 @@ import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.pictc.datalog.DataOperationContent;
import com.pictc.datalog.DataOperationListener;
import com.pictc.enums.BusinessCode;
import com.pictc.enums.ExceptionCommonCode;
import com.xjrsoft.common.exception.BusinessException;
import com.xjrsoft.common.model.result.R;
import com.xjrsoft.common.page.ConventPage;
import com.xjrsoft.common.page.PageOutput;
import com.xjrsoft.common.utils.VoToColumnUtil;
import com.xjrsoft.module.common.db.utils.CommonCallUtils;
import com.xjrsoft.module.datalog.service.DatalogService;
import com.xjrsoft.module.datalog.vo.DataChangeLogVo;
import com.xjrsoft.module.mdm.dto.LngBPngLinePageDto;
@ -27,6 +34,7 @@ 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.mdm.vo.LngBPngLineVo;
import com.xjrsoft.module.system.client.ICodeRuleClient;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.bean.BeanUtil;
@ -49,7 +57,12 @@ public class PipelineGgasLineController {
private final IPipelineGgasLineService pipelineGgasLineService;
private final DatalogService dataService;
private final DatalogService dataService;
private final ICodeRuleClient codeRuleClient;
private final String PNG_LINE_CODE = "pngLineCode";
@GetMapping(value = "/page")
@ApiOperation(value="LngBPngLine列表(分页)")
@ -88,14 +101,33 @@ public class PipelineGgasLineController {
@ApiOperation(value = "新增LngBPngLine")
@SaCheckPermission("pipelineGgasLine:add")
public R add(@Valid @RequestBody UpdateLngBPngLineDto dto){
return R.ok(pipelineGgasLineService.add(dto));
return R.ok(dataService.insert(dto,new DataOperationListener<UpdateLngBPngLineDto>() {
@Override
public UpdateLngBPngLineDto before(DataOperationContent<UpdateLngBPngLineDto> content) {
String code = codeRuleClient.genEncode(PNG_LINE_CODE);
dto.setCode(code);
return content.getObj();
}
@Override
public UpdateLngBPngLineDto after(DataOperationContent<UpdateLngBPngLineDto> content) {
String msg = CommonCallUtils.saveAfter(content.getTableName(),content.getIdValue());
if (StringUtils.isNotBlank(msg)) {
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_EXEC_ERROR, msg));
}
codeRuleClient.useEncode(PNG_LINE_CODE);
return content.getObj();
}
}));
}
@PutMapping
@ApiOperation(value = "修改LngBPngLine")
@SaCheckPermission("pipelineGgasLine:edit")
public R update(@Valid @RequestBody UpdateLngBPngLineDto dto){
return R.ok(pipelineGgasLineService.update(dto));
return R.ok(dataService.updateById(dto));
}
@DeleteMapping

View File

@ -87,14 +87,14 @@ public class TaxRateController {
@ApiOperation(value = "新增LngBTax")
@SaCheckPermission("taxRate:add")
public R add(@Valid @RequestBody UpdateLngBTaxDto dto){
return R.ok(taxRateService.add(dto));
return R.ok(dataService.insert(dto));
}
@PutMapping
@ApiOperation(value = "修改LngBTax")
@SaCheckPermission("taxRate:edit")
public R update(@Valid @RequestBody UpdateLngBTaxDto dto){
return R.ok(taxRateService.update(dto));
return R.ok(dataService.updateById(dto));
}
@DeleteMapping
@ -117,7 +117,7 @@ public class TaxRateController {
@ApiOperation(value = "启用")
@SaCheckPermission("taxRate:enable")
public R enable(@Valid @RequestBody List<Long> ids){
return R.ok(dataService.enable(UpdateLngBTaxDto.class,ids));
return R.ok(dataService.enable(UpdateLngBTaxDto.class,ids));
}
@ -125,7 +125,7 @@ public class TaxRateController {
@ApiOperation(value = "禁用")
@SaCheckPermission("taxRate:disable")
public R disable(@Valid @RequestBody List<Long> ids){
return R.ok(dataService.disable(UpdateLngBTaxDto.class,ids));
return R.ok(dataService.disable(UpdateLngBTaxDto.class,ids));
}
}

View File

@ -1,9 +1,6 @@
package com.xjrsoft.module.mdm.service;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.IService;
import com.xjrsoft.module.mdm.dto.UpdateLngBBankDto;
import com.xjrsoft.module.mdm.entity.LngBBank;
/**
@ -15,11 +12,5 @@ import com.xjrsoft.module.mdm.entity.LngBBank;
public interface IBankService extends IService<LngBBank> {
Long add(UpdateLngBBankDto dto);
boolean enable(List<Long> ids);
boolean disable(List<Long> ids);
Long update(UpdateLngBBankDto dto);
}

View File

@ -1,11 +1,8 @@
package com.xjrsoft.module.mdm.service;
import java.util.List;
import javax.validation.Valid;
import java.util.Map;
import com.baomidou.mybatisplus.extension.service.IService;
import com.xjrsoft.module.mdm.dto.UpdateLngBRegionDto;
import com.xjrsoft.module.mdm.entity.LngBRegion;
/**
@ -17,11 +14,7 @@ import com.xjrsoft.module.mdm.entity.LngBRegion;
public interface ICountryRegionService extends IService<LngBRegion> {
Long add(UpdateLngBRegionDto dto);
boolean enable(List<Long> ids);
Map<String, Object> getRegionByParentId(String code, String excludeType);
boolean disable(List<Long> ids);
Long update(UpdateLngBRegionDto dto);
}

View File

@ -1,9 +1,6 @@
package com.xjrsoft.module.mdm.service;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.IService;
import com.xjrsoft.module.mdm.dto.UpdateLngBFeeDto;
import com.xjrsoft.module.mdm.entity.LngBFee;
/**
@ -15,11 +12,4 @@ import com.xjrsoft.module.mdm.entity.LngBFee;
public interface IFeeService extends IService<LngBFee> {
Boolean enable(List<Long> ids);
Boolean disable(List<Long> ids);
Long update(UpdateLngBFeeDto dto);
Long add(UpdateLngBFeeDto dto);
}

View File

@ -1,9 +1,6 @@
package com.xjrsoft.module.mdm.service;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.IService;
import com.xjrsoft.module.mdm.dto.UpdateLngBStationPngDto;
import com.xjrsoft.module.mdm.entity.LngBStationPng;
/**
@ -15,11 +12,6 @@ import com.xjrsoft.module.mdm.entity.LngBStationPng;
public interface IPipeGasDownloadPointService extends IService<LngBStationPng> {
Boolean enable(List<Long> ids);
Boolean disable(List<Long> ids);
Long add(UpdateLngBStationPngDto dto);
Long update(UpdateLngBStationPngDto dto);
}

View File

@ -1,9 +1,6 @@
package com.xjrsoft.module.mdm.service;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.IService;
import com.xjrsoft.module.mdm.dto.UpdateLngBPngLineDto;
import com.xjrsoft.module.mdm.entity.LngBPngLine;
/**
@ -15,13 +12,6 @@ import com.xjrsoft.module.mdm.entity.LngBPngLine;
public interface IPipelineGgasLineService extends IService<LngBPngLine> {
Boolean disable(List<Long> ids);
Boolean enable(List<Long> ids);
Long add(UpdateLngBPngLineDto dto);
Long update(UpdateLngBPngLineDto dto);
LngBPngLine getByCode(String code);
}

View File

@ -1,9 +1,6 @@
package com.xjrsoft.module.mdm.service;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.IService;
import com.xjrsoft.module.mdm.dto.UpdateLngBTaxDto;
import com.xjrsoft.module.mdm.entity.LngBTax;
/**
@ -15,11 +12,5 @@ import com.xjrsoft.module.mdm.entity.LngBTax;
public interface ITaxRateService extends IService<LngBTax> {
Long add(UpdateLngBTaxDto dto);
Long update(UpdateLngBTaxDto dto);
Boolean enable(List<Long> ids);
Boolean disable(List<Long> ids);
}

View File

@ -1,25 +1,11 @@
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.pictc.constant.FieldNameConstants;
import com.pictc.constant.TableNameConstants;
import com.pictc.enums.BusinessCode;
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.mdm.dto.UpdateLngBBankDto;
import com.xjrsoft.module.mdm.entity.LngBBank;
import com.xjrsoft.module.mdm.mapper.LngBBankMapper;
import com.xjrsoft.module.mdm.service.IBankService;
import com.xjrsoft.module.system.client.ICodeRuleClient;
import lombok.AllArgsConstructor;
@ -32,89 +18,6 @@ import lombok.AllArgsConstructor;
@Service
@AllArgsConstructor
public class BankServiceImpl extends ServiceImpl<LngBBankMapper, LngBBank> implements IBankService {
private final CommonCallService commonCallService;
private final ICodeRuleClient codeRuleClient;
private final String BANK_CODE = "bankCode";
@Override
@Transactional(rollbackFor = Exception.class)
public Long add(UpdateLngBBankDto dto) {
String code = codeRuleClient.genEncode(BANK_CODE);
dto.setCode(code);
this.checkParams(dto);
UpdateLngBBankDto res = DataLogTools.insert(dto);
codeRuleClient.useEncode(BANK_CODE);
this.addOrUpdateAfter(res.getId());
return res.getId();
}
@Override
@Transactional(rollbackFor = Exception.class)
public Long update(UpdateLngBBankDto dto) {
this.checkParams(dto);
UpdateLngBBankDto res = DataLogTools.update(dto);
this.addOrUpdateAfter(res.getId());
return res.getId();
}
@Override
@Transactional(rollbackFor = Exception.class)
public boolean enable(List<Long> ids) {
DataLogTools.enable(UpdateLngBBankDto.class,ids);
for (Long id : ids) {
String msg = commonCallService.enableBefore(TableNameConstants.LNG_B_BANK, id);
if (StringUtils.isNotBlank(msg)) {
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_EXEC_ERROR, msg));
}
}
return true;
}
@Override
@Transactional(rollbackFor = Exception.class)
public boolean disable(List<Long> ids) {
DataLogTools.disable(UpdateLngBBankDto.class,ids);
for (Long id : ids) {
String msg = commonCallService.disableBefore(TableNameConstants.LNG_B_BANK, id);
if (StringUtils.isNotBlank(msg)) {
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_EXEC_ERROR, msg));
}
}
return true;
}
private void checkParams(UpdateLngBBankDto dto) {
Long codeCount = this.baseMapper.selectCount(new LambdaQueryWrapper<LngBBank>()
.eq(LngBBank::getCode, dto.getCode()).ne(dto.getId() != null, LngBBank::getId, dto.getId()));
if (codeCount > 0) {
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DATA_FIELD_DUPLICATION,
FieldNameConstants.CODE));
}
Long shortNameCount = this.baseMapper.selectCount(new LambdaQueryWrapper<LngBBank>()
.eq(LngBBank::getShortName, dto.getShortName()).ne(dto.getId() != null, LngBBank::getId, dto.getId()));
if (shortNameCount > 0) {
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DATA_FIELD_DUPLICATION,
FieldNameConstants.SHORT_NAME));
}
Long nameCount = this.baseMapper.selectCount(new LambdaQueryWrapper<LngBBank>()
.eq(LngBBank::getFullName, dto.getFullName()).ne(dto.getId() != null, LngBBank::getId, dto.getId()));
if (nameCount > 0) {
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DATA_FIELD_DUPLICATION,
FieldNameConstants.FULL_NAME));
}
}
private void addOrUpdateAfter(Long id) {
String msg = commonCallService.saveAfter(TableNameConstants.LNG_B_BANK, id);
if (StringUtils.isNotBlank(msg)) {
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_EXEC_ERROR, msg));
}
}
}

View File

@ -1,30 +1,29 @@
package com.xjrsoft.module.mdm.service.impl;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.Map;
import java.util.stream.Collectors;
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.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pictc.constant.FieldNameConstants;
import com.pictc.constant.TableNameConstants;
import com.pictc.enums.BusinessCode;
import com.pictc.enums.ExceptionCommonCode;
import com.pictc.utils.DataLogTools;
import com.xjrsoft.common.exception.BusinessException;
import com.xjrsoft.common.utils.CacheUtil;
import com.xjrsoft.module.common.db.service.CommonCallService;
import com.xjrsoft.module.datalog.service.DatalogService;
import com.xjrsoft.module.mdm.dto.UpdateLngBRegionDto;
import com.pictc.utils.CollectionUtils;
import com.xjrsoft.common.constant.GlobalConstant;
import com.xjrsoft.common.utils.TreeUtil;
import com.xjrsoft.module.mdm.entity.LngBRegion;
import com.xjrsoft.module.mdm.enums.CountryRegionEnum;
import com.xjrsoft.module.mdm.mapper.LngBRegionMapper;
import com.xjrsoft.module.mdm.service.ICountryRegionService;
import com.xjrsoft.module.mdm.vo.LngBRegionTreeVo;
import cn.hutool.core.bean.BeanUtil;
import lombok.AllArgsConstructor;
import shade.powerjob.com.google.common.collect.Lists;
/**
* @title: service
@ -35,110 +34,65 @@ import lombok.AllArgsConstructor;
@Service
@AllArgsConstructor
public class CountryRegionServiceImpl extends ServiceImpl<LngBRegionMapper, LngBRegion> implements ICountryRegionService {
private final CommonCallService commonCallService;
private final DatalogService dataService;
@Override
@Transactional(rollbackFor = Exception.class)
public Long add(UpdateLngBRegionDto dto) {
if(!CountryRegionEnum.CONTINENT.getCode().equals(dto.getRegionTypeCode()) ) {
if(dto.getPid() != null && dto.getPid() != 0) {
LngBRegion parentRegion = this.getById(dto.getPid());
if(parentRegion != null) {
dto.setFullPath(parentRegion.getFullPath()+dto.getFullName());
}
}
}else {
dto.setFullPath(dto.getFullName());
}
this.checkParams(dto);
UpdateLngBRegionDto res = DataLogTools.insert(dto);
this.addOrUpdateAfter(res.getId());
refreshCahe();
return res.getId();
}
@Override
@Transactional(rollbackFor = Exception.class)
public boolean enable(List<Long> ids) {
dataService.enable(UpdateLngBRegionDto.class,ids);
for (Long id : ids) {
String msg = commonCallService.enableBefore(TableNameConstants.LNG_B_REGION, id);
if (StringUtils.isNotBlank(msg)) {
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_EXEC_ERROR, msg));
}
}
refreshCahe();
return true;
}
@Override
@Transactional(rollbackFor = Exception.class)
public boolean disable(List<Long> ids) {
dataService.disable(UpdateLngBRegionDto.class,ids);
for (Long id : ids) {
String msg = commonCallService.disableBefore(TableNameConstants.LNG_B_REGION, id);
if (StringUtils.isNotBlank(msg)) {
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_EXEC_ERROR, msg));
}
}
refreshCahe();
return true;
}
@Override
@Transactional(rollbackFor = Exception.class)
public Long update(UpdateLngBRegionDto dto) {
if(!CountryRegionEnum.CONTINENT.getCode().equals(dto.getRegionTypeCode()) ) {
if(dto.getPid() != null && dto.getPid() != 0) {
LngBRegion parentRegion = this.getById(dto.getPid());
if(parentRegion != null) {
dto.setFullPath(parentRegion.getFullPath()+dto.getFullName());
}
}
}else {
dto.setFullPath(dto.getFullName());
}
this.checkParams(dto);
UpdateLngBRegionDto res = DataLogTools.update(dto);
this.addOrUpdateAfter(res.getId());
refreshCahe();
return res.getId();
public Map<String, Object> getRegionByParentId(String code,String excludeType) {
Map<String,Object> result = new HashMap<>();
LambdaQueryWrapper<LngBRegion> queryWrapper = new LambdaQueryWrapper<LngBRegion>();
queryWrapper.eq(LngBRegion::getCode,code);
LngBRegion temp = this.getOne(queryWrapper);
if(temp == null) {
return result;
}
List<String> codeList = CollectionUtils.newArrayList();
List<LngBRegion> allList = this.list(Wrappers.<LngBRegion>query()
.lambda().ne(StringUtils.isNotBlank(excludeType),LngBRegion::getRegionTypeCode, excludeType));
Map<Long,LngBRegion> map = allList.stream().collect(Collectors.toMap(LngBRegion::getId,
obj -> obj));
if(map != null) {
codeList.add(code);
while(temp != null && temp.getPid() != null && !CountryRegionEnum.CONTINENT.getCode().equals(temp.getRegionTypeCode())) {
temp = map.get(temp.getPid());
if(temp != null) {
codeList.add(temp.getCode());
}
}
}
List<LngBRegionTreeVo> voList = CollectionUtils.newArrayList();
if(allList != null && allList.size() > 0) {
for(LngBRegion br:allList) {
LngBRegionTreeVo vo = new LngBRegionTreeVo();
BeanUtil.copyProperties(br, vo);
if(br.getPid() != null) {
vo.setParentId(String.valueOf(br.getPid()) );
}else {
vo.setParentId(String.valueOf(GlobalConstant.FIRST_NODE_VALUE));
}
voList.add(vo);
}
}
List<LngBRegionTreeVo> treeVoList = TreeUtil.build(voList);
filterNode(treeVoList,codeList);
result.put("areaList", treeVoList);
Collections.reverse(codeList);
result.put("regionCode", codeList);
return result;
}
private void checkParams(UpdateLngBRegionDto dto) {
Long codeCount = this.baseMapper.selectCount(new LambdaQueryWrapper<LngBRegion>()
.eq(LngBRegion::getCode, dto.getCode()).ne(dto.getId() != null, LngBRegion::getId, dto.getId()));
if (codeCount > 0) {
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DATA_FIELD_DUPLICATION,
FieldNameConstants.CODE));
}
Long nameCount = this.baseMapper.selectCount(new LambdaQueryWrapper<LngBRegion>()
.eq(LngBRegion::getFullName, dto.getFullName()).ne(dto.getId() != null, LngBRegion::getId, dto.getId()));
if (nameCount > 0) {
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DATA_FIELD_DUPLICATION,
FieldNameConstants.FULL_NAME));
}
}
private void addOrUpdateAfter(Long id) {
String msg = commonCallService.saveAfter(TableNameConstants.LNG_B_REGION, id);
if (StringUtils.isNotBlank(msg)) {
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_EXEC_ERROR, msg));
}
}
private void refreshCahe(){
//异步更新用户表、用户部门表、用户角色表、用户岗位表数据
CompletableFuture.runAsync(() -> {
CacheUtil.refreshRegionList();
});
}
private void filterNode(List<LngBRegionTreeVo> treeVoList,List<String> codeList) {
for(LngBRegionTreeVo tree:treeVoList) {
if( tree.getChildren() != null && tree.getChildren().size() > 0 ) {
tree.setIsLeaf(false);
if( !codeList.contains(tree.getCode())){
tree.setChildren(Lists.newArrayList());
}
filterNode(tree.getChildren(),codeList);
}else {
tree.setIsLeaf(true);
}
}
}
}

View File

@ -1,22 +1,8 @@
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.pictc.constant.FieldNameConstants;
import com.pictc.constant.TableNameConstants;
import com.pictc.enums.BusinessCode;
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.mdm.dto.UpdateLngBBankDto;
import com.xjrsoft.module.mdm.dto.UpdateLngBFeeDto;
import com.xjrsoft.module.mdm.entity.LngBFee;
import com.xjrsoft.module.mdm.mapper.LngBFeeMapper;
import com.xjrsoft.module.mdm.service.IFeeService;
@ -33,75 +19,6 @@ import lombok.AllArgsConstructor;
@AllArgsConstructor
public class FeeServiceImpl extends ServiceImpl<LngBFeeMapper, LngBFee> implements IFeeService {
private final CommonCallService commonCallService;
@Override
@Transactional(rollbackFor = Exception.class)
public Long add(UpdateLngBFeeDto dto) {
this.checkParams(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);
this.addOrUpdateAfter(res.getId());
return res.getId();
}
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean enable(List<Long> ids) {
DataLogTools.enable(UpdateLngBBankDto.class,ids);
for (Long id : ids) {
String msg = commonCallService.enableBefore(TableNameConstants.LNG_B_FEE, id);
if (StringUtils.isNotBlank(msg)) {
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_EXEC_ERROR, msg));
}
}
return true;
}
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean disable(List<Long> ids) {
DataLogTools.disable(UpdateLngBBankDto.class,ids);
for (Long id : ids) {
String msg = commonCallService.disableBefore(TableNameConstants.LNG_B_FEE, id);
if (StringUtils.isNotBlank(msg)) {
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_EXEC_ERROR, msg));
}
}
return true;
}
private void checkParams(UpdateLngBFeeDto dto) {
Long codeCount = this.baseMapper.selectCount(new LambdaQueryWrapper<LngBFee>()
.eq(LngBFee::getCode, dto.getCode()).ne(dto.getId() != null, LngBFee::getId, dto.getId()));
if (codeCount > 0) {
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DATA_FIELD_DUPLICATION,
FieldNameConstants.CODE));
}
Long nameCount = this.baseMapper.selectCount(new LambdaQueryWrapper<LngBFee>()
.eq(LngBFee::getFullName, dto.getFullName()).ne(dto.getId() != null, LngBFee::getId, dto.getId()));
if (nameCount > 0) {
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DATA_FIELD_DUPLICATION,
FieldNameConstants.FULL_NAME));
}
}
private void addOrUpdateAfter(Long id) {
String msg = commonCallService.saveAfter(TableNameConstants.LNG_B_FEE, id);
if (StringUtils.isNotBlank(msg)) {
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_EXEC_ERROR, msg));
}
}
}

View File

@ -1,25 +1,11 @@
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.pictc.constant.FieldNameConstants;
import com.pictc.constant.TableNameConstants;
import com.pictc.enums.BusinessCode;
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.mdm.dto.UpdateLngBStationPngDto;
import com.xjrsoft.module.mdm.entity.LngBStationPng;
import com.xjrsoft.module.mdm.mapper.LngBStationPngMapper;
import com.xjrsoft.module.mdm.service.IPipeGasDownloadPointService;
import com.xjrsoft.module.system.client.ICodeRuleClient;
import lombok.AllArgsConstructor;
@ -32,84 +18,10 @@ import lombok.AllArgsConstructor;
@Service
@AllArgsConstructor
public class PipeGasDownloadPointServiceImpl extends ServiceImpl<LngBStationPngMapper, LngBStationPng> implements IPipeGasDownloadPointService {
private final CommonCallService commonCallService;
private final ICodeRuleClient codeRuleClient;
private final String PNG_DL_POINT_CODE = "pngDlPointCode";
@Override
@Transactional(rollbackFor = Exception.class)
public Long add(UpdateLngBStationPngDto dto) {
String code = codeRuleClient.genEncode(PNG_DL_POINT_CODE);
dto.setCode(code);
this.checkParams(dto);
UpdateLngBStationPngDto res = DataLogTools.insert(dto);
codeRuleClient.useEncode(PNG_DL_POINT_CODE);
this.addOrUpdateAfter(res.getId());
return res.getId();
}
@Override
@Transactional(rollbackFor = Exception.class)
public Long update(UpdateLngBStationPngDto dto) {
this.checkParams(dto);
UpdateLngBStationPngDto res = DataLogTools.update(dto);
this.addOrUpdateAfter(res.getId());
return res.getId();
}
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean enable(List<Long> ids) {
DataLogTools.enable(UpdateLngBStationPngDto.class,ids);
for (Long id : ids) {
String msg = commonCallService.enableBefore(TableNameConstants.LNG_B_STATION_PNG, id);
if (StringUtils.isNotBlank(msg)) {
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_EXEC_ERROR, msg));
}
}
return true;
}
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean disable(List<Long> ids) {
DataLogTools.disable(UpdateLngBStationPngDto.class,ids);
for (Long id : ids) {
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));
}
}
return true;
}
private void checkParams(UpdateLngBStationPngDto dto) {
Long codeCount = this.baseMapper.selectCount(new LambdaQueryWrapper<LngBStationPng>()
.eq(LngBStationPng::getCode, dto.getCode()).ne(dto.getId() != null, LngBStationPng::getId, dto.getId()));
if (codeCount > 0) {
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DATA_FIELD_DUPLICATION,
FieldNameConstants.CODE));
}
Long nameCount = this.baseMapper.selectCount(new LambdaQueryWrapper<LngBStationPng>()
.eq(LngBStationPng::getFullName, dto.getFullName()).ne(dto.getId() != null, LngBStationPng::getId, dto.getId()));
if (nameCount > 0) {
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DATA_FIELD_DUPLICATION,
FieldNameConstants.FULL_NAME));
}
}
private void addOrUpdateAfter(Long id) {
String msg = commonCallService.saveAfter(TableNameConstants.LNG_B_STATION_PNG, id);
if (StringUtils.isNotBlank(msg)) {
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_EXEC_ERROR, msg));
}
}
}

View File

@ -33,46 +33,6 @@ import lombok.AllArgsConstructor;
@AllArgsConstructor
public class PipelineGgasLineServiceImpl extends ServiceImpl<LngBPngLineMapper, LngBPngLine> implements IPipelineGgasLineService {
private final CommonCallService commonCallService;
private final ICodeRuleClient codeRuleClient;
private final String PNG_LINE_CODE = "pngLineCode";
@Override
@Transactional(rollbackFor = Exception.class)
public Long add(UpdateLngBPngLineDto dto) {
String code = codeRuleClient.genEncode(PNG_LINE_CODE);
dto.setCode(code);
this.checkParams(dto);
UpdateLngBPngLineDto res = DataLogTools.insert(dto);
codeRuleClient.useEncode(PNG_LINE_CODE);
this.addOrUpdateAfter(res.getId());
return res.getId();
}
@Override
@Transactional(rollbackFor = Exception.class)
public Long update(UpdateLngBPngLineDto dto) {
this.checkParams(dto);
UpdateLngBPngLineDto res = DataLogTools.update(dto);
this.addOrUpdateAfter(res.getId());
return res.getId();
}
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean enable(List<Long> ids) {
DataLogTools.enable(UpdateLngBPngLineDto.class,ids);
for (Long id : ids) {
String msg = commonCallService.enableBefore(TableNameConstants.LNG_B_PNG_LINE, id);
if (StringUtils.isNotBlank(msg)) {
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_EXEC_ERROR, msg));
}
}
return true;
}
@Override
public LngBPngLine getByCode(String code) {
@ -82,42 +42,6 @@ public class PipelineGgasLineServiceImpl extends ServiceImpl<LngBPngLineMapper,
}
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean disable(List<Long> ids) {
DataLogTools.disable(UpdateLngBPngLineDto.class,ids);
for (Long id : ids) {
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));
}
}
return true;
}
private void checkParams(UpdateLngBPngLineDto dto) {
Long codeCount = this.baseMapper.selectCount(new LambdaQueryWrapper<LngBPngLine>()
.eq(LngBPngLine::getCode, dto.getCode()).ne(dto.getId() != null, LngBPngLine::getId, dto.getId()));
if (codeCount > 0) {
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DATA_FIELD_DUPLICATION,
FieldNameConstants.CODE));
}
Long nameCount = this.baseMapper.selectCount(new LambdaQueryWrapper<LngBPngLine>()
.eq(LngBPngLine::getFullName, dto.getFullName()).ne(dto.getId() != null, LngBPngLine::getId, dto.getId()));
if (nameCount > 0) {
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DATA_FIELD_DUPLICATION,
FieldNameConstants.FULL_NAME));
}
}
private void addOrUpdateAfter(Long id) {
String msg = commonCallService.saveAfter(TableNameConstants.LNG_B_PNG_LINE, id);
if (StringUtils.isNotBlank(msg)) {
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_EXEC_ERROR, msg));
}
}
}

View File

@ -1,22 +1,8 @@
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.pictc.constant.FieldNameConstants;
import com.pictc.constant.TableNameConstants;
import com.pictc.enums.BusinessCode;
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.mdm.dto.UpdateLngBBankDto;
import com.xjrsoft.module.mdm.dto.UpdateLngBTaxDto;
import com.xjrsoft.module.mdm.entity.LngBTax;
import com.xjrsoft.module.mdm.mapper.LngBTaxMapper;
import com.xjrsoft.module.mdm.service.ITaxRateService;
@ -33,74 +19,5 @@ import lombok.AllArgsConstructor;
@AllArgsConstructor
public class TaxRateServiceImpl extends ServiceImpl<LngBTaxMapper, LngBTax> implements ITaxRateService {
private final CommonCallService commonCallService;
@Override
@Transactional(rollbackFor = Exception.class)
public Long add(UpdateLngBTaxDto dto) {
this.checkParams(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);
this.addOrUpdateAfter(res.getId());
return res.getId();
}
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean enable(List<Long> ids) {
DataLogTools.enable(UpdateLngBTaxDto.class,ids);
for (Long id : ids) {
String msg = commonCallService.enableBefore(TableNameConstants.LNG_B_TAX, id);
if (StringUtils.isNotBlank(msg)) {
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_EXEC_ERROR, msg));
}
}
return true;
}
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean disable(List<Long> ids) {
DataLogTools.disable(UpdateLngBBankDto.class,ids);
for (Long id : ids) {
String msg = commonCallService.disableBefore(TableNameConstants.LNG_B_TAX, id);
if (StringUtils.isNotBlank(msg)) {
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_EXEC_ERROR, msg));
}
}
return true;
}
private void checkParams(UpdateLngBTaxDto dto) {
Long codeCount = this.baseMapper.selectCount(new LambdaQueryWrapper<LngBTax>()
.eq(LngBTax::getCode, dto.getCode()).ne(dto.getId() != null, LngBTax::getId, dto.getId()));
if (codeCount > 0) {
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DATA_FIELD_DUPLICATION,
FieldNameConstants.CODE));
}
Long nameCount = this.baseMapper.selectCount(new LambdaQueryWrapper<LngBTax>()
.eq(LngBTax::getFullName, dto.getFullName()).ne(dto.getId() != null, LngBTax::getId, dto.getId()));
if (nameCount > 0) {
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DATA_FIELD_DUPLICATION,
FieldNameConstants.FULL_NAME));
}
}
private void addOrUpdateAfter(Long id) {
String msg = commonCallService.saveAfter(TableNameConstants.LNG_B_TAX, id);
if (StringUtils.isNotBlank(msg)) {
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_EXEC_ERROR, msg));
}
}
}

View File

@ -0,0 +1,460 @@
spring:
#------------------自定义global配置------------------
# 环境 dev|test|prod
#profiles:
# active: dev
# jackson时间格式化
jackson:
time-zone: GMT+8
date-format: yyyy-MM-dd HH:mm:ss
servlet:
multipart:
max-file-size: 100MB
max-request-size: 100MB
enabled: true
mvc:
throw-exception-if-no-handler-found: true
pathmatch:
matching-strategy: ant_path_matcher
#freemarker:
#template-loader-path: classpath:/templates/generateCode
#------------------自定义datasource配置------------------
autoconfigure:
#自动化配置 例外处理
exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
datasource:
type: com.alibaba.druid.pool.DruidDataSource
dynamic:
primary: master
strict: true # 根据数据id找不到数据源报错抛异常
datasource:
master:
driver-class-name: com.kingbase8.Driver
url: jdbc:kingbase8://47.94.165.164:54322/itc?currentSchema=dne_sit
username: itc_dne
password: itc_dne
druid:
# 初始化大小
initialSize: 10
# 最大连接池
maxActive: 50
# 最小连接池
minIdle: 10
# 最大等待超时时间配置获取连接等待超时时间单位都是毫秒ms
maxWait: 60000
# 是否缓存preparedStatement也就是PSCache 官方建议MySQL下建议关闭 个人建议如果想用SQL防火墙 建议打开
poolPreparedStatements: true
# 最大PSCache缓存池
maxPoolPreparedStatementPerConnectionSize: 20
#配置间隔多久才进行一次检测,检测需要关闭的空闲连接
timeBetweenEvictionRunsMillis: 60000
#配置一个连接在池中最小生存的时间
minEvictableIdleTimeMillis: 120000
#配置一个连接在池中最大生存的时间
maxEvictableIdleTimeMillis: 180000
# 测试链接 语句
validationQuery: SELECT 1
# 空闲时检查连接
testWhileIdle: true
# 从连接池中取出时检查连接
testOnBorrow: false
# 归还到连接池时检查连接
testOnReturn: false
# 配置监控统计拦截的filters去掉后监控界面sql无法统计'wall'用于防火墙
filters: stat,slf4j
# 合并多个DruidDataSource的监控数据
useGlobalDataSourceStat: true
# 启用 Keep-Alive 机制
keep-alive: true
keep-alive-between-time-millis: 1800000 # 30分钟
#------------------自定义datasource配置------------------
#------------------自定义global配置------------------
cloud:
nacos: #nacos监控
config:
server-addr: 127.0.0.1:8848 # nacos 配置中心地址
namespace: ITC-MS
group: DNE
username: nacos
password: Lng@123
extension-configs:
# - data-id: global-local.yml
# refresh: true
# group: DNE
# - data-id: discovery-local.yml
# refresh: true
# group: DNE
# - data-id: datasource-local.yml
# refresh: true
# group: DNE
# - data-id: seata-local.yml
# refresh: true
# group: DNE
# - data-id: redis-local.yml
# refresh: true
# group: DNE
- data-id: magic-api.yml
refresh: true
group: DNE
- data-id: sa-token.yml
refresh: true
group: DNE
- data-id: camunda.yml
refresh: true
group: DNE
#
# - data-id: sentinel-local.yml
# refresh: true
# group: DNE
#------------------自定义nacos的discovery配置------------------
discovery:
server-addr: 127.0.0.1:8848
namespace: DNE-MS-SIT
group: DNE-ZBZ
username: nacos
password: Lng@123
#------------------自定义nacos的discovery配置------------------
#------------------自定义sentinel配置------------------
sentinel:
transport:
dashboard: 172.19.3.230:8080 #sentinel dashboard 地址
port: 8719 #默认端口, 如果 被占用,会一直+1 直到未被占用为止
#------------------自定义sentinel配置------------------
#------------------自定义redis配置------------------
redis:
database: 0
host: 47.94.165.164
port: 9620
password: tdjj2HH0fva^2R # 密码(默认为空)
timeout: 60000ms # 连接超时时长(毫秒)
jedis:
pool:
max-active: 1000 # 连接池最大连接数(使用负值表示没有限制)
max-wait: -1ms # 连接池最大阻塞等待时间(使用负值表示没有限制)
max-idle: 10 # 连接池中的最大空闲连接
min-idle: 5 # 连接池中的最小空闲连接
#------------------自定义redis配置------------------
#------------------自定义global配置------------------
workflow:
selectNextUser:
timeout: 1 #选人超时时间单位s流程预审要设置为1立刻超时
schedule:
enabled: true
syncOrgAndUser:
enabled: true
logging:
config: http://${spring.cloud.nacos.config.server-addr}/nacos/v1/cs/configs?group=${spring.cloud.nacos.config.group}&tenant=${spring.cloud.nacos.config.namespace}&username=${spring.cloud.nacos.config.username}&password=${spring.cloud.nacos.config.password}&dataId=logback-spring.xml
level:
org.camunda: debug #打印camunda 日志 一般用于 查看camunda 执行sql
com.xjrsoft: debug
xjrsoft:
oss:
#enabled: true
cloud-type: minio
# access-key: xjrsoft
# secret-key: Xjrsoft9012@@
# endpoint: http://47.106.153.7:9000
# bucket-name: xjrsoft
# prefix: xjr
#阿里云
access-key: admin
secret-key: password123
endpoint: http://minio-api.ges.bjgastx.com:80
bucket-name: fcd2-ma
prefix: dev
job:
enabled: true # 执行器通讯TOKEN [必填]:是否启用定时任务功能;
accessToken: # 执行器通讯TOKEN [选填]:非空时启用;
admin:
addresses: http://xxl-job.ges.bjgastx.com/xxl-job-admin # 调度中心部署跟地址 [选填]:如调度中心集群部署存在多个地址则用逗号分隔。执行器将会使用该地址进行"执行器心跳注册"和"任务结果回调";为空则关闭自动注册;
executor:
address: # 执行器注册 [选填]:优先使用该配置作为注册地址,为空时使用内嵌服务 ”IP:PORT“ 作为注册地址。从而更灵活的支持容器类型执行器动态IP和动态映射端口问题。
appname: xjrsoft # 执行器AppName [选填]:执行器心跳注册分组依据;为空则关闭自动注册
ip: # 执行器IP [选填]默认为空表示自动获取IP多网卡时可手动设置指定IP该IP不会绑定Host仅作为通讯实用地址信息用于 "执行器注册" 和 "调度中心请求并触发任务"
port: 0 # 执行器端口号 [选填]小于等于0则自动获取默认端口为9999单机部署多个执行器时注意要配置不同执行器端口
log-path: /data/logs/xxl-job/job-logs # 执行器运行日志文件存储磁盘路径 [选填] :需要对该路径拥有读写权限;为空则使用默认路径;
log-retention-days: 30 # 执行器日志文件保存天数 [选填] 过期日志自动清理, 限制值大于等于3时生效; 否则, 如-1, 关闭自动清理功能;
# generate:
# #webPath: D:\pm\yfxm-newgit\front #生成代码的路径
# javaPath: F:\ges-scm\code\dev\geg-gas-pcitc\itc-pcitc-demo\itc-pcitc-demo-service
# webPath: D:\Users\ITC\Desktop\codeGenerate
# appPath: D:\pm\yfxm-newgit\uniapp\xjrsoft-uni #前端app
generate:
apiJavaPath: D:\dev\Git\Repository\GDNY\geg-gas-pcitc\itc-pcitc-mdm\itc-pcitc-mdm-api
javaPath: D:\dev\Git\Repository\GDNY\geg-gas-pcitc\itc-pcitc-mdm\itc-pcitc-mdm-service
webPath: D:\dev\Git\Repository\GDNY\geg-gas-pcitc\itc-pcitc-mdm\itc-pcitc-mdm-service
appPath: D:\dev\Git\Repository\GDNY\geg-gas-pcitc\itc-pcitc-mdm\itc-pcitc-mdm-service
tenant:
enabled: true #是否启用多租户
admin-tenant-code: system #管理员租户编码
tenant-field: tenant_id #多租户 区分字段enantCode
default-tenant-code: system
is-use-default-tenant: true
hidden-sub-menu-ids:
- 1419273699655498176
- 1700041673784094722
ignore-table: #忽略多租户的表
- xjr_app_func_design
- xjr_app_menu
- xjr_app_page_design
- xjr_area
- xjr_code_schema
- xjr_databaselink
- xjr_language
- xjr_language_type
- xjr_liteflow_chain
- xjr_liteflow_script
- xjr_menu
- xjr_menu_button
- xjr_menu_column
- xjr_menu_form
- xjr_report
- xjr_report_relation
- xjr_subsystem
- xjr_tenant
- xjr_tenant_authorize
- xjr_app_menu_button
- xjr_app_menu_column
- xjr_app_menu_form
- xjr_app_authorize
- xjr_user
- xjr_department
- xjr_user_dept_relation
- xjr_authorize
- menu_tree
login:
checkCodeWidth: 360 #获取验证码前的校验码 图片宽度
checkCodeHeight: 120 #获取验证码前的校验码 图片高度
checkCodeCharCount: 6 #获取验证码前的校验码 字符数
checkCodeLinkCount: 20 #获取验证码前的校验码 干扰线条数
checkCodeEffectiveTime: 300 #获取手机验证码前的校验码的有效redis时长单位正整数 5分钟*60秒
common:
druid-account: admin # druid 监控账户
druid-password: admin # druid 监控密码
default-password: "000000" #默认密码(用户重置密码后为该密码)
error-type: SYSTEM
white-list:
- 192.168.0.139
exclude-urls:
- /favicon.ico #网站图标
- /webjars/** #swagger(knife4j) 接口文档必要资源
- /swagger-resources/** #swagger(knife4j) 接口文档必要资源
- /v2/api-docs #swagger(knife4j) 接口文档必要资源
- /doc.html #swagger(knife4j) 接口文档必要资源
- /druid/** #druid 监控
- /ureport/** #ureport报表
- /system/captcha # 验证码
- /system/captchaImg # 验证码图片 用于请求手机号码验证的前置判断 2025-02-12 新增登录用手机验证码的预先校验码生成
- /system/captchaImg-by-type # 验证码图片 用于请求手机号码验证的前置判断 2025-04-08 新增登录用账号登录的预先校验码生成
- /system/checkAccountCaptcha #2025-04-08 登录配置查询 拿着用户账号查询登录的是否需要验证码
- /system/login # 登录接口
- /system/login/** # 登录接口
- /system/logout # 登出接口
- /system/logoConfig/logo-info #登录之后加载图片的接口
- /camunda/** # camunda工作台
- /language/** # language
- ${magic-api.web}/** # magic-api web
- ${magic-api.prefix}/** # magic-api 前缀
- /bi/project/info # 桌面
- /system/qrcode-login # 扫码登录
- /oauth/callback/** #回调
- /ssotoken/**
- /client/system/tenant/getAvailableOne
- /system/checkAccountCaptcha
is-sa-token-method-annotation-enabled: true
email:
is_enabled: false
mail_default_server: https://mail.dms.yudean.com/ews/exchange.asmx
mail_suffix: dms.yudean.com # 邮箱后缀
#mail_suffix: qq.com # 邮箱后缀
username: 967711 # 用户域工号
password: UY!kT28Z # 用户域密码
host: #邮件服务器的SMTP地址可选默认为smtp.<发件人邮箱后缀>
port: # 邮件服务器的SMTP端口可选默认25
auth: true
from: # 发件人(必须正确,否则发送失败
user: # 用户名,默认为发件人邮箱前缀
pass: # 密码注意某些邮箱需要为SMTP服务单独设置授权码详情查看相关帮助
enabled_subSystem: true #是否开启子系统 (请勿修改)
enabledTenant: true #是否开启多租户
tenantAdminCode: admin #租户管理员编码
wechatenterprise:
appkey: ww00ce9acc4f193f18
appSecret: 5bYCMH3ULPHzyrJviIFWCIdX0OTyQoFqfnel_noyrwo
agentid: 1000005
redirectUri: http://www.tzx.test.com:8080/oauth/callback/wechat_enterprise
frontUrl: http://localhost:3100/#/login
dingtalk:
appkey: dingaex2gok1rllumlqs
appSecret: Nv2pe-UoR0Z_Iw8d29laZfL3kH6ElmhZpRdPwI7SvmKJmaCI29qCrSlFEiMM88MB
agentid: 839967779
redirectUri: http://www.tzx.test.com:8080/oauth/callback/dingtalk
frontUrl: http://localhost:3100/#/login
ureport:
account: xjrsoft #ureport 账号
password: 123456 #ureport 密码
keycloak:
url: http://192.168.0.221:12829/auth/
realm: test
client-id: tzx-java
secret: yo5kPZlHgmodz4vVASH61zq8i6gMhkk2
user-name: tzx #如果不需要后端再次 可以不需要
password: "000000" #可以不需要
payload: code #从payload 某个key中取值 登录
chatgpt:
proxy-type: 0 # 不开启代理 == -1 http == 0 socket == 1
proxy: 192.168.0.220
port: 1081
api-key: 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 #your api-key. It can be generated in the link https://beta.openai.com/docs/quickstart/adjust-your-settings
# some properties as below have default values. Of course, you can change them.
max-tokens: 4000 # The maximum number of tokens to generate in the completion.The token count of your prompt plus max_tokens cannot exceed the model's context length. Most models have a context length of 2048 tokens (except for the newest models, which support 4096).
# model: text-davinci-003 # GPT-3 models can understand and generate natural language. We offer four main models with different levels of power suitable for different tasks. Davinci is the most capable model, and Ada is the fastest.
# temperature: 0.0 # What sampling temperature to use. Higher values means the model will take more risks. Try 0.9 for more creative applications, and 0 (argmax sampling) for ones with a well-defined answer.We generally recommend altering this or top_p but not both.
# top-p: 1.0 # An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.We generally recommend altering this or temperature but not both.
sms:
platform: GEG_CLOUD #默认使用短信服务商
captcha-sender: 8823053028920 #验证码通道号
captcha-template-id: 97c6fcf9fd0149b39c0ed0e53480116f # 验证码 模板id
notify-sender: 8823053111843 # 提示类提示短信 通道号
notify-template-id: d424de0f2a9244ac9d2f2685cd158635 #提示类短信 模板id
circulated-sender: 8823053111843 # 提示类传阅短信 通道号
circulated-template-id: 5c179070a72447c79568ac22371be803 #提示类传阅短信 模板id
timeout-sender: 8823053111843 # 提示类短超时信 通道号
timeout-template-id: 5c179070a72447c79568ac22371be803 #提示类超时短信 模板id
expire: 300 #有效时长五分钟
send-sms-limit-time: 5 #单个号码短信轮滚(单位:分钟,正整数) 2025-02-12 新增登录短信下发的频次控制
send-sms-limit-count: 3 #单个号码短信轮滚下发限制次数与sendSmsLimitTime一起使用限制时长内允许发送的次数 2025-02-12 新增登录短信下发的频次控制
# 粤电集团短信平台配置
gdyd:
service_url: http://webservices.gdyd.com
service_part: SMSInteWebService
wsdl_url: http://sms.gdyd.com/smsInte/services/SMSInteWebService?wsdl
dbIP: mas.gdyd.com
dbUser: eipm3test
dbPwd: eipm3testPSW
apiCode: eipm3test
dbName: mas
license:
enabled: false #是否需要验证
login-max: 100 #最大登陆人数
start-time: 2023-07-01 00:00:00 #开始时间
end-time: 2023-07-03 17:00:00 #结束时间
company-name: xxx #公司名
contact-number: xxx #联系人
# 互信token密钥
token_secret_key: pK9WM85TTweSnlckk1uJ80rX8cuzDegk
# 前端地址路由url+端口
openLoginLog: true # 是否开启互信方式登录的 秘钥解密算法 中间参数的日志
changeLog:
enabled: false #是否开启表单修改记录功能
dist:
pc_url: http://10.0.252.5:3100
mobile_url: http://10.133.96.101:8077/app
config: gdyd-fcd-xfj
pc_config: xfj-fcd-pc
url: data/gdyd/trust/redirect2
tenant_code_name: tenantCode
sso_cron: 0 0/30 * * * ?
type_name: 新能源 #系统名或者模块名
data-center:
url: https://10.4.116.9:18199/data-service/gateway/v3.0/data-service/scroll/1236365572350097390
userId: 5fb73ca9f5214ad08e61ae14675c5d86
deptId: f03595d8b1fe4de798dd34a58ff52506
subscribeId: 1236365572350098016
accessToken: 8b5401d2431f4fb88cc30062d0c49b0d
whitelist: .jpg,.jpeg,.png,.gif,.bmp,.tiff,.tif,.pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.txt,.csv,.zip,.rar,.7z,.mp3,.mp4,.avi,.mov,.wmv,.flv,.ogg,.ogv,.webm,.wps,.wpt,.doc,.dot,.xls,.xlt,.csv,.txt,.ppt,.dps,.dpt,.json,.ofd
organization:
mergeGroupRoles2Role: true
powerjob:
worker:
enabled: false
app-name: xjrsoft-boot
server-address: 192.168.0.124:7700
protocol: http
store-strategy: disk
max-result-length: 4096
max-appended-wf-context-length: 4096
max-lightweight-task-num: 1024
# 验证码配置
#smst:
# sp: huawei # 短信服务商huawei(华为),ali(阿里巴巴),tencent(腾讯)
# url: https://smsapi.cn-north-4.myhuaweicloud.com:443/sms/batchSendSms/v1 # APP接入地址+接口访问URI
# app_key: 69s6YyLsrLgWW99BJ5K1K26WiF29
# secret_id: RuE1YajkI6FC4Gh2WjVtOpychRGL # API秘钥
# secret_key: RuE1YajkI6FC4Gh2WjVtOpychRGL # 目前只有腾讯用到
# sender: 8823053028920 # 验证码类发送人手机号通道号
# message_sender: 8823053111843 # 通知类发送人手机号通道号
# signature: # 签名名称
# region: default # 地区名阿里和腾讯需要配置默认default
# templates:
# - type: login # 手机登录验证 模板ID keys是短信模板内容中的参数名只有阿里的短信模板需要key去填充其他两个则是传入的数组参数顺序填充
# id: 97c6fcf9fd0149b39c0ed0e53480116f
# keys: code
# - type: reset # 忘记密码-验证手机号码 模板ID
# id: 614a2cd08b704cf393321e1df054e3df
# keys: code
# - type: message # 消息管理发送短信通道码
# id: d424de0f2a9244ac9d2f2685cd158635
# keys: code
cas:
enable: false
#前端路由是hash模式的使用这两个配置需要配合nginx使用否则会跨域
client-service-url: http://10.133.96.105:3800/api/
success-redirect-url: http://10.133.96.105:3800/#/tokenLogin
#前端路由是history模式的只需要使用这个配置一般用于开发时调试
#client-service-url: http://10.133.96.105:3700/tokenLogin
datalog:
db:
url: jdbc:kingbase8://47.94.165.164:54322/itc?currentSchema=data_log_sit
#------------------自定义global配置------------------
#------------------自定义seata配置------------------
seata:
enable: true
application-id: ${spring.application.name}
tx-service-group: default_tx_group
enable-auto-data-source-proxy: true
data-source-proxy-mode: AT
service:
vgroup-mapping:
default_tx_group: default
grouplist:
default: 192.168.112.193:8091
disable-global-transaction: false
registry:
type: nacos
nacos:
application: seata-server
namespace: ${spring.cloud.nacos.discovery.namespace}
server-addr: ${spring.cloud.nacos.discovery.server-addr}
group : ${spring.cloud.nacos.discovery.group}
userName: ${spring.cloud.nacos.discovery.username}
password: ${spring.cloud.nacos.discovery.password}
config:
type: nacos
nacos:
namespace: ${spring.cloud.nacos.config.namespace}
server-addr: ${spring.cloud.nacos.config.server-addr}
group : ${spring.cloud.nacos.config.group}
cluster: default
userName: ${spring.cloud.nacos.config.username}
password: ${spring.cloud.nacos.config.password}
data-id: seataServer.properties
#------------------自定义seata配置------------------
#------------------自定义内容,如果误提交,需要回退------------------

View File

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