Browse Source

入库明细

master
lzh 2 years ago
parent
commit
28ac247605
  1. 46
      base-ui/src/api/kucun/ruku.js
  2. 217
      base-ui/src/views/kucun/rkmx/index.vue
  3. 6
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageCount.java
  4. 49
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageCountDto.java
  5. 62
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageCountLog.java
  6. 52
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageCountLogMapper.java
  7. 55
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageCountLogService.java
  8. 24
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageCountService.java
  9. 14
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageGdService.java
  10. 1
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageLog.java
  11. 7
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageLogErr.java
  12. 14
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageLogService.java
  13. 40
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageRest.java
  14. 28
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageService.java
  15. 47
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdRukuQuery.java
  16. 1
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryLog.java
  17. 7
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryLogErr.java
  18. 4
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryOkService.java
  19. 14
      yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryService.java

46
base-ui/src/api/kucun/ruku.js

@ -7,12 +7,46 @@ export function recount() {
method: 'get' method: 'get'
}) })
} }
// 条件查询 // 入库汇总信息
export function downloadhz(parm) { export function countinfo() {
return request({ return request({
url: '/kucun/downloadhz', url: '/ruku/countinfo',
method: 'get', method: 'get'
responseType: 'blob', })
params: parm }
// 112仓入库信息分页查询
export function in112PagerList(data) {
return request({
url: '/ruku/in112PagerList',
data,
method: 'post',
headers: {
'Content-Type': 'application/json'
}
})
}
// 所有入库信息分页查询
export function inallPagerList(data) {
return request({
url: '/ruku/inallPagerList',
data,
method: 'post',
headers: {
'Content-Type': 'application/json'
}
})
}
// 入库单导入日志分页查询
export function logPagerList(data) {
return request({
url: '/ruku/logPagerList',
data,
method: 'post',
headers: {
'Content-Type': 'application/json'
}
}) })
} }

217
base-ui/src/views/kucun/rkmx/index.vue

@ -1,16 +1,100 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="14"> <el-col :span="17">
<el-tabs v-model="tabActiveName"> <el-tabs v-model="tabActiveName">
<el-tab-pane label="入库单上传记录" name="uplog">入库单上传记录</el-tab-pane> <el-tab-pane label="入库单上传记录" name="uplog">
<el-tab-pane label="[112]供应链仓入库明细" name="k112">[112]供应链仓入库明细</el-tab-pane> <div>
<el-tab-pane label="全部入库明细" name="all">全部入库明细</el-tab-pane> <el-table :data="logList" border style="width: 100%">
<el-tab-pane label="入库明细汇总" name="hz">入库明细汇总</el-tab-pane> <el-table-column prop="createTime" label="记录创建时间" />
<el-table-column prop="orderDate" label="单据日期" />
<el-table-column prop="allNum" label="总记录数" />
<el-table-column prop="validNum" label="[112]仓记录数" />
</el-table>
</div>
<div class="pages">
<!-- 翻页 -->
<pagination
v-show="logListTotal > 0"
:total="logListTotal"
:page.sync="logListQuery.current"
:limit.sync="logListQuery.size"
class="pagination"
@pagination="loadLogList"
/>
</div>
</el-tab-pane>
<el-tab-pane label="[112]供应链仓入库明细" name="k112">
<div>
<el-table :data="in112List" border style="width: 100%">
<el-table-column prop="supplierCodeUnified" label="供货商统一码" />
<el-table-column prop="colex" label="供货商编码" />
<el-table-column prop="cole4" label="供货商名称" :show-overflow-tooltip="true" />
<el-table-column prop="colh7" label="商品编码" />
<el-table-column prop="coli8" label="商品名称" :show-overflow-tooltip="true" />
<el-table-column prop="colr17" label="商品数量" />
<el-table-column prop="colq16" label="商品货值" />
</el-table>
</div>
<div class="pages">
<!-- 翻页 -->
<pagination
v-show="in112ListTotal > 0"
:total="in112ListTotal"
:page.sync="in112ListQuery.current"
:limit.sync="in112ListQuery.size"
class="pagination"
@pagination="loadIn112List"
/>
</div>
</el-tab-pane>
<el-tab-pane label="全部入库明细" name="all">
<div>
<el-table :data="inallList" border style="width: 100%">
<el-table-column prop="supplierCodeUnified" label="供货商统一码" />
<el-table-column prop="colex" label="供货商编码" />
<el-table-column prop="cole4" label="供货商名称" :show-overflow-tooltip="true" />
<el-table-column prop="colh7" label="商品编码" />
<el-table-column prop="coli8" label="商品名称" :show-overflow-tooltip="true" />
<el-table-column prop="colr17" label="商品数量" />
<el-table-column prop="colq16" label="商品货值" />
</el-table>
</div>
<div class="pages">
<!-- 翻页 -->
<pagination
v-show="inallListTotal > 0"
:total="inallListTotal"
:page.sync="inallListQuery.current"
:limit.sync="inallListQuery.size"
class="pagination"
@pagination="loadInallList"
/>
</div>
</el-tab-pane>
<el-tab-pane label="入库明细汇总" name="hz">
<el-card class="box-card" style="margin-bottom: 10px;">
<div>{{ countInfoMessage }}</div>
</el-card>
<el-card class="box-card" :body-style="{ padding: '0px' }">
<div slot="header" class="clearfix"><span>最新汇总数据</span></div>
<div>
<el-table :data="countInfo.countList" height="350" border style="width: 100%">
<el-table-column prop="supplierCodeUnified" label="供货商统一码" />
<el-table-column prop="supplierCode" label="供货商编码" />
<el-table-column prop="supplierName" label="供货商名称" :show-overflow-tooltip="true" />
<el-table-column prop="prodCode" label="商品编码" />
<el-table-column prop="prodName" label="商品名称" :show-overflow-tooltip="true" />
<el-table-column prop="prodNum" label="商品数量" />
<el-table-column prop="prodValue" label="商品货值" />
</el-table>
</div>
</el-card>
</el-tab-pane>
</el-tabs> </el-tabs>
</el-col> </el-col>
<el-col :span="10"> <el-col :span="7">
<el-card class="box-card"> <el-card class="box-card">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>入库单上传</span> <span>入库单上传</span>
@ -46,10 +130,11 @@
</template> </template>
<script> <script>
import { recount } from '@/api/kucun/ruku' import { recount, countinfo, in112PagerList, inallPagerList, logPagerList } from '@/api/kucun/ruku'
import Pagination from '@/components/pagination'
export default { export default {
name: 'KucunRkmxIndex', name: 'KucunRkmxIndex',
// components: { }, components: { Pagination },
data() { data() {
return { return {
updateAction: process.env.VUE_APP_BASE_API + '/ruku/uploadRkmxb', updateAction: process.env.VUE_APP_BASE_API + '/ruku/uploadRkmxb',
@ -57,21 +142,114 @@ export default {
tabActiveName: 'uplog', tabActiveName: 'uplog',
fileList: [], fileList: [],
uploadResultMesssage: '', uploadResultMesssage: '',
fullscreenloading: null fullscreenloading: null,
logList: [],
logListQuery: {
current: 1,
size: 5
},
logListTotal: 1,
in112List: [],
in112ListQuery: {
current: 1,
size: 5
},
in112ListTotal: 1,
inallList: [],
inallListQuery: {
current: 1,
size: 5
},
inallListTotal: 1,
countInfo: {
countLog: null,
countList: []
},
countInfoMessage: '无汇总信息'
} }
}, },
created() { created() {
// //
this.init() this.init()
//
// this.getList()
}, },
methods: { methods: {
init() {}, init() {
getList() {}, this.loadLogList()
// this.loadIn112List()
handleReturn() { this.loadInallList()
this.$router.go(-1) this.loadCountInfo()
},
loadLogList() {
logPagerList({
current: this.logListQuery.current,
size: this.logListQuery.size,
params: {
orderDate: ''
}
}).then(response => {
console.log('mmmm', response)
if (response.code === '200' && response.data && response.data.total > 0) {
this.logList = response.data.records
this.logListTotal = response.data.total
this.logListQuery.current = response.data.current
this.logListQuery.size = response.data.size
} else {
this.logList = []
this.logListTotal = 0
}
})
},
loadIn112List() {
in112PagerList({
current: this.in112ListQuery.current,
size: this.in112ListQuery.size,
params: {
orderDate: ''
}
}).then(response => {
if (response.code === '200' && response.data && response.data.total > 0) {
this.in112List = response.data.records
this.in112ListTotal = response.data.total
this.in112ListQuery.current = response.data.current
this.in112ListQuery.size = response.data.size
} else {
this.in112List = []
this.in112ListTotal = 0
}
})
},
loadInallList() {
inallPagerList({
current: this.inallListQuery.current,
size: this.inallListQuery.size,
params: {
orderDate: ''
}
}).then(response => {
if (response.code === '200' && response.data && response.data.total > 0) {
this.inallList = response.data.records
this.inallListTotal = response.data.total
this.inallListQuery.current = response.data.current
this.inallListQuery.size = response.data.size
} else {
this.inallList = []
this.inallListTotal = 0
}
})
},
loadCountInfo() {
countinfo()
.then(res => {
if (res.msg === '没有统计入库明细!') {
this.countInfoMessage = res.msg
} else {
this.countInfo = res.data
this.countInfoMessage = '最新统计时间:' + res.data.countLog.createTime + ', 统计用时:' + res.data.countLog.durations + ' 毫秒!'
}
})
.catch(e => {
console.log(e)
})
}, },
recountRk() { recountRk() {
recount() recount()
@ -80,6 +258,8 @@ export default {
message: '入库信息已经重新汇总完成!', message: '入库信息已经重新汇总完成!',
type: 'success' type: 'success'
}) })
this.loadCountInfo()
this.tabActiveName = 'hz'
}) })
.catch(e => { .catch(e => {
console.log(e) console.log(e)
@ -106,7 +286,10 @@ export default {
this.fullscreenloading = null this.fullscreenloading = null
if (resp.success) { if (resp.success) {
const rdata = resp.data const rdata = resp.data
this.uploadResultMesssage = '共导入数据:' + rdata.allNum + ' 条;符合监管条件的数据:' + rdata.validNum + ' 条;用时:' + rdata.durations + ' 毫秒。' this.uploadResultMesssage = '共导入数据:' + rdata.allNum + ' 条,【112】仓库记录数:' + rdata.validNum + ' 条;用时:' + rdata.durations + ' 毫秒。'
this.loadLogList()
this.tabActiveName = 'uplog'
} else { } else {
this.uploadResultMesssage = resp.msg this.uploadResultMesssage = resp.msg
} }

6
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageCount.java

@ -50,6 +50,8 @@ public class GdInstorageCount extends EntityWithId {
private int prodNum; //'商品数量 private int prodNum; //'商品数量
private double prodValue; //商品货值 private double prodValue; //商品货值
private String supplierCode; //商品编码 private String supplierCode; //供货商编码
private String supplierName; //商品编码 private String supplierName; //供货商名称
private String supplierCodeUnified; //供货商编码统一',
} }

49
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageCountDto.java

@ -0,0 +1,49 @@
/*********************************************************
*********************************************************
******************** *******************
************* ************
******* _oo0oo_ *******
*** o8888888o ***
* 88" . "88 *
* (| -_- |) *
* 0\ = /0 *
* ___/`---'\___ *
* .' \\| |// '. *
* / \\||| : |||// \ *
* / _||||| -:- |||||- \ *
* | | \\\ - /// | | *
* | \_| ''\---/'' |_/ | *
* \ .-\__ '-' ___/-. / *
* ___'. .' /--.--\ `. .'___ *
* ."" '< `.___\_<|>_/___.' >' "". *
* | | : `- \`.;`\ _ /`;.`/ - ` : | | *
* \ \ `_. \_ __\ /__ _/ .-` / / *
* =====`-.____`.___ \_____/___.-`___.-'===== *
* `=---=' *
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
*********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
*********************************************************/
package com.yxt.supervise.portal.biz.gdinstorage;
import lombok.Data;
import java.util.List;
/**
* Project: yxt_supervise <br/>
* File: GdInstorageCountDto.java <br/>
* Class: com.yxt.supervise.portal.biz.gdinstorage.GdInstorageCountDto <br/>
* Description: <描述类的功能>. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2022/12/10 14:26 <br/>
*
* @author liupopo
* @version 1.0
* @since 1.0
*/
@Data
public class GdInstorageCountDto {
private GdInstorageCountLog countLog;
private List<GdInstorageCount> countList;
}

62
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageCountLog.java

@ -0,0 +1,62 @@
/*********************************************************
*********************************************************
******************** *******************
************* ************
******* _oo0oo_ *******
*** o8888888o ***
* 88" . "88 *
* (| -_- |) *
* 0\ = /0 *
* ___/`---'\___ *
* .' \\| |// '. *
* / \\||| : |||// \ *
* / _||||| -:- |||||- \ *
* | | \\\ - /// | | *
* | \_| ''\---/'' |_/ | *
* \ .-\__ '-' ___/-. / *
* ___'. .' /--.--\ `. .'___ *
* ."" '< `.___\_<|>_/___.' >' "". *
* | | : `- \`.;`\ _ /`;.`/ - ` : | | *
* \ \ `_. \_ __\ /__ _/ .-` / / *
* =====`-.____`.___ \_____/___.-`___.-'===== *
* `=---=' *
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
*********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
*********************************************************/
package com.yxt.supervise.portal.biz.gdinstorage;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yxt.common.core.domain.EntityWithId;
import lombok.Data;
import lombok.ToString;
import java.util.Date;
/**
* Project: yxt_supervise <br/>
* File: GdInstorageCountLog.java <br/>
* Class: com.yxt.supervise.portal.biz.gdinstorage.GdInstorageCountLog <br/>
* Description: <描述类的功能>. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2022/12/10 11:18 <br/>
*
* @author liupopo
* @version 1.0
* @since 1.0
*/
@Data
@TableName("gd_instorage_count_log")
public class GdInstorageCountLog extends EntityWithId {
public GdInstorageCountLog() {
}
public GdInstorageCountLog(long durations) {
this.durations = durations;
}
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createTime = new Date(); // 记录创建时间/
private long durations; // 程序运行时长/
}

52
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageCountLogMapper.java

@ -0,0 +1,52 @@
/*********************************************************
*********************************************************
******************** *******************
************* ************
******* _oo0oo_ *******
*** o8888888o ***
* 88" . "88 *
* (| -_- |) *
* 0\ = /0 *
* ___/`---'\___ *
* .' \\| |// '. *
* / \\||| : |||// \ *
* / _||||| -:- |||||- \ *
* | | \\\ - /// | | *
* | \_| ''\---/'' |_/ | *
* \ .-\__ '-' ___/-. / *
* ___'. .' /--.--\ `. .'___ *
* ."" '< `.___\_<|>_/___.' >' "". *
* | | : `- \`.;`\ _ /`;.`/ - ` : | | *
* \ \ `_. \_ __\ /__ _/ .-` / / *
* =====`-.____`.___ \_____/___.-`___.-'===== *
* `=---=' *
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
*********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
*********************************************************/
package com.yxt.supervise.portal.biz.gdinstorage;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.util.List;
/**
* Project: yxt_supervise <br/>
* File: GdInstorageCountLogMapper.java <br/>
* Class: com.yxt.supervise.portal.biz.gdinstorage.GdInstorageCountLogMapper <br/>
* Description: <描述类的功能>. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2022/12/10 14:21 <br/>
*
* @author liupopo
* @version 1.0
* @since 1.0
*/
@Mapper
public interface GdInstorageCountLogMapper extends BaseMapper<GdInstorageCountLog> {
@Select("select * from gd_instorage_count_log order by id desc limit 1")
List<GdInstorageCountLog> listLastOrderById();
}

55
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageCountLogService.java

@ -0,0 +1,55 @@
/*********************************************************
*********************************************************
******************** *******************
************* ************
******* _oo0oo_ *******
*** o8888888o ***
* 88" . "88 *
* (| -_- |) *
* 0\ = /0 *
* ___/`---'\___ *
* .' \\| |// '. *
* / \\||| : |||// \ *
* / _||||| -:- |||||- \ *
* | | \\\ - /// | | *
* | \_| ''\---/'' |_/ | *
* \ .-\__ '-' ___/-. / *
* ___'. .' /--.--\ `. .'___ *
* ."" '< `.___\_<|>_/___.' >' "". *
* | | : `- \`.;`\ _ /`;.`/ - ` : | | *
* \ \ `_. \_ __\ /__ _/ .-` / / *
* =====`-.____`.___ \_____/___.-`___.-'===== *
* `=---=' *
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
*********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
*********************************************************/
package com.yxt.supervise.portal.biz.gdinstorage;
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;
/**
* Project: yxt_supervise <br/>
* File: GdInstorageCountLogService.java <br/>
* Class: com.yxt.supervise.portal.biz.gdinstorage.GdInstorageCountLogService <br/>
* Description: <描述类的功能>. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2022/12/10 14:22 <br/>
*
* @author liupopo
* @version 1.0
* @since 1.0
*/
@Service
public class GdInstorageCountLogService extends ServiceImpl<GdInstorageCountLogMapper, GdInstorageCountLog> {
public GdInstorageCountLog lastLog() {
List<GdInstorageCountLog> list = baseMapper.listLastOrderById();
if (list == null || list.isEmpty())
return null;
return list.get(0);
}
}

24
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageCountService.java

@ -27,8 +27,11 @@ package com.yxt.supervise.portal.biz.gdinstorage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yxt.common.core.result.ResultBean; import com.yxt.common.core.result.ResultBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List;
/** /**
* Project: yxt_supervise <br/> * Project: yxt_supervise <br/>
* File: GdInstorageCountService.java <br/> * File: GdInstorageCountService.java <br/>
@ -44,10 +47,31 @@ import org.springframework.stereotype.Service;
*/ */
@Service @Service
public class GdInstorageCountService extends ServiceImpl<GdInstorageCountMapper, GdInstorageCount> { public class GdInstorageCountService extends ServiceImpl<GdInstorageCountMapper, GdInstorageCount> {
@Autowired
private GdInstorageCountLogService gdInstorageCountLogService;
public ResultBean recount() { public ResultBean recount() {
ResultBean rb = ResultBean.fireFail(); ResultBean rb = ResultBean.fireFail();
long millis = System.currentTimeMillis();
baseMapper.clearData(); baseMapper.clearData();
baseMapper.insertFromInstorage(); baseMapper.insertFromInstorage();
long tt = System.currentTimeMillis() - millis;
GdInstorageCountLog log = new GdInstorageCountLog(tt);
gdInstorageCountLogService.save(log);
return rb.success(); return rb.success();
} }
public ResultBean<GdInstorageCountDto> countinfo() {
ResultBean rb = ResultBean.fireFail();
GdInstorageCountLog clog = gdInstorageCountLogService.lastLog();
if (clog == null)
return rb.success().setMsg("没有统计入库明细!");
List<GdInstorageCount> list = this.list();
GdInstorageCountDto dto = new GdInstorageCountDto();
dto.setCountLog(clog);
dto.setCountList(list);
return rb.success().setData(dto);
}
} }

14
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageGdService.java

@ -25,7 +25,12 @@
*********************************************************/ *********************************************************/
package com.yxt.supervise.portal.biz.gdinstorage; package com.yxt.supervise.portal.biz.gdinstorage;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yxt.common.base.utils.PagerUtil;
import com.yxt.common.core.query.PagerQuery;
import com.yxt.common.core.vo.PagerVo;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/** /**
@ -43,4 +48,13 @@ import org.springframework.stereotype.Service;
*/ */
@Service @Service
public class GdInstorageGdService extends ServiceImpl<GdInstorageGdMapper, GdInstorageGd> { public class GdInstorageGdService extends ServiceImpl<GdInstorageGdMapper, GdInstorageGd> {
public PagerVo<GdInstorageGd> listPageVo(PagerQuery<GdRukuQuery> pq) {
GdRukuQuery query = pq.getParams();
QueryWrapper<GdInstorageGd> qw = new QueryWrapper<>();
qw.orderByDesc("orderDate");
IPage<GdInstorageGd> page = PagerUtil.queryToPage(pq);
IPage<GdInstorageGd> pagging = baseMapper.selectPage(page, qw);
PagerVo<GdInstorageGd> p = PagerUtil.pageToVo(pagging, null);
return p;
}
} }

1
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageLog.java

@ -29,4 +29,5 @@ public class GdInstorageLog extends EntityWithId {
private int validNum; // 有效记录数/ private int validNum; // 有效记录数/
private long durations; // 程序运行时长/ private long durations; // 程序运行时长/
private int errRowNum; // 出错的条数/ private int errRowNum; // 出错的条数/
private String orderDate; // 单据日期
} }

7
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageLogErr.java

@ -15,4 +15,11 @@ public class GdInstorageLogErr extends EntityWithId {
private String errInfo; // 异常信息', private String errInfo; // 异常信息',
private String rowContent; // 原记录内容', private String rowContent; // 原记录内容',
private int rowNum; // 出错行数', private int rowNum; // 出错行数',
private String prodCode; //商品编码
private String prodName; //商品名称
private String prodNum; //'商品数量
private String prodValue; //商品货值
private String supplierCode; //供货商编码
private String supplierName; //供货商名称
private String orderDate; // 单据日期
} }

14
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageLogService.java

@ -1,8 +1,22 @@
package com.yxt.supervise.portal.biz.gdinstorage; package com.yxt.supervise.portal.biz.gdinstorage;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yxt.common.base.utils.PagerUtil;
import com.yxt.common.core.query.PagerQuery;
import com.yxt.common.core.vo.PagerVo;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@Service @Service
public class GdInstorageLogService extends ServiceImpl<GdInstorageLogMapper, GdInstorageLog> { public class GdInstorageLogService extends ServiceImpl<GdInstorageLogMapper, GdInstorageLog> {
public PagerVo<GdInstorageLog> listPageVo(PagerQuery<GdRukuQuery> pq) {
GdRukuQuery query = pq.getParams();
QueryWrapper<GdInstorageLog> qw = new QueryWrapper<>();
qw.orderByDesc("orderDate");
IPage<GdInstorageLog> page = PagerUtil.queryToPage(pq);
IPage<GdInstorageLog> pagging = baseMapper.selectPage(page, qw);
PagerVo<GdInstorageLog> p = PagerUtil.pageToVo(pagging, null);
return p;
}
} }

40
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageRest.java

@ -25,8 +25,13 @@
*********************************************************/ *********************************************************/
package com.yxt.supervise.portal.biz.gdinstorage; package com.yxt.supervise.portal.biz.gdinstorage;
import com.yxt.common.core.query.PagerQuery;
import com.yxt.common.core.result.ResultBean; import com.yxt.common.core.result.ResultBean;
import com.yxt.common.core.vo.PagerVo;
import com.yxt.supervise.portal.api.kfpurchaserequisition.KfPurchaseRequisitionQuery;
import com.yxt.supervise.portal.api.kfpurchaserequisition.KfPurchaseRequisitionVo;
import com.yxt.supervise.portal.biz.gdinventory.GdInventoryLog; import com.yxt.supervise.portal.biz.gdinventory.GdInventoryLog;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
@ -51,6 +56,10 @@ public class GdInstorageRest {
@Autowired @Autowired
private GdInstorageService gdInstorageService; private GdInstorageService gdInstorageService;
@Autowired @Autowired
private GdInstorageGdService gdInstorageGdService;
@Autowired
private GdInstorageLogService gdInstorageLogService;
@Autowired
private GdInstorageCountService gdInstorageCountService; private GdInstorageCountService gdInstorageCountService;
@GetMapping("/test") @GetMapping("/test")
@ -82,5 +91,34 @@ public class GdInstorageRest {
} }
@GetMapping("/recount") @GetMapping("/recount")
public ResultBean recount() {return gdInstorageCountService.recount();} public ResultBean recount() {
return gdInstorageCountService.recount();
}
@GetMapping("/countinfo")
public ResultBean<GdInstorageCountDto> countinfo() {
return gdInstorageCountService.countinfo();
}
@PostMapping("/in112PagerList")
public ResultBean<PagerVo<GdInstorage>> in112PagerList(@RequestBody PagerQuery<GdRukuQuery> pq) {
ResultBean rb = ResultBean.fireFail();
PagerVo<GdInstorage> pv = gdInstorageService.listPageVo(pq);
return rb.success().setData(pv);
}
@PostMapping("/inallPagerList")
public ResultBean<PagerVo<GdInstorageGd>> inallPagerList(@RequestBody PagerQuery<GdRukuQuery> pq) {
ResultBean rb = ResultBean.fireFail();
PagerVo<GdInstorageGd> pv = gdInstorageGdService.listPageVo(pq);
return rb.success().setData(pv);
}
@PostMapping("/logPagerList")
public ResultBean<PagerVo<GdInstorageLog>> logPagerList(@RequestBody PagerQuery<GdRukuQuery> pq) {
ResultBean rb = ResultBean.fireFail();
PagerVo<GdInstorageLog> pv = gdInstorageLogService.listPageVo(pq);
return rb.success().setData(pv);
}
} }

28
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageService.java

@ -31,10 +31,18 @@ import cn.hutool.json.JSONUtil;
import cn.hutool.poi.excel.ExcelReader; import cn.hutool.poi.excel.ExcelReader;
import cn.hutool.poi.excel.ExcelUtil; import cn.hutool.poi.excel.ExcelUtil;
import cn.hutool.poi.excel.sax.handler.RowHandler; import cn.hutool.poi.excel.sax.handler.RowHandler;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yxt.common.base.config.component.FileUploadComponent; import com.yxt.common.base.config.component.FileUploadComponent;
import com.yxt.common.base.utils.PagerUtil;
import com.yxt.common.core.query.PagerQuery;
import com.yxt.common.core.result.FileUploadResult; import com.yxt.common.core.result.FileUploadResult;
import com.yxt.common.core.result.ResultBean; import com.yxt.common.core.result.ResultBean;
import com.yxt.common.core.vo.PagerVo;
import com.yxt.supervise.portal.api.kfpurchaserequisition.KfPurchaseRequisition;
import com.yxt.supervise.portal.api.kfpurchaserequisition.KfPurchaseRequisitionQuery;
import com.yxt.supervise.portal.api.kfpurchaserequisition.KfPurchaseRequisitionVo;
import com.yxt.supervise.portal.biz.gdinventory.GdInventoryLog; import com.yxt.supervise.portal.biz.gdinventory.GdInventoryLog;
import com.yxt.supervise.portal.biz.gdinventory.GdInventoryLogErr; import com.yxt.supervise.portal.biz.gdinventory.GdInventoryLogErr;
import com.yxt.supervise.portal.biz.gdinventory.GdInventoryOk; import com.yxt.supervise.portal.biz.gdinventory.GdInventoryOk;
@ -171,6 +179,7 @@ public class GdInstorageService extends ServiceImpl<GdInstorageMapper, GdInstora
if (StrUtil.isBlank(odate)) { if (StrUtil.isBlank(odate)) {
odate = readOrderDate(gd.getCold3()); odate = readOrderDate(gd.getCold3());
gdlog.setOrderDate(odate);
} }
gd.setOrderDate(odate); gd.setOrderDate(odate);
@ -184,6 +193,14 @@ public class GdInstorageService extends ServiceImpl<GdInstorageMapper, GdInstora
gile.setErrInfo("未知供应商编号:" + gd.getColex()); gile.setErrInfo("未知供应商编号:" + gd.getColex());
gile.setFileFullPath(gdlog.getFileFullPath()); gile.setFileFullPath(gdlog.getFileFullPath());
gile.setRowContent(JSONUtil.toJsonStr(r)); gile.setRowContent(JSONUtil.toJsonStr(r));
gile.setProdCode(""+r.get(8));
gile.setProdName(""+r.get(9));
gile.setProdNum(""+r.get(18));
gile.setProdValue(""+r.get(17));
gile.setSupplierCode(""+r.get(4));
gile.setSupplierName(""+r.get(5));
gile.setOrderDate(odate);
errList.add(gile); errList.add(gile);
} else { } else {
gd.setSupplierCodeUnified(unifiedCode); gd.setSupplierCodeUnified(unifiedCode);
@ -219,4 +236,15 @@ public class GdInstorageService extends ServiceImpl<GdInstorageMapper, GdInstora
} }
}; };
} }
public PagerVo<GdInstorage> listPageVo(PagerQuery<GdRukuQuery> pq) {
GdRukuQuery query = pq.getParams();
QueryWrapper<GdInstorage> qw = new QueryWrapper<>();
qw.orderByDesc("orderDate");
IPage<GdInstorage> page = PagerUtil.queryToPage(pq);
IPage<GdInstorage> pagging = baseMapper.selectPage(page, qw);
PagerVo<GdInstorage> p = PagerUtil.pageToVo(pagging, null);
return p;
}
} }

47
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdRukuQuery.java

@ -0,0 +1,47 @@
/*********************************************************
*********************************************************
******************** *******************
************* ************
******* _oo0oo_ *******
*** o8888888o ***
* 88" . "88 *
* (| -_- |) *
* 0\ = /0 *
* ___/`---'\___ *
* .' \\| |// '. *
* / \\||| : |||// \ *
* / _||||| -:- |||||- \ *
* | | \\\ - /// | | *
* | \_| ''\---/'' |_/ | *
* \ .-\__ '-' ___/-. / *
* ___'. .' /--.--\ `. .'___ *
* ."" '< `.___\_<|>_/___.' >' "". *
* | | : `- \`.;`\ _ /`;.`/ - ` : | | *
* \ \ `_. \_ __\ /__ _/ .-` / / *
* =====`-.____`.___ \_____/___.-`___.-'===== *
* `=---=' *
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
*********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
*********************************************************/
package com.yxt.supervise.portal.biz.gdinstorage;
import com.yxt.common.core.query.Query;
import lombok.Data;
/**
* Project: yxt_supervise <br/>
* File: GdRukuQuery.java <br/>
* Class: com.yxt.supervise.portal.biz.gdinstorage.GdRukuQuery <br/>
* Description: <描述类的功能>. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2022/12/10 21:15 <br/>
*
* @author liupopo
* @version 1.0
* @since 1.0
*/
@Data
public class GdRukuQuery implements Query {
private String orderDate;
}

1
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryLog.java

@ -29,4 +29,5 @@ public class GdInventoryLog extends EntityWithId {
private int validNum; // 有效记录数/ private int validNum; // 有效记录数/
private long durations; // 程序运行时长/ private long durations; // 程序运行时长/
private int errRowNum; // 出错的条数/ private int errRowNum; // 出错的条数/
private String orderDate; // 单据日期
} }

7
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryLogErr.java

@ -15,4 +15,11 @@ public class GdInventoryLogErr extends EntityWithId {
private String errInfo; // 异常信息', private String errInfo; // 异常信息',
private String rowContent; // 原记录内容', private String rowContent; // 原记录内容',
private int rowNum; // 出错行数', private int rowNum; // 出错行数',
private String prodCode; //商品编码
private String prodName; //商品名称
private String prodNum; //'商品数量
private String prodValue; //商品货值
private String supplierCode; //供货商编码
private String supplierName; //供货商名称
private String orderDate; // 单据日期
} }

4
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryOkService.java

@ -103,7 +103,11 @@ public class GdInventoryOkService extends ServiceImpl<GdInventoryOkMapper, GdInv
writer.setSheet(0); writer.setSheet(0);
writer.writeCellValue(0, 1, "编号:" + timestr); writer.writeCellValue(0, 1, "编号:" + timestr);
writer.writeCellValue(3, 1, datefmt1); writer.writeCellValue(3, 1, datefmt1);
if(prod112>0){
writer.writeCellValue(1, 3, 1); writer.writeCellValue(1, 3, 1);
}else {
writer.writeCellValue(1, 3, 0);
}
writer.writeCellValue(1, 4, type1); writer.writeCellValue(1, 4, type1);
writer.writeCellValue(1, 5, type2); writer.writeCellValue(1, 5, type2);
writer.writeCellValue(2, 3, prod112); writer.writeCellValue(2, 3, prod112);

14
yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryService.java

@ -28,6 +28,7 @@ package com.yxt.supervise.portal.biz.gdinventory;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.io.FileUtil; import cn.hutool.core.io.FileUtil;
import cn.hutool.core.text.csv.*; import cn.hutool.core.text.csv.*;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil; import cn.hutool.json.JSONUtil;
import cn.hutool.poi.excel.ExcelUtil; import cn.hutool.poi.excel.ExcelUtil;
import cn.hutool.poi.excel.sax.handler.RowHandler; import cn.hutool.poi.excel.sax.handler.RowHandler;
@ -291,6 +292,7 @@ public class GdInventoryService extends ServiceImpl<GdInventoryMapper, GdInvento
private List<GdInventoryLogErr> errList = new ArrayList<>(); private List<GdInventoryLogErr> errList = new ArrayList<>();
private int x = 0, y = 0, errnum = 0; private int x = 0, y = 0, errnum = 0;
private int num = 0; private int num = 0;
private String odate = null;
@Override @Override
public void handle(int sheetIndex, long rowIndex, List<Object> r) { public void handle(int sheetIndex, long rowIndex, List<Object> r) {
@ -298,6 +300,11 @@ public class GdInventoryService extends ServiceImpl<GdInventoryMapper, GdInvento
String prodCode = "" + r.get(3); String prodCode = "" + r.get(3);
String warehouseCode = "" + r.get(1); String warehouseCode = "" + r.get(1);
if (StrUtil.isBlank(odate)) {
odate = "" + r.get(10);
gdlog.setOrderDate(odate);
}
if (gdRescategoryProdService.containsCode(prodCode) && storeIndexService.containsCodeWithOneNoJmd(warehouseCode)) { if (gdRescategoryProdService.containsCode(prodCode) && storeIndexService.containsCodeWithOneNoJmd(warehouseCode)) {
GdInventoryOk ok = new GdInventoryOk(); GdInventoryOk ok = new GdInventoryOk();
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
@ -324,6 +331,13 @@ public class GdInventoryService extends ServiceImpl<GdInventoryMapper, GdInvento
gile.setErrInfo(e.getMessage()); gile.setErrInfo(e.getMessage());
gile.setFileFullPath(gdlog.getFileFullPath()); gile.setFileFullPath(gdlog.getFileFullPath());
gile.setRowContent(JSONUtil.toJsonStr(r)); gile.setRowContent(JSONUtil.toJsonStr(r));
gile.setProdCode(prodCode);
gile.setProdName(""+r.get(5));
gile.setProdNum(""+r.get(7));
gile.setProdValue(""+r.get(8));
gile.setSupplierCode("");
gile.setSupplierName(""+r.get(9));
gile.setOrderDate(odate);
errList.add(gile); errList.add(gile);
} }

Loading…
Cancel
Save