|
@@ -967,6 +967,35 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
|
|
|
return mapper.selectCountByPosition(positionCode);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<Map<String, String>> selectCountByPositionGroup() {
|
|
|
+ List<Map<String, String>> sbInfoCountMapList = mapper.selectCountByPositionGroup();
|
|
|
+ if(sbInfoCountMapList != null) {
|
|
|
+ for (Map<String, String> map: sbInfoCountMapList) {
|
|
|
+ // 汇总厂区的,将厂区下面的车间数量累加到上面
|
|
|
+ if ("1".equals(map.get("type"))) {
|
|
|
+ String numStr = map.get("num");
|
|
|
+ int num = 0;
|
|
|
+ if(StringUtils.isEmpty(numStr)){
|
|
|
+ num = 0;
|
|
|
+ }else{
|
|
|
+ num = Integer.valueOf(numStr);
|
|
|
+ }
|
|
|
+ for (Map<String, String> child: sbInfoCountMapList) {
|
|
|
+ if (map.get("id").equals(child.get("parentId"))) {
|
|
|
+ String childNumStr = child.get("num");
|
|
|
+ if(!StringUtils.isEmpty(numStr)){
|
|
|
+ num = num + Integer.valueOf(childNumStr);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ map.put("num", num + "");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return sbInfoCountMapList;
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public List<Map<String, String>> selectCountByPositionGroupBySbType(String positionCode) {
|
|
|
Weekend<SbPosition> weekend = new Weekend<>(SbPosition.class);
|