Administrator пре 1 година
родитељ
комит
3f1c95c3d3

+ 5 - 5
ruoyi-admin/src/main/java/com/ruoyi/web/controller/projectV2/common/ZsyzCommonController.java

@@ -44,8 +44,8 @@ public class ZsyzCommonController extends BaseController {
      *
      * @return
      */
-    @GetMapping("/census")
-    public AjaxResult census(ZsyzSbbzb zsyzSbbzb) {
+    @PostMapping("/census")
+    public AjaxResult census(@RequestBody ZsyzSbbzb zsyzSbbzb) {
         return zsyzCommonService.census(zsyzSbbzb);
     }
 
@@ -54,9 +54,9 @@ public class ZsyzCommonController extends BaseController {
      *
      * @return
      */
-    @GetMapping("/censusXy")
-    public AjaxResult censusXy() {
-        return zsyzCommonService.censusXy();
+    @GetMapping("/censusXy/{year}")
+    public AjaxResult censusXy(@PathVariable("year") String year) {
+        return zsyzCommonService.censusXy(year);
     }
 
     /***

+ 3 - 3
ruoyi-admin/src/main/resources/application-druid.yml

@@ -35,9 +35,9 @@ spring:
     # redis 配置
     redis:
         # 地址
-        host: 192.168.101.10
+        host: 60.171.161.56
         # 端口,默认为6379
-        port: 6379
+        port: 20001
         # 数据库索引
         database: 8
         # 密码
@@ -60,7 +60,7 @@ spring:
         druid:
             # 主库数据源
             master:
-                url: jdbc:mysql://192.168.101.10:3306/zhaoshang2?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+                url: jdbc:mysql://60.171.161.56:25143/zhaoshang2?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
                 username: root
                 password: Boman123
             # 从库数据源

+ 7 - 0
ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/projectV2/ZsyzSbbzbServiceImpl.java

@@ -23,6 +23,7 @@ import com.ruoyi.system.mapper.projectV2.*;
 import com.ruoyi.system.service.ISysUserService;
 import com.ruoyi.system.service.projectV2.IZsyzSbbzbService;
 import com.ruoyi.system.service.projectV2.common.ISendSmsConfigService;
+import org.apache.commons.lang3.ObjectUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -98,6 +99,12 @@ public class ZsyzSbbzbServiceImpl implements IZsyzSbbzbService {
     @Override
     @DataScope(deptAlias = "s",permission = "s.cjd_id")
     public List<ZsyzSbbzb> selectZsyzSbbzbList(ZsyzSbbzb zsyzSbbzb) {
+        Map<String, Object> paramsMap = zsyzSbbzb.getParams();
+        Object year = paramsMap.get("year");
+        if (ObjectUtils.isNotEmpty(year)){
+            paramsMap.put("beginTime",year+"0101");
+            paramsMap.put("endTime",year+"1231");
+        }
         List<SysRole> roles = SecurityUtils.getLoginUser().getUser().getRoles();
         List<ZsyzSbbzb> zsyzSbbzbs = new ArrayList<>();
         boolean flag = true;

+ 9 - 3
ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/projectV2/common/ZsyzCommonServiceImpL.java

@@ -24,6 +24,7 @@ import com.ruoyi.system.service.projectV2.IZsyzProjectDeptService;
 import com.ruoyi.system.service.projectV2.IZsyzSbbzbService;
 import com.ruoyi.system.service.projectV2.IZsyzShyjService;
 import com.ruoyi.system.service.projectV2.common.IZsyzCommonService;
+import org.apache.commons.lang3.ObjectUtils;
 import org.jacoco.agent.rt.internal_035b120.core.internal.flow.IFrame;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -498,6 +499,12 @@ public class ZsyzCommonServiceImpL implements IZsyzCommonService {
      */
     @Override
     public AjaxResult census(ZsyzSbbzb zsyzSbbzb) {
+        Map<String, Object> paramsMap = zsyzSbbzb.getParams();
+        Object year = paramsMap.get("year");
+        if (ObjectUtils.isNotEmpty(year)){
+            paramsMap.put("beginTime",year+"0101");
+            paramsMap.put("endTime",year+"1231");
+        }
         Long deptId = SecurityUtils.getDeptId();
         Map<String, Object> map = new HashMap<>();
         //定义返回值
@@ -604,7 +611,7 @@ public class ZsyzCommonServiceImpL implements IZsyzCommonService {
 
     //首页统计折线图
     @Override
-    public AjaxResult censusXy() {
+    public AjaxResult censusXy(String year) {
         //1.创建一个放所有日期的集合
         List<String> dates = new ArrayList();
         dates.add("第一季度");
@@ -621,8 +628,7 @@ public class ZsyzCommonServiceImpL implements IZsyzCommonService {
         List<Integer> tc = new ArrayList();
         //查询对应季度所有正常的项目
         List<Map<String, Object>> dateList = new ArrayList<>();
-        String year = DateUtils.getTime();
-        //获取当前年
+
         Map<String, Object> timeMapOne = new HashMap<>(2);
         Map<String, Object> timeMapTwo = new HashMap<>(2);
         Map<String, Object> timeMapThr = new HashMap<>(2);

+ 1 - 1
ruoyi-system/src/main/java/com/ruoyi/system/service/projectV2/common/IZsyzCommonService.java

@@ -54,7 +54,7 @@ public interface IZsyzCommonService
   public AjaxResult census(ZsyzSbbzb zsyzSbbzb);
 
     //首页统计折线图
-  public AjaxResult censusXy();
+  public AjaxResult censusXy(String year);
 
   /**
    * 项目指派