常量化,尽可能避免出错
parent
589187d846
commit
8e7c85d75e
|
@ -0,0 +1,8 @@
|
|||
package cn.palmte.work.bean;
|
||||
|
||||
/**
|
||||
* @see EstimateBean 貌似完全一样
|
||||
* @author xiongshiyan at 2021/11/1 , contact me with email yanshixiong@126.com or phone 15208384257
|
||||
*/
|
||||
public class BudgetBean extends EstimateBean{
|
||||
}
|
|
@ -5,6 +5,7 @@ import cn.palmte.work.bean.EstimateBean;
|
|||
import cn.palmte.work.model.Dept;
|
||||
import cn.palmte.work.model.DeptRepository;
|
||||
import cn.palmte.work.model.Project;
|
||||
import cn.palmte.work.service.ProjectEstimateService;
|
||||
import cn.palmte.work.service.ProjectService;
|
||||
import cn.palmte.work.utils.InterfaceUtil;
|
||||
import cn.palmte.work.utils.Utils;
|
||||
|
@ -33,10 +34,12 @@ import java.util.concurrent.ConcurrentHashMap;
|
|||
public class ProjectController extends BaseController{
|
||||
private static final Logger logger = LoggerFactory.getLogger(ProjectController.class);
|
||||
|
||||
@Autowired
|
||||
private DeptRepository deptRepository;
|
||||
@Autowired
|
||||
private ProjectService projectService;
|
||||
@Autowired
|
||||
private DeptRepository deptRepository;
|
||||
private ProjectEstimateService projectEstimateService;
|
||||
|
||||
/**
|
||||
* 项目列表
|
||||
|
@ -98,30 +101,45 @@ public class ProjectController extends BaseController{
|
|||
public String estimateAddSaveAndApprove(Project project, EstimateBean estimateBean,
|
||||
Map<String, Object> model) {
|
||||
projectService.estimateAddSave(project, estimateBean, InterfaceUtil.getAdmin(), ApproveStatusEnum.APPROVAL_PENDING);
|
||||
//TODO 发起审核
|
||||
return "redirect:/project/list";
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping("/edit")
|
||||
public String edit(@RequestParam("id") int id,Map<String, Object> model) {
|
||||
Project project = projectService.getProject(id);
|
||||
model.put("project", project);
|
||||
EstimateBean estimateBean = projectService.estimate(project);
|
||||
EstimateBean estimateBean = projectEstimateService.getEstimate(project);
|
||||
model.put("estimateBean", estimateBean);
|
||||
return "admin/project_estimate_edit";
|
||||
}
|
||||
|
||||
@RequestMapping("/estimateEditSave")
|
||||
public String estimateEditSave(Project project, EstimateBean estimateBean,
|
||||
Map<String, Object> model) {
|
||||
projectService.estimateEditSave(project, estimateBean, InterfaceUtil.getAdmin(), ApproveStatusEnum.APPROVAL_UNCOMMIT);
|
||||
return "redirect:/project/list";
|
||||
}
|
||||
|
||||
@RequestMapping("/estimateEditSaveAndApprove")
|
||||
public String estimateEditSaveAndApprove(Project project, EstimateBean estimateBean,
|
||||
Map<String, Object> model) {
|
||||
projectService.estimateEditSave(project, estimateBean, InterfaceUtil.getAdmin(), ApproveStatusEnum.APPROVAL_PENDING);
|
||||
//TODO 发起审核
|
||||
return "redirect:/project/list";
|
||||
}
|
||||
|
||||
/**
|
||||
* 进项目预算页面
|
||||
*/
|
||||
@RequestMapping("/budgetEdit")
|
||||
public String budget(@RequestParam("id") int id,Map<String, Object> model) {
|
||||
Project project = projectService.getProject(id);
|
||||
model.put("project", project);
|
||||
EstimateBean estimateBean = projectEstimateService.getEstimate(project);
|
||||
model.put("budgetBean", estimateBean);
|
||||
return "admin/project_budget_edit";
|
||||
}
|
||||
|
||||
@InitBinder
|
||||
public void initBinder(WebDataBinder webDataBinder){
|
||||
|
|
|
@ -11,6 +11,16 @@ import java.math.BigDecimal;
|
|||
@Entity
|
||||
@Table(name = "project_estimate_cost")
|
||||
public class ProjectEstimateCost {
|
||||
public static final int FEE_PURCHASE = 1;
|
||||
public static final int FEE_PROJECT_MANAGE = 2;
|
||||
public static final int FEE_OTHER = 3;
|
||||
|
||||
public static final int TYPE_DEVICE = 1;
|
||||
public static final int TYPE_BUILDING = 2;
|
||||
public static final int TYPE_SERVICE = 3;
|
||||
public static final int TYPE_OTHER = 4;
|
||||
public static final int TYPE_PROJECT_MANAGE = 5;
|
||||
public static final int TYPE_OTHER_OTHER = 6;
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
|
|
|
@ -11,6 +11,8 @@ import java.math.BigDecimal;
|
|||
@Entity
|
||||
@Table(name = "project_estimate_cost_manage")
|
||||
public class ProjectEstimateCostManage {
|
||||
public static final int TYPE_EXPROPRIATION = 1;
|
||||
public static final int TYPE_COMPANY_MANAGE = 2;
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
|
|
|
@ -11,6 +11,10 @@ import java.math.BigDecimal;
|
|||
@Entity
|
||||
@Table(name = "project_estimate_income")
|
||||
public class ProjectEstimateIncome {
|
||||
public static final int TYPE_DEVICE = 1;
|
||||
public static final int TYPE_ENGINEER = 2;
|
||||
public static final int TYPE_SERVICE = 3;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
|
|
|
@ -0,0 +1,191 @@
|
|||
package cn.palmte.work.service;
|
||||
|
||||
import cn.palmte.work.bean.EstimateBean;
|
||||
import cn.palmte.work.model.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import top.jfunc.common.utils.CollectionUtil;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 项目概算service
|
||||
* @author xiongshiyan at 2021/10/29 , contact me with email yanshixiong@126.com or phone 15208384257
|
||||
*/
|
||||
@Service
|
||||
public class ProjectEstimateService {
|
||||
@Autowired
|
||||
private ProjectEstimateIncomeRepository projectEstimateIncomeRepository;
|
||||
@Autowired
|
||||
private ProjectEstimateCostRepository projectEstimateCostRepository;
|
||||
@Autowired
|
||||
private ProjectEstimateCostManageRepository projectEstimateCostManageRepository;
|
||||
|
||||
|
||||
public void clearEstimate(Project project){
|
||||
List<ProjectEstimateIncome> incomes = projectEstimateIncomeRepository.findAllByProjectIdEquals(project.getId());
|
||||
if(CollectionUtil.isNotEmpty(incomes)){
|
||||
projectEstimateIncomeRepository.deleteInBatch(incomes);
|
||||
}
|
||||
|
||||
List<ProjectEstimateCost> costs = projectEstimateCostRepository.findAllByProjectIdEquals(project.getId());
|
||||
if(CollectionUtil.isNotEmpty(costs)){
|
||||
projectEstimateCostRepository.deleteInBatch(costs);
|
||||
}
|
||||
|
||||
List<ProjectEstimateCostManage> costManages = projectEstimateCostManageRepository.findAllByProjectIdEquals(project.getId());
|
||||
if(CollectionUtil.isNotEmpty(costManages)){
|
||||
projectEstimateCostManageRepository.deleteInBatch(costManages);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void saveEstimate(Project project, EstimateBean estimateBean){
|
||||
//收入记录
|
||||
income(project, estimateBean);
|
||||
//成本记录
|
||||
cost(project, estimateBean);
|
||||
//管理记录
|
||||
costManage(project, estimateBean);
|
||||
}
|
||||
|
||||
private void cost(Project project, EstimateBean estimateBean) {
|
||||
ProjectEstimateCost projectEstimateCostDevice = new ProjectEstimateCost();
|
||||
projectEstimateCostDevice.setProjectId(project.getId());
|
||||
projectEstimateCostDevice.setFee(ProjectEstimateCost.FEE_PURCHASE);
|
||||
projectEstimateCostDevice.setType(ProjectEstimateCost.TYPE_DEVICE);
|
||||
projectEstimateCostDevice.setCostTaxInclude(estimateBean.getCostPurchaseDeviceTaxInclude());
|
||||
projectEstimateCostDevice.setCostTaxExclude(estimateBean.getCostPurchaseDeviceTaxExclude());
|
||||
projectEstimateCostRepository.saveAndFlush(projectEstimateCostDevice);
|
||||
|
||||
|
||||
ProjectEstimateCost projectEstimateCostBuild = new ProjectEstimateCost();
|
||||
projectEstimateCostBuild.setProjectId(project.getId());
|
||||
projectEstimateCostBuild.setFee(ProjectEstimateCost.FEE_PURCHASE);
|
||||
projectEstimateCostBuild.setType(ProjectEstimateCost.TYPE_BUILDING);
|
||||
projectEstimateCostBuild.setCostTaxInclude(estimateBean.getCostPurchaseBuildTaxInclude());
|
||||
projectEstimateCostBuild.setCostTaxExclude(estimateBean.getCostPurchaseBuildTaxExclude());
|
||||
projectEstimateCostRepository.saveAndFlush(projectEstimateCostBuild);
|
||||
|
||||
ProjectEstimateCost projectEstimateCostService = new ProjectEstimateCost();
|
||||
projectEstimateCostService.setProjectId(project.getId());
|
||||
projectEstimateCostService.setFee(ProjectEstimateCost.FEE_PURCHASE);
|
||||
projectEstimateCostService.setType(ProjectEstimateCost.TYPE_SERVICE);
|
||||
projectEstimateCostService.setCostTaxInclude(estimateBean.getCostPurchaseServiceTaxInclude());
|
||||
projectEstimateCostService.setCostTaxExclude(estimateBean.getCostPurchaseServiceTaxExclude());
|
||||
projectEstimateCostRepository.saveAndFlush(projectEstimateCostService);
|
||||
|
||||
ProjectEstimateCost projectEstimateCostOther = new ProjectEstimateCost();
|
||||
projectEstimateCostOther.setProjectId(project.getId());
|
||||
projectEstimateCostOther.setFee(ProjectEstimateCost.FEE_PURCHASE);
|
||||
projectEstimateCostOther.setType(ProjectEstimateCost.TYPE_OTHER);
|
||||
projectEstimateCostOther.setCostTaxInclude(estimateBean.getCostPurchaseOtherTaxInclude());
|
||||
projectEstimateCostOther.setCostTaxExclude(estimateBean.getCostPurchaseOtherTaxExclude());
|
||||
projectEstimateCostRepository.saveAndFlush(projectEstimateCostOther);
|
||||
|
||||
ProjectEstimateCost projectEstimateCostProject = new ProjectEstimateCost();
|
||||
projectEstimateCostProject.setProjectId(project.getId());
|
||||
projectEstimateCostProject.setFee(ProjectEstimateCost.FEE_PROJECT_MANAGE);
|
||||
projectEstimateCostProject.setType(ProjectEstimateCost.TYPE_PROJECT_MANAGE);
|
||||
projectEstimateCostProject.setCostTaxInclude(estimateBean.getCostProjectManageTaxInclude());
|
||||
projectEstimateCostProject.setCostTaxExclude(estimateBean.getCostProjectManageTaxExclude());
|
||||
projectEstimateCostRepository.saveAndFlush(projectEstimateCostProject);
|
||||
|
||||
ProjectEstimateCost projectEstimateCostOtherOther = new ProjectEstimateCost();
|
||||
projectEstimateCostOtherOther.setProjectId(project.getId());
|
||||
projectEstimateCostOtherOther.setFee(ProjectEstimateCost.FEE_OTHER);
|
||||
projectEstimateCostOtherOther.setType(ProjectEstimateCost.TYPE_OTHER_OTHER);
|
||||
projectEstimateCostOtherOther.setCostTaxInclude(estimateBean.getCostOtherOtherTaxInclude());
|
||||
projectEstimateCostOtherOther.setCostTaxExclude(estimateBean.getCostOtherOtherTaxExclude());
|
||||
projectEstimateCostRepository.saveAndFlush(projectEstimateCostOtherOther);
|
||||
|
||||
}
|
||||
private void costManage(Project project, EstimateBean estimateBean) {
|
||||
ProjectEstimateCostManage projectEstimateCostZijin = new ProjectEstimateCostManage();
|
||||
projectEstimateCostZijin.setProjectId(project.getId());
|
||||
projectEstimateCostZijin.setType(ProjectEstimateCostManage.TYPE_EXPROPRIATION);
|
||||
projectEstimateCostZijin.setCostTaxExclude(estimateBean.getCostExpropriationTaxExclude());
|
||||
projectEstimateCostManageRepository.saveAndFlush(projectEstimateCostZijin);
|
||||
|
||||
ProjectEstimateCostManage projectEstimateCostManage = new ProjectEstimateCostManage();
|
||||
projectEstimateCostManage.setProjectId(project.getId());
|
||||
projectEstimateCostManage.setType(ProjectEstimateCostManage.TYPE_COMPANY_MANAGE);
|
||||
projectEstimateCostManage.setCostTaxExclude(estimateBean.getCostCompanyManageTaxExclude());
|
||||
projectEstimateCostManageRepository.saveAndFlush(projectEstimateCostManage);
|
||||
}
|
||||
private void income(Project project, EstimateBean estimateBean) {
|
||||
ProjectEstimateIncome projectEstimateIncomeDevice = new ProjectEstimateIncome();
|
||||
projectEstimateIncomeDevice.setProjectId(project.getId());
|
||||
projectEstimateIncomeDevice.setType(ProjectEstimateIncome.TYPE_DEVICE);
|
||||
projectEstimateIncomeDevice.setIncomeTaxInclude(estimateBean.getIncomeDeviceTaxInclude());
|
||||
projectEstimateIncomeDevice.setIncomeTaxExclude(estimateBean.getIncomeDeviceTaxExclude());
|
||||
projectEstimateIncomeRepository.saveAndFlush(projectEstimateIncomeDevice);
|
||||
|
||||
ProjectEstimateIncome projectEstimateIncomeEngineer = new ProjectEstimateIncome();
|
||||
projectEstimateIncomeEngineer.setProjectId(project.getId());
|
||||
projectEstimateIncomeEngineer.setType(ProjectEstimateIncome.TYPE_ENGINEER);
|
||||
projectEstimateIncomeEngineer.setIncomeTaxInclude(estimateBean.getIncomeEngineerTaxInclude());
|
||||
projectEstimateIncomeEngineer.setIncomeTaxExclude(estimateBean.getIncomeEngineerTaxExclude());
|
||||
projectEstimateIncomeRepository.saveAndFlush(projectEstimateIncomeEngineer);
|
||||
|
||||
ProjectEstimateIncome projectEstimateIncomeService = new ProjectEstimateIncome();
|
||||
projectEstimateIncomeService.setProjectId(project.getId());
|
||||
projectEstimateIncomeService.setType(ProjectEstimateIncome.TYPE_SERVICE);
|
||||
projectEstimateIncomeService.setIncomeTaxInclude(estimateBean.getIncomeServiceTaxInclude());
|
||||
projectEstimateIncomeService.setIncomeTaxExclude(estimateBean.getIncomeServiceTaxExclude());
|
||||
projectEstimateIncomeRepository.saveAndFlush(projectEstimateIncomeService);
|
||||
}
|
||||
|
||||
|
||||
public EstimateBean getEstimate(Project project) {
|
||||
EstimateBean estimateBean = new EstimateBean();
|
||||
List<ProjectEstimateIncome> incomes = projectEstimateIncomeRepository.findAllByProjectIdEquals(project.getId());
|
||||
|
||||
ProjectEstimateIncome projectEstimateIncomeDevice = incomes.stream().filter(d -> d.getType() == ProjectEstimateIncome.TYPE_DEVICE).collect(Collectors.toList()).get(0);
|
||||
estimateBean.setIncomeDeviceTaxInclude(projectEstimateIncomeDevice.getIncomeTaxInclude());
|
||||
estimateBean.setIncomeDeviceTaxExclude(projectEstimateIncomeDevice.getIncomeTaxExclude());
|
||||
|
||||
ProjectEstimateIncome projectEstimateIncomeEngineer = incomes.stream().filter(d -> d.getType() == ProjectEstimateIncome.TYPE_ENGINEER).collect(Collectors.toList()).get(0);
|
||||
estimateBean.setIncomeEngineerTaxInclude(projectEstimateIncomeEngineer.getIncomeTaxInclude());
|
||||
estimateBean.setIncomeEngineerTaxExclude(projectEstimateIncomeEngineer.getIncomeTaxExclude());
|
||||
|
||||
ProjectEstimateIncome projectEstimateIncomeService = incomes.stream().filter(d -> d.getType() == ProjectEstimateIncome.TYPE_SERVICE).collect(Collectors.toList()).get(0);
|
||||
estimateBean.setIncomeServiceTaxInclude(projectEstimateIncomeService.getIncomeTaxInclude());
|
||||
estimateBean.setIncomeServiceTaxExclude(projectEstimateIncomeService.getIncomeTaxExclude());
|
||||
|
||||
List<ProjectEstimateCost> costs = projectEstimateCostRepository.findAllByProjectIdEquals(project.getId());
|
||||
|
||||
ProjectEstimateCost projectEstimateCostDevice = costs.stream().filter(d -> d.getType() == ProjectEstimateCost.TYPE_DEVICE).collect(Collectors.toList()).get(0);
|
||||
estimateBean.setCostPurchaseDeviceTaxInclude(projectEstimateCostDevice.getCostTaxInclude());
|
||||
estimateBean.setCostPurchaseDeviceTaxExclude(projectEstimateCostDevice.getCostTaxExclude());
|
||||
|
||||
ProjectEstimateCost projectEstimateCostBuild = costs.stream().filter(d -> d.getType() == ProjectEstimateCost.TYPE_BUILDING).collect(Collectors.toList()).get(0);
|
||||
estimateBean.setCostPurchaseBuildTaxInclude(projectEstimateCostBuild.getCostTaxInclude());
|
||||
estimateBean.setCostPurchaseBuildTaxExclude(projectEstimateCostBuild.getCostTaxExclude());
|
||||
|
||||
ProjectEstimateCost projectEstimateCostService = costs.stream().filter(d -> d.getType() == ProjectEstimateCost.TYPE_SERVICE).collect(Collectors.toList()).get(0);
|
||||
estimateBean.setCostPurchaseServiceTaxInclude(projectEstimateCostService.getCostTaxInclude());
|
||||
estimateBean.setCostPurchaseServiceTaxExclude(projectEstimateCostService.getCostTaxExclude());
|
||||
|
||||
ProjectEstimateCost projectEstimateCostOther = costs.stream().filter(d -> d.getType() == ProjectEstimateCost.TYPE_OTHER).collect(Collectors.toList()).get(0);
|
||||
estimateBean.setCostPurchaseOtherTaxInclude(projectEstimateCostOther.getCostTaxInclude());
|
||||
estimateBean.setCostPurchaseOtherTaxExclude(projectEstimateCostOther.getCostTaxExclude());
|
||||
|
||||
ProjectEstimateCost projectEstimateCostProjectManage = costs.stream().filter(d -> d.getType() == ProjectEstimateCost.TYPE_PROJECT_MANAGE).collect(Collectors.toList()).get(0);
|
||||
estimateBean.setCostProjectManageTaxInclude(projectEstimateCostProjectManage.getCostTaxInclude());
|
||||
estimateBean.setCostProjectManageTaxExclude(projectEstimateCostProjectManage.getCostTaxExclude());
|
||||
|
||||
ProjectEstimateCost projectEstimateCostOtherOther = costs.stream().filter(d -> d.getType() == ProjectEstimateCost.TYPE_OTHER_OTHER).collect(Collectors.toList()).get(0);
|
||||
estimateBean.setCostOtherOtherTaxInclude(projectEstimateCostOtherOther.getCostTaxInclude());
|
||||
estimateBean.setCostOtherOtherTaxExclude(projectEstimateCostOtherOther.getCostTaxExclude());
|
||||
|
||||
List<ProjectEstimateCostManage> manages = projectEstimateCostManageRepository.findAllByProjectIdEquals(project.getId());
|
||||
ProjectEstimateCostManage costManageExpropriation = manages.stream().filter(d -> d.getType() == ProjectEstimateCostManage.TYPE_EXPROPRIATION).collect(Collectors.toList()).get(0);
|
||||
estimateBean.setCostExpropriationTaxExclude(costManageExpropriation.getCostTaxExclude());
|
||||
ProjectEstimateCostManage costManageCompany = manages.stream().filter(d -> d.getType() == ProjectEstimateCostManage.TYPE_COMPANY_MANAGE).collect(Collectors.toList()).get(0);
|
||||
estimateBean.setCostCompanyManageTaxExclude(costManageCompany.getCostTaxExclude());
|
||||
|
||||
return estimateBean;
|
||||
}
|
||||
}
|
|
@ -4,20 +4,19 @@ import cn.palmte.work.bean.ApproveStatusEnum;
|
|||
import cn.palmte.work.bean.EstimateBean;
|
||||
import cn.palmte.work.bean.StatusEnum;
|
||||
import cn.palmte.work.bean.TypeEnum;
|
||||
import cn.palmte.work.model.*;
|
||||
import cn.palmte.work.model.Admin;
|
||||
import cn.palmte.work.model.Project;
|
||||
import cn.palmte.work.model.ProjectRepository;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import top.jfunc.common.db.QueryHelper;
|
||||
import top.jfunc.common.db.bean.Page;
|
||||
import top.jfunc.common.db.utils.Pagination;
|
||||
import top.jfunc.common.utils.CollectionUtil;
|
||||
import top.jfunc.common.utils.StrUtil;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author xiongshiyan at 2021/10/29 , contact me with email yanshixiong@126.com or phone 15208384257
|
||||
|
@ -29,11 +28,7 @@ public class ProjectService {
|
|||
@Autowired
|
||||
private ProjectRepository projectRepository;
|
||||
@Autowired
|
||||
private ProjectEstimateIncomeRepository projectEstimateIncomeRepository;
|
||||
@Autowired
|
||||
private ProjectEstimateCostRepository projectEstimateCostRepository;
|
||||
@Autowired
|
||||
private ProjectEstimateCostManageRepository projectEstimateCostManageRepository;
|
||||
private ProjectEstimateService projectEstimateService;
|
||||
|
||||
|
||||
private QueryHelper getQueryHelper(Map<String, String> searchInfo, int pageNumber, int pageSize) {
|
||||
|
@ -86,12 +81,34 @@ public class ProjectService {
|
|||
QueryHelper queryHelper = getQueryHelper(searchInfo, pageNumber, pageSize);
|
||||
return pagination.paginate(queryHelper.getSql(), Project.class,pageNumber,pageSize);
|
||||
}
|
||||
public Project getProject(int id){
|
||||
return projectRepository.findOne(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增概算保存项目
|
||||
*/
|
||||
@Transactional(rollbackFor = RuntimeException.class)
|
||||
public Project estimateAddSave(Project project, EstimateBean estimateBean, Admin admin, ApproveStatusEnum approveStatusEnum) {
|
||||
Project p = addProject(project, admin, approveStatusEnum);
|
||||
projectEstimateService.saveEstimate(p, estimateBean);
|
||||
|
||||
return project;
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑概算保存项目
|
||||
*/
|
||||
@Transactional(rollbackFor = RuntimeException.class)
|
||||
public Project estimateEditSave(Project project, EstimateBean estimateBean, Admin admin, ApproveStatusEnum approveStatusEnum) {
|
||||
Project p = editProject(project, admin, approveStatusEnum);
|
||||
//清空重新保存概算信息
|
||||
projectEstimateService.clearEstimate(project);
|
||||
projectEstimateService.saveEstimate(p, estimateBean);
|
||||
return p;
|
||||
}
|
||||
|
||||
private Project addProject(Project project, Admin admin, ApproveStatusEnum approveStatusEnum) {
|
||||
project.setTypeDesc(TypeEnum.parseType(project.getType()).getTypeDesc());
|
||||
project.setStatus(StatusEnum.CREATED.getStatus());
|
||||
project.setStatusDesc(StatusEnum.CREATED.getStatusDesc());
|
||||
|
@ -109,187 +126,24 @@ public class ProjectService {
|
|||
project.setCreateTime(new Date());
|
||||
|
||||
project = projectRepository.saveAndFlush(project);
|
||||
|
||||
|
||||
//收入记录
|
||||
income(project, estimateBean);
|
||||
//成本记录
|
||||
cost(project, estimateBean);
|
||||
//管理记录
|
||||
costManage(project, estimateBean);
|
||||
|
||||
return project;
|
||||
}
|
||||
|
||||
private void clearEstimate(Project project){
|
||||
List<ProjectEstimateIncome> incomes = projectEstimateIncomeRepository.findAllByProjectIdEquals(project.getId());
|
||||
if(CollectionUtil.isNotEmpty(incomes)){
|
||||
projectEstimateIncomeRepository.deleteInBatch(incomes);
|
||||
}
|
||||
private Project editProject(Project project, Admin admin, ApproveStatusEnum approveStatusEnum) {
|
||||
Project p = getProject(project.getId());
|
||||
|
||||
List<ProjectEstimateCost> costs = projectEstimateCostRepository.findAllByProjectIdEquals(project.getId());
|
||||
if(CollectionUtil.isNotEmpty(costs)){
|
||||
projectEstimateCostRepository.deleteInBatch(costs);
|
||||
}
|
||||
//只有如下可以修改
|
||||
p.setStartDate(project.getStartDate());
|
||||
p.setEndDate(project.getEndDate());
|
||||
p.setAdvanceInterestAmount(project.getAdvanceInterestAmount());
|
||||
p.setAdvancePeakAmount(project.getAdvancePeakAmount());
|
||||
p.setContractAmount(project.getContractAmount());
|
||||
p.setHuazhiProductAmount(project.getHuazhiProductAmount());
|
||||
p.setZiguangOtherAmount(project.getZiguangOtherAmount());
|
||||
p.setMainContractCollectionTerms(project.getMainContractCollectionTerms());
|
||||
|
||||
List<ProjectEstimateCostManage> costManages = projectEstimateCostManageRepository.findAllByProjectIdEquals(project.getId());
|
||||
if(CollectionUtil.isNotEmpty(costManages)){
|
||||
projectEstimateCostManageRepository.deleteInBatch(costManages);
|
||||
}
|
||||
p.setApproveStatusEstimate(approveStatusEnum.getApproveStatus());
|
||||
|
||||
}
|
||||
/**
|
||||
* 编辑概算保存项目
|
||||
*/
|
||||
@Transactional(rollbackFor = RuntimeException.class)
|
||||
public Project estimateEditSave(Project project, EstimateBean estimateBean, Admin admin, ApproveStatusEnum approveStatusEnum) {
|
||||
//删除原来的
|
||||
projectRepository.delete(project.getId());
|
||||
//清空概算信息
|
||||
clearEstimate(project);
|
||||
|
||||
return estimateAddSave(project, estimateBean, admin, approveStatusEnum);
|
||||
}
|
||||
|
||||
private void cost(Project project, EstimateBean estimateBean) {
|
||||
ProjectEstimateCost projectEstimateCostDevice = new ProjectEstimateCost();
|
||||
projectEstimateCostDevice.setProjectId(project.getId());
|
||||
projectEstimateCostDevice.setFee(1);
|
||||
projectEstimateCostDevice.setType(1);
|
||||
projectEstimateCostDevice.setCostTaxInclude(estimateBean.getCostPurchaseDeviceTaxInclude());
|
||||
projectEstimateCostDevice.setCostTaxExclude(estimateBean.getCostPurchaseDeviceTaxExclude());
|
||||
projectEstimateCostRepository.saveAndFlush(projectEstimateCostDevice);
|
||||
|
||||
|
||||
ProjectEstimateCost projectEstimateCostBuild = new ProjectEstimateCost();
|
||||
projectEstimateCostBuild.setProjectId(project.getId());
|
||||
projectEstimateCostBuild.setFee(1);
|
||||
projectEstimateCostBuild.setType(2);
|
||||
projectEstimateCostBuild.setCostTaxInclude(estimateBean.getCostPurchaseBuildTaxInclude());
|
||||
projectEstimateCostBuild.setCostTaxExclude(estimateBean.getCostPurchaseBuildTaxExclude());
|
||||
projectEstimateCostRepository.saveAndFlush(projectEstimateCostBuild);
|
||||
|
||||
ProjectEstimateCost projectEstimateCostService = new ProjectEstimateCost();
|
||||
projectEstimateCostService.setProjectId(project.getId());
|
||||
projectEstimateCostService.setFee(1);
|
||||
projectEstimateCostService.setType(3);
|
||||
projectEstimateCostService.setCostTaxInclude(estimateBean.getCostPurchaseServiceTaxInclude());
|
||||
projectEstimateCostService.setCostTaxExclude(estimateBean.getCostPurchaseServiceTaxExclude());
|
||||
projectEstimateCostRepository.saveAndFlush(projectEstimateCostService);
|
||||
|
||||
ProjectEstimateCost projectEstimateCostOther = new ProjectEstimateCost();
|
||||
projectEstimateCostOther.setProjectId(project.getId());
|
||||
projectEstimateCostOther.setFee(1);
|
||||
projectEstimateCostOther.setType(4);
|
||||
projectEstimateCostOther.setCostTaxInclude(estimateBean.getCostPurchaseOtherTaxInclude());
|
||||
projectEstimateCostOther.setCostTaxExclude(estimateBean.getCostPurchaseOtherTaxExclude());
|
||||
projectEstimateCostRepository.saveAndFlush(projectEstimateCostOther);
|
||||
|
||||
ProjectEstimateCost projectEstimateCostProject = new ProjectEstimateCost();
|
||||
projectEstimateCostProject.setProjectId(project.getId());
|
||||
projectEstimateCostProject.setFee(2);
|
||||
projectEstimateCostProject.setType(5);
|
||||
projectEstimateCostProject.setCostTaxInclude(estimateBean.getCostProjectManageTaxInclude());
|
||||
projectEstimateCostProject.setCostTaxExclude(estimateBean.getCostProjectManageTaxExclude());
|
||||
projectEstimateCostRepository.saveAndFlush(projectEstimateCostProject);
|
||||
|
||||
ProjectEstimateCost projectEstimateCostOtherOther = new ProjectEstimateCost();
|
||||
projectEstimateCostOtherOther.setProjectId(project.getId());
|
||||
projectEstimateCostOtherOther.setFee(3);
|
||||
projectEstimateCostOtherOther.setType(6);
|
||||
projectEstimateCostOtherOther.setCostTaxInclude(estimateBean.getCostOtherOtherTaxInclude());
|
||||
projectEstimateCostOtherOther.setCostTaxExclude(estimateBean.getCostOtherOtherTaxExclude());
|
||||
projectEstimateCostRepository.saveAndFlush(projectEstimateCostOtherOther);
|
||||
|
||||
}
|
||||
private void costManage(Project project, EstimateBean estimateBean) {
|
||||
ProjectEstimateCostManage projectEstimateCostZijin = new ProjectEstimateCostManage();
|
||||
projectEstimateCostZijin.setProjectId(project.getId());
|
||||
projectEstimateCostZijin.setType(1);
|
||||
projectEstimateCostZijin.setCostTaxExclude(estimateBean.getCostExpropriationTaxExclude());
|
||||
projectEstimateCostManageRepository.saveAndFlush(projectEstimateCostZijin);
|
||||
|
||||
ProjectEstimateCostManage projectEstimateCostManage = new ProjectEstimateCostManage();
|
||||
projectEstimateCostManage.setProjectId(project.getId());
|
||||
projectEstimateCostManage.setType(2);
|
||||
projectEstimateCostManage.setCostTaxExclude(estimateBean.getCostCompanyManageTaxExclude());
|
||||
projectEstimateCostManageRepository.saveAndFlush(projectEstimateCostManage);
|
||||
}
|
||||
private void income(Project project, EstimateBean estimateBean) {
|
||||
ProjectEstimateIncome projectEstimateIncomeDevice = new ProjectEstimateIncome();
|
||||
projectEstimateIncomeDevice.setProjectId(project.getId());
|
||||
projectEstimateIncomeDevice.setType(1);
|
||||
projectEstimateIncomeDevice.setIncomeTaxInclude(estimateBean.getIncomeDeviceTaxInclude());
|
||||
projectEstimateIncomeDevice.setIncomeTaxExclude(estimateBean.getIncomeDeviceTaxExclude());
|
||||
projectEstimateIncomeRepository.saveAndFlush(projectEstimateIncomeDevice);
|
||||
|
||||
ProjectEstimateIncome projectEstimateIncomeEngineer = new ProjectEstimateIncome();
|
||||
projectEstimateIncomeEngineer.setProjectId(project.getId());
|
||||
projectEstimateIncomeEngineer.setType(2);
|
||||
projectEstimateIncomeEngineer.setIncomeTaxInclude(estimateBean.getIncomeEngineerTaxInclude());
|
||||
projectEstimateIncomeEngineer.setIncomeTaxExclude(estimateBean.getIncomeEngineerTaxExclude());
|
||||
projectEstimateIncomeRepository.saveAndFlush(projectEstimateIncomeEngineer);
|
||||
|
||||
ProjectEstimateIncome projectEstimateIncomeService = new ProjectEstimateIncome();
|
||||
projectEstimateIncomeService.setProjectId(project.getId());
|
||||
projectEstimateIncomeService.setType(3);
|
||||
projectEstimateIncomeService.setIncomeTaxInclude(estimateBean.getIncomeServiceTaxInclude());
|
||||
projectEstimateIncomeService.setIncomeTaxExclude(estimateBean.getIncomeServiceTaxExclude());
|
||||
projectEstimateIncomeRepository.saveAndFlush(projectEstimateIncomeService);
|
||||
}
|
||||
|
||||
public Project getProject(int id) {
|
||||
return projectRepository.findOne(id);
|
||||
}
|
||||
|
||||
public EstimateBean estimate(Project project) {
|
||||
EstimateBean estimateBean = new EstimateBean();
|
||||
List<ProjectEstimateIncome> incomes = projectEstimateIncomeRepository.findAllByProjectIdEquals(project.getId());
|
||||
|
||||
ProjectEstimateIncome projectEstimateIncomeDevice = incomes.stream().filter(d -> d.getType() == 1).collect(Collectors.toList()).get(0);
|
||||
estimateBean.setIncomeDeviceTaxInclude(projectEstimateIncomeDevice.getIncomeTaxInclude());
|
||||
estimateBean.setIncomeDeviceTaxExclude(projectEstimateIncomeDevice.getIncomeTaxExclude());
|
||||
|
||||
ProjectEstimateIncome projectEstimateIncomeEngineer = incomes.stream().filter(d -> d.getType() == 2).collect(Collectors.toList()).get(0);
|
||||
estimateBean.setIncomeEngineerTaxInclude(projectEstimateIncomeEngineer.getIncomeTaxInclude());
|
||||
estimateBean.setIncomeEngineerTaxExclude(projectEstimateIncomeEngineer.getIncomeTaxExclude());
|
||||
|
||||
ProjectEstimateIncome projectEstimateIncomeService = incomes.stream().filter(d -> d.getType() == 3).collect(Collectors.toList()).get(0);
|
||||
estimateBean.setIncomeServiceTaxInclude(projectEstimateIncomeService.getIncomeTaxInclude());
|
||||
estimateBean.setIncomeServiceTaxExclude(projectEstimateIncomeService.getIncomeTaxExclude());
|
||||
|
||||
List<ProjectEstimateCost> costs = projectEstimateCostRepository.findAllByProjectIdEquals(project.getId());
|
||||
|
||||
ProjectEstimateCost projectEstimateCostDevice = costs.stream().filter(d -> d.getType() == 1).collect(Collectors.toList()).get(0);
|
||||
estimateBean.setCostPurchaseDeviceTaxInclude(projectEstimateCostDevice.getCostTaxInclude());
|
||||
estimateBean.setCostPurchaseDeviceTaxExclude(projectEstimateCostDevice.getCostTaxExclude());
|
||||
|
||||
ProjectEstimateCost projectEstimateCostBuild = costs.stream().filter(d -> d.getType() == 2).collect(Collectors.toList()).get(0);
|
||||
estimateBean.setCostPurchaseBuildTaxInclude(projectEstimateCostBuild.getCostTaxInclude());
|
||||
estimateBean.setCostPurchaseBuildTaxExclude(projectEstimateCostBuild.getCostTaxExclude());
|
||||
|
||||
ProjectEstimateCost projectEstimateCostService = costs.stream().filter(d -> d.getType() == 3).collect(Collectors.toList()).get(0);
|
||||
estimateBean.setCostPurchaseServiceTaxInclude(projectEstimateCostService.getCostTaxInclude());
|
||||
estimateBean.setCostPurchaseServiceTaxExclude(projectEstimateCostService.getCostTaxExclude());
|
||||
|
||||
ProjectEstimateCost projectEstimateCostOther = costs.stream().filter(d -> d.getType() == 4).collect(Collectors.toList()).get(0);
|
||||
estimateBean.setCostPurchaseOtherTaxInclude(projectEstimateCostOther.getCostTaxInclude());
|
||||
estimateBean.setCostPurchaseOtherTaxExclude(projectEstimateCostOther.getCostTaxExclude());
|
||||
|
||||
ProjectEstimateCost projectEstimateCostProjectManage = costs.stream().filter(d -> d.getType() == 5).collect(Collectors.toList()).get(0);
|
||||
estimateBean.setCostProjectManageTaxInclude(projectEstimateCostProjectManage.getCostTaxInclude());
|
||||
estimateBean.setCostProjectManageTaxExclude(projectEstimateCostProjectManage.getCostTaxExclude());
|
||||
|
||||
ProjectEstimateCost projectEstimateCostOtherOther = costs.stream().filter(d -> d.getType() == 6).collect(Collectors.toList()).get(0);
|
||||
estimateBean.setCostOtherOtherTaxInclude(projectEstimateCostOtherOther.getCostTaxInclude());
|
||||
estimateBean.setCostOtherOtherTaxExclude(projectEstimateCostOtherOther.getCostTaxExclude());
|
||||
|
||||
List<ProjectEstimateCostManage> manages = projectEstimateCostManageRepository.findAllByProjectIdEquals(project.getId());
|
||||
ProjectEstimateCostManage costManageExpropriation = manages.stream().filter(d -> d.getType() == 1).collect(Collectors.toList()).get(0);
|
||||
estimateBean.setCostExpropriationTaxExclude(costManageExpropriation.getCostTaxExclude());
|
||||
ProjectEstimateCostManage costManageCompany = manages.stream().filter(d -> d.getType() == 2).collect(Collectors.toList()).get(0);
|
||||
estimateBean.setCostCompanyManageTaxExclude(costManageCompany.getCostTaxExclude());
|
||||
|
||||
return estimateBean;
|
||||
return projectRepository.saveAndFlush(p);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,431 @@
|
|||
<#assign base=request.contextPath />
|
||||
<#import "../common/defaultLayout.ftl" as defaultLayout>
|
||||
<@defaultLayout.layout>
|
||||
|
||||
<div class="admin-content">
|
||||
<div class="admin-content-body">
|
||||
<div class="am-cf am-padding">
|
||||
<div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">项目概算表</strong> / <small>${project.name}</small></div>
|
||||
</div>
|
||||
|
||||
<form method="post" class="am-form" id="pmsForm" action="${base}/project/budgetEditSave">
|
||||
<!--选项卡(tabs)begin-->
|
||||
<div class="am-tabs am-margin" data-am-tabs>
|
||||
<ul class="am-tabs-nav am-nav am-nav-tabs">
|
||||
<li class="am-active"><a href="#tab1">项目基本信息</a></li>
|
||||
<li><a href="#tab2">项目详细信息</a></li>
|
||||
</ul>
|
||||
<div class="am-tabs-bd">
|
||||
<div class="am-tab-panel am-fade am-in am-active" id="tab1">
|
||||
<input name="id" id="id" type="hidden" value="${project.id}" />
|
||||
<!--验证表单元素(validate) begin-->
|
||||
|
||||
<div class="am-g am-form-group am-margin-top">
|
||||
<div class="am-u-sm-4 am-u-md-2 am-text-right"><span style="color: red;">*</span>部门名称</div>
|
||||
<div class="am-u-sm-6 am-u-md-6">
|
||||
<span>${project.deptName}</span>
|
||||
</div>
|
||||
<div class="am-u-sm-2 am-u-md-4 input-msg"></div>
|
||||
</div>
|
||||
|
||||
<div class="am-g am-form-group am-margin-top">
|
||||
<div class="am-u-sm-4 am-u-md-2 am-text-right"><span style="color: red;">*</span>项目计划开始时间</div>
|
||||
<div class="am-u-sm-2 am-u-md-2">
|
||||
<div class="am-form-group am-form-icon">
|
||||
<i class="am-icon-calendar"></i>
|
||||
<input type="text" class="am-form-field am-input-sm" id="startDate"
|
||||
name="startDate" autocomplete="off"
|
||||
value="${project.startDate}" placeholder="项目计划开始时间"
|
||||
data-am-datepicker>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-u-sm-2 am-u-md-4 input-msg"></div>
|
||||
</div>
|
||||
<div class="am-g am-form-group am-margin-top">
|
||||
<div class="am-u-sm-4 am-u-md-2 am-text-right"><span style="color: red;">*</span>项目计划结束时间</div>
|
||||
<div class="am-u-sm-2 am-u-md-2">
|
||||
<div class="am-form-group am-form-icon">
|
||||
<i class="am-icon-calendar"></i>
|
||||
<input type="text" class="am-form-field am-input-sm" id="endDate"
|
||||
name="endDate" autocomplete="off"
|
||||
value="${project.endDate}" placeholder="项目计划结束时间"
|
||||
data-am-datepicker>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-u-sm-2 am-u-md-4 input-msg"></div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="am-g am-form-group am-margin-top">
|
||||
<div class="am-u-sm-4 am-u-md-2 am-text-right"><span style="color: red;">*</span>项目名称</div>
|
||||
<div class="am-u-sm-6 am-u-md-6">
|
||||
<input type="text" class="am-input" data-validate-async data-validation-message="请输入项目名称(20字符以内)"
|
||||
name="name" placeholder="请输入项目名称(20字符以内)" maxlength="20"
|
||||
value="${project.name}" required readonly/>
|
||||
</div>
|
||||
<div class="am-u-sm-2 am-u-md-4 input-msg"></div>
|
||||
</div>
|
||||
|
||||
<div class="am-g am-form-group am-margin-top">
|
||||
<div class="am-u-sm-4 am-u-md-2 am-text-right"><span style="color: red;">*</span>项目类型</div>
|
||||
<div class="am-u-sm-6 am-u-md-6">
|
||||
<select data-am-selected id="type" name="type" readonly="">
|
||||
<option value="1" <#if project.type=1>selected</#if>>工程集成类</option>
|
||||
<option value="2" <#if project.type=2>selected</#if>>设备集成类</option>
|
||||
<option value="3" <#if project.type=3>selected</#if>>战略合作类</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-u-sm-2 am-u-md-4 input-msg"></div>
|
||||
</div>
|
||||
<div class="am-g am-form-group am-margin-top">
|
||||
<div class="am-u-sm-4 am-u-md-2 am-text-right"><span style="color: red;">*</span>垫资模式</div>
|
||||
<div class="am-u-sm-6 am-u-md-6">
|
||||
<select data-am-selected id="underwrittenMode" name="underwrittenMode" readonly="">
|
||||
<option value="1" <#if project.underwrittenMode=1>selected</#if>>A类-不垫资(战略合作)</option>
|
||||
<option value="2" <#if project.underwrittenMode=2>selected</#if>>B类-不垫资(背靠背)</option>
|
||||
<option value="3" <#if project.underwrittenMode=3>selected</#if>>C类-垫资(账期覆盖)</option>
|
||||
<option value="4" <#if project.underwrittenMode=4>selected</#if>>D类-垫资(账期不覆盖)</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-u-sm-2 am-u-md-4 input-msg"></div>
|
||||
</div>
|
||||
|
||||
<div class="am-g am-form-group am-margin-top">
|
||||
<div class="am-u-sm-4 am-u-md-2 am-text-right"><span style="color: red;">*</span>客户名称</div>
|
||||
<div class="am-u-sm-6 am-u-md-6">
|
||||
<input type="text" class="am-input" data-validate-async data-validation-message="请输入客户名称(20字符以内)"
|
||||
name="customer" placeholder="请输入客户名称(20字符以内)" maxlength="20"
|
||||
value="${project.customer}" required readonly/>
|
||||
</div>
|
||||
<div class="am-u-sm-2 am-u-md-4 input-msg"></div>
|
||||
</div>
|
||||
<div class="am-g am-form-group am-margin-top">
|
||||
<div class="am-u-sm-4 am-u-md-2 am-text-right"><span style="color: red;">*</span>终端客户名称</div>
|
||||
<div class="am-u-sm-6 am-u-md-6">
|
||||
<input type="text" class="am-input" data-validate-async data-validation-message="请输入终端客户名称(20字符以内)"
|
||||
name="terminalCustomer" placeholder="请输入终端客户名称(20字符以内)" maxlength="20"
|
||||
value="${project.terminalCustomer}" required readonly/>
|
||||
</div>
|
||||
<div class="am-u-sm-2 am-u-md-4 input-msg"></div>
|
||||
</div>
|
||||
<div class="am-g am-form-group am-margin-top">
|
||||
<div class="am-u-sm-4 am-u-md-2 am-text-right"><span style="color: red;">*</span>垫资利息</div>
|
||||
<div class="am-u-sm-6 am-u-md-6">
|
||||
<input type="number" class="am-input" data-validate-async data-validation-message="请输入垫资利息"
|
||||
name="advanceInterestAmount" placeholder="单位(元)" maxlength="20"
|
||||
value="${project.advanceInterestAmount}" required />
|
||||
</div>
|
||||
<div class="am-u-sm-2 am-u-md-4 input-msg"></div>
|
||||
</div>
|
||||
<div class="am-g am-form-group am-margin-top">
|
||||
<div class="am-u-sm-4 am-u-md-2 am-text-right"><span style="color: red;">*</span>垫资峰值</div>
|
||||
<div class="am-u-sm-6 am-u-md-6">
|
||||
<input type="number" class="am-input" data-validate-async data-validation-message="请输入垫资峰值"
|
||||
name="advancePeakAmount" placeholder="单位(元)" maxlength="20"
|
||||
value="${project.advancePeakAmount}" required />
|
||||
</div>
|
||||
<div class="am-u-sm-2 am-u-md-4 input-msg"></div>
|
||||
</div>
|
||||
<div class="am-g am-form-group am-margin-top">
|
||||
<div class="am-u-sm-4 am-u-md-2 am-text-right"><span style="color: red;">*</span>合同金额</div>
|
||||
<div class="am-u-sm-6 am-u-md-6">
|
||||
<input type="number" class="am-input" data-validate-async data-validation-message="请输入合同金额"
|
||||
name="contractAmount" placeholder="单位(元)" maxlength="20"
|
||||
value="${project.contractAmount}" required />
|
||||
</div>
|
||||
<div class="am-u-sm-2 am-u-md-4 input-msg"></div>
|
||||
</div>
|
||||
<div class="am-g am-form-group am-margin-top">
|
||||
<div class="am-u-sm-4 am-u-md-2 am-text-right"><span style="color: red;">*</span>行业场景应用</div>
|
||||
<div class="am-u-sm-6 am-u-md-6">
|
||||
<input type="text" class="am-input" data-validate-async data-validation-message="请输入行业场景应用"
|
||||
name="industryScenario" placeholder="请输入行业场景应用" maxlength="20"
|
||||
value="${project.industryScenario}" required readonly/>
|
||||
</div>
|
||||
<div class="am-u-sm-2 am-u-md-4 input-msg"></div>
|
||||
</div>
|
||||
<div class="am-g am-form-group am-margin-top">
|
||||
<div class="am-u-sm-4 am-u-md-2 am-text-right"><span style="color: red;">*</span>华智产品金额</div>
|
||||
<div class="am-u-sm-6 am-u-md-6">
|
||||
<input type="number" class="am-input" data-validate-async data-validation-message="华智产品金额"
|
||||
name="huazhiProductAmount" placeholder="单位(元)" maxlength="20"
|
||||
value="${project.huazhiProductAmount!}" />
|
||||
</div>
|
||||
<div class="am-u-sm-2 am-u-md-4 input-msg"></div>
|
||||
</div>
|
||||
<div class="am-g am-form-group am-margin-top">
|
||||
<div class="am-u-sm-4 am-u-md-2 am-text-right"><span style="color: red;">*</span>紫光其他产品金额</div>
|
||||
<div class="am-u-sm-6 am-u-md-6">
|
||||
<input type="number" class="am-input" data-validate-async data-validation-message="请输入紫光其他产品金额"
|
||||
name="ziguangOtherAmount" placeholder="单位(元)" maxlength="20"
|
||||
value="${project.ziguangOtherAmount!}" />
|
||||
</div>
|
||||
<div class="am-u-sm-2 am-u-md-4 input-msg"></div>
|
||||
</div>
|
||||
<div class="am-g am-form-group am-margin-top">
|
||||
<div class="am-u-sm-4 am-u-md-2 am-text-right"><span style="color: red;">*</span>主合同收款条款</div>
|
||||
<div class="am-u-sm-6 am-u-md-6">
|
||||
<input type="text" class="am-input" data-validate-async data-validation-message="请输入收款条款"
|
||||
name="mainContractCollectionTerms" placeholder="请输入收款条款" maxlength="20"
|
||||
value="${project.mainContractCollectionTerms}" required />
|
||||
</div>
|
||||
<div class="am-u-sm-2 am-u-md-4 input-msg"></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--验证表单元素(validate end-->
|
||||
</div>
|
||||
<div class="am-tabs-bd">
|
||||
<div class="am-tab-panel am-fade am-in" id="tab2">
|
||||
<span class="am-text-lg">收入</span>
|
||||
<span class="am-text-primary"><a>收入明细表</a></span>
|
||||
<table class="am-table am-table-bordered am-table-radius table-main" style="padding:0;">
|
||||
<tbody>
|
||||
<tr class="am-text-xl">
|
||||
<td>类别</td>
|
||||
<td>费用</td>
|
||||
<td>含税金额(元)</td>
|
||||
<td>不含税金额(元)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>收入</td>
|
||||
<td>设备类</td>
|
||||
<td><input name="incomeDeviceTaxInclude" value="${budgetBean.incomeDeviceTaxInclude!}" required readonly></td>
|
||||
<td><input name="incomeDeviceTaxExclude" value="${budgetBean.incomeDeviceTaxExclude!}" required readonly></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>收入</td>
|
||||
<td>工程类</td>
|
||||
<td><input name="incomeEngineerTaxInclude" value="${budgetBean.incomeEngineerTaxInclude!}" required readonly></td>
|
||||
<td><input name="incomeEngineerTaxExclude" value="${budgetBean.incomeEngineerTaxExclude!}" required readonly></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>收入</td>
|
||||
<td>服务类</td>
|
||||
<td><input name="incomeServiceTaxInclude" value="${budgetBean.incomeServiceTaxInclude!}" required readonly></td>
|
||||
<td><input name="incomeServiceTaxExclude" value="${budgetBean.incomeServiceTaxExclude!}" required readonly></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>合计</td>
|
||||
<td></td>
|
||||
<td><input name="incomeTotalTaxInclude" value="${budgetBean.incomeTotalTaxInclude!}" readonly required></td>
|
||||
<td><input name="incomeTotalTaxExclude" value="${budgetBean.incomeTotalTaxExclude!}" readonly required></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<span class="am-text-lg">成本</span>
|
||||
<span class="am-text-primary"><a>采购成本明细表</a></span>
|
||||
<span class="am-text-primary"><a>项目管理成本表</a></span>
|
||||
<table class="am-table am-table-bordered am-table-radius table-main" style="padding:0;">
|
||||
<tbody>
|
||||
<tr class="am-text-xl">
|
||||
<td>类别</td>
|
||||
<td>费用</td>
|
||||
<td>费用项目</td>
|
||||
<td>含税金额(元)</td>
|
||||
<td>不含税金额(元)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>成本</td>
|
||||
<td>采购成本</td>
|
||||
<td>设备</td>
|
||||
<td><input name="costPurchaseDeviceTaxInclude" value="${budgetBean.costPurchaseDeviceTaxInclude!}" readonly required></td>
|
||||
<td><input name="costPurchaseDeviceTaxExclude" value="${budgetBean.costPurchaseDeviceTaxExclude!}" readonly required></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>成本</td>
|
||||
<td>采购成本</td>
|
||||
<td>施工</td>
|
||||
<td><input name="costPurchaseBuildTaxInclude" value="${budgetBean.costPurchaseBuildTaxInclude!}" readonly required></td>
|
||||
<td><input name="costPurchaseBuildTaxExclude" value="${budgetBean.costPurchaseBuildTaxExclude!}" readonly required></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>成本</td>
|
||||
<td>采购成本</td>
|
||||
<td>服务</td>
|
||||
<td><input name="costPurchaseServiceTaxInclude" value="${budgetBean.costPurchaseServiceTaxInclude!}" readonly required></td>
|
||||
<td><input name="costPurchaseServiceTaxExclude" value="${budgetBean.costPurchaseServiceTaxExclude!}" readonly required></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>成本</td>
|
||||
<td>采购成本</td>
|
||||
<td>其他</td>
|
||||
<td><input name="costPurchaseOtherTaxInclude" value="${budgetBean.costPurchaseOtherTaxInclude!}" readonly required></td>
|
||||
<td><input name="costPurchaseOtherTaxExclude" value="${budgetBean.costPurchaseOtherTaxExclude!}" readonly required></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>成本</td>
|
||||
<td>项目管理成本</td>
|
||||
<td>项目管理成本</td>
|
||||
<td><input name="costProjectManageTaxInclude" value="${budgetBean.costProjectManageTaxInclude!}" readonly required></td>
|
||||
<td><input name="costProjectManageTaxExclude" value="${budgetBean.costProjectManageTaxExclude!}" readonly required></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>成本</td>
|
||||
<td>其他</td>
|
||||
<td>其他</td>
|
||||
<td><input name="costOtherOtherTaxInclude" value="${budgetBean.costOtherOtherTaxInclude!}" readonly required></td>
|
||||
<td><input name="costOtherOtherTaxExclude" value="${budgetBean.costOtherOtherTaxExclude!}" readonly required></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>合计</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td><input name="costTotalTaxInclude" value="${budgetBean.costTotalTaxInclude!}" readonly required></td>
|
||||
<td><input name="costTotalTaxExclude" value="${budgetBean.costTotalTaxExclude!}" readonly required></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<span class="am-text-lg">管理</span>
|
||||
<span class="am-text-primary"><a>资金计划表</a></span>
|
||||
<table class="am-table am-table-bordered am-table-radius table-main" style="padding:0;">
|
||||
<tbody>
|
||||
<tr class="am-text-xl">
|
||||
<td>类别</td>
|
||||
<td>费用项目</td>
|
||||
<td>不含税金额(元)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>财务费用</td>
|
||||
<td>资金占用成本</td>
|
||||
<td><input name="costExpropriationTaxExclude" value="${budgetBean.costExpropriationTaxExclude!}" required readonly></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>公司管理费用</td>
|
||||
<td></td>
|
||||
<td><input name="costCompanyManageTaxExclude" value="${budgetBean.costCompanyManageTaxExclude!}" required readonly></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<span class="am-text-lg">利润率计算</span>
|
||||
<table class="am-table am-table-bordered am-table-radius table-main" style="padding:0;">
|
||||
<tbody>
|
||||
<tr class="am-text-xl">
|
||||
<td>类别</td>
|
||||
<td>不含税金额(元)</td>
|
||||
<td>利润率(%)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>项目毛利</td>
|
||||
<td><input name="projectGrossProfit" value="${budgetBean.projectGrossProfit!}" readonly required></td>
|
||||
<td><input name="projectGrossProfitRate" value="${budgetBean.projectGrossProfitRate!}" readonly required></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>项目贡献利润率</td>
|
||||
<td><input name="projectContributionProfit" value="${budgetBean.projectContributionProfit!}" readonly required></td>
|
||||
<td><input name="projectContributionProfitRate" value="${budgetBean.projectContributionProfitRate!}" readonly required></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<span class="am-text-lg">现金流量表</span>
|
||||
<table class="am-table am-table-bordered am-table-radius table-main" style="padding:0;">
|
||||
<tbody>
|
||||
<tr class="am-text-xl">
|
||||
<td>类别</td>
|
||||
<td>金额(元)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>销售商品、提供劳务收到的现金a</td>
|
||||
<td><input name="" value="${budgetBean.a!}" readonly required></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>收到的税费返还b</td>
|
||||
<td><input name="" value="${budgetBean.a!}" readonly required></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>收到其他与经营活动有关的现金c</td>
|
||||
<td><input name="" value="${budgetBean.a!}" readonly required></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>购买商品、接受劳务支付的现d</td>
|
||||
<td><input name="" value="${budgetBean.a!}" readonly required></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>支付的各项税费e</td>
|
||||
<td><input name="" value="${budgetBean.a!}" readonly required></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>支付其他与经营活动有关的现金f</td>
|
||||
<td><input name="" value="${budgetBean.a!}" readonly required></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>经营活动产生的现金流量净额g</td>
|
||||
<td><input name="" value="${budgetBean.a!}" readonly required></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>投资活动现金流入h</td>
|
||||
<td><input name="" value="${budgetBean.a!}" readonly required></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>投资活动现金流出i</td>
|
||||
<td><input name="" value="${budgetBean.a!}" readonly required></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>投资活动产生的现金流量净额j</td>
|
||||
<td><input name="" value="${budgetBean.a!}" readonly required></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>融资资金流入k</td>
|
||||
<td><input name="" value="${budgetBean.a!}" readonly required></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>还款资金流出l</td>
|
||||
<td><input name="" value="${budgetBean.a!}" readonly required></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>筹资活动产生的现金流量净额m</td>
|
||||
<td><input name="" value="${budgetBean.a!}" readonly required></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>货币资金净增加额n</td>
|
||||
<td><input name="" value="${budgetBean.a!}" readonly required></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!--验证表单元素(validate end-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--选项卡(tabs)end-->
|
||||
<div class="am-margin">
|
||||
<button type="button" class="am-btn am-btn-warning am-btn-xs" onclick="javascript:history.go(-1);">返回上一级</button>
|
||||
<button type="submit" class="am-btn am-btn-primary am-btn-xs" id="saveDraft">保存草稿</button>
|
||||
<button type="submit" class="am-btn am-btn-primary am-btn-xs" id="saveApprove">提交审核</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<script src="${base}/assets/js/project_budget.js"></script>
|
||||
<script>
|
||||
$(function () {
|
||||
$("#saveDraft").click(function () {
|
||||
$("#pmsForm").attr("action","${base}/project/budgetEditSave");
|
||||
$("#pmsForm").submit();
|
||||
});
|
||||
$("#saveApprove").click(function () {
|
||||
$("#pmsForm").attr("action","${base}/project/budgetEditSaveAndApprove");
|
||||
$("#pmsForm").submit();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</@defaultLayout.layout>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -178,7 +178,7 @@
|
|||
</div>
|
||||
<div class="am-tabs-bd">
|
||||
<div class="am-tab-panel am-fade am-in" id="tab2">
|
||||
<span class="am-text-xl">收入</span>
|
||||
<span class="am-text-lg">收入</span>
|
||||
<table class="am-table am-table-bordered am-table-radius table-main" style="padding:0;">
|
||||
<tbody>
|
||||
<tr class="am-text-xl">
|
||||
|
@ -213,7 +213,7 @@
|
|||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<span class="am-text-xl">成本</span>
|
||||
<span class="am-text-lg">成本</span>
|
||||
<table class="am-table am-table-bordered am-table-radius table-main" style="padding:0;">
|
||||
<tbody>
|
||||
<tr class="am-text-xl">
|
||||
|
@ -274,7 +274,7 @@
|
|||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<span class="am-text-xl">管理</span>
|
||||
<span class="am-text-lg">管理</span>
|
||||
<table class="am-table am-table-bordered am-table-radius table-main" style="padding:0;">
|
||||
<tbody>
|
||||
<tr class="am-text-xl">
|
||||
|
@ -295,7 +295,7 @@
|
|||
</tbody>
|
||||
</table>
|
||||
|
||||
<span class="am-text-xl">利润率计算</span>
|
||||
<span class="am-text-lg">利润率计算</span>
|
||||
<table class="am-table am-table-bordered am-table-radius table-main" style="padding:0;">
|
||||
<tbody>
|
||||
<tr class="am-text-xl">
|
||||
|
|
|
@ -62,7 +62,7 @@
|
|||
<div class="am-u-sm-6 am-u-md-6">
|
||||
<input type="text" class="am-input" data-validate-async data-validation-message="请输入项目名称(20字符以内)"
|
||||
name="name" placeholder="请输入项目名称(20字符以内)" maxlength="20"
|
||||
value="${project.name}" required />
|
||||
value="${project.name}" required readonly/>
|
||||
</div>
|
||||
<div class="am-u-sm-2 am-u-md-4 input-msg"></div>
|
||||
</div>
|
||||
|
@ -70,7 +70,7 @@
|
|||
<div class="am-g am-form-group am-margin-top">
|
||||
<div class="am-u-sm-4 am-u-md-2 am-text-right"><span style="color: red;">*</span>项目类型</div>
|
||||
<div class="am-u-sm-6 am-u-md-6">
|
||||
<select data-am-selected id="type" name="type">
|
||||
<select data-am-selected id="type" name="type" readonly="">
|
||||
<option value="1" <#if project.type=1>selected</#if>>工程集成类</option>
|
||||
<option value="2" <#if project.type=2>selected</#if>>设备集成类</option>
|
||||
<option value="3" <#if project.type=3>selected</#if>>战略合作类</option>
|
||||
|
@ -81,7 +81,7 @@
|
|||
<div class="am-g am-form-group am-margin-top">
|
||||
<div class="am-u-sm-4 am-u-md-2 am-text-right"><span style="color: red;">*</span>垫资模式</div>
|
||||
<div class="am-u-sm-6 am-u-md-6">
|
||||
<select data-am-selected id="underwrittenMode" name="underwrittenMode">
|
||||
<select data-am-selected id="underwrittenMode" name="underwrittenMode" readonly="">
|
||||
<option value="1" <#if project.underwrittenMode=1>selected</#if>>A类-不垫资(战略合作)</option>
|
||||
<option value="2" <#if project.underwrittenMode=2>selected</#if>>B类-不垫资(背靠背)</option>
|
||||
<option value="3" <#if project.underwrittenMode=3>selected</#if>>C类-垫资(账期覆盖)</option>
|
||||
|
@ -96,7 +96,7 @@
|
|||
<div class="am-u-sm-6 am-u-md-6">
|
||||
<input type="text" class="am-input" data-validate-async data-validation-message="请输入客户名称(20字符以内)"
|
||||
name="customer" placeholder="请输入客户名称(20字符以内)" maxlength="20"
|
||||
value="${project.customer}" required />
|
||||
value="${project.customer}" required readonly/>
|
||||
</div>
|
||||
<div class="am-u-sm-2 am-u-md-4 input-msg"></div>
|
||||
</div>
|
||||
|
@ -105,7 +105,7 @@
|
|||
<div class="am-u-sm-6 am-u-md-6">
|
||||
<input type="text" class="am-input" data-validate-async data-validation-message="请输入终端客户名称(20字符以内)"
|
||||
name="terminalCustomer" placeholder="请输入终端客户名称(20字符以内)" maxlength="20"
|
||||
value="${project.terminalCustomer}" required />
|
||||
value="${project.terminalCustomer}" required readonly/>
|
||||
</div>
|
||||
<div class="am-u-sm-2 am-u-md-4 input-msg"></div>
|
||||
</div>
|
||||
|
@ -141,7 +141,7 @@
|
|||
<div class="am-u-sm-6 am-u-md-6">
|
||||
<input type="text" class="am-input" data-validate-async data-validation-message="请输入行业场景应用"
|
||||
name="industryScenario" placeholder="请输入行业场景应用" maxlength="20"
|
||||
value="${project.industryScenario}" required />
|
||||
value="${project.industryScenario}" required readonly/>
|
||||
</div>
|
||||
<div class="am-u-sm-2 am-u-md-4 input-msg"></div>
|
||||
</div>
|
||||
|
@ -178,7 +178,7 @@
|
|||
</div>
|
||||
<div class="am-tabs-bd">
|
||||
<div class="am-tab-panel am-fade am-in" id="tab2">
|
||||
<span class="am-text-xl">收入</span>
|
||||
<span class="am-text-lg">收入</span>
|
||||
<table class="am-table am-table-bordered am-table-radius table-main" style="padding:0;">
|
||||
<tbody>
|
||||
<tr class="am-text-xl">
|
||||
|
@ -213,7 +213,7 @@
|
|||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<span class="am-text-xl">成本</span>
|
||||
<span class="am-text-lg">成本</span>
|
||||
<table class="am-table am-table-bordered am-table-radius table-main" style="padding:0;">
|
||||
<tbody>
|
||||
<tr class="am-text-xl">
|
||||
|
@ -274,7 +274,7 @@
|
|||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<span class="am-text-xl">管理</span>
|
||||
<span class="am-text-lg">管理</span>
|
||||
<table class="am-table am-table-bordered am-table-radius table-main" style="padding:0;">
|
||||
<tbody>
|
||||
<tr class="am-text-xl">
|
||||
|
@ -295,7 +295,7 @@
|
|||
</tbody>
|
||||
</table>
|
||||
|
||||
<span class="am-text-xl">利润率计算</span>
|
||||
<span class="am-text-lg">利润率计算</span>
|
||||
<table class="am-table am-table-bordered am-table-radius table-main" style="padding:0;">
|
||||
<tbody>
|
||||
<tr class="am-text-xl">
|
||||
|
|
|
@ -180,6 +180,13 @@
|
|||
class="am-icon-pencil-square-o"></span>编辑
|
||||
</button>
|
||||
</@shiro.hasPermission>
|
||||
<@shiro.hasPermission name="PROJECT_EDIT">
|
||||
<button type="button"
|
||||
class="am-btn am-btn-default am-btn-xs am-text-secondary"
|
||||
onclick="location.href='${base}/project/budgetEdit?id=${list.id}'"><span
|
||||
class="am-icon-pencil-square-o"></span>填写预算表
|
||||
</button>
|
||||
</@shiro.hasPermission>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
|
|
Loading…
Reference in New Issue