This commit is contained in:
张秉卓
2026-01-16 12:25:06 +08:00
13 changed files with 175 additions and 54 deletions

View File

@ -96,7 +96,7 @@ public class LngContractFactPageVo extends BaseModel {
* 币种编码
*/
@ApiModelProperty("币种编码")
@Trans(type = TransType.API, id = "93d735dcb7364a0f8102188ec4d77ac7", transToFieldName = "curName")
@Trans(type = TransType.CURRENCY, transToFieldName = "curName")
private String curCode;
private String curName;
/**

View File

@ -109,7 +109,9 @@ public class LngContractFactVo {
* 币种编码
*/
@ApiModelProperty("币种编码")
@Trans(type = TransType.CURRENCY, transToFieldName = "curName")
private String curCode;
private String curName;
/**

View File

@ -132,8 +132,9 @@ public class LngContractPurVo extends com.xjrsoft.common.model.base.BaseModel{
* 币种
*/
@ApiModelProperty("币种")
@Trans(type = TransType.CURRENCY, transToFieldName = "curName")
private String curCode;
private String curName;
/**
* 合同金额

View File

@ -137,8 +137,9 @@ public class LngContractVo {
* 币种
*/
@ApiModelProperty("币种")
@Trans(type = TransType.CURRENCY, transToFieldName = "curName")
private String curCode;
private String curName;
/**
* 合同金额

View File

@ -49,7 +49,7 @@ public class UpdateLngPngDemandDto implements Serializable {
*/
@LogField(name="版本号",index=2)
@ApiModelProperty("版本号(初始为1变更时+1)")
private Byte verNo;
private Byte verNo = 1;
/**
* 最新版本标识(Y-是N-否版本1主键相同的记录中只有一个Y版本变更时将版本1主键相同的其他记录置为N)

View File

@ -0,0 +1,27 @@
package com.xjrsoft.module.mdm.client;
import java.util.List;
import java.util.Map;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import com.xjrsoft.common.constant.GlobalConstant;
import com.xjrsoft.module.mdm.dto.UpdateLngBBankDto;
/**
* @author: ksy
* @since: 2025/11/5
*/
@FeignClient(value = GlobalConstant.CLIENT_PCITC_MDM_NAME, path = GlobalConstant.CLIENT_API_PRE + GlobalConstant.MDM_MODULE_PREFIX + "/tran/currency")
public interface ICurrencyClient {
@GetMapping("/getAllTranData")
Map<String,String> getAllTranData();
@GetMapping("/getTranById")
String getTranById(@RequestParam("id")String id);
}

View File

@ -20,6 +20,8 @@ import org.springframework.web.multipart.MultipartFile;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.support.ExcelTypeEnum;
import com.pictc.datalog.DataOperationContent;
import com.pictc.datalog.DataOperationListener;
import com.xjrsoft.common.model.result.R;
import com.xjrsoft.common.page.PageOutput;
import com.xjrsoft.common.utils.ExcelUtil;
@ -86,15 +88,39 @@ public class DemandController {
@ApiOperation(value = "新增LngPngDemand")
@SaCheckPermission("demand:add")
public R add(@Valid @RequestBody UpdateLngPngDemandDto dto){
UpdateLngPngDemandDto res = dataService.insert(dto);
return R.ok(res.getId());
return R.ok(dataService.insert(dto,new DataOperationListener<UpdateLngPngDemandDto>() {
@Override
public UpdateLngPngDemandDto before(DataOperationContent<UpdateLngPngDemandDto> content) {
return null;
}
@Override
public UpdateLngPngDemandDto after(DataOperationContent<UpdateLngPngDemandDto> content) {
return null;
}
}));
}
@PutMapping
@ApiOperation(value = "修改LngPngDemand")
@SaCheckPermission("demand:edit")
public R update(@Valid @RequestBody UpdateLngPngDemandDto dto){
return R.ok(dataService.updateById(dto));
return R.ok(dataService.updateById(dto,new DataOperationListener<UpdateLngPngDemandDto>() {
@Override
public UpdateLngPngDemandDto before(DataOperationContent<UpdateLngPngDemandDto> content) {
return null;
}
@Override
public UpdateLngPngDemandDto after(DataOperationContent<UpdateLngPngDemandDto> content) {
return null;
}
}));
}
@DeleteMapping

View File

@ -52,16 +52,8 @@ public class LngPngDemand implements Serializable {
@TableField(updateStrategy = FieldStrategy.IGNORED)
private Long orgId;
/**
* 版本号(初始为1变更时+1)
*/
@ApiModelProperty("版本号(初始为1变更时+1)")
@TableField(updateStrategy = FieldStrategy.IGNORED)
private Byte verNo;
/**
* 最新版本标识(Y-是N-否版本1主键相同的记录中只有一个Y版本变更时将版本1主键相同的其他记录置为N)
*/
@ -78,9 +70,6 @@ public class LngPngDemand implements Serializable {
* 计划日期(次日计划为次日;当日计划为当日;同日、同客户、同销售合同交割点、同上载点、同供应商不能重复(仅检查最新版并去掉变更标识为删除的))
*/
@ApiModelProperty("计划日期(次日计划为次日;当日计划为当日;同日、同客户、同销售合同交割点、同上载点、同供应商不能重复(仅检查最新版并去掉变更标识为删除的))")
@TableField(updateStrategy = FieldStrategy.IGNORED)
private LocalDateTime datePlan;
@ -94,9 +83,6 @@ public class LngPngDemand implements Serializable {
* 交易主体编码(天然气公司/惠贸;只读从合同带)
*/
@ApiModelProperty("交易主体编码(天然气公司/惠贸;只读从合同带)")
@TableField(updateStrategy = FieldStrategy.IGNORED)
private Long comId;
@ -104,9 +90,6 @@ public class LngPngDemand implements Serializable {
* 合同-主信息主键(销售)(lng_contract)
*/
@ApiModelProperty("合同-主信息主键(销售)(lng_contract)")
@TableField(updateStrategy = FieldStrategy.IGNORED)
private Long ksId;
@ -218,9 +201,6 @@ public class LngPngDemand implements Serializable {
* 日批复量(方)(只读)
*/
@ApiModelProperty("日批复量(方)(只读)")
@TableField(updateStrategy = FieldStrategy.IGNORED)
private BigDecimal qtySalesM3;
@ -228,9 +208,6 @@ public class LngPngDemand implements Serializable {
* 销售价格(元/吉焦)(提交时获取)
*/
@ApiModelProperty("销售价格(元/吉焦)(提交时获取)")
@TableField(updateStrategy = FieldStrategy.IGNORED)
private BigDecimal priceSalesGj;
@ -238,9 +215,6 @@ public class LngPngDemand implements Serializable {
* 销售价格(元/方)(提交时获取)
*/
@ApiModelProperty("销售价格(元/方)(提交时获取)")
@TableField(updateStrategy = FieldStrategy.IGNORED)
private BigDecimal priceSalesM3;
@ -264,9 +238,6 @@ public class LngPngDemand implements Serializable {
* 提交时间
*/
@ApiModelProperty("提交时间")
@TableField(updateStrategy = FieldStrategy.IGNORED)
private LocalDateTime timeSubmit;
@ -331,6 +302,13 @@ public class LngPngDemand implements Serializable {
@TableField(fill = FieldFill.INSERT, updateStrategy = FieldStrategy.IGNORED)
private Long ruleUserId;
/**
* 版本号(初始为1变更时+1)
*/
@ApiModelProperty("版本号(初始为1变更时+1)")
@TableField(updateStrategy = FieldStrategy.IGNORED,fill = FieldFill.INSERT)
@Version // 指定实际字段名
private Byte verNo;
/**
* lngPngDemandPur

View File

@ -12,6 +12,6 @@ import org.apache.ibatis.annotations.Mapper;
* @Version 1.0
*/
@Mapper
public interface LngPngDemandPurMapper extends MPJBaseMapper<LngPngDemandPur> {
public interface LngPngDemandPurMapper extends MPJBaseMapper<LngPngDemandPur>,BaseMapper<LngPngDemandPur> {
}

View File

@ -0,0 +1,56 @@
package com.xjrsoft.module.mdm.client;
import java.util.List;
import java.util.Map;
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.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.xjrsoft.common.constant.GlobalConstant;
import com.xjrsoft.common.utils.TenantUtil;
import com.xjrsoft.module.mdm.dto.UpdateLngBBankDto;
import com.xjrsoft.module.mdm.entity.LngBBank;
import com.xjrsoft.module.mdm.entity.LngBCurrency;
import com.xjrsoft.module.mdm.entity.LngBStationLng;
import com.xjrsoft.module.mdm.service.IBankService;
import com.xjrsoft.module.mdm.service.ICurrencyService;
import com.xjrsoft.module.mdm.service.ILNGStationService;
import lombok.AllArgsConstructor;
/**
* @author: yjw
* @since: 2025/3/5
*/
//@Api(hidden = true)
@RestController
@RequestMapping(GlobalConstant.CLIENT_API_PRE + GlobalConstant.MDM_MODULE_PREFIX + "/tran/currency")
@AllArgsConstructor
public class CurrencyClientImpl implements ICurrencyClient {
private final ICurrencyService currencyService;
@GetMapping("/getAllTranData")
@Override
public Map<String, String> getAllTranData() {
try {
TenantUtil.ignore(true);
List<LngBCurrency> list = currencyService.list();
return list.stream().collect(Collectors.toMap(LngBCurrency::getCode,LngBCurrency::getFullName));
}finally {
TenantUtil.clear();
}
}
@GetMapping("/getTranById")
@Override
public String getTranById(@RequestParam("id")String code) {
LngBCurrency currency = currencyService.getByCode(code);
return currency!=null?currency.getFullName():null;
}
}

View File

@ -1,8 +1,18 @@
package com.xjrsoft.module.mdm.controller;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.StrUtil;
import java.util.List;
import javax.validation.Valid;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.xjrsoft.common.model.result.R;
@ -17,13 +27,13 @@ import com.xjrsoft.module.mdm.entity.LngBCurrency;
import com.xjrsoft.module.mdm.service.ICurrencyService;
import com.xjrsoft.module.mdm.vo.LngBCurrencyPageVo;
import com.xjrsoft.module.mdm.vo.LngBCurrencyVo;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.StrUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.List;
/**
* @title: 币种管理
@ -41,6 +51,7 @@ public class CurrencyController {
private final ICurrencyService currencyService;
private final DatalogService dataService;
@GetMapping(value = "/page")
@ApiOperation(value="LngBCurrency列表(分页)")
@SaCheckPermission("currency:list")

View File

@ -1,12 +1,13 @@
package com.xjrsoft.module.mdm.service;
import java.util.List;
import javax.validation.Valid;
import com.baomidou.mybatisplus.extension.service.IService;
import com.xjrsoft.module.mdm.dto.UpdateLngBCurrencyDto;
import com.xjrsoft.module.mdm.entity.LngBCurrency;
import javax.validation.Valid;
import java.util.List;
/**
* @title: service
* @Author 管理员
@ -22,4 +23,6 @@ public interface ICurrencyService extends IService<LngBCurrency> {
boolean enable(@Valid List<Long> ids);
boolean disable(@Valid List<Long> ids);
LngBCurrency getByCode(String code);
}

View File

@ -1,5 +1,12 @@
package com.xjrsoft.module.mdm.service.impl;
import java.util.List;
import java.util.Objects;
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;
@ -8,20 +15,17 @@ import com.pictc.enums.BusinessCode;
import com.pictc.enums.ExceptionCommonCode;
import com.pictc.enums.ValidEnum;
import com.pictc.utils.DataLogTools;
import com.xjrsoft.common.advice.tran.CurrencyDataProvider;
import com.xjrsoft.common.enums.YesOrNoEnum;
import com.xjrsoft.common.exception.BusinessException;
import com.xjrsoft.module.common.db.service.CommonCallService;
import com.xjrsoft.module.mdm.dto.UpdateLngBCurrencyDto;
import com.xjrsoft.module.mdm.entity.LngBCurrency;
import com.xjrsoft.module.mdm.mapper.LngBCurrencyMapper;
import com.xjrsoft.module.mdm.service.ICurrencyService;
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 lombok.AllArgsConstructor;
/**
* @title: service
@ -35,12 +39,16 @@ public class CurrencyServiceImpl extends ServiceImpl<LngBCurrencyMapper, LngBCur
private final CommonCallService commonCallService;
private final CurrencyDataProvider tranProvider;
@Override
@Transactional(rollbackFor = Exception.class)
public Long add(UpdateLngBCurrencyDto dto) {
this.checkParams(dto);
UpdateLngBCurrencyDto res = DataLogTools.insert(dto);
this.addOrUpdateAfter(res.getId());
tranProvider.saveData(dto.getCode(), dto.getFullName());
return res.getId();
}
@ -84,6 +92,7 @@ public class CurrencyServiceImpl extends ServiceImpl<LngBCurrencyMapper, LngBCur
this.checkParams(dto);
DataLogTools.update(dto);
this.addOrUpdateAfter(dto.getId());
tranProvider.saveData(dto.getCode(), dto.getFullName());
return true;
}
@ -112,4 +121,11 @@ public class CurrencyServiceImpl extends ServiceImpl<LngBCurrencyMapper, LngBCur
}
return true;
}
@Override
public LngBCurrency getByCode(String code) {
LambdaQueryWrapper<LngBCurrency> queryWrapper = new LambdaQueryWrapper<LngBCurrency>();
queryWrapper.eq(LngBCurrency::getCode,code);
return baseMapper.selectOne(queryWrapper);
}
}