lsw 1 年之前
父節點
當前提交
2444f18262

+ 1 - 1
admin-ui/src/App.vue

@@ -21,7 +21,7 @@ export default {
 /**挂载iconfont字体图标*/
 /**挂载iconfont字体图标*/
 @font-face {
 @font-face {
   font-family: 'iconfont';
   font-family: 'iconfont';
-  src: url('https://at.alicdn.com/t/c/font_4507607_65hrfnip6ym.ttf?t=1713404333569') format('truetype');
+  src: url('https://at.alicdn.com/t/c/font_4507607_mslj3795yhh.ttf?t=1713864741791') format('truetype');
   /* src: url('~@/static/font/iconfont.ttf') format('truetype'); */
   /* src: url('~@/static/font/iconfont.ttf') format('truetype'); */
 }
 }
 .icon {
 .icon {

+ 7 - 5
admin-ui/src/assets/styles/extend.scss

@@ -414,10 +414,6 @@
 }
 }
 .dashboard-editor-container {
 .dashboard-editor-container {
   padding: 15px 20px 0px 20px;
   padding: 15px 20px 0px 20px;
-  .mtitle {
-    margin-bottom: 10px;
-    margin-top: -15px;
-  }
   .chart-wrapper {
   .chart-wrapper {
     margin-top: 12px;
     margin-top: 12px;
     overflow: hidden;
     overflow: hidden;
@@ -426,7 +422,7 @@
       width: 33.33%;
       width: 33.33%;
       overflow: hidden;
       overflow: hidden;
       .out {
       .out {
-        margin: 10px 10px 20px 0px;
+        margin: 10px 20px 20px 0px;
         .int {
         .int {
           box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
           box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
           background: white;
           background: white;
@@ -454,3 +450,9 @@
     }
     }
   }
   }
 }
 }
+.mar0{
+  margin-right: 0px!important;
+}
+.mal0{
+  margin-left: 0px!important;
+}

+ 14 - 1
admin-ui/src/router/index.js

@@ -87,7 +87,20 @@ export const constantRoutes = [
         meta: { title: '个人中心', icon: 'user' }
         meta: { title: '个人中心', icon: 'user' }
       }
       }
     ]
     ]
-  }
+  },
+  {
+    path: '',
+    component: Layout,
+    redirect: 'notification',
+    children: [
+      {
+        path: 'notification',
+        component: () => import('@/views/work/notice/notification'),
+        name: 'Index',
+        meta: { title: '通知消息', icon: 'dashboard'}
+      }
+    ]
+  },
 ]
 ]
 
 
 // 动态路由,基于用户权限动态去加载
 // 动态路由,基于用户权限动态去加载

+ 33 - 0
admin-ui/src/views/dashboard/top.vue

@@ -0,0 +1,33 @@
+<template>
+  <div class="mtitle">
+    <span style="font-size: 19px">
+      <span>{{ user.nickName }}</span>
+      <span class="roleName" v-if="user.roleName">({{ user.roleName }})</span>
+      <span>您好,欢迎使用承揽时代企业端</span>
+    </span>
+    <iframe allowtransparency="true" frameborder="0" width="180" height="36" scrolling="no" style="padding-top: 10px" src="//tianqi.2345.com/plugin/widget/index.htm?s=3&z=2&t=0&v=0&d=2&bd=0&k=&f=#545555&ltf=#545555&htf=ffffff&q=1&e=1&a=1&c=72036&w=180&h=36&align=center"></iframe>
+  </div>
+</template>
+
+<script>
+export default {
+  props: {
+    title: {
+      type: String,
+      default: '欢迎使用承揽时代平台端'
+    }
+  },
+  data() {
+    return {
+      user: this.$store.state.user
+    };
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+.mtitle {
+  margin-bottom: 10px;
+  margin-top: -15px;
+}
+</style>

+ 254 - 0
admin-ui/src/views/dashboard/yrows.vue

@@ -0,0 +1,254 @@
+<template>
+  <div class="yrows">
+    <div v-if="row == '结算单'">
+      <div class="yr">
+        <div class="rout" style="padding-left: 0px">
+          <div class="rint" style="background-color: #faf7fe">
+            <div class="icon" style="color: #8642df">&#xe611;</div>
+            <div class="rcon">
+              <div class="rtt">结算人数(人)</div>
+              <div class="rdesc">{{ cdata.peoples || 0 }}</div>
+            </div>
+          </div>
+        </div>
+      </div>
+      <div class="yr">
+        <div class="rout">
+          <div class="rint" style="background-color: #fffcf7">
+            <div class="icon" style="color: #fab22e">&#xe818;</div>
+            <div class="rcon">
+              <div class="rtt">总金额(元)</div>
+              <div class="rdesc">{{ cdata.money || 0 }}</div>
+            </div>
+          </div>
+        </div>
+      </div>
+      <div class="yr">
+        <div class="rout">
+          <div class="rint" style="background-color: #f7fbff">
+            <div class="icon" style="color: #489afd">&#xe645;</div>
+            <div class="rcon">
+              <div class="rtt">发放业务费(元)</div>
+              <div class="rdesc">{{ cdata.realMoney || 0 }}</div>
+            </div>
+          </div>
+        </div>
+      </div>
+      <div class="yr">
+        <div class="rout" style="padding-right: 0px">
+          <div class="rint" style="background-color: #fff7f9">
+            <div class="icon" style="color: #fa5376">&#xe70f;</div>
+            <div class="rcon">
+              <div class="rtt">总服务费(元)</div>
+              <div class="rdesc">{{ cdata.serviceMoney || 0 }}</div>
+            </div>
+          </div>
+        </div>
+      </div>
+    </div>
+    <div v-if="row == '企业概览'">
+      <div class="yr" style="width: 50%">
+        <div class="rout">
+          <div class="rint" style="background-color: #f7fbff">
+            <div class="icon" style="color: #489afd">&#xe60d;</div>
+            <div class="rcon">
+              <div class="rtt">员工总数</div>
+              <div class="rdesc">{{ cdata.users || 0 }}</div>
+            </div>
+          </div>
+        </div>
+      </div>
+      <div class="yr" style="width: 50%">
+        <div class="rout" style="padding-right: 0px">
+          <div class="rint" style="background-color: #fffcf7">
+            <div class="icon" style="color: #fab22e">&#xe818;</div>
+            <div class="rcon">
+              <div class="rtt">项目总数</div>
+              <div class="rdesc">{{ cdata.project || 0 }}</div>
+            </div>
+          </div>
+        </div>
+      </div>
+      <div class="yr" style="width: 50%">
+        <div class="rout">
+          <div class="rint" style="background-color: #faf7fe">
+            <div class="icon" style="color: #8642df">&#xe611;</div>
+            <div class="rcon">
+              <div class="rtt">关联用户</div>
+              <div class="rdesc">{{ cdata.relate || 0 }}</div>
+            </div>
+          </div>
+        </div>
+      </div>
+      <div class="yr" style="width: 50%">
+        <div class="rout" style="padding-right: 0px">
+          <div class="rint" style="background-color: #fff7f9">
+            <div class="icon" style="color: #fa5376">&#xe604;</div>
+            <div class="rcon">
+              <div class="rtt">接包总数</div>
+              <div class="rdesc">{{ cdata.packages || 0 }}</div>
+            </div>
+          </div>
+        </div>
+      </div>
+    </div>
+    <div v-if="row == '快捷菜单'">
+      <div class="yr" style="width: 20%" v-for="(item, index) in menu" :key="item.id" v-hasPermi="[item.hasPermi]">
+        <router-link :to="item.url">
+          <div class="rout">
+            <div class="rint" style="text-align: center; cursor: pointer">
+              <span class="icon" :style="{ float: 'none', color: item.color }" v-html="item.icon">&#xe60d;</span>
+              <div class="ctt">{{ item.name }}</div>
+            </div>
+          </div>
+        </router-link>
+      </div>
+      <div class="yr" style="width: 20%">
+        <router-link to="/notification">
+          <div class="rout">
+            <div class="rint" style="text-align: center; cursor: pointer">
+              <span class="icon" style="float: none; color: #2196f3">&#xe6b0;</span>
+              <div class="ctt">通知消息</div>
+            </div>
+          </div>
+        </router-link>
+      </div>
+      <div class="yr" style="width: 20%">
+        <router-link to="/notice">
+          <div class="rout">
+            <div class="rint" style="text-align: center; cursor: pointer">
+              <span class="icon" style="float: none; color: #ff5722">&#xe6be;</span>
+              <div class="ctt">意见反馈</div>
+            </div>
+          </div>
+        </router-link>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+  props: {
+    row: {
+      type: String
+    },
+    cdata: {
+      type: Object
+    }
+  },
+  data() {
+    return {
+      menu: [
+        {
+          icon: '&#xe818;',
+          color: '#fab22e',
+          name: '项目管理',
+          url: '/project',
+          hasPermi: 'work:project:list'
+        },
+        {
+          icon: '&#xe609;',
+          color: '#1890ff',
+          name: '制单管理',
+          url: '/statement/make',
+          hasPermi: 'work:statement:make'
+        },
+        {
+          icon: '&#xe627;',
+          color: '#9C27B0',
+          name: '结算单管理',
+          url: '/statement/manage',
+          hasPermi: 'work:statement:manage'
+        },
+        {
+          icon: '&#xe625;',
+          color: '#3F51B5',
+          name: '结算单审核',
+          url: '/statement/audit',
+          hasPermi: 'work:statement:audit'
+        },
+        {
+          icon: '&#xe645;',
+          color: '#FF9800',
+          name: '发放业务费',
+          url: '/statement/give',
+          hasPermi: 'work:statement:give'
+        },
+        {
+          icon: '&#xe623;',
+          color: '#607D8B',
+          name: '关联用户',
+          url: '/relate',
+          hasPermi: 'work:relate:list'
+        },
+        {
+          icon: '&#xe60d;',
+          color: '#1890ff',
+          name: '员工管理',
+          url: '/system/user',
+          hasPermi: 'system:user:list'
+        },
+        {
+          icon: '&#xe60b;',
+          color: '#FFC107',
+          name: '角色管理',
+          url: '/system/role',
+          hasPermi: 'system:role:list'
+        },
+        {
+          icon: '&#xe62c;',
+          color: '#9E9E9E',
+          name: '操作日志',
+          url: '/system/operlog',
+          hasPermi: 'monitor:operlog:list'
+        }
+      ]
+    };
+  },
+  methods: {}
+};
+</script>
+
+<style lang="scss" scoped>
+.yrows {
+  margin-top: 10px;
+  .yr {
+    float: left;
+    width: 25%;
+    .rout {
+      padding: 6px;
+      .rint {
+        padding: 10px;
+        border-radius: 5px;
+        overflow: hidden;
+        .icon {
+          float: left;
+          font-size: 30px;
+          background-color: white;
+          border-radius: 50%;
+          padding: 10px;
+          box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
+        }
+        .rcon {
+          float: left;
+          padding-left: 12px;
+          .rtt {
+            color: #8c8c8c;
+            font-size: 14px;
+          }
+          .rdesc {
+            font-weight: bold;
+            padding-top: 7px;
+          }
+        }
+        .ctt {
+          color: #8c8c8c;
+          font-size: 14px;
+          padding-top: 18px;
+        }
+      }
+    }
+  }
+}
+</style>

+ 24 - 21
admin-ui/src/views/index_company.vue

@@ -1,21 +1,6 @@
 <template>
 <template>
   <div class="dashboard-editor-container">
   <div class="dashboard-editor-container">
-    <div class="mtitle">
-      <span style="font-size: 19px">
-        <span>{{ user.nickName }}</span>
-        <span class="roleName" v-if="user.roleName">({{ user.roleName }})</span>
-        <span>您好,欢迎使用承揽时代企业端</span>
-      </span>
-      <iframe
-        allowtransparency="true"
-        frameborder="0"
-        width="180"
-        height="36"
-        scrolling="no"
-        style="padding-top: 10px"
-        src="//tianqi.2345.com/plugin/widget/index.htm?s=3&z=2&t=0&v=0&d=2&bd=0&k=&f=#545555&ltf=#545555&htf=ffffff&q=1&e=1&a=1&c=72036&w=180&h=36&align=center"
-      ></iframe>
-    </div>
+    <top title="欢迎使用承揽时代企业端"></top>
     <div class="chart-wrapper">
     <div class="chart-wrapper">
       <div class="pop" style="width: 65%">
       <div class="pop" style="width: 65%">
         <div class="out">
         <div class="out">
@@ -26,6 +11,7 @@
                 <div class="tit">账户信息</div>
                 <div class="tit">账户信息</div>
               </div>
               </div>
               <companyInfo></companyInfo>
               <companyInfo></companyInfo>
+              <yrows :cdata="data" row="结算单"></yrows>
             </div>
             </div>
           </div>
           </div>
         </div>
         </div>
@@ -34,15 +20,16 @@
             <div class="bos">
             <div class="bos">
               <div class="lab">
               <div class="lab">
                 <div class="bsg"></div>
                 <div class="bsg"></div>
-                <div class="tit">账户信息</div>
+                <div class="tit">快捷菜单</div>
               </div>
               </div>
+              <yrows :cdata="data" row="快捷菜单"></yrows>
             </div>
             </div>
           </div>
           </div>
         </div>
         </div>
       </div>
       </div>
       <!--通知消息-->
       <!--通知消息-->
       <div class="pop" style="width: 35%">
       <div class="pop" style="width: 35%">
-        <div class="out" style="margin-right: 0px">
+        <div class="out mar0">
           <div class="int">
           <div class="int">
             <div class="bos">
             <div class="bos">
               <div class="lab">
               <div class="lab">
@@ -59,6 +46,17 @@
             </div>
             </div>
           </div>
           </div>
         </div>
         </div>
+        <div class="out mar0">
+          <div class="int">
+            <div class="bos">
+              <div class="lab">
+                <div class="bsg"></div>
+                <div class="tit">企业概览</div>
+              </div>
+              <yrows :cdata="data" row="企业概览"></yrows>
+            </div>
+          </div>
+        </div>
       </div>
       </div>
     </div>
     </div>
   </div>
   </div>
@@ -66,8 +64,13 @@
 
 
 <script>
 <script>
 import noticeDetail from '@/views/work/notice/detail';
 import noticeDetail from '@/views/work/notice/detail';
+import top from '@/views/dashboard/top';
+import yrows from '@/views/dashboard/yrows';
 export default {
 export default {
-  components: {},
+  components: {
+    top,
+    yrows
+  },
   data() {
   data() {
     return {
     return {
       user: this.$store.state.user,
       user: this.$store.state.user,
@@ -80,9 +83,9 @@ export default {
   },
   },
   methods: {
   methods: {
     getData() {
     getData() {
-      /* this.ajax({ url: '/home/index', data: { deptId: this.deptId } }).then((response) => {
+      this.ajax({ url: '/work/company/statistics' }).then((response) => {
         this.data = response.data;
         this.data = response.data;
-      }); */
+      });
       this.ajax({ url: '/work/notice/queryList' }).then((response) => {
       this.ajax({ url: '/work/notice/queryList' }).then((response) => {
         this.noticeList = response.data;
         this.noticeList = response.data;
       });
       });

+ 54 - 0
admin-ui/src/views/work/notice/notification.vue

@@ -0,0 +1,54 @@
+<template>
+  <div class="app-container">
+    <el-table :data="response.rows" border @selection-change="selects" height="calc(100vh - 195px)">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="通知标题" align="left" prop="title" />
+      <el-table-column label="创建时间" align="center" prop="createTime" width="200" />
+      <el-table-column label="操作" align="center" width="220">
+        <template slot-scope="scope">
+          <el-button size="mini" type="text" icon="el-icon-view" @click="op('detail', scope.row)">详情</el-button>
+        </template>
+      </el-table-column>
+      <template slot="empty">
+        <el-empty></el-empty>
+      </template>
+    </el-table>
+    <pagination v-if="response.total > 0" :total="response.total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
+  </div>
+</template>
+
+<script>
+import noticeDetail from '@/views/work/notice/detail';
+export default {
+  name: 'Notice',
+  data() {
+    return {
+      ids: [],
+      showSearch: true,
+      response: {},
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        orderByColumn: 'id',
+        isAsc: 'desc'
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    getList() {
+      this.ajax({ url: '/work/notice/list', data: this.queryParams }).then((response) => {
+        this.response = response;
+      });
+    },
+    op(tag, row) {
+      if (tag == 'detail') {
+        this.iframe({ obj: noticeDetail, param: { id: row.id }, title: row.title, width: '58%', height: '75%' });
+        return;
+      }
+    }
+  }
+};
+</script>

+ 11 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/controller/CompanyController.java

@@ -6,6 +6,7 @@ import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.core.page.TableDataInfo;
 import com.ruoyi.common.core.page.TableDataInfo;
 import com.ruoyi.common.enums.BusinessType;
 import com.ruoyi.common.enums.BusinessType;
 import com.ruoyi.web.work.domain.Company;
 import com.ruoyi.web.work.domain.Company;
+import com.ruoyi.web.work.mapper.CommonMapper;
 import com.ruoyi.web.work.service.ICompanyService;
 import com.ruoyi.web.work.service.ICompanyService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -13,6 +14,7 @@ import org.springframework.web.bind.annotation.*;
 
 
 import java.rmi.ServerException;
 import java.rmi.ServerException;
 import java.util.List;
 import java.util.List;
+import java.util.Map;
 
 
 /**
 /**
  * 企业管理
  * 企业管理
@@ -26,6 +28,9 @@ public class CompanyController extends BaseController {
     @Autowired
     @Autowired
     private ICompanyService companyService;
     private ICompanyService companyService;
 
 
+    @Autowired
+    private CommonMapper commonMapper;
+
 
 
     @PreAuthorize("@ss.hasPermi('work:company:list')")
     @PreAuthorize("@ss.hasPermi('work:company:list')")
     @GetMapping("/list")
     @GetMapping("/list")
@@ -35,6 +40,12 @@ public class CompanyController extends BaseController {
         return getDataTable(list);
         return getDataTable(list);
     }
     }
 
 
+    @GetMapping("/statistics")
+    public AjaxResult statistics() {
+        Map<String, Object> company=commonMapper.company(getLoginUser().getUser().getCompanyId());
+        return AjaxResult.success(company);
+    }
+
     @GetMapping("/index")
     @GetMapping("/index")
     public AjaxResult index() {
     public AjaxResult index() {
         Company company = companyService.getById(getLoginUser().getUser().getCompanyId());
         Company company = companyService.getById(getLoginUser().getUser().getCompanyId());

+ 6 - 8
ruoyi-admin/src/main/java/com/ruoyi/web/work/domain/Statement.java

@@ -55,6 +55,12 @@ public class Statement extends BaseData {
     @ApiModelProperty(value = "发放金额")
     @ApiModelProperty(value = "发放金额")
     private BigDecimal money;
     private BigDecimal money;
 
 
+    @ApiModelProperty(value = "发放业务费")
+    private BigDecimal realMoney;
+
+    @ApiModelProperty(value = "综合服务费")
+    private BigDecimal serviceMoney;
+
     @ApiModelProperty(value = "发放人数")
     @ApiModelProperty(value = "发放人数")
     private Integer peoples;
     private Integer peoples;
 
 
@@ -115,14 +121,6 @@ public class Statement extends BaseData {
     @ApiModelProperty(value = "企业名称")
     @ApiModelProperty(value = "企业名称")
     private String companyName;
     private String companyName;
 
 
-    @TableField(exist = false)
-    @ApiModelProperty(value = "发放业务费")
-    private BigDecimal realMoney;
-
-    @TableField(exist = false)
-    @ApiModelProperty(value = "综合服务费")
-    private BigDecimal serviceMoney;
-
     @NotNull(message = "请上传结算单")
     @NotNull(message = "请上传结算单")
     @TableField(exist = false)
     @TableField(exist = false)
     @JsonIgnore
     @JsonIgnore

+ 3 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/domain/StatementDetail.java

@@ -28,6 +28,9 @@ public class StatementDetail {
     @ApiModelProperty(value = "关联结算单")
     @ApiModelProperty(value = "关联结算单")
     private Long statementId;
     private Long statementId;
 
 
+    @ApiModelProperty(value = "关联企业")
+    private Long companyId;
+
     @ApiModelProperty(value = "关联项目")
     @ApiModelProperty(value = "关联项目")
     private Long projectId;
     private Long projectId;
 
 

+ 11 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/mapper/CommonMapper.java

@@ -0,0 +1,11 @@
+package com.ruoyi.web.work.mapper;
+
+import org.apache.ibatis.annotations.Param;
+
+import java.util.Map;
+
+
+public interface CommonMapper {
+
+    Map<String, Object> company(@Param("companyId") Long companyId);
+}

+ 0 - 2
ruoyi-admin/src/main/java/com/ruoyi/web/work/mapper/StatementMapper.java

@@ -3,7 +3,6 @@ package com.ruoyi.web.work.mapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.ruoyi.web.work.domain.Statement;
 import com.ruoyi.web.work.domain.Statement;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Param;
-import org.apache.ibatis.annotations.Select;
 
 
 import java.util.List;
 import java.util.List;
 
 
@@ -16,6 +15,5 @@ public interface StatementMapper extends BaseMapper<Statement> {
 
 
     List<Statement> selectPayList(Statement statement);
     List<Statement> selectPayList(Statement statement);
 
 
-    @Select("SELECT s.id,s.audit,s.give,s.company_id,(SELECT SUM(money) FROM tb_statement_detail d WHERE d.statement_id=s.id)AS money FROM tb_statement s WHERE s.id=#{id}")
     Statement calculate(@Param("id") Long id);
     Statement calculate(@Param("id") Long id);
 }
 }

+ 1 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/service/impl/StatementServiceImpl.java

@@ -92,6 +92,7 @@ public class StatementServiceImpl extends ServiceImpl<StatementMapper, Statement
             detail.setStatementId(statement.getId());
             detail.setStatementId(statement.getId());
             detail.setProjectId(statement.getProjectId());
             detail.setProjectId(statement.getProjectId());
             detail.setState(0);
             detail.setState(0);
+            detail.setCompanyId(statement.getCompanyId());
             detail.setNum(StringUtils.generateNumber());
             detail.setNum(StringUtils.generateNumber());
             detail.setServiceMoney(platform.getRate().divide(new BigDecimal("100")).multiply(detail.getMoney()));
             detail.setServiceMoney(platform.getRate().divide(new BigDecimal("100")).multiply(detail.getMoney()));
             detail.setRealMoney(detail.getMoney().subtract(detail.getServiceMoney()));
             detail.setRealMoney(detail.getMoney().subtract(detail.getServiceMoney()));

+ 20 - 0
ruoyi-admin/src/main/resources/mapper/work/CommonMapper.xml

@@ -0,0 +1,20 @@
+<?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.CommonMapper">
+
+    <!--后台企业端首页统计-->
+    <select id="company" resultType="java.util.Map">
+        SELECT
+                ( SELECT COUNT( user_id ) FROM sys_user WHERE company_id =#{companyId} ) AS users,
+                ( SELECT COUNT( id ) FROM tb_project WHERE company_id =#{companyId} ) AS project,
+                ( SELECT COUNT( id ) FROM tb_relate WHERE company_id =#{companyId} ) AS relate,
+                ( SELECT COUNT( id ) FROM tb_packages WHERE company_id =#{companyId} ) AS packages,
+                ( SELECT SUM( money ) FROM tb_statement WHERE give = 2 AND company_id =#{companyId} ) AS money,
+                ( SELECT SUM( real_money ) FROM tb_statement WHERE give = 2 AND company_id =#{companyId} ) AS realMoney,
+                ( SELECT SUM( service_money ) FROM tb_statement WHERE give = 2 AND company_id =#{companyId} ) AS serviceMoney,
+                ( SELECT SUM( peoples ) FROM tb_statement WHERE give = 2 AND company_id =#{companyId} ) AS peoples
+    </select>
+
+</mapper>

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

@@ -65,4 +65,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </where>
         </where>
     </select>
     </select>
 
 
+    <select id="calculate" resultType="com.ruoyi.web.work.domain.Statement">
+        SELECT
+            s.id,
+            s.audit,
+            s.give,
+            s.company_id,
+            ( SELECT SUM( d.money ) FROM tb_statement_detail d WHERE d.statement_id = s.id ) AS money,
+            ( SELECT SUM( d.real_money ) FROM tb_statement_detail d WHERE d.statement_id = s.id ) AS realMoney,
+            ( SELECT SUM( d.service_money ) FROM tb_statement_detail d WHERE d.statement_id = s.id ) AS serviceMoney,
+            ( SELECT COUNT( d.id ) FROM tb_statement_detail d WHERE d.statement_id = s.id ) AS peoples
+        FROM
+            tb_statement s
+        WHERE
+            s.id =#{id}
+    </select>
+
 </mapper>
 </mapper>