lsw 11 months ago
parent
commit
9fe55cda8a

+ 1 - 1
admin-ui/src/components/companyInfo.vue

@@ -62,7 +62,7 @@ export default {
         this.iframe({ obj: record_list, param: {}, title: '资金交易明细', width: '55%', height: '70%' });
       }
       if (tag == 'info') {
-        this.iframe({ obj: company, param: { id: this.form.id, detail: true }, title: '企业信息', width: '60%', height: '70%' });
+        this.iframe({ obj: company, param: { id: this.form.id, detail: true }, title: '企业信息', width: '50%', height: '75%' });
       }
       if (tag == 'qr') {
         this.iframe({ obj: qr, param: {}, title: '查看企业二维码', width: '27%', height: '45%' });

+ 22 - 19
admin-ui/src/views/work/company/detail.vue

@@ -1,30 +1,42 @@
 <template>
   <div class="cmain">
-    <el-form ref="form" :model="form" :rules="rules" label-width="110px">
+    <el-form ref="form" :model="form" :disabled="param.detail" :rules="rules" label-width="110px">
       <div class="bos">
         <div class="lab">
           <div class="bsg"></div>
           <div class="tit">企业信息</div>
         </div>
-        <el-form-item label="企业名称" prop="companyName">
-          <el-input v-model="form.companyName" :disabled="param.detail" clearable />
-        </el-form-item>
+        <el-row>
+          <el-col :span="12">
+            <el-form-item label="企业名称" prop="companyName">
+              <el-input v-model="form.companyName" />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="邮箱地址" prop="email">
+              <el-input v-model="form.email" />
+            </el-form-item>
+          </el-col>
+        </el-row>
         <el-row>
           <el-col :span="12">
             <el-form-item label="企业负责人" prop="director">
-              <el-input v-model="form.director" clearable :disabled="param.detail" />
+              <el-input v-model="form.director" />
             </el-form-item>
           </el-col>
           <el-col :span="12">
             <el-form-item label="手机号" prop="phone">
-              <el-input v-model="form.phone" clearable :disabled="param.detail" />
+              <el-input v-model="form.phone" />
             </el-form-item>
           </el-col>
         </el-row>
+        <el-form-item label="综合服务费率" prop="rate">
+          <el-input type="number" v-model="form.rate"><template slot="append">%</template></el-input>
+        </el-form-item>
         <el-row>
           <el-col :span="12">
             <el-form-item label="联系地址" prop="address">
-              <el-input type="textarea" v-model="form.address" rows="4" clearable :disabled="param.detail" />
+              <el-input type="textarea" v-model="form.address" rows="4" />
             </el-form-item>
           </el-col>
           <el-col :span="12">
@@ -42,12 +54,12 @@
         <el-row>
           <el-col :span="12">
             <el-form-item label="开户行" prop="bankName">
-              <el-input v-model="form.bankName" :disabled="param.detail" />
+              <el-input v-model="form.bankName" />
             </el-form-item>
           </el-col>
           <el-col :span="12">
             <el-form-item label="对公账号" prop="bankAccount">
-              <el-input v-model="form.bankAccount" :disabled="param.detail" />
+              <el-input v-model="form.bankAccount" />
             </el-form-item>
           </el-col>
         </el-row>
@@ -64,16 +76,7 @@ export default {
   data() {
     return {
       form: {},
-      rules: {
-        companyName: [{ required: true, message: '不能为空', trigger: 'blur' }],
-        director: [{ required: true, message: '不能为空', trigger: 'blur' }],
-        phone: [{ required: true, message: '不能为空', trigger: 'blur' }],
-        address: [{ required: true, message: '不能为空', trigger: 'blur' }],
-        business: [{ required: true, message: '不能为空', trigger: 'blur' }],
-        bankName: [{ required: true, message: '不能为空', trigger: 'blur' }],
-        bankAccount: [{ required: true, message: '不能为空', trigger: 'blur' }],
-        b1: [{ required: true, message: '不能为空', trigger: 'blur' }]
-      }
+      rules: {}
     };
   },
   props: {

+ 4 - 0
admin-ui/src/views/work/company/edit.vue

@@ -30,6 +30,9 @@
             </el-form-item>
           </el-col>
         </el-row>
+        <el-form-item label="综合服务费率" prop="rate">
+          <el-input type="number" v-model="form.rate" placeholder="请输入综合服务费率" clearable><template slot="append">%</template></el-input>
+        </el-form-item>
         <el-row>
           <el-col :span="12">
             <el-form-item label="联系地址" prop="address">
@@ -110,6 +113,7 @@ export default {
             trigger: 'blur'
           }
         ],
+        rate: [{ required: true, message: '不能为空', trigger: 'blur' }],
         address: [{ required: true, message: '不能为空', trigger: 'blur' }],
         business: [{ required: true, message: '不能为空', trigger: 'blur' }],
         bankName: [{ required: true, message: '不能为空', trigger: 'blur' }],

+ 87 - 83
admin-ui/src/views/work/company/index.vue

@@ -28,14 +28,18 @@
     </el-row>
     <el-table :data="response.rows" border height="calc(100vh - 270px)">
       <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="企业名称" align="left" prop="companyName" />
+      <el-table-column label="企业名称" align="left" prop="companyName" width="250"/>
       <el-table-column label="企业方负责人" align="center" prop="director" width="110" />
       <el-table-column label="手机号" align="center" prop="phone" width="130" />
-      <el-table-column label="邮箱" align="center" prop="email" width="180"/>
+      <el-table-column label="邮箱" align="center" prop="email" width="180" />
+      <el-table-column label="税率(%)" align="center" prop="rate" width="90" />
       <el-table-column label="账户余额(元)" align="center" prop="money" width="110" />
+      <el-table-column label="发放金额(元)" align="center" prop="giveMoney" width="110" />
+      <el-table-column label="服务费(元)" align="center" prop="serviceMoney" width="110" />
+      <el-table-column label="发放人次" align="center" prop="givePeoples" width="110" />
       <el-table-column label="关联用户" align="center" prop="peoples" width="100" />
       <el-table-column label="创建日期" align="center" prop="createTime" width="180" />
-      <el-table-column label="账号状态" align="center" prop="state" width="100">
+      <el-table-column label="账号状态" align="center" prop="state" width="100" fixed="right">
         <template slot-scope="scope">
           <div class="switch">
             <el-switch v-model="scope.row.state" :active-value="0" :width="50" :inactive-value="1" @change="op('change', scope.row)"></el-switch>
@@ -44,7 +48,7 @@
           </div>
         </template>
       </el-table-column>
-      <el-table-column label="操作" align="center" width="180">
+      <el-table-column label="操作" align="center" width="180" fixed="right">
         <template slot-scope="scope">
           <el-button size="mini" type="text" icon="el-icon-view" @click="op('detail', scope.row)" v-hasPermi="['work:company:list']">详情</el-button>
           <el-button size="mini" type="text" icon="el-icon-edit" @click="op('edit', scope.row)" v-hasPermi="['work:company:edit']">修改</el-button>
@@ -60,89 +64,89 @@
 </template>
 
 <script>
-  import edit from './edit';
-  export default {
-    name: 'Company',
-    data() {
-      return {
-        showSearch: true,
-        response: {},
-        dateRange: [],
-        queryParams: {
-          pageNum: 1,
-          pageSize: 10,
-          companyName: null,
-          director: null,
-          phone: null,
-          state: null,
-          orderByColumn: 'id',
-          isAsc: 'desc'
-        }
-      };
+import edit from './edit';
+export default {
+  name: 'Company',
+  data() {
+    return {
+      showSearch: true,
+      response: {},
+      dateRange: [],
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        companyName: null,
+        director: null,
+        phone: null,
+        state: null,
+        orderByColumn: 'id',
+        isAsc: 'desc'
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    getList() {
+      if (this.dateRange) {
+        this.queryParams.dateBegin = this.dateRange[0];
+        this.queryParams.dateEnd = this.dateRange[1];
+      }
+      this.ajax({ url: '/work/company/list', data: this.queryParams }).then((response) => {
+        this.response = response;
+      });
     },
-    created() {
+    handleQuery() {
+      this.queryParams.pageNum = 1;
       this.getList();
     },
-    methods: {
-      getList() {
-        if (this.dateRange) {
-          this.queryParams.dateBegin = this.dateRange[0];
-          this.queryParams.dateEnd = this.dateRange[1];
-        }
-        this.ajax({ url: '/work/company/list', data: this.queryParams }).then((response) => {
-          this.response = response;
-        });
-      },
-      handleQuery() {
-        this.queryParams.pageNum = 1;
-        this.getList();
-      },
-      resetQuery() {
-        this.resetForm('queryForm');
-        this.dateRange = [];
-        this.handleQuery();
-      },
-      op(tag, row) {
-        if (tag == 'add') {
-          this.iframe({ obj: edit, param: {}, title: '新增企业', width: '50%', height: '83%' });
-        }
-        const id = row.id;
-        if (tag == 'detail') {
-          this.iframe({ obj: edit, param: { id: id, detail: true }, title: '查看企业信息', width: '50%', height: '83%' });
-        }
-        if (tag == 'edit') {
-          this.iframe({ obj: edit, param: { id: id }, title: '编辑企业', width: '50%', height: '70%' });
-        }
-        //账号状态
-        if (tag == 'change') {
-          let text = row.state === 0 ? '启用' : '停用';
-          this.$confirm('确认要' + text + '该企业? 停用后该企业所有账号都停用', '警告', { type: 'warning' })
-            .then(() => {
-              this.post({ url: '/work/company/lock', data: { id: row.id, state: row.state } })
-                .then((response) => {
-                  this.$modal.msgSuccess(text + '成功');
-                })
-                .catch(() => {
-                  row.state = row.state === 0 ? 1 : 0;
-                });
-            })
-            .catch(() => {
-              row.state = row.state === 0 ? 1 : 0;
-            });
-        }
-      },
-      del(row) {
-        this.$confirm('是否确认删除选中企业?删除后该企业下的所有账号都被删除', '警告', { type: 'warning' }).then(() => {
-          this.get({ url: '/work/company/remove/' + row.id }).then((response) => {
-            this.$modal.msgSuccess('删除成功');
-            this.getList();
+    resetQuery() {
+      this.resetForm('queryForm');
+      this.dateRange = [];
+      this.handleQuery();
+    },
+    op(tag, row) {
+      if (tag == 'add') {
+        this.iframe({ obj: edit, param: {}, title: '新增企业', width: '50%', height: '90%' });
+      }
+      const id = row.id;
+      if (tag == 'detail') {
+        this.iframe({ obj: edit, param: { id: id, detail: true }, title: '查看企业信息', width: '50%', height: '90%' });
+      }
+      if (tag == 'edit') {
+        this.iframe({ obj: edit, param: { id: id }, title: '编辑企业', width: '50%', height: '80%' });
+      }
+      //账号状态
+      if (tag == 'change') {
+        let text = row.state === 0 ? '启用' : '停用';
+        this.$confirm('确认要' + text + '该企业? 停用后该企业所有账号都停用', '警告', { type: 'warning' })
+          .then(() => {
+            this.post({ url: '/work/company/lock', data: { id: row.id, state: row.state } })
+              .then((response) => {
+                this.$modal.msgSuccess(text + '成功');
+              })
+              .catch(() => {
+                row.state = row.state === 0 ? 1 : 0;
+              });
+          })
+          .catch(() => {
+            row.state = row.state === 0 ? 1 : 0;
           });
-        });
-      },
-      /** 导出按钮操作 */
-      handleExport() {
-        this.download('/work/company/export', { ...this.queryParams }, '企业信息.xlsx');
       }
+    },
+    del(row) {
+      this.$confirm('是否确认删除选中企业?删除后该企业下的所有账号都被删除', '警告', { type: 'warning' }).then(() => {
+        this.get({ url: '/work/company/remove/' + row.id }).then((response) => {
+          this.$modal.msgSuccess('删除成功');
+          this.getList();
+        });
+      });
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download('/work/company/export', { ...this.queryParams }, '企业信息.xlsx');
     }
-  };
+  }
+};
 </script>

+ 0 - 9
admin-ui/src/views/work/platform/index.vue

@@ -38,15 +38,6 @@
         <div class="bos">
           <div class="lab">
             <div class="bsg"></div>
-            <div class="tit">结算信息</div>
-          </div>
-          <el-form-item label="综合服务费率" prop="rate">
-            <el-input type="number" v-model="form.rate" placeholder="请输入综合服务费率" clearable><template slot="append">%</template></el-input>
-          </el-form-item>
-        </div>
-        <div class="bos">
-          <div class="lab">
-            <div class="bsg"></div>
             <div class="tit">协议</div>
           </div>
           <el-form-item label="用户协议" prop="privacy">

+ 14 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/domain/Company.java

@@ -65,6 +65,9 @@ public class Company extends BaseData {
     @Excel(name = "账户余额")
     private BigDecimal money;
 
+    @ApiModelProperty(value = "综合服务费率")
+    private BigDecimal rate;
+
     @NotBlank(message = "请上传开户许可证照片")
     @ApiModelProperty(value = "开户许可证照片")
     private String b1;
@@ -97,6 +100,8 @@ public class Company extends BaseData {
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date updateTime;
 
+    /***************************************查询*********************************/
+
     @TableField(exist = false)
     private String userName;
 
@@ -105,4 +110,13 @@ public class Company extends BaseData {
 
     @TableField(exist = false)
     private Integer peoples;
+
+    @TableField(exist = false)
+    private Integer giveMoney;
+
+    @TableField(exist = false)
+    private Integer serviceMoney;
+
+    @TableField(exist = false)
+    private Integer givePeoples;
 }

+ 0 - 4
ruoyi-admin/src/main/java/com/ruoyi/web/work/domain/Platform.java

@@ -8,7 +8,6 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.experimental.Accessors;
 
-import java.math.BigDecimal;
 import java.util.Date;
 /**
  * @author lsw
@@ -43,9 +42,6 @@ public class Platform{
     @ApiModelProperty(value = "平台邮箱")
     private String email;
 
-    @ApiModelProperty(value = "综合服务费率")
-    private BigDecimal rate;
-
     @ApiModelProperty(value = "用户协议")
     private String agreement;
 

+ 4 - 3
ruoyi-admin/src/main/java/com/ruoyi/web/work/service/impl/StatementServiceImpl.java

@@ -93,6 +93,7 @@ public class StatementServiceImpl extends ServiceImpl<StatementMapper, Statement
             throw new ServiceException("上传结算单数据不能为空!");
         }
         Platform platform = redisCache.getCacheObject(CacheConstants.APP_PLATFORM);
+        Company company=companyService.getById(SecurityUtils.getLoginUser().getUser().getCompanyId());
         statement.setUserId(SecurityUtils.getLoginUser().getUser().getUserId());
         statement.setCompanyId(SecurityUtils.getLoginUser().getUser().getCompanyId());
         statement.setOpBy(SecurityUtils.getLoginUser().getUser().getNickName());
@@ -114,7 +115,7 @@ public class StatementServiceImpl extends ServiceImpl<StatementMapper, Statement
             detail.setState(0);
             detail.setCompanyId(statement.getCompanyId());
             detail.setNum(StringUtils.generateNumber());
-            detail.setServiceMoney(platform.getRate().divide(new BigDecimal("100")).multiply(detail.getMoney()));
+            detail.setServiceMoney(company.getRate().divide(new BigDecimal("100")).multiply(detail.getMoney()));
             detail.setRealMoney(detail.getMoney().add(detail.getServiceMoney()));
             if (!detailService.save(detail)) {
                 throw new ServiceException("导入失败,请联系平台");
@@ -214,8 +215,8 @@ public class StatementServiceImpl extends ServiceImpl<StatementMapper, Statement
         if (detail == null || !detail.getCompanyId().equals(SecurityUtils.getLoginUser().getUser().getCompanyId())) {
             return AjaxResult.error("关联结算单明细不存在或非法操作");
         }
-        Platform platform = redisCache.getCacheObject(CacheConstants.APP_PLATFORM);
-        detail.setServiceMoney(platform.getRate().divide(new BigDecimal("100")).multiply(detail.getMoney()));
+        Company company=companyService.getById(SecurityUtils.getLoginUser().getUser().getCompanyId());
+        detail.setServiceMoney(company.getRate().divide(new BigDecimal("100")).multiply(detail.getMoney()));
         detail.setRealMoney(detail.getMoney().add(detail.getServiceMoney()));
         if (!detailService.updateById(detail)) {
             throw new ServiceException("编辑结算单明细失败");

+ 5 - 1
ruoyi-admin/src/main/resources/mapper/work/CompanyMapper.xml

@@ -14,10 +14,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         c.director,
         c.money,
         c.phone,
+        c.rate,
         c.create_time,
         c.state,
         c.email,
-        ( SELECT COUNT( r.id ) FROM tb_relate r WHERE r.company_id = c.id ) AS peoples
+        ( SELECT COUNT( r.id ) FROM tb_relate r WHERE r.company_id = c.id ) AS peoples,
+        ( SELECT SUM( r.money ) FROM tb_statement r WHERE r.company_id = c.id AND r.give=2) AS giveMoney,
+        ( SELECT SUM( r.service_money ) FROM tb_statement r WHERE r.company_id = c.id AND r.give=2) AS serviceMoney,
+        ( SELECT SUM( r.peoples ) FROM tb_statement r WHERE r.company_id = c.id AND r.give=2) AS givePeoples
         FROM
         tb_company c
         <where>