瀏覽代碼

顽症报告导出

zhuang 1 年之前
父節點
當前提交
522f5b8ae7

+ 2 - 2
business-common/src/main/java/com/rongwei/bscommon/sys/dao/ZhcxPersistentManageDao.java

@@ -18,7 +18,7 @@ public interface ZhcxPersistentManageDao extends BaseMapper<ZhcxPersistentManage
             "where 1=1 and DELETED = '0' and PERIOD = #{period} and YEAR(CREATEDATE) = #{year} " +
             "and FILL IS NOT NULL" +
             "<if test='params!=null and params!=null'>" +
-            "${params}" +
+            " and ${params}" +
             "</if>" +
             "</script>")
     List<ZhcxPersistentManageDo> listData(Map<String, Object> map);
@@ -27,7 +27,7 @@ public interface ZhcxPersistentManageDao extends BaseMapper<ZhcxPersistentManage
             "where 1=1 and DELETED = '0' and PERIOD = #{period} and YEAR(CREATEDATE) = #{year} " +
             "and FILL LIKE '%${type}%' and FIRSTORGNAME is not null " +
             "<if test='params!=null and params!=null'>" +
-            "${params}" +
+            " and ${params}" +
             "</if>" +
             "GROUP BY FIRSTORGNAME ,TYPE"+
             "</script>")

+ 15 - 2
business-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ZhcxPersistentManageServiceImpl.java

@@ -195,6 +195,17 @@ public class ZhcxPersistentManageServiceImpl extends ServiceImpl<ZhcxPersistentM
                                     item.setRewardAmount(ev.getAmount());
                                 }
                             });
+                            boolean b = listData.stream().anyMatch(item -> {
+                                if (item.getFirstorgname().equals(ev.getFirstorgname())) {
+                                    return true;
+                                } else {
+                                    return false;
+                                }
+                            });
+                            if(!b){
+                                ev.setRewardAmount(ev.getAmount());
+                                listData.add(ev);
+                            }
                         }
                     });
                     List<Map<String, Object>> maps = convertList(listData, ZhcxPersistentWordVO.class);
@@ -256,7 +267,7 @@ public class ZhcxPersistentManageServiceImpl extends ServiceImpl<ZhcxPersistentM
             try {
                 doc[0].updateFields();
                 response.setContentType("application/octet-stream;charset=ISO8859-1");
-                response.setHeader("Content-Disposition", "attachment;filename=" + "测试1");
+                response.setHeader("Content-Disposition", "attachment;filename=" + "报告");
                 doc[0].save(response.getOutputStream(), com.aspose.words.SaveOptions.createSaveOptions(com.aspose.words.SaveFormat.DOCX));
             } catch (Exception e) {
                 log.info("顽症导出word失败:"+e);
@@ -401,10 +412,12 @@ public class ZhcxPersistentManageServiceImpl extends ServiceImpl<ZhcxPersistentM
                             builder.insertImage(inputStream, 100, 80); // 设置图片宽度和高度
                         }
                     }
+                }else{
+                    range.replace("pic", "");
                 }
             }
             range.replace("index",String.valueOf(i));
-            range.replace("pic", sitepic);
+
             range.replace("content",projectcode+projectename+content);
             range.replace("code", baseinfonum);
             if (amount != null) {

+ 27 - 3
business-entity/src/main/java/com/rongwei/bsentity/domain/ZhcxPersistentManageDo.java

@@ -1,6 +1,9 @@
 package com.rongwei.bsentity.domain;
 
 import java.math.BigDecimal;
+
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableLogic;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.rongwei.rwcommon.base.BaseDo;
 import java.util.Date;
@@ -18,10 +21,9 @@ import lombok.experimental.Accessors;
  * @since 2024-05-20
  */
 @Data
-@EqualsAndHashCode(callSuper = true)
 @Accessors(chain = true)
 @TableName("ZHCX_PERSISTENT_MANAGE")
-public class ZhcxPersistentManageDo extends BaseDo {
+public class ZhcxPersistentManageDo {
 
     private static final long serialVersionUID=1L;
 
@@ -241,5 +243,27 @@ public class ZhcxPersistentManageDo extends BaseDo {
     @TableField("BELONGORGNAME")
     private String belongorgname;
 
-
+    @TableLogic
+    @TableField(value = "DELETED")
+    private String deleted;
+    //备注
+    private String remark;
+    //创建时间
+    @TableField(value = "CREATEDATE", fill = FieldFill.INSERT)
+    private Date createdate;
+    //创建人ID
+    @TableField(value = "CREATEUSERID", fill = FieldFill.INSERT)
+    private String createuserid;
+    //创建人名称
+    @TableField(value = "CREATEUSERNAME", fill = FieldFill.INSERT)
+    private String createusername;
+    //更新时间
+    @TableField(value = "MODIFYDATE", fill = FieldFill.INSERT_UPDATE)
+    private Date modifydate;
+    //更新人ID
+    @TableField(value = "MODIFYUSERID", fill = FieldFill.INSERT_UPDATE)
+    private String modifyuserid;
+    //更新人名称
+    @TableField(value = "MODIFYUSERNAME", fill = FieldFill.INSERT_UPDATE)
+    private String modifyusername;
 }