|
@@ -25,29 +25,8 @@ import com.minpay.common.util.ChineseNumber;
|
|
|
import com.minpay.common.util.CommonUtil;
|
|
|
import com.minpay.common.util.DateUtil;
|
|
|
import com.minpay.common.util.ListUtil;
|
|
|
-import com.minpay.db.table.mapper.ApBrandInfMapper;
|
|
|
-import com.minpay.db.table.mapper.ApCompanyAccountMapper;
|
|
|
-import com.minpay.db.table.mapper.ApContractDetailMapper;
|
|
|
-import com.minpay.db.table.mapper.ApContractInfMapper;
|
|
|
-import com.minpay.db.table.mapper.ApMoreInfMapper;
|
|
|
-import com.minpay.db.table.mapper.ApProductInfMapper;
|
|
|
-import com.minpay.db.table.mapper.ApProductSpecRelMapper;
|
|
|
-import com.minpay.db.table.mapper.ApWarehouseInfMapper;
|
|
|
-import com.minpay.db.table.model.ApBrandInf;
|
|
|
-import com.minpay.db.table.model.ApBrandInfExample;
|
|
|
-import com.minpay.db.table.model.ApCompanyAccount;
|
|
|
-import com.minpay.db.table.model.ApCompanyAccountExample;
|
|
|
-import com.minpay.db.table.model.ApContractDetail;
|
|
|
-import com.minpay.db.table.model.ApContractDetailExample;
|
|
|
-import com.minpay.db.table.model.ApContractInf;
|
|
|
-import com.minpay.db.table.model.ApContractInfExample;
|
|
|
-import com.minpay.db.table.model.ApMoreInf;
|
|
|
-import com.minpay.db.table.model.ApProductInf;
|
|
|
-import com.minpay.db.table.model.ApProductInfExample;
|
|
|
-import com.minpay.db.table.model.ApProductSpecRel;
|
|
|
-import com.minpay.db.table.model.ApProductSpecRelExample;
|
|
|
-import com.minpay.db.table.model.ApWarehouseInf;
|
|
|
-import com.minpay.db.table.model.OwnApWarehouseInfExample;
|
|
|
+import com.minpay.db.table.mapper.*;
|
|
|
+import com.minpay.db.table.model.*;
|
|
|
import com.minpay.db.table.own.mapper.LongContractMapper;
|
|
|
import com.minpay.db.table.own.mapper.OrderManageMapper;
|
|
|
import com.minpay.db.table.own.mapper.WarehouseInventoryMapper;
|
|
@@ -362,6 +341,33 @@ public class TemplateExportAction implements IMINAction {
|
|
|
|
|
|
//将总金额转换成中文大写
|
|
|
String chineseNb = ChineseNumber.getChineseNumber(amtAll);
|
|
|
+ String companyId = u.getCompanyId();
|
|
|
+ // 获取公司联系人列表的第一条数据
|
|
|
+ ApCompanyContactExample apCompanyContactExample = new ApCompanyContactExample();
|
|
|
+ apCompanyContactExample.createCriteria().andCompanyIdEqualTo(companyId);
|
|
|
+ List<ApCompanyContact> apCompanyContactList = Service.lookup(IMINDataBaseService.class)
|
|
|
+ .selectByExample(ApCompanyContactMapper.class, apCompanyContactExample);
|
|
|
+
|
|
|
+ String ownerContactName = "";
|
|
|
+ String ownerContactPhone = "";
|
|
|
+ if(apCompanyContactList.size()>0){
|
|
|
+ ApCompanyContact apCompanyContact = apCompanyContactList.get(0);
|
|
|
+ ownerContactName = apCompanyContact.getName();
|
|
|
+ ownerContactPhone = apCompanyContact.getPhone();
|
|
|
+ }
|
|
|
+ String finalOwnerContactName = ownerContactName;
|
|
|
+ String finalOwnerContactPhone = ownerContactPhone;
|
|
|
+ // 获取公司下的地址列表的第一条数据
|
|
|
+ ApCompanySiteExample apCompanySiteExample = new ApCompanySiteExample();
|
|
|
+ apCompanySiteExample.createCriteria().andCompanyIdEqualTo(companyId);
|
|
|
+ List<ApCompanySite> apCompanySiteList = Service.lookup(IMINDataBaseService.class)
|
|
|
+ .selectByExample(ApCompanySiteMapper.class, apCompanySiteExample);
|
|
|
+ String ownerAddress = "";
|
|
|
+ if(apCompanySiteList.size()>0){
|
|
|
+ ApCompanySite apCompanySite = apCompanySiteList.get(0);
|
|
|
+ ownerAddress = apCompanySite.getAddress();
|
|
|
+ }
|
|
|
+ String finalOwnerAddress = ownerAddress;
|
|
|
XWPFTemplate template = XWPFTemplate.compile(strm).render(new HashMap<String, Object>(){{
|
|
|
String proName = "";
|
|
|
String weight = "";
|
|
@@ -428,15 +434,15 @@ public class TemplateExportAction implements IMINAction {
|
|
|
put("sellerContractPhone", contractPhone);
|
|
|
put("sellerAddress", address);
|
|
|
// 买方信息
|
|
|
- put("buyerContractName", "");
|
|
|
- put("buyerContractPhone", "");
|
|
|
- put("buyerAddress", "");
|
|
|
+ put("buyerContractName", finalOwnerContactName);
|
|
|
+ put("buyerContractPhone", finalOwnerContactPhone);
|
|
|
+ put("buyerAddress", finalOwnerAddress);
|
|
|
// 销售合同
|
|
|
} else {
|
|
|
// 卖方信息
|
|
|
- put("sellerContractName", "");
|
|
|
- put("sellerContractPhone", "");
|
|
|
- put("sellerAddress", "");
|
|
|
+ put("sellerContractName", finalOwnerContactName);
|
|
|
+ put("sellerContractPhone", finalOwnerContactPhone);
|
|
|
+ put("sellerAddress", finalOwnerAddress);
|
|
|
// 买方信息
|
|
|
put("buyerContractName", contractName);
|
|
|
put("buyerContractPhone", contractPhone);
|