Commit 81c85405701b1504e263962eccbddbbd25f9e808

Authored by pengyongcheng
1 parent 6e5b170d

报表:盘点报表

ant-design-vue-jeecg/src/views/system/report/ReportCycleCountList.vue 0 → 100644
  1 +<template>
  2 + <a-card :bordered="false">
  3 + <!-- 查询区域 -->
  4 + <div class="table-page-search-wrapper">
  5 + <a-form layout="inline" @keyup.enter.native="searchQuery">
  6 + <a-row :gutter="24">
  7 + <a-col :xl="6" :lg="7" :md="8" :sm="24">
  8 + <a-form-item label="库位编码">
  9 + <a-input placeholder="请输入库位编码" v-model="queryParam.locationCode"></a-input>
  10 + </a-form-item>
  11 + </a-col>
  12 + <a-col :xl="6" :lg="7" :md="8" :sm="24">
  13 + <a-form-item label="物料编码">
  14 + <a-input placeholder="请输入物料编码" v-model="queryParam.materialCode"></a-input>
  15 + </a-form-item>
  16 + </a-col>
  17 + <a-col :xl="6" :lg="7" :md="8" :sm="24">
  18 + <a-form-item label="物料名称">
  19 + <a-input placeholder="请输入物料名称" v-model="queryParam.materialName"></a-input>
  20 + </a-form-item>
  21 + </a-col>
  22 + <a-col :xl="6" :lg="7" :md="8" :sm="24">
  23 + <a-form-item label="物料规格">
  24 + <a-input placeholder="请输入物料规格" v-model="queryParam.materialSpec"></a-input>
  25 + </a-form-item>
  26 + </a-col>
  27 + <a-col :xl="6" :lg="7" :md="8" :sm="24">
  28 + <a-form-item label="物料单位">
  29 + <a-input placeholder="请输入物料单位" v-model="queryParam.materialUnit"></a-input>
  30 + </a-form-item>
  31 + </a-col>
  32 + <a-col :xl="6" :lg="7" :md="8" :sm="24">
  33 + <a-form-item label="盘点人">
  34 + <a-input placeholder="请输入盘点人" v-model="queryParam.stocktakingAc"></a-input>
  35 + </a-form-item>
  36 + </a-col>
  37 + <a-col :xl="12" :lg="14" :md="16" :sm="24">
  38 + <a-form-item label="盘点日期">
  39 + <j-date :show-date="true" date-format="YYYY-MM-DD" placeholder="请选择开始时间"
  40 + class="query-group-cust" v-model="queryParam.completedAtBegin"></j-date>
  41 + <span class="query-group-split-cust"></span>
  42 + <j-date :show-date="true" date-format="YYYY-MM-DD" placeholder="请选择结束时间"
  43 + class="query-group-cust" v-model="queryParam.completedAtEnd"></j-date>
  44 + </a-form-item>
  45 + </a-col>
  46 + <a-col :xl="6" :lg="7" :md="8" :sm="24">
  47 + <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  48 + <a-button id="search" type="primary" @click="searchQuery" icon="search">查询</a-button>
  49 + <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  50 + </span>
  51 + </a-col>
  52 + </a-row>
  53 + </a-form>
  54 + </div>
  55 + <!-- 查询区域-END -->
  56 + <!-- table区域-begin -->
  57 + <div>
  58 + <a-table
  59 + ref="table"
  60 + size="middle"
  61 + :scroll="{x:true}"
  62 + bordered
  63 + rowKey="id"
  64 + :columns="columns"
  65 + :dataSource="dataSource"
  66 + :pagination="ipagination"
  67 + :loading="loading"
  68 + class="j-table-force-nowrap"
  69 + @change="handleTableChange">
  70 +
  71 + <span slot="zoneCode" slot-scope="zoneCode">
  72 + <a-tag :key="zoneCode" color="blue">
  73 + {{ solutionZoneCode(zoneCode) }}
  74 + </a-tag>
  75 + </span>
  76 + <template slot="htmlSlot" slot-scope="text">
  77 + <div v-html="text"></div>
  78 + </template>
  79 + </a-table>
  80 + </div>
  81 + </a-card>
  82 +</template>
  83 +
  84 +<script>
  85 +
  86 +import '@/assets/less/TableExpand.less'
  87 +import {mixinDevice} from '@/utils/mixin'
  88 +import {JeecgListMixin} from '@/mixins/JeecgListMixin'
  89 +import {getMaterialTypeList, getZoneList} from '@/api/api'
  90 +
  91 +export default {
  92 + name: 'ReportInventoryClassificationList',
  93 + mixins: [JeecgListMixin, mixinDevice],
  94 + components: {},
  95 + data() {
  96 + return {
  97 + description: '库存分类报表页面',
  98 + zoneList: [],
  99 + zoneOptions: [],
  100 + materialTypeList: [],
  101 + firstLoad: 0,
  102 + // 表头
  103 + columns: [
  104 + {
  105 + title: '#',
  106 + dataIndex: '',
  107 + key: 'rowIndex',
  108 + width: 60,
  109 + align: 'center',
  110 + customRender: function (t, r, index) {
  111 + return parseInt(index) + 1
  112 + }
  113 + },
  114 + {
  115 + title: '库存位置',
  116 + align: "center",
  117 + dataIndex: 'locationCode'
  118 + },
  119 + {
  120 + title: '物料编码',
  121 + align: "center",
  122 + dataIndex: 'materialCode'
  123 + },
  124 + {
  125 + title: '物料名称',
  126 + align: "center",
  127 + dataIndex: 'materialName'
  128 + },
  129 + {
  130 + title: '物料规格',
  131 + align: "center",
  132 + dataIndex: 'materialSpec'
  133 + },
  134 + {
  135 + title: '物料单位',
  136 + align: "center",
  137 + dataIndex: 'materialUnit'
  138 + },
  139 + {
  140 + title: '库存数量',
  141 + align: "center",
  142 + dataIndex: 'systemQty'
  143 + },
  144 + {
  145 + title: '实际数量',
  146 + align: "center",
  147 + dataIndex: 'countedQty'
  148 + },
  149 + {
  150 + title: '差异数量',
  151 + align: "center",
  152 + dataIndex: 'gapQty'
  153 + },
  154 + {
  155 + title: '盘点日期',
  156 + align: "center",
  157 + dataIndex: 'completedAt'
  158 + },
  159 + {
  160 + title: '盘点人',
  161 + align: "center",
  162 + dataIndex: 'stocktakingAc'
  163 + }
  164 + ],
  165 + url: {
  166 + list: "/report/listCycleCount",
  167 + },
  168 + }
  169 + },
  170 + created() {
  171 + this.loadFrom();
  172 + },
  173 + mounted() {
  174 + if (this.firstLoad === 0) {
  175 + this.firstLoad = 1;
  176 + return;
  177 + }
  178 + //页面没加载完,此时methods里的方法找不到,使用定时器模拟点击
  179 + let timeSearch = setInterval(() => {
  180 + let eleSearch = document.getElementById("search");
  181 + if (eleSearch != null) {
  182 + //调用成功,清除定时器
  183 + clearInterval(timeSearch)
  184 + eleSearch.click();
  185 + }
  186 + }, 200)
  187 + },
  188 + computed: {
  189 + importExcelUrl: function () {
  190 + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
  191 + },
  192 + },
  193 + methods: {
  194 + loadFrom() {
  195 + getMaterialTypeList().then((res) => {
  196 + if (res.success) {
  197 + this.materialTypeList = res.result
  198 + }
  199 + });
  200 + getZoneList().then((res) => {
  201 + if (res.success) {
  202 + this.zoneList = res.result
  203 + //延迟半秒执行,避免组件未加载完,数据已经加载完
  204 + setTimeout(() => {
  205 + //slice可以在数组的任何位置进行删除/添加操作
  206 + this.zoneOptions.splice(0, 1);
  207 + for (const element of res.result) {
  208 + this.zoneOptions.push({value: element.code, text: element.name})
  209 + }
  210 + }, 500)
  211 + }
  212 + });
  213 + },
  214 + solutionZoneCode(value) {
  215 + let actions = []
  216 + Object.keys(this.zoneList).some(key => {
  217 + if (this.zoneList[key].code === '' + value) {
  218 + actions.push(this.zoneList[key].name)
  219 + return true
  220 + }
  221 + })
  222 + return actions.join('')
  223 + }
  224 + }
  225 +}
  226 +</script>
  227 +<style scoped>
  228 +@import '~@assets/less/common.less';
  229 +</style>
0 230 \ No newline at end of file
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/report/controller/ReportController.java
... ... @@ -30,8 +30,11 @@ import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail;
30 30 import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService;
31 31 import org.jeecg.modules.wms.inventory.inventoryTransaction.entity.InventoryTransaction;
32 32 import org.jeecg.modules.wms.inventory.inventoryTransaction.service.IInventoryTransactionService;
  33 +import org.jeecg.modules.wms.report.dto.QueryReportCycleCountDto;
  34 +import org.jeecg.modules.wms.report.dto.ReportCycleCountDto;
33 35 import org.jeecg.modules.wms.report.dto.ReportInventoryClassificationDto;
34 36 import org.jeecg.modules.wms.report.dto.ReportPerformanceAssessmentDto;
  37 +import org.jeecg.modules.wms.stocktaking.cycleCountDetail.service.ICycleCountDetailChildService;
35 38 import org.jeecg.modules.wms.task.taskHeader.service.ITaskHeaderService;
36 39 import org.jeecg.utils.HuahengJwtUtil;
37 40 import org.jeecg.utils.StringUtils;
... ... @@ -69,6 +72,8 @@ public class ReportController extends JeecgController&lt;InventoryTransaction, IInv
69 72 private ILocationService locationService;
70 73 @Resource
71 74 private IInventoryDetailService inventoryDetailService;
  75 + @Resource
  76 + private ICycleCountDetailChildService cycleCountDetailChildService;
72 77  
73 78 /**
74 79 * 分页列表查询
... ... @@ -230,4 +235,17 @@ public class ReportController extends JeecgController&lt;InventoryTransaction, IInv
230 235 page.setRecords(performanceAssessmentReportList);
231 236 return Result.OK(page);
232 237 }
  238 +
  239 + /**
  240 + * 盘点报表列表查询
  241 + */
  242 + @GetMapping(value = "/listCycleCount")
  243 + public Result listCycleCount(QueryReportCycleCountDto queryReportCycleCountDto,
  244 + @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
  245 + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
  246 + List<ReportCycleCountDto> cycleCountReportList = cycleCountDetailChildService.getCycleCountReport(queryReportCycleCountDto);
  247 + Page<ReportCycleCountDto> page = new Page<>(pageNo, pageSize);
  248 + page.setRecords(cycleCountReportList);
  249 + return Result.OK(page);
  250 + }
233 251 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/report/dto/QueryReportCycleCountDto.java 0 → 100644
  1 +package org.jeecg.modules.wms.report.dto;
  2 +
  3 +import lombok.Data;
  4 +
  5 +import java.io.Serializable;
  6 +import java.math.BigDecimal;
  7 +
  8 +/**
  9 + * 盘点报表查询Dto类
  10 + */
  11 +@Data
  12 +public class QueryReportCycleCountDto implements Serializable {
  13 +
  14 + /**
  15 + * 库位编码
  16 + */
  17 + private String locationCode;
  18 +
  19 + /**
  20 + * 物料编码
  21 + */
  22 + private String materialCode;
  23 +
  24 + /**
  25 + * 物料名称
  26 + */
  27 + private String materialName;
  28 +
  29 + /**
  30 + * 物料规格
  31 + */
  32 + private String materialSpec;
  33 +
  34 + /**
  35 + * 物料单位
  36 + */
  37 + private String materialUnit;
  38 +
  39 + /**
  40 + * 盘点人
  41 + */
  42 + private String stocktakingAc;
  43 +
  44 + /**
  45 + * 盘点日期起始;
  46 + */
  47 + private String completedAtBegin;
  48 +
  49 + /**
  50 + * 盘点日期结束;
  51 + */
  52 + private String completedAtEnd;
  53 +}
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/report/dto/ReportCycleCountDto.java 0 → 100644
  1 +package org.jeecg.modules.wms.report.dto;
  2 +
  3 +import io.micrometer.core.annotation.Counted;
  4 +import lombok.Data;
  5 +
  6 +import java.io.Serializable;
  7 +import java.math.BigDecimal;
  8 +
  9 +/**
  10 + * 盘点报表Dto类
  11 + */
  12 +@Data
  13 +public class ReportCycleCountDto implements Serializable {
  14 +
  15 + /**
  16 + * 库位编码
  17 + */
  18 + private String locationCode;
  19 +
  20 + /**
  21 + * 物料编码
  22 + */
  23 + private String materialCode;
  24 +
  25 + /**
  26 + * 物料名称
  27 + */
  28 + private String materialName;
  29 +
  30 + /**
  31 + * 物料规格
  32 + */
  33 + private String materialSpec;
  34 +
  35 + /**
  36 + * 物料单位
  37 + */
  38 + private String materialUnit;
  39 +
  40 + /**
  41 + * 系统数量
  42 + */
  43 + private BigDecimal systemQty;
  44 +
  45 + /**
  46 + * 盘点数量
  47 + */
  48 + private BigDecimal countedQty;
  49 +
  50 + /**
  51 + * 差异数量
  52 + */
  53 + private BigDecimal gapQty;
  54 +
  55 + /**
  56 + * 盘点人
  57 + */
  58 + private String stocktakingAc;
  59 +
  60 + /**
  61 + * '盘点日期;
  62 + */
  63 + private String completedAt;
  64 +}
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/mapper/CycleCountDetailChildMapper.java
1 1 package org.jeecg.modules.wms.stocktaking.cycleCountDetail.mapper;
2 2  
3 3 import java.util.List;
  4 +
  5 +import org.jeecg.modules.wms.report.dto.QueryReportCycleCountDto;
  6 +import org.jeecg.modules.wms.report.dto.ReportCycleCountDto;
4 7 import org.jeecg.modules.wms.stocktaking.cycleCountDetail.entity.CycleCountDetailChild;
5 8 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
6 9 import org.apache.ibatis.annotations.Param;
... ... @@ -13,5 +16,13 @@ import org.apache.ibatis.annotations.Param;
13 16 */
14 17 public interface CycleCountDetailChildMapper extends BaseMapper<CycleCountDetailChild> {
15 18  
16   -
  19 + /**
  20 + * 盘点报表查询
  21 + *
  22 + * @param queryReportCycleCountDto 查询参数
  23 + * @param statuses 盘点明细状态
  24 + * @return 盘点报表信息
  25 + */
  26 + List<ReportCycleCountDto> selectCycleCount(@Param("queryParam") QueryReportCycleCountDto queryReportCycleCountDto,
  27 + @Param("statuses") List<Integer> statuses);
17 28 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/mapper/xml/CycleCountDetailChildMapper.xml 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3 +<mapper namespace="org.jeecg.modules.wms.stocktaking.cycleCountDetail.mapper.CycleCountDetailChildMapper">
  4 +
  5 + <select id="selectCycleCount" resultType="org.jeecg.modules.wms.report.dto.ReportCycleCountDto">
  6 + SELECT child.location_code,
  7 + child.material_code,
  8 + child.material_name,
  9 + child.material_spec,
  10 + child.material_unit,
  11 + child.system_qty,
  12 + child.counted_qty,
  13 + child.gap_qty,
  14 + header.stocktaking_ac,
  15 + detail.completed_at
  16 + FROM cycle_count_detail_child child
  17 + LEFT JOIN cycle_count_detail detail ON child.cycle_count_detailid = detail.id
  18 + LEFT JOIN cycle_count_header header ON detail.cycle_count_head_id = header.id
  19 + <where>
  20 + <if test="queryParam.locationCode != null and queryParam.locationCode != ''">
  21 + and child.location_code = #{queryParam.locationCode}
  22 + </if>
  23 + <if test="queryParam.materialCode != null and queryParam.materialCode != ''">
  24 + and child.material_code = #{queryParam.materialCode}
  25 + </if>
  26 + <if test="queryParam.materialName != null and queryParam.materialName != ''">
  27 + <bind name="queryParam.materialName" value="'%' + queryParam.materialName + '%'"/>
  28 + and child.material_name LIKE #{queryParam.materialName}
  29 + </if>
  30 + <if test="queryParam.materialSpec != null and queryParam.materialSpec != ''">
  31 + and child.material_spec = #{queryParam.materialSpec}
  32 + </if>
  33 + <if test="queryParam.materialUnit != null and queryParam.materialUnit != ''">
  34 + and child.material_unit = #{queryParam.materialUnit}
  35 + </if>
  36 + <if test="queryParam.stocktakingAc != null and queryParam.stocktakingAc != ''">
  37 + <bind name="queryParam.stocktakingAc" value="'%' + queryParam.stocktakingAc + '%'"/>
  38 + and header.stocktaking_ac LIKE #{queryParam.stocktakingAc}
  39 + </if>
  40 + <if test="queryParam.completedAtBegin != null and queryParam.completedAtBegin != ''">
  41 + and detail.completed_at &gt;= #{queryParam.completedAtBegin}
  42 + </if>
  43 + <if test="queryParam.completedAtEnd != null and queryParam.completedAtEnd != ''">
  44 + and detail.completed_at &lt;= #{queryParam.completedAtEnd}
  45 + </if>
  46 + and detail.enable_status IN
  47 + <foreach collection="statuses" open="(" close=")" item="status" separator=",">
  48 + #{status}
  49 + </foreach>
  50 + </where>
  51 + </select>
  52 +</mapper>
0 53 \ No newline at end of file
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/service/ICycleCountDetailChildService.java
1 1 package org.jeecg.modules.wms.stocktaking.cycleCountDetail.service;
2 2  
3 3 import org.jeecg.common.api.vo.Result;
  4 +import org.jeecg.modules.wms.config.material.entity.Material;
  5 +import org.jeecg.modules.wms.report.dto.QueryReportCycleCountDto;
  6 +import org.jeecg.modules.wms.report.dto.ReportCycleCountDto;
4 7 import org.jeecg.modules.wms.stocktaking.cycleCountDetail.entity.CycleCountDetailChild;
5 8 import com.baomidou.mybatisplus.extension.service.IService;
6 9 import java.util.List;
... ... @@ -15,4 +18,11 @@ public interface ICycleCountDetailChildService extends IService&lt;CycleCountDetail
15 18  
16 19  
17 20 Result confirmGapQty(String id, String countedQty,String state);
  21 +
  22 + /**
  23 + * 盘点报表查询
  24 + * @param queryReportCycleCountDto 查询参数
  25 + * @return 盘点报表信息
  26 + */
  27 + List<ReportCycleCountDto> getCycleCountReport(QueryReportCycleCountDto queryReportCycleCountDto);
18 28 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/service/impl/CycleCountDetailChildServiceImpl.java
1 1 package org.jeecg.modules.wms.stocktaking.cycleCountDetail.service.impl;
2 2  
3 3 import java.math.BigDecimal;
  4 +import java.util.Collections;
4 5 import java.util.List;
5 6  
6 7 import javax.annotation.Resource;
... ... @@ -9,6 +10,8 @@ import org.apache.shiro.SecurityUtils;
9 10 import org.jeecg.common.api.vo.Result;
10 11 import org.jeecg.common.exception.JeecgBootException;
11 12 import org.jeecg.common.system.vo.LoginUser;
  13 +import org.jeecg.modules.wms.report.dto.QueryReportCycleCountDto;
  14 +import org.jeecg.modules.wms.report.dto.ReportCycleCountDto;
12 15 import org.jeecg.modules.wms.stocktaking.cycleCountDetail.entity.CycleCountDetail;
13 16 import org.jeecg.modules.wms.stocktaking.cycleCountDetail.entity.CycleCountDetailChild;
14 17 import org.jeecg.modules.wms.stocktaking.cycleCountDetail.mapper.CycleCountDetailChildMapper;
... ... @@ -142,4 +145,9 @@ public class CycleCountDetailChildServiceImpl extends ServiceImpl&lt;CycleCountDeta
142 145 // result.setResult(cycleCountHeader.getId());
143 146 return Result.OK("调整成功");
144 147 }
  148 +
  149 + @Override
  150 + public List<ReportCycleCountDto> getCycleCountReport(QueryReportCycleCountDto queryReportCycleCountDto) {
  151 + return super.baseMapper.selectCycleCount(queryReportCycleCountDto, Collections.singletonList(QuantityConstant.CYCLECOUNT_STATUS_COMPLETED));
  152 + }
145 153 }
... ...