银行转换
This commit is contained in:
@ -0,0 +1,24 @@
|
||||
package com.xjrsoft.module.mdm.client;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* @author: ksy
|
||||
* @since: 2025/11/5
|
||||
*/
|
||||
@FeignClient(value = GlobalConstant.CLIENT_PCITC_MDM_NAME, path = GlobalConstant.CLIENT_API_PRE + GlobalConstant.MDM_MODULE_PREFIX + "/tran/lngBank")
|
||||
public interface ILngBankClient {
|
||||
|
||||
@GetMapping("/getAllTranData")
|
||||
Map<String,String> getAllTranData();
|
||||
|
||||
@GetMapping("/getTranById")
|
||||
String getTranById(@RequestParam("id")String id);
|
||||
|
||||
}
|
||||
@ -8,6 +8,9 @@ import java.time.LocalDateTime;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
import com.xjrsoft.common.annotation.Trans;
|
||||
import com.xjrsoft.common.enums.TransType;
|
||||
|
||||
/**
|
||||
* @title: 表单出参
|
||||
* @Author 管理员
|
||||
@ -35,8 +38,15 @@ public class LngCustomerBankVo {
|
||||
* 银行
|
||||
*/
|
||||
@ApiModelProperty("银行")
|
||||
@Trans(type = TransType.LNG_BANK, transToFieldName = "bankName")
|
||||
private String bankCode;
|
||||
|
||||
/**
|
||||
* 银行
|
||||
*/
|
||||
@ApiModelProperty("银行名称")
|
||||
private String bankName;
|
||||
|
||||
|
||||
/**
|
||||
* 账号名称
|
||||
|
||||
@ -8,6 +8,9 @@ import java.time.LocalDateTime;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
import com.xjrsoft.common.annotation.Trans;
|
||||
import com.xjrsoft.common.enums.TransType;
|
||||
|
||||
/**
|
||||
* @title: 表单出参
|
||||
* @Author 管理员
|
||||
@ -35,8 +38,15 @@ public class LngSupplierBankVo {
|
||||
* 银行
|
||||
*/
|
||||
@ApiModelProperty("银行")
|
||||
@Trans(type = TransType.LNG_BANK, transToFieldName = "bankName")
|
||||
private String bankCode;
|
||||
|
||||
/**
|
||||
* 银行
|
||||
*/
|
||||
@ApiModelProperty("银行名称")
|
||||
private String bankName;
|
||||
|
||||
|
||||
/**
|
||||
* 账号名称
|
||||
|
||||
@ -0,0 +1,52 @@
|
||||
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.entity.LngBBank;
|
||||
import com.xjrsoft.module.mdm.entity.LngBStationLng;
|
||||
import com.xjrsoft.module.mdm.service.IBankService;
|
||||
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/lngBank")
|
||||
@AllArgsConstructor
|
||||
public class LngBankClientImpl implements ILngStationClient {
|
||||
|
||||
private final IBankService lngBankService;
|
||||
|
||||
@GetMapping("/getAllTranData")
|
||||
@Override
|
||||
public Map<String, String> getAllTranData() {
|
||||
try {
|
||||
TenantUtil.ignore(true);
|
||||
List<LngBBank> list = lngBankService.list();
|
||||
return list.stream().collect(Collectors.toMap(LngBBank::getCode,LngBBank::getFullName));
|
||||
}finally {
|
||||
TenantUtil.clear();
|
||||
}
|
||||
}
|
||||
|
||||
@GetMapping("/getTranById")
|
||||
@Override
|
||||
public String getTranById(@RequestParam("id")String code) {
|
||||
LngBBank bank = lngBankService.getByCode(code);
|
||||
return bank!=null?bank.getFullName():null;
|
||||
}
|
||||
|
||||
}
|
||||
@ -21,11 +21,11 @@ import com.pictc.datalog.DataOperationContent;
|
||||
import com.pictc.datalog.DataOperationListener;
|
||||
import com.pictc.enums.BusinessCode;
|
||||
import com.pictc.enums.ExceptionCommonCode;
|
||||
import com.xjrsoft.common.advice.tran.LngBankDataProvider;
|
||||
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;
|
||||
@ -66,6 +66,8 @@ public class BankController {
|
||||
|
||||
private final String BANK_CODE = "bankCode";
|
||||
|
||||
private final LngBankDataProvider tranProvider;
|
||||
|
||||
@GetMapping(value = "/page")
|
||||
@ApiOperation(value="LngBBank列表(分页)")
|
||||
@SaCheckPermission("bank:list")
|
||||
@ -134,7 +136,9 @@ public class BankController {
|
||||
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_EXEC_ERROR, msg));
|
||||
}
|
||||
codeRuleClient.useEncode(BANK_CODE);
|
||||
return content.getObj();
|
||||
UpdateLngBBankDto obj =content.getObj();
|
||||
tranProvider.saveData(obj.getCode(), obj.getFullName());
|
||||
return obj;
|
||||
}
|
||||
}));
|
||||
|
||||
@ -144,7 +148,24 @@ public class BankController {
|
||||
@ApiOperation(value = "修改LngBBank")
|
||||
@SaCheckPermission("bank:edit")
|
||||
public R update(@Valid @RequestBody UpdateLngBBankDto dto){
|
||||
return R.ok(dataService.updateById(dto));
|
||||
return R.ok(dataService.updateById(dto,new DataOperationListener<UpdateLngBBankDto>() {
|
||||
|
||||
@Override
|
||||
public UpdateLngBBankDto before(DataOperationContent<UpdateLngBBankDto> content) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@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));
|
||||
}
|
||||
UpdateLngBBankDto obj =content.getObj();
|
||||
tranProvider.saveData(obj.getCode(), obj.getFullName());
|
||||
return obj;
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
|
||||
@ -12,5 +12,5 @@ import com.xjrsoft.module.mdm.entity.LngBBank;
|
||||
|
||||
public interface IBankService extends IService<LngBBank> {
|
||||
|
||||
|
||||
LngBBank getByCode(String code);
|
||||
}
|
||||
|
||||
@ -2,6 +2,7 @@ package com.xjrsoft.module.mdm.service.impl;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.xjrsoft.module.mdm.entity.LngBBank;
|
||||
import com.xjrsoft.module.mdm.mapper.LngBBankMapper;
|
||||
@ -19,5 +20,12 @@ import lombok.AllArgsConstructor;
|
||||
@AllArgsConstructor
|
||||
public class BankServiceImpl extends ServiceImpl<LngBBankMapper, LngBBank> implements IBankService {
|
||||
|
||||
@Override
|
||||
public LngBBank getByCode(String code) {
|
||||
LambdaQueryWrapper<LngBBank> queryWrapper = new LambdaQueryWrapper<LngBBank>();
|
||||
queryWrapper.eq(LngBBank::getCode,code);
|
||||
return baseMapper.selectOne(queryWrapper);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -1,14 +1,15 @@
|
||||
package com.xjrsoft.module.supplier.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.github.yulichang.base.MPJBaseServiceImpl;
|
||||
import com.xjrsoft.module.supplier.entity.LngScoreDtl;
|
||||
import com.xjrsoft.module.supplier.entity.LngScore;
|
||||
import com.xjrsoft.module.supplier.entity.LngSupplier;
|
||||
import com.xjrsoft.module.supplier.mapper.LngSupplierMapper;
|
||||
import com.xjrsoft.module.supplier.mapper.LngSupplierScoreDtlMapper;
|
||||
import com.xjrsoft.module.mdm.entity.LngBRegion;
|
||||
import com.xjrsoft.module.supplier.dto.UpdateLngSupplierDto;
|
||||
import com.xjrsoft.module.supplier.entity.LngScore;
|
||||
import com.xjrsoft.module.supplier.mapper.LngSupplierScoreMapper;
|
||||
import com.xjrsoft.module.supplier.service.IScoreSupplierService;
|
||||
import com.xjrsoft.module.supplier.vo.LngScoreVo;
|
||||
@ -17,14 +18,6 @@ import com.xjrsoft.module.system.vo.LngFileUploadVo;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
|
||||
/**
|
||||
* @title: service
|
||||
|
||||
Reference in New Issue
Block a user