Browse Source

项目监管数据

master
liupopo 2 years ago
parent
commit
116a640276
  1. 2
      docs/databases/data_modify/data_modify-crm2system().sql
  2. 4
      docs/databases/report/table_create_report_project_daily.sql
  3. 4
      docs/databases/table_modify.sql
  4. 27
      supervise-report-ui/src/api/project/projectDaily.js
  5. 2
      supervise-report-ui/src/router/modules/codemenu.js
  6. 535
      supervise-report-ui/src/views/project/projectDaily.vue
  7. 3
      yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/projectdaily/ProjectDaily.java
  8. 9
      yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/projectdaily/ProjectDailyFilesService.java
  9. 3
      yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/projectdaily/ProjectDailyQuery.java
  10. 53
      yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/projectdaily/ProjectDailyRest.java
  11. 72
      yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/projectdaily/ProjectDailyService.java

2
docs/databases/data_modify/data_modify-crm2system().sql

@ -0,0 +1,2 @@
insert into yxt_portal.sys_user(sid, userName, password,staffSid,mobile,userType)
select uuid(),bm.name,'8ee032c2f0b2db72c45ac82007c8dac3',bm.sid,bm.telephone,3 from supervise_crm.bank_manager bm;

4
docs/databases/report/table_create_report_project_daily.sql

@ -18,7 +18,9 @@ CREATE TABLE `project_daily` (
`transitAmount` DOUBLE(12,2) DEFAULT 0 COMMENT '在途货值',
`advancePayment` DOUBLE(12,2) DEFAULT 0 COMMENT '预付款',
`pledgeRate` DOUBLE(12,2) DEFAULT 0 COMMENT '质押率=(贷款金额-帐户余额)/(库存总价值+应收帐款+在途商品+预付款)',
`messState` int(11) DEFAULT 0 COMMENT '消息发送状态: 0=未发送;1=已发送',
`messNum` int(11) DEFAULT 0 COMMENT '消息发送次数',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB COMMENT='项目监管报表';

4
docs/databases/table_modify.sql

@ -36,3 +36,7 @@ ALTER TABLE yxt_portal.sys_staffinfo ADD openId varchar(100) DEFAULT NULL COMMEN
ALTER TABLE supervise_supplychain.purchase_requisition_pro MODIFY COLUMN packageTotalPrice double(12,2) NULL COMMENT '包合计(元)(对应采购订单中的送货金额)';
ALTER TABLE supervise_supplychain.supplier_index ADD sid varchar(100) NULL;
ALTER TABLE yxt_portal.sys_user ADD openid varchar(100) NULL COMMENT '微信公众号OpenID';
ALTER TABLE yxt_portal.sys_user ADD appletOpenid varchar(100) NULL COMMENT '小程序OpenID';

27
supervise-report-ui/src/api/project/projectDaily.js

@ -12,5 +12,28 @@ export default {
data: params
})
},
}
// 所有项目信息列表
projectListAll: function() {
return request({
baseURL: '/api',
url: '/crm/v1/projectinformation/listAll'
})
},
// 保存项目监管数据
saveDaily: function(params) {
return request({
baseURL: '/api',
url: '/report/projectdaily/saveDaily',
method: 'post',
data: params
})
},
// 发送通知
sendMess: function(projectSid, orderDate) {
return request({
baseURL: '/api',
url: '/report/projectdaily/sendMess/' + projectSid + "/" + orderDate
})
}
}

2
supervise-report-ui/src/router/modules/codemenu.js

@ -106,7 +106,7 @@ const codemenu = [{
children: [{
path: '/projectDaily/index',
component: () => import('@/views/project/projectDaily.vue'),
name: 'inventorySummary',
name: 'projectDailyIndex',
meta: {
title: '项目监管报表',
noCache: true,

535
supervise-report-ui/src/views/project/projectDaily.vue

@ -1,7 +1,7 @@
<template>
<div class="app-container">
<div v-show="viewState == 1">
<button-bar ref="btnbar" view-title="每日回款核对记录" :btndisabled="btndisabled" @btnhandle="btnHandle" />
<button-bar ref="btnbar" view-title="项目监管报表" :btndisabled="btndisabled" @btnhandle="btnHandle" />
<div class="main-content">
<div class="searchcon">
<el-button size="small" class="searchbtn" @click="clicksearchShow">{{ searchxianshitit }}</el-button>
@ -12,6 +12,11 @@
<span style="padding: 0 8px"></span>
<el-date-picker v-model="queryParams.params.dataDateEnd" type="date" clearable value-format="yyyy-MM-dd" placeholder="选择数据结束日期" />
</el-form-item>
<el-form-item label="监管项目">
<el-select v-model="queryParams.params.projectSid" placeholder="请选择">
<el-option v-for="item in projectList" :key="item.sid" :label="item.entryName" :value="item.sid" />
</el-select>
</el-form-item>
</el-form>
<div class="btn" style="text-align: center;">
<el-button type="primary" size="small" icon="el-icon-search" @click="dosearch">查询</el-button>
@ -22,22 +27,31 @@
<!-- Start 项目列表头部 -->
<div class="listtop">
<div class="tit" />
<pageye v-show="dataList.length > 0" :total="queryParams.total" :page.sync="queryParams.current" :limit.sync="queryParams.size" class="pagination" @pagination="loadList" />
<pageye
v-show="dataList.length > 0"
:total="queryParams.total"
:page.sync="queryParams.current"
:limit.sync="queryParams.size"
class="pagination"
@pagination="loadList"
/>
</div>
<!-- End 项目列表头部 -->
<!-- Start 项目列表 -->
<div class="">
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%">
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
<el-table-column prop="dataDate" label="数据日期" align="center" width="120" />
<el-table-column prop="orderDate" label="数据日期" align="center" width="110" />
<el-table-column prop="createTime" label="录入时间" align="center" width="160" />
<el-table-column prop="projectName" label="项目名称" align="center" width="180" />
<el-table-column prop="stockAmount" label="库存货值(元)" align="center" width="180" />
<el-table-column prop="transitAmount" label="在途货值(元)" align="center" width="180" />
<el-table-column label="操作" wid align="center">
<el-table-column prop="projectName" label="项目名称" align="center" />
<el-table-column prop="accountsBalance" label="帐户余额(元)" align="center" width="140" />
<el-table-column prop="accountsReceivable" label="应收账款(元)" align="center" width="140" />
<el-table-column prop="stockAmount" label="库存货值(元)" align="center" width="140" />
<el-table-column prop="transitAmount" label="在途货值(元)" align="center" width="140" />
<el-table-column prop="advancePayment" label="预付款(元)" align="center" width="140" />
<el-table-column label="操作" align="center" width="130">
<template slot-scope="scope">
<el-button type="primary" icon="el-icon-edit" size="small" @click="toEdit(scope.row)">编辑</el-button>
<el-button type="primary" icon="el-icon-edit" size="small" @click="toEdit(scope.row)">删除</el-button>
<el-button type="primary" icon="el-icon-chat-dot-round" size="small" @click="sendMess(scope.row)">发送通知</el-button>
</template>
</el-table-column>
</el-table>
@ -58,39 +72,138 @@
</div>
</div>
<el-dialog title="编辑项目监管报表数据" :close-on-click-modal="false" :visible.sync="dialogVisible" width="60%" :before-close="dialogClose">
<el-card class="box-card">
<div>
<el-upload
ref="upload"
class="upload-demo"
:action="updateAction"
:on-progress="handleProgress"
:on-success="handleSuccess"
:file-list="fileList"
:auto-upload="false"
:multiple="false"
:limit="1"
>
<el-button slot="trigger" size="small" type="primary">选取文件</el-button>
<el-button style="margin-left: 10px;" size="small" type="success" @click="submitUpload">上传到服务器</el-button>
<div slot="tip" class="el-upload__tip">上传 汇融银行_按日汇总对账报表.xlsx文件</div>
</el-upload>
<el-dialog title="编辑项目监管报表数据" :close-on-click-modal="false" :visible.sync="dialogVisible" width="60%" :before-close="projectDailyClose">
<el-form ref="form_daily" :model="projectDaily" :rules="rules" label-position="right" class="formadd">
<div class="title">
<div>项目监管数据</div>
</div>
<div>
<h3>文件上传结果</h3>
<el-card class="box-card">
<div>{{ uploadResultMesssage }}</div>
</el-card>
<el-card v-show="showSelectButton" class="box-card">
<div style="color: red;margin-bottom: 15px;">是否覆盖之前的数据如果选择覆盖相关回款数据将被重置</div>
<div>
<el-button size="small" type="primary" @click="dialogClose">不覆盖关闭</el-button>
<el-button size="small" type="warning" @click="coverLog">覆盖并重置数据</el-button>
</div>
</el-card>
</div>
</el-card>
<el-row>
<el-col :span="6" class="tleftb">
<span>填报日期</span>
</el-col>
<el-col :span="6" class="trightb">
<el-form-item prop="orderDate"> <el-date-picker v-model="projectDaily.orderDate" type="date" placeholder="选择日期" value-format="yyyy-MM-dd" /></el-form-item>
</el-col>
<el-col :span="4" class="tleftb">
<span>选择监管项目</span>
</el-col>
<el-col :span="8" class="trightb">
<el-form-item>
<el-select v-model="projectDaily.projectSid" placeholder="请选择" @change="projectSelectChange()">
<el-option v-for="item in projectList" :key="item.sid" :label="item.entryName" :value="item.sid" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="6" class="tleftb">
<span>贷款总额</span>
</el-col>
<el-col :span="18" class="trightb">
<el-form-item prop="totalLoan">
<el-input v-model="projectDaily.totalLoan" oninput="value=value.replace(/[^0-9.]/g,'')" placeholder="" class="addinputw" clearable />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="6" class="tleftb">
<span>帐户余额</span>
</el-col>
<el-col :span="10" class="trightb">
<el-form-item prop="accountsBalance">
<el-input v-model="projectDaily.accountsBalance" oninput="value=value.replace(/[^0-9.]/g,'')" placeholder="" class="addinputw" clearable />
</el-form-item>
</el-col>
<el-col :span="8" class="trightb">
<el-form-item>
<el-upload class="upload-demo" :action="updateAction" :on-success="handleSuccess1" :show-file-list="false">
<el-button size="small" type="primary">上传账户余额报表</el-button>
</el-upload>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="6" class="tleftb">
<span>应收账款</span>
</el-col>
<el-col :span="10" class="trightb">
<el-form-item prop="accountsReceivable">
<el-input v-model="projectDaily.accountsReceivable" oninput="value=value.replace(/[^0-9.]/g,'')" placeholder="" class="addinputw" clearable />
</el-form-item>
</el-col>
<el-col :span="8" class="trightb">
<el-form-item>
<el-upload class="upload-demo" :action="updateAction" :on-success="handleSuccess2" :show-file-list="false">
<el-button size="small" type="primary">上传应收账款报表</el-button>
</el-upload>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="6" class="tleftb">
<span>库存货值</span>
</el-col>
<el-col :span="10" class="trightb">
<el-form-item prop="stockAmount">
<el-input v-model="projectDaily.stockAmount" oninput="value=value.replace(/[^0-9.]/g,'')" placeholder="" class="addinputw" clearable />
</el-form-item>
</el-col>
<el-col :span="8" class="trightb">
<el-form-item>
<el-upload class="upload-demo" :action="updateAction" :on-success="handleSuccess3" :show-file-list="false">
<el-button size="small" type="primary">上传库存货值报表</el-button>
</el-upload>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="6" class="tleftb">
<span>在途货值</span>
</el-col>
<el-col :span="10" class="trightb">
<el-form-item prop="transitAmount">
<el-input v-model="projectDaily.transitAmount" oninput="value=value.replace(/[^0-9.]/g,'')" placeholder="" class="addinputw" clearable />
</el-form-item>
</el-col>
<el-col :span="8" class="trightb">
<el-form-item>
<el-upload class="upload-demo" :action="updateAction" :on-success="handleSuccess4" :show-file-list="false">
<el-button size="small" type="primary">上传在途货值报表</el-button>
</el-upload>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="6" class="tleftb">
<span>预付款</span>
</el-col>
<el-col :span="10" class="trightb">
<el-form-item prop="advancePayment">
<el-input v-model="projectDaily.advancePayment" oninput="value=value.replace(/[^0-9.]/g,'')" placeholder="" class="addinputw" clearable />
</el-form-item>
</el-col>
<el-col :span="8" class="trightb">
<el-form-item>
<el-upload class="upload-demo" :action="updateAction" :on-success="handleSuccess5" :show-file-list="false">
<el-button size="small" type="primary">上传预付款报表</el-button>
</el-upload>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="6" class="tleftb">
<span>备注</span>
</el-col>
<el-col :span="18" class="trightb">
<el-form-item><el-input v-model="projectDaily.remarks" type="textarea" :rows="2" placeholder="" class="addinputw" clearable /></el-form-item>
</el-col>
</el-row>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="projectDailyClose"> </el-button>
<el-button type="primary" @click="projectDailySave()"> </el-button>
</span>
</el-dialog>
</div>
</template>
@ -100,6 +213,9 @@
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
import req from '@/api/project/projectDaily'
import {
parseTime
} from '@/utils/index'
export default {
name: 'DaydatauploadCash',
components: {
@ -108,6 +224,23 @@
pageye
},
data() {
var checkIsNumber = (rule, value, callback) => {
if (!value) { // 使text
callback(new Error(rule.text ? rule.text : '请输入'))
} else {
// const reg = /^[0-9]*$/
const reg = /^[+-]?\d+(?:\.\d{1,4})?$/
if (reg.test(value) && value >= 0) {
callback()
} else {
if (!String(value).indexOf('.') + 1) {
callback(new Error('请输入数字!'))
} else {
callback(new Error('仅支持小数点后4位!'))
}
}
}
}
return {
btndisabled: false,
viewState: 1, // 1 2 3 4
@ -119,7 +252,8 @@
total: 0,
params: {
dataDateStart: '',
dataDateEnd: ''
dataDateEnd: '',
projectSid: ''
}
},
tableLoading: false,
@ -129,7 +263,7 @@
size: 'small',
icon: 'upload',
btnKey: 'showUploadXlsx',
btnLabel: '上传按日汇总对账报表'
btnLabel: '填报当日数据'
},
{
type: 'info',
@ -139,23 +273,92 @@
btnLabel: '关闭'
}
],
fullscreenloading: null,
dialogVisible: false,
updateAction: '/api/customer' + '/csmcash/uploadGdData',
fileList: [],
uploadResultMesssage: '',
updateAction: '/api/report' + '/projectdaily/uploadfile',
showSelectButton: false,
currentLogSid: '',
ychzFilePath: ''
ychzFilePath: '',
projectDaily: {
sid: '',
remarks: '', // ',
orderDate: parseTime(new Date(), '{y}-{m}-{d}'), // ',
projectSid: '', // Sid',
projectName: '', // ',
totalLoan: 0, // ',
accountsBalance: 0, // ',
accountsReceivable: 0, // ',
stockAmount: 0, // ',
transitAmount: 0, // ',
advancePayment: 0, // ',
fileList: []
// fileList:[{
// fileTypeId: '', // : 1=;2=;3=;4=;5=;',
// fileTypeName` VARCHAR(100) DEFAULT NULL COMMENT ': 1=;2=;3=;4=;5=',
// fileSrcName` VARCHAR(100) DEFAULT NULL COMMENT '',
// filePath` VARCHAR(1024) DEFAULT NULL COMMENT '',
// fullUrl` VARCHAR(2048) DEFAULT NULL COMMENT '访URL',
// }]
},
rules: {
projectSid: [{
required: true,
message: '请选择回监管项目',
trigger: 'blur'
}],
orderDate: [{
required: true,
message: '请选择填报日期',
trigger: 'blur'
}],
totalLoan: [{
validator: checkIsNumber,
trigger: 'blur'
}],
accountsBalance: [{
validator: checkIsNumber,
trigger: 'blur'
}],
accountsReceivable: [{
validator: checkIsNumber,
trigger: 'blur'
}],
stockAmount: [{
validator: checkIsNumber,
trigger: 'blur'
}],
transitAmount: [{
validator: checkIsNumber,
trigger: 'blur'
}],
advancePayment: [{
validator: checkIsNumber,
trigger: 'blur'
}]
},
projectList: [],
reportFileList: []
}
},
mounted() {
this.$refs['btnbar'].setButtonList(this.btnList)
},
created() {
this.initData()
this.loadList()
},
methods: {
initData() {
req.projectListAll().then(res => {
this.projectList = res.data
this.projectDaily.projectSid = this.projectList[0].sid
this.projectDaily.projectName = this.projectList[0].entryName
this.projectDaily.totalLoan = Number(this.projectList[0].creditLimit)
console.log('projectList:', res)
}).catch(e => {
console.log('projectListAll--ee:', e)
})
},
//
clicksearchShow() {
this.isSearchShow = !this.isSearchShow
@ -188,7 +391,8 @@
total: 0,
params: {
dataDateStart: '',
dataDateEnd: ''
dataDateEnd: '',
projectSid: ''
}
}
this.loadList()
@ -214,87 +418,188 @@
showUploadXlsx() {
this.dialogVisible = true
},
dialogClose() {
this.clearLog()
this.fileList = []
this.showSelectButton = false
this.currentLogSid = ''
this.uploadResultMesssage = ''
projectSelectChange() {
for (const i in this.projectList) {
if (this.projectDaily.projectSid === this.projectList[i].sid) {
this.projectDaily.totalLoan = Number(this.projectList[i].creditLimit)
this.projectDaily.projectName = this.projectList[i].entryName
}
}
},
projectDailyClose() {
this.projectDaily.sid = ''
this.projectDaily.remarks = '' // ',
this.projectDaily.orderDate = parseTime(new Date(), '{y}-{m}-{d}') // ',
this.projectDaily.projectSid = this.projectList[0].sid // Sid',
this.projectDaily.projectName = this.projectList[0].entryName // ',
this.projectDaily.totalLoan = Number(this.projectList[0].creditLimit) // ',
this.projectDaily.accountsBalance = 0 // ',
this.projectDaily.accountsReceivable = 0 // ',
this.projectDaily.stockAmount = 0 // ',
this.projectDaily.transitAmount = 0 // ',
this.projectDaily.advancePayment = 0 // ',
this.projectDaily.fileList = []
this.reportFileList = []
this.$refs['form_daily'].resetFields()
this.dialogVisible = false
},
submitUpload() {
this.$refs.upload.submit()
projectDailySave() {
this.$refs['form_daily'].validate((valid) => {
if (valid) {
this.projectDaily.fileList = this.reportFileList
req.saveDaily(this.projectDaily).then(resp => {
this.loadList()
this.projectDailyClose()
}).catch(e => {
console.log('projectDailySave--e:', e)
})
} else {
console.log('error submit!!')
return false
}
})
},
handleProgress(event, file, fileList) {
const _this = this
this.fullscreenloading = this.$loading({
lock: true,
text: '文件正在上传',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
sendMess(row) {
req.sendMess(row.projectSid, row.orderDate).then(res => {
this.$message({
showClose: true,
type: 'success',
message: '消息已经送出'
})
}).catch(e => {
console.log('sendMess--e: ', e)
})
console.log('111', event.percent)
if (event.percent >= 100) {
_this.fullscreenloading.text = '上传完成,正在导入数据库'
},
handleSuccess1(resp, file, fileList) {
console.log('111', resp)
const _this = this
let noHasFile = true
for (const i in _this.reportFileList) {
if (_this.reportFileList[i].fileTypeId === 1) {
noHasFile = false
_this.reportFileList[i].fileTypeId = 1 // ': 1=;2=;3=;4=;5=;',
_this.reportFileList[i].fileTypeName = '帐户余额' // ': 1=;2=;3=;4=;5=',
_this.reportFileList[i].fileSrcName = resp.data.sourceFileName // '',
_this.reportFileList[i].filePath = resp.data.sourceFileName // '',
_this.reportFileList[i].fullUrl = resp.data.sourceFileName // '访URL',
break
}
}
if (noHasFile) {
const upfile = {
fileTypeId: 1, // ': 1=;2=;3=;4=;5=;',
fileTypeName: '帐户余额', // ': 1=;2=;3=;4=;5=',
fileSrcName: resp.data.sourceFileName, // '',
filePath: resp.data.sourceFileName, // '',
fullUrl: resp.data.sourceFileName // '访URL',
}
_this.reportFileList.push(upfile)
}
},
handleSuccess(resp, file, fileList) {
handleSuccess2(resp, file, fileList) {
console.log('222', resp)
const _this = this
if (this.fullscreenloading) this.fullscreenloading.close()
this.fullscreenloading = null
if (resp.success) {
_this.uploadResultMesssage = '按日汇总对账报表数据已经导入,可进行回款数据比对~'
_this.loadList()
setTimeout(function() {
_this.dialogClose()
}, 3000)
} else {
_this.fileList = []
if (resp.code === 'cash_5001') {
_this.uploadResultMesssage = '没有进行数据导入,异常信息为:' + resp.msg
} else if (resp.code === 'cash_5002') {
_this.uploadResultMesssage = resp.msg
_this.showSelectButton = true
_this.currentLogSid = resp.data.sid
} else {
_this.uploadResultMesssage = '上传数据文件异常,请选择正确的汇总对账报表文件上传,异常信息为:' + resp.msg
let noHasFile = true
for (const i in _this.reportFileList) {
if (_this.reportFileList[i].fileTypeId === 2) {
noHasFile = false
_this.reportFileList[i].fileTypeId = 2 // ': 1=;2=;3=;4=;5=;',
_this.reportFileList[i].fileTypeName = '应收账款' // ': 1=;2=;3=;4=;5=',
_this.reportFileList[i].fileSrcName = resp.data.sourceFileName // '',
_this.reportFileList[i].filePath = resp.data.sourceFileName // '',
_this.reportFileList[i].fullUrl = resp.data.sourceFileName // '访URL',
break
}
}
},
clearLog() {
if (this.currentLogSid) {
req.clearLog({
logsid: this.currentLogSid
}).then(res => {
console.log('临时数据已经清除:', this.currentLogSid)
this.currentLogSid = ''
}).catch(e => {
console.log('CsmCashLog-clearLog-ee:', e)
})
if (noHasFile) {
const upfile = {
fileTypeId: 2, // ': 1=;2=;3=;4=;5=;',
fileTypeName: '应收账款', // ': 1=;2=;3=;4=;5=',
fileSrcName: resp.data.sourceFileName, // '',
filePath: resp.data.sourceFileName, // '',
fullUrl: resp.data.sourceFileName // '访URL',
}
_this.reportFileList.push(upfile)
}
},
coverLog() {
if (this.currentLogSid) {
req.coverLog({
logsid: this.currentLogSid
}).then(res => {
this.loadList()
this.showSelectButton = false
this.currentLogSid = ''
this.dialogVisible = false
this.uploadResultMesssage = ''
}).catch(e => {
console.log('CsmCashLog-coverLog-ee:', e)
})
handleSuccess3(resp, file, fileList) {
console.log('333', resp)
const _this = this
let noHasFile = true
for (const i in _this.reportFileList) {
if (_this.reportFileList[i].fileTypeId === 3) {
noHasFile = false
_this.reportFileList[i].fileTypeId = 3 // ': 1=;2=;3=;4=;5=;',
_this.reportFileList[i].fileTypeName = '库存货值' // ': 1=;2=;3=;4=;5=',
_this.reportFileList[i].fileSrcName = resp.data.sourceFileName // '',
_this.reportFileList[i].filePath = resp.data.sourceFileName // '',
_this.reportFileList[i].fullUrl = resp.data.sourceFileName // '访URL',
break
}
}
if (noHasFile) {
const upfile = {
fileTypeId: 3, // ': 1=;2=;3=;4=;5=;',
fileTypeName: '库存货值', // ': 1=;2=;3=;4=;5=',
fileSrcName: resp.data.sourceFileName, // '',
filePath: resp.data.sourceFileName, // '',
fullUrl: resp.data.sourceFileName // '访URL',
}
_this.reportFileList.push(upfile)
}
},
toEdit(row) {
this.viewState = 3
this.$refs['divcashedit'].showEdit(row)
handleSuccess4(resp, file, fileList) {
console.log('444', resp)
const _this = this
let noHasFile = true
for (const i in _this.reportFileList) {
if (_this.reportFileList[i].fileTypeId === 4) {
noHasFile = false
_this.reportFileList[i].fileTypeId = 4 // ': 1=;2=;3=;4=;5=;',
_this.reportFileList[i].fileTypeName = '在途货值' // ': 1=;2=;3=;4=;5=',
_this.reportFileList[i].fileSrcName = resp.data.sourceFileName // '',
_this.reportFileList[i].filePath = resp.data.sourceFileName // '',
_this.reportFileList[i].fullUrl = resp.data.sourceFileName // '访URL',
break
}
}
if (noHasFile) {
const upfile = {
fileTypeId: 4, // ': 1=;2=;3=;4=;5=;',
fileTypeName: '在途货值', // ': 1=;2=;3=;4=;5=',
fileSrcName: resp.data.sourceFileName, // '',
filePath: resp.data.sourceFileName, // '',
fullUrl: resp.data.sourceFileName // '访URL',
}
_this.reportFileList.push(upfile)
}
},
resetState() {
this.viewState = 1
handleSuccess5(resp, file, fileList) {
console.log('555', resp)
const _this = this
let noHasFile = true
for (const i in _this.reportFileList) {
if (_this.reportFileList[i].fileTypeId === 5) {
noHasFile = false
_this.reportFileList[i].fileTypeId = 5 // ': 1=;2=;3=;4=;5=;',
_this.reportFileList[i].fileTypeName = '预付款' // ': 1=;2=;3=;4=;5=',
_this.reportFileList[i].fileSrcName = resp.data.sourceFileName // '',
_this.reportFileList[i].filePath = resp.data.sourceFileName // '',
_this.reportFileList[i].fullUrl = resp.data.sourceFileName // '访URL',
break
}
}
if (noHasFile) {
const upfile = {
fileTypeId: 5, // ': 1=;2=;3=;4=;5=;',
fileTypeName: '预付款', // ': 1=;2=;3=;4=;5=',
fileSrcName: resp.data.sourceFileName, // '',
filePath: resp.data.sourceFileName, // '',
fullUrl: resp.data.sourceFileName // '访URL',
}
_this.reportFileList.push(upfile)
}
}
}
}

3
yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/projectdaily/ProjectDaily.java

@ -34,6 +34,9 @@ public class ProjectDaily extends EntityWithId {
private double advancePayment = 0; // 预付款',
private double pledgeRate = 0; // 质押率=(贷款金额-帐户余额)/(库存总价值+应收帐款+在途商品+预付款)',
private int messState = 0; // 消息发送状态: 0=未发送;1=已发送',
private int messNum = 0; // 消息发送次数',
/**
* 计算出的质押率
*

9
yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/projectdaily/ProjectDailyFilesService.java

@ -1,8 +1,17 @@
package com.yxt.supervise.report.biz.projectdaily;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class ProjectDailyFilesService extends ServiceImpl<ProjectDailyFilesMapper, ProjectDailyFiles> {
public List<ProjectDailyFiles> listByProjectAndDay(String projectSid, String orderDate) {
QueryWrapper<ProjectDailyFiles> qw = new QueryWrapper<>();
qw.eq("projectSid", projectSid);
qw.eq("orderDate", orderDate);
return baseMapper.selectList(qw);
}
}

3
yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/projectdaily/ProjectDailyQuery.java

@ -24,4 +24,7 @@ public class ProjectDailyQuery implements Query {
private double transitAmount = 0; // 在途货值',
private double advancePayment = 0; // 预付款',
private double pledgeRate = 0; // 质押率=(贷款金额-帐户余额)/(库存总价值+应收帐款+在途商品+预付款)',
private String dataDateStart; // 数据日期
private String dataDateEnd; // 数据日期
}

53
yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/projectdaily/ProjectDailyRest.java

@ -1,8 +1,13 @@
package com.yxt.supervise.report.biz.projectdaily;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yxt.common.base.config.component.FileUploadComponent;
import com.yxt.common.core.query.PagerQuery;
import com.yxt.common.core.result.FileUploadResult;
import com.yxt.common.core.result.ResultBean;
import com.yxt.common.core.vo.PagerVo;
import com.yxt.supervise.report.biz.stock.ReportStockDay;
import com.yxt.supervise.report.biz.stock.ReportStockDayStore;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
@ -15,20 +20,58 @@ import java.util.List;
@RequestMapping("/projectdaily")
public class ProjectDailyRest {
@Autowired
private FileUploadComponent fileUploadComponent;
@Autowired
private ProjectDailyService projectDailyService;
@Autowired
private ProjectDailyFilesService projectDailyFilesService;
@ApiOperation("查询项目监管报表信息")
@PostMapping("/listPage")
public ResultBean selectListPage(@RequestBody PagerQuery<ProjectDailyQuery> pq){
public ResultBean<IPage<ProjectDaily>> selectListPage(@RequestBody PagerQuery<ProjectDailyQuery> pq) {
ResultBean rb = ResultBean.fireFail();
PagerVo<ProjectDailyVo> projectDailyVoPagerVo = projectDailyService.selectListPage(pq);
return rb.success().setData(projectDailyVoPagerVo);
// PagerVo<ProjectDailyVo> projectDailyVoPagerVo = projectDailyService.selectListPage(pq);
IPage<ProjectDaily> iPage = projectDailyService.listPage(pq);
return rb.success().setData(iPage);
}
@ApiOperation("添加项目监管报表信息")
@PostMapping("/save")
public ResultBean save(@RequestBody ProjectDailyDto dto){
@PostMapping("/saveDaily")
public ResultBean saveDaily(@RequestBody ProjectDailyDto dto) {
return projectDailyService.save(dto);
}
@PostMapping("/uploadfile")
public ResultBean<FileUploadResult> uploadImage(@RequestParam(value = "file") MultipartFile file) {
ResultBean rb = ResultBean.fireFail();
if (file == null || file.isEmpty()) {
return rb.setMsg("文件为空");
}
rb = fileUploadComponent.uploadFile(file, "reportprojectdaily");
return rb;
}
@GetMapping("/getProjectDaily/{projectSid}/{orderDate}")
public ResultBean<ProjectDaily> getProjectDaily(@PathVariable("projectSid") String projectSid, @PathVariable("orderDate") String orderDate) {
ResultBean rb = ResultBean.fireFail();
ProjectDaily pv = projectDailyService.fetchByProjectAndDay(projectSid, orderDate);
return rb.success().setData(pv);
}
@GetMapping("/getProjectDailyFiles/{projectSid}/{orderDate}")
public ResultBean<List<ProjectDailyFiles>> getProjectDailyFiles(@PathVariable("projectSid") String projectSid, @PathVariable("orderDate") String orderDate) {
ResultBean rb = ResultBean.fireFail();
List<ProjectDailyFiles> pv = projectDailyFilesService.listByProjectAndDay(projectSid, orderDate);
return rb.success().setData(pv);
}
@GetMapping("/sendMess/{projectSid}/{orderDate}")
public ResultBean sendMess(@PathVariable("projectSid") String projectSid, @PathVariable("orderDate") String orderDate) {
ResultBean rb = ResultBean.fireFail();
projectDailyService.sendMess(projectSid, orderDate);
return rb.success();
}
}

72
yxt_supervise/supervise-report/supervise-report-biz/src/main/java/com/yxt/supervise/report/biz/projectdaily/ProjectDailyService.java

@ -3,6 +3,7 @@ package com.yxt.supervise.report.biz.projectdaily;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.unit.DataUnit;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@ -32,10 +33,10 @@ public class ProjectDailyService extends ServiceImpl<ProjectDailyMapper, Project
@Autowired
private ProjectDailyFilesService projectDailyFilesService;
public PagerVo<ProjectDailyVo> selectListPage(PagerQuery<ProjectDailyQuery> pq){
public PagerVo<ProjectDailyVo> selectListPage(PagerQuery<ProjectDailyQuery> pq) {
ProjectDailyQuery params = pq.getParams();
QueryWrapper<ProjectDaily> wq = new QueryWrapper<>();
if (params != null){
if (params != null) {
}
IPage<ProjectDaily> page = PagerUtil.queryToPage(pq);
@ -43,17 +44,39 @@ public class ProjectDailyService extends ServiceImpl<ProjectDailyMapper, Project
PagerVo<ProjectDailyVo> objectPagerVo = PagerUtil.pageToVo(projectDailyVoIPage, null);
return objectPagerVo;
}
public ResultBean save(ProjectDailyDto dto){
public IPage<ProjectDaily> listPage(PagerQuery<ProjectDailyQuery> pq) {
ProjectDailyQuery params = pq.getParams();
QueryWrapper<ProjectDaily> qw = new QueryWrapper<>();
qw.gt("id", 0);
if (StrUtil.isNotBlank(params.getDataDateStart())) {
qw.ge("orderDate", params.getDataDateStart());
}
if (StrUtil.isNotBlank(params.getDataDateEnd())) {
qw.le("orderDate", params.getDataDateEnd());
}
if (StrUtil.isNotBlank(params.getProjectSid())) {
qw.eq("projectSid", params.getProjectSid());
}
qw.orderByDesc("orderDate", "createTime");
IPage<ProjectDaily> iPage = PagerUtil.queryToPage(pq);
IPage<ProjectDaily> page = baseMapper.selectPage(iPage, qw);
return page;
}
public ResultBean save(ProjectDailyDto dto) {
ResultBean rb = ResultBean.fireFail();
ProjectDaily projectDaily = new ProjectDaily();
BeanUtil.copyProperties(dto,projectDaily);
BeanUtil.copyProperties(dto, projectDaily);
String pledgeRateNormal = projectDaily.getPledgeRateNormal();
projectDaily.setPledgeRate(Double.parseDouble(pledgeRateNormal));
baseMapper.delete(new QueryWrapper<ProjectDaily>().eq("orderDate", DateUtil.format(new Date(), "yyyy-MM-dd")));
projectDaily.setReportTime(projectDaily.getOrderDate() + " " + DateUtil.format(new Date(), "HH:mm"));
baseMapper.delete(new QueryWrapper<ProjectDaily>().eq("projectSid", dto.getProjectSid()).eq("orderDate", dto.getOrderDate()));
baseMapper.insert(projectDaily);
List<ProjectDailyFiles> fileList = dto.getFileList();
if (fileList != null){
projectDailyFilesService.remove(new QueryWrapper<ProjectDailyFiles>().eq("orderDate", DateUtil.format(new Date(), "yyyy-MM-dd")));
if (fileList != null && !fileList.isEmpty()) {
projectDailyFilesService.remove(new QueryWrapper<ProjectDailyFiles>().eq("projectSid", dto.getProjectSid()).eq("orderDate", dto.getOrderDate()));
for (ProjectDailyFiles s : fileList) {
ProjectDailyFiles projectDailyFiles = new ProjectDailyFiles();
projectDailyFiles.setOrderDate(dto.getOrderDate());
@ -68,25 +91,22 @@ public class ProjectDailyService extends ServiceImpl<ProjectDailyMapper, Project
projectDailyFilesService.save(projectDailyFiles);
}
}
//上传文件
// for (MultipartFile s : fileList) {
// //获取文件名
// String originalFilename = s.getOriginalFilename();
// byte [] bytes = originalFilename.getBytes();
// File file = new File(uploadPath);
// if (!file.exists()) {
// file.mkdirs();
// }
// //创建文件
// File file1 = new File(file, originalFilename);
// //写入指定文件夹
// try {
// OutputStream out = new FileOutputStream(file1);
// out.write(bytes);
// }catch (Exception e){
// e.printStackTrace();
// }
// }
return rb.success().setMsg("添加成功");
}
public ProjectDaily fetchByProjectAndDay(String projectSid, String orderDate) {
QueryWrapper<ProjectDaily> qw = new QueryWrapper<>();
qw.eq("projectSid", projectSid)
.eq("orderDate", orderDate);
return baseMapper.selectOne(qw);
}
public void sendMess(String projectSid, String orderDate) {
ProjectDaily projectDaily = this.fetchByProjectAndDay(projectSid, orderDate);
projectDaily.setMessState(1);
projectDaily.setMessNum(projectDaily.getMessNum() + 1);
baseMapper.updateById(projectDaily);
// TODO: 发送微信模板消息
}
}

Loading…
Cancel
Save