diff --git a/supervise-customer-ui/src/api/customer/csmcash.js b/supervise-customer-ui/src/api/customer/csmcash.js
new file mode 100644
index 00000000..99a18263
--- /dev/null
+++ b/supervise-customer-ui/src/api/customer/csmcash.js
@@ -0,0 +1,20 @@
+import request from '@/utils/request'
+// 入库导入的记录
+export default {
+
+ // 查询分页列表
+ listPage: function(params) {
+ return request({
+ baseURL: '/api',
+ url: '/customer/csmcash/listPage',
+ method: 'post',
+ data: params
+ })
+ },
+ // 通过sid查询一条记录
+ fetchBySid: function(sid) {
+ return request({
+ url: '/supervise/v1/gdinstoragelog/fetchDetailsBySid/' + sid
+ })
+ }
+}
diff --git a/supervise-customer-ui/src/views/daydataupload/cash/index.vue b/supervise-customer-ui/src/views/daydataupload/cash/index.vue
index b5bece24..97fe792b 100644
--- a/supervise-customer-ui/src/views/daydataupload/cash/index.vue
+++ b/supervise-customer-ui/src/views/daydataupload/cash/index.vue
@@ -28,16 +28,32 @@
-
-
-
-
-
+
+
+
+
+
+
- 正在导入数据库...刷新
- 正在创建报表...刷新
- 正在生成Excel...刷新
+ 正在导入数据库...刷新
+ 正在创建报表...刷新
+ 正在生成Excel...刷新
下载库存日报表
没有报表文件
@@ -74,7 +90,7 @@
>
选取文件
上传到服务器
- 上传 《汇融银行_库存信息查询.xlsx》文件
+ 上传 《汇融银行_按日汇总对账报表.xlsx》文件
@@ -82,14 +98,11 @@
{{ uploadResultMesssage }}
-
-
-
库存汇总数据
-
- {{ hzResultMesssage }}
+
+ 是否覆盖之前的数据,如果选择覆盖,相关回款数据将被重置!
- 下载库存汇总文件
-
+ 不覆盖,关闭
+ 覆盖并重置数据
@@ -102,7 +115,7 @@
import ButtonBar from '@/components/ButtonBar'
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
- import req from '@/api/supervise/gdinventorylog'
+ import req from '@/api/customer/csmcash'
export default {
name: 'DaydatauploadCash',
@@ -143,15 +156,14 @@
btnLabel: '关闭'
}
],
+ fullscreenloading: null,
dialogVisible: false,
updateAction: '/api/customer' + '/csmcash/uploadGdData',
- name: '库存数据导入',
fileList: [],
uploadResultMesssage: '',
- hzResultMesssage: '',
- hzFilePath: '',
- ychzFilePath: '',
- fullscreenloading: null
+ showSelectButton: false,
+ currentLogSid: '',
+ ychzFilePath: ''
}
},
mounted() {
@@ -209,7 +221,7 @@
this.queryParams.total = res.data.total
this.dataList = res.data.records
}).catch(e => {
- console.log('GdinventoryLog-loadList-ee:', e)
+ console.log('CsmCashLog-loadList-ee:', e)
})
},
doClose() {
@@ -220,15 +232,12 @@
this.dialogVisible = true
},
dialogClose() {
- this.currentLog = {}
+ this.clearLog()
this.fileList = []
- this.filecandown = true
+ this.showSelectButton = false
+ this.currentLogSid = ''
this.dialogVisible = false
},
- // 返回
- handleReturn() {
- this.$router.go(-1)
- },
submitUpload() {
this.$refs.upload.submit()
},
@@ -246,71 +255,49 @@
}
},
handleSuccess(resp, file, fileList) {
- // if (this.fullscreenloading) this.fullscreenloading.close()
- // this.fullscreenloading = null
console.log('222', resp)
- const rdata = resp.data
const _this = this
if (this.fullscreenloading) this.fullscreenloading.close()
this.fullscreenloading = null
- _this.uploadResultMesssage = '文件上传完成,正在进行数据整理~'
- _this.loadList()
- setTimeout(function() {
+ if (resp.success) {
+ _this.uploadResultMesssage = '按日汇总对账报表数据已经导入,可进行回款数据比对~'
+ _this.loadList()
+ setTimeout(function() {
_this.dialogClose()
- }, 3000)
- // _this.fullscreenloading.text = '数据导入完成,正在生成报表~'
- // this.fileList = []
- // _this.uploadResultMesssage = '共导入数据:' + rdata.allNum + ' 条;普通商品数据:' + rdata.validNum + ' 条;烟草商品数据:' + rdata.errRowNum + ' 条;用时:' + rdata.durations + ' 毫秒。'
- // const param = {
- // orderDate: rdata.orderDate
- // }
- // req.kcReport(param)
- // .then(res => {
- // console.log('333', res)
- // _this.fullscreenloading.text = '报表数据完成,创建Excel文件'
+ }, 3000)
+ } else {
+ _this.fileList = []
+ if (resp.code === 'cash_5001') {
+ _this.uploadResultMesssage = '没有进行数据导入,异常信息为:' + resp.msg
+ } else if (resp.code === 'cash_5002') {
+ _this.uploadResultMesssage = resp.msg
- // req.kcExcel({ logid: rdata.id })
- // .then(res => {
- // if (this.fullscreenloading) this.fullscreenloading.close()
- // this.fullscreenloading = null
- // console.log('444', res)
- // _this.hzFilePath = res.data.fileUrl
- // })
- // .catch(e => {
- // if (this.fullscreenloading) this.fullscreenloading.close()
- // this.fullscreenloading = null
- // })
- // })
- // .catch(e => {
- // if (this.fullscreenloading) this.fullscreenloading.close()
- // this.fullscreenloading = null
- // })
- },
- toDownload(row) {
- console.log('lll', row)
- if (row.fileUrl) {
- window.open(row.fileUrl, '_blank')
+ _this.showSelectButton = true
+ _this.currentLogSid = resp.data.sid
+ } else {
+ _this.uploadResultMesssage = '上传数据文件异常,请选择正确的汇总对账报表文件上传,异常信息为:' + resp.msg
+ }
}
},
- doDownloadHz() {
- window.open(this.hzFilePath, '_blank')
- // downloadhz({ filepath: this.hzFilePath })
- // .then(res => {
- // console.log('xxx', res)
- // const blob = new Blob([res.data])
- // const url = window.URL.createObjectURL(blob) // 创建 url 并指向 blob
- // const a = document.createElement('a')
- // a.href = url
- // a.download = '导出数据.xlsx'
- // a.click()
- // window.URL.revokeObjectURL(url) // 释放该 ur
- // })
- // .catch(e => {
- // console.log(e)
- // })
+ clearLog() {
+ if (this.currentLogSid) {
+ req.clearLog(this.currentLogSid).then(res => {
+ this.queryParams.total = res.data.total
+ this.dataList = res.data.records
+ }).catch(e => {
+ console.log('CsmCashLog-loadList-ee:', e)
+ })
+ }
},
- doDownloadHzYc() {
- window.open(this.ychzFilePath, '_blank')
+ coverLog(logsid) {
+ if (logsid) {
+ req.clearLog(logsid).then(res => {
+ this.queryParams.total = res.data.total
+ this.dataList = res.data.records
+ }).catch(e => {
+ console.log('CsmCashLog-loadList-ee:', e)
+ })
+ }
}
}
}
diff --git a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/CodeMsgEnum.java b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/CodeMsgEnum.java
new file mode 100644
index 00000000..651780eb
--- /dev/null
+++ b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/CodeMsgEnum.java
@@ -0,0 +1,48 @@
+package com.yxt.supervise.customer;
+
+import com.yxt.common.core.result.IResultCodeMsg;
+
+/**
+ * 统一返回信息的code和msg,需要更新并安装yxt-common-core项目
+ */
+public enum CodeMsgEnum implements IResultCodeMsg {
+
+ /**
+ * 返回正常
+ */
+ HTML200("200", "返回正常"),
+ /**
+ * 页面不存在
+ */
+ HTML404("404", "页面不存在"),
+ /**
+ * 服务器错误
+ */
+ HTML500("500", "服务器错误"),
+ /**
+ * 回款报表已经生成,不可再次导入
+ */
+ CASH_5001("cash_5001", "报表已生成,不可再次导入"),
+ /**
+ * 当日数据已存在,但未生成报表,可修改,是否覆盖
+ */
+ CASH_5002("cash_5002", "当日数据已存在,是否覆盖");
+
+ private String code;
+ private String msg;
+
+ private CodeMsgEnum(String code, String msg) {
+ this.code = code;
+ this.msg = msg;
+ }
+
+ @Override
+ public String getMsg() {
+ return msg;
+ }
+
+ @Override
+ public String getCode() {
+ return code;
+ }
+}
diff --git a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/csmcash/CsmCashGd.java b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/csmcash/CsmCashGd.java
index cc1e6429..a3e4dea6 100644
--- a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/csmcash/CsmCashGd.java
+++ b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/csmcash/CsmCashGd.java
@@ -4,12 +4,23 @@ import cn.hutool.core.util.IdUtil;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yxt.common.core.domain.EntityWithId;
+import lombok.Data;
import java.util.Date;
+@Data
@TableName("csm_cash_gd")
public class CsmCashGd extends EntityWithId {
+ public CsmCashGd() {
+ }
+
+ public CsmCashGd(String dataDate, String accountName, double accountAmount) {
+ this.dataDate = dataDate;
+ this.accountName = accountName;
+ this.accountAmount = accountAmount;
+ }
+
private String sid = IdUtil.fastSimpleUUID(); // sid
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss",
@@ -22,59 +33,5 @@ public class CsmCashGd extends EntityWithId {
private String accountName; // 账户名称
private double accountAmount; // 金额
- public String getSid() {
- return sid;
- }
-
- public void setSid(String sid) {
- this.sid = sid;
- }
-
- public Date getCreateTime() {
- return createTime;
- }
-
- public void setCreateTime(Date createTime) {
- this.createTime = createTime;
- }
-
- public String getRemarks() {
- return remarks;
- }
-
- public void setRemarks(String remarks) {
- this.remarks = remarks;
- }
-
- public int getStatus() {
- return status;
- }
-
- public void setStatus(int status) {
- this.status = status;
- }
-
- public String getDataDate() {
- return dataDate;
- }
-
- public void setDataDate(String dataDate) {
- this.dataDate = dataDate;
- }
-
- public String getAccountName() {
- return accountName;
- }
-
- public void setAccountName(String accountName) {
- this.accountName = accountName;
- }
-
- public double getAccountAmount() {
- return accountAmount;
- }
-
- public void setAccountAmount(double accountAmount) {
- this.accountAmount = accountAmount;
- }
+ private String logsid; // 日志记录的SID',
}
diff --git a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/csmcash/CsmCashGdService.java b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/csmcash/CsmCashGdService.java
index 6572fdad..41796ca9 100644
--- a/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/csmcash/CsmCashGdService.java
+++ b/yxt_supervise/supervise-customer/supervise-customer-biz/src/main/java/com/yxt/supervise/customer/biz/csmcash/CsmCashGdService.java
@@ -1,51 +1,26 @@
package com.yxt.supervise.customer.biz.csmcash;
-import cn.hutool.poi.excel.ExcelReader;
-import cn.hutool.poi.excel.ExcelUtil;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.yxt.common.base.config.component.FileUploadComponent;
-import com.yxt.common.core.result.FileUploadResult;
-import com.yxt.common.core.result.ResultBean;
-import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
-import org.springframework.web.multipart.MultipartFile;
import java.util.List;
-import java.util.Map;
@Service
public class CsmCashGdService extends ServiceImpl {
@Autowired
- private FileUploadComponent fileUploadComponent;
- @Autowired
- private CsmCashLogService csmCashLogService;
-
- public ResultBean uploadAnd2Db(MultipartFile file) {
- ResultBean rb = ResultBean.fireFail();
+ private CsmCashSalesService csmCashSalesService;
- ResultBean fub = fileUploadComponent.uploadFile(file, "kcxxcx");
- String filePath = fub.getData().getFilePath();
- String fp = fileUploadComponent.getUploadPath() + filePath;
-
- ExcelReader reader = ExcelUtil.getReader(fp);
- List