|
@@ -4,6 +4,7 @@ import cn.hutool.core.util.ObjectUtil;
|
|
|
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
+import com.fjhx.area.utils.AreaUtil;
|
|
|
import com.fjhx.common.constant.SourceConstant;
|
|
|
import com.fjhx.common.entity.corporation.po.Corporation;
|
|
|
import com.fjhx.common.service.corporation.CorporationService;
|
|
@@ -163,12 +164,14 @@ public class DocumentsServiceImpl extends ServiceImpl<DocumentsMapper, Documents
|
|
|
if(ObjectUtil.isEmpty(documents)){
|
|
|
throw new ServiceException("单证不存在");
|
|
|
}
|
|
|
+ setDocumentArea(documents);
|
|
|
//查询合同
|
|
|
Contract contract = contractService.getById(documents.getContractId());
|
|
|
if(ObjectUtil.isEmpty(contract)){
|
|
|
throw new ServiceException("该单证合同不存在");
|
|
|
}
|
|
|
ContractVo contractVo = BeanUtil.toBean(contract, ContractVo.class);
|
|
|
+ setContractArea(contractVo);
|
|
|
//查询买方
|
|
|
Customer customer = customerService.getById(contractVo.getBuyCorporationId());
|
|
|
//查询卖方
|
|
@@ -212,4 +215,36 @@ public class DocumentsServiceImpl extends ServiceImpl<DocumentsMapper, Documents
|
|
|
// map.put("packDetailGoodsList",packDetailGoodsList);//装箱商品明细
|
|
|
return map;
|
|
|
}
|
|
|
+ /**
|
|
|
+ * 赋值买卖公司国家省市区名称
|
|
|
+ */
|
|
|
+ private void setContractArea(ContractVo contractVo) {
|
|
|
+
|
|
|
+ List<String> areaIdList = Arrays.asList(
|
|
|
+ contractVo.getBuyCountryId(),
|
|
|
+ contractVo.getBuyProvinceId(),
|
|
|
+ contractVo.getBuyCityId(),
|
|
|
+ contractVo.getSellCountryId(),
|
|
|
+ contractVo.getSellProvinceId(),
|
|
|
+ contractVo.getSellCityId()
|
|
|
+ );
|
|
|
+ Map<String, String> areaMap = AreaUtil.getAreaMapByIds(areaIdList);
|
|
|
+ contractVo.setBuyCountryName(areaMap.get(contractVo.getBuyCountryId()));
|
|
|
+ contractVo.setBuyProvinceName(areaMap.get(contractVo.getBuyProvinceId()));
|
|
|
+ contractVo.setBuyCityName(areaMap.get(contractVo.getBuyCityId()));
|
|
|
+ contractVo.setSellCountryName(areaMap.get(contractVo.getSellCountryId()));
|
|
|
+ contractVo.setSellProvinceName(areaMap.get(contractVo.getSellProvinceId()));
|
|
|
+ contractVo.setSellCityName(areaMap.get(contractVo.getSellCityId()));
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * 赋值单证目的国家名称
|
|
|
+ */
|
|
|
+ private void setDocumentArea(Documents documents) {
|
|
|
+
|
|
|
+ List<String> areaIdList = Arrays.asList(
|
|
|
+ documents.getCountryId()
|
|
|
+ );
|
|
|
+ Map<String, String> areaMap = AreaUtil.getAreaMapByIds(areaIdList);
|
|
|
+ documents.setCountryName(areaMap.get(documents.getCountryId()));
|
|
|
+ }
|
|
|
}
|