Kaynağa Gözat

装表计划批量导入,修正查询阀控过滤站点

oppadmin 4 yıl önce
ebeveyn
işleme
37d7b97f5c

+ 2 - 2
smart-city-platform/src/main/java/com/bz/smart_city/excel/download/template/InstallPlanDownloadExcelTemplate.java

@@ -51,9 +51,9 @@ public class InstallPlanDownloadExcelTemplate extends AbstractDownloadExcelTempl
     protected void setParam() {
         LoginUser loginUser = UserUtil.getCurrentUser();
         filePath = getFilePath();
-        templatePath = "excel/installPlanTemplate_20201208.xlsx";
+        templatePath = "excel/payBaseAccountTemplate20210130.xlsx";
 
-        DateTimeFormatter f = DateTimeFormatter.ofPattern("yyyyMMdd");
+        DateTimeFormatter f = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");
         LocalDateTime date = LocalDateTime.now();
         downloadName = "批量创建装表计划模板"+ "_" + date.format(f);
 

+ 13 - 9
smart-city-platform/src/main/java/com/bz/smart_city/excel/resolver/InstallPlanResolverExcelTemplate.java

@@ -138,10 +138,10 @@ public class InstallPlanResolverExcelTemplate extends AbstractResolverExcelTempl
                     Cell doorNoCell = row.getCell(3);
                     Cell deviceTypeCell = row.getCell(4);
                     Cell fileNoCell = row.getCell(5);
-                    Cell userNameCell = row.getCell(6);
+/*                    Cell userNameCell = row.getCell(6);
                     Cell userPhoneCell = row.getCell(7);
                     Cell idCardCell = row.getCell(8);
-                    Cell remarkCell = row.getCell(9);
+                    Cell remarkCell = row.getCell(9);*/
 
                     buildingCell.setCellType(CellType.STRING);
                     unitCell.setCellType(CellType.STRING);
@@ -149,9 +149,9 @@ public class InstallPlanResolverExcelTemplate extends AbstractResolverExcelTempl
                     doorNoCell.setCellType(CellType.STRING);
                     deviceTypeCell.setCellType(CellType.STRING);
                     fileNoCell.setCellType(CellType.STRING);
-                    userNameCell.setCellType(CellType.STRING);
+/*                    userNameCell.setCellType(CellType.STRING);
                     userPhoneCell.setCellType(CellType.STRING);
-                    idCardCell.setCellType(CellType.STRING);
+                    idCardCell.setCellType(CellType.STRING);*/
 
                     if (StringUtils.equals("", buildingCell.getStringCellValue().trim()) &&
                             StringUtils.equals("", floorCell.getStringCellValue().trim()) &&
@@ -177,9 +177,8 @@ public class InstallPlanResolverExcelTemplate extends AbstractResolverExcelTempl
                         continue;
                     }
 
-                    log.info("Row info = building={},unit={},floor={},doorNo={},deviceType={},fileNo={},userName={},userPhone={},idCard={}",buildingCell.getStringCellValue(),unitCell.getStringCellValue(),floorCell.getStringCellValue(),
-                            doorNoCell.getStringCellValue(),deviceTypeCell.getStringCellValue(),fileNoCell.getStringCellValue(),userNameCell.getStringCellValue(),
-                            userPhoneCell.getStringCellValue(),idCardCell.getStringCellValue());
+                    log.info("Row info = building={},unit={},floor={},doorNo={},deviceType={},fileNo={}",buildingCell.getStringCellValue(),unitCell.getStringCellValue(),floorCell.getStringCellValue(),
+                            doorNoCell.getStringCellValue(),deviceTypeCell.getStringCellValue(),fileNoCell.getStringCellValue());
                     //deviceTypeSet.add(deviceTypeCell.getStringCellValue().trim());
 
                     InstallPlanInputDTO installPlanInput = new InstallPlanInputDTO();
@@ -235,13 +234,18 @@ public class InstallPlanResolverExcelTemplate extends AbstractResolverExcelTempl
                     doorNoDTO.setName(doorNoCell.getStringCellValue().trim());
 
                    floorDTO.getChildren().add(doorNoDTO);
-                    if(installPlanInput.getEnableUnit() == 1){
+/*                    if(installPlanInput.getEnableUnit() == 1){
                         unitDTO.setName(unitCell.getStringCellValue().trim());
                         unitDTO.getChildren().add(floorDTO);
                         buildDTO.getChildren().add(unitDTO);
                     }
                     else
-                        buildDTO.getChildren().add(floorDTO);
+                        buildDTO.getChildren().add(floorDTO);*/
+
+                    unitDTO.setName(unitCell.getStringCellValue().trim());
+                    unitDTO.getChildren().add(floorDTO);
+                    buildDTO.getChildren().add(unitDTO);
+
 
                     if(installPlanInput.getInstallPlanDataList() == null)
                         installPlanInput.setInstallPlanDataList(new ArrayList<>());

+ 4 - 4
smart-city-platform/src/main/resources/mapper/pay/PayControlRecordMapper.xml

@@ -28,8 +28,8 @@
         left join sc_device sc on pcr.meter_id = sc.id
         <where>
             pcr.del_flag = 0
-            <if test="payControlRecordDto.siteId != null"> and pcr.site_id = #{payControlRecordDto.siteId}</if>
-            <if test="payControlRecordDto.customerId != null"> and pcr.customer_id = #{payControlRecordDto.customerId}</if>
+            <if test="payControlRecordDto.siteId != null"> and pcr.site_id = #{siteId}</if>
+            <if test="payControlRecordDto.customerId != null"> and pcr.customer_id = {customerId}</if>
             <if test="payControlRecordDto.id != null"> and pcr.id = #{payControlRecordDto.id}</if>
             <if test="payControlRecordDto.accountId != null"> and pcr.account_id = #{payControlRecordDto.accountId}</if>
             <if test="payControlRecordDto.meterId != null"> and pcr.meter_id = #{payControlRecordDto.meterId}</if>
@@ -92,8 +92,8 @@
         left join pay_control_rule pcrule on pcr.control_rule_id = pcrule.id
         where
         pba.accountnumber = #{accountNumber}
-        <if test="payControlRecordDto.siteId != null"> and pcr.site_id = #{payControlRecordDto.siteId}</if>
-        <if test="payControlRecordDto.customerId != null"> and pcr.customer_id = #{payControlRecordDto.customerId}</if>
+        <if test="payControlRecordDto.siteId != null"> and pcr.site_id = #{siteId}</if>
+        <if test="payControlRecordDto.customerId != null"> and pcr.customer_id = #{customerId}</if>
         and DATE_FORMAT(pcr.create_date,'%Y')=#{year}
         order by pcr.update_date desc
     </select>