Merge branch 'dev' of http://47.94.165.164:13000/geg-gas/geg-gas-pcitc into dev
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
package com.pictc.utils;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.nacos.shaded.com.google.common.collect.Lists;
|
||||
@ -58,6 +59,8 @@ public class DataLogTools {
|
||||
|
||||
private static Map<String,Class<?>> entitys = Maps.newHashMap();
|
||||
|
||||
private static final String REDIS_CACHE_KEY = "TABLE_INFO:";
|
||||
|
||||
private static Set<String> logTables = null;
|
||||
|
||||
private static Object lock = new Object();
|
||||
@ -609,21 +612,23 @@ public class DataLogTools {
|
||||
Object joinValue = tabInfo.getFieldValue(entity, join.getField());
|
||||
if(joinValue!=null && joinValue instanceof List) {
|
||||
List listValue = (List) joinValue;
|
||||
for (LogJoinColumn joinColumn : columns) {
|
||||
if (joinColumn.valueType() == JoinValueType.FEILD
|
||||
&& joinColumn.valueDirection() == ValueDirectionType.RIGHT) {
|
||||
Object joinFieldValue = tabInfo.getFieldValue(entity, joinColumn.field());
|
||||
for (Object item : listValue) {
|
||||
Long idValue2 = joinTable.getIdValue(item);
|
||||
if(idValue2==null || idValue2 <=0) {
|
||||
joinTable.setIdValue(item, IdWorker.getId());
|
||||
}
|
||||
|
||||
for (Object item : listValue) {
|
||||
Long idValue2 = joinTable.getIdValue(item);
|
||||
if(idValue2==null || idValue2 <=0) {
|
||||
joinTable.setIdValue(item, IdWorker.getId());
|
||||
}
|
||||
for (LogJoinColumn joinColumn : columns) {
|
||||
if (joinColumn.valueType() == JoinValueType.FEILD
|
||||
&& joinColumn.valueDirection() == ValueDirectionType.RIGHT) {
|
||||
Object joinFieldValue = tabInfo.getFieldValue(entity, joinColumn.field());
|
||||
joinTable.setFieldValue(item, joinColumn.relatedField(), joinFieldValue);
|
||||
}else if(joinColumn.valueType()==JoinValueType.STATIC){
|
||||
Object joinFieldValue = Convert.convert(joinColumn.staticType(), joinColumn.staticValue());
|
||||
joinTable.setFieldValue(item, joinColumn.relatedField(), joinFieldValue);
|
||||
Set<Class<?>> joinClasses = SetUtils.ofCollection(classes);
|
||||
initJoinValue(item,joinTable,joinClasses);
|
||||
}
|
||||
}
|
||||
Set<Class<?>> joinClasses = SetUtils.ofCollection(classes);
|
||||
initJoinValue(item,joinTable,joinClasses);
|
||||
}
|
||||
}else {
|
||||
Long idValue2 = joinTable.getIdValue(joinValue);
|
||||
@ -634,9 +639,16 @@ public class DataLogTools {
|
||||
if(joinColumn.valueType()==JoinValueType.FEILD && joinColumn.valueDirection()==ValueDirectionType.LEFT) {
|
||||
Object joinFieldValue = joinTable.getFieldValue(joinValue, joinColumn.relatedField());
|
||||
tabInfo.setFieldValue(entity, joinColumn.field(),joinFieldValue);
|
||||
}else {
|
||||
}else if(joinColumn.valueType()==JoinValueType.FEILD){
|
||||
Object joinFieldValue = tabInfo.getFieldValue(entity, joinColumn.field());
|
||||
joinTable.setFieldValue(joinValue, joinColumn.relatedField(), joinFieldValue);
|
||||
}else {
|
||||
Object joinFieldValue = Convert.convert(joinColumn.staticType(), joinColumn.staticValue());
|
||||
if(joinColumn.valueDirection()==ValueDirectionType.LEFT) {
|
||||
tabInfo.setFieldValue(entity, joinColumn.field(),joinFieldValue);
|
||||
}else {
|
||||
joinTable.setFieldValue(joinValue, joinColumn.relatedField(), joinFieldValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
Set<Class<?>> joinClasses = SetUtils.ofCollection(classes);
|
||||
|
||||
@ -0,0 +1,46 @@
|
||||
package com.pictc.utils;
|
||||
|
||||
import java.util.Enumeration;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
import org.springframework.web.servlet.HandlerMapping;
|
||||
|
||||
|
||||
public class RequestUtils {
|
||||
|
||||
private RequestUtils() {
|
||||
super();
|
||||
}
|
||||
|
||||
public static HttpServletRequest getRequest() {
|
||||
ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes)RequestContextHolder.getRequestAttributes();
|
||||
return servletRequestAttributes.getRequest();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public static Map<String, String> getPathValues(){
|
||||
HttpServletRequest request = getRequest();
|
||||
return (Map<String, String>) request.getAttribute(HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE);
|
||||
}
|
||||
|
||||
public static String getPathValue(String name){
|
||||
return getPathValues().get(name);
|
||||
}
|
||||
|
||||
public static Map<String,Object> getParameters(HttpServletRequest request) {
|
||||
Map<String,Object> parameters = CollectionUtils.newHashMap();
|
||||
Enumeration<String> names = request.getParameterNames();
|
||||
if(names!=null) {
|
||||
while (names.hasMoreElements()) {
|
||||
String name = names.nextElement();
|
||||
parameters.put(name, request.getParameter(name));
|
||||
}
|
||||
}
|
||||
return parameters;
|
||||
}
|
||||
|
||||
}
|
||||
@ -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);
|
||||
|
||||
}
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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);
|
||||
|
||||
}
|
||||
|
||||
@ -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);
|
||||
|
||||
}
|
||||
|
||||
@ -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);
|
||||
|
||||
}
|
||||
|
||||
@ -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);
|
||||
|
||||
}
|
||||
|
||||
@ -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")
|
||||
|
||||
@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -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));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -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));
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user