Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
2026-01-20 18:12:44 +08:00
24 changed files with 317 additions and 159 deletions

View File

@ -3,6 +3,8 @@ package com.xjrsoft.module.approve;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @title: 审批通用类
@ -36,5 +38,5 @@ public class ApproveDto<T> {
/**
* 操作数据
*/
private T data;
private List<T> data;
}

View File

@ -80,7 +80,7 @@ public class LngPngApproPurVo extends com.xjrsoft.common.model.base.BaseModel{
* 采购合同名称
*/
@ApiModelProperty("采购合同名称")
private Long kpName;
private String kpName;
/**

View File

@ -102,7 +102,7 @@ public class LngPngApproVo extends com.xjrsoft.common.model.base.BaseModel{
* 交易主体名称(天然气公司/惠贸)
*/
@ApiModelProperty("交易主体名称(天然气公司/惠贸)")
private Long comName;
private String comName;
/**

View File

@ -7,6 +7,7 @@ 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.vo.LngBRegionVo;
/**
* @author: ksy
@ -19,6 +20,6 @@ public interface ICountryRegionClient {
Map<String,String> getAllTranData();
@GetMapping("/getTranById")
String getTranById(@RequestParam("id")String id);
LngBRegionVo getTranById(@RequestParam("id")String id);
}

View File

@ -1,6 +1,6 @@
package com.xjrsoft.module.mdm.client;
import java.util.List;
import java.util.Map;
import org.springframework.cloud.openfeign.FeignClient;
@ -8,7 +8,7 @@ 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;
import com.xjrsoft.module.mdm.vo.LngBCurrencyVo;
/**
* @author: ksy
@ -21,7 +21,7 @@ public interface ICurrencyClient {
Map<String,String> getAllTranData();
@GetMapping("/getTranById")
String getTranById(@RequestParam("id")String id);
LngBCurrencyVo getTranById(@RequestParam("id")String id);
}

View File

@ -9,6 +9,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import com.xjrsoft.common.constant.GlobalConstant;
import com.xjrsoft.module.mdm.dto.UpdateLngBBankDto;
import com.xjrsoft.module.mdm.vo.LngBBankVo;
/**
* @author: ksy
@ -21,7 +22,7 @@ public interface ILngBankClient {
Map<String,String> getAllTranData();
@GetMapping("/getTranById")
String getTranById(@RequestParam("id")String id);
LngBBankVo getTranById(@RequestParam("id")String id);
@GetMapping("/getTranByCodes")
List<UpdateLngBBankDto> getTranByCodes(@RequestParam("codes") List<String> codes);

View File

@ -7,6 +7,7 @@ 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.vo.LngBStationLngVo;
/**
* @author: ksy
@ -15,10 +16,7 @@ import com.xjrsoft.common.constant.GlobalConstant;
@FeignClient(value = GlobalConstant.CLIENT_PCITC_MDM_NAME, path = GlobalConstant.CLIENT_API_PRE + GlobalConstant.MDM_MODULE_PREFIX + "/tran/lngStation")
public interface ILngStationClient {
@GetMapping("/getAllTranData")
Map<String,String> getAllTranData();
@GetMapping("/getTranById")
String getTranById(@RequestParam("id")String id);
LngBStationLngVo getTranById(@RequestParam("id")String id);
}

View File

@ -7,6 +7,7 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import com.xjrsoft.common.constant.GlobalConstant;
import com.xjrsoft.module.sales.vo.LngCustomerVo;
/**
* @author: ksy
@ -15,10 +16,7 @@ import com.xjrsoft.common.constant.GlobalConstant;
@FeignClient(value = GlobalConstant.CLIENT_PCITC_MDM_NAME, path = GlobalConstant.CLIENT_API_PRE + GlobalConstant.SALES_MODULE_PREFIX + "/tran/customer")
public interface ICustomerClient {
@GetMapping("/getAllTranData")
Map<String,String> getAllTranData();
@GetMapping("/getTranById")
String getTranById(@RequestParam("id")String id);
LngCustomerVo getTranById(@RequestParam("id")String id);
}

View File

@ -1,12 +1,11 @@
package com.xjrsoft.module.sales.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;
import com.xjrsoft.module.sales.vo.LngGradeSystemVo;
/**
* @author: ksy
@ -15,10 +14,7 @@ import com.xjrsoft.common.constant.GlobalConstant;
@FeignClient(value = GlobalConstant.CLIENT_PCITC_MDM_NAME, path = GlobalConstant.CLIENT_API_PRE + GlobalConstant.SALES_MODULE_PREFIX + "/tran/gradeSystem")
public interface IGradeSystemClient {
@GetMapping("/getAllTranData")
Map<String,String> getAllTranData();
@GetMapping("/getTranById")
String getTranById(@RequestParam("id")String id);
LngGradeSystemVo getTranById(@RequestParam("id")String id);
}

View File

@ -7,6 +7,7 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import com.xjrsoft.common.constant.GlobalConstant;
import com.xjrsoft.module.supplier.vo.LngSupplierVo;
/**
* @author: ksy
@ -19,6 +20,6 @@ public interface ISupplierClient {
Map<String,String> getAllTranData();
@GetMapping("/getTranById")
String getTranById(@RequestParam("id")String id);
LngSupplierVo getTranById(@RequestParam("id")String id);
}

View File

@ -74,7 +74,15 @@ public class PngApproController {
@PostMapping(value = "/approveXS")
@SaCheckPermission("pngAppro:approveXS")
public R approveXS(@Valid @RequestBody ApproveDto<UpdateLngPngApproDto> dto){
pngApproService.approve(dto);
pngApproService.approveXS(dto);
return R.ok();
}
@ApiOperation(value = "销售审批")
@PostMapping(value = "/batchApproveXS")
@SaCheckPermission("pngAppro:batchApproveXS")
public R batchApproveXS(@Valid @RequestBody ApproveDto<UpdateLngPngApproDto> dto){
pngApproService.approveXS(dto);
return R.ok();
}
@ -82,7 +90,7 @@ public class PngApproController {
@PostMapping(value = "/approveGD")
@SaCheckPermission("pngAppro:approveGD")
public R approveGD(@Valid @RequestBody ApproveDto<UpdateLngPngApproDto> dto){
pngApproService.approve(dto);
pngApproService.approveGD(dto);
return R.ok();
}
@ -90,7 +98,7 @@ public class PngApproController {
@PostMapping(value = "/approveJSZ")
@SaCheckPermission("pngAppro:approveJSZ")
public R approveJSZ(@Valid @RequestBody ApproveDto<UpdateLngPngApproDto> dto){
pngApproService.approve(dto);
pngApproService.approveJSZ(dto);
return R.ok();
}

View File

@ -25,12 +25,13 @@ import java.util.List;
public interface LngPngApproMapper extends MPJBaseMapper<LngPngAppro>, BaseMapper<LngPngAppro> {
@Select("SELECT a.id, a.rule_user_id, a.demand_org_id, a.date_plan," +
" (CASE a.date_plan - CURRENT_DATE " +
" (CASE EXTRACT(DAY FROM a.date_plan - CURRENT_DATE)" +
" WHEN 0 THEN '当日' " +
" WHEN 1 THEN '次日' " +
" ELSE IF(a.date_plan - CURRENT_DATE < 0,'',a.date_plan - CURRENT_DATE || '日后') " +
" END) days_sign" +
" a.cu_code, cu.cu_name, cu.cu_sname, a.ver_no, a.point_dely_code, sp.full_name AS poin_dely_name," +
" ELSE IF(EXTRACT(DAY FROM a.date_plan - CURRENT_DATE) < 0,''," +
" EXTRACT(DAY FROM a.date_plan - CURRENT_DATE) || '日后') " +
" END) days_sign," +
" a.cu_code, cu.cu_name, cu.cu_sname, a.ver_no, a.point_dely_code, sp.full_name AS point_dely_name," +
" a.qty_demand_gj, a.qty_demand_m3/10000 AS qty_demand_m3," +
" a.qty_sales_gj, a.qty_sales_m3/10000 AS qty_sales_m3," +
" a.rate_k, a.rate_mp, a.rate_s, k.k_name, a.alter_sign, dd_iud.name AS alter_name," +
@ -50,12 +51,13 @@ public interface LngPngApproMapper extends MPJBaseMapper<LngPngAppro>, BaseMappe
IPage<LngPngApproVo> queryPage(IPage<LngPngApproPageDto> page, @Param(Constants.WRAPPER) QueryWrapper<LngPngAppro> queryWrapper);
@Select("SELECT a.*," +
" (CASE a.date_plan - CURRENT_DATE " +
" (CASE EXTRACT(DAY FROM a.date_plan - CURRENT_DATE)" +
" WHEN 0 THEN '当日' " +
" WHEN 1 THEN '次日' " +
" ELSE IF(a.date_plan - CURRENT_DATE < 0,'',a.date_plan - CURRENT_DATE || '日后') " +
" ELSE IF(EXTRACT(DAY FROM a.date_plan - CURRENT_DATE) < 0,''," +
" EXTRACT(DAY FROM a.date_plan - CURRENT_DATE) || '日后') " +
" END) days_sign," +
" cu.cu_name, cu.cu_sname, sp.full_name AS poin_dely_name," +
" cu.cu_name, cu.cu_sname, sp.full_name AS point_dely_name," +
" k.k_name, dd_iud.name AS alter_name," +
" com.name AS com_name, dd_a.name as appro_name" +
" FROM lng_png_appro a" +
@ -71,12 +73,13 @@ public interface LngPngApproMapper extends MPJBaseMapper<LngPngAppro>, BaseMappe
LngPngApproVo getOneById(@Param("id") Long id);
@Select("SELECT a.*," +
" (CASE a.date_plan - CURRENT_DATE " +
" (CASE EXTRACT(DAY FROM a.date_plan - CURRENT_DATE)" +
" WHEN 0 THEN '当日' " +
" WHEN 1 THEN '次日' " +
" ELSE IF(a.date_plan - CURRENT_DATE < 0,'',a.date_plan - CURRENT_DATE || '日后') " +
" ELSE IF(EXTRACT(DAY FROM a.date_plan - CURRENT_DATE) < 0,''," +
" EXTRACT(DAY FROM a.date_plan - CURRENT_DATE) || '日后') " +
" END) days_sign," +
" cu.cu_name, cu.cu_sname, sp.full_name AS poin_dely_name," +
" cu.cu_name, cu.cu_sname, sp.full_name AS point_dely_name," +
" k.k_name, dd_iud.name AS alter_name," +
" com.name AS com_name, dd_a.name as appro_name" +
" FROM lng_png_appro a" +

View File

@ -27,7 +27,11 @@ public interface IPngApproService extends MPJBaseService<LngPngAppro>, MPJDeepSe
LngPngApproVo getInfoById(Long id);
void approve(@Valid ApproveDto<UpdateLngPngApproDto> dto);
void approveXS(@Valid ApproveDto<UpdateLngPngApproDto> dto);
void approveGD(@Valid ApproveDto<UpdateLngPngApproDto> dto);
void approveJSZ(@Valid ApproveDto<UpdateLngPngApproDto> dto);
List<LngPngApproVo> compare(Long orgId);
}

View File

@ -3,6 +3,7 @@ package com.xjrsoft.module.dayPlan.service.impl;
import cn.dev33.satoken.session.SaSession;
import cn.dev33.satoken.stp.StpUtil;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.yulichang.base.MPJBaseServiceImpl;
@ -34,6 +35,7 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.util.List;
/**
@ -93,41 +95,130 @@ public class PngApproServiceImpl extends MPJBaseServiceImpl<LngPngApproMapper, L
@Override
@Transactional(rollbackFor = Exception.class)
public void approve(ApproveDto<UpdateLngPngApproDto> dto) {
UpdateLngPngApproDto data = dto.getData();
LngPngAppro lngPngAppro = this.baseMapper.selectById(data.getId());
if(lngPngAppro == null) {
throw new BusinessException(BusinessCode.of(10500,"找不到此数据"));
}
lngPngAppro.setQtySalesGj(data.getQtySalesGj());
lngPngAppro.setQtySalesM3(data.getQtySalesM3());
this.baseMapper.updateById(lngPngAppro);
for (UpdateLngPngApproPurDto lngPngApproPurDto : data.getLngPngApproPurList()) {
LngPngApproPur lngPngApproPur = lngPngApproPurMapper.selectById(lngPngApproPurDto.getId());
if(lngPngApproPur == null) {
throw new BusinessException(BusinessCode.of(10500,"找不到此数据"));
}
lngPngApproPur.setQtySalesGj(lngPngApproPurDto.getQtySalesGj());
lngPngApproPur.setQtySalesM3(lngPngApproPurDto.getQtySalesM3());
lngPngApproPur.setNote(lngPngApproPurDto.getNote());
lngPngApproPurMapper.updateById(lngPngApproPur);
public void approveXS(ApproveDto<UpdateLngPngApproDto> dto) {
List<UpdateLngPngApproDto> data = dto.getData();
if (CollectionUtils.isEmpty(data)) {
throw new BusinessException(BusinessCode.of(10500,"请选择审批数据"));
}
String sql = com.pictc.utils.StringUtils.format("{? = call pc_{0}.f_approval(?, ?, ?, ?, ?)}",
"lng_png_appro");
List<JdbcParam> params = Lists.newArrayList();
JdbcParam outParam = JdbcParam.ofString(null).setOut(true);
params.add(outParam);
params.add(JdbcParam.ofLong(data.getId()));
params.add(JdbcParam.ofString("XS"));
params.add(JdbcParam.ofString(dto.getResult()));
params.add(JdbcParam.ofString(dto.getRemark()));
SaSession tokenSession = StpUtil.getTokenSession();
UserDto user = tokenSession.get(GlobalConstant.LOGIN_USER_INFO_KEY, new UserDto());
params.add(JdbcParam.ofLong(user.getId()));
JdbcTools.call(sql,params);
String error = outParam.getStringValue();
if (com.pictc.utils.StringUtils.isNotEmpty(error)) {
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_DELETE_EXEC_ERROR, error));
for (UpdateLngPngApproDto lngPngApproDto : data) {
LngPngAppro lngPngAppro = this.baseMapper.selectById(lngPngApproDto.getId());
if(lngPngAppro == null) {
throw new BusinessException(BusinessCode.of(10500,"找不到此数据"));
}
if (CollectionUtils.isEmpty(lngPngApproDto.getLngPngApproPurList())) {
List<LngPngApproPur> list = lngPngApproPurMapper.selectList(new LambdaQueryWrapper<LngPngApproPur>()
.eq(LngPngApproPur::getApproId, lngPngApproDto.getId()));
if (CollectionUtils.isEmpty(list)) {
throw new BusinessException(BusinessCode.of(10500,"找不到上载点数据"));
}
BigDecimal qtySalesGjTotal = BigDecimal.ZERO;
BigDecimal qtySalesM3Total = BigDecimal.ZERO;
for (LngPngApproPur lngPngApproPur : list) {
lngPngApproPur.setQtySalesGj(lngPngApproPur.getQtyDemandGj());
lngPngApproPur.setQtySalesM3(lngPngApproPur.getQtyDemandM3());
lngPngApproPurMapper.updateById(lngPngApproPur);
qtySalesGjTotal = qtySalesGjTotal.add(lngPngApproPur.getQtySalesGj());
qtySalesM3Total = qtySalesM3Total.add(lngPngApproPur.getQtySalesM3());
}
lngPngAppro.setQtySalesGj(qtySalesGjTotal);
lngPngAppro.setQtySalesM3(qtySalesM3Total);
this.baseMapper.updateById(lngPngAppro);
} else {
lngPngAppro.setQtySalesGj(lngPngApproDto.getQtySalesGj());
lngPngAppro.setQtySalesM3(lngPngApproDto.getQtySalesM3());
this.baseMapper.updateById(lngPngAppro);
for (UpdateLngPngApproPurDto lngPngApproPurDto : lngPngApproDto.getLngPngApproPurList()) {
LngPngApproPur lngPngApproPur = lngPngApproPurMapper.selectById(lngPngApproPurDto.getId());
if(lngPngApproPur == null) {
throw new BusinessException(BusinessCode.of(10500,"找不到上载点数据"));
}
lngPngApproPur.setQtySalesGj(lngPngApproPurDto.getQtySalesGj());
lngPngApproPur.setQtySalesM3(lngPngApproPurDto.getQtySalesM3());
lngPngApproPur.setNote(lngPngApproPurDto.getNote());
lngPngApproPurMapper.updateById(lngPngApproPur);
}
}
List<JdbcParam> params = Lists.newArrayList();
JdbcParam outParam = JdbcParam.ofString(null).setOut(true);
params.add(outParam);
params.add(JdbcParam.ofLong(lngPngApproDto.getId()));
params.add(JdbcParam.ofString("XS"));
params.add(JdbcParam.ofString(dto.getResult()));
params.add(JdbcParam.ofString(dto.getRemark()));
params.add(JdbcParam.ofLong(user.getId()));
JdbcTools.call(sql,params);
String error = outParam.getStringValue();
if (com.pictc.utils.StringUtils.isNotEmpty(error)) {
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_DELETE_EXEC_ERROR, error));
}
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public void approveGD(ApproveDto<UpdateLngPngApproDto> dto) {
List<UpdateLngPngApproDto> data = dto.getData();
if (CollectionUtils.isEmpty(data)) {
throw new BusinessException(BusinessCode.of(10500,"请选择审批数据"));
}
String sql = com.pictc.utils.StringUtils.format("{? = call pc_{0}.f_approval_gd(?, ?, ?, ?, ?)}",
"lng_png_appro");
SaSession tokenSession = StpUtil.getTokenSession();
UserDto user = tokenSession.get(GlobalConstant.LOGIN_USER_INFO_KEY, new UserDto());
for (UpdateLngPngApproDto lngPngApproDto : data) {
LngPngAppro lngPngAppro = this.baseMapper.selectById(lngPngApproDto.getId());
if(lngPngAppro == null) {
throw new BusinessException(BusinessCode.of(10500,"找不到此数据"));
}
List<JdbcParam> params = Lists.newArrayList();
JdbcParam outParam = JdbcParam.ofString(null).setOut(true);
params.add(outParam);
params.add(JdbcParam.ofString(user.getStaCode()));
params.add(JdbcParam.ofLocalDateTime(lngPngAppro.getDatePlan()));
params.add(JdbcParam.ofString(dto.getResult()));
params.add(JdbcParam.ofString(dto.getRemark()));
params.add(JdbcParam.ofLong(user.getId()));
JdbcTools.call(sql,params);
String error = outParam.getStringValue();
if (com.pictc.utils.StringUtils.isNotEmpty(error)) {
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_DELETE_EXEC_ERROR, error));
}
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public void approveJSZ(ApproveDto<UpdateLngPngApproDto> dto) {
List<UpdateLngPngApproDto> data = dto.getData();
if (CollectionUtils.isEmpty(data)) {
throw new BusinessException(BusinessCode.of(10500,"请选择审批数据"));
}
String sql = com.pictc.utils.StringUtils.format("{? = call pc_{0}.f_approval_jsz(?, ?, ?, ?, ?)}",
"lng_png_appro");
SaSession tokenSession = StpUtil.getTokenSession();
UserDto user = tokenSession.get(GlobalConstant.LOGIN_USER_INFO_KEY, new UserDto());
for (UpdateLngPngApproDto lngPngApproDto : data) {
LngPngAppro lngPngAppro = this.baseMapper.selectById(lngPngApproDto.getId());
if(lngPngAppro == null) {
throw new BusinessException(BusinessCode.of(10500,"找不到此数据"));
}
List<JdbcParam> params = Lists.newArrayList();
JdbcParam outParam = JdbcParam.ofString(null).setOut(true);
params.add(outParam);
params.add(JdbcParam.ofString(user.getStaCode()));
params.add(JdbcParam.ofLocalDateTime(lngPngAppro.getDatePlan()));
params.add(JdbcParam.ofString(dto.getResult()));
params.add(JdbcParam.ofString(dto.getRemark()));
params.add(JdbcParam.ofLong(user.getId()));
JdbcTools.call(sql,params);
String error = outParam.getStringValue();
if (com.pictc.utils.StringUtils.isNotEmpty(error)) {
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_DELETE_EXEC_ERROR, error));
}
}
}
}

View File

@ -14,7 +14,9 @@ import com.xjrsoft.common.constant.GlobalConstant;
import com.xjrsoft.common.utils.TenantUtil;
import com.xjrsoft.module.mdm.entity.LngBRegion;
import com.xjrsoft.module.mdm.service.ICountryRegionService;
import com.xjrsoft.module.mdm.vo.LngBRegionVo;
import cn.hutool.core.convert.Convert;
import lombok.AllArgsConstructor;
/**
@ -43,9 +45,11 @@ public class CountryRegionClientImpl implements ICountryRegionClient {
@GetMapping("/getTranById")
@Override
public String getTranById(@RequestParam("id")String code) {
LngBRegion region = countryRegionService.getByCode(code);
return region!=null?region.getFullPath():null;
public LngBRegionVo getTranById(@RequestParam("id")String code) {
return TenantUtil.ignoreR(()->{
LngBRegion region = countryRegionService.getByCode(code);
return Convert.convert(LngBRegionVo.class, region);
});
}
}

View File

@ -9,16 +9,14 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.itextpdf.text.pdf.PdfStructTreeController.returnType;
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 com.xjrsoft.module.mdm.vo.LngBCurrencyVo;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.convert.Convert;
import lombok.AllArgsConstructor;
/**
@ -33,23 +31,22 @@ 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;
public LngBCurrencyVo getTranById(@RequestParam("id")String code) {
return TenantUtil.ignoreR(()->{
LngBCurrency currency = currencyService.getByCode(code);
return Convert.convert(LngBCurrencyVo.class, currency);
});
}
@GetMapping("/getAllTranData")
@Override
public Map<String, String> getAllTranData() {
return TenantUtil.ignoreR(()->{
List<LngBCurrency> list = currencyService.list();
return list.stream().collect(Collectors.toMap(LngBCurrency::getCode,LngBCurrency::getFullName));
});
}

View File

@ -16,7 +16,9 @@ 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 com.xjrsoft.module.mdm.vo.LngBBankVo;
import cn.hutool.core.convert.Convert;
import lombok.AllArgsConstructor;
/**
@ -45,9 +47,12 @@ public class LngBankClientImpl implements ILngBankClient {
@GetMapping("/getTranById")
@Override
public String getTranById(@RequestParam("id")String code) {
LngBBank bank = lngBankService.getByCode(code);
return bank!=null?bank.getFullName():null;
public LngBBankVo getTranById(@RequestParam("id")String code) {
return TenantUtil.ignoreR(()->{
LngBBank bank = lngBankService.getByCode(code);
return Convert.convert(LngBBankVo.class,bank);
});
}
@Override

View File

@ -13,7 +13,9 @@ import com.xjrsoft.common.constant.GlobalConstant;
import com.xjrsoft.common.utils.TenantUtil;
import com.xjrsoft.module.mdm.entity.LngBStationLng;
import com.xjrsoft.module.mdm.service.ILNGStationService;
import com.xjrsoft.module.mdm.vo.LngBStationLngVo;
import cn.hutool.core.convert.Convert;
import lombok.AllArgsConstructor;
/**
@ -28,23 +30,13 @@ public class LngStationClientImpl implements ILngStationClient {
private final ILNGStationService lngStationService;
@GetMapping("/getAllTranData")
@Override
public Map<String, String> getAllTranData() {
try {
TenantUtil.ignore(true);
List<LngBStationLng> list = lngStationService.list();
return list.stream().collect(Collectors.toMap(LngBStationLng::getCode,LngBStationLng::getFullName));
}finally {
TenantUtil.clear();
}
}
@GetMapping("/getTranById")
@Override
public String getTranById(@RequestParam("id")String code) {
LngBStationLng region = lngStationService.getByCode(code);
return region!=null?region.getFullName():null;
public LngBStationLngVo getTranById(@RequestParam("id")String code) {
return TenantUtil.ignoreR(()->{
LngBStationLng region = lngStationService.getByCode(code);
return Convert.convert(LngBStationLngVo.class, region);
});
}
}

View File

@ -1,9 +1,5 @@
package com.xjrsoft.module.sales.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;
@ -13,7 +9,9 @@ import com.xjrsoft.common.constant.GlobalConstant;
import com.xjrsoft.common.utils.TenantUtil;
import com.xjrsoft.module.sales.entity.LngCustomer;
import com.xjrsoft.module.sales.service.ICustomerService;
import com.xjrsoft.module.sales.vo.LngCustomerVo;
import cn.hutool.core.convert.Convert;
import lombok.AllArgsConstructor;
/**
@ -28,23 +26,13 @@ public class CustomerClientImpl implements ICustomerClient {
private final ICustomerService customerService;
@GetMapping("/getAllTranData")
@Override
public Map<String, String> getAllTranData() {
try {
TenantUtil.ignore(true);
List<LngCustomer> list = customerService.list();
return list.stream().collect(Collectors.toMap(LngCustomer::getCuCode,LngCustomer::getCuName));
}finally {
TenantUtil.clear();
}
}
@GetMapping("/getTranById")
@Override
public String getTranById(@RequestParam("id")String code) {
LngCustomer cu = customerService.getByCode(code);
return cu!=null?cu.getCuName():null;
public LngCustomerVo getTranById(@RequestParam("id")String code) {
return TenantUtil.ignoreR(()->{
LngCustomer cu = customerService.getByCode(code);
return Convert.convert(LngCustomerVo.class, cu);
});
}
}

View File

@ -13,7 +13,9 @@ import com.xjrsoft.common.constant.GlobalConstant;
import com.xjrsoft.common.utils.TenantUtil;
import com.xjrsoft.module.sales.entity.LngGradeSystem;
import com.xjrsoft.module.sales.service.IGradeSystemService;
import com.xjrsoft.module.sales.vo.LngGradeSystemVo;
import cn.hutool.core.convert.Convert;
import lombok.AllArgsConstructor;
/**
@ -28,23 +30,13 @@ public class GradeSystemClientImpl implements IGradeSystemClient {
private final IGradeSystemService gradeSystemService;
@GetMapping("/getAllTranData")
@Override
public Map<String, String> getAllTranData() {
try {
TenantUtil.ignore(true);
List<LngGradeSystem> list = gradeSystemService.list();
return list.stream().collect(Collectors.toMap(e -> String.valueOf(e.getId()),LngGradeSystem::getGsName));
}finally {
TenantUtil.clear();
}
}
@GetMapping("/getTranById")
@Override
public String getTranById(@RequestParam("id")String code) {
LngGradeSystem gs = gradeSystemService.getById(code);
return gs!=null?gs.getGsName():null;
public LngGradeSystemVo getTranById(@RequestParam("id")String code) {
return TenantUtil.ignoreR(()->{
return Convert.convert(LngGradeSystemVo.class, gradeSystemService.getById(code));
});
}
}

View File

@ -13,7 +13,9 @@ import com.xjrsoft.common.constant.GlobalConstant;
import com.xjrsoft.common.utils.TenantUtil;
import com.xjrsoft.module.supplier.entity.LngSupplier;
import com.xjrsoft.module.supplier.service.ISupplierService;
import com.xjrsoft.module.supplier.vo.LngSupplierVo;
import cn.hutool.core.convert.Convert;
import lombok.AllArgsConstructor;
/**
@ -42,9 +44,11 @@ public class SupplierClientImpl implements ISupplierClient {
@GetMapping("/getTranById")
@Override
public String getTranById(@RequestParam("id")String code) {
LngSupplier su = supplierService.getByCode(code);
return su!=null?su.getSuName():null;
public LngSupplierVo getTranById(@RequestParam("id")String code) {
return TenantUtil.ignoreR(()->{
LngSupplier su = supplierService.getByCode(code);
return Convert.convert(LngSupplierVo.class, su);
});
}
}

View File

@ -0,0 +1,15 @@
package com.xjrsoft.test;
import java.util.Map;
import cn.hutool.json.JSONUtil;
public class JsonTest {
public static void main(String[] args) {
String json = "{\"name\":\"John\",\"age\":30,\"city\":\"New York\"}";
Map<String,Object> bean = JSONUtil.toBean(json, Map.class, true);
System.out.println(bean);
}
}