소스 검색

新增确认人字段,修改导出

wuhonghao 4 년 전
부모
커밋
227299c8fd

+ 26 - 14
railway-admin/src/main/java/com/railway/web/controller/business/catenary/BusJcbBlqController.java

@@ -21,6 +21,7 @@ import javax.validation.Valid;
 import java.io.FileInputStream;
 import java.io.InputStream;
 import java.net.URLEncoder;
+import java.text.SimpleDateFormat;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -104,24 +105,35 @@ public class BusJcbBlqController extends BaseController {
     }
 
     @ApiOperation(value = "导出")
-    @PutMapping("/export")
+    @GetMapping("/export")
     public void export(@RequestParam String id, HttpServletResponse response) {
+        BusJcbBlq info = busJcbBlqService.getInfo(id);
         WordUtils wordUtil=new WordUtils();
         Map<String, Object> params = new HashMap<String, Object>();
-        params.put("${fdh}", "测试分段号");
-        params.put("${qj}", "测试区间");
-        params.put("${wd}", "85");
-        try{
+        params.put("${qj}", info.getQj());
+        params.put("${zzh}", info.getZzh());
+        params.put("${wd}", info.getWd());
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy年MM月dd日");
+        String jcrq = simpleDateFormat.format(info.getJcrq());
+        params.put("${jcrq}", jcrq);
+        params.put("${jcr}", info.getJcr());
+        params.put("${tjwzBlqtjazsp}", info.getTjwzBlqtjazsp().equals("1") ? "√" : "×");
+        params.put("${tjwzWxs}", info.getTjwzWxs().equals("1") ? "√" : "×");
+        params.put("${tjwzGblsljjg}", info.getTjwzGblsljjg().equals("1") ? "√" : "×");
+        params.put("${blqjyzBlqjzcjyzcszzt}", info.getBlqjyzBlqjzcjyzcszzt().equals("1") ? "√" : "×");
+        params.put("${blqjyzBmqjazlg}", info.getBlqjyzBmqjazlg().equals("1") ? "√" : "×");
+        params.put("${blqyxBlqyxwssdg}", info.getBlqyxBlqyxwssdg().equals("1") ? "√" : "×");
+        params.put("${blqyxGycyxdjdtdtzxjl}", info.getBlqyxGycyxdjdtdtzxjl());
+        params.put("${tlqZtlhwpslh}", info.getTlqZtlhwpslh().equals("1") ? "√" : "×");
+        params.put("${jsqDzjs}", info.getJsqDzjs());
+        params.put("${blqjdztJddz}", info.getBlqjdztJddz());
+        params.put("${sbzt}", info.getSbzt().equals("1") ? "合格" : "不合格");
+        params.put("${qrr}", info.getQrr());
+        params.put("${czwt}", info.getCzwt());
 
-            Map<String,Object> header = new HashMap<String, Object>();
-            header.put("width", 450);
-            header.put("height", 110);
-            header.put("type", "jpg");
-            header.put("content", WordUtils.inputStream2ByteArray(new FileInputStream(filePath+"/fdjyq-20211016.png"), true));
-            params.put("${header}",header);
-            //InputStream inputStream = this.getClass().getResourceAsStream("/word/template/DXF分段绝缘器手册.docx");
-            InputStream inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("word/template/DXF分段绝缘器手册.docx");
-            String fileName= URLEncoder.encode("测试文档.docx", "UTF-8");    //生成word文件的文件名
+        try{
+            InputStream inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("word/template/避雷器手册.docx");
+            String fileName= URLEncoder.encode("避雷器手册.docx", "UTF-8");    //生成word文件的文件名
             wordUtil.getWord(inputStream,params,null,fileName,response);
 
         }catch(Exception e){

+ 16 - 13
railway-admin/src/main/java/com/railway/web/controller/business/catenary/BusJcbFdfxjyqController.java

@@ -14,6 +14,7 @@ import java.io.FileInputStream;
 import java.io.InputStream;
 import java.net.URL;
 import java.net.URLEncoder;
+import java.text.SimpleDateFormat;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -108,7 +109,7 @@ public class BusJcbFdfxjyqController extends BaseController {
     }
 
     @ApiOperation(value = "导出")
-    @PutMapping("/export")
+    @GetMapping("/export")
     public void export(@RequestParam String id, HttpServletResponse response) {
         try {
             //获取基础数据
@@ -116,28 +117,30 @@ public class BusJcbFdfxjyqController extends BaseController {
             WordUtils wordUtil=new WordUtils();
             //填充变量
             Map<String, Object> params = new HashMap<String, Object>();
-            params.put("${fdh}", info.getFcd().toString());
+            params.put("${fdh}", info.getFdh());
             params.put("${qj}", info.getQj().toString());
-            params.put("${jcrq}", info.getJcrq().toString());
+            SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy年MM月dd日");
+            String jcrq = simpleDateFormat.format(info.getJcrq());
+            params.put("${jcrq}", jcrq);
             params.put("${wd}", info.getWd().toString());
             params.put("${jcr}", info.getJcr().toString());
             params.put("${pointB}", info.getPointB().toString());
             params.put("${pointG}", info.getPointG().toString());
             params.put("${fcd}", info.getFcd().toString());
             params.put("${fddmpsd}", info.getFddmpsd().toString());
-            params.put("${jybjFdjyqzjyzt}", info.getJybjFdjyqzjyzt().equals("0")?"√":"×");
-            params.put("${jybjClsjyzzt}", info.getJybjClsjyzzt().equals("0")?"√":"×");
-            params.put("${lbjztLs}", info.getLbjztLs().equals("0")?"√":"×");
-            params.put("${lbjztXdx}", info.getLbjztXdx().equals("0")?"√":"×");
-            params.put("${lbjztPhzj}", info.getLbjztPhzj().equals("0")?"√":"×");
-            params.put("${lbjztJcxjt}", info.getLbjztJcxjt().equals("0")?"√":"×");
-            params.put("${lbjztXhj}", info.getLbjztXhj().equals("0")?"√":"×");
-            params.put("${sbzt}", info.getSbzt().equals("0")?"√":"×");
+            params.put("${jybjFdjyqzjyzt}", info.getJybjFdjyqzjyzt().equals("1")?"√":"×");
+            params.put("${jybjClsjyzzt}", info.getJybjClsjyzzt().equals("1")?"√":"×");
+            params.put("${lbjztLs}", info.getLbjztLs().equals("1")?"√":"×");
+            params.put("${lbjztXdx}", info.getLbjztXdx().equals("1")?"√":"×");
+            params.put("${lbjztPhzj}", info.getLbjztPhzj().equals("1")?"√":"×");
+            params.put("${lbjztJcxjt}", info.getLbjztJcxjt().equals("1")?"√":"×");
+            params.put("${lbjztXhj}", info.getLbjztXhj().equals("1")?"√":"×");
+            params.put("${sbzt}", info.getSbzt().equals("0") ? "合格" : "不合格");
             params.put("${xlfdXlpd}", info.getXlfdXlpd().toString());
             params.put("${xlfdWgdg}", info.getXlfdWgdg().toString());
             params.put("${xlfdFdsxlqj}", info.getXlfdFdsxlqj().toString());
             params.put("${xlfdFdczxlqj}", info.getXlfdFdczxlqj().toString());
-            params.put("${sdgjcztSddg}", info.getSdgjcztSddg().equals("0")?"√":"×");
+            params.put("${sdgjcztSddg}", info.getSdgjcztSddg().equals("1")?"√":"×");
             params.put("${qrr}", info.getJcr().toString());
             try{
                 //填充图片信息
@@ -149,7 +152,7 @@ public class BusJcbFdfxjyqController extends BaseController {
                 params.put("${header}",header);
                 InputStream inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("word/template/DXF分段绝缘器手册.docx");
                 //生成word文件的文件名
-                String fileName= URLEncoder.encode("测试文档.docx", "UTF-8");
+                String fileName= URLEncoder.encode("DXF分段绝缘器手册.docx", "UTF-8");
                 //调用生成导出方法
                 wordUtil.getWord(inputStream,params,null,fileName,response);
 

+ 8 - 13
railway-business/src/main/java/com/railway/business/catenary/domain/BusJcbBlq.java

@@ -79,22 +79,14 @@ public class BusJcbBlq extends BaseEntity{
     @Length(min = 0, max = 255, message = "【避雷器及支持绝缘子呈竖直状态(故障描述)】长度必须介于 {min} 和 {max} 之间")
     private String blqjyzBlqjzcjyzcszztDesc;
 
-    @ApiModelProperty(value = "表面清洁,安装牢固")
-    @Length(min = 1, max = 1, message = "【表面清洁,安装牢固】长度必须介于 {min} 和 {max} 之间")
+    @ApiModelProperty(value = "表面清洁,安装牢固,无裂纹、破损及放电痕迹")
+    @Length(min = 1, max = 1, message = "【表面清洁,安装牢固,无裂纹、破损及放电痕迹】长度必须介于 {min} 和 {max} 之间")
     private String blqjyzBmqjazlg;
 
-    @ApiModelProperty(value = "表面清洁,安装牢固(故障描述)")
-    @Length(min = 0, max = 255, message = "【表面清洁,安装牢固(故障描述)】长度必须介于 {min} 和 {max} 之间")
+    @ApiModelProperty(value = "表面清洁,安装牢固,无裂纹、破损及放电痕迹(故障描述)")
+    @Length(min = 0, max = 255, message = "【表面清洁,安装牢固,无裂纹、破损及放电痕迹(故障描述)】长度必须介于 {min} 和 {max} 之间")
     private String blqjyzBmqjazlgDesc;
 
-    @ApiModelProperty(value = "无裂纹、破损及放电痕迹")
-    @Length(min = 1, max = 1, message = "【无裂纹、破损及放电痕迹】长度必须介于 {min} 和 {max} 之间")
-    private String blqjyzWlhpsjfdhj;
-
-    @ApiModelProperty(value = "无裂纹、破损及放电痕迹(故障描述)")
-    @Length(min = 0, max = 255, message = "【无裂纹、破损及放电痕迹(故障描述)】长度必须介于 {min} 和 {max} 之间")
-    private String blqjyzWlhpsjfdhjDesc;
-
     @ApiModelProperty(value = "避雷器引线无烧伤、断股")
     @Length(min = 1, max = 1, message = "【避雷器引线无烧伤、断股】长度必须介于 {min} 和 {max} 之间")
     private String blqyxBlqyxwssdg;
@@ -132,7 +124,10 @@ public class BusJcbBlq extends BaseEntity{
     private String sbztDesc;
 
     @ApiModelProperty(value = "检查人")
-    private Long jcr;
+    private String jcr;
+
+    @ApiModelProperty(value = "确认人")
+    private String qrr;
 
     @ApiModelProperty(value = "存在问题")
     @Length(min = 1, max = 1000, message = "【存在问题】长度必须介于 {min} 和 {max} 之间")

+ 4 - 1
railway-business/src/main/java/com/railway/business/catenary/domain/BusJcbFdfxjyq.java

@@ -164,7 +164,10 @@ public class BusJcbFdfxjyq extends BaseEntity{
     private String sbztDesc;
 
     @ApiModelProperty(value = "检查人")
-    private Long jcr;
+    private String jcr;
+
+    @ApiModelProperty(value = "确认人")
+    private String qrr;
 
     @ApiModelProperty(value = "存在问题")
     @Length(min = 1, max = 1000, message = "【存在问题】长度必须介于 {min} 和 {max} 之间")

+ 12 - 24
railway-business/src/main/resources/mapper/business/BusJcbBlqMapper.xml

@@ -22,8 +22,6 @@
                 <result column="blqjyz_blqjzcjyzcszzt_desc" property="blqjyzBlqjzcjyzcszztDesc"/>
                 <result column="blqjyz_bmqjazlg" property="blqjyzBmqjazlg"/>
                 <result column="blqjyz_bmqjazlg_desc" property="blqjyzBmqjazlgDesc"/>
-                <result column="blqjyz_wlhpsjfdhj" property="blqjyzWlhpsjfdhj"/>
-                <result column="blqjyz_wlhpsjfdhj_desc" property="blqjyzWlhpsjfdhjDesc"/>
                 <result column="blqyx_blqyxwssdg" property="blqyxBlqyxwssdg"/>
                 <result column="blqyx_blqyxwssdg_desc" property="blqyxBlqyxwssdgDesc"/>
                 <result column="blqyx_gycyxdjdtdtzxjl" property="blqyxGycyxdjdtdtzxjl"/>
@@ -34,6 +32,7 @@
                 <result column="sbzt" property="sbzt"/>
                 <result column="sbzt_desc" property="sbztDesc"/>
                 <result column="jcr" property="jcr"/>
+                <result column="qrr" property="qrr"/>
                 <result column="czwt" property="czwt"/>
                 <result column="create_by" property="createBy"/>
                 <result column="create_time" property="createTime"/>
@@ -62,8 +61,6 @@
                 blqjyz_blqjzcjyzcszzt_desc,
                 blqjyz_bmqjazlg,
                 blqjyz_bmqjazlg_desc,
-                blqjyz_wlhpsjfdhj,
-                blqjyz_wlhpsjfdhj_desc,
                 blqyx_blqyxwssdg,
                 blqyx_blqyxwssdg_desc,
                 blqyx_gycyxdjdtdtzxjl,
@@ -74,6 +71,7 @@
                 sbzt,
                 sbzt_desc,
                 jcr,
+                qrr,
                 czwt,
                 create_by,
                 create_time,
@@ -140,12 +138,6 @@
                     <if test ='null != blqjyzBmqjazlgDesc'>
                     blqjyz_bmqjazlg_desc,
                     </if>
-                    <if test ='null != blqjyzWlhpsjfdhj'>
-                    blqjyz_wlhpsjfdhj,
-                    </if>
-                    <if test ='null != blqjyzWlhpsjfdhjDesc'>
-                    blqjyz_wlhpsjfdhj_desc,
-                    </if>
                     <if test ='null != blqyxBlqyxwssdg'>
                     blqyx_blqyxwssdg,
                     </if>
@@ -176,6 +168,9 @@
                     <if test ='null != jcr'>
                     jcr,
                     </if>
+                    <if test ='null != qrr'>
+                        qrr,
+                    </if>
                     <if test ='null != czwt'>
                     czwt,
                     </if>
@@ -250,12 +245,6 @@
                     <if test ='null != blqjyzBmqjazlgDesc'>
                     #{blqjyzBmqjazlgDesc},
                     </if>
-                    <if test ='null != blqjyzWlhpsjfdhj'>
-                    #{blqjyzWlhpsjfdhj},
-                    </if>
-                    <if test ='null != blqjyzWlhpsjfdhjDesc'>
-                    #{blqjyzWlhpsjfdhjDesc},
-                    </if>
                     <if test ='null != blqyxBlqyxwssdg'>
                     #{blqyxBlqyxwssdg},
                     </if>
@@ -286,6 +275,9 @@
                     <if test ='null != jcr'>
                     #{jcr},
                     </if>
+                    <if test ='null != qrr'>
+                        #{qrr},
+                    </if>
                     <if test ='null != czwt'>
                     #{czwt},
                     </if>
@@ -336,8 +328,6 @@
                     <if test ='null != blqjyzBlqjzcjyzcszztDesc'>blqjyz_blqjzcjyzcszzt_desc = #{blqjyzBlqjzcjyzcszztDesc},</if>
                     <if test ='null != blqjyzBmqjazlg'>blqjyz_bmqjazlg = #{blqjyzBmqjazlg},</if>
                     <if test ='null != blqjyzBmqjazlgDesc'>blqjyz_bmqjazlg_desc = #{blqjyzBmqjazlgDesc},</if>
-                    <if test ='null != blqjyzWlhpsjfdhj'>blqjyz_wlhpsjfdhj = #{blqjyzWlhpsjfdhj},</if>
-                    <if test ='null != blqjyzWlhpsjfdhjDesc'>blqjyz_wlhpsjfdhj_desc = #{blqjyzWlhpsjfdhjDesc},</if>
                     <if test ='null != blqyxBlqyxwssdg'>blqyx_blqyxwssdg = #{blqyxBlqyxwssdg},</if>
                     <if test ='null != blqyxBlqyxwssdgDesc'>blqyx_blqyxwssdg_desc = #{blqyxBlqyxwssdgDesc},</if>
                     <if test ='null != blqyxGycyxdjdtdtzxjl'>blqyx_gycyxdjdtdtzxjl = #{blqyxGycyxdjdtdtzxjl},</if>
@@ -348,6 +338,7 @@
                     <if test ='null != sbzt'>sbzt = #{sbzt},</if>
                     <if test ='null != sbztDesc'>sbzt_desc = #{sbztDesc},</if>
                     <if test ='null != jcr'>jcr = #{jcr},</if>
+                    <if test ='null != qrr'>qrr = #{qrr},</if>
                     <if test ='null != czwt'>czwt = #{czwt},</if>
                     <if test ='null != createBy'>create_by = #{createBy},</if>
                     <if test ='null != createTime'>create_time = #{createTime},</if>
@@ -425,12 +416,6 @@
                 <if test="blqjyzBmqjazlgDesc!=null and blqjyzBmqjazlgDesc!=''">
                     and blqjyz_bmqjazlg_desc=#{blqjyzBmqjazlgDesc}
                 </if>
-                <if test="blqjyzWlhpsjfdhj!=null and blqjyzWlhpsjfdhj!=''">
-                    and blqjyz_wlhpsjfdhj=#{blqjyzWlhpsjfdhj}
-                </if>
-                <if test="blqjyzWlhpsjfdhjDesc!=null and blqjyzWlhpsjfdhjDesc!=''">
-                    and blqjyz_wlhpsjfdhj_desc=#{blqjyzWlhpsjfdhjDesc}
-                </if>
                 <if test="blqyxBlqyxwssdg!=null and blqyxBlqyxwssdg!=''">
                     and blqyx_blqyxwssdg=#{blqyxBlqyxwssdg}
                 </if>
@@ -461,6 +446,9 @@
                 <if test="jcr!=null and jcr!=''">
                     and jcr=#{jcr}
                 </if>
+                <if test="qrr!=null and qrr!=''">
+                    and qrr=#{qrr}
+                </if>
                 <if test="czwt!=null and czwt!=''">
                     and czwt=#{czwt}
                 </if>

+ 14 - 0
railway-business/src/main/resources/mapper/business/BusJcbFdfxjyqMapper.xml

@@ -39,6 +39,7 @@
                 <result column="sbzt" property="sbzt"/>
                 <result column="sbzt_desc" property="sbztDesc"/>
                 <result column="jcr" property="jcr"/>
+                <result column="qrr" property="qrr"/>
                 <result column="czwt" property="czwt"/>
                 <result column="create_by" property="createBy"/>
                 <result column="create_time" property="createTime"/>
@@ -90,6 +91,7 @@
                 sbzt,
                 sbzt_desc,
                 jcr,
+                qrr,
                 czwt,
                 create_by,
                 create_time,
@@ -210,6 +212,9 @@
                     <if test ='null != jcr'>
                     jcr,
                     </if>
+                    <if test ='null != qrr'>
+                        qrr,
+                    </if>
                     <if test ='null != czwt'>
                     czwt,
                     </if>
@@ -353,6 +358,9 @@
                     <if test ='null != jcr'>
                     #{jcr},
                     </if>
+                    <if test ='null != qrr'>
+                        #{qrr},
+                    </if>
                     <if test ='null != czwt'>
                     #{czwt},
                     </if>
@@ -438,6 +446,7 @@
                     <if test ='null != sbzt'>sbzt = #{sbzt},</if>
                     <if test ='null != sbztDesc'>sbzt_desc = #{sbztDesc},</if>
                     <if test ='null != jcr'>jcr = #{jcr},</if>
+                    <if test ='null != qrr'>qrr = #{qrr},</if>
                     <if test ='null != czwt'>czwt = #{czwt},</if>
                     <if test ='null != createBy'>create_by = #{createBy},</if>
                     <if test ='null != createTime'>create_time = #{createTime},</if>
@@ -505,6 +514,7 @@
         a.sbzt,
         a.sbzt_desc,
         a.jcr,
+        a.qrr,
         a.czwt,
         a.create_by,
         a.create_time,
@@ -566,6 +576,7 @@
         a.sbzt,
         a.sbzt_desc,
         a.jcr,
+        a.qrr,
         a.czwt,
         a.create_by,
         a.create_time,
@@ -689,6 +700,9 @@
                 <if test="jcr!=null and jcr!=''">
                     and a.jcr=#{jcr}
                 </if>
+                <if test="qrr!=null and qrr!=''">
+                    and a.qrr=#{qrr}
+                </if>
                 <if test="czwt!=null and czwt!=''">
                     and a.czwt=#{czwt}
                 </if>

BIN
railway-business/src/main/resources/word/template/DXF分段绝缘器手册.docx


BIN
railway-business/src/main/resources/word/template/避雷器手册.docx