|
@@ -10,17 +10,11 @@ import com.zcxk.core.common.util.BeanCopyUtils;
|
|
|
import com.zcxk.core.common.util.SnowflakeIdWorker;
|
|
|
import com.zcxk.core.oauth2.util.UserUtil;
|
|
|
import com.zcxk.core.mysql.pageing.Pagination;
|
|
|
-import com.zcxk.rmcp.api.dto.install.InstallDetailDto;
|
|
|
-import com.zcxk.rmcp.api.dto.install.InstallListDto;
|
|
|
-import com.zcxk.rmcp.api.dto.install.InstallPlanDataDto;
|
|
|
-import com.zcxk.rmcp.api.dto.install.InstallPlanInputDto;
|
|
|
+import com.zcxk.rmcp.api.dto.install.*;
|
|
|
import com.zcxk.rmcp.api.enums.RmcpErrorEnum;
|
|
|
import com.zcxk.rmcp.api.query.InstallPlanQueryCondition;
|
|
|
-import com.zcxk.rmcp.api.vo.InstallListVo;
|
|
|
-import com.zcxk.rmcp.api.vo.InstallPlanVo;
|
|
|
-import com.zcxk.rmcp.core.dao.CommunityMapper;
|
|
|
-import com.zcxk.rmcp.core.dao.InstallListMapper;
|
|
|
-import com.zcxk.rmcp.core.dao.InstallPlanDataMapper;
|
|
|
+import com.zcxk.rmcp.api.vo.*;
|
|
|
+import com.zcxk.rmcp.core.dao.*;
|
|
|
import com.zcxk.rmcp.core.entity.*;
|
|
|
import com.zcxk.rmcp.web.excel.download.adapter.InstallMeterExcelFillAdapter;
|
|
|
import com.zcxk.rmcp.web.excel.download.adapter.InstallPlanExcelFillAdapter;
|
|
@@ -40,7 +34,6 @@ import org.springframework.stereotype.Service;
|
|
|
import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
-import com.zcxk.rmcp.core.dao.InstallPlanMapper;
|
|
|
import org.springframework.transaction.TransactionDefinition;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
@@ -83,6 +76,8 @@ public class InstallPlanServiceImpl implements InstallPlanService {
|
|
|
private ProductService productService;
|
|
|
@Autowired
|
|
|
private OrgService orgService;
|
|
|
+ @Autowired
|
|
|
+ private MeterReadWaterRecordMapper meterReadWaterRecordMapper;
|
|
|
|
|
|
|
|
|
@Override
|
|
@@ -229,26 +224,31 @@ public class InstallPlanServiceImpl implements InstallPlanService {
|
|
|
|
|
|
|
|
|
@Override
|
|
|
- public void batchDel(List<Integer> ids) {
|
|
|
-
|
|
|
+ public void batchDelete(List<Integer> ids) {
|
|
|
+ installPlanMapper.batchDelete(ids);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void allDel(InstallPlanQueryCondition condition) {
|
|
|
-
|
|
|
+ List<InstallPlanVo> list = installPlanMapper.findList(condition,UserUtil.getCurrentUser().getUserCondition());
|
|
|
+ List<Integer> ids = new ArrayList<>();
|
|
|
+ if (list != null && list.size() > 0) {
|
|
|
+ for (InstallPlanVo vo : list) {
|
|
|
+ ids.add(vo.getId());
|
|
|
+ }
|
|
|
+ this.batchDelete(ids);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public InstallDetailDto getInstallDetail(Integer id) {
|
|
|
- InstallDetailDto installDetail = new InstallDetailDto();
|
|
|
+ //InstallDetailDto installDetail = new InstallDetailDto();
|
|
|
List<InstallPlanDataDto> installPlanDataDTOList = newArrayList();
|
|
|
|
|
|
//1、计划信息
|
|
|
- InstallPlan installPlan = installPlanMapper.findById(id);
|
|
|
- if (installPlan != null) {
|
|
|
- installDetail.setCommunityName(installPlan.getPlanName());
|
|
|
- installDetail.setEnableUnit(installPlan.getEnableUnit());
|
|
|
- }
|
|
|
+ //InstallPlan installPlan = installPlanMapper.findById(id);
|
|
|
+ InstallDetailDto installDetail = installPlanMapper.findDetail(id);
|
|
|
+
|
|
|
|
|
|
//2、计划数据(楼栋、单元、楼层)
|
|
|
List<InstallPlanData> installPlanDataList = installPlanDataMapper.fondByPlanId(id);
|
|
@@ -282,8 +282,8 @@ public class InstallPlanServiceImpl implements InstallPlanService {
|
|
|
installedNumber++;
|
|
|
}
|
|
|
}
|
|
|
- installDetail.setTotalNumber(installLists.size());
|
|
|
- installDetail.setInstalledNumber(installedNumber);
|
|
|
+ //installDetail.setTotalNumber(installLists.size());
|
|
|
+ //installDetail.setInstalledNumber(installedNumber);
|
|
|
}
|
|
|
|
|
|
//4、组装树形数据
|
|
@@ -455,10 +455,10 @@ public class InstallPlanServiceImpl implements InstallPlanService {
|
|
|
|
|
|
log.info("saveExcelData excelData:{}",JSON.toJSONString(excelData));
|
|
|
|
|
|
- if (excelData.getInstallList().size() > 0) {
|
|
|
+ if (!excelData.getInstallList().isEmpty()) {
|
|
|
installListMapper.batchInsert(excelData.getInstallList());
|
|
|
}
|
|
|
- if (excelData.getInstallPlanDataList().size() > 0) {
|
|
|
+ if (!excelData.getInstallPlanDataList().isEmpty()) {
|
|
|
installPlanDataMapper.batchInsert(excelData.getInstallPlanDataList());
|
|
|
}
|
|
|
|
|
@@ -468,4 +468,16 @@ public class InstallPlanServiceImpl implements InstallPlanService {
|
|
|
updateInstallPlan.setEnableUnit(excelData.getEnableUnit());
|
|
|
this.updateByPrimaryKeySelective(updateInstallPlan);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public PlanStatisticsVo statistics(Integer planId) {
|
|
|
+ PlanStatisticsVo planStatisticsVo = new PlanStatisticsVo();
|
|
|
+ StatisticsDeviceStatusVo deviceStatusVo = installPlanMapper.totalDeviceStatus(planId);
|
|
|
+
|
|
|
+ StatisticsReadRateVo readRateVo = meterReadWaterRecordMapper.totalReadRate(planId);
|
|
|
+
|
|
|
+ planStatisticsVo.setReadRate(readRateVo);
|
|
|
+ planStatisticsVo.setDeviceStatus(deviceStatusVo);
|
|
|
+ return planStatisticsVo;
|
|
|
+ }
|
|
|
}
|