licailing пре 4 година
родитељ
комит
982d197bab

+ 1 - 1
src/main/java/com/izouma/zhirongip/service/demand/FundingService.java

@@ -33,7 +33,7 @@ public class FundingService {
                 .collect(Collectors.toMap(Setting::getId, Setting::getName));
 
         return fundingRepo.findAll(((root, criteriaQuery, criteriaBuilder) -> {
-                    List<Predicate> and = JpaUtils.toPredicates(pageQuery, TechnicalManager.class, root, criteriaQuery, criteriaBuilder);
+                    List<Predicate> and = JpaUtils.toPredicates(pageQuery, Funding.class, root, criteriaQuery, criteriaBuilder);
                     if (ObjectUtil.isNotNull(field)) {
                         Expression<Long> function = criteriaBuilder.function("FIND_IN_SET", Long.class, criteriaBuilder.literal(field), root
                                 .get("purpose"));

+ 9 - 9
src/main/java/com/izouma/zhirongip/service/supply/PatentService.java

@@ -27,18 +27,18 @@ public class PatentService {
     private final InformationRepo informationRepo;
 
     public Page<Patent> all(PageQuery pageQuery) {
-        Map<Long, String> settingMap = settingRepo.findAllByFlagIn(CollUtil.list(false, 1, 13,24,25,26)).stream()
+        Map<Long, String> settingMap = settingRepo.findAllByFlagIn(CollUtil.list(false, 1, 13, 24, 25, 26)).stream()
                 .collect(Collectors.toMap(Setting::getId, Setting::getName));
         return patentRepo.findAll(JpaUtils.toSpecification(pageQuery, Patent.class), JpaUtils.toPageRequest(pageQuery))
                 .map(cd -> {
                     cd.setIndustryName(settingMap.get(cd.getIndustryClass()));
-                    if(cd.getPatentTypeId()!=null){
+                    if (cd.getPatentTypeId() != null) {
                         cd.setPatentType(settingMap.get(cd.getPatentTypeId()));
                     }
-                    if(cd.getLawStatusId()!=null){
+                    if (cd.getLawStatusId() != null) {
                         cd.setLawStatus(settingMap.get(cd.getLawStatusId()));
                     }
-                    if(cd.getTradingMethodId()!=null){
+                    if (cd.getTradingMethodId() != null) {
                         cd.setTradingMethod(settingMap.get(cd.getTradingMethodId()));
                     }
                     return cd;
@@ -51,17 +51,17 @@ public class PatentService {
                 .orElseThrow(new BusinessException("无记录"))
                 .getName());
 
-        if(patent.getPatentTypeId()!=null){
+        if (patent.getPatentTypeId() != null) {
             patent.setPatentType(settingRepo.findById(patent.getPatentTypeId())
                     .orElseThrow(new BusinessException("无记录"))
                     .getName());
         }
-        if(patent.getLawStatusId()!=null){
+        if (patent.getLawStatusId() != null) {
             patent.setLawStatus(settingRepo.findById(patent.getLawStatusId())
                     .orElseThrow(new BusinessException("无记录"))
                     .getName());
         }
-        if(patent.getTradingMethodId()!=null){
+        if (patent.getTradingMethodId() != null) {
             patent.setTradingMethod(settingRepo.findById(patent.getTradingMethodId())
                     .orElseThrow(new BusinessException("无记录"))
                     .getName());
@@ -81,14 +81,14 @@ public class PatentService {
             record.setStatus(ApplyStatus.PASS);
             patentRepo.save(record);
 
-            information.setContent("您发布的供给侧:"+record.getName()+"已通过审核!");
+            information.setContent("您发布的供给侧:" + record.getName() + "已通过审核!");
             informationRepo.save(information);
             return;
         }
         record.setStatus(ApplyStatus.DENY);
         patentRepo.save(record);
 
-        information.setContent("您发布的的供给侧:"+record.getName()+"未通过审核,原因为:" + remark);
+        information.setContent("您发布的的供给侧:" + record.getName() + "未通过审核,原因为:" + remark);
         informationRepo.save(information);
     }
 }

+ 24 - 24
src/main/vue/src/views/demand/CopyrightDemandEdit.vue

@@ -109,11 +109,11 @@ export default {
                 .then(res => {
                     this.formData = res;
                     if (res.type == 'COPY') {
-                        this.getSetting(3);
+                        this.getSetting(3, 'workTypeOptions');
                     } else if (res.type == 'SOFT') {
-                        this.getSetting(4);
+                        this.getSetting(4, 'workTypeOptions');
                     } else {
-                        this.getSetting(6);
+                        this.getSetting(6, 'workTypeOptions');
                     }
                 })
                 .catch(e => {
@@ -125,11 +125,11 @@ export default {
             let type = this.$route.query.type;
             this.formData.type = this.$route.query.type;
             if (type == 'COPY') {
-                this.getSetting(3);
+                this.getSetting(3, 'workTypeOptions');
             } else if (type == 'SOFT') {
-                this.getSetting(4);
+                this.getSetting(4, 'workTypeOptions');
             } else {
-                this.getSetting(6);
+                this.getSetting(6, 'workTypeOptions');
             }
         }
     },
@@ -231,25 +231,25 @@ export default {
                         this.$message.error((e || {}).error || '删除失败');
                     }
                 });
-        },
-        getSetting(flag) {
-            this.$http
-                .post('/setting/byFlag', { flag: flag })
-                .then(res => {
-                    if (res.length > 0) {
-                        res.forEach(item => {
-                            this.workTypeOptions.push({
-                                label: item.name,
-                                value: item.id
-                            });
-                        });
-                    }
-                })
-                .catch(e => {
-                    console.log(e);
-                    this.$message.error(e.error);
-                });
         }
+        // getSetting(flag) {
+        //     this.$http
+        //         .post('/setting/byFlag', { flag: flag })
+        //         .then(res => {
+        //             if (res.length > 0) {
+        //                 res.forEach(item => {
+        //                     this.workTypeOptions.push({
+        //                         label: item.name,
+        //                         value: item.id
+        //                     });
+        //                 });
+        //             }
+        //         })
+        //         .catch(e => {
+        //             console.log(e);
+        //             this.$message.error(e.error);
+        //         });
+        // }
     }
 };
 </script>

+ 22 - 22
src/main/vue/src/views/demand/PatentDemandEdit.vue

@@ -126,9 +126,9 @@ export default {
                 .then(res => {
                     this.formData = res;
                     if (res.caseType == 'GENERAL') {
-                        this.getSetting(1);
+                        this.getSetting(1, 'industryClassOptions');
                     } else {
-                        this.getSetting(13);
+                        this.getSetting(13, 'industryClassOptions');
                     }
                 })
                 .catch(e => {
@@ -140,9 +140,9 @@ export default {
             let type = this.$route.query.type;
             this.formData.caseType = this.$route.query.type;
             if (type == 'GENERAL') {
-                this.getSetting(1);
+                this.getSetting(1, 'industryClassOptions');
             } else {
-                this.getSetting(13);
+                this.getSetting(13, 'industryClassOptions');
             }
         }
         this.getSetting(25, 'patentTypeOptions');
@@ -268,24 +268,24 @@ export default {
                     }
                 });
         },
-        getSetting(flag) {
-            this.$http
-                .post('/setting/byFlag', { flag: flag })
-                .then(res => {
-                    if (res.length > 0) {
-                        res.forEach(item => {
-                            this.industryClassOptions.push({
-                                label: item.name,
-                                value: item.id
-                            });
-                        });
-                    }
-                })
-                .catch(e => {
-                    console.log(e);
-                    this.$message.error(e.error);
-                });
-        },
+        // getSetting(flag) {
+        //     this.$http
+        //         .post('/setting/byFlag', { flag: flag })
+        //         .then(res => {
+        //             if (res.length > 0) {
+        //                 res.forEach(item => {
+        //                     this.industryClassOptions.push({
+        //                         label: item.name,
+        //                         value: item.id
+        //                     });
+        //                 });
+        //             }
+        //         })
+        //         .catch(e => {
+        //             console.log(e);
+        //             this.$message.error(e.error);
+        //         });
+        // },
         clear() {
             if (this.formData.negotiateDirectly) {
                 this.formData.expectedPrice = '';

+ 22 - 22
src/main/vue/src/views/supply/CopyrightEdit.vue

@@ -168,9 +168,9 @@ export default {
                 .then(res => {
                     this.formData = res;
                     if (res.type == 'COPY') {
-                        this.getSetting(3);
+                        this.getSetting(3, 'workTypeOptions');
                     } else {
-                        this.getSetting(4);
+                        this.getSetting(4, 'workTypeOptions');
                     }
                 })
                 .catch(e => {
@@ -181,9 +181,9 @@ export default {
         if (this.$route.query.type) {
             this.formData.type = this.$route.query.type;
             if (this.formData.type == 'COPY') {
-                this.getSetting(3);
+                this.getSetting(3, 'workTypeOptions');
             } else {
-                this.getSetting(4);
+                this.getSetting(4, 'workTypeOptions');
             }
         }
     },
@@ -300,25 +300,25 @@ export default {
                         this.$message.error((e || {}).error || '删除失败');
                     }
                 });
-        },
-        getSetting(flag) {
-            this.$http
-                .post('/setting/byFlag', { flag: flag })
-                .then(res => {
-                    if (res.length > 0) {
-                        res.forEach(item => {
-                            this.workTypeOptions.push({
-                                label: item.name,
-                                value: item.id
-                            });
-                        });
-                    }
-                })
-                .catch(e => {
-                    console.log(e);
-                    this.$message.error(e.error);
-                });
         }
+        // getSetting(flag) {
+        //     this.$http
+        //         .post('/setting/byFlag', { flag: flag })
+        //         .then(res => {
+        //             if (res.length > 0) {
+        //                 res.forEach(item => {
+        //                     this.workTypeOptions.push({
+        //                         label: item.name,
+        //                         value: item.id
+        //                     });
+        //                 });
+        //             }
+        //         })
+        //         .catch(e => {
+        //             console.log(e);
+        //             this.$message.error(e.error);
+        //         });
+        // }
     }
 };
 </script>

+ 2 - 2
src/main/vue/src/views/supply/PatentEdit.vue

@@ -240,11 +240,11 @@ export default {
                 .then(res => {
                     this.formData = res;
                     if (res.caseType == 'GENERAL') {
-                        this.getSetting(1);
+                        this.getSetting(1, 'industryOptions');
                         this.getSetting(25, 'patentTypeOptions');
                         this.getSetting(26, 'lawStatusOptions');
                     } else {
-                        this.getSetting(13);
+                        this.getSetting(13, 'industryOptions');
                     }
                 })
                 .catch(e => {

+ 24 - 0
src/test/java/com/izouma/zhirongip/service/demand/FundingServiceTest.java

@@ -0,0 +1,24 @@
+package com.izouma.zhirongip.service.demand;
+
+import com.izouma.zhirongip.ApplicationTests;
+import com.izouma.zhirongip.dto.PageQuery;
+import org.junit.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import java.util.Map;
+
+
+public class FundingServiceTest extends ApplicationTests {
+
+    @Autowired
+    private FundingService fundingService;
+
+    @Test
+    public void all() {
+        PageQuery pageQuery = new PageQuery();
+        Map<String, Object> query = pageQuery.getQuery();
+        query.put("loanTerm", "ONE_TWO_YEARS");
+
+        System.out.println(fundingService.all(pageQuery, null).getContent());
+    }
+}