Parcourir la source

中间合同PDF修改

caozj il y a 1 an
Parent
commit
de3bf0ef36

+ 64 - 0
hx-sale/src/main/java/com/fjhx/sale/entity/intermediate/vo/IntermediateContractVo.java

@@ -50,6 +50,50 @@ public class IntermediateContractVo extends IntermediateContract {
      * 中间合同卖方名称 多公司
      */
     private String sellCorporationName;
+
+    /**
+     * 卖方公司英文名称
+     */
+    private String sellCorporationNameEn;
+
+    /**
+     * 卖方公司国家
+     */
+    private String sellCountryName;
+
+    /**
+     * 卖方公司省
+     */
+    private String sellProvinceName;
+
+    /**
+     * 卖方公司市
+     */
+    private String sellCityName;
+
+    /**
+     * 卖方公司详细地址
+     */
+    private String sellDetailedAddress;
+
+    /**
+     * 卖方公司国家
+     */
+    private String sellCountryNameEn;
+
+    /**
+     * 卖方公司省
+     */
+    private String sellProvinceNameEn;
+
+    /**
+     * 卖方公司市
+     */
+    private String sellCityNameEn;
+    /**
+     * 卖方公司详细地址
+     */
+    private String sellDetailedAddressEn;
     /**
      * 中间合同买方名称 多公司
      */
@@ -59,6 +103,26 @@ public class IntermediateContractVo extends IntermediateContract {
 
     private String userName;
 
+    /**
+     * 买方公司国家
+     */
+    private String buyCountryName;
+
+    /**
+     * 买方公司省
+     */
+    private String buyProvinceName;
+
+    /**
+     * 买方公司市
+     */
+    private String buyCityName;
+
+    /**
+     * 卖方公司详细地址
+     */
+    private String buyDetailedAddress;
+
     private Map<String,Object> contractMap;
 
 }

+ 21 - 5
hx-sale/src/main/java/com/fjhx/sale/service/intermediate/impl/IntermediateContractServiceImpl.java

@@ -163,21 +163,37 @@ public class IntermediateContractServiceImpl extends ServiceImpl<IntermediateCon
     public IntermediateContract getPrintInfo(IntermediateContractDto dto) {
         Assert.notEmpty(dto.getId(), "参数异常");
         IntermediateContract in = this.getById(dto.getId());
-        IntermediateContractVo vo = new IntermediateContractVo();
-        BeanUtils.copyProperties(in,vo);
         if(ObjectUtil.isEmpty(in)){
             throw new ServiceException("合同不存在");
         }
+        IntermediateContractVo vo = new IntermediateContractVo();
+        BeanUtils.copyProperties(in,vo);
         //赋值买方卖方公司名称
         List<Long> corporationIds = Arrays.asList(in.getBuyCorporationId(), in.getSellCorporationId());
         Map<Long, Corporation> corporationMap = corporationService.mapKEntity(Corporation::getId, q -> q.in(Corporation::getId, corporationIds));
         Corporation buyCorporation = corporationMap.get(in.getBuyCorporationId());
-        Corporation sellCorporation = corporationMap.get(in.getSellCorporationId());
+        //赋值买方信息
+        vo.setBuyContactNumber(in.getBuyContactName());
+        vo.setBuyCorporationName(in.getBuyContactNumber());
         if (ObjectUtil.isNotEmpty(buyCorporation)) {
-            vo.setBuyCorporationName(buyCorporation.getName());
+            vo.setBuyContactName(buyCorporation.getNameEn());
+            //赋值买方国家省市详细地址信息
+            vo.setBuyCountryName(buyCorporation.getCountryEnStr());
+            vo.setBuyProvinceName(buyCorporation.getProvinceEnStr());
+            vo.setBuyCityName(buyCorporation.getCityEnStr());
+            vo.setBuyDetailedAddress(buyCorporation.getAddressEn());
         }
+        Corporation sellCorporation = corporationMap.get(in.getSellCorporationId());
+        //赋值卖方信息
+        vo.setSellContactNumber(in.getSellContactName());
+        vo.setSellCorporationNameEn(in.getSellContactNumber());
         if (ObjectUtil.isNotEmpty(sellCorporation)) {
-            vo.setSellCorporationName(sellCorporation.getName());
+            vo.setSellContactName(sellCorporation.getNameEn());
+            //赋值卖方国家省市详细地址信息
+            vo.setSellCountryName(sellCorporation.getCountryEnStr());
+            vo.setSellProvinceName(sellCorporation.getProvinceEnStr());
+            vo.setSellCityName(sellCorporation.getCityEnStr());
+            vo.setSellDetailedAddress(sellCorporation.getAddressEn());
         }
         //查询最新的一条单证信息
         Documents documents = documentsService.getOne(Wrappers.<Documents>query().lambda().in(Documents::getId,Arrays.asList(in.getDocumentsIds().split(","))).orderByDesc(Documents::getCreateTime).last("limit 1"));