|
|
@@ -1424,8 +1424,24 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
|
|
|
if (e.getOrderNo()!=null){
|
|
|
TOrderPublicReleaseCount out = tOrderPublicReleaseCountMapper.selectByOrderNo(e.getOrderNo());
|
|
|
List<ExpenseAccount> expenseAccounts = expenseAccountMapper.selectByOrderNo(e.getOrderNo());
|
|
|
- BigDecimal reduce = expenseAccounts.stream().map(ExpenseAccount::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
- String str = getString(e, out, reduce);
|
|
|
+ BigDecimal count = BigDecimal.ZERO;
|
|
|
+ BigDecimal yxyCount = BigDecimal.ZERO;
|
|
|
+ BigDecimal zxsCount = BigDecimal.ZERO;
|
|
|
+ BigDecimal qtCount = BigDecimal.ZERO;
|
|
|
+ for (ExpenseAccount ea : expenseAccounts) {
|
|
|
+ count=count.add(ea.getAmount());
|
|
|
+ Admin admin = adminMapper.selectByPrimaryKey(ea.getAid());
|
|
|
+ if (admin.getPosition()!=null){
|
|
|
+ if (admin.getPosition().equals("1")){
|
|
|
+ yxyCount=yxyCount.add(ea.getAmount());
|
|
|
+ }else if (admin.getPosition().equals("2")){
|
|
|
+ zxsCount=zxsCount.add(ea.getAmount());
|
|
|
+ }else {
|
|
|
+ qtCount=qtCount.add(ea.getAmount());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ String str = getString(e, out, count, yxyCount, zxsCount,qtCount);
|
|
|
e.setCountStr(str);
|
|
|
}
|
|
|
}
|
|
|
@@ -1435,13 +1451,28 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
|
|
|
|
|
|
}
|
|
|
|
|
|
- private String getString(SonExpenseAccount e, TOrderPublicReleaseCount out, BigDecimal reduce) {
|
|
|
+ private String getString(SonExpenseAccount e, TOrderPublicReleaseCount out, BigDecimal count, BigDecimal yxyCount, BigDecimal zxsCount, BigDecimal qtCount) {
|
|
|
String maxString=":应公出" + out.getMaxDuration() + "小时";
|
|
|
String actualString=",超过" + out.getExceedDuration() + "(仅统计技术的总工时)小时";
|
|
|
if (out.getMaxDuration().equals(-1d)){
|
|
|
maxString=":不限制公出小时";
|
|
|
actualString=",";
|
|
|
}
|
|
|
+ StringBuilder expenseString=new StringBuilder().append(",报销").append(count.stripTrailingZeros().toPlainString()).append("元");
|
|
|
+ if (yxyCount != null || zxsCount != null||qtCount != null){
|
|
|
+ expenseString.append("(");
|
|
|
+ if (zxsCount != null && zxsCount.compareTo(BigDecimal.ZERO) > 0) {
|
|
|
+ expenseString.append("技术").append(zxsCount.stripTrailingZeros().toPlainString()).append("元,");
|
|
|
+ }
|
|
|
+ if (yxyCount != null && yxyCount.compareTo(BigDecimal.ZERO) > 0){
|
|
|
+ expenseString.append("营销").append(yxyCount.stripTrailingZeros().toPlainString()).append("元,");
|
|
|
+ }
|
|
|
+ if (qtCount != null && qtCount.compareTo(BigDecimal.ZERO) > 0){
|
|
|
+ expenseString.append("其他").append(qtCount.stripTrailingZeros().toPlainString()).append("元,");
|
|
|
+ }
|
|
|
+ expenseString.deleteCharAt(expenseString.length() - 1);
|
|
|
+ expenseString.append(")");
|
|
|
+ }
|
|
|
if (out.getActualDuration()<=out.getMaxDuration()){
|
|
|
actualString=",";
|
|
|
}
|
|
|
@@ -1450,8 +1481,7 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
|
|
|
",已" + out.getPeopleCount() + "人公出," +
|
|
|
out.getFrequency() + "次" +
|
|
|
"," + out.getActualDuration() + "小时" +
|
|
|
- actualString+
|
|
|
- "已报销" + reduce.stripTrailingZeros().toPlainString() + "元";
|
|
|
+ actualString+expenseString;
|
|
|
}
|
|
|
|
|
|
|