Browse Source

feature: 主体数据统计

mazq 2 years ago
parent
commit
982d9c9c2d

+ 12 - 0
dcuc-app-api/src/main/java/com/dragoninfo/dcuc/app/facade/IApplyInfoFacade.java

@@ -8,6 +8,7 @@ import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.data.domain.Page;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.Date;
 import java.util.List;
 import java.util.Map;
 
@@ -314,4 +315,15 @@ public interface IApplyInfoFacade {
     @PutMapping("updateOrgInfos")
     ResponseStatus updateOrgInfos(@RequestParam("targetOrgCode") String targetOrgCode, @RequestParam("fullName") String fullName,
                                   @RequestParam("code") String code);
+
+    /**
+     * 应用数量统计
+     *
+     * @param startTime
+     * @param endTime
+     * @return
+     */
+    @GetMapping("count")
+    Long count(@RequestParam(value = "startTime", required = false) Date startTime,
+               @RequestParam(value = "endTime", required = false) Date endTime);
 }

+ 6 - 0
dcuc-app-service/src/main/java/com/dragoninfo/dcuc/app/facade/ApplyInfoFacade.java

@@ -11,6 +11,7 @@ import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.util.Date;
 import java.util.List;
 import java.util.Map;
 
@@ -81,6 +82,11 @@ public class ApplyInfoFacade implements IApplyInfoFacade {
         return ResponseStatus.success();
     }
 
+    @Override
+    public Long count(Date startTime, Date endTime) {
+        return applyInfoService.count(startTime, endTime);
+    }
+
     @Override
     public String getNewSort() {
         return applyInfoService.getNewSort();

+ 9 - 0
dcuc-app-service/src/main/java/com/dragoninfo/dcuc/app/service/IApplyInfoService.java

@@ -6,6 +6,7 @@ import com.dragonsoft.duceap.base.entity.http.ResponseStatus;
 import com.dragonsoft.duceap.base.entity.search.SearchDTO;
 import org.springframework.data.domain.Page;
 
+import java.util.Date;
 import java.util.List;
 import java.util.Map;
 
@@ -261,4 +262,12 @@ public interface IApplyInfoService {
      * @param code          机构代码
      */
     void updateOrgInfos(String targetOrgCode, String fullName, String code);
+
+    /**
+     * 统计应用数量
+     * @param startTime
+     * @param endTime
+     * @return
+     */
+    Long count(Date startTime, Date endTime);
 }

+ 13 - 0
dcuc-app-service/src/main/java/com/dragoninfo/dcuc/app/service/impl/ApplyInfoServiceImpl.java

@@ -470,6 +470,19 @@ public class ApplyInfoServiceImpl implements IApplyInfoService {
         applyInfoMapper.update(applyInfo, queryWrapper);
     }
 
+    @Override
+    public Long count(Date startTime, Date endTime) {
+        LambdaQueryWrapper<ApplyInfo> query = Wrappers.lambdaQuery();
+        if (null != startTime) {
+            query.ge(ApplyInfo::getRegistrationTime, startTime);
+        }
+        if (null != endTime) {
+            query.le(ApplyInfo::getRegistrationTime, endTime);
+        }
+
+        return Long.valueOf(applyInfoMapper.selectCount(query));
+    }
+
     @Override
     public List<ApplyInfo> findList(String applyStatus) {
         LambdaQueryWrapper<ApplyInfo> queryWrapper = new LambdaQueryWrapper<>();