|
@@ -8,8 +8,9 @@ import com.sooka.sponest.lawenforcement.record.service.ILawenforcementViewServic
|
|
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 java.util.List;
|
|
|
|
-import java.util.Map;
|
|
|
|
|
|
+import java.util.*;
|
|
|
|
+
|
|
|
|
+import static com.ruoyi.common.core.utils.DateUtils.getLastMonths;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 可视化Service业务层处理
|
|
* 可视化Service业务层处理
|
|
@@ -75,4 +76,38 @@ public class LawenforcementViewServiceImpl extends BaseService implements ILawen
|
|
setSookaDataBase(lawenforcementViewBO);
|
|
setSookaDataBase(lawenforcementViewBO);
|
|
return lawenforcementViewMapper.getEquipmentDetails(lawenforcementViewBO);
|
|
return lawenforcementViewMapper.getEquipmentDetails(lawenforcementViewBO);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ @DataScopeMutiDept(deptAlias = "d")
|
|
|
|
+ public List<Map<String, Object>> getTypeList(LawenforcementViewBO lawenforcementViewBO) {
|
|
|
|
+ setSookaDataBase(lawenforcementViewBO);
|
|
|
|
+ return lawenforcementViewMapper.getTypeList(lawenforcementViewBO);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ @DataScopeMutiDept(deptAlias = "d")
|
|
|
|
+ public List<LinkedHashMap<String, Object>> getTypeCount(LawenforcementViewBO lawenforcementViewBO) {
|
|
|
|
+ setSookaDataBase(lawenforcementViewBO);
|
|
|
|
+ lawenforcementViewBO.setDates(getLastMonths(12));
|
|
|
|
+ List<LinkedHashMap<String, Object>> typeCount = lawenforcementViewMapper.getTypeCount(lawenforcementViewBO);
|
|
|
|
+ List<LinkedHashMap<String,Object>> list = new ArrayList<>();
|
|
|
|
+ for (LinkedHashMap<String,Object> map : typeCount) {
|
|
|
|
+ LinkedHashMap<String, Object> hashMap = new LinkedHashMap<>();
|
|
|
|
+ hashMap.put("subitemName", map.get("subitemName"));
|
|
|
|
+ map.remove("subitemName");
|
|
|
|
+ Iterator<String> iterator = map.keySet().iterator();
|
|
|
|
+ List<String> month = new ArrayList<>();
|
|
|
|
+ List<String> num = new ArrayList<>();
|
|
|
|
+ while (iterator.hasNext()) {
|
|
|
|
+ String key = iterator.next();
|
|
|
|
+ month.add(key);
|
|
|
|
+ Object value = map.get(key);
|
|
|
|
+ num.add(value.toString());
|
|
|
|
+ }
|
|
|
|
+ hashMap.put("month", month);
|
|
|
|
+ hashMap.put("num", num);
|
|
|
|
+ list.add(hashMap);
|
|
|
|
+ }
|
|
|
|
+ return list;
|
|
|
|
+ }
|
|
}
|
|
}
|