|
@@ -7,6 +7,7 @@ import java.io.FileInputStream;
|
|
|
import java.io.FileOutputStream;
|
|
import java.io.FileOutputStream;
|
|
|
import java.io.InputStream;
|
|
import java.io.InputStream;
|
|
|
import java.io.OutputStream;
|
|
import java.io.OutputStream;
|
|
|
|
|
+import java.lang.reflect.Method;
|
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
|
import java.util.Comparator;
|
|
import java.util.Comparator;
|
|
@@ -25,6 +26,7 @@ import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
+import com.xintong.visualinspection.bean.CheckAppealStatistic;
|
|
|
import com.xintong.visualinspection.bean.CheckmanStatisticsBean;
|
|
import com.xintong.visualinspection.bean.CheckmanStatisticsBean;
|
|
|
import com.xintong.visualinspection.bean.Constant;
|
|
import com.xintong.visualinspection.bean.Constant;
|
|
|
import com.xintong.visualinspection.bean.FeeStation;
|
|
import com.xintong.visualinspection.bean.FeeStation;
|
|
@@ -1133,4 +1135,80 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
|
|
|
return sFsList;
|
|
return sFsList;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // 将list 转化为 HashMap
|
|
|
|
|
+ private <T> Map<Integer,T> getMapFromList(List<T> list,String fieldName ){
|
|
|
|
|
+ if(list!=null && list.size() >0){
|
|
|
|
|
+ try {
|
|
|
|
|
+ Map<Integer,T> map = new HashMap<>();
|
|
|
|
|
+ for(T obj : list){
|
|
|
|
|
+ Method m = obj.getClass().getMethod("get"+fieldName.substring(0, 1).toUpperCase() + fieldName.substring(1));
|
|
|
|
|
+ Integer value = (Integer)m.invoke(obj);
|
|
|
|
|
+ map.put(value, obj);
|
|
|
|
|
+ }
|
|
|
|
|
+ return map;
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+
|
|
|
|
|
+ e.printStackTrace();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public List<CheckAppealStatistic> getCheckAppealStatistic(CheckAppealStatistic obj) {
|
|
|
|
|
+ // 根据不同检索条件,分别检索去 公司、道管或者收费站 下的收费站列表
|
|
|
|
|
+ List<Organ> list ;
|
|
|
|
|
+ if(obj.getDept_id()!=null){
|
|
|
|
|
+ Organ organ =new Organ();
|
|
|
|
|
+ organ.setId(obj.getDept_id());
|
|
|
|
|
+ list = departmentDao.getOrgan(organ);
|
|
|
|
|
+ }else if(obj.getParent_dept_id()!=null){
|
|
|
|
|
+ list = getFsStationList(obj.getParent_dept_id());
|
|
|
|
|
+ obj.setDept_list(list);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ list = new ArrayList<>();
|
|
|
|
|
+ List<FeeStation> lists = departmentDao.getAllFS();
|
|
|
|
|
+ for(FeeStation e : lists){
|
|
|
|
|
+ Organ organ = new Organ();
|
|
|
|
|
+ organ.setId(Integer.parseInt(e.getDeptid()));
|
|
|
|
|
+ organ.setOrganname(e.getName());
|
|
|
|
|
+ list.add(organ);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 将检索的数据填充list中
|
|
|
|
|
+ List<CheckAppealStatistic> ObjList = statisticsDao.selectCheckAppealNum(obj);
|
|
|
|
|
+ Map<Integer,CheckAppealStatistic> map = getMapFromList(ObjList,"dept_id");
|
|
|
|
|
+
|
|
|
|
|
+ for(Organ organObj :list ){
|
|
|
|
|
+ if(map!=null && map.containsKey(organObj.getId())){
|
|
|
|
|
+ CheckAppealStatistic reObj = map.get(organObj.getId());
|
|
|
|
|
+ reObj.setFee_station_name(organObj.getOrganname());
|
|
|
|
|
+ Integer appeal_num = 0;
|
|
|
|
|
+ for(CheckAppealStatistic subObj:reObj.getSubCheckApealStatistic()){
|
|
|
|
|
+ appeal_num += subObj.getAppeal_num();
|
|
|
|
|
+ if(subObj.getAppeal_result() ==null){
|
|
|
|
|
+ reObj.setAppeal_other_num(subObj.getAppeal_num());
|
|
|
|
|
+ }else if(subObj.getAppeal_result()==1){
|
|
|
|
|
+ reObj.setAppeal_success_num(subObj.getAppeal_num());
|
|
|
|
|
+ }else{
|
|
|
|
|
+ reObj.setAppeal_fail_num(subObj.getAppeal_fail_num());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ reObj.setAppeal_num(appeal_num);
|
|
|
|
|
+ reObj.setSubCheckApealStatistic(null);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ CheckAppealStatistic reobj = new CheckAppealStatistic();
|
|
|
|
|
+ reobj.setFee_station_name(organObj.getOrganname());
|
|
|
|
|
+ reobj.setAppeal_num(0);
|
|
|
|
|
+ reobj.setAppeal_fail_num(0);
|
|
|
|
|
+ reobj.setAppeal_other_num(0);
|
|
|
|
|
+ reobj.setAppeal_result(0);
|
|
|
|
|
+ ObjList.add(reobj);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return ObjList;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|