Compare commits
2 Commits
eea4d93ae1
...
0b45f6eef2
| Author | SHA1 | Date | |
|---|---|---|---|
| 0b45f6eef2 | |||
| 22ab2c7bdf |
@@ -40,16 +40,12 @@ public class AbstractYongYouU8Ctx extends AbstractCtx {
|
|||||||
super(ctx);
|
super(ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void from(AbstractYongYouU8Ctx parent) {
|
|
||||||
repository = parent.repository;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void initializeRepository(MessageHolder holder) {
|
public void initializeRepository(MessageHolder holder) {
|
||||||
if (repository != null) {
|
if (repository != null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
repository = getBean(YongYouU8Repository.class);
|
repository = getCachedBean(YongYouU8Repository.class);
|
||||||
} catch (BeansException e) {
|
} catch (BeansException e) {
|
||||||
holder.warn("未启用 " + CloudServiceConstant.U8_NAME + " 服务");
|
holder.warn("未启用 " + CloudServiceConstant.U8_NAME + " 服务");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,22 +1,22 @@
|
|||||||
package com.ecep.contract.cloud.u8.ctx;
|
package com.ecep.contract.cloud.u8.ctx;
|
||||||
|
|
||||||
import static com.ecep.contract.SpringApp.getBean;
|
|
||||||
|
|
||||||
import com.ecep.contract.MessageHolder;
|
import com.ecep.contract.MessageHolder;
|
||||||
import com.ecep.contract.ds.company.service.CompanyBankAccountService;
|
|
||||||
import com.ecep.contract.ds.company.model.Company;
|
import com.ecep.contract.ds.company.model.Company;
|
||||||
|
import com.ecep.contract.ds.company.service.CompanyBankAccountService;
|
||||||
import lombok.Setter;
|
import com.ecep.contract.util.BeanContext;
|
||||||
|
|
||||||
public class CompanyBankAccountCtx extends AbstractYongYouU8Ctx {
|
public class CompanyBankAccountCtx extends AbstractYongYouU8Ctx {
|
||||||
@Setter
|
|
||||||
private CompanyBankAccountService companyBankAccountService;
|
public CompanyBankAccountCtx() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public CompanyBankAccountCtx(BeanContext ctx) {
|
||||||
|
super(ctx);
|
||||||
|
}
|
||||||
|
|
||||||
CompanyBankAccountService getCompanyBankAccountService() {
|
CompanyBankAccountService getCompanyBankAccountService() {
|
||||||
if (companyBankAccountService == null) {
|
return getCachedBean(CompanyBankAccountService.class);
|
||||||
companyBankAccountService = getBean(CompanyBankAccountService.class);
|
|
||||||
}
|
|
||||||
return companyBankAccountService;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateBankAccount(Company company, String bank, String bankAccount, MessageHolder holder) {
|
public void updateBankAccount(Company company, String bank, String bankAccount, MessageHolder holder) {
|
||||||
|
|||||||
@@ -1,22 +1,29 @@
|
|||||||
package com.ecep.contract.cloud.u8.ctx;
|
package com.ecep.contract.cloud.u8.ctx;
|
||||||
|
|
||||||
import static com.ecep.contract.SpringApp.getBean;
|
|
||||||
|
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
import com.ecep.contract.ds.company.CompanyContext;
|
|
||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
import com.ecep.contract.MessageHolder;
|
import com.ecep.contract.MessageHolder;
|
||||||
import com.ecep.contract.constant.CloudServiceConstant;
|
import com.ecep.contract.constant.CloudServiceConstant;
|
||||||
import com.ecep.contract.constant.CloudYuConstant;
|
import com.ecep.contract.constant.CloudYuConstant;
|
||||||
import com.ecep.contract.ds.company.service.CompanyService;
|
import com.ecep.contract.ds.company.CompanyContext;
|
||||||
import com.ecep.contract.ds.company.model.Company;
|
import com.ecep.contract.ds.company.model.Company;
|
||||||
import com.ecep.contract.ds.company.model.CompanyOldName;
|
import com.ecep.contract.ds.company.model.CompanyOldName;
|
||||||
|
import com.ecep.contract.ds.company.service.CompanyService;
|
||||||
|
import com.ecep.contract.util.BeanContext;
|
||||||
|
|
||||||
public class CompanyCtx extends AbstractYongYouU8Ctx implements CompanyContext {
|
public class CompanyCtx extends AbstractYongYouU8Ctx implements CompanyContext {
|
||||||
|
public CompanyCtx() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public CompanyCtx(BeanContext ctx) {
|
||||||
|
super(ctx);
|
||||||
|
}
|
||||||
|
|
||||||
public boolean updateCompanyNameIfAbsent(Company company, String name, MessageHolder holder) {
|
public boolean updateCompanyNameIfAbsent(Company company, String name, MessageHolder holder) {
|
||||||
if (!StringUtils.hasText(name)) {
|
if (!StringUtils.hasText(name)) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -14,13 +14,9 @@ import java.util.Objects;
|
|||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.concurrent.atomic.AtomicBoolean;
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
import java.util.function.Consumer;
|
|
||||||
import java.util.function.Supplier;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
import com.ecep.contract.cloud.old.OldVersionService;
|
|
||||||
import com.ecep.contract.vo.*;
|
|
||||||
import org.hibernate.Hibernate;
|
import org.hibernate.Hibernate;
|
||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
@@ -28,8 +24,14 @@ import com.ecep.contract.ContractFileType;
|
|||||||
import com.ecep.contract.ContractPayWay;
|
import com.ecep.contract.ContractPayWay;
|
||||||
import com.ecep.contract.MessageHolder;
|
import com.ecep.contract.MessageHolder;
|
||||||
import com.ecep.contract.MyDateTimeUtils;
|
import com.ecep.contract.MyDateTimeUtils;
|
||||||
|
import com.ecep.contract.cloud.old.OldVersionService;
|
||||||
import com.ecep.contract.constant.CloudServiceConstant;
|
import com.ecep.contract.constant.CloudServiceConstant;
|
||||||
import com.ecep.contract.ds.company.CompanyFileUtils;
|
import com.ecep.contract.ds.company.CompanyFileUtils;
|
||||||
|
import com.ecep.contract.ds.company.model.Company;
|
||||||
|
import com.ecep.contract.ds.contract.model.Contract;
|
||||||
|
import com.ecep.contract.ds.contract.model.ContractFile;
|
||||||
|
import com.ecep.contract.ds.contract.model.ContractItem;
|
||||||
|
import com.ecep.contract.ds.contract.model.ContractPayPlan;
|
||||||
import com.ecep.contract.ds.contract.service.ContractFileService;
|
import com.ecep.contract.ds.contract.service.ContractFileService;
|
||||||
import com.ecep.contract.ds.contract.service.ContractFileTypeService;
|
import com.ecep.contract.ds.contract.service.ContractFileTypeService;
|
||||||
import com.ecep.contract.ds.contract.service.ContractGroupService;
|
import com.ecep.contract.ds.contract.service.ContractGroupService;
|
||||||
@@ -38,30 +40,29 @@ import com.ecep.contract.ds.contract.service.ContractKindService;
|
|||||||
import com.ecep.contract.ds.contract.service.ContractPayPlanService;
|
import com.ecep.contract.ds.contract.service.ContractPayPlanService;
|
||||||
import com.ecep.contract.ds.contract.service.ContractService;
|
import com.ecep.contract.ds.contract.service.ContractService;
|
||||||
import com.ecep.contract.ds.contract.service.ContractTypeService;
|
import com.ecep.contract.ds.contract.service.ContractTypeService;
|
||||||
|
import com.ecep.contract.ds.customer.model.CompanyCustomer;
|
||||||
|
import com.ecep.contract.ds.customer.model.CompanyCustomerEntity;
|
||||||
import com.ecep.contract.ds.customer.service.CompanyCustomerEntityService;
|
import com.ecep.contract.ds.customer.service.CompanyCustomerEntityService;
|
||||||
import com.ecep.contract.ds.customer.service.CustomerService;
|
import com.ecep.contract.ds.customer.service.CustomerService;
|
||||||
import com.ecep.contract.ds.project.ProjectCtx;
|
import com.ecep.contract.ds.project.ProjectCtx;
|
||||||
import com.ecep.contract.ds.project.service.ProjectSaleTypeService;
|
import com.ecep.contract.ds.project.service.ProjectSaleTypeService;
|
||||||
import com.ecep.contract.ds.vendor.service.VendorEntityService;
|
|
||||||
import com.ecep.contract.ds.vendor.service.VendorService;
|
|
||||||
import com.ecep.contract.ds.company.model.Company;
|
|
||||||
import com.ecep.contract.ds.customer.model.CompanyCustomer;
|
|
||||||
import com.ecep.contract.ds.customer.model.CompanyCustomerEntity;
|
|
||||||
import com.ecep.contract.ds.contract.model.Contract;
|
|
||||||
import com.ecep.contract.model.ContractCatalog;
|
|
||||||
import com.ecep.contract.ds.contract.model.ContractFile;
|
|
||||||
import com.ecep.contract.ds.contract.model.ContractItem;
|
|
||||||
import com.ecep.contract.model.ContractKind;
|
|
||||||
import com.ecep.contract.ds.contract.model.ContractPayPlan;
|
|
||||||
import com.ecep.contract.model.ContractType;
|
|
||||||
import com.ecep.contract.model.Employee;
|
|
||||||
import com.ecep.contract.ds.project.model.Project;
|
|
||||||
import com.ecep.contract.model.ProjectSaleType;
|
|
||||||
import com.ecep.contract.ds.vendor.model.Vendor;
|
import com.ecep.contract.ds.vendor.model.Vendor;
|
||||||
import com.ecep.contract.ds.vendor.model.VendorEntity;
|
import com.ecep.contract.ds.vendor.model.VendorEntity;
|
||||||
|
import com.ecep.contract.ds.vendor.service.VendorEntityService;
|
||||||
|
import com.ecep.contract.ds.vendor.service.VendorService;
|
||||||
|
import com.ecep.contract.util.BeanContext;
|
||||||
import com.ecep.contract.util.FileUtils;
|
import com.ecep.contract.util.FileUtils;
|
||||||
import com.ecep.contract.util.NumberUtils;
|
import com.ecep.contract.util.NumberUtils;
|
||||||
import com.ecep.contract.util.TaxRateUtils;
|
import com.ecep.contract.util.TaxRateUtils;
|
||||||
|
import com.ecep.contract.vo.CompanyCustomerEntityVo;
|
||||||
|
import com.ecep.contract.vo.ContractCatalogVo;
|
||||||
|
import com.ecep.contract.vo.ContractFileTypeLocalVo;
|
||||||
|
import com.ecep.contract.vo.ContractFileVo;
|
||||||
|
import com.ecep.contract.vo.ContractVo;
|
||||||
|
import com.ecep.contract.vo.CustomerVo;
|
||||||
|
import com.ecep.contract.vo.ProjectSaleTypeVo;
|
||||||
|
import com.ecep.contract.vo.ProjectVo;
|
||||||
|
import com.ecep.contract.vo.VendorEntityVo;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
@@ -87,6 +88,15 @@ public class ContractCtx extends AbstractYongYouU8Ctx {
|
|||||||
@Setter
|
@Setter
|
||||||
private int customerEntityUpdateDelayDays = 1;
|
private int customerEntityUpdateDelayDays = 1;
|
||||||
|
|
||||||
|
public ContractCtx() {
|
||||||
|
super();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public ContractCtx(BeanContext ctx) {
|
||||||
|
super(ctx);
|
||||||
|
}
|
||||||
|
|
||||||
public ContractService getContractService() {
|
public ContractService getContractService() {
|
||||||
return getCachedBean(ContractService.class);
|
return getCachedBean(ContractService.class);
|
||||||
}
|
}
|
||||||
@@ -109,39 +119,35 @@ public class ContractCtx extends AbstractYongYouU8Ctx {
|
|||||||
|
|
||||||
VendorCtx getVendorCtx() {
|
VendorCtx getVendorCtx() {
|
||||||
if (vendorCtx == null) {
|
if (vendorCtx == null) {
|
||||||
vendorCtx = new VendorCtx();
|
vendorCtx = new VendorCtx(this);
|
||||||
vendorCtx.from(this);
|
|
||||||
}
|
}
|
||||||
return vendorCtx;
|
return vendorCtx;
|
||||||
}
|
}
|
||||||
|
|
||||||
CompanyCtx getCompanyCtx() {
|
CompanyCtx getCompanyCtx() {
|
||||||
if (companyCtx == null) {
|
if (companyCtx == null) {
|
||||||
companyCtx = new CompanyCtx();
|
companyCtx = new CompanyCtx(this);
|
||||||
companyCtx.from(this);
|
|
||||||
}
|
}
|
||||||
return companyCtx;
|
return companyCtx;
|
||||||
}
|
}
|
||||||
|
|
||||||
CustomerCtx getCustomerCtx() {
|
CustomerCtx getCustomerCtx() {
|
||||||
if (customerCtx == null) {
|
if (customerCtx == null) {
|
||||||
customerCtx = new CustomerCtx();
|
customerCtx = new CustomerCtx(this);
|
||||||
customerCtx.from(this);
|
|
||||||
}
|
}
|
||||||
return customerCtx;
|
return customerCtx;
|
||||||
}
|
}
|
||||||
|
|
||||||
InventoryCtx getInventoryCtx() {
|
InventoryCtx getInventoryCtx() {
|
||||||
if (inventoryCtx == null) {
|
if (inventoryCtx == null) {
|
||||||
inventoryCtx = new InventoryCtx();
|
inventoryCtx = new InventoryCtx(this);
|
||||||
inventoryCtx.from(this);
|
|
||||||
}
|
}
|
||||||
return inventoryCtx;
|
return inventoryCtx;
|
||||||
}
|
}
|
||||||
|
|
||||||
ProjectCtx getProjectCtx() {
|
ProjectCtx getProjectCtx() {
|
||||||
if (projectCtx == null) {
|
if (projectCtx == null) {
|
||||||
projectCtx = new ProjectCtx();
|
projectCtx = new ProjectCtx(this);
|
||||||
}
|
}
|
||||||
return projectCtx;
|
return projectCtx;
|
||||||
}
|
}
|
||||||
@@ -262,15 +268,18 @@ public class ContractCtx extends AbstractYongYouU8Ctx {
|
|||||||
"变更日期")) {
|
"变更日期")) {
|
||||||
modified = true;
|
modified = true;
|
||||||
}
|
}
|
||||||
if (updateEmployeeIdByName(contract::getSetupPersonId, contract::setSetupPersonId, (String) rs.get("strSetupPerson"),
|
if (updateEmployeeIdByName(contract::getSetupPersonId, contract::setSetupPersonId,
|
||||||
|
(String) rs.get("strSetupPerson"),
|
||||||
holder, "提交人")) {
|
holder, "提交人")) {
|
||||||
modified = true;
|
modified = true;
|
||||||
}
|
}
|
||||||
if (updateEmployeeIdByName(contract::getInurePersonId, contract::setInurePersonId, (String) rs.get("strInurePerson"),
|
if (updateEmployeeIdByName(contract::getInurePersonId, contract::setInurePersonId,
|
||||||
|
(String) rs.get("strInurePerson"),
|
||||||
holder, "生效人")) {
|
holder, "生效人")) {
|
||||||
modified = true;
|
modified = true;
|
||||||
}
|
}
|
||||||
if (updateEmployeeIdByName(contract::getVaryPersonId, contract::setVaryPersonId, (String) rs.get("strVaryPerson"),
|
if (updateEmployeeIdByName(contract::getVaryPersonId, contract::setVaryPersonId,
|
||||||
|
(String) rs.get("strVaryPerson"),
|
||||||
holder, "修改人")) {
|
holder, "修改人")) {
|
||||||
modified = true;
|
modified = true;
|
||||||
}
|
}
|
||||||
@@ -364,7 +373,8 @@ public class ContractCtx extends AbstractYongYouU8Ctx {
|
|||||||
var contractCompany = getCompanyService().findById(companyId);
|
var contractCompany = getCompanyService().findById(companyId);
|
||||||
var vendorCompany = getCompanyService().findById(vendor.getCompanyId());
|
var vendorCompany = getCompanyService().findById(vendor.getCompanyId());
|
||||||
holder.error(
|
holder.error(
|
||||||
"供应商的企业和合同的企业不一致, 供应商的企业:" + vendorCompany.getName() + ",合同的企业:" + contractCompany.getName());
|
"供应商的企业和合同的企业不一致, 供应商的企业:" + vendorCompany.getName() + ",合同的企业:"
|
||||||
|
+ contractCompany.getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -627,7 +637,6 @@ public class ContractCtx extends AbstractYongYouU8Ctx {
|
|||||||
return updated;
|
return updated;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public ContractVo findContractByCode(String contractCode) {
|
public ContractVo findContractByCode(String contractCode) {
|
||||||
var service = getContractService();
|
var service = getContractService();
|
||||||
return service.findByCode(contractCode);
|
return service.findByCode(contractCode);
|
||||||
@@ -1318,7 +1327,6 @@ public class ContractCtx extends AbstractYongYouU8Ctx {
|
|||||||
return Math.max(suggestFileName.length(), value.length());
|
return Math.max(suggestFileName.length(), value.length());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public boolean syncContractPayPlan(ContractVo contract, MessageHolder holder) {
|
public boolean syncContractPayPlan(ContractVo contract, MessageHolder holder) {
|
||||||
if (repository == null) {
|
if (repository == null) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import com.ecep.contract.ds.company.model.Company;
|
|||||||
import com.ecep.contract.ds.customer.model.CompanyCustomer;
|
import com.ecep.contract.ds.customer.model.CompanyCustomer;
|
||||||
import com.ecep.contract.ds.customer.model.CompanyCustomerEntity;
|
import com.ecep.contract.ds.customer.model.CompanyCustomerEntity;
|
||||||
import com.ecep.contract.model.CustomerCatalog;
|
import com.ecep.contract.model.CustomerCatalog;
|
||||||
|
import com.ecep.contract.util.BeanContext;
|
||||||
import com.ecep.contract.vo.CompanyCustomerEntityVo;
|
import com.ecep.contract.vo.CompanyCustomerEntityVo;
|
||||||
import com.ecep.contract.vo.CustomerCatalogVo;
|
import com.ecep.contract.vo.CustomerCatalogVo;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
@@ -25,6 +26,7 @@ import java.util.function.Supplier;
|
|||||||
|
|
||||||
public class CustomerCtx extends AbstractYongYouU8Ctx {
|
public class CustomerCtx extends AbstractYongYouU8Ctx {
|
||||||
private static final String AUTO_CREATE_CUSTOMER_AFTER = "cloud.u8.auto-create-customer-after";
|
private static final String AUTO_CREATE_CUSTOMER_AFTER = "cloud.u8.auto-create-customer-after";
|
||||||
|
|
||||||
@Setter
|
@Setter
|
||||||
private CompanyCtx companyCtx;
|
private CompanyCtx companyCtx;
|
||||||
@Setter
|
@Setter
|
||||||
@@ -34,18 +36,24 @@ public class CustomerCtx extends AbstractYongYouU8Ctx {
|
|||||||
@Setter
|
@Setter
|
||||||
private CompanyCustomerEntityService customerEntityService;
|
private CompanyCustomerEntityService customerEntityService;
|
||||||
|
|
||||||
|
public CustomerCtx() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public CustomerCtx(BeanContext ctx) {
|
||||||
|
super(ctx);
|
||||||
|
}
|
||||||
|
|
||||||
public CompanyCtx getCompanyCtx() {
|
public CompanyCtx getCompanyCtx() {
|
||||||
if (companyCtx == null) {
|
if (companyCtx == null) {
|
||||||
companyCtx = new CompanyCtx();
|
companyCtx = new CompanyCtx(this);
|
||||||
companyCtx.from(this);
|
|
||||||
}
|
}
|
||||||
return companyCtx;
|
return companyCtx;
|
||||||
}
|
}
|
||||||
|
|
||||||
ContractCtx getContractCtx() {
|
ContractCtx getContractCtx() {
|
||||||
if (contractCtx == null) {
|
if (contractCtx == null) {
|
||||||
contractCtx = new ContractCtx();
|
contractCtx = new ContractCtx(this);
|
||||||
contractCtx.from(this);
|
|
||||||
}
|
}
|
||||||
return contractCtx;
|
return contractCtx;
|
||||||
}
|
}
|
||||||
@@ -53,7 +61,6 @@ public class CustomerCtx extends AbstractYongYouU8Ctx {
|
|||||||
CompanyBankAccountCtx getCompanyBankAccountCtx() {
|
CompanyBankAccountCtx getCompanyBankAccountCtx() {
|
||||||
if (companyBankAccountCtx == null) {
|
if (companyBankAccountCtx == null) {
|
||||||
companyBankAccountCtx = new CompanyBankAccountCtx();
|
companyBankAccountCtx = new CompanyBankAccountCtx();
|
||||||
companyBankAccountCtx.from(this);
|
|
||||||
}
|
}
|
||||||
return companyBankAccountCtx;
|
return companyBankAccountCtx;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
package com.ecep.contract.cloud.u8.ctx;
|
package com.ecep.contract.cloud.u8.ctx;
|
||||||
|
|
||||||
import static com.ecep.contract.SpringApp.getBean;
|
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
@@ -11,18 +9,19 @@ import org.springframework.util.StringUtils;
|
|||||||
import com.ecep.contract.MessageHolder;
|
import com.ecep.contract.MessageHolder;
|
||||||
import com.ecep.contract.ds.company.service.InvoiceService;
|
import com.ecep.contract.ds.company.service.InvoiceService;
|
||||||
import com.ecep.contract.ds.other.model.Invoice;
|
import com.ecep.contract.ds.other.model.Invoice;
|
||||||
|
import com.ecep.contract.util.BeanContext;
|
||||||
import lombok.Setter;
|
|
||||||
|
|
||||||
public class InvoiceCtx extends AbstractYongYouU8Ctx {
|
public class InvoiceCtx extends AbstractYongYouU8Ctx {
|
||||||
@Setter
|
public InvoiceCtx() {
|
||||||
private InvoiceService invoiceService;
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public InvoiceCtx(BeanContext ctx) {
|
||||||
|
super(ctx);
|
||||||
|
}
|
||||||
|
|
||||||
InvoiceService getInvoiceService() {
|
InvoiceService getInvoiceService() {
|
||||||
if (invoiceService == null) {
|
return getCachedBean(InvoiceService.class);
|
||||||
invoiceService = getBean(InvoiceService.class);
|
|
||||||
}
|
|
||||||
return invoiceService;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean updateInvoiceByNumber(Supplier<Invoice> getter, Consumer<Invoice> setter, String invoiceNumber,
|
public boolean updateInvoiceByNumber(Supplier<Invoice> getter, Consumer<Invoice> setter, String invoiceNumber,
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ import com.ecep.contract.ds.vendor.model.Vendor;
|
|||||||
import com.ecep.contract.ds.vendor.model.VendorEntity;
|
import com.ecep.contract.ds.vendor.model.VendorEntity;
|
||||||
import com.ecep.contract.ds.contract.model.Contract;
|
import com.ecep.contract.ds.contract.model.Contract;
|
||||||
import com.ecep.contract.model.Inventory;
|
import com.ecep.contract.model.Inventory;
|
||||||
|
import com.ecep.contract.util.BeanContext;
|
||||||
import com.ecep.contract.ds.other.model.Invoice;
|
import com.ecep.contract.ds.other.model.Invoice;
|
||||||
import com.ecep.contract.ds.vendor.model.PurchaseBillVoucher;
|
import com.ecep.contract.ds.vendor.model.PurchaseBillVoucher;
|
||||||
import com.ecep.contract.ds.vendor.model.PurchaseBillVoucherItem;
|
import com.ecep.contract.ds.vendor.model.PurchaseBillVoucherItem;
|
||||||
@@ -50,6 +51,14 @@ public class PurchaseBillVoucherCtx extends AbstractYongYouU8Ctx {
|
|||||||
InvoiceCtx invoiceCtx;
|
InvoiceCtx invoiceCtx;
|
||||||
ContractCtx contractCtx;
|
ContractCtx contractCtx;
|
||||||
|
|
||||||
|
public PurchaseBillVoucherCtx() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public PurchaseBillVoucherCtx(BeanContext ctx) {
|
||||||
|
super(ctx);
|
||||||
|
}
|
||||||
|
|
||||||
PurchaseOrdersService getPurchaseOrdersService() {
|
PurchaseOrdersService getPurchaseOrdersService() {
|
||||||
if (purchaseOrdersService == null) {
|
if (purchaseOrdersService == null) {
|
||||||
purchaseOrdersService = getBean(PurchaseOrdersService.class);
|
purchaseOrdersService = getBean(PurchaseOrdersService.class);
|
||||||
@@ -80,24 +89,21 @@ public class PurchaseBillVoucherCtx extends AbstractYongYouU8Ctx {
|
|||||||
|
|
||||||
InventoryCtx getInventoryCtx() {
|
InventoryCtx getInventoryCtx() {
|
||||||
if (inventoryCtx == null) {
|
if (inventoryCtx == null) {
|
||||||
inventoryCtx = new InventoryCtx();
|
inventoryCtx = new InventoryCtx(this);
|
||||||
inventoryCtx.from(this);
|
|
||||||
}
|
}
|
||||||
return inventoryCtx;
|
return inventoryCtx;
|
||||||
}
|
}
|
||||||
|
|
||||||
InvoiceCtx getInvoiceCtx() {
|
InvoiceCtx getInvoiceCtx() {
|
||||||
if (invoiceCtx == null) {
|
if (invoiceCtx == null) {
|
||||||
invoiceCtx = new InvoiceCtx();
|
invoiceCtx = new InvoiceCtx(this);
|
||||||
invoiceCtx.from(this);
|
|
||||||
}
|
}
|
||||||
return invoiceCtx;
|
return invoiceCtx;
|
||||||
}
|
}
|
||||||
|
|
||||||
ContractCtx getContractCtx() {
|
ContractCtx getContractCtx() {
|
||||||
if (contractCtx == null) {
|
if (contractCtx == null) {
|
||||||
contractCtx = new ContractCtx();
|
contractCtx = new ContractCtx(this);
|
||||||
contractCtx.from(this);
|
|
||||||
}
|
}
|
||||||
return contractCtx;
|
return contractCtx;
|
||||||
}
|
}
|
||||||
@@ -121,7 +127,8 @@ public class PurchaseBillVoucherCtx extends AbstractYongYouU8Ctx {
|
|||||||
// 查询 U8 数据库
|
// 查询 U8 数据库
|
||||||
List<Map<String, Object>> ds = repository.findAllPurchaseBillVoucherByVendorCode(entity.getCode());
|
List<Map<String, Object>> ds = repository.findAllPurchaseBillVoucherByVendorCode(entity.getCode());
|
||||||
holder.debug(
|
holder.debug(
|
||||||
"供应商关联项: " + entity.getCode() + " 查找到 " + ds.size() + " 条专用发票记录在 " + CloudServiceConstant.U8_NAME);
|
"供应商关联项: " + entity.getCode() + " 查找到 " + ds.size() + " 条专用发票记录在 "
|
||||||
|
+ CloudServiceConstant.U8_NAME);
|
||||||
|
|
||||||
for (Map<String, Object> map : ds) {
|
for (Map<String, Object> map : ds) {
|
||||||
Integer pbvid = (Integer) map.get("PBVID");
|
Integer pbvid = (Integer) map.get("PBVID");
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ import com.ecep.contract.ds.contract.model.Contract;
|
|||||||
import com.ecep.contract.model.Inventory;
|
import com.ecep.contract.model.Inventory;
|
||||||
import com.ecep.contract.ds.vendor.model.PurchaseOrder;
|
import com.ecep.contract.ds.vendor.model.PurchaseOrder;
|
||||||
import com.ecep.contract.ds.vendor.model.PurchaseOrderItem;
|
import com.ecep.contract.ds.vendor.model.PurchaseOrderItem;
|
||||||
|
import com.ecep.contract.util.BeanContext;
|
||||||
import com.ecep.contract.util.NumberUtils;
|
import com.ecep.contract.util.NumberUtils;
|
||||||
|
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
@@ -44,18 +45,24 @@ public class PurchaseOrderCtx extends AbstractYongYouU8Ctx {
|
|||||||
InventoryCtx inventoryCtx;
|
InventoryCtx inventoryCtx;
|
||||||
CompanyBankAccountCtx companyBankAccountCtx;
|
CompanyBankAccountCtx companyBankAccountCtx;
|
||||||
|
|
||||||
|
public PurchaseOrderCtx() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public PurchaseOrderCtx(BeanContext ctx) {
|
||||||
|
super(ctx);
|
||||||
|
}
|
||||||
|
|
||||||
InventoryCtx getInventoryCtx() {
|
InventoryCtx getInventoryCtx() {
|
||||||
if (inventoryCtx == null) {
|
if (inventoryCtx == null) {
|
||||||
inventoryCtx = new InventoryCtx();
|
inventoryCtx = new InventoryCtx(this);
|
||||||
inventoryCtx.from(this);
|
|
||||||
}
|
}
|
||||||
return inventoryCtx;
|
return inventoryCtx;
|
||||||
}
|
}
|
||||||
|
|
||||||
CompanyBankAccountCtx getCompanyBankAccountCtx() {
|
CompanyBankAccountCtx getCompanyBankAccountCtx() {
|
||||||
if (companyBankAccountCtx == null) {
|
if (companyBankAccountCtx == null) {
|
||||||
companyBankAccountCtx = new CompanyBankAccountCtx();
|
companyBankAccountCtx = new CompanyBankAccountCtx(this);
|
||||||
companyBankAccountCtx.from(this);
|
|
||||||
}
|
}
|
||||||
return companyBankAccountCtx;
|
return companyBankAccountCtx;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,8 +15,7 @@ public class PurchaseSettlementVoucherCtx extends AbstractYongYouU8Ctx {
|
|||||||
|
|
||||||
InventoryCtx getInventoryCtx() {
|
InventoryCtx getInventoryCtx() {
|
||||||
if (inventoryCtx == null) {
|
if (inventoryCtx == null) {
|
||||||
inventoryCtx = new InventoryCtx();
|
inventoryCtx = new InventoryCtx(this);
|
||||||
inventoryCtx.from(this);
|
|
||||||
}
|
}
|
||||||
return inventoryCtx;
|
return inventoryCtx;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
package com.ecep.contract.cloud.u8.ctx;
|
package com.ecep.contract.cloud.u8.ctx;
|
||||||
|
|
||||||
import static com.ecep.contract.SpringApp.getBean;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.sql.Timestamp;
|
import java.sql.Timestamp;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@@ -18,24 +16,33 @@ import org.springframework.util.StringUtils;
|
|||||||
|
|
||||||
import com.ecep.contract.MessageHolder;
|
import com.ecep.contract.MessageHolder;
|
||||||
import com.ecep.contract.constant.CloudServiceConstant;
|
import com.ecep.contract.constant.CloudServiceConstant;
|
||||||
|
import com.ecep.contract.ds.company.model.Company;
|
||||||
|
import com.ecep.contract.ds.contract.model.Contract;
|
||||||
import com.ecep.contract.ds.contract.service.ContractService;
|
import com.ecep.contract.ds.contract.service.ContractService;
|
||||||
import com.ecep.contract.ds.contract.service.SaleOrdersService;
|
import com.ecep.contract.ds.contract.service.SaleOrdersService;
|
||||||
import com.ecep.contract.ds.contract.service.SalesBillVoucherItemService;
|
import com.ecep.contract.ds.contract.service.SalesBillVoucherItemService;
|
||||||
import com.ecep.contract.ds.contract.service.SalesBillVoucherService;
|
import com.ecep.contract.ds.contract.service.SalesBillVoucherService;
|
||||||
import com.ecep.contract.ds.company.model.Company;
|
|
||||||
import com.ecep.contract.ds.customer.model.CompanyCustomer;
|
import com.ecep.contract.ds.customer.model.CompanyCustomer;
|
||||||
import com.ecep.contract.ds.customer.model.CompanyCustomerEntity;
|
import com.ecep.contract.ds.customer.model.CompanyCustomerEntity;
|
||||||
import com.ecep.contract.ds.contract.model.Contract;
|
|
||||||
import com.ecep.contract.model.Inventory;
|
|
||||||
import com.ecep.contract.ds.customer.model.SalesBillVoucher;
|
import com.ecep.contract.ds.customer.model.SalesBillVoucher;
|
||||||
import com.ecep.contract.ds.customer.model.SalesBillVoucherItem;
|
import com.ecep.contract.ds.customer.model.SalesBillVoucherItem;
|
||||||
import com.ecep.contract.ds.customer.model.SalesOrder;
|
import com.ecep.contract.ds.customer.model.SalesOrder;
|
||||||
|
import com.ecep.contract.model.Inventory;
|
||||||
|
import com.ecep.contract.util.BeanContext;
|
||||||
import com.ecep.contract.util.NumberUtils;
|
import com.ecep.contract.util.NumberUtils;
|
||||||
import com.ecep.contract.vo.SalesOrderVo;
|
import com.ecep.contract.vo.SalesOrderVo;
|
||||||
|
|
||||||
public class SalesBillVoucherCtx extends AbstractYongYouU8Ctx {
|
public class SalesBillVoucherCtx extends AbstractYongYouU8Ctx {
|
||||||
InventoryCtx inventoryCtx;
|
InventoryCtx inventoryCtx;
|
||||||
|
|
||||||
|
public SalesBillVoucherCtx() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public SalesBillVoucherCtx(BeanContext ctx) {
|
||||||
|
super(ctx);
|
||||||
|
}
|
||||||
|
|
||||||
ContractService getContractService() {
|
ContractService getContractService() {
|
||||||
return getCachedBean(ContractService.class);
|
return getCachedBean(ContractService.class);
|
||||||
}
|
}
|
||||||
@@ -54,8 +61,7 @@ public class SalesBillVoucherCtx extends AbstractYongYouU8Ctx {
|
|||||||
|
|
||||||
InventoryCtx getInventoryCtx() {
|
InventoryCtx getInventoryCtx() {
|
||||||
if (inventoryCtx == null) {
|
if (inventoryCtx == null) {
|
||||||
inventoryCtx = new InventoryCtx();
|
inventoryCtx = new InventoryCtx(this);
|
||||||
inventoryCtx.from(this);
|
|
||||||
}
|
}
|
||||||
return inventoryCtx;
|
return inventoryCtx;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
package com.ecep.contract.cloud.u8.ctx;
|
package com.ecep.contract.cloud.u8.ctx;
|
||||||
|
|
||||||
import static com.ecep.contract.SpringApp.getBean;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.sql.Timestamp;
|
import java.sql.Timestamp;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -14,24 +12,23 @@ import java.util.function.Function;
|
|||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import com.ecep.contract.ds.company.model.Company;
|
|
||||||
import com.ecep.contract.ds.company.service.CompanyService;
|
|
||||||
import com.ecep.contract.ds.contract.service.ContractItemService;
|
|
||||||
import com.ecep.contract.ds.contract.service.ContractService;
|
|
||||||
import com.ecep.contract.vo.ContractVo;
|
|
||||||
import org.springframework.data.domain.Sort;
|
|
||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
import com.ecep.contract.MessageHolder;
|
import com.ecep.contract.MessageHolder;
|
||||||
import com.ecep.contract.constant.CloudServiceConstant;
|
import com.ecep.contract.constant.CloudServiceConstant;
|
||||||
|
import com.ecep.contract.ds.company.model.Company;
|
||||||
|
import com.ecep.contract.ds.company.service.CompanyService;
|
||||||
|
import com.ecep.contract.ds.contract.service.ContractItemService;
|
||||||
|
import com.ecep.contract.ds.contract.service.ContractService;
|
||||||
import com.ecep.contract.ds.contract.service.SaleOrdersService;
|
import com.ecep.contract.ds.contract.service.SaleOrdersService;
|
||||||
import com.ecep.contract.ds.contract.service.SalesOrderItemService;
|
import com.ecep.contract.ds.contract.service.SalesOrderItemService;
|
||||||
import com.ecep.contract.ds.contract.model.Contract;
|
|
||||||
import com.ecep.contract.ds.customer.model.SalesOrder;
|
import com.ecep.contract.ds.customer.model.SalesOrder;
|
||||||
import com.ecep.contract.ds.customer.model.SalesOrderItem;
|
import com.ecep.contract.ds.customer.model.SalesOrderItem;
|
||||||
import com.ecep.contract.ds.customer.service.CompanyCustomerEntityService;
|
import com.ecep.contract.ds.customer.service.CompanyCustomerEntityService;
|
||||||
import com.ecep.contract.ds.customer.service.CustomerService;
|
import com.ecep.contract.ds.customer.service.CustomerService;
|
||||||
|
import com.ecep.contract.util.BeanContext;
|
||||||
import com.ecep.contract.util.NumberUtils;
|
import com.ecep.contract.util.NumberUtils;
|
||||||
|
import com.ecep.contract.vo.ContractVo;
|
||||||
|
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
|
||||||
@@ -42,11 +39,16 @@ public class SalesOrderCtx extends AbstractYongYouU8Ctx {
|
|||||||
@Setter
|
@Setter
|
||||||
private SalesOrderItemService orderItemService;
|
private SalesOrderItemService orderItemService;
|
||||||
|
|
||||||
SaleOrdersService getSaleOrdersService() {
|
public SalesOrderCtx() {
|
||||||
if (saleOrdersService == null) {
|
super();
|
||||||
saleOrdersService = getBean(SaleOrdersService.class);
|
|
||||||
}
|
}
|
||||||
return saleOrdersService;
|
|
||||||
|
public SalesOrderCtx(BeanContext ctx) {
|
||||||
|
super(ctx);
|
||||||
|
}
|
||||||
|
|
||||||
|
SaleOrdersService getSaleOrdersService() {
|
||||||
|
return getCachedBean(SaleOrdersService.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import com.ecep.contract.ds.company.model.Company;
|
|||||||
import com.ecep.contract.ds.vendor.model.Vendor;
|
import com.ecep.contract.ds.vendor.model.Vendor;
|
||||||
import com.ecep.contract.ds.vendor.model.VendorEntity;
|
import com.ecep.contract.ds.vendor.model.VendorEntity;
|
||||||
import com.ecep.contract.model.VendorCatalog;
|
import com.ecep.contract.model.VendorCatalog;
|
||||||
|
import com.ecep.contract.util.BeanContext;
|
||||||
|
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
|
||||||
@@ -39,26 +40,31 @@ public class VendorCtx extends AbstractYongYouU8Ctx {
|
|||||||
@Setter
|
@Setter
|
||||||
private CompanyBankAccountCtx companyBankAccountCtx;
|
private CompanyBankAccountCtx companyBankAccountCtx;
|
||||||
|
|
||||||
|
public VendorCtx() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public VendorCtx(BeanContext ctx) {
|
||||||
|
super(ctx);
|
||||||
|
}
|
||||||
|
|
||||||
public CompanyCtx getCompanyCtx() {
|
public CompanyCtx getCompanyCtx() {
|
||||||
if (companyCtx == null) {
|
if (companyCtx == null) {
|
||||||
companyCtx = new CompanyCtx();
|
companyCtx = new CompanyCtx(this);
|
||||||
companyCtx.from(this);
|
|
||||||
}
|
}
|
||||||
return companyCtx;
|
return companyCtx;
|
||||||
}
|
}
|
||||||
|
|
||||||
ContractCtx getContractCtx() {
|
ContractCtx getContractCtx() {
|
||||||
if (contractCtx == null) {
|
if (contractCtx == null) {
|
||||||
contractCtx = new ContractCtx();
|
contractCtx = new ContractCtx(this);
|
||||||
contractCtx.from(this);
|
|
||||||
}
|
}
|
||||||
return contractCtx;
|
return contractCtx;
|
||||||
}
|
}
|
||||||
|
|
||||||
CompanyBankAccountCtx getCompanyBankAccountCtx() {
|
CompanyBankAccountCtx getCompanyBankAccountCtx() {
|
||||||
if (companyBankAccountCtx == null) {
|
if (companyBankAccountCtx == null) {
|
||||||
companyBankAccountCtx = new CompanyBankAccountCtx();
|
companyBankAccountCtx = new CompanyBankAccountCtx(this);
|
||||||
companyBankAccountCtx.from(this);
|
|
||||||
}
|
}
|
||||||
return companyBankAccountCtx;
|
return companyBankAccountCtx;
|
||||||
}
|
}
|
||||||
@@ -100,7 +106,6 @@ public class VendorCtx extends AbstractYongYouU8Ctx {
|
|||||||
String phone = (String) map.get("cVenPhone");
|
String phone = (String) map.get("cVenPhone");
|
||||||
String person = (String) map.get("cVenPerson");
|
String person = (String) map.get("cVenPerson");
|
||||||
|
|
||||||
|
|
||||||
boolean modified = false;
|
boolean modified = false;
|
||||||
if (updateText(item::getName, item::setName, name, holder, "名称")) {
|
if (updateText(item::getName, item::setName, name, holder, "名称")) {
|
||||||
modified = true;
|
modified = true;
|
||||||
@@ -135,7 +140,6 @@ public class VendorCtx extends AbstractYongYouU8Ctx {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Vendor vendor = item.getVendor();
|
Vendor vendor = item.getVendor();
|
||||||
if (vendor == null) {
|
if (vendor == null) {
|
||||||
// 如果没有关联供应商,则根据供应商名称或别名查找公司
|
// 如果没有关联供应商,则根据供应商名称或别名查找公司
|
||||||
@@ -167,7 +171,8 @@ public class VendorCtx extends AbstractYongYouU8Ctx {
|
|||||||
return modified;
|
return modified;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean updateVendorCatalog(Supplier<VendorCatalog> getter, Consumer<VendorCatalog> setter, String catalogCode, MessageHolder holder, String topic) {
|
private boolean updateVendorCatalog(Supplier<VendorCatalog> getter, Consumer<VendorCatalog> setter,
|
||||||
|
String catalogCode, MessageHolder holder, String topic) {
|
||||||
VendorCatalogVo catalog = null;
|
VendorCatalogVo catalog = null;
|
||||||
if (StringUtils.hasText(catalogCode)) {
|
if (StringUtils.hasText(catalogCode)) {
|
||||||
catalog = getCompanyVendorService().findCatalogByCode(catalogCode);
|
catalog = getCompanyVendorService().findCatalogByCode(catalogCode);
|
||||||
@@ -251,7 +256,8 @@ public class VendorCtx extends AbstractYongYouU8Ctx {
|
|||||||
return updated;
|
return updated;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean updateCompanyNameAndAbbNameByVendorEntity(Company company, VendorEntity entity, MessageHolder holder) {
|
private boolean updateCompanyNameAndAbbNameByVendorEntity(Company company, VendorEntity entity,
|
||||||
|
MessageHolder holder) {
|
||||||
CompanyService companyService = getCompanyService();
|
CompanyService companyService = getCompanyService();
|
||||||
if (company == null) {
|
if (company == null) {
|
||||||
return false;
|
return false;
|
||||||
@@ -321,7 +327,6 @@ public class VendorCtx extends AbstractYongYouU8Ctx {
|
|||||||
return vendor;
|
return vendor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private Company findOrCreateCompanyByVendorEntity(VendorEntity entity, MessageHolder holder) {
|
private Company findOrCreateCompanyByVendorEntity(VendorEntity entity, MessageHolder holder) {
|
||||||
String name = entity.getName();
|
String name = entity.getName();
|
||||||
String abbName = entity.getAbbName();
|
String abbName = entity.getAbbName();
|
||||||
@@ -332,7 +337,6 @@ public class VendorCtx extends AbstractYongYouU8Ctx {
|
|||||||
return getCompanyVendorEntityService().save(entity);
|
return getCompanyVendorEntityService().save(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public VendorVo save(VendorVo vendor) {
|
public VendorVo save(VendorVo vendor) {
|
||||||
VendorService service = getCompanyVendorService();
|
VendorService service = getCompanyVendorService();
|
||||||
Vendor v0 = service.getById(vendor.getId());
|
Vendor v0 = service.getById(vendor.getId());
|
||||||
|
|||||||
@@ -6,16 +6,12 @@ import java.util.Objects;
|
|||||||
import java.util.concurrent.atomic.AtomicReference;
|
import java.util.concurrent.atomic.AtomicReference;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
import com.ecep.contract.ds.project.service.ProjectService;
|
|
||||||
import com.ecep.contract.ds.vendor.model.PurchaseOrder;
|
|
||||||
import org.hibernate.Hibernate;
|
|
||||||
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
|
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
|
||||||
import org.springframework.jdbc.CannotGetJdbcConnectionException;
|
import org.springframework.jdbc.CannotGetJdbcConnectionException;
|
||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
import com.ecep.contract.ContractPayWay;
|
import com.ecep.contract.ContractPayWay;
|
||||||
import com.ecep.contract.MessageHolder;
|
import com.ecep.contract.MessageHolder;
|
||||||
import com.ecep.contract.SpringApp;
|
|
||||||
import com.ecep.contract.cloud.u8.YongYouU8Service;
|
import com.ecep.contract.cloud.u8.YongYouU8Service;
|
||||||
import com.ecep.contract.cloud.u8.ctx.ContractCtx;
|
import com.ecep.contract.cloud.u8.ctx.ContractCtx;
|
||||||
import com.ecep.contract.cloud.u8.ctx.PurchaseBillVoucherCtx;
|
import com.ecep.contract.cloud.u8.ctx.PurchaseBillVoucherCtx;
|
||||||
@@ -23,10 +19,11 @@ import com.ecep.contract.cloud.u8.ctx.PurchaseOrderCtx;
|
|||||||
import com.ecep.contract.cloud.u8.ctx.SalesBillVoucherCtx;
|
import com.ecep.contract.cloud.u8.ctx.SalesBillVoucherCtx;
|
||||||
import com.ecep.contract.cloud.u8.ctx.SalesOrderCtx;
|
import com.ecep.contract.cloud.u8.ctx.SalesOrderCtx;
|
||||||
import com.ecep.contract.constant.CloudServiceConstant;
|
import com.ecep.contract.constant.CloudServiceConstant;
|
||||||
import com.ecep.contract.ds.contract.service.ContractService;
|
|
||||||
import com.ecep.contract.ds.contract.model.Contract;
|
import com.ecep.contract.ds.contract.model.Contract;
|
||||||
import com.ecep.contract.ds.project.model.Project;
|
import com.ecep.contract.ds.contract.service.ContractService;
|
||||||
import com.ecep.contract.ds.customer.model.SalesOrder;
|
import com.ecep.contract.ds.customer.model.SalesOrder;
|
||||||
|
import com.ecep.contract.ds.project.service.ProjectService;
|
||||||
|
import com.ecep.contract.ds.vendor.model.PurchaseOrder;
|
||||||
import com.ecep.contract.ui.Tasker;
|
import com.ecep.contract.ui.Tasker;
|
||||||
import com.ecep.contract.vo.ContractVo;
|
import com.ecep.contract.vo.ContractVo;
|
||||||
|
|
||||||
@@ -42,7 +39,7 @@ public abstract class AbstContractRepairTasker extends Tasker<Object> {
|
|||||||
@Getter
|
@Getter
|
||||||
protected boolean saleOrderUpdated = false;
|
protected boolean saleOrderUpdated = false;
|
||||||
|
|
||||||
protected final ContractCtx contractCtx = new ContractCtx();
|
protected final ContractCtx contractCtx = new ContractCtx(this);
|
||||||
protected SalesOrderCtx salesOrderCtx = null;
|
protected SalesOrderCtx salesOrderCtx = null;
|
||||||
protected SalesBillVoucherCtx salesBillVoucherCtx = null;
|
protected SalesBillVoucherCtx salesBillVoucherCtx = null;
|
||||||
protected PurchaseOrderCtx purchaseOrderCtx = null;
|
protected PurchaseOrderCtx purchaseOrderCtx = null;
|
||||||
@@ -50,32 +47,28 @@ public abstract class AbstContractRepairTasker extends Tasker<Object> {
|
|||||||
|
|
||||||
SalesOrderCtx getSalesOrderCtx() {
|
SalesOrderCtx getSalesOrderCtx() {
|
||||||
if (salesOrderCtx == null) {
|
if (salesOrderCtx == null) {
|
||||||
salesOrderCtx = new SalesOrderCtx();
|
salesOrderCtx = new SalesOrderCtx(this);
|
||||||
salesOrderCtx.from(contractCtx);
|
|
||||||
}
|
}
|
||||||
return salesOrderCtx;
|
return salesOrderCtx;
|
||||||
}
|
}
|
||||||
|
|
||||||
SalesBillVoucherCtx getSalesBillVoucherCtx() {
|
SalesBillVoucherCtx getSalesBillVoucherCtx() {
|
||||||
if (salesBillVoucherCtx == null) {
|
if (salesBillVoucherCtx == null) {
|
||||||
salesBillVoucherCtx = new SalesBillVoucherCtx();
|
salesBillVoucherCtx = new SalesBillVoucherCtx(this);
|
||||||
salesBillVoucherCtx.from(contractCtx);
|
|
||||||
}
|
}
|
||||||
return salesBillVoucherCtx;
|
return salesBillVoucherCtx;
|
||||||
}
|
}
|
||||||
|
|
||||||
PurchaseOrderCtx getPurchaseOrderCtx() {
|
PurchaseOrderCtx getPurchaseOrderCtx() {
|
||||||
if (purchaseOrderCtx == null) {
|
if (purchaseOrderCtx == null) {
|
||||||
purchaseOrderCtx = new PurchaseOrderCtx();
|
purchaseOrderCtx = new PurchaseOrderCtx(this);
|
||||||
purchaseOrderCtx.from(contractCtx);
|
|
||||||
}
|
}
|
||||||
return purchaseOrderCtx;
|
return purchaseOrderCtx;
|
||||||
}
|
}
|
||||||
|
|
||||||
PurchaseBillVoucherCtx getPurchaseBillVoucherCtx() {
|
PurchaseBillVoucherCtx getPurchaseBillVoucherCtx() {
|
||||||
if (purchaseBillVoucherCtx == null) {
|
if (purchaseBillVoucherCtx == null) {
|
||||||
purchaseBillVoucherCtx = new PurchaseBillVoucherCtx();
|
purchaseBillVoucherCtx = new PurchaseBillVoucherCtx(this);
|
||||||
purchaseBillVoucherCtx.from(contractCtx);
|
|
||||||
}
|
}
|
||||||
return purchaseBillVoucherCtx;
|
return purchaseBillVoucherCtx;
|
||||||
}
|
}
|
||||||
@@ -83,7 +76,7 @@ public abstract class AbstContractRepairTasker extends Tasker<Object> {
|
|||||||
@Override
|
@Override
|
||||||
protected Object execute(MessageHolder holder) throws Exception {
|
protected Object execute(MessageHolder holder) throws Exception {
|
||||||
try {
|
try {
|
||||||
YongYouU8Service u8Service = SpringApp.getBean(YongYouU8Service.class);
|
YongYouU8Service u8Service = getBean(YongYouU8Service.class);
|
||||||
u8Service.initialize(contractCtx);
|
u8Service.initialize(contractCtx);
|
||||||
} catch (NoSuchBeanDefinitionException ignored) {
|
} catch (NoSuchBeanDefinitionException ignored) {
|
||||||
holder.warn("无法使用 " + CloudServiceConstant.U8_NAME + " 服务");
|
holder.warn("无法使用 " + CloudServiceConstant.U8_NAME + " 服务");
|
||||||
|
|||||||
@@ -44,15 +44,13 @@ public class ContractRepairByCompanyTask extends AbstContractRepairTasker {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
VendorCtx vendorCtx = new VendorCtx();
|
VendorCtx vendorCtx = new VendorCtx(this);
|
||||||
vendorCtx.from(contractCtx);
|
|
||||||
if (vendorCtx.syncVendor(company, holder)) {
|
if (vendorCtx.syncVendor(company, holder)) {
|
||||||
cloudYu.setVendorUpdateDate(LocalDate.now());
|
cloudYu.setVendorUpdateDate(LocalDate.now());
|
||||||
repaired = true;
|
repaired = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
CustomerCtx customerCtx = new CustomerCtx();
|
CustomerCtx customerCtx = new CustomerCtx(this);
|
||||||
customerCtx.from(contractCtx);
|
|
||||||
if (customerCtx.syncCustomer(company, holder)) {
|
if (customerCtx.syncCustomer(company, holder)) {
|
||||||
cloudYu.setCustomerUpdateDate(LocalDate.now());
|
cloudYu.setCustomerUpdateDate(LocalDate.now());
|
||||||
repaired = true;
|
repaired = true;
|
||||||
|
|||||||
@@ -2,19 +2,26 @@ package com.ecep.contract.ds.project;
|
|||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
import com.ecep.contract.vo.ProjectVo;
|
|
||||||
import org.hibernate.Hibernate;
|
import org.hibernate.Hibernate;
|
||||||
|
|
||||||
import com.ecep.contract.MessageHolder;
|
import com.ecep.contract.MessageHolder;
|
||||||
import com.ecep.contract.cloud.AbstractCtx;
|
import com.ecep.contract.cloud.AbstractCtx;
|
||||||
import com.ecep.contract.ds.project.service.ProjectService;
|
|
||||||
import com.ecep.contract.ds.company.model.Company;
|
import com.ecep.contract.ds.company.model.Company;
|
||||||
import com.ecep.contract.ds.project.model.Project;
|
import com.ecep.contract.ds.project.model.Project;
|
||||||
|
import com.ecep.contract.ds.project.service.ProjectService;
|
||||||
import lombok.Setter;
|
import com.ecep.contract.util.BeanContext;
|
||||||
|
import com.ecep.contract.vo.ProjectVo;
|
||||||
|
|
||||||
public class ProjectCtx extends AbstractCtx {
|
public class ProjectCtx extends AbstractCtx {
|
||||||
|
|
||||||
|
public ProjectCtx() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public ProjectCtx(BeanContext ctx) {
|
||||||
|
super(ctx);
|
||||||
|
}
|
||||||
|
|
||||||
public ProjectService getProjectService() {
|
public ProjectService getProjectService() {
|
||||||
return getCachedBean(ProjectService.class);
|
return getCachedBean(ProjectService.class);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user