Browse Source

流程/阶段

licailing 5 years ago
parent
commit
811c03b1ec

+ 6 - 0
src/main/java/com/izouma/uwip/domain/DomesticPatent.java

@@ -1,5 +1,7 @@
 package com.izouma.uwip.domain;
 package com.izouma.uwip.domain;
 
 
+import cn.hutool.core.bean.BeanUtil;
+import com.izouma.uwip.dto.DomesticPatentVO;
 import com.izouma.uwip.enums.DomesticWorkflow;
 import com.izouma.uwip.enums.DomesticWorkflow;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiModelProperty;
@@ -81,4 +83,8 @@ public class DomesticPatent extends BaseEntity {
 
 
     @ApiModelProperty(value = "账单")
     @ApiModelProperty(value = "账单")
     private String bill;
     private String bill;
+
+    public DomesticPatent(DomesticPatentVO vo) {
+        BeanUtil.copyProperties(vo, this);
+    }
 }
 }

+ 1 - 0
src/main/java/com/izouma/uwip/domain/Partner.java

@@ -61,4 +61,5 @@ public class Partner extends BaseEntity {
 
 
     @ApiModelProperty(value = "账号")
     @ApiModelProperty(value = "账号")
     private String account;
     private String account;
+
 }
 }

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

@@ -146,19 +146,19 @@ public interface DomesticPatentDTO {
 
 
     String getInventorIdno();
     String getInventorIdno();
 
 
-    boolean isDeduction();
+    boolean getDeduction();
 
 
-    boolean isEssentialReview();
+    Boolean getEssentialReview();
 
 
-    boolean isPublicInAdvance();
+    Boolean getPublicInAdvance();
 
 
-    boolean isChapterAcceptanceNotice();
+    Boolean getChapterAcceptanceNotice();
 
 
-    boolean isChapterPaymentNotice();
+    Boolean getChapterPaymentNotice();
 
 
     Boolean getDecideReply();
     Boolean getDecideReply();
 
 
-    Boolean getClientReady();
+    Boolean getIsClientReady();
 
 
     Boolean getReplyPassed();
     Boolean getReplyPassed();
 
 

+ 3 - 0
src/main/java/com/izouma/uwip/dto/DomesticPatentVO.java

@@ -12,6 +12,7 @@ import lombok.NoArgsConstructor;
 
 
 import java.math.BigDecimal;
 import java.math.BigDecimal;
 import java.time.LocalDate;
 import java.time.LocalDate;
+import java.util.List;
 
 
 @AllArgsConstructor
 @AllArgsConstructor
 @Data
 @Data
@@ -148,4 +149,6 @@ public class DomesticPatentVO {
 
 
     @ApiModelProperty(value = "申请日")
     @ApiModelProperty(value = "申请日")
     private LocalDate applyDate;
     private LocalDate applyDate;
+
+    public List<AttachmentDTO> attachments;
 }
 }

+ 4 - 3
src/main/java/com/izouma/uwip/repo/DomesticPatentRepo.java

@@ -9,6 +9,7 @@ import org.springframework.data.jpa.repository.Query;
 
 
 import javax.transaction.Transactional;
 import javax.transaction.Transactional;
 import java.util.List;
 import java.util.List;
+import java.util.Optional;
 
 
 public interface DomesticPatentRepo extends JpaRepository<DomesticPatent, Long>, JpaSpecificationExecutor<DomesticPatent> {
 public interface DomesticPatentRepo extends JpaRepository<DomesticPatent, Long>, JpaSpecificationExecutor<DomesticPatent> {
     @Query("update DomesticPatent t set t.del = true where t.id = ?1")
     @Query("update DomesticPatent t set t.del = true where t.id = ?1")
@@ -16,11 +17,11 @@ public interface DomesticPatentRepo extends JpaRepository<DomesticPatent, Long>,
     @Transactional
     @Transactional
     void softDelete(Long id);
     void softDelete(Long id);
 
 
-    @Query(nativeQuery = true, value = "select d.*,p.id as patentId," +
+    @Query(nativeQuery = true, value = "select d.*,d.id as did,p.id as patentId," +
             "applicant_address, applicant_en_address, applicant_en_name, applicant_name, apply_date, apply_no, " +
             "applicant_address, applicant_en_address, applicant_en_name, applicant_name, apply_date, apply_no, " +
             "client_partner_id, inventor_en_name, inventor_name, name, official_period, priority_country, priority_date, " +
             "client_partner_id, inventor_en_name, inventor_name, name, official_period, priority_country, priority_date, " +
             "priority_no, status, submit_period, supplier_no, supplier_partner_id, supplier_submit_period, type, uw_no " +
             "priority_no, status, submit_period, supplier_no, supplier_partner_id, supplier_submit_period, type, uw_no " +
             "from domestic_patent d left join patent p on d.patent_id = p.id " +
             "from domestic_patent d left join patent p on d.patent_id = p.id " +
-            "where d.id = ?1")
-    List<DomesticPatentDTO> findDomesticDTO(Long id);
+            "where d.id = ?1 and d.del = false")
+    Optional<DomesticPatentDTO> findDomesticDTO(Long id);
 }
 }

+ 33 - 0
src/main/java/com/izouma/uwip/service/DomesticPatentService.java

@@ -1,10 +1,17 @@
 package com.izouma.uwip.service;
 package com.izouma.uwip.service;
 
 
+import cn.hutool.core.bean.BeanUtil;
 import com.izouma.uwip.domain.DomesticPatent;
 import com.izouma.uwip.domain.DomesticPatent;
+import com.izouma.uwip.domain.Partner;
+import com.izouma.uwip.dto.DomesticPatentVO;
 import com.izouma.uwip.dto.PageQuery;
 import com.izouma.uwip.dto.PageQuery;
+import com.izouma.uwip.exception.BusinessException;
 import com.izouma.uwip.repo.DomesticPatentRepo;
 import com.izouma.uwip.repo.DomesticPatentRepo;
+import com.izouma.uwip.repo.PartnerRepo;
 import com.izouma.uwip.utils.JpaUtils;
 import com.izouma.uwip.utils.JpaUtils;
+import com.izouma.uwip.utils.ObjUtils;
 import lombok.AllArgsConstructor;
 import lombok.AllArgsConstructor;
+import org.apache.commons.collections.CollectionUtils;
 import org.springframework.data.domain.Page;
 import org.springframework.data.domain.Page;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
@@ -13,8 +20,34 @@ import org.springframework.stereotype.Service;
 public class DomesticPatentService {
 public class DomesticPatentService {
 
 
     private final DomesticPatentRepo domesticPatentRepo;
     private final DomesticPatentRepo domesticPatentRepo;
+    private final AttachmentService  attachmentService;
+    private final PartnerRepo        partnerRepo;
 
 
     public Page<DomesticPatent> all(PageQuery pageQuery) {
     public Page<DomesticPatent> all(PageQuery pageQuery) {
         return domesticPatentRepo.findAll(JpaUtils.toSpecification(pageQuery, DomesticPatent.class), JpaUtils.toPageRequest(pageQuery));
         return domesticPatentRepo.findAll(JpaUtils.toSpecification(pageQuery, DomesticPatent.class), JpaUtils.toPageRequest(pageQuery));
     }
     }
+
+    public DomesticPatent saveDTO(DomesticPatentVO record, Long id) {
+        if (record.getDid() != null) {
+            DomesticPatent orig = domesticPatentRepo.findById(record.getDid())
+                    .orElseThrow(new BusinessException("无记录"));
+            DomesticPatent dPatent = new DomesticPatent(record);
+            ObjUtils.merge(orig, dPatent);
+            orig = domesticPatentRepo.save(orig);
+
+            Partner orig1 = partnerRepo.findById(record.getPatentId()).orElseThrow(new BusinessException("无记录"));
+            Partner partner = new Partner();
+
+            ObjUtils.merge(orig1, record);
+            // 保存附件
+            if (CollectionUtils.isNotEmpty(record.getAttachments())) {
+                attachmentService.batchSave(record.getAttachments(), id, record.getDid());
+            }
+
+
+            return orig;
+        }
+//        return domesticPatentRepo.save(record);
+        return null;
+    }
 }
 }

+ 14 - 11
src/main/java/com/izouma/uwip/service/LogoPatentService.java

@@ -79,17 +79,20 @@ public class LogoPatentService {
 
 
     public ApplyStatus getApplyStatus(LogoWorkflow logoWorkflow) {
     public ApplyStatus getApplyStatus(LogoWorkflow logoWorkflow) {
         switch (logoWorkflow) {
         switch (logoWorkflow) {
-            case IS_CONTRACT:
-            case TO_BE_MAINTAINED:
-            case PENDING:
-                return ApplyStatus.APPLY_STAGE;
-            case PENDING_REVIEW:
-            case DISMISS:
-            case ANNOUNCEMENTS:
-                return ApplyStatus.REVIEW_STAGE;
-            case HANDLE:
-                return ApplyStatus.GRANT_STAGE;
-            default:
+            case IS_CONTRACT://签约
+            case TO_BE_MAINTAINED://供应商
+            case PENDING://受理
+            case PALINDROME_CORRECTION://回文
+            case PENDING_PAYMENT://缴费
+                return ApplyStatus.APPLY_STAGE;//申请阶段
+            case PENDING_REVIEW://待审查
+            case DISMISS://驳回
+            case REVIEW_MATERIALS://复审材料
+            case ANNOUNCEMENTS://公告初审
+                return ApplyStatus.REVIEW_STAGE;//审查阶段
+            case HANDLE://证件
+                return ApplyStatus.GRANT_STAGE;//授权阶段
+            default://不缴费/不复审
                 return ApplyStatus.COMPLETED;
                 return ApplyStatus.COMPLETED;
         }
         }
     }
     }

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

@@ -1,12 +1,18 @@
 package com.izouma.uwip.web;
 package com.izouma.uwip.web;
+
+import cn.hutool.core.bean.BeanUtil;
 import com.izouma.uwip.domain.DomesticPatent;
 import com.izouma.uwip.domain.DomesticPatent;
+import com.izouma.uwip.dto.DomesticPatentDTO;
+import com.izouma.uwip.dto.DomesticPatentVO;
 import com.izouma.uwip.service.DomesticPatentService;
 import com.izouma.uwip.service.DomesticPatentService;
 import com.izouma.uwip.dto.PageQuery;
 import com.izouma.uwip.dto.PageQuery;
 import com.izouma.uwip.exception.BusinessException;
 import com.izouma.uwip.exception.BusinessException;
 import com.izouma.uwip.repo.DomesticPatentRepo;
 import com.izouma.uwip.repo.DomesticPatentRepo;
 import com.izouma.uwip.utils.ObjUtils;
 import com.izouma.uwip.utils.ObjUtils;
+import com.izouma.uwip.utils.SecurityUtils;
 import com.izouma.uwip.utils.excel.ExcelUtils;
 import com.izouma.uwip.utils.excel.ExcelUtils;
 import lombok.AllArgsConstructor;
 import lombok.AllArgsConstructor;
+import org.apache.commons.collections.CollectionUtils;
 import org.springframework.data.domain.Page;
 import org.springframework.data.domain.Page;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
@@ -20,7 +26,7 @@ import java.util.List;
 @AllArgsConstructor
 @AllArgsConstructor
 public class DomesticPatentController extends BaseController {
 public class DomesticPatentController extends BaseController {
     private final DomesticPatentService domesticPatentService;
     private final DomesticPatentService domesticPatentService;
-    private final DomesticPatentRepo domesticPatentRepo;
+    private final DomesticPatentRepo    domesticPatentRepo;
 
 
     //@PreAuthorize("hasRole('ADMIN')")
     //@PreAuthorize("hasRole('ADMIN')")
     @PostMapping("/save")
     @PostMapping("/save")
@@ -33,6 +39,11 @@ public class DomesticPatentController extends BaseController {
         return domesticPatentRepo.save(record);
         return domesticPatentRepo.save(record);
     }
     }
 
 
+    @PostMapping("/saveDTO")
+    public DomesticPatent saveDTO(@RequestBody DomesticPatentVO record) {
+        return domesticPatentService.saveDTO(record, SecurityUtils.getAuthenticatedUser().getId());
+    }
+
 
 
     //@PreAuthorize("hasRole('ADMIN')")
     //@PreAuthorize("hasRole('ADMIN')")
     @PostMapping("/all")
     @PostMapping("/all")
@@ -45,6 +56,11 @@ public class DomesticPatentController extends BaseController {
         return domesticPatentRepo.findById(id).orElseThrow(new BusinessException("无记录"));
         return domesticPatentRepo.findById(id).orElseThrow(new BusinessException("无记录"));
     }
     }
 
 
+    @GetMapping("/getDTO/{id}")
+    public DomesticPatentDTO getDTO(@PathVariable Long id) {
+        return domesticPatentRepo.findDomesticDTO(id).orElseThrow(new BusinessException("无记录"));
+    }
+
     @PostMapping("/del/{id}")
     @PostMapping("/del/{id}")
     public void del(@PathVariable Long id) {
     public void del(@PathVariable Long id) {
         domesticPatentRepo.softDelete(id);
         domesticPatentRepo.softDelete(id);

+ 2 - 2
src/main/vue/src/views/DomesticPatentEdit.vue

@@ -117,7 +117,7 @@ export default {
     created() {
     created() {
         if (this.$route.query.id) {
         if (this.$route.query.id) {
             this.$http
             this.$http
-                .get('domesticPatent/get/' + this.$route.query.id)
+                .get('domesticPatent/getDTO/' + this.$route.query.id)
                 .then(res => {
                 .then(res => {
                     this.formData = res;
                     this.formData = res;
                 })
                 })
@@ -159,7 +159,7 @@ export default {
 
 
             this.saving = true;
             this.saving = true;
             this.$http
             this.$http
-                .post('/domesticPatent/save', data, { body: 'json' })
+                .post('/domesticPatent/saveDTO', data, { body: 'json' })
                 .then(res => {
                 .then(res => {
                     this.saving = false;
                     this.saving = false;
                     this.$message.success('成功');
                     this.$message.success('成功');