Skip to content
Snippets Groups Projects
Commit 34399016 authored by kjl's avatar kjl
Browse files

1

parent 7c7af710
Branches
1 merge request!15Kejinlong
Pipeline #79684 failed with stage
......@@ -147,54 +147,6 @@ public class CompanyDeptServiceImpl implements CompanyDeptService {
for (CompanyPo companyPo : companyPos) {
saveBudget(companyPo,year,month,FundTypeEnum.ALLFUND);
saveBudget(companyPo,year,month,FundTypeEnum.FISCALFUND);
/*//查询财政资金
//根据token和${systemId},${year},${month},${summaryType=1},FixedList[{"index":3,"codes":["01"]}] 生成查询条件 根据url查询当前时间每个单位的各部门预算
String data1 = getData(companyPo,year,FundTypeEnum.FISCALFUND);
//将2.3.1中查询出的各部门数据进行处理得到部门数据${detailList}(部门编号 部门名称 部门调整后预 算 部门支出 执行率)
List<DeptPo> deptPoList1 = JSONArray.parseArray(data1, DeptPo.class);
if (ObjectUtils.isEmpty(deptPoList1)){
companyDeptMapper.insert(new CompanyDeptPo(companyPo.getCompanyName(),FundTypeEnum.FISCALFUND.getIndex(),year,month,new BigDecimal(0),new BigDecimal(0),new BigDecimal(0),new BigDecimal(0),new BigDecimal(0),""));
}else {
for (DeptPo deptPo : deptPoList1) {
deptPo.setChangedAppropAmount();
deptPo.setImplementRate();
}
//根据token和${systemId},${year},${month},${summaryType},FixedList[{"index":3,"codes":["01"]}] 生成查询条件 根据url查询去年当前时间每个单位的各部门预算
//查询数据库中是否存在去年的数据 若存在 则取数据库的值 若不存在 则调接口查询
List<CompanyDeptPo> companyDeptPos3 = companyDeptMapper.selectList(new QueryWrapper<CompanyDeptPo>().eq("year", year - 1).eq("month", month).eq("company_name", companyPo.getCompanyName()).eq("fund_type", FundTypeEnum.FISCALFUND.getIndex()));
List<DeptPo> lastYearDeptPoList1 = new ArrayList<>();
if (ObjectUtils.isEmpty(companyDeptPos3)){
//根据token和${systemId},${year},${month},${summaryType}生成查询条件 根据url查询去年当前时间每个单位的各部门预算
lastYearDeptPoList1 = JSONArray.parseArray(getData(companyPo,year-1,FundTypeEnum.FISCALFUND), DeptPo.class);
for (DeptPo deptPo : lastYearDeptPoList1) {
deptPo.setChangedAppropAmount();
deptPo.setImplementRate();
}
}else {
lastYearDeptPoList1 = JSONArray.parseArray(companyDeptPos3.get(0).getData(), DeptPo.class);
}
//根据查询结果 进行数据处理 得出该单位的预算总额${budgetTotal},调整后的预算总额${changedBudgetTotal} ,预算总额相比于去年新增多少${differenceBudgetTotal},支出总额${expendTotal},执行率${implementRate} 并和单位名称${companyName}, 资金性质${fundType}(2), ${year} ,${month}, ${detailList} 添加到${companyDept}中
CompanyDeptPo companyDeptPo1 = new CompanyDeptPo();
companyDeptPo1.setCompanyName(companyPo.getCompanyName());
companyDeptPo1.setFundType(FundTypeEnum.FISCALFUND.getIndex());
companyDeptPo1.setYear(year);
companyDeptPo1.setMonth(month);
companyDeptPo1.setBudgetTotal(deptPoList1.stream().map(DeptPo::getAppropAmount).reduce(BigDecimal.ZERO, BigDecimal::add));
companyDeptPo1.setChangedBudgetTotal(deptPoList1.stream().map(DeptPo::getChangedAppropAmount).reduce(BigDecimal.ZERO, BigDecimal::add));
companyDeptPo1.setDifferenceBudgetTotal(deptPoList1.stream().map(DeptPo::getAppropAmount).reduce(BigDecimal.ZERO, BigDecimal::add).subtract(lastYearDeptPoList1.stream().map(DeptPo::getAppropAmount).reduce(BigDecimal.ZERO, BigDecimal::add)));
companyDeptPo1.setExpendTotal(deptPoList1.stream().map(DeptPo::getExpendAmount).reduce(BigDecimal.ZERO, BigDecimal::add));
companyDeptPo1.setImplementRate();
companyDeptPo1.setData(data1);
//将${companyDept}保存到数据库tb_company_dept中
//查询数据库中是否存在该月份的数据 若存在 则更新数据 若不存在 则上传数据
List<CompanyDeptPo> companyDeptPos1 = companyDeptMapper.selectList(new QueryWrapper<CompanyDeptPo>().eq("company_name", companyPo.getCompanyName()).eq("year", year).eq("month", month).eq("fund_type", companyDeptPo1.getFundType()));
if (ObjectUtils.isEmpty(companyDeptPos1)){
companyDeptMapper.insert(companyDeptPo1);
}else {
companyDeptMapper.update(companyDeptPo1,new QueryWrapper<CompanyDeptPo>().eq("company_name", companyPo.getCompanyName()).eq("year", year).eq("month", month).eq("fund_type", companyDeptPo1.getFundType()));
}
}*/
}
}
......
......@@ -149,53 +149,6 @@ public class CompanyFundServiceImpl implements CompanyFundService {
for (CompanyPo companyPo : companyPos) {
saveBudget(companyPo,year,FundTypeEnum.ALLFUND);
saveBudget(companyPo,year,FundTypeEnum.FISCALFUND);
/*//查询财政资金
//根据token和${systemId},${year},${month},${summaryType=1},FixedList[{"index":3,"codes":["01"]}] 生成查询条件 根据url查询当前时间每个单位的各部门预算
String data1 = getData(companyPo,year,FundTypeEnum.FISCALFUND);
//将2.3.1中查询出的各部门数据进行处理得到部门数据${detailList}(部门编号 部门名称 部门调整后预 算 部门支出 执行率)
List<FundPo> result1 = JSONArray.parseArray(data1, FundPo.class);
if (ObjectUtils.isEmpty(result1)){
companyFundMapper.insert(new CompanyFundPo(companyPo.getCompanyName(),FundTypeEnum.FISCALFUND.getIndex(),year,new BigDecimal(0),new BigDecimal(0),new BigDecimal(0),new BigDecimal(0),new BigDecimal(0),""));
}else {
List<FundPo> fundPoList1 = merge(result1);
for (FundPo fundPo : fundPoList1) {
fundPo.setChangedAppropAmount();
fundPo.setImplementRate();
}
//根据token和${systemId},${year},${month},${summaryType},FixedList[{"index":3,"codes":["01"]}] 生成查询条件 根据url查询去年当前时间每个单位的各部门预算
//查询数据库中是否存在去年的数据 若存在 则取数据库的值 若不存在 则调接口查询
List<CompanyFundPo> companyFundPoList1 = companyFundMapper.selectList(new QueryWrapper<CompanyFundPo>().eq("year", year - 1).eq("company_name", companyPo.getCompanyName()).eq("fund_type", FundTypeEnum.FISCALFUND.getIndex()));
List<FundPo> lastYearFundPoList1 = new ArrayList<>();
if (ObjectUtils.isEmpty(companyFundPoList1)){
//根据token和${systemId},${year},${month},${summaryType}生成查询条件 根据url查询去年当前时间每个单位的各部门预算
lastYearFundPoList1 = merge(JSONArray.parseArray(getData(companyPo,year-1,FundTypeEnum.FISCALFUND), FundPo.class));
for (FundPo fundPo : lastYearFundPoList1) {
fundPo.setChangedAppropAmount();
fundPo.setImplementRate();
}
}else {
lastYearFundPoList1 = merge(JSONArray.parseArray(companyFundPoList1.get(0).getData(), FundPo.class));
}
//根据查询结果 进行数据处理 得出该单位的预算总额${budgetTotal},调整后的预算总额${changedBudgetTotal} ,预算总额相比于去年新增多少${differenceBudgetTotal},支出总额${expendTotal},执行率${implementRate} 并和单位名称${companyName}, 资金性质${fundType}(2), ${year} ,${month}, ${detailList} 添加到${companyDept}中
CompanyFundPo companyFundPo1 = new CompanyFundPo();
companyFundPo1.setCompanyName(companyPo.getCompanyName());
companyFundPo1.setFundType(FundTypeEnum.FISCALFUND.getIndex());
companyFundPo1.setYear(year);
companyFundPo1.setBudgetTotal(fundPoList1.stream().map(FundPo::getAppropAmount).reduce(BigDecimal.ZERO, BigDecimal::add));
companyFundPo1.setChangedBudgetTotal(fundPoList1.stream().map(FundPo::getChangedAppropAmount).reduce(BigDecimal.ZERO, BigDecimal::add));
companyFundPo1.setDifferenceBudgetTotal(fundPoList1.stream().map(FundPo::getAppropAmount).reduce(BigDecimal.ZERO, BigDecimal::add).subtract(lastYearFundPoList1.stream().map(FundPo::getAppropAmount).reduce(BigDecimal.ZERO, BigDecimal::add)));
companyFundPo1.setExpendTotal(fundPoList1.stream().map(FundPo::getExpendAmount).reduce(BigDecimal.ZERO, BigDecimal::add));
companyFundPo1.setImplementRate();
companyFundPo1.setData(data);
//2.3.5 将${companyDept}保存到数据库tb_company_dept中
//查询数据库中是否存在该数据 若存在 则更新数据 若不存在 则上传数据
List<CompanyFundPo> companyFundPoList2 = companyFundMapper.selectList(new QueryWrapper<CompanyFundPo>().eq("company_name", companyPo.getCompanyName()).eq("year", year).eq("fund_type", companyFundPo1.getFundType()));
if (ObjectUtils.isEmpty(companyFundPoList2)){
companyFundMapper.insert(companyFundPo1);
}else {
companyFundMapper.update(companyFundPo1,new QueryWrapper<CompanyFundPo>().eq("company_name", companyPo.getCompanyName()).eq("year", year).eq("fund_type", companyFundPo1.getFundType()));
}
}*/
}
}
......
......@@ -175,52 +175,6 @@ public class OfficialBusinessServiceImpl implements OfficialBusinessService {
for (CompanyPo companyPo : companyPos) {
saveBudget(companyPo,year,FundTypeEnum.ALLFUND);
saveBudget(companyPo,year,FundTypeEnum.FISCALFUND);
/*//查询财政资金
//根据token和${systemId},${year},${month},${summaryType=1},FixedList[{"index":3,"codes":["01"]}] 生成查询条件 根据url查询当前时间每个单位的各部门预算
String data1 = getData(companyPo,year,FundTypeEnum.FISCALFUND);
//将2.3.1中查询出的各部门数据进行处理得到部门数据${detailList}(部门编号 部门名称 部门调整后预 算 部门支出 执行率)
List<CostPo> costPoList1 = JSONArray.parseArray(data1, CostPo.class);
if (ObjectUtils.isEmpty(costPoList1)){
officialBusinessMapper.insert(new OfficialBusinessPo(companyPo.getCompanyName(),FundTypeEnum.FISCALFUND.getIndex(),year,new BigDecimal(0),new BigDecimal(0),new BigDecimal(0),new BigDecimal(0),new BigDecimal(0),""));
}else {
for (CostPo costPo : costPoList1) {
costPo.setChangedAppropAmount();
costPo.setImplementRate();
}
//根据token和${systemId},${year},${month},${summaryType},FixedList[{"index":3,"codes":["01"]}] 生成查询条件 根据url查询去年当前时间每个单位的各部门预算
//查询数据库中是否存在去年的数据 若存在 则取数据库的值 若不存在 则调接口查询
List<OfficialBusinessPo> officialBusinessPoList3 = officialBusinessMapper.selectList(new QueryWrapper<OfficialBusinessPo>().eq("year", year - 1).eq("company_name", companyPo.getCompanyName()).eq("fund_type", FundTypeEnum.FISCALFUND.getIndex()));
List<CostPo> lastYearCostPoList1 = new ArrayList<>();
if (ObjectUtils.isEmpty(officialBusinessPoList3)){
//根据token和${systemId},${year},${month},${summaryType}生成查询条件 根据url查询去年当前时间每个单位的各部门预算
lastYearCostPoList1 = JSONArray.parseArray(getData(companyPo,year-1,FundTypeEnum.FISCALFUND), CostPo.class);
for (CostPo costPo : lastYearCostPoList1) {
costPo.setChangedAppropAmount();
costPo.setImplementRate();
}
}else {
lastYearCostPoList1 = JSONArray.parseArray(officialBusinessPoList3.get(0).getData(), CostPo.class);
}
//根据查询结果 进行数据处理 得出该单位的预算总额${budgetTotal},调整后的预算总额${changedBudgetTotal} ,预算总额相比于去年新增多少${differenceBudgetTotal},支出总额${expendTotal},执行率${implementRate} 并和单位名称${companyName}, 资金性质${fundType}(2), ${year} ,${month}, ${detailList} 添加到${companyDept}中
OfficialBusinessPo officialBusinessPo1 = new OfficialBusinessPo();
officialBusinessPo1.setCompanyName(companyPo.getCompanyName());
officialBusinessPo1.setFundType(FundTypeEnum.FISCALFUND.getIndex());
officialBusinessPo1.setYear(year);
officialBusinessPo1.setBudgetTotal(costPoList1.stream().map(CostPo::getControlAmount).reduce(BigDecimal.ZERO, BigDecimal::add));
officialBusinessPo1.setChangedBudgetTotal(costPoList1.stream().map(CostPo::getChangedAppropAmount).reduce(BigDecimal.ZERO, BigDecimal::add));
officialBusinessPo1.setDifferenceBudgetTotal(costPoList1.stream().map(CostPo::getControlAmount).reduce(BigDecimal.ZERO, BigDecimal::add).subtract(lastYearCostPoList1.stream().map(CostPo::getControlAmount).reduce(BigDecimal.ZERO, BigDecimal::add)));
officialBusinessPo1.setExpendTotal(costPoList1.stream().map(CostPo::getUsedAmount).reduce(BigDecimal.ZERO, BigDecimal::add));
officialBusinessPo1.setImplementRate();
officialBusinessPo1.setData(data);
//将${officialBusinessPo1}保存到数据库
//查询数据库中是否存在该月份的数据 若存在 则更新数据 若不存在 则上传数据
List<OfficialBusinessPo> officialBusinessPoList1 = officialBusinessMapper.selectList(new QueryWrapper<OfficialBusinessPo>().eq("company_name", companyPo.getCompanyName()).eq("year", year).eq("fund_type", officialBusinessPo1.getFundType()));
if (ObjectUtils.isEmpty(officialBusinessPoList1)){
officialBusinessMapper.insert(officialBusinessPo1);
}else {
officialBusinessMapper.update(officialBusinessPo1,new QueryWrapper<OfficialBusinessPo>().eq("company_name", companyPo.getCompanyName()).eq("year", year).eq("fund_type", officialBusinessPo1.getFundType()));
}
}*/
}
}
......
......@@ -171,96 +171,6 @@ public class TaskListServiceImpl implements TaskListService {
for (CompanyPo companyPo : companyPos) {
saveBudget(companyPo,year,FundTypeEnum.ALLFUND);
saveBudget(companyPo,year,FundTypeEnum.FISCALFUND);
/*//查询财政资金
//根据token和${systemId},${year},${month},${summaryType=1},FixedList[{"index":3,"codes":["01"]}] 生成查询条件 根据url查询当前时间每个单位的各部门预算
String data3 = getData(companyPo,year,FundTypeEnum.FISCALFUND,"01");
String data4 = getData(companyPo,year,FundTypeEnum.FISCALFUND,"02");
Boolean flag3 = false;
Boolean flag4 = false;
//将2.3.1中查询出的各部门数据进行处理得到部门数据${detailList}(部门编号 部门名称 部门调整后预 算 部门支出 执行率)
List<ProjectPo> projectPoList3 = JSONArray.parseArray(data3, ProjectPo.class);
if (ObjectUtils.isEmpty(projectPoList3)){
flag3 = true;
}else {
for (ProjectPo projectPo : projectPoList3) {
projectPo.setAppropAmount(projectPo.getAppropAmount());
projectPo.setChangeAppropAmount(projectPo.getChangeAppropAmount());
projectPo.setExpendAmount(projectPo.getExpendAmount());
projectPo.setChangedAppropAmount();
projectPo.setImplementRate();
projectPo.setFixedQuota();
projectPo.setFloatingQuota(new BigDecimal(0));
}
}
List<ProjectPo> projectPoList4 = JSONArray.parseArray(data4, ProjectPo.class);
if (ObjectUtils.isEmpty(projectPoList2)){
flag4 = true;
}else {
for (ProjectPo projectPo : projectPoList4) {
projectPo.setAppropAmount(projectPo.getAppropAmount());
projectPo.setChangeAppropAmount(projectPo.getChangeAppropAmount());
projectPo.setExpendAmount(projectPo.getExpendAmount());
projectPo.setChangedAppropAmount();
projectPo.setImplementRate();
projectPo.setFloatingQuota();
projectPo.setFixedQuota(new BigDecimal(0));
}
}
if (flag3 & flag4){
taskListMapper.insert(new TaskListPo(companyPo.getCompanyName(),FundTypeEnum.FISCALFUND.getIndex(),year,new BigDecimal(0),new BigDecimal(0),new BigDecimal(0),new BigDecimal(0),new BigDecimal(0),new BigDecimal(0),new BigDecimal(0),""));
}else {
projectPoList3.addAll(projectPoList4);
//根据token和${systemId},${year},${month},${summaryType},FixedList[{"index":3,"codes":["01"]}] 生成查询条件 根据url查询去年当前时间每个单位的各部门预算
//查询数据库中是否存在去年的数据 若存在 则取数据库的值 若不存在 则调接口查询
List<TaskListPo> taskListPoList = taskListMapper.selectList(new QueryWrapper<TaskListPo>().eq("year", year - 1).eq("company_name", companyPo.getCompanyName()).eq("fund_type", FundTypeEnum.FISCALFUND.getIndex()));
List<ProjectPo> lastYearFundPoList3 = new ArrayList<>();
List<ProjectPo> lastYearFundPoList4 = new ArrayList<>();
List<ProjectPo> lastYearFundPoList9 = new ArrayList<>();
if (ObjectUtils.isEmpty(taskListPoList)){
//根据token和${systemId},${year},${month},${summaryType}生成查询条件 根据url查询去年当前时间每个单位的各部门预算 固定额度
lastYearFundPoList3 = JSONArray.parseArray(getData(companyPo,year-1,FundTypeEnum.FISCALFUND,"01"), ProjectPo.class);
for (ProjectPo projectPo : lastYearFundPoList3) {
projectPo.setAppropAmount(projectPo.getAppropAmount());
projectPo.setChangeAppropAmount(projectPo.getChangeAppropAmount());
projectPo.setExpendAmount(projectPo.getExpendAmount());
projectPo.setChangedAppropAmount();
projectPo.setImplementRate();
}
lastYearFundPoList4 = JSONArray.parseArray(getData(companyPo,year-1,FundTypeEnum.FISCALFUND,"02"), ProjectPo.class);
for (ProjectPo projectPo: lastYearFundPoList4) {
projectPo.setAppropAmount(projectPo.getAppropAmount());
projectPo.setChangeAppropAmount(projectPo.getChangeAppropAmount());
projectPo.setExpendAmount(projectPo.getExpendAmount());
projectPo.setChangedAppropAmount();
projectPo.setImplementRate();
}
lastYearFundPoList3.addAll(lastYearFundPoList4);
lastYearFundPoList9 = lastYearFundPoList3;
}else {
lastYearFundPoList9 = JSONArray.parseArray(taskListPoList.get(0).getData(), ProjectPo.class);
}
//根据查询结果 进行数据处理 得出该单位的预算总额${budgetTotal},调整后的预算总额${changedBudgetTotal} ,预算总额相比于去年新增多少${differenceBudgetTotal},支出总额${expendTotal},执行率${implementRate} 并和单位名称${companyName}, 资金性质${fundType}(2), ${year} ,${month}, ${detailList} 添加到${companyDept}中
TaskListPo taskListPo2 = new TaskListPo();
taskListPo2.setCompanyName(companyPo.getCompanyName());
taskListPo2.setFundType(FundTypeEnum.FISCALFUND.getIndex());
taskListPo2.setYear(year);
taskListPo2.setBudgetTotal(projectPoList3.stream().map(ProjectPo::getAppropAmount).reduce(BigDecimal.ZERO, BigDecimal::add));
taskListPo2.setChangedBudgetTotal(projectPoList3.stream().map(ProjectPo::getChangedAppropAmount).reduce(BigDecimal.ZERO, BigDecimal::add));
taskListPo2.setDifferenceBudgetTotal(projectPoList3.stream().map(ProjectPo::getAppropAmount).reduce(BigDecimal.ZERO, BigDecimal::add).subtract(lastYearFundPoList9.stream().map(ProjectPo::getAppropAmount).reduce(BigDecimal.ZERO, BigDecimal::add)));
taskListPo2.setExpendTotal(projectPoList3.stream().map(ProjectPo::getExpendAmount).reduce(BigDecimal.ZERO, BigDecimal::add));
taskListPo2.setFixedQuota(projectPoList3.stream().map(ProjectPo::getFixedQuota).reduce(BigDecimal.ZERO, BigDecimal::add));
taskListPo2.setFloatingQuota(projectPoList3.stream().map(ProjectPo::getFloatingQuota).reduce(BigDecimal.ZERO, BigDecimal::add));
taskListPo2.setImplementRate();
taskListPo2.setData(JSON.toJSONString(projectPoList3));
//2.3.5 将${companyDept}保存到数据库tb_company_dept中
//查询数据库中是否存在该数据 若存在 则更新数据 若不存在 则上传数据
List<TaskListPo> taskListPoList2 = taskListMapper.selectList(new QueryWrapper<TaskListPo>().eq("company_name", companyPo.getCompanyName()).eq("year", year).eq("fund_type", taskListPo2.getFundType()));
if (ObjectUtils.isEmpty(taskListPoList2)){
taskListMapper.insert(taskListPo2);
}else {
taskListMapper.update(taskListPo2,new QueryWrapper<TaskListPo>().eq("company_name", companyPo.getCompanyName()).eq("year", year).eq("fund_type", taskListPo2.getFundType()));
}
}*/
}
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment