Merge branch 'dev_1.0.0' of http://git.unissense.tech/mula/fourcal
commit
3ea59ec3d5
|
@ -1132,7 +1132,7 @@ public class ProjectController extends BaseController {
|
||||||
@RequestMapping("/incomeTemplate")
|
@RequestMapping("/incomeTemplate")
|
||||||
public void incomeTemplate(HttpServletResponse response) throws Exception{
|
public void incomeTemplate(HttpServletResponse response) throws Exception{
|
||||||
|
|
||||||
String[] headers = new String[]{"类别", "名称", "规格类型", "参数", "单位", "数量", "单价", "税率(%)"};
|
String[] headers = new String[]{"类别", "产品大类", "税率(%)","含税总金额(元)"};
|
||||||
downloadHeader(response , Utils.generateExcelName("收入明细表批量导入模板"));
|
downloadHeader(response , Utils.generateExcelName("收入明细表批量导入模板"));
|
||||||
ExportUtils exportUtils = new ExportUtils(headers);
|
ExportUtils exportUtils = new ExportUtils(headers);
|
||||||
exportUtils.write(response.getOutputStream());
|
exportUtils.write(response.getOutputStream());
|
||||||
|
@ -1167,7 +1167,7 @@ public class ProjectController extends BaseController {
|
||||||
@RequestMapping("/costTemplate")
|
@RequestMapping("/costTemplate")
|
||||||
public void costTemplate(HttpServletResponse response) throws Exception{
|
public void costTemplate(HttpServletResponse response) throws Exception{
|
||||||
|
|
||||||
String[] headers = new String[]{"费用项目", "采购类别", "名称", "单位", "数量", "单价", "税率(%)", "签约方", "是否垫资", "预估垫资金额(元)", "支出时间", "支出金额(元)", "付款方式", "备注"};
|
String[] headers = new String[]{"采购成本项目", "产品大类", "税率(%)","含税总金额(元)" ,"供应商", "备注"};
|
||||||
downloadHeader(response , Utils.generateExcelName("采购成本明细表批量导入模板"));
|
downloadHeader(response , Utils.generateExcelName("采购成本明细表批量导入模板"));
|
||||||
ExportUtils exportUtils = new ExportUtils(headers);
|
ExportUtils exportUtils = new ExportUtils(headers);
|
||||||
exportUtils.write(response.getOutputStream());
|
exportUtils.write(response.getOutputStream());
|
||||||
|
@ -1254,7 +1254,7 @@ public class ProjectController extends BaseController {
|
||||||
//收入明细
|
//收入明细
|
||||||
List<ProjectBudgetIncomeDetail> budgetIncomeDetail = projectBudgetService.getBudgetIncomeDetail(project);
|
List<ProjectBudgetIncomeDetail> budgetIncomeDetail = projectBudgetService.getBudgetIncomeDetail(project);
|
||||||
BigDecimal incomeTotalAmount = projectBudgetService.getBudgetIncomeAmount(project);
|
BigDecimal incomeTotalAmount = projectBudgetService.getBudgetIncomeAmount(project);
|
||||||
String[] headers2 = {"序号", "产品大类", "名称", "税率(%)", "含税总金额(元)", "不含税金额(元)", "税金(元)"};
|
String[] headers2 = {"序号", "类别", "产品大类", "税率(%)", "含税总金额(元)", "不含税金额(元)", "税金(元)"};
|
||||||
String[] columns2 = {"tempId", "type", "name", "taxRate", "totalTaxInclude", "totalTaxExclude", "totalTax"};
|
String[] columns2 = {"tempId", "type", "name", "taxRate", "totalTaxInclude", "totalTaxExclude", "totalTax"};
|
||||||
exportExcelUtils.exportIncomeDetailExcel(headers2, columns2, project, budgetBean, budgetIncomeDetail, incomeTotalAmount, "yyyy-MM-dd", 0, "收入明细表", outputStream);
|
exportExcelUtils.exportIncomeDetailExcel(headers2, columns2, project, budgetBean, budgetIncomeDetail, incomeTotalAmount, "yyyy-MM-dd", 0, "收入明细表", outputStream);
|
||||||
|
|
||||||
|
@ -1347,7 +1347,7 @@ public class ProjectController extends BaseController {
|
||||||
//资金计划明细
|
//资金计划明细
|
||||||
List<ProjectBudgetPlanDetail> projectBudgetPlanDetails = projectBudgetService.getProjectBudgetPlanDetails(project);
|
List<ProjectBudgetPlanDetail> projectBudgetPlanDetails = projectBudgetService.getProjectBudgetPlanDetails(project);
|
||||||
ProjectBudgetPlanDetail projectBudgetPlanDetailTotal = projectBudgetService.getProjectBudgetPlanDetailTotal(project, projectBudgetPlanDetails);
|
ProjectBudgetPlanDetail projectBudgetPlanDetailTotal = projectBudgetService.getProjectBudgetPlanDetailTotal(project, projectBudgetPlanDetails);
|
||||||
String[] headers5 = {"月份", "设备支出", "工程支出(含服务+施工+其他)", "经营性开支", "保证金支出", "支出合计", "销售收款", "保证金收款", "收款合计", "资金余额", "资金利息", "垫资计划", "还款计划"};
|
String[] headers5 = {"月份", "设备支出", "工程支出(含服务+施工+其他)", "项目管理费用付款", "保证金付款", "付款合计", "销售收款", "保证金收款", "收款合计", "资金余额", "资金利息", "垫资计划", "还款计划"};
|
||||||
String[] row5 = {"month", "deviceCost", "engineerCost", "projectManageCost", "earnestMoneyCost", "totalCost", "saleIncome", "earnestMoneyIncome", "totalIncome", "fundBalance", "capitalInterest", "underwrittenPlan", "repaymentPlan"};
|
String[] row5 = {"month", "deviceCost", "engineerCost", "projectManageCost", "earnestMoneyCost", "totalCost", "saleIncome", "earnestMoneyIncome", "totalIncome", "fundBalance", "capitalInterest", "underwrittenPlan", "repaymentPlan"};
|
||||||
exportExcelUtils.exportPlanDetailExcel(headers5, row5, project, budgetBean, projectBudgetPlanDetails, projectBudgetPlanDetailTotal, "yyyy-MM-dd", 0, "资金计划表", outputStream);
|
exportExcelUtils.exportPlanDetailExcel(headers5, row5, project, budgetBean, projectBudgetPlanDetails, projectBudgetPlanDetailTotal, "yyyy-MM-dd", 0, "资金计划表", outputStream);
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@ public class ProjectBudgetPayPlanTemp extends ProjectBudgetPayPlanBase {
|
||||||
public ProjectBudgetPayPlan toProjectBudgetPayPlanDetail() {
|
public ProjectBudgetPayPlan toProjectBudgetPayPlanDetail() {
|
||||||
ProjectBudgetPayPlan projectBudgetPayPlan = new ProjectBudgetPayPlan();
|
ProjectBudgetPayPlan projectBudgetPayPlan = new ProjectBudgetPayPlan();
|
||||||
BeanUtils.copyProperties(this, projectBudgetPayPlan);
|
BeanUtils.copyProperties(this, projectBudgetPayPlan);
|
||||||
|
projectBudgetPayPlan.setId(null);
|
||||||
return projectBudgetPayPlan;
|
return projectBudgetPayPlan;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1143,6 +1143,15 @@ public class ProjectBudgetService {
|
||||||
clearBudgetCostProjectManageDetail(p);
|
clearBudgetCostProjectManageDetail(p);
|
||||||
//资金计划明细
|
//资金计划明细
|
||||||
clearBudgetPlanDetail(p);
|
clearBudgetPlanDetail(p);
|
||||||
|
//付款计划表
|
||||||
|
clearBudgetPayPlan(p);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void clearBudgetPayPlan(Project p) {
|
||||||
|
List<ProjectBudgetPayPlan> costDetails = projectBudgetPayPlanRepository.findAllByProjectIdEquals(p.getId());
|
||||||
|
if(CollectionUtil.isNotEmpty(costDetails)){
|
||||||
|
projectBudgetPayPlanRepository.deleteInBatch(costDetails);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
@ -1192,36 +1201,22 @@ public class ProjectBudgetService {
|
||||||
} else {
|
} else {
|
||||||
throw new Exception("该类别不存在");
|
throw new Exception("该类别不存在");
|
||||||
}
|
}
|
||||||
key = "名称";
|
key = "产品大类";
|
||||||
o1 = m.get(key);
|
o1 = m.get(key);
|
||||||
temp.setName((String) o1);
|
temp.setName((String) o1);
|
||||||
key = "规格类型";
|
|
||||||
o1 = m.get(key);
|
|
||||||
temp.setSpec((String) o1);
|
|
||||||
key = "参数";
|
|
||||||
o1 = m.get(key);
|
|
||||||
temp.setParam((String) o1);
|
|
||||||
key = "单位";
|
|
||||||
o1 = m.get(key);
|
|
||||||
temp.setUnit((String) o1);
|
|
||||||
try {
|
try {
|
||||||
key = "数量";
|
|
||||||
o1 = m.get(key);
|
|
||||||
if (o1 != null) {
|
|
||||||
temp.setAmount(new BigDecimal((String) o1));
|
|
||||||
}
|
|
||||||
key = "单价";
|
|
||||||
o1 = m.get(key);
|
|
||||||
if (o1 != null) {
|
|
||||||
temp.setPrice(new BigDecimal((String) o1));
|
|
||||||
}
|
|
||||||
key = "税率(%)";
|
key = "税率(%)";
|
||||||
o1 = m.get(key);
|
o1 = m.get(key);
|
||||||
if (o1 != null) {
|
if (o1 != null) {
|
||||||
temp.setTaxRate(new BigDecimal((String) o1));
|
temp.setTaxRate(new BigDecimal((String) o1));
|
||||||
}
|
}
|
||||||
|
key = "含税总金额(元)";
|
||||||
|
o1 = m.get(key);
|
||||||
|
if (o1 != null) {
|
||||||
|
temp.setTotalTaxInclude(new BigDecimal((String) o1));
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new Exception("数量、单价、税率需为数字");
|
throw new Exception("税率、含税总金额需为数字");
|
||||||
}
|
}
|
||||||
incomeDetailTempList.add(temp);
|
incomeDetailTempList.add(temp);
|
||||||
}
|
}
|
||||||
|
@ -1261,7 +1256,7 @@ public class ProjectBudgetService {
|
||||||
String key;
|
String key;
|
||||||
Object o1;
|
Object o1;
|
||||||
temp.setProjectId(id);
|
temp.setProjectId(id);
|
||||||
key = "费用项目";
|
key = "采购成本项目";
|
||||||
o1 = m.get(key);
|
o1 = m.get(key);
|
||||||
String type = (String) o1;
|
String type = (String) o1;
|
||||||
if ("设备".equals(type)) {
|
if ("设备".equals(type)) {
|
||||||
|
@ -1275,75 +1270,36 @@ public class ProjectBudgetService {
|
||||||
} else {
|
} else {
|
||||||
throw new Exception("该费用项目不存在");
|
throw new Exception("该费用项目不存在");
|
||||||
}
|
}
|
||||||
key = "采购类别";
|
key = "产品大类";
|
||||||
o1 = m.get(key);
|
o1 = m.get(key);
|
||||||
String category = (String) o1;
|
String category = (String) o1;
|
||||||
ProcurementType procurementType = procurementTypeRepository.findByName(category);
|
ProcurementType procurementType = procurementTypeRepository.findByName(category);
|
||||||
if (procurementType != null && procurementType.getType() == temp.getType()) {
|
if (procurementType != null && procurementType.getType() == temp.getType()) {
|
||||||
temp.setCategory(procurementType.getId());
|
temp.setCategory(procurementType.getId());
|
||||||
} else {
|
} else {
|
||||||
throw new Exception("该采购类别不存在或者与费用项目不匹配");
|
throw new Exception("该采购类别不存在或者与采购成本项目不匹配");
|
||||||
}
|
}
|
||||||
key = "名称";
|
|
||||||
o1 = m.get(key);
|
key = "供应商";
|
||||||
temp.setName((String) o1);
|
|
||||||
key = "单位";
|
|
||||||
o1 = m.get(key);
|
|
||||||
temp.setUnit((String) o1);
|
|
||||||
key = "签约方";
|
|
||||||
o1 = m.get(key);
|
o1 = m.get(key);
|
||||||
temp.setContractParty((String) o1);
|
temp.setContractParty((String) o1);
|
||||||
key = "是否垫资";
|
|
||||||
o1 = m.get(key);
|
|
||||||
String isUnderwritten = (String) o1;
|
|
||||||
if ("是".equals(isUnderwritten)) {
|
|
||||||
temp.setIsUnderwritten(1);
|
|
||||||
} else if ("否".equals(isUnderwritten)) {
|
|
||||||
temp.setIsUnderwritten(2);
|
|
||||||
} else {
|
|
||||||
temp.setIsUnderwritten(0);
|
|
||||||
}
|
|
||||||
try {
|
try {
|
||||||
key = "数量";
|
|
||||||
o1 = m.get(key);
|
|
||||||
if (o1 != null) {
|
|
||||||
temp.setAmount(new BigDecimal((String) o1));
|
|
||||||
}
|
|
||||||
key = "单价";
|
|
||||||
o1 = m.get(key);
|
|
||||||
if (o1 != null) {
|
|
||||||
temp.setPrice(new BigDecimal((String) o1));
|
|
||||||
}
|
|
||||||
key = "税率(%)";
|
key = "税率(%)";
|
||||||
o1 = m.get(key);
|
o1 = m.get(key);
|
||||||
if (o1 != null) {
|
if (o1 != null) {
|
||||||
temp.setTaxRate(new BigDecimal((String) o1));
|
temp.setTaxRate(new BigDecimal((String) o1));
|
||||||
}
|
}
|
||||||
key = "预估垫资金额(元)";
|
key = "含税总金额(元)";
|
||||||
o1 = m.get(key);
|
o1 = m.get(key);
|
||||||
if (o1 != null) {
|
if (o1 != null) {
|
||||||
temp.setUnderwrittenAmount(new BigDecimal((String) o1));
|
temp.setTotalTaxInclude(new BigDecimal((String) o1));
|
||||||
}
|
|
||||||
key = "支出金额(元)";
|
|
||||||
o1 = m.get(key);
|
|
||||||
if (o1 != null) {
|
|
||||||
temp.setPayAmount(new BigDecimal((String) o1));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new Exception("数量、单价、税率、预估垫资金额和支出金额需为数字");
|
throw new Exception("税率、含税总金额(元)需为数字");
|
||||||
}
|
}
|
||||||
try {
|
|
||||||
key = "支出时间";
|
|
||||||
o1 = m.get(key);
|
|
||||||
if (o1 != null) {
|
|
||||||
temp.setPayTime(DateKit.getDate((String) o1, DateKit.DATE_FORMAT));
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
throw new Exception("支出时间需为时间格式yyyy-MM-dd");
|
|
||||||
}
|
|
||||||
key = "付款方式";
|
|
||||||
o1 = m.get(key);
|
|
||||||
temp.setPayWay((String) o1);
|
|
||||||
key = "备注";
|
key = "备注";
|
||||||
o1 = m.get(key);
|
o1 = m.get(key);
|
||||||
temp.setRemark((String) o1);
|
temp.setRemark((String) o1);
|
||||||
|
@ -1355,6 +1311,7 @@ public class ProjectBudgetService {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void saveBudgetPayPlanTemp(Project project, List<ProjectBudgetPayPlanTemp> detailList) {
|
public void saveBudgetPayPlanTemp(Project project, List<ProjectBudgetPayPlanTemp> detailList) {
|
||||||
|
clearBudgetPauPlanTemp(project);
|
||||||
if(CollectionUtil.isNotEmpty(detailList)){
|
if(CollectionUtil.isNotEmpty(detailList)){
|
||||||
for (ProjectBudgetPayPlanTemp temp : detailList) {
|
for (ProjectBudgetPayPlanTemp temp : detailList) {
|
||||||
temp.setProjectId(project.getId());
|
temp.setProjectId(project.getId());
|
||||||
|
@ -1363,4 +1320,11 @@ public class ProjectBudgetService {
|
||||||
projectBudgetPayPlanTempRepository.save(detailList);
|
projectBudgetPayPlanTempRepository.save(detailList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void clearBudgetPauPlanTemp(Project project) {
|
||||||
|
List<ProjectBudgetPayPlanTemp> allByProjectIdEquals = projectBudgetPayPlanTempRepository.findAllByProjectIdEquals(project.getId());
|
||||||
|
if(CollectionUtil.isNotEmpty(allByProjectIdEquals)){
|
||||||
|
projectBudgetPayPlanTempRepository.deleteInBatch(allByProjectIdEquals);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue