This commit is contained in:
张秉卓
2026-01-20 18:02:02 +08:00
18 changed files with 177 additions and 113 deletions

View File

@ -178,7 +178,21 @@ public class DemandController {
pdp.setAddSign("N");
}
}
return this.add(temp);
return R.ok(dataService.insert(temp,new DataOperationListener<UpdateLngPngDemandDto>() {
@Override
public UpdateLngPngDemandDto before(DataOperationContent<UpdateLngPngDemandDto> content) {
return null;
}
@Override
public UpdateLngPngDemandDto after(DataOperationContent<UpdateLngPngDemandDto> content) {
lngPngDemand.setLastVerSign("N");
demandService.updateById(lngPngDemand);
return null;
}
}));
}
@GetMapping(value="/compare")

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);
});
}
}