lngStation转换
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/lngStation")
|
||||
public interface ILngStationClient {
|
||||
|
||||
@GetMapping("/getAllTranData")
|
||||
Map<String,String> getAllTranData();
|
||||
|
||||
@GetMapping("/getTranById")
|
||||
String getTranById(@RequestParam("id")String id);
|
||||
|
||||
}
|
||||
@ -44,6 +44,7 @@ public class LngBPngLinePageVo {
|
||||
* 自有接收站(惠州/阳江)
|
||||
*/
|
||||
@ApiModelProperty("自有接收站(惠州/阳江)")
|
||||
@Trans(type = TransType.LNG_STATION)
|
||||
private String staCodeLng;
|
||||
/**
|
||||
* 显示顺序
|
||||
|
||||
@ -0,0 +1,50 @@
|
||||
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.LngBStationLng;
|
||||
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/lngStation")
|
||||
@AllArgsConstructor
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
@ -23,4 +23,6 @@ public interface ILNGStationService extends IService<LngBStationLng> {
|
||||
boolean enable(@Valid List<Long> ids);
|
||||
|
||||
boolean disable(@Valid List<Long> ids);
|
||||
|
||||
LngBStationLng getByCode(String code);
|
||||
}
|
||||
|
||||
@ -17,7 +17,6 @@ import com.pictc.utils.CollectionUtils;
|
||||
import com.xjrsoft.common.constant.GlobalConstant;
|
||||
import com.xjrsoft.common.utils.TreeUtil;
|
||||
import com.xjrsoft.module.mdm.entity.LngBRegion;
|
||||
import com.xjrsoft.module.mdm.enums.CountryRegionEnum;
|
||||
import com.xjrsoft.module.mdm.mapper.LngBRegionMapper;
|
||||
import com.xjrsoft.module.mdm.service.ICountryRegionService;
|
||||
import com.xjrsoft.module.mdm.vo.LngBRegionTreeVo;
|
||||
@ -60,7 +59,8 @@ public class CountryRegionServiceImpl extends ServiceImpl<LngBRegionMapper, LngB
|
||||
}
|
||||
|
||||
LambdaQueryWrapper<LngBRegion> tempQw = Wrappers.<LngBRegion>query().lambda()
|
||||
.notIn(StringUtils.isNotBlank(excludeType),LngBRegion::getRegionTypeCode, excludeTypeList);
|
||||
.notIn(StringUtils.isNotBlank(excludeType),LngBRegion::getRegionTypeCode, excludeTypeList)
|
||||
.orderByAsc(LngBRegion::getCode);
|
||||
//.eq(StringUtils.isNotBlank(startPCode),LngBRegion::getCode, startPCode);
|
||||
List<LngBRegion> allList = this.list(tempQw);
|
||||
Map<Long,LngBRegion> map = allList.stream().collect(Collectors.toMap(LngBRegion::getId,
|
||||
@ -145,7 +145,7 @@ public class CountryRegionServiceImpl extends ServiceImpl<LngBRegionMapper, LngB
|
||||
.in(pid == null, LngBRegion::getPid, pidList)
|
||||
.and(StrUtil.isNotBlank(keyword), x -> {
|
||||
x.like(StrUtil.isNotBlank(keyword), LngBRegion::getFullName, keyword);
|
||||
}));
|
||||
}).orderByAsc(LngBRegion::getCode));
|
||||
|
||||
List<LngBRegionVo> voList = CollectionUtils.newArrayList();
|
||||
if(regionList != null && regionList.size() > 0) {
|
||||
|
||||
@ -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;
|
||||
@ -7,6 +14,8 @@ import com.pictc.constant.TableNameConstants;
|
||||
import com.pictc.enums.BusinessCode;
|
||||
import com.pictc.enums.ExceptionCommonCode;
|
||||
import com.pictc.utils.DataLogTools;
|
||||
import com.xjrsoft.common.advice.tran.LngStationDataProvider;
|
||||
import com.xjrsoft.common.advice.tran.RegionDataProvider;
|
||||
import com.xjrsoft.common.exception.BusinessException;
|
||||
import com.xjrsoft.module.common.db.service.CommonCallService;
|
||||
import com.xjrsoft.module.mdm.dto.UpdateLngBStationLngDto;
|
||||
@ -14,13 +23,8 @@ import com.xjrsoft.module.mdm.entity.LngBStationLng;
|
||||
import com.xjrsoft.module.mdm.mapper.LngBStationLngMapper;
|
||||
import com.xjrsoft.module.mdm.service.ILNGStationService;
|
||||
import com.xjrsoft.module.system.client.ICodeRuleClient;
|
||||
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
|
||||
@ -37,6 +41,8 @@ public class LNGStationServiceImpl extends ServiceImpl<LngBStationLngMapper, Lng
|
||||
private final ICodeRuleClient codeRuleClient;
|
||||
|
||||
private final String STATIONCODE = "stationCode";
|
||||
|
||||
private final LngStationDataProvider tranProvider;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@ -46,6 +52,7 @@ public class LNGStationServiceImpl extends ServiceImpl<LngBStationLngMapper, Lng
|
||||
UpdateLngBStationLngDto res = DataLogTools.insert(dto);
|
||||
codeRuleClient.useEncode(STATIONCODE);
|
||||
this.addOrUpdateAfter(res.getId());
|
||||
tranProvider.saveData(dto.getCode(), dto.getFullName());
|
||||
return res.getId();
|
||||
}
|
||||
|
||||
@ -79,6 +86,7 @@ public class LNGStationServiceImpl extends ServiceImpl<LngBStationLngMapper, Lng
|
||||
this.checkParams(dto);
|
||||
DataLogTools.update(dto);
|
||||
this.addOrUpdateAfter(dto.getId());
|
||||
tranProvider.saveData(dto.getCode(), dto.getFullName());
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -107,4 +115,11 @@ public class LNGStationServiceImpl extends ServiceImpl<LngBStationLngMapper, Lng
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public LngBStationLng getByCode(String code) {
|
||||
LambdaQueryWrapper<LngBStationLng> queryWrapper = new LambdaQueryWrapper<LngBStationLng>();
|
||||
queryWrapper.eq(LngBStationLng::getCode,code);
|
||||
return baseMapper.selectOne(queryWrapper);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user