采购合同流程 供应商比选材料

master
Harry Yang 2022-12-27 18:09:36 +08:00
parent f08212289e
commit b313635e96
5 changed files with 30 additions and 14 deletions

View File

@ -258,6 +258,9 @@ public class ProcessController {
public Object contract;
public ProjectProcess process;
public List<SupplierMaterial> supplierMaterials;
}
@ResponseBody
@ -301,13 +304,15 @@ public class ProcessController {
Project project = projectRepository.findById(process.getProjectId());
BigDecimal repaidAmount = getRepaidAmount(id);
Object contract;
List<SupplierMaterial> supplierMaterials = null;
switch (process.getProcessType()) {
case sale_contract: {
contract = processService.findSaleContract(process.getId());
contract = processService.findSaleContract(id);
break;
}
case procurement_contract: {
contract = processService.findProcurementContract(process.getId());
contract = processService.findProcurementContract(id);
supplierMaterials = processService.getSupplierMaterials(id);
break;
}
default:
@ -326,8 +331,9 @@ public class ProcessController {
.repaidAmount(repaidAmount + "元")
.budgetGrossMargin(project.getGrossProfitMargin())
.projectNo(project.getProjectNo())
.applyPersonName(process.getApplyPersonName())
.supplierMaterials(supplierMaterials)
.contractAmount(project.getContractAmount())
.applyPersonName(process.getApplyPersonName())
.terminalCustomer(project.getTerminalCustomer())
.projectType(Enumerable.of(ProjectType.class, project.getType()).getDescription())
.cooperationType(Enumerable.of(CooperationType.class, project.getCooperateType()).getDescription())
@ -407,7 +413,7 @@ public class ProcessController {
}
case procurement_contract: {
ProcurementContract contract = processService.findProcurementContract(form.getId());
contract.setMode(form.getProcurementMode());
contract.setProcurementMode(form.getProcurementMode());
contract.setPaymentTerms(form.getPaymentTerms());
contract.setSupplierName(form.getSupplierName());
entityManager.merge(contract);

View File

@ -30,7 +30,7 @@ public class ProcurementContract implements Serializable {
@GenericGenerator(name = "persistenceGenerator", strategy = "increment")
private Integer id;
private ProcurementMode mode;
private ProcurementMode procurementMode;
private String supplierName;
@ -41,7 +41,7 @@ public class ProcurementContract implements Serializable {
public static ProcurementContract from(ProcessCreationForm form) {
ProcurementContract contract = new ProcurementContract();
contract.setMode(form.getProcurementMode());
contract.setProcurementMode(form.getProcurementMode());
contract.setPaymentTerms(form.getPaymentTerms());
contract.setSupplierName(form.getSupplierName());
return contract;

View File

@ -41,6 +41,8 @@ public class SupplierMaterial {
private String attachment;
private Integer processId;
@Override
public boolean equals(Object o) {
if (this == o)

View File

@ -31,6 +31,7 @@ import cn.palmte.work.model.enums.ProcessStatus;
import cn.palmte.work.model.process.ProcurementContract;
import cn.palmte.work.model.process.ProjectProcess;
import cn.palmte.work.model.process.SaleContract;
import cn.palmte.work.model.process.SupplierMaterial;
import cn.palmte.work.model.process.form.SaleContractDetailForm;
import lombok.Data;
import lombok.RequiredArgsConstructor;
@ -182,6 +183,13 @@ public class ProjectProcessService {
return query.getSingleResult();
}
public List<SupplierMaterial> getSupplierMaterials(int processId) {
TypedQuery<SupplierMaterial> query = entityManager.createQuery(
"from SupplierMaterial where processId=:processId", SupplierMaterial.class);
query.setParameter("processId", processId);
return query.getResultList();
}
public ProjectProcess getById(int id) {
return entityManager.find(ProjectProcess.class, id);
}

View File

@ -37,11 +37,11 @@ alter table project_process
# 采购合同
create table procurement_contract
(
id int auto_increment primary key comment 'ID',
`mode` varchar(255) null comment '采购模式',
payment_terms text null comment '付款条件',
process_id int null comment '流程ID',
supplier_name varchar(255) null comment '供应商名称'
id int auto_increment primary key comment 'ID',
procurement_mode varchar(255) null comment '采购模式',
payment_terms text null comment '付款条件',
process_id int null comment '流程ID',
supplier_name varchar(255) null comment '供应商名称'
);
# 销售合同
@ -60,8 +60,8 @@ create table procurement_contract_supplier_material
total_amount varchar(255) null comment '合计金额',
service_terms varchar(255) null comment '服务条款',
payment_terms varchar(255) null comment '付款条件',
taxRate varchar(255) null comment '税率',
tax_rate varchar(255) null comment '税率',
remark varchar(255) null comment '备注',
attachment varchar(1000) null comment '附件'
attachment varchar(1000) null comment '附件',
process_id int null comment '流程ID'
);