Browse Source

报销列表BUG修复

anderx 1 year ago
parent
commit
5c429d52ee

+ 8 - 0
src/main/java/com/goafanti/weChat/controller/AdminReleaseApiController.java

@@ -268,6 +268,14 @@ public class AdminReleaseApiController extends CertifyApiController{
 		return res;
 	}
 
+
+	@RequestMapping(value = "/publicReleaseAndCount", method = RequestMethod.GET)
+	public Result publicReleaseAndCount(InputPublicDtails in){
+		Result res =new Result();
+		res.data(publicReleaseService.publicReleaseAndCount(in));
+		return res;
+	}
+
 	/**
 	 * 公出详情列表
 	 * @return

+ 4 - 2
src/main/java/com/goafanti/weChat/service/PublicReleaseService.java

@@ -1,10 +1,10 @@
 package com.goafanti.weChat.service;
 
+import com.goafanti.weChat.bo.*;
+
 import java.util.List;
 import java.util.Map;
 
-import com.goafanti.weChat.bo.*;
-
 public interface PublicReleaseService {
 
 	Map<String, Object> addPublicRelease(InputPublicRelease in);
@@ -62,4 +62,6 @@ public interface PublicReleaseService {
 	boolean checkaddAssistant(Integer id, String aid);
 
     int updateLocation(InputPublicRelease in);
+
+	Object publicReleaseAndCount(InputPublicDtails in);
 }

+ 43 - 0
src/main/java/com/goafanti/weChat/service/impl/PublicReleaseServiceImpl.java

@@ -27,6 +27,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.socket.TextMessage;
 
+import java.math.BigDecimal;
 import java.text.ParseException;
 import java.util.*;
 import java.util.concurrent.atomic.AtomicReference;
@@ -1441,5 +1442,47 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 		return publicReleaseDetailsMapper.updateByPrimaryKeySelective(updateprd);
 	}
 
+	@Override
+	public Object publicReleaseAndCount(InputPublicDtails in) {
+		List<OutPublicDtails> list = publicReleaseListDtailsList(in);
+		//公出次数
+		int count=0;
+		BigDecimal durationCount=BigDecimal.ZERO;
+		List<String> aList =new ArrayList<>();
+		for (OutPublicDtails e : list) {
+			if (e.getType()==0||e.getType()==1||e.getType()==2){
+				count++;
+				durationCount=durationCount.add(new BigDecimal(e.getDuration()));
+				if (!aList.contains(e.getAname())){
+					aList.add(e.getAname());
+				}
+				if (StringUtils.isNotEmpty(e.getAssistAidName())){
+					String[] split = e.getAssistAidName().split(",");
+					for (String s : split) {
+						if (!aList.contains(s)){
+							aList.add(s);
+						}
+					}
+				}
+				if (StringUtils.isNotEmpty(e.getAssistantName())){
+					String[] split = e.getAssistantName().split(",");
+					for (String s : split) {
+						if (!aList.contains(s)){
+							aList.add(s);
+						}
+					}
+				}
+			}
+
+
+		}
+		Map<String,Object> map=new HashMap<String, Object>();
+		map.put("list",list);
+		map.put("count",count);
+		map.put("durationCount",durationCount);
+		map.put("peopleCount",aList.size());
+		return map;
+	}
+
 
 }