ZHGYL_GKPT 4 rokov pred
rodič
commit
a009f87e8c

+ 5 - 0
src/main/java/com/minpay/common/constant/Constant.java

@@ -335,6 +335,11 @@ public class Constant implements IMINBusinessConstant{
 	 */
 	public static final String FILE_DETAIL_TYPE_09 = "1000010";
 	/**
+	 * 故障工单信息
+	 */
+	public static final String FILE_DETAIL_TYPE_11 = "1000011";
+
+	/**
 	 * 报表类型 TQTDRB:台区停电日报
 	 */
 	public static final String REPORT_TYPE_00 = "TQTDRB";

+ 3 - 0
src/main/java/com/minpay/common/service/impl/ReportServiceImpl.java

@@ -406,6 +406,9 @@ public class ReportServiceImpl implements IReportService {
 					}
 				}
 			}
+			//抢修类工单报表
+			List<Map<String, String>>  qxlgdbbbList = db.getMybatisMapper(IReportBatchMapper.class).selectQxlgdbbData(map);
+
 			rstMap.put("result",ja);//线路重载
 			rstMap.put("result2",ja2);//线路过载
 			rstMap.put("result3",ja3);//配变过载

+ 1 - 1
src/main/java/com/minpay/common/util/ExcelTemplateUtil.java

@@ -72,7 +72,7 @@ public class ExcelTemplateUtil {
             flag = false;
         } else {
             for (int i = 0; i < excelheader.length; i++) {
-                if(!excelheader[i].equals(excelheader2[i])){
+                if(!StringUtil.ObjectToString(excelheader[i]).equals(StringUtil.ObjectToString(excelheader2[i]))){
                     flag = false;
                     break;
                 }

+ 16 - 10
src/main/java/com/minpay/common/util/StringUtil.java

@@ -113,7 +113,10 @@ public class StringUtil extends StringUtils {
                    return simpleDateFormat2.parse(obj.toString().substring(0,obj.toString().length()-2));
                }
            }else {
-               LocalDateTime ldt = LocalDateTime.parse(obj.toString(),dtf);
+               LocalDateTime ldt = LocalDateTime.parse(obj.toString().replaceAll(" ","")
+                       .replaceAll("-","")
+                       .replaceAll("/","")
+                       .replaceAll(":",""),dtf);
                String datetime = ldt.format(fa);
                if("1".equals(type)){
                    return simpleDateFormat.parse(datetime);
@@ -126,6 +129,18 @@ public class StringUtil extends StringUtils {
         return null;
     }
 
+    public static void main(String[] args) {
+        Object obj = "20210225111412";
+        DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");
+        DateTimeFormatter fa = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+
+
+        LocalDateTime ldt = LocalDateTime.parse(obj.toString(),dtf);
+        String datetime = ldt.format(fa);
+        System.out.println(datetime);
+    }
+
+
     /**
      * 入参格式yyyyMMdd hh:mm:ss
      * @param obj
@@ -177,13 +192,4 @@ public class StringUtil extends StringUtils {
         return start+end;
     }
 
-    public static void main(String[] args) {
-        String str = "2021-04-01 - 2021-04-30";
-        str = str.replaceAll(" ","").replaceAll("-","").replaceAll("/","");
-        if(str.length() == 16){
-            System.out.println(str.substring(0,8)+"000000");
-            System.out.println(str.substring(8,16)+"235959");
-        }
-
-    }
 }

+ 14 - 0
src/main/java/com/minpay/db/table/own/mapper/IReportBatchMapper.java

@@ -2,6 +2,7 @@ package com.minpay.db.table.own.mapper;
 
 import com.minpay.db.table.model.DwFileDetail09;
 import com.minpay.db.table.model.DwFileDetail10;
+import com.minpay.db.table.model.DwFileDetail11;
 import com.startup.minpay.frame.jdbc.IMINMybatisMapper;
 import org.apache.ibatis.annotations.Param;
 
@@ -41,4 +42,17 @@ public interface IReportBatchMapper  extends IMINMybatisMapper {
      * @return
      */
     List<Map<String, String>> selectReportInfo(Map<String, Object> param);
+
+    /**
+     * 抢修类工单报表
+     * @param map
+     * @return
+     */
+    List<Map<String, String>> selectQxlgdbbData(Map<String, Object> map);
+
+    /**
+     * 故障工单
+     * @param tempList
+     */
+    void insertGzgdReport(List<DwFileDetail11> tempList);
 }

+ 169 - 3
src/main/java/com/minpay/reportManage/action/DataWareManageAction.java

@@ -19,6 +19,7 @@ import com.minpay.common.util.*;
 import com.minpay.db.table.mapper.*;
 import com.minpay.db.table.model.*;
 import com.minpay.db.table.own.mapper.IReportBatchMapper;
+import com.startup.minpay.frame.data.AbstractMINBean;
 import org.apache.commons.fileupload.FileItem;
 import org.apache.ibatis.transaction.Transaction;
 import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
@@ -46,6 +47,7 @@ import com.startup.minpay.frame.target.MINComponent;
 import com.startup.minpay.frame.target.MINParam;
 
 import net.sf.json.JSONArray;
+import org.apache.poi.ss.formula.functions.T;
 import org.springframework.transaction.annotation.Transactional;
 
 @MINComponent
@@ -518,9 +520,6 @@ public class DataWareManageAction implements IMINAction {
 
 				}
 			}
-
-
-
 		//配变过重载
 		}else if(Constant.FILE_DETAIL_TYPE_08.equals(fileType)){
 			//标题对应key
@@ -678,6 +677,138 @@ public class DataWareManageAction implements IMINAction {
 				}
 				this.batchXlgzzReportData(ll,2);
 			}
+		// 故障工单信息
+		}else if(Constant.FILE_DETAIL_TYPE_11.equals(fileType)){
+			//标题对应key
+			String[] titleKey = new String[]{
+					"GDBH","GWGDBH","YHBH","GDDW","DWXCSJ", "GZPCSJ", "YJFL", "EJFL", "SJFL", "YWLXMC", "SLSH", "PGR",
+					"PCRY", "SDR", "YHMC", "LXR", "LXDZ", "XCFL", "JJCD", "WHCD", "CQSX", "GZGS", "SLNR", "GDZT", "GZYY",
+					"GZXX", "DYDJ", "ZDCL", "GZDZ", "LXDH", "CLJG", "HBZD", "QXZSC", "DGSC", "GZPCSC", "GZYPJG", "XCQXJL",
+					"SCPFQXDSJ", "ZCPFQXDSJ", "ZDJDSJ", "HFSDSJ", "TJSHSJ", "GDSHSJ", "GDSJ", "ZDBM"};
+			String[] titleValue = new String[]{
+					"工单编号" , "国网工单号" , "用户编号" , "供电单位" , "到达现场时间" , "故障排除时间" , "一级分类" ,
+					"二级分类" , "三级分类" , "业务类型名称" , "受理时间" , "派工人 " , "派出人员" , "锁定人 " , "用户名称" ,
+					"联系人 " , "联系地址" , "现场分类" , "紧急程度" , "危害程度" , "产权属性" , "故障归属" , "受理内容" ,
+					"工单状态" , "故障原因" , "故障现象" , "电压等级" , "终端处理" , "故障地址" , "联系电话" , "处理结果" ,
+					"合并主单" , "抢修总时长(分)" , "到岗时长(分) " , "故障排除时长(分) " , "故障研判结果" , "现场抢修记录" ,
+					"首次派发抢修队时间 " , "再次派发抢修队时间 " , "终端接单时间" , "恢复送电时间" , "提交审核时间" ,
+					"工单审核时间" ,"归档时间" , "终端编码"
+			};
+			//验证模板是否正确
+			Map<String,Object> header = new HashMap<String, Object>();
+			List<String[]> headerTitle = new ArrayList<String[]>();
+			headerTitle.add(titleValue);
+			if(headerTitle == null || headerTitle.isEmpty()){
+				System.out.println("标题列为空");
+			} else {
+				header.put("headerRows",headerTitle.size() - 1);
+				header.put("header",headerTitle);
+				header.put("cols",headerTitle.get(headerTitle.size() -1).length);
+				boolean b = ExcelTemplateUtil.verificationExcelHeadLine(fileItem,header);
+				if (!b) {
+					throw new MINBusinessException("导入模板不一致,请使用正确模板");//无数据,请添加数据
+				}
+				//读取excel数据
+				list = FilesUtil.readExecleasy(fileItem, titleKey, 1);
+				if(list == null || list.isEmpty()){
+					throw new MINBusinessException("无数据,请添加数据");//无数据,请添加数据
+				}
+				List<DwFileDetail11> ll = new ArrayList<DwFileDetail11>();
+				// 详情数据存入数据库
+				for (Map<String,String> excelMap : list) {
+					DwFileDetail11 fileDetail11 = new DwFileDetail11();
+					fileDetail11.setId(UUID.randomUUID().toString().replace("-", ""));
+					fileDetail11.setGdbh(excelMap.get("GDBH"));
+					fileDetail11.setGwgdbh(excelMap.get("GWGDBH"));
+					fileDetail11.setYhbh(excelMap.get("YHBH"));
+					fileDetail11.setGddw(excelMap.get("GDDW"));
+					String dwxcsj = excelMap.get("DWXCSJ");
+					if(dwxcsj != null && !"".equals(dwxcsj)){
+						fileDetail11.setDwxcsj(StringUtil.ObjToDate(dwxcsj,"2"));
+					}
+					String gzpcsj = excelMap.get("GZPCSJ");
+					if(gzpcsj != null && !"".equals(gzpcsj)){
+						fileDetail11.setGzpcsj(StringUtil.ObjToDate(gzpcsj,"2"));
+					}
+//					fileDetail11.setDwxcsj(excelMap.get("DWXCSJ"));
+//					fileDetail11.setGzpcsj(excelMap.get("GZPCSJ"));
+					fileDetail11.setYjfl(excelMap.get("YJFL"));
+					fileDetail11.setEjfl(excelMap.get("EJFL"));
+					fileDetail11.setSjfl(excelMap.get("SJFL"));
+					fileDetail11.setYwlxmc(excelMap.get("YWLXMC"));
+					String slsh = excelMap.get("SLSH");
+					if(slsh != null && !"".equals(slsh)){
+						fileDetail11.setSlsh(StringUtil.ObjToDate(slsh,"2"));
+					}
+//					fileDetail11.setSlsh(excelMap.get("SLSH"));
+					fileDetail11.setPgr(excelMap.get("PGR"));
+					fileDetail11.setPcry(excelMap.get("PCRY"));
+					fileDetail11.setSdr(excelMap.get("SDR"));
+					fileDetail11.setYhmc(excelMap.get("YHMC"));
+					fileDetail11.setLxr(excelMap.get("LXR"));
+					fileDetail11.setLxdz(excelMap.get("LXDZ"));
+					fileDetail11.setXcfl(excelMap.get("XCFL"));
+					fileDetail11.setJjcd(excelMap.get("JJCD"));
+					fileDetail11.setWhcd(excelMap.get("WHCD"));
+					fileDetail11.setCqsx(excelMap.get("CQSX"));
+					fileDetail11.setGzgs(excelMap.get("GZGS"));
+					fileDetail11.setSlnr(excelMap.get("SLNR"));
+					fileDetail11.setGdzt(excelMap.get("GDZT"));
+					fileDetail11.setGzyy(excelMap.get("GZYY"));
+					fileDetail11.setGzxx(excelMap.get("GZXX"));
+					fileDetail11.setDydj(excelMap.get("DYDJ"));
+					fileDetail11.setZdcl(excelMap.get("ZDCL"));
+					fileDetail11.setGzdz(excelMap.get("GZDZ"));
+					fileDetail11.setLxdh(excelMap.get("LXDH"));
+					fileDetail11.setCljg(excelMap.get("CLJG"));
+					fileDetail11.setHbzd(excelMap.get("HBZD"));
+					fileDetail11.setQxzsc(StringUtil.ObjToFloat(excelMap.get("QXZSC")));
+					fileDetail11.setDgsc(StringUtil.ObjToFloat(excelMap.get("DGSC")));
+					fileDetail11.setGzpcsc(StringUtil.ObjToFloat(excelMap.get("GZPCSC")));
+					fileDetail11.setGzypjg(excelMap.get("GZYPJG"));
+					fileDetail11.setXcqxjl(excelMap.get("XCQXJL"));
+					String scpfqxdsj = excelMap.get("SCPFQXDSJ");
+					if(scpfqxdsj != null && !"".equals(scpfqxdsj)){
+						fileDetail11.setScpfqxdsj(StringUtil.ObjToDate(scpfqxdsj,"2"));
+					}
+//					fileDetail11.setScpfqxdsj(excelMap.get("SCPFQXDSJ"));
+					String zcpfqxdsj = excelMap.get("ZCPFQXDSJ");
+					if(zcpfqxdsj != null && !"".equals(zcpfqxdsj)){
+						fileDetail11.setZcpfqxdsj(StringUtil.ObjToDate(zcpfqxdsj,"2"));
+					}
+//					fileDetail11.setZcpfqxdsj(excelMap.get("ZCPFQXDSJ"));
+					String zdjdsj = excelMap.get("ZDJDSJ");
+					if(zdjdsj != null && !"".equals(zdjdsj)){
+						fileDetail11.setZdjdsj(StringUtil.ObjToDate(zdjdsj,"2"));
+					}
+//					fileDetail11.setZdjdsj(excelMap.get("ZDJDSJ"));
+					String hfsdsj = excelMap.get("HFSDSJ");
+					if(hfsdsj != null && !"".equals(hfsdsj)){
+						fileDetail11.setHfsdsj(StringUtil.ObjToDate(hfsdsj,"2"));
+					}
+//					fileDetail11.setHfsdsj(excelMap.get("HFSDSJ"));
+					String tjshsj = excelMap.get("TJSHSJ");
+					if(tjshsj != null && !"".equals(tjshsj)){
+						fileDetail11.setTjshsj(StringUtil.ObjToDate(tjshsj,"2"));
+					}
+//					fileDetail11.setTjshsj(excelMap.get("TJSHSJ"));
+					String gdshsj = excelMap.get("GDSHSJ");
+					if(gdshsj != null && !"".equals(gdshsj)){
+						fileDetail11.setGdshsj(StringUtil.ObjToDate(gdshsj,"2"));
+					}
+//					fileDetail11.setGdshsj(excelMap.get("GDSHSJ"));
+					String gdsj = excelMap.get("GDSJ");
+					if(gdsj != null && !"".equals(gdsj)){
+						fileDetail11.setGdsj(StringUtil.ObjToDate(gdsj,"2"));
+					}
+//					fileDetail11.setGdsj(excelMap.get("GDSJ"));
+					fileDetail11.setZdbm(excelMap.get("ZDBM"));
+
+					fileDetail11.setFileId(fileId);
+					ll.add(fileDetail11);
+				}
+				this.batchGzgdReportData(ll,2);
+			}
 		}
 
 		// 文件名
@@ -707,6 +838,41 @@ public class DataWareManageAction implements IMINAction {
     }
 
 	/**
+	 * @param list
+	 * @param type
+	 */
+	private void batchGzgdReportData(List<DwFileDetail11> list, int type) {
+
+		if(list != null && list.size() > 0){
+			List<DwFileDetail11> tempList = new ArrayList<DwFileDetail11>();
+			int cou = 0;
+			for (int i = 0; i < list.size() ; i++) {
+				if((list.size() - i) >= 1000){
+					tempList.add((DwFileDetail11) list.get(i));
+					cou += 1;
+					if(cou == 1000){
+						try {
+							db.getMybatisMapper(IReportBatchMapper.class).insertGzgdReport(tempList);
+						} catch (MINBusinessException e) {
+							e.printStackTrace();
+						}
+						cou = 0;
+						tempList = new ArrayList<DwFileDetail11>();
+					}
+				}
+				if((list.size() - i) < 1000){
+					tempList.add((DwFileDetail11) list.get(i));
+				}
+			}
+			try {
+				db.getMybatisMapper(IReportBatchMapper.class).insertGzgdReport(tempList);
+			} catch (MINBusinessException e) {
+				e.printStackTrace();
+			}
+		}
+	}
+
+	/**
 	 * 批处理-配变过重载
 	 * @param list
 	 */

+ 0 - 2
src/main/java/com/minpay/reportManage/action/XlgzzReportAction.java

@@ -336,6 +336,4 @@ public class XlgzzReportAction implements IMINAction {
         ExportUtils.XlzgzCreateSheet(wb,index,"抢修类工单报表明细",titleArray3,fieldArray3,"",new ArrayList<>(),new HashMap<String,String>());
         return wb;
     }
-
-
 }

+ 68 - 0
src/main/resources/com/minpay/db/table/own/mapper/ReportBatchMapper.xml

@@ -80,6 +80,71 @@
         </foreach>
         ) A
     </insert>
+
+    <!--故障工单-->
+    <insert id="insertGzgdReport">
+        INSERT INTO DW_FILE_DETAIL_11 (
+        DFD11_ID,DFD11_GDBH,DFD11_GWGDBH,DFD11_YHBH,DFD11_GDDW,DFD11_DWXCSJ,DFD11_GZPCSJ,DFD11_YJFL,
+        DFD11_EJFL,DFD11_SJFL,DFD11_YWLXMC,DFD11_SLSH,DFD11_PGR,DFD11_PCRY,DFD11_SDR,DFD11_YHMC,DFD11_LXR,
+        DFD11_LXDZ,DFD11_XCFL,DFD11_JJCD,DFD11_WHCD,DFD11_CQSX,DFD11_GZGS,DFD11_SLNR,DFD11_GDZT,DFD11_GZYY,
+        DFD11_GZXX,DFD11_DYDJ,DFD11_ZDCL,DFD11_GZDZ,DFD11_LXDH,DFD11_CLJG,DFD11_HBZD,DFD11_QXZSC,DFD11_DGSC,
+        DFD11_GZPCSC,DFD11_GZYPJG,DFD11_XCQXJL,DFD11_SCPFQXDSJ,DFD11_ZCPFQXDSJ,DFD11_ZDJDSJ,DFD11_HFSDSJ,
+        DFD11_TJSHSJ,DFD11_GDSHSJ,DFD11_GDSJ,DFD11_ZDBM,DFD11_FILE_ID,DFD11_STATE)
+        SELECT A.* FROM (
+        <foreach collection="list" item="item" index="index" separator="UNION ALL">
+            SELECT
+            #{item.id} id,
+            #{item.gdbh} gdbh,
+            #{item.gwgdbh} gwgdbh,
+            #{item.yhbh} yhbh,
+            #{item.gddw} gddw,
+            #{item.dwxcsj} dwxcsj,
+            #{item.gzpcsj} gzpcsj,
+            #{item.yjfl} yjfl,
+            #{item.ejfl} ejfl,
+            #{item.sjfl} sjfl,
+            #{item.ywlxmc} ywlxmc,
+            #{item.slsh} slsh,
+            #{item.pgr} pgr,
+            #{item.pcry} pcry,
+            #{item.sdr} sdr,
+            #{item.yhmc} yhmc,
+            #{item.lxr} lxr,
+            #{item.lxdz} lxdz,
+            #{item.xcfl} xcfl,
+            #{item.jjcd} jjcd,
+            #{item.whcd} whcd,
+            #{item.cqsx} cqsx,
+            #{item.gzgs} gzgs,
+            #{item.slnr} slnr,
+            #{item.gdzt} gdzt,
+            #{item.gzyy} gzyy,
+            #{item.gzxx} gzxx,
+            #{item.dydj} dydj,
+            #{item.zdcl} zdcl,
+            #{item.gzdz} gzdz,
+            #{item.lxdh} lxdh,
+            #{item.cljg} cljg,
+            #{item.hbzd} hbzd,
+            #{item.qxzsc} qxzsc,
+            #{item.dgsc} dgsc,
+            #{item.gzpcsc} gzpcsc,
+            #{item.gzypjg} gzypjg,
+            #{item.xcqxjl} xcqxjl,
+            #{item.scpfqxdsj} scpfqxdsj,
+            #{item.zcpfqxdsj} zcpfqxdsj,
+            #{item.zdjdsj} zdjdsj,
+            #{item.hfsdsj} hfsdsj,
+            #{item.tjshsj} tjshsj,
+            #{item.gdshsj} gdshsj,
+            #{item.gdsj} gdsj,
+            #{item.zdbm} zdbm,
+            #{item.fileId} fid,
+            0 state
+            FROM DUAL
+        </foreach>
+        ) A
+    </insert>
     <!--线路重过载查询-->
     <select id="selectXlgzzData" resultType="map" parameterType="map">
         SELECT
@@ -159,4 +224,7 @@
             AND B.DBRT_ID = #{reportTypeId}
             AND DRI_ID = #{reportId}
     </select>
+    <select id="selectQxlgdbbData" resultType="map" parameterType="map">
+        select 1 from dual
+    </select>
 </mapper>

+ 2 - 1
src/main/webapp/admin/xlgzz/reportManageDetailXlgzz.html

@@ -80,12 +80,13 @@
         tableYulan();
         // 预览
         function tableYulan() {
+            console.log("reportId:"+reportId+",reportType:" + reportType)
             // 查询符合条件的明细数据,生成预览数据
             $.request({
                 action : 'XlgzzReportAction/reportNeedDataDetail2',
                 data : {
                     reportId : reportId,
-                    reportType:reportType
+                    reportType:reportType//日报 or  周报
                 },
                 success : function(data) {
                     if (data.code == 0) {//查询结果集成功

+ 1 - 1
src/main/webapp/admin/xlgzz/reportManageXlgzz.html

@@ -133,7 +133,7 @@
 		 });
 
 		  function reloadSearch (t) {
-		  	console.log("1111111111111111111111111111111111111111111111111")
+			    console.log("1111111111111111111111111111111111111111111111111")
 				var fileName = $("#fileName").val();
 				var date = $("#date").val();
 				//执行重载

+ 0 - 1
src/main/webapp/admin/xlgzz/reportProduceXlgzz.html

@@ -401,7 +401,6 @@
 						if (timeType == '00') {// 日报
 							$("#gongjubiao").hide();
 							// $("#reportTable").show();
-
 							// $element.tabDelete('demo', '22');
 							$table.render({
 								elem: '#demo1x'