|
@@ -7,11 +7,8 @@ import org.jeecg.common.system.api.ISysBaseAPI;
|
|
|
import org.jeecg.common.system.vo.LoginUser;
|
|
|
import org.jeecg.common.util.DateUtils;
|
|
|
import org.jeecg.common.util.RedisUtil;
|
|
|
-import org.jeecg.modules.Index.entity.vo.ResultEightCost;
|
|
|
-import org.jeecg.modules.Index.entity.vo.EightCosts;
|
|
|
-import org.jeecg.modules.Index.entity.vo.IndexTotalVo;
|
|
|
+import org.jeecg.modules.Index.entity.vo.*;
|
|
|
import org.jeecg.modules.Index.entity.dto.IndexInfoParamDto;
|
|
|
-import org.jeecg.modules.Index.entity.vo.IndexChartInfoVo;
|
|
|
import org.jeecg.modules.Index.mapper.IndexZcbMapper;
|
|
|
import org.jeecg.modules.Index.service.IndexZcbService;
|
|
|
import org.jeecg.modules.Index.util.AuthMark;
|
|
@@ -42,10 +39,6 @@ public class IndexZcbServiceImpl implements IndexZcbService {
|
|
|
@SuppressWarnings("all")
|
|
|
private IndexZcbMapper indexZcbMapper;
|
|
|
|
|
|
- //@Autowired
|
|
|
- //@SuppressWarnings("all")
|
|
|
- //private RedisTemplate<String,String> redisTemplate;
|
|
|
-
|
|
|
@Autowired
|
|
|
@SuppressWarnings("all")
|
|
|
private RedisUtil redisUtil;
|
|
@@ -467,6 +460,7 @@ public class IndexZcbServiceImpl implements IndexZcbService {
|
|
|
List<EightCosts> e1 = indexZcbMapper.getEightCostDepartByDate(beginDate, endDate, pcList);
|
|
|
if (!ObjectUtil.isEmpty(e1)){
|
|
|
HashMap<String, BigDecimal> m = new HashMap<>();
|
|
|
+ BigDecimal sumZcb = BigDecimal.valueOf(0);
|
|
|
for (EightCosts e:e1) {
|
|
|
m.put("clf",e.getClf());
|
|
|
m.put("zyf",e.getZyf());
|
|
@@ -476,6 +470,7 @@ public class IndexZcbServiceImpl implements IndexZcbService {
|
|
|
m.put("gdzczj",e.getGdzczj());
|
|
|
m.put("gzjlwf",e.getGzjlwf());
|
|
|
m.put("glf",e.getGlf());
|
|
|
+ sumZcb = e.getClf().add(e.getZyf()).add(e.getSwf()).add(e.getWxf()).add(e.getRldlf()).add(e.getGdzczj()).add(e.getGzjlwf()).add(e.getGlf());
|
|
|
}
|
|
|
Map<String, BigDecimal> sortedMap = m.entrySet()
|
|
|
.stream()
|
|
@@ -484,8 +479,10 @@ public class IndexZcbServiceImpl implements IndexZcbService {
|
|
|
(oldValue, newValue) -> oldValue, LinkedHashMap::new));
|
|
|
|
|
|
for (Map.Entry<String, BigDecimal> entry : sortedMap.entrySet()) {
|
|
|
+ BigDecimal divide = entry.getValue().divide(sumZcb, 2, BigDecimal.ROUND_HALF_UP);
|
|
|
+ BigDecimal mul = divide.multiply(BigDecimal.valueOf(100));
|
|
|
ResultEightCost resultEightCost = new ResultEightCost();
|
|
|
- resultEightCost.setName(entry.getKey());
|
|
|
+ resultEightCost.setName(entry.getKey()+"-"+mul+"%");
|
|
|
resultEightCost.setValue(entry.getValue());
|
|
|
resultList.add(resultEightCost);
|
|
|
}
|
|
@@ -497,6 +494,7 @@ public class IndexZcbServiceImpl implements IndexZcbService {
|
|
|
List<EightCosts> e2 = indexZcbMapper.getEightCostZrDepartByDate(deptList, beginDate, endDate,pcList);
|
|
|
if (e1.size() > 0 && e2.size() == 0){
|
|
|
HashMap<String, BigDecimal> m = new HashMap<>();
|
|
|
+ BigDecimal sumZcb = BigDecimal.valueOf(0);
|
|
|
for (EightCosts e:e1) {
|
|
|
m.put("clf",e.getClf());
|
|
|
m.put("zyf",e.getZyf());
|
|
@@ -506,6 +504,7 @@ public class IndexZcbServiceImpl implements IndexZcbService {
|
|
|
m.put("gdzczj",e.getGdzczj());
|
|
|
m.put("gzjlwf",e.getGzjlwf());
|
|
|
m.put("glf",e.getGlf());
|
|
|
+ sumZcb = e.getClf().add(e.getZyf()).add(e.getSwf()).add(e.getWxf()).add(e.getRldlf()).add(e.getGdzczj()).add(e.getGzjlwf()).add(e.getGlf());
|
|
|
}
|
|
|
Map<String, BigDecimal> sortedMap = m.entrySet()
|
|
|
.stream()
|
|
@@ -514,14 +513,17 @@ public class IndexZcbServiceImpl implements IndexZcbService {
|
|
|
(oldValue, newValue) -> oldValue, LinkedHashMap::new));
|
|
|
|
|
|
for (Map.Entry<String, BigDecimal> entry : sortedMap.entrySet()) {
|
|
|
+ BigDecimal divide = entry.getValue().divide(sumZcb, 2, BigDecimal.ROUND_HALF_UP);
|
|
|
+ BigDecimal mul = divide.multiply(BigDecimal.valueOf(100));
|
|
|
ResultEightCost resultEightCost = new ResultEightCost();
|
|
|
- resultEightCost.setName(entry.getKey());
|
|
|
+ resultEightCost.setName(entry.getKey()+"-"+mul+"%");
|
|
|
resultEightCost.setValue(entry.getValue());
|
|
|
resultList.add(resultEightCost);
|
|
|
}
|
|
|
}
|
|
|
if (e1.size() == 0 && e2.size() > 0){
|
|
|
HashMap<String, BigDecimal> m = new HashMap<>();
|
|
|
+ BigDecimal sumZcb = BigDecimal.valueOf(0);
|
|
|
for (EightCosts e:e2) {
|
|
|
m.put("clf",e.getClf());
|
|
|
m.put("zyf",e.getZyf());
|
|
@@ -531,6 +533,7 @@ public class IndexZcbServiceImpl implements IndexZcbService {
|
|
|
m.put("gdzczj",e.getGdzczj());
|
|
|
m.put("gzjlwf",e.getGzjlwf());
|
|
|
m.put("glf",e.getGlf());
|
|
|
+ sumZcb = e.getClf().add(e.getZyf()).add(e.getSwf()).add(e.getWxf()).add(e.getRldlf()).add(e.getGdzczj()).add(e.getGzjlwf()).add(e.getGlf());
|
|
|
}
|
|
|
Map<String, BigDecimal> sortedMap = m.entrySet()
|
|
|
.stream()
|
|
@@ -539,8 +542,10 @@ public class IndexZcbServiceImpl implements IndexZcbService {
|
|
|
(oldValue, newValue) -> oldValue, LinkedHashMap::new));
|
|
|
|
|
|
for (Map.Entry<String, BigDecimal> entry : sortedMap.entrySet()) {
|
|
|
+ BigDecimal divide = entry.getValue().divide(sumZcb, 2, BigDecimal.ROUND_HALF_UP);
|
|
|
+ BigDecimal mul = divide.multiply(BigDecimal.valueOf(100));
|
|
|
ResultEightCost resultEightCost = new ResultEightCost();
|
|
|
- resultEightCost.setName(entry.getKey());
|
|
|
+ resultEightCost.setName(entry.getKey()+"-"+mul+"%");
|
|
|
resultEightCost.setValue(entry.getValue());
|
|
|
resultList.add(resultEightCost);
|
|
|
}
|
|
@@ -562,6 +567,7 @@ public class IndexZcbServiceImpl implements IndexZcbService {
|
|
|
eightCostsList.add(eightCosts);
|
|
|
}
|
|
|
HashMap<String, BigDecimal> m = new HashMap<>();
|
|
|
+ BigDecimal sumZcb = BigDecimal.valueOf(0);
|
|
|
for (EightCosts e:eightCostsList) {
|
|
|
m.put("clf",e.getClf());
|
|
|
m.put("zyf",e.getZyf());
|
|
@@ -571,6 +577,7 @@ public class IndexZcbServiceImpl implements IndexZcbService {
|
|
|
m.put("gdzczj",e.getGdzczj());
|
|
|
m.put("gzjlwf",e.getGzjlwf());
|
|
|
m.put("glf",e.getGlf());
|
|
|
+ sumZcb = e.getClf().add(e.getZyf()).add(e.getSwf()).add(e.getWxf()).add(e.getRldlf()).add(e.getGdzczj()).add(e.getGzjlwf()).add(e.getGlf());
|
|
|
}
|
|
|
Map<String, BigDecimal> sortedMap = m.entrySet()
|
|
|
.stream()
|
|
@@ -579,8 +586,10 @@ public class IndexZcbServiceImpl implements IndexZcbService {
|
|
|
(oldValue, newValue) -> oldValue, LinkedHashMap::new));
|
|
|
|
|
|
for (Map.Entry<String, BigDecimal> entry : sortedMap.entrySet()) {
|
|
|
+ BigDecimal divide = entry.getValue().divide(sumZcb, 2, BigDecimal.ROUND_HALF_UP);
|
|
|
+ BigDecimal mul = divide.multiply(BigDecimal.valueOf(100));
|
|
|
ResultEightCost resultEightCost = new ResultEightCost();
|
|
|
- resultEightCost.setName(entry.getKey());
|
|
|
+ resultEightCost.setName(entry.getKey()+"-"+mul+"%");
|
|
|
resultEightCost.setValue(entry.getValue());
|
|
|
resultList.add(resultEightCost);
|
|
|
}
|
|
@@ -606,7 +615,7 @@ public class IndexZcbServiceImpl implements IndexZcbService {
|
|
|
|
|
|
for (Map.Entry<String, BigDecimal> entry : sortedMap.entrySet()) {
|
|
|
ResultEightCost resultEightCost = new ResultEightCost();
|
|
|
- resultEightCost.setName(entry.getKey());
|
|
|
+ resultEightCost.setName(entry.getKey()+"-0%");
|
|
|
resultEightCost.setValue(entry.getValue());
|
|
|
resultList.add(resultEightCost);
|
|
|
}
|
|
@@ -621,6 +630,7 @@ public class IndexZcbServiceImpl implements IndexZcbService {
|
|
|
List<EightCosts> e1 = indexZcbMapper.getEightCostDepartByDate(beginDate, endDate, pcList);
|
|
|
if (!ObjectUtil.isEmpty(e1)){
|
|
|
HashMap<String, BigDecimal> m = new HashMap<>();
|
|
|
+ BigDecimal sumZcb = BigDecimal.valueOf(0);
|
|
|
for (EightCosts e:e1) {
|
|
|
m.put("clf",e.getClf());
|
|
|
m.put("zyf",e.getZyf());
|
|
@@ -630,6 +640,7 @@ public class IndexZcbServiceImpl implements IndexZcbService {
|
|
|
m.put("gdzczj",e.getGdzczj());
|
|
|
m.put("gzjlwf",e.getGzjlwf());
|
|
|
m.put("glf",e.getGlf());
|
|
|
+ sumZcb = e.getClf().add(e.getZyf()).add(e.getSwf()).add(e.getWxf()).add(e.getRldlf()).add(e.getGdzczj()).add(e.getGzjlwf()).add(e.getGlf());
|
|
|
}
|
|
|
Map<String, BigDecimal> sortedMap = m.entrySet()
|
|
|
.stream()
|
|
@@ -638,8 +649,10 @@ public class IndexZcbServiceImpl implements IndexZcbService {
|
|
|
(oldValue, newValue) -> oldValue, LinkedHashMap::new));
|
|
|
|
|
|
for (Map.Entry<String, BigDecimal> entry : sortedMap.entrySet()) {
|
|
|
+ BigDecimal divide = entry.getValue().divide(sumZcb, 2, BigDecimal.ROUND_HALF_UP);
|
|
|
+ BigDecimal mul = divide.multiply(BigDecimal.valueOf(100));
|
|
|
ResultEightCost resultEightCost = new ResultEightCost();
|
|
|
- resultEightCost.setName(entry.getKey());
|
|
|
+ resultEightCost.setName(entry.getKey()+"-"+mul+"%");
|
|
|
resultEightCost.setValue(entry.getValue());
|
|
|
resultList.add(resultEightCost);
|
|
|
}
|
|
@@ -650,6 +663,7 @@ public class IndexZcbServiceImpl implements IndexZcbService {
|
|
|
List<EightCosts> e2 = indexZcbMapper.getEightCostZrDepartByDate(deptList, beginDate, endDate,pcList);
|
|
|
if (e1.size() > 0 && e2.size() == 0){
|
|
|
HashMap<String, BigDecimal> m = new HashMap<>();
|
|
|
+ BigDecimal sumZcb = BigDecimal.valueOf(0);
|
|
|
for (EightCosts e:e1) {
|
|
|
m.put("clf",e.getClf());
|
|
|
m.put("zyf",e.getZyf());
|
|
@@ -659,6 +673,7 @@ public class IndexZcbServiceImpl implements IndexZcbService {
|
|
|
m.put("gdzczj",e.getGdzczj());
|
|
|
m.put("gzjlwf",e.getGzjlwf());
|
|
|
m.put("glf",e.getGlf());
|
|
|
+ sumZcb = e.getClf().add(e.getZyf()).add(e.getSwf()).add(e.getWxf()).add(e.getRldlf()).add(e.getGdzczj()).add(e.getGzjlwf()).add(e.getGlf());
|
|
|
}
|
|
|
Map<String, BigDecimal> sortedMap = m.entrySet()
|
|
|
.stream()
|
|
@@ -667,14 +682,17 @@ public class IndexZcbServiceImpl implements IndexZcbService {
|
|
|
(oldValue, newValue) -> oldValue, LinkedHashMap::new));
|
|
|
|
|
|
for (Map.Entry<String, BigDecimal> entry : sortedMap.entrySet()) {
|
|
|
+ BigDecimal divide = entry.getValue().divide(sumZcb, 2, BigDecimal.ROUND_HALF_UP);
|
|
|
+ BigDecimal mul = divide.multiply(BigDecimal.valueOf(100));
|
|
|
ResultEightCost resultEightCost = new ResultEightCost();
|
|
|
- resultEightCost.setName(entry.getKey());
|
|
|
+ resultEightCost.setName(entry.getKey()+"-"+mul+"%");
|
|
|
resultEightCost.setValue(entry.getValue());
|
|
|
resultList.add(resultEightCost);
|
|
|
}
|
|
|
}
|
|
|
if (e1.size() == 0 && e2.size() > 0){
|
|
|
HashMap<String, BigDecimal> m = new HashMap<>();
|
|
|
+ BigDecimal sumZcb = BigDecimal.valueOf(0);
|
|
|
for (EightCosts e:e2) {
|
|
|
m.put("clf",e.getClf());
|
|
|
m.put("zyf",e.getZyf());
|
|
@@ -684,6 +702,7 @@ public class IndexZcbServiceImpl implements IndexZcbService {
|
|
|
m.put("gdzczj",e.getGdzczj());
|
|
|
m.put("gzjlwf",e.getGzjlwf());
|
|
|
m.put("glf",e.getGlf());
|
|
|
+ sumZcb = e.getClf().add(e.getZyf()).add(e.getSwf()).add(e.getWxf()).add(e.getRldlf()).add(e.getGdzczj()).add(e.getGzjlwf()).add(e.getGlf());
|
|
|
}
|
|
|
Map<String, BigDecimal> sortedMap = m.entrySet()
|
|
|
.stream()
|
|
@@ -692,8 +711,10 @@ public class IndexZcbServiceImpl implements IndexZcbService {
|
|
|
(oldValue, newValue) -> oldValue, LinkedHashMap::new));
|
|
|
|
|
|
for (Map.Entry<String, BigDecimal> entry : sortedMap.entrySet()) {
|
|
|
+ BigDecimal divide = entry.getValue().divide(sumZcb, 2, BigDecimal.ROUND_HALF_UP);
|
|
|
+ BigDecimal mul = divide.multiply(BigDecimal.valueOf(100));
|
|
|
ResultEightCost resultEightCost = new ResultEightCost();
|
|
|
- resultEightCost.setName(entry.getKey());
|
|
|
+ resultEightCost.setName(entry.getKey()+"-"+mul+"%");
|
|
|
resultEightCost.setValue(entry.getValue());
|
|
|
resultList.add(resultEightCost);
|
|
|
}
|
|
@@ -715,6 +736,7 @@ public class IndexZcbServiceImpl implements IndexZcbService {
|
|
|
eightCostsList.add(eightCosts);
|
|
|
}
|
|
|
HashMap<String, BigDecimal> m = new HashMap<>();
|
|
|
+ BigDecimal sumZcb = BigDecimal.valueOf(0);
|
|
|
for (EightCosts e:eightCostsList) {
|
|
|
m.put("clf",e.getClf());
|
|
|
m.put("zyf",e.getZyf());
|
|
@@ -724,6 +746,7 @@ public class IndexZcbServiceImpl implements IndexZcbService {
|
|
|
m.put("gdzczj",e.getGdzczj());
|
|
|
m.put("gzjlwf",e.getGzjlwf());
|
|
|
m.put("glf",e.getGlf());
|
|
|
+ sumZcb = e.getClf().add(e.getZyf()).add(e.getSwf()).add(e.getWxf()).add(e.getRldlf()).add(e.getGdzczj()).add(e.getGzjlwf()).add(e.getGlf());
|
|
|
}
|
|
|
Map<String, BigDecimal> sortedMap = m.entrySet()
|
|
|
.stream()
|
|
@@ -732,8 +755,10 @@ public class IndexZcbServiceImpl implements IndexZcbService {
|
|
|
(oldValue, newValue) -> oldValue, LinkedHashMap::new));
|
|
|
|
|
|
for (Map.Entry<String, BigDecimal> entry : sortedMap.entrySet()) {
|
|
|
+ BigDecimal divide = entry.getValue().divide(sumZcb, 2, BigDecimal.ROUND_HALF_UP);
|
|
|
+ BigDecimal mul = divide.multiply(BigDecimal.valueOf(100));
|
|
|
ResultEightCost resultEightCost = new ResultEightCost();
|
|
|
- resultEightCost.setName(entry.getKey());
|
|
|
+ resultEightCost.setName(entry.getKey()+"-"+mul+"%");
|
|
|
resultEightCost.setValue(entry.getValue());
|
|
|
resultList.add(resultEightCost);
|
|
|
}
|
|
@@ -759,7 +784,7 @@ public class IndexZcbServiceImpl implements IndexZcbService {
|
|
|
|
|
|
for (Map.Entry<String, BigDecimal> entry : sortedMap.entrySet()) {
|
|
|
ResultEightCost resultEightCost = new ResultEightCost();
|
|
|
- resultEightCost.setName(entry.getKey());
|
|
|
+ resultEightCost.setName(entry.getKey()+"-0%");
|
|
|
resultEightCost.setValue(entry.getValue());
|
|
|
resultList.add(resultEightCost);
|
|
|
}
|
|
@@ -881,4 +906,22 @@ public class IndexZcbServiceImpl implements IndexZcbService {
|
|
|
pcList.addAll(pcTasknoSonList);
|
|
|
redisUtil.set("pcList",pcList,1000L * 60 * 60 * 2);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * author: dzc
|
|
|
+ * version: 1.0
|
|
|
+ * des: 支出统计二级汇总
|
|
|
+ * date: 2023/9/24
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public List<ZhiChuCost> getEightCostsInfo(IndexInfoParamDto indexInfoParamDto) {
|
|
|
+ ArrayList<ZhiChuCost> zhiChuCostsList = new ArrayList<>();
|
|
|
+ List<IndexChartInfoVo> chartInfoList = getEightCostsList(indexInfoParamDto);
|
|
|
+ List<ResultEightCost> sumEightCosts = getSumEightCosts(indexInfoParamDto);
|
|
|
+ ZhiChuCost zhiChuCost = new ZhiChuCost();
|
|
|
+ zhiChuCost.setChartInfoList(chartInfoList);
|
|
|
+ zhiChuCost.setEightCostPaiHang(sumEightCosts);
|
|
|
+ zhiChuCostsList.add(zhiChuCost);
|
|
|
+ return zhiChuCostsList;
|
|
|
+ }
|
|
|
}
|