lsw 1 年之前
父节点
当前提交
d21567590f

+ 2 - 1
admin-ui/src/assets/styles/extend.scss

@@ -326,7 +326,8 @@
 }
 .sfz {
   border-radius: 5px;
-  max-height: 120px;
+  max-height: 110px;
+  width: 60%;
 }
 .bs {
   color: darkgray;

+ 1 - 4
admin-ui/src/views/dashboard/BarChart.vue

@@ -125,9 +125,6 @@ export default {
         yAxis: [
           {
             type: 'value',
-            minInterval: 1,
-            min: 70, // 设置最小值
-            max: 100, // 设置最大值
             nameTextStyle: {
               color: '#545555'
             },
@@ -178,7 +175,7 @@ export default {
                   position: 'top',
                   textStyle: {
                     color: '#545555',
-                    fontSize: 14
+                    fontSize: 13
                   },
                   formatter: '{c}元'
                 }

+ 47 - 3
admin-ui/src/views/work/money/index.vue

@@ -2,17 +2,61 @@
   <div class="app-container">
     <div class="cmain">
       <companyInfo :bar="true"></companyInfo>
+      <div class="out" style="margin-top: 20px">
+        <div class="int">
+          <div class="bos" style="border: 0px">
+            <div class="lab">
+              <div class="bsg"></div>
+              <div class="tit">交易金额统计</div>
+            </div>
+            <div class="years">
+              <el-date-picker class="dpicker" :clearable="false" v-model="year" type="year" value-format="yyyy" placeholder="请选择年份"></el-date-picker>
+              <div class="year" :class="{ active: current == index }" @click="current = index" v-for="(item, index) in type" :key="index">{{ item.name }}</div>
+            </div>
+            <BarChart :chartData="chartData" height="270px" v-if="chartData"></BarChart>
+          </div>
+        </div>
+      </div>
     </div>
   </div>
 </template>
 
 <script>
+import BarChart from '@/views/dashboard/BarChart';
 export default {
   name: 'Money',
+  components: {
+    BarChart
+  },
   data() {
-    return {};
+    return {
+      current: 0,
+      chartData: [],
+      year: this.util.getDate('year'),
+      type: [
+        { name: '充值金额', value: 0 },
+        { name: '提现金额', value: 1 },
+        { name: '发放金额', value: 2 }
+      ]
+    };
+  },
+  watch: {
+    current(val) {
+      this.getRecord();
+    },
+    year(val) {
+      this.getRecord();
+    }
+  },
+  mounted() {
+    this.getRecord();
   },
-  mounted() {},
-  methods: {}
+  methods: {
+    getRecord() {
+      this.ajax({ url: '/work/company/statistics/chart', data: { year: this.year, type: this.current } }).then((response) => {
+        this.chartData = response.data;
+      });
+    }
+  }
 };
 </script>

+ 1 - 1
admin-ui/src/views/work/project/packages/index.vue

@@ -106,7 +106,7 @@ export default {
     op(tag, row) {
       const id = row.id;
       if (tag == 'detail') {
-        this.iframe({ obj: info, param: { id: row.userId, detail: true }, title: '查看详情', width: '55%', height: '60%' });
+        this.iframe({ obj: info, param: { id: row.userId, detail: true }, title: '查看详情', width: '55%', height: '65%' });
       }
       if (tag == 'success') {
         this.$confirm('是否确认审核通过?', '警告', { type: 'warning' }).then(() => {

+ 2 - 2
admin-ui/vue.config.js

@@ -35,8 +35,8 @@ module.exports = {
     proxy: {
       // detail: https://cli.vuejs.org/config/#devserver-proxy
       [process.env.VUE_APP_BASE_API]: {
-        target: `http://localhost:9191`,
-        //target: `http://47.104.228.216/prod-api`,
+        //target: `http://localhost:9191`,
+        target: `http://47.104.228.216/prod-api`,
         changeOrigin: true,
         pathRewrite: {
           ['^' + process.env.VUE_APP_BASE_API]: ''

+ 5 - 24
ruoyi-admin/src/main/java/com/ruoyi/web/work/controller/RecordController.java

@@ -1,17 +1,17 @@
 package com.ruoyi.web.work.controller;
 
-import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.core.page.TableDataInfo;
-import com.ruoyi.common.enums.BusinessType;
 import com.ruoyi.web.work.domain.Record;
 import com.ruoyi.web.work.service.IRecordService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
 
-import java.util.Arrays;
 import java.util.List;
 
 /**
@@ -28,6 +28,7 @@ public class RecordController extends BaseController {
     @PreAuthorize("@ss.hasPermi('work:record:list')")
     @GetMapping("/list")
     public TableDataInfo list(Record record){
+        record.setCompanyId(getLoginUser().getUser().getCompanyId());
         startPage();
         List<Record> list = recordService.selectList(record);
         return getDataTable(list);
@@ -39,24 +40,4 @@ public class RecordController extends BaseController {
         return AjaxResult.success(recordService.getById(id));
     }
 
-    @PreAuthorize("@ss.hasPermi('work:record:add')")
-    @Log(title = "资金交易记录", businessType = BusinessType.INSERT)
-    @PostMapping("/add")
-    public AjaxResult add(@RequestBody Record record){
-        return toAjax(recordService.save(record));
-    }
-
-    @PreAuthorize("@ss.hasPermi('work:record:edit')")
-    @Log(title = "资金交易记录", businessType = BusinessType.UPDATE)
-    @PostMapping("/edit")
-    public AjaxResult edit(@RequestBody Record record){
-        return toAjax(recordService.updateById(record));
-    }
-
-    @PreAuthorize("@ss.hasPermi('work:record:remove')")
-    @Log(title = "资金交易记录", businessType = BusinessType.DELETE)
-    @GetMapping("/remove/{ids}")
-    public AjaxResult remove(@PathVariable Long[] ids){
-        return toAjax(recordService.removeByIds(Arrays.asList(ids)));
-    }
 }

+ 7 - 5
ruoyi-admin/src/main/java/com/ruoyi/web/work/domain/Record.java

@@ -1,14 +1,16 @@
 package com.ruoyi.web.work.domain;
 
-import java.math.BigDecimal;
-import java.util.Date;
-import com.fasterxml.jackson.annotation.JsonFormat;
 import com.baomidou.mybatisplus.annotation.FieldFill;
 import com.baomidou.mybatisplus.annotation.TableField;
-import lombok.Data;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruoyi.web.work.domain.base.BaseData;
 import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
 import lombok.experimental.Accessors;
+
+import java.math.BigDecimal;
+import java.util.Date;
 /**
  * @author lsw
  * @date 2024-04-26
@@ -16,7 +18,7 @@ import lombok.experimental.Accessors;
 @Data
 @TableName(value = "tb_record")
 @Accessors(chain = true)
-public class Record{
+public class Record extends BaseData {
     private static final long serialVersionUID = 1L;
 
     private Long id;

+ 16 - 0
ruoyi-admin/src/main/resources/mapper/work/RecordMapper.xml

@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ruoyi.web.work.mapper.RecordMapper">
+    
+    <select id="selectList" resultType="com.ruoyi.web.work.domain.Record">
+        select * from tb_record
+        <where>  
+            <if test="companyId != null "> and company_id = #{companyId}</if>
+            <if test="type != null "> and type = #{type}</if>
+            <if test="dateBegin != null  and dateBegin != ''"> AND create_time BETWEEN #{dateBegin} AND #{dateEnd} + INTERVAL 1 DAY</if>
+        </where>
+    </select>
+
+</mapper>

+ 8 - 8
ruoyi-common/src/main/java/com/ruoyi/common/utils/ImageCompressUtil.java

@@ -32,20 +32,20 @@ public class ImageCompressUtil {
             int h1 = h;
             //对于小400分辨率的图不压缩
             if (w < 1000 && w > 500) {
-                w1 = (int) (w - w * 0.2);
-                h1 = (int) (h - h * 0.2);
+                w1 = (int) (w - w * 0.1);
+                h1 = (int) (h - h * 0.1);
             }
             if (w < 1600 && w > 1000) {
-                w1 = (int) (w - w * 0.45);
-                h1 = (int) (h - h * 0.45);
+                w1 = (int) (w - w * 0.25);
+                h1 = (int) (h - h * 0.25);
             }
             if (w < 2500 && w > 1600) {
-                w1 = (int) (w - w * 0.55);
-                h1 = (int) (h - h * 0.55);
+                w1 = (int) (w - w * 0.35);
+                h1 = (int) (h - h * 0.35);
             }
             if (w > 2500) {
-                w1 = (int) (w - w * 0.6);
-                h1 = (int) (h - h * 0.6);
+                w1 = (int) (w - w * 0.45);
+                h1 = (int) (h - h * 0.45);
             }
             String srcImgPath = newFile.getAbsoluteFile().toString();
             String subfix = "jpg";