浏览代码

消息/费用增加类别/国内专利导出

licailing 4 年之前
父节点
当前提交
f0f40d820c

+ 18 - 2
src/main/java/com/izouma/uwip/domain/Fee.java

@@ -1,5 +1,6 @@
 package com.izouma.uwip.domain;
 
+import com.izouma.uwip.enums.Category;
 import com.izouma.uwip.enums.PayStatus;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -7,9 +8,10 @@ import lombok.AllArgsConstructor;
 import lombok.Builder;
 import lombok.Data;
 import lombok.NoArgsConstructor;
+import org.hibernate.annotations.NotFound;
+import org.hibernate.annotations.NotFoundAction;
 
-import javax.persistence.Entity;
-import javax.persistence.Transient;
+import javax.persistence.*;
 import java.math.BigDecimal;
 import java.time.LocalDate;
 
@@ -86,6 +88,10 @@ public class Fee extends BaseEntity {
 
     private Long userId;
 
+    @Column(nullable = false)
+    @Enumerated(EnumType.STRING)
+    private Category category;
+
     @Transient
     private String patentPartner;
 
@@ -94,4 +100,14 @@ public class Fee extends BaseEntity {
 
     @Transient
     private String currency;
+
+    @ManyToOne(fetch = FetchType.LAZY)
+    @JoinColumn(name = "patentId", insertable = false, updatable = false, foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
+    @NotFound(action = NotFoundAction.IGNORE)
+    private Patent patent;
+
+    @ManyToOne(fetch = FetchType.LAZY)
+    @JoinColumn(name = "patentId", insertable = false, updatable = false, foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
+    @NotFound(action = NotFoundAction.IGNORE)
+    private LogoPatent lPatent;
 }

+ 3 - 2
src/main/java/com/izouma/uwip/domain/Message.java

@@ -22,8 +22,9 @@ import java.util.List;
 @Where(clause = "del = 0")
 public class Message extends BaseEntity {
     @ApiModelProperty(value = "接收人")
-    @Convert(converter = LongArrayConverter.class)
-    private List<Long> receiveUserId;
+//    @Convert(converter = LongArrayConverter.class)
+//    private List<Long> receiveUserId;
+    private Long receiveUserId;
 
     @ApiModelProperty(value = "是否已读")
     private boolean isRead;

+ 4 - 5
src/main/java/com/izouma/uwip/domain/Patent.java

@@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
 import com.izouma.uwip.annotations.Searchable;
 import com.izouma.uwip.converter.HandleListConverter;
 import com.izouma.uwip.enums.ApplyStatus;
+import com.izouma.uwip.enums.Category;
 import com.izouma.uwip.enums.PatentType;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -26,7 +27,6 @@ import java.util.List;
 @Where(clause = "del = 0")
 @JsonIgnoreProperties(value = {"hibernateLazyInitializer"}, ignoreUnknown = true)
 public class Patent extends BaseEntity {
-//    private String workflow;
 
     @Searchable
     @ApiModelProperty(value = "专利名称")
@@ -106,10 +106,9 @@ public class Patent extends BaseEntity {
     @Convert(converter = HandleListConverter.class)
     private List<Handle> handle;
 
-    /*
-    0-国内 1-国际 2-国家
-     */
-    private int category;
+    @Column(nullable = false)
+    @Enumerated(EnumType.STRING)
+    private Category category;
 
     private String flow;
 

+ 56 - 5
src/main/java/com/izouma/uwip/dto/DomesticPatentDTO.java

@@ -1,6 +1,8 @@
 package com.izouma.uwip.dto;
 
 import cn.hutool.core.bean.BeanUtil;
+import com.alibaba.excel.annotation.ExcelIgnore;
+import com.alibaba.excel.annotation.ExcelProperty;
 import com.izouma.uwip.domain.DomesticPatent;
 import com.izouma.uwip.domain.Handle;
 import com.izouma.uwip.domain.Patent;
@@ -23,36 +25,47 @@ import java.util.List;
 @Data
 @Builder
 @NoArgsConstructor
-@ApiModel(value = "国内申请")
+@ApiModel(value = "DomesticPatent", description = "国内申请")
 public class DomesticPatentDTO {
+    @ExcelIgnore
     private Long did;
 
+    @ExcelIgnore
     private Long patentId;
 
+    @ExcelIgnore
     @ApiModelProperty(value = "流程")
     private DomesticWorkflow workflow;
 
+    @ExcelProperty(value = "申请人统一社会信用代码")
     @ApiModelProperty(value = "申请人统一社会信用代码")
     private String applicantUscc;
 
+    @ExcelProperty(value = "第一发明人身份证")
     @ApiModelProperty(value = "第一发明人身份证")
     private String inventorIdno;
 
+    @ExcelProperty(value = "是否请求费减")
     @ApiModelProperty(value = "是否请求费减")
     private boolean deduction;
 
+    @ExcelProperty(value = "是否请求实质审查")
     @ApiModelProperty(value = "是否请求实质审查")
     private boolean essentialReview;
 
+    @ExcelProperty(value = "是否申请提前公开")
     @ApiModelProperty(value = "是否申请提前公开")
     private boolean publicInAdvance;
 
+    @ExcelProperty(value = "是否申请红章受理通知书")
     @ApiModelProperty(value = "是否申请红章受理通知书")
     private boolean chapterAcceptanceNotice;
 
+    @ExcelProperty(value = "是否申请红章缴费通知书")
     @ApiModelProperty(value = "是否申请红章缴费通知书")
     private boolean chapterPaymentNotice;
 
+    @ExcelProperty(value = "是否决定答复")
     @ApiModelProperty(value = "是否决定答复")
     private Boolean decideReply;
 
@@ -60,111 +73,149 @@ public class DomesticPatentDTO {
     true 客户准备
     false 律师准备
      */
+    @ExcelProperty(value = "准备答复意见")
     @ApiModelProperty(value = "准备答复意见")
     private Boolean isClientReady;
 
+    @ExcelProperty(value = "是否通过答复")
     @ApiModelProperty(value = "是否通过答复")
     private Boolean replyPassed;
 
+    @ExcelProperty(value = "办登通知日")
     @ApiModelProperty(value = "办登通知日")
     private LocalDate registerNotice;
 
+    @ExcelProperty(value = "办登截止日")
     @ApiModelProperty(value = "办登截止日")
     private LocalDate registerEndDate;
 
+    @ExcelProperty(value = "费用备注")
     @ApiModelProperty(value = "费用备注")
     private String feeRemark;
 
+    @ExcelProperty(value = "是否已缴费")
     @ApiModelProperty(value = "是否已缴费")
     private Boolean payment;
 
+    @ExcelProperty(value = "年费")
     @ApiModelProperty(value = "年费")
     private BigDecimal annualFee;
 
+    @ExcelProperty(value = "年费支付期限")
     @ApiModelProperty(value = "年费支付期限")
     private LocalDate feePaymentPeriod;
 
+    @ExcelProperty(value = "账单")
     @ApiModelProperty(value = "账单")
     private String bill;
 
+    @ExcelProperty(value = "专利名称")
     @ApiModelProperty(value = "专利名称")
     private String name;
 
+    @ExcelIgnore
     private ApplyStatus applyStatus;
 
+    @ExcelIgnore
     @ApiModelProperty(value = "专利类型")
     private PatentType type;
 
     /*
     客户编码(由客户经理填写)+年份+案件类型+连接符+案件阶段[+国家]+序列号
      */
+    @ExcelProperty(value = "寰球案号")
     @ApiModelProperty(value = "寰球案号")
     private String uwNo;
 
+    @ExcelIgnore
     @ApiModelProperty(value = "客户id")
     private Long clientPartnerId;
 
+    @ExcelIgnore
     @ApiModelProperty(value = "供应商")
     private Long supplierPartnerId;
 
+    @ExcelProperty(value = "供应商案号")
     @ApiModelProperty(value = "供应商案号")
     private String supplierNo;
 
+    @ExcelProperty(value = "供应商提交期限")
     @ApiModelProperty(value = "供应商提交期限")
     private LocalDate supplierSubmitPeriod;
 
+    @ExcelProperty(value = "申请人名称")
     @ApiModelProperty(value = "申请人名称")
     private String applicantName;
 
+    @ExcelProperty(value = "申请人英文名称")
     @ApiModelProperty(value = "申请人英文名称")
     private String applicantEnName;
 
+    @ExcelProperty(value = "申请人地址")
     @ApiModelProperty(value = "申请人地址")
     private String applicantAddress;
 
+    @ExcelProperty(value = "申请人英文地址")
     @ApiModelProperty(value = "申请人英文地址")
     private String applicantEnAddress;
 
+    @ExcelProperty(value = "发明人名称")
     @ApiModelProperty(value = "发明人名称")
     private String inventorName;
 
+    @ExcelProperty(value = "发明人英文名称")
     @ApiModelProperty(value = "发明人英文名称")
     private String inventorEnName;
 
+    @ExcelProperty(value = "优先权号")
     @ApiModelProperty(value = "优先权号")
     private String priorityNo;
 
+    @ExcelProperty(value = "优先权日")
     @ApiModelProperty(value = "优先权日")
     private LocalDate priorityDate;
 
+    @ExcelProperty(value = "优先权国别")
     @ApiModelProperty(value = "优先权国别")
     private String priorityCountry;
 
+    @ExcelProperty(value = "内部期限")
     @ApiModelProperty(value = "提交期限/内部期限")
     private LocalDate submitPeriod;
 
     /*
     =优先权日+30个月
      */
+    @ExcelProperty(value = "官方期限")
     @ApiModelProperty(value = "官方期限")
     private LocalDate officialPeriod;
 
+    @ExcelProperty(value = "申请号")
     @ApiModelProperty(value = "申请号")
     private String applyNo;
 
+    @ExcelProperty(value = "申请日")
     @ApiModelProperty(value = "申请日")
     private LocalDate applyDate;
-
+    @ExcelIgnore
     public List<AttachmentDTO> attachments;
 
+    @ExcelIgnore
     public LocalDate period;
 
+    @ExcelIgnore
     private List<Handle> handle = new ArrayList<>();
 
-    public DomesticPatentDTO(DomesticPatent dPatent, Patent patent){
-        BeanUtil.copyProperties(dPatent,this);
-        BeanUtil.copyProperties(patent,this);
+    public DomesticPatentDTO(DomesticPatent dPatent, Patent patent) {
+        BeanUtil.copyProperties(dPatent, this);
+        BeanUtil.copyProperties(patent, this);
         this.did = dPatent.getId();
         this.patentId = patent.getId();
     }
+
+    public DomesticPatentDTO(DomesticPatent dPatent) {
+        BeanUtil.copyProperties(dPatent, this);
+        BeanUtil.copyProperties(dPatent.getPatent(), this);
+        this.did = dPatent.getId();
+    }
 }

+ 8 - 0
src/main/java/com/izouma/uwip/enums/Category.java

@@ -0,0 +1,8 @@
+package com.izouma.uwip.enums;
+
+public enum Category {
+    DOMESTIC,
+    INTERNATIONAL,
+    COUNTRY,
+    LOGO
+}

+ 8 - 2
src/main/java/com/izouma/uwip/repo/MessageRepo.java

@@ -15,6 +15,12 @@ public interface MessageRepo extends JpaRepository<Message, Long>, JpaSpecificat
     @Transactional
     void softDelete(Long id);
 
-    @Query(nativeQuery = true, value = "select * from message where find_in_set(?1, receive_user_id)")
-    List<Message> findMy(Long userId);
+    @Query("update Message t set t.isRead = true where t.receiveUserId = ?1")
+    @Modifying
+    @Transactional
+    void batchRead(Long userId);
+
+    List<Message> findAllByReceiveUserId(Long receiveUserId);
+//    @Query(nativeQuery = true, value = "select * from message where find_in_set(?1, receive_user_id)")
+//    List<Message> findMy(Long userId);
 }

+ 2 - 5
src/main/java/com/izouma/uwip/service/CountryPatentService.java

@@ -8,10 +8,7 @@ import com.izouma.uwip.domain.InternationalPatent;
 import com.izouma.uwip.domain.Patent;
 import com.izouma.uwip.dto.CountryPatentDTO;
 import com.izouma.uwip.dto.PageQuery;
-import com.izouma.uwip.enums.ApplyStatus;
-import com.izouma.uwip.enums.CaseStage;
-import com.izouma.uwip.enums.CaseType;
-import com.izouma.uwip.enums.CountryWorkflow;
+import com.izouma.uwip.enums.*;
 import com.izouma.uwip.exception.BusinessException;
 import com.izouma.uwip.repo.CountryPatentRepo;
 import com.izouma.uwip.repo.PatentRepo;
@@ -82,7 +79,7 @@ public class CountryPatentService {
         Patent patent = new Patent();
         BeanUtil.copyProperties(record, patent);
         patent.setSort(patentRepo.findMax());
-        patent.setCategory(2);
+        patent.setCategory(Category.COUNTRY);
 
         // 寰球案号
         String type = patent.getType().name();

+ 12 - 40
src/main/java/com/izouma/uwip/service/DomesticPatentService.java

@@ -2,13 +2,15 @@ package com.izouma.uwip.service;
 
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.ObjectUtil;
-import com.izouma.uwip.domain.*;
+import com.izouma.uwip.domain.DomesticPatent;
+import com.izouma.uwip.domain.Handle;
+import com.izouma.uwip.domain.Patent;
+import com.izouma.uwip.domain.User;
 import com.izouma.uwip.dto.DomesticPatentDTO;
 import com.izouma.uwip.dto.PageQuery;
 import com.izouma.uwip.enums.*;
 import com.izouma.uwip.exception.BusinessException;
 import com.izouma.uwip.repo.DomesticPatentRepo;
-import com.izouma.uwip.repo.MessageRepo;
 import com.izouma.uwip.repo.PatentRepo;
 import com.izouma.uwip.repo.UserRepo;
 import com.izouma.uwip.security.Authority;
@@ -34,7 +36,7 @@ public class DomesticPatentService {
     private final PartnerService     partnerService;
     private final PatentService      patentService;
     private final UserRepo           userRepo;
-    private final MessageRepo        messageRepo;
+    private final MessageService     messageService;
 
     public Page<DomesticPatent> all(PageQuery pageQuery) {
         return domesticPatentRepo.findAll(JpaUtils.toSpecification(pageQuery, DomesticPatent.class), JpaUtils.toPageRequest(pageQuery));
@@ -81,7 +83,7 @@ public class DomesticPatentService {
         Patent patent = new Patent();
         BeanUtil.copyProperties(record, patent);
         patent.setSort(patentRepo.findMax());
-        patent.setCategory(0);
+        patent.setCategory(Category.DOMESTIC);
 
         //寰球案号
         PatentType type = patent.getType();
@@ -118,65 +120,35 @@ public class DomesticPatentService {
                 return ApplyStatus.APPLY_STAGE;
             case MAINTAIN_CASE://申请号/申请日
                 //发送消息-客户经理
-                messageRepo.save(
-                        Message.builder()
-                                .receiveUserId(accountIds)
-                                .title("国内专利:" + name)
-                                .content("收到一条待维护案件专利")
-                                .build());
+                messageService.batchSave(accountIds,"国内专利:"+name,"收到一条待维护案件专利");
                 return ApplyStatus.APPLY_STAGE;
             case REPLY_TO_NOTICE://官方期限/内部期限
                 //发送消息-项目经理
-                messageRepo.save(
-                        Message.builder()
-                                .receiveUserId(projectIds)
-                                .title("国内专利:" + name)
-                                .content("收到一条上传答复通知专利")
-                                .build());
+                messageService.batchSave(projectIds,"国内专利:"+name,"收到一条上传答复通知专利");
                 return ApplyStatus.APPLY_STAGE;
 
             case PENDING_REVIEW://是否答复 待审查
                 //发送消息-客户经理
-                messageRepo.save(
-                        Message.builder()
-                                .receiveUserId(accountIds)
-                                .title("国内专利:" + name)
-                                .content("收到一条待审查专利")
-                                .build());
+                messageService.batchSave(accountIds,"国内专利:"+name,"收到一条待审查专利");
 
                 return ApplyStatus.APPLY_STAGE;//申请阶段
             case REPLY_SUBMISSIONS://答复意见书
                 return ApplyStatus.SUBSTANTIVE_STAGE;// 实审阶段
             case REPLY_RESULT://答复结果
                 //发送消息-项目经理
-                messageRepo.save(
-                        Message.builder()
-                                .receiveUserId(projectIds)
-                                .title("国内专利:" + name)
-                                .content("收到一条待上传答复通知专利")
-                                .build());
+                messageService.batchSave(projectIds,"国内专利:"+name,"收到一条待上传答复通知专利");
 
                 return ApplyStatus.REVIEW_STAGE;//复查阶段
             case PENDING_REGISTER://办登通知日
                 //发送消息-客户经理
-                messageRepo.save(
-                        Message.builder()
-                                .receiveUserId(accountIds)
-                                .title("国内专利:" + name)
-                                .content("收到一条待待办登专利")
-                                .build());
+                messageService.batchSave(accountIds,"国内专利:"+name,"收到一条待待办登专利");
                 return ApplyStatus.GRANT_STAGE;
 
             case PAYMENT_REGISTER://是否缴费
                 return ApplyStatus.GRANT_STAGE;
             case REGISTER://办登登记
                 //发送消息-项目经理
-                messageRepo.save(
-                        Message.builder()
-                                .receiveUserId(projectIds)
-                                .title("国内专利:" + name)
-                                .content("收到一条待办理登记专利")
-                                .build());
+                messageService.batchSave(projectIds,"国内专利:"+name,"收到一条待办理登记专利");
 
             case ANNUAL_FEE://维护费用
                 return ApplyStatus.GRANT_STAGE;//授权阶段

+ 1 - 1
src/main/java/com/izouma/uwip/service/InternationalPatentService.java

@@ -75,7 +75,7 @@ public class InternationalPatentService {
         Patent patent = new Patent();
         BeanUtil.copyProperties(record, patent);
         patent.setSort(patentRepo.findMax());
-        patent.setCategory(1);
+        patent.setCategory(Category.INTERNATIONAL);
 
         //寰球案号
         PatentType type = patent.getType();

+ 11 - 0
src/main/java/com/izouma/uwip/service/MessageService.java

@@ -8,6 +8,8 @@ import lombok.AllArgsConstructor;
 import org.springframework.data.domain.Page;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 @Service
 @AllArgsConstructor
 public class MessageService {
@@ -17,4 +19,13 @@ public class MessageService {
     public Page<Message> all(PageQuery pageQuery) {
         return messageRepo.findAll(JpaUtils.toSpecification(pageQuery, Message.class), JpaUtils.toPageRequest(pageQuery));
     }
+
+    public void batchSave(List<Long> userIds, String name, String content) {
+        userIds.forEach(id -> messageRepo.save(Message.builder()
+                .title(name)
+                .content(content)
+                .receiveUserId(id)
+                .build()));
+
+    }
 }

+ 8 - 7
src/main/java/com/izouma/uwip/service/PatentService.java

@@ -1,6 +1,5 @@
 package com.izouma.uwip.service;
 
-import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.StrUtil;
 import com.izouma.uwip.domain.Handle;
@@ -10,6 +9,7 @@ import com.izouma.uwip.dto.PageQuery;
 import com.izouma.uwip.dto.PatentDTO;
 import com.izouma.uwip.dto.TrendDTO;
 import com.izouma.uwip.enums.ApplyStatus;
+import com.izouma.uwip.enums.Category;
 import com.izouma.uwip.repo.LogoPatentRepo;
 import com.izouma.uwip.repo.PatentRepo;
 import com.izouma.uwip.utils.JpaUtils;
@@ -185,9 +185,9 @@ public class PatentService {
                             .filter(patent -> patent.getCreatedAt().getMonthValue() == finalMonth)
                             .collect(Collectors.toList());
                     for (Patent mp : monthPatents) {
-                        if (0 == mp.getCategory()) {
+                        if (Category.DOMESTIC.equals(mp.getCategory())) {
                             dp++;
-                        } else if (1 == mp.getCategory()) {
+                        } else if (Category.INTERNATIONAL.equals(mp.getCategory())) {
                             ip++;
                         } else {
                             cp++;
@@ -215,18 +215,19 @@ public class PatentService {
             int ip = 0;
             int cp = 0;
             LocalDate weekStart = now.minusDays(day - 1);
-            List<Patent> monthPatents = patents.stream()
+            List<Patent> monPatents = patents.stream()
                     .filter(patent -> patent.getCreatedAt().toLocalDate().equals(weekStart))
                     .collect(Collectors.toList());
-            for (Patent mp : monthPatents) {
-                if (0 == mp.getCategory()) {
+            for (Patent mp : monPatents) {
+                if (Category.DOMESTIC.equals(mp.getCategory())) {
                     dp++;
-                } else if (1 == mp.getCategory()) {
+                } else if (Category.INTERNATIONAL.equals(mp.getCategory())) {
                     ip++;
                 } else {
                     cp++;
                 }
             }
+//            System.out.println(monPatents);
             int lp = (int) lPatents.stream()
                     .filter(patent -> patent.getCreatedAt().toLocalDate().equals(weekStart))
                     .count();

+ 34 - 0
src/main/java/com/izouma/uwip/utils/excel/BooleanConverter.java

@@ -0,0 +1,34 @@
+package com.izouma.uwip.utils.excel;
+
+import com.alibaba.excel.converters.Converter;
+import com.alibaba.excel.enums.CellDataTypeEnum;
+import com.alibaba.excel.metadata.CellData;
+import com.alibaba.excel.metadata.GlobalConfiguration;
+import com.alibaba.excel.metadata.property.ExcelContentProperty;
+
+
+public class BooleanConverter implements Converter<Boolean> {
+    @Override
+    public Class supportJavaTypeKey() {
+        return Boolean.class;
+    }
+
+    @Override
+    public CellDataTypeEnum supportExcelTypeKey() {
+        return CellDataTypeEnum.STRING;
+    }
+
+    @Override
+    public Boolean convertToJavaData(CellData cellData, ExcelContentProperty excelContentProperty, GlobalConfiguration globalConfiguration) throws Exception {
+        return Boolean.valueOf(cellData.getStringValue());
+    }
+
+    @Override
+    public CellData convertToExcelData(Boolean booleanValue, ExcelContentProperty excelContentProperty, GlobalConfiguration globalConfiguration) throws Exception {
+        String str = "";
+        if (booleanValue != null) {
+            str = booleanValue ? "是" : "否";
+        }
+        return new CellData(str);
+    }
+}

+ 4 - 3
src/main/java/com/izouma/uwip/utils/excel/ExcelUtils.java

@@ -16,8 +16,9 @@ public class ExcelUtils<T> {
         response.setCharacterEncoding("utf-8");
         response.setHeader("Content-Disposition", "attachment;filename=" + fileName);
         EasyExcel.write(response.getOutputStream(), data.get(0).getClass()).sheet("sheet")
-                 .registerConverter(new LocalDateConverter())
-                 .registerConverter(new LocalDateTimeConverter())
-                 .doWrite(data);
+                .registerConverter(new LocalDateConverter())
+                .registerConverter(new LocalDateTimeConverter())
+                .registerConverter(new BooleanConverter())
+                .doWrite(data);
     }
 }

+ 3 - 1
src/main/java/com/izouma/uwip/web/DomesticPatentController.java

@@ -17,6 +17,7 @@ import org.springframework.web.bind.annotation.*;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.util.List;
+import java.util.stream.Collectors;
 
 @RestController
 @RequestMapping("/domesticPatent")
@@ -75,7 +76,8 @@ public class DomesticPatentController extends BaseController {
     @ResponseBody
     public void excel(HttpServletResponse response, PageQuery pageQuery) throws IOException {
         List<DomesticPatent> data = all(pageQuery).getContent();
-        ExcelUtils.export(response, data);
+        List<DomesticPatentDTO> dtos = data.stream().map(DomesticPatentDTO::new).collect(Collectors.toList());
+        ExcelUtils.export(response, dtos);
     }
 }
 

+ 9 - 3
src/main/java/com/izouma/uwip/web/MessageController.java

@@ -1,16 +1,16 @@
 package com.izouma.uwip.web;
 
 import com.izouma.uwip.domain.Message;
-import com.izouma.uwip.service.MessageService;
 import com.izouma.uwip.dto.PageQuery;
 import com.izouma.uwip.exception.BusinessException;
 import com.izouma.uwip.repo.MessageRepo;
+import com.izouma.uwip.service.MessageService;
 import com.izouma.uwip.utils.ObjUtils;
 import com.izouma.uwip.utils.SecurityUtils;
 import com.izouma.uwip.utils.excel.ExcelUtils;
+import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
 import org.springframework.data.domain.Page;
-import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletResponse;
@@ -61,7 +61,13 @@ public class MessageController extends BaseController {
 
     @GetMapping("/my")
     public List<Message> my() {
-        return messageRepo.findMy(SecurityUtils.getAuthenticatedUser().getId());
+        return messageRepo.findAllByReceiveUserId(SecurityUtils.getAuthenticatedUser().getId());
+    }
+
+    @GetMapping("/batchRead")
+    @ApiOperation("批量已读")
+    public void batchRead() {
+        messageRepo.batchRead(SecurityUtils.getAuthenticatedUser().getId());
     }
 }
 

+ 9 - 0
src/main/vue/src/components/fee/FeeAdd.vue

@@ -264,6 +264,15 @@ export default {
             if (this.info.patentId || this.info.id) {
                 data.patentId = this.info.patentId || this.info.id;
             }
+            if (this.info.id) {
+                data.category = 'LOGO';
+            } else if (this.info.did) {
+                data.category = 'DOMESTIC';
+            } else if (this.info.iid) {
+                data.category = 'INTERNATIONAL';
+            } else {
+                data.category = 'COUNTRY';
+            }
             this.saving = true;
             this.$http
                 .post('/fee/save', data, { body: 'json' })

+ 1 - 1
src/test/java/com/izouma/uwip/service/PatentServiceTest.java

@@ -28,7 +28,7 @@ public class PatentServiceTest extends ApplicationTests {
 
     @Test
     public void test1() {
-        System.out.println(patentService.getData(patentRepo.findAll(), logoPatentRepo.findAll(), LocalDate.now(), 7));
+//        System.out.println(patentService.getData(patentRepo.findAll(), logoPatentRepo.findAll(), LocalDate.now(), 7));
         List<TrendDTO> dto = new ArrayList<>();
         patentService.getEveryDay(patentRepo.findAll(), logoPatentRepo.findAll(), dto, LocalDate
                 .now(), 7);