This commit is contained in:
张秉卓
2025-11-06 17:03:16 +08:00
17 changed files with 183 additions and 79 deletions

View File

@ -18,6 +18,8 @@
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<docker-image-name>pcitc/itc-pcitc-demo</docker-image-name>
<libServerUrl>http://172.27.46.206:23117</libServerUrl>
<ignoreUpload>false</ignoreUpload>
</properties>
<dependencies>
@ -81,7 +83,7 @@
<build>
<finalName>app</finalName>
<plugins>
<plugin>
<!-- <plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.7.6</version>
@ -91,12 +93,30 @@
<goal>repackage</goal>
</goals>
<configuration>
<!--<classifier>classes</classifier>-->
<classifier>classes</classifier>
<attach>false</attach>
</configuration>
</execution>
</executions>
</plugin>
</plugin> -->
<plugin>
<groupId>com.geg</groupId>
<artifactId>tanuki-boot-maven-plugin</artifactId>
<version>1.0.0</version>
<configuration>
<libServerUrl>${libServerUrl}</libServerUrl>
<ignoreUpload>${ignoreUpload}</ignoreUpload>
<libServerUser>${libServerUser}</libServerUser>
<libServerPwd>${libServerPwd}</libServerPwd>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>

View File

@ -142,34 +142,17 @@ public class Testfrom3Controller {
@Override
public UpdateTestfrom3Dto before(DataOperationContent<UpdateTestfrom3Dto> content) {
if(content.getType()==OperationType.DELETE) {
CommonCallUtils.deleteBefore(content.getTableName(),content.getIdValue());
}else if(content.getType()==OperationType.DISABLE){
CommonCallUtils.disableBefore(content.getTableName(),content.getIdValue());
}else if(content.getType()==OperationType.ENABLE){
CommonCallUtils.enableBefore(content.getTableName(),content.getIdValue());
}
return content.getObj();
}
@Override
public UpdateTestfrom3Dto after(DataOperationContent<UpdateTestfrom3Dto> content) {
if(content.getType()==OperationType.INSERT || content.getType()==OperationType.UPDATE) {
if(content.getType()==OperationType.UPDATE) {
CommonCallUtils.saveAfter(content.getTableName(),content.getIdValue());
}
return content.getObj();
}
@Override
public void onError(DataOperationContent<UpdateTestfrom3Dto> content) {
// TODO Auto-generated method stub
}
@Override
public void onFinally(DataOperationContent<UpdateTestfrom3Dto> content) {
// TODO Auto-generated method stub
}
}));
}

View File

@ -0,0 +1,38 @@
package com.xjrsoft.module.dev.entity;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @title: 测试3
* @Author 管理员
* @Date: 2025-09-25
* @Version 1.0
*/
@Data
@TableName("sys_jar_info")
@ApiModel(value = "jar包明细对象", description = "jar包明细")
public class SysJarInfo {
/**
*
*/
@ApiModelProperty("")
@TableId
private String id;
private String name;
private String custom;
private String url;
private String fid;
}

View File

@ -16,7 +16,6 @@
<properties>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<revision>2.0.4</revision>
</properties>
<dependencies>

View File

@ -7,13 +7,17 @@ import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.List;
import javax.sql.DataSource;
import org.springframework.dao.DataAccessException;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.datasource.DataSourceUtils;
import org.springframework.jdbc.support.JdbcUtils;
import com.pictc.jdbc.model.JdbcParam;
import com.pictc.utils.CollectionUtils;
import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
@ -23,7 +27,7 @@ import lombok.extern.slf4j.Slf4j;
@Setter
public class JdbcContext {
public static final int DEF_STEP = 1000;
public static final int DEF_STEP = 1000;
private JdbcTemplate jdbc;

View File

@ -10,6 +10,7 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.toolkit.SqlRunner;
import com.pictc.jdbc.model.JdbcParam;
import com.pictc.jdbc.model.QueryParameter;
import com.pictc.utils.CollectionUtils;

View File

@ -4,10 +4,10 @@ import java.util.List;
import org.springframework.stereotype.Component;
import com.baomidou.mybatisplus.extension.toolkit.SqlRunner;
import com.google.api.client.util.Lists;
import com.pictc.jdbc.JdbcTools;
import com.pictc.jdbc.model.JdbcParam;
import com.pictc.utils.ListUtils;
import com.pictc.utils.StringUtils;
/**

View File

@ -0,0 +1,17 @@
package com.xjrsoft.module.mdm.client;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import com.xjrsoft.common.constant.GlobalConstant;
/**
* @author: ksy
* @since: 2025/11/5
*/
@FeignClient(value = GlobalConstant.CLIENT_PCITC_MDM_NAME, path = GlobalConstant.CLIENT_API_PRE + GlobalConstant.MDM_MODULE_PREFIX + "/countryRegion")
public interface ICountryRegionClient {
@GetMapping("/refreshCache")
void refreshCache();
}

View File

@ -1,22 +1,12 @@
package com.xjrsoft.module.mdm.dto;
import java.io.Serializable;
import com.pictc.annotations.datalog.LogField;
import com.pictc.annotations.datalog.LogTable;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalTime;
import java.time.LocalDateTime;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.List;
import com.pictc.annotations.datalog.LogTable;
import com.pictc.annotations.datalog.LogField;
import com.pictc.annotations.datalog.LogJoin;
import com.pictc.annotations.datalog.LogJoinColumn;
import com.pictc.annotations.datalog.JoinCaseType;
import com.pictc.annotations.datalog.JoinType;
import com.pictc.annotations.datalog.ValueDirectionType;

View File

@ -1,22 +1,12 @@
package com.xjrsoft.module.mdm.dto;
import java.io.Serializable;
import com.pictc.annotations.datalog.LogField;
import com.pictc.annotations.datalog.LogTable;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalTime;
import java.time.LocalDateTime;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.List;
import com.pictc.annotations.datalog.LogTable;
import com.pictc.annotations.datalog.LogField;
import com.pictc.annotations.datalog.LogJoin;
import com.pictc.annotations.datalog.LogJoinColumn;
import com.pictc.annotations.datalog.JoinCaseType;
import com.pictc.annotations.datalog.JoinType;
import com.pictc.annotations.datalog.ValueDirectionType;

View File

@ -0,0 +1,49 @@
package com.xjrsoft.module.mdm.client;
import java.util.List;
import java.util.stream.Collectors;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.xjrsoft.common.constant.GlobalConstant;
import com.xjrsoft.common.utils.RedisUtil;
import com.xjrsoft.common.utils.TenantUtil;
import com.xjrsoft.module.mdm.entity.LngBRegion;
import com.xjrsoft.module.mdm.service.ICountryRegionService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
/**
* @author: yjw
* @since: 2025/3/5
*/
//@Api(hidden = true)
@RestController
@RequestMapping(GlobalConstant.CLIENT_API_PRE + GlobalConstant.MDM_MODULE_PREFIX + "/countryRegion")
@AllArgsConstructor
@Slf4j
public class CountryRegionClientImpl implements ICountryRegionClient {
private final ICountryRegionService countryRegionService;
private final RedisUtil redisUtil;
@GetMapping("/refreshCache")
public void refreshCache() {
try {
TenantUtil.ignore(true);
log.info("MDM: 加载所有国家地区表缓存开始");
List<LngBRegion> list = countryRegionService.list();
redisUtil.set(GlobalConstant.REGION_CACHE_KEY, list);
redisUtil.set(GlobalConstant.REGION_NAME_CACHE_KEY, list.stream().collect(Collectors.toMap(LngBRegion::getCode,LngBRegion::getFullPath)));
log.info("MDM: 加载所有国家地区表缓存结束");
}finally {
TenantUtil.clear();
}
}
}

View File

@ -113,7 +113,6 @@ 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);
}

View File

@ -24,7 +24,7 @@ import com.xjrsoft.module.datalog.vo.DataChangeLogVo;
import com.xjrsoft.module.mdm.dto.LngBFeePageDto;
import com.xjrsoft.module.mdm.dto.UpdateLngBFeeDto;
import com.xjrsoft.module.mdm.entity.LngBFee;
import com.xjrsoft.module.mdm.service.IExpenseNameService;
import com.xjrsoft.module.mdm.service.IFeeService;
import com.xjrsoft.module.mdm.vo.LngBFeePageVo;
import com.xjrsoft.module.mdm.vo.LngBFeeVo;
@ -42,18 +42,18 @@ import lombok.AllArgsConstructor;
* @Version 1.0
*/
@RestController
@RequestMapping("/mdm" + "/expenseName")
@Api(value = "/mdm" + "/expenseName",tags = "费用名称代码")
@RequestMapping("/mdm" + "/fee")
@Api(value = "/mdm" + "/fee",tags = "费用名称代码")
@AllArgsConstructor
public class ExpenseNameController {
public class FeeController {
private final IExpenseNameService expenseNameService;
private final IFeeService feeService;
private final DatalogService dataService;
@GetMapping(value = "/page")
@ApiOperation(value="LngBFee列表(分页)")
@SaCheckPermission("expenseName:list")
@SaCheckPermission("fee:list")
public R page(@Valid LngBFeePageDto dto){
LambdaQueryWrapper<LngBFee> queryWrapper = new LambdaQueryWrapper<>();
@ -64,16 +64,16 @@ public class ExpenseNameController {
.like(StrUtil.isNotBlank(dto.getNote()),LngBFee::getNote,dto.getNote())
.orderByAsc(LngBFee::getSort,LngBFee::getCode)
.select(LngBFee.class,x -> VoToColumnUtil.fieldsToColumns(LngBFeePageVo.class).contains(x.getProperty()));
IPage<LngBFee> page = expenseNameService.page(ConventPage.getPage(dto), queryWrapper);
IPage<LngBFee> page = feeService.page(ConventPage.getPage(dto), queryWrapper);
PageOutput<LngBFeePageVo> pageOutput = ConventPage.getPageOutput(page, LngBFeePageVo.class);
return R.ok(pageOutput);
}
@GetMapping(value = "/info")
@ApiOperation(value="根据id查询LngBFee信息")
@SaCheckPermission("expenseName:detail")
@SaCheckPermission("fee:detail")
public R info(@RequestParam Long id){
LngBFee lngBFee = expenseNameService.getById(id);
LngBFee lngBFee = feeService.getById(id);
if (lngBFee == null) {
return R.error("找不到此数据!");
}
@ -83,21 +83,21 @@ public class ExpenseNameController {
@PostMapping
@ApiOperation(value = "新增LngBFee")
@SaCheckPermission("expenseName:add")
@SaCheckPermission("fee:add")
public R add(@Valid @RequestBody UpdateLngBFeeDto dto){
return R.ok(expenseNameService.add(dto));
return R.ok(feeService.add(dto));
}
@PutMapping
@ApiOperation(value = "修改LngBFee")
@SaCheckPermission("expenseName:edit")
@SaCheckPermission("fee:edit")
public R update(@Valid @RequestBody UpdateLngBFeeDto dto){
return R.ok(expenseNameService.update(dto));
return R.ok(feeService.update(dto));
}
@DeleteMapping
@ApiOperation(value = "删除")
@SaCheckPermission("expenseName:delete")
@SaCheckPermission("fee:delete")
public R delete(@Valid @RequestBody List<Long> ids){
return R.ok(dataService.deleteByIds(UpdateLngBFeeDto.class, ids));
@ -105,7 +105,7 @@ public class ExpenseNameController {
@GetMapping(value = "/datalog")
@ApiOperation(value="根据id查询LngBFee数据详细日志")
@SaCheckPermission("expenseName:datalog")
@SaCheckPermission("fee:datalog")
public R datalog(@RequestParam Long id){
List<DataChangeLogVo> logs = dataService.findLogsByEntityId(UpdateLngBFeeDto.class,id);
return R.ok(logs);
@ -113,7 +113,7 @@ public class ExpenseNameController {
@PostMapping("/enable")
@ApiOperation(value = "启用")
@SaCheckPermission("expenseName:enable")
@SaCheckPermission("fee:enable")
public R enable(@Valid @RequestBody List<Long> ids){
return R.ok(dataService.enable(UpdateLngBFeeDto.class,ids));
}
@ -121,7 +121,7 @@ public class ExpenseNameController {
@PostMapping("/disable")
@ApiOperation(value = "禁用")
@SaCheckPermission("expenseName:disable")
@SaCheckPermission("fee:disable")
public R disable(@Valid @RequestBody List<Long> ids){
return R.ok(dataService.disable(UpdateLngBFeeDto.class,ids));
}

View File

@ -13,7 +13,7 @@ import com.xjrsoft.module.mdm.entity.LngBFee;
* @Version 1.0
*/
public interface IExpenseNameService extends IService<LngBFee> {
public interface IFeeService extends IService<LngBFee> {
Boolean enable(List<Long> ids);

View File

@ -1,6 +1,7 @@
package com.xjrsoft.module.mdm.service.impl;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
@ -14,6 +15,7 @@ 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;
@ -54,6 +56,7 @@ public class CountryRegionServiceImpl extends ServiceImpl<LngBRegionMapper, LngB
this.checkParams(dto);
UpdateLngBRegionDto res = DataLogTools.insert(dto);
this.addOrUpdateAfter(res.getId());
refreshCahe();
return res.getId();
}
@ -67,6 +70,7 @@ public class CountryRegionServiceImpl extends ServiceImpl<LngBRegionMapper, LngB
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_EXEC_ERROR, msg));
}
}
refreshCahe();
return true;
}
@ -81,6 +85,7 @@ public class CountryRegionServiceImpl extends ServiceImpl<LngBRegionMapper, LngB
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_EXEC_ERROR, msg));
}
}
refreshCahe();
return true;
}
@ -102,6 +107,7 @@ public class CountryRegionServiceImpl extends ServiceImpl<LngBRegionMapper, LngB
this.checkParams(dto);
UpdateLngBRegionDto res = DataLogTools.update(dto);
this.addOrUpdateAfter(res.getId());
refreshCahe();
return res.getId();
}
@ -126,5 +132,13 @@ public class CountryRegionServiceImpl extends ServiceImpl<LngBRegionMapper, LngB
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_EXEC_ERROR, msg));
}
}
private void refreshCahe(){
//异步更新用户表、用户部门表、用户角色表、用户岗位表数据
CompletableFuture.runAsync(() -> {
CacheUtil.refreshRegionList();
});
}
}

View File

@ -19,7 +19,7 @@ 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.IExpenseNameService;
import com.xjrsoft.module.mdm.service.IFeeService;
import lombok.AllArgsConstructor;
@ -31,7 +31,7 @@ import lombok.AllArgsConstructor;
*/
@Service
@AllArgsConstructor
public class ExpenseNameServiceImpl extends ServiceImpl<LngBFeeMapper, LngBFee> implements IExpenseNameService {
public class FeeServiceImpl extends ServiceImpl<LngBFeeMapper, LngBFee> implements IFeeService {
private final CommonCallService commonCallService;

View File

@ -11,7 +11,7 @@
<packaging>pom</packaging>
<modules>
<module>itc-pcitc-demo</module>
<!-- <module>itc-pcitc-demo</module> -->
<module>itc-pcitc-dependencies</module>
<module>itc-pcitc-mdm</module>
<!-- <module>itc-pcitc-purchasing</module>
@ -23,7 +23,7 @@
</modules>
<properties>
<revision>2.0.4</revision>
<revision>2.0.8</revision>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>8</java.version>
@ -43,7 +43,7 @@
<dependency>
<groupId>com.geg</groupId>
<artifactId>itc-framework-ms</artifactId>
<version>2.0.4</version>
<version>2.0.8</version>
<type>pom</type>
<scope>import</scope>
</dependency>