no message
							parent
							
								
									84fa3cdc01
								
							
						
					
					
						commit
						889db214d8
					
				| 
						 | 
				
			
			@ -0,0 +1,494 @@
 | 
			
		|||
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="div1">
 | 
			
		||||
 | 
			
		||||
    <div class="div2" style="padding-bottom: 10px">
 | 
			
		||||
      <el-form ref="form" :model="param" label-width="80px">
 | 
			
		||||
        <el-row>
 | 
			
		||||
          <el-col :span="1">
 | 
			
		||||
            <el-form-item label="波次号:">
 | 
			
		||||
              <el-input type="textarea" v-model="param.wdCode" :rows="1" style="width: 280px;"></el-input>
 | 
			
		||||
            </el-form-item>
 | 
			
		||||
          </el-col>
 | 
			
		||||
        </el-row>
 | 
			
		||||
        <el-button type="success" @click="find">查找</el-button>
 | 
			
		||||
        <el-button type="success" @click="down">导出</el-button>
 | 
			
		||||
        <el-button type="success" @click="rest">重置</el-button>  
 | 
			
		||||
      </el-form>
 | 
			
		||||
    </div>
 | 
			
		||||
    <div class="table-title">命中率</div>
 | 
			
		||||
    <el-table
 | 
			
		||||
        v-loading="this.tableloding"
 | 
			
		||||
        :data="rqMzList"
 | 
			
		||||
        id="educe-table"
 | 
			
		||||
        ref="tableData"
 | 
			
		||||
        border
 | 
			
		||||
        style="width: 100%;">
 | 
			
		||||
      <el-table-column prop="workstation" label="工作站" width="180"></el-table-column>
 | 
			
		||||
      <el-table-column prop="g201.mz" label="201" width="50"></el-table-column>
 | 
			
		||||
      <el-table-column prop="g202.mz" label="202" width="50"></el-table-column>
 | 
			
		||||
      <el-table-column prop="g203.mz" label="203" width="50"></el-table-column>
 | 
			
		||||
      <el-table-column prop="g204.mz" label="204" width="50"></el-table-column>
 | 
			
		||||
      <el-table-column prop="g205.mz" label="205" width="50"></el-table-column>
 | 
			
		||||
      <el-table-column prop="g206.mz" label="206" width="50"></el-table-column>
 | 
			
		||||
      <el-table-column prop="g207.mz" label="207" width="50"></el-table-column>
 | 
			
		||||
      <el-table-column prop="g208.mz" label="208" width="50"></el-table-column>
 | 
			
		||||
      <el-table-column prop="g209.mz" label="209" width="50"></el-table-column>
 | 
			
		||||
      <el-table-column prop="g210.mz" label="210" width="50"></el-table-column>
 | 
			
		||||
      <el-table-column prop="g211.mz" label="211" width="50"></el-table-column>
 | 
			
		||||
      <el-table-column prop="g212.mz" label="212" width="50"></el-table-column>
 | 
			
		||||
      <el-table-column prop="g213.mz" label="213" width="50"></el-table-column>
 | 
			
		||||
      <el-table-column prop="g214.mz" label="214" width="50"></el-table-column>
 | 
			
		||||
      <el-table-column prop="g215.mz" label="215" width="50"></el-table-column>
 | 
			
		||||
      <el-table-column prop="total.mz" label="平均值" width="60"></el-table-column>
 | 
			
		||||
    </el-table>
 | 
			
		||||
    <div class="table-title">箱子流通数</div>
 | 
			
		||||
    <el-table
 | 
			
		||||
        v-loading="this.tableloding"
 | 
			
		||||
        :data="rqLtList"
 | 
			
		||||
        id="educe-table"
 | 
			
		||||
        ref="tableData"
 | 
			
		||||
        border
 | 
			
		||||
        style="width: 100%;">
 | 
			
		||||
      <el-table-column prop="workstation" label="工作站" width="180"></el-table-column>
 | 
			
		||||
      <el-table-column prop="g201" label="201" width="50"></el-table-column>
 | 
			
		||||
      <el-table-column prop="g202" label="202" width="50"></el-table-column>
 | 
			
		||||
      <el-table-column prop="g203" label="203" width="50"></el-table-column>
 | 
			
		||||
      <el-table-column prop="g204" label="204" width="50"></el-table-column>
 | 
			
		||||
      <el-table-column prop="g205" label="205" width="50"></el-table-column>
 | 
			
		||||
      <el-table-column prop="g206" label="206" width="50"></el-table-column>
 | 
			
		||||
      <el-table-column prop="g207" label="207" width="50"></el-table-column>
 | 
			
		||||
      <el-table-column prop="g208" label="208" width="50"></el-table-column>
 | 
			
		||||
      <el-table-column prop="g209" label="209" width="50"></el-table-column>
 | 
			
		||||
      <el-table-column prop="g210" label="210" width="50"></el-table-column>
 | 
			
		||||
      <el-table-column prop="g211" label="211" width="50"></el-table-column>
 | 
			
		||||
      <el-table-column prop="g212" label="212" width="50"></el-table-column>
 | 
			
		||||
      <el-table-column prop="g213" label="213" width="50"></el-table-column>
 | 
			
		||||
      <el-table-column prop="g214" label="214" width="50"></el-table-column>
 | 
			
		||||
      <el-table-column prop="g215" label="215" width="50"></el-table-column>
 | 
			
		||||
      <el-table-column prop="total" label="汇总" width="60"></el-table-column>
 | 
			
		||||
    </el-table>
 | 
			
		||||
    <div class="table-title" v-if="false">数据详情
 | 
			
		||||
    <el-table
 | 
			
		||||
        v-loading="this.tableloding"
 | 
			
		||||
        :height="MaxHeight"
 | 
			
		||||
        :header-cell-style="{background:'#000',color:'#fff'}"
 | 
			
		||||
        :data="tableData"
 | 
			
		||||
        id="educe-table"
 | 
			
		||||
        ref="tableData"
 | 
			
		||||
        border
 | 
			
		||||
        style="width: 100%;">
 | 
			
		||||
      <el-table-column
 | 
			
		||||
          fixed
 | 
			
		||||
          label="容器"
 | 
			
		||||
          v-if="true"
 | 
			
		||||
          width="180">
 | 
			
		||||
        <template slot-scope="scope">
 | 
			
		||||
          <span style="margin-left: 10px">{{ scope.row.rqh }}</span>
 | 
			
		||||
        </template>
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
      <el-table-column
 | 
			
		||||
          fixed
 | 
			
		||||
          label="201"
 | 
			
		||||
          v-if="true"
 | 
			
		||||
          width="50">
 | 
			
		||||
        <template slot-scope="scope">
 | 
			
		||||
          <span style="margin-left: 10px">{{ scope.row.g201 }}</span>
 | 
			
		||||
        </template>
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
      <el-table-column
 | 
			
		||||
          fixed
 | 
			
		||||
          label="202"
 | 
			
		||||
          v-if="true"
 | 
			
		||||
          width="50">
 | 
			
		||||
        <template slot-scope="scope">
 | 
			
		||||
          <span style="margin-left: 10px">{{ scope.row.g202 }}</span>
 | 
			
		||||
        </template>
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
      <el-table-column
 | 
			
		||||
          fixed
 | 
			
		||||
          label="203"
 | 
			
		||||
          v-if="true"
 | 
			
		||||
          width="50">
 | 
			
		||||
        <template slot-scope="scope">
 | 
			
		||||
          <span style="margin-left: 10px">{{ scope.row.g203 }}</span>
 | 
			
		||||
        </template>
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
      <el-table-column
 | 
			
		||||
          fixed
 | 
			
		||||
          label="204"
 | 
			
		||||
          v-if="true"
 | 
			
		||||
          width="50">
 | 
			
		||||
        <template slot-scope="scope">
 | 
			
		||||
          <span style="margin-left: 10px">{{ scope.row.g204 }}</span>
 | 
			
		||||
        </template>
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
      <el-table-column
 | 
			
		||||
          fixed
 | 
			
		||||
          label="205"
 | 
			
		||||
          v-if="true"
 | 
			
		||||
          width="50">
 | 
			
		||||
        <template slot-scope="scope">
 | 
			
		||||
          <span style="margin-left: 10px">{{ scope.row.g205 }}</span>
 | 
			
		||||
        </template>
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
      <el-table-column
 | 
			
		||||
          fixed
 | 
			
		||||
          label="206"
 | 
			
		||||
          v-if="true"
 | 
			
		||||
          width="50">
 | 
			
		||||
        <template slot-scope="scope">
 | 
			
		||||
          <span style="margin-left: 10px">{{ scope.row.g206 }}</span>
 | 
			
		||||
        </template>
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
      <el-table-column
 | 
			
		||||
          fixed
 | 
			
		||||
          label="207"
 | 
			
		||||
          v-if="true"
 | 
			
		||||
          width="50">
 | 
			
		||||
        <template slot-scope="scope">
 | 
			
		||||
          <span style="margin-left: 10px">{{ scope.row.g207 }}</span>
 | 
			
		||||
        </template>
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
      <el-table-column
 | 
			
		||||
          fixed
 | 
			
		||||
          label="208"
 | 
			
		||||
          v-if="true"
 | 
			
		||||
          width="50">
 | 
			
		||||
        <template slot-scope="scope">
 | 
			
		||||
          <span style="margin-left: 10px">{{ scope.row.g208 }}</span>
 | 
			
		||||
        </template>
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
      <el-table-column
 | 
			
		||||
          fixed
 | 
			
		||||
          label="209"
 | 
			
		||||
          v-if="true"
 | 
			
		||||
          width="50">
 | 
			
		||||
        <template slot-scope="scope">
 | 
			
		||||
          <span style="margin-left: 10px">{{ scope.row.g209 }}</span>
 | 
			
		||||
        </template>
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
      <el-table-column
 | 
			
		||||
          fixed
 | 
			
		||||
          label="210"
 | 
			
		||||
          v-if="true"
 | 
			
		||||
          width="50">
 | 
			
		||||
        <template slot-scope="scope">
 | 
			
		||||
          <span style="margin-left: 10px">{{ scope.row.g210 }}</span>
 | 
			
		||||
        </template>
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
      <el-table-column
 | 
			
		||||
          fixed
 | 
			
		||||
          label="211"
 | 
			
		||||
          v-if="true"
 | 
			
		||||
          width="50">
 | 
			
		||||
        <template slot-scope="scope">
 | 
			
		||||
          <span style="margin-left: 10px">{{ scope.row.g211 }}</span>
 | 
			
		||||
        </template>
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
      <el-table-column
 | 
			
		||||
          fixed
 | 
			
		||||
          label="212"
 | 
			
		||||
          v-if="true"
 | 
			
		||||
          width="50">
 | 
			
		||||
        <template slot-scope="scope">
 | 
			
		||||
          <span style="margin-left: 10px">{{ scope.row.g212 }}</span>
 | 
			
		||||
        </template>
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
      <el-table-column
 | 
			
		||||
          fixed
 | 
			
		||||
          label="213"
 | 
			
		||||
          v-if="true"
 | 
			
		||||
          width="50">
 | 
			
		||||
        <template slot-scope="scope">
 | 
			
		||||
          <span style="margin-left: 10px">{{ scope.row.g213 }}</span>
 | 
			
		||||
        </template>
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
      <el-table-column
 | 
			
		||||
          fixed
 | 
			
		||||
          label="214"
 | 
			
		||||
          v-if="true"
 | 
			
		||||
          width="50">
 | 
			
		||||
        <template slot-scope="scope">
 | 
			
		||||
          <span style="margin-left: 10px">{{ scope.row.g214 }}</span>
 | 
			
		||||
        </template>
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
      <el-table-column
 | 
			
		||||
          fixed
 | 
			
		||||
          label="215"
 | 
			
		||||
          v-if="true"
 | 
			
		||||
          width="50">
 | 
			
		||||
        <template slot-scope="scope">
 | 
			
		||||
          <span style="margin-left: 10px">{{ scope.row.g215 }}</span>
 | 
			
		||||
        </template>
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
    </el-table>
 | 
			
		||||
    <el-pagination
 | 
			
		||||
        @size-change="handleSizeChange"
 | 
			
		||||
        @current-change="handleCurrentChange"
 | 
			
		||||
        :current-page="pageNum"
 | 
			
		||||
        :page-sizes="[ 50, 100, 200,500]"
 | 
			
		||||
        :page-size="pageSize"
 | 
			
		||||
        layout="total, sizes, prev, pager, next, jumper"
 | 
			
		||||
        :total="total">
 | 
			
		||||
    </el-pagination>
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import FileSaver from 'file-saver'
 | 
			
		||||
// eslint-disable-next-line no-unused-vars
 | 
			
		||||
import XLSX from 'xlsx'
 | 
			
		||||
export default {
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      rqLtList: [],
 | 
			
		||||
      rqMzList: [],
 | 
			
		||||
      pickerOptions: {
 | 
			
		||||
        shortcuts: [{
 | 
			
		||||
          text: '最近一周',
 | 
			
		||||
          onClick(picker) {
 | 
			
		||||
            const end = new Date();
 | 
			
		||||
            const start = new Date();
 | 
			
		||||
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
 | 
			
		||||
            picker.$emit('pick', [start, end]);
 | 
			
		||||
          }
 | 
			
		||||
        }, {
 | 
			
		||||
          text: '最近一个月',
 | 
			
		||||
          onClick(picker) {
 | 
			
		||||
            const end = new Date();
 | 
			
		||||
            const start = new Date();
 | 
			
		||||
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
 | 
			
		||||
            picker.$emit('pick', [start, end]);
 | 
			
		||||
          }
 | 
			
		||||
        }, {
 | 
			
		||||
          text: '最近三个月',
 | 
			
		||||
          onClick(picker) {
 | 
			
		||||
            const end = new Date();
 | 
			
		||||
            const start = new Date();
 | 
			
		||||
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
 | 
			
		||||
            picker.$emit('pick', [start, end]);
 | 
			
		||||
          }
 | 
			
		||||
        }]
 | 
			
		||||
      },
 | 
			
		||||
      tableloding: false,
 | 
			
		||||
      isShow:false,//是否展示全部搜索条件
 | 
			
		||||
      tableData: [],
 | 
			
		||||
      pageSize: 50,
 | 
			
		||||
      spanArr: [], //每行合并数
 | 
			
		||||
      pos: 0, //角标索引
 | 
			
		||||
      pageNum: 1,
 | 
			
		||||
      total: 3,
 | 
			
		||||
      //查询条件
 | 
			
		||||
      param: {
 | 
			
		||||
        wdCode: ''
 | 
			
		||||
      },
 | 
			
		||||
      loading: false,
 | 
			
		||||
      checked: false,
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
 | 
			
		||||
  computed:{
 | 
			
		||||
    existingLogicTotal() {
 | 
			
		||||
      return this.existingLogic.reduce((total, num) => total + num, 0);
 | 
			
		||||
    },
 | 
			
		||||
    headLogicTotal() {
 | 
			
		||||
      return this.headLogic.reduce((total, num) => total + num, 0);
 | 
			
		||||
    },
 | 
			
		||||
    MaxHeight(){
 | 
			
		||||
      return  window.innerHeight - 240 +"px";
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  mounted: function () {
 | 
			
		||||
    this.queryUser();
 | 
			
		||||
  },
 | 
			
		||||
  updated() {
 | 
			
		||||
    // 每次更新会重新对 Table 进行重新布局
 | 
			
		||||
    this.$nextTick(() => {
 | 
			
		||||
      if (this.$refs.mutipleTable !== undefined) {
 | 
			
		||||
        this.$refs.mutipleTable.doLayout()
 | 
			
		||||
      }
 | 
			
		||||
    })
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
 | 
			
		||||
    // 合并单元格样式,主要是针对要合并列的第一个单元格(有其他需要的可自行更改)
 | 
			
		||||
    cellStyle({ row, column }) {
 | 
			
		||||
      // 找到数组中列>1那一个单元格,就是需要改变的样式
 | 
			
		||||
      if (row['mergeData'][column.property] && row['mergeData'][column.property][1] && row['mergeData'][column.property][1] > 1) {
 | 
			
		||||
        return { 'text-align': 'left' }
 | 
			
		||||
      } else {
 | 
			
		||||
        return {}
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
    },
 | 
			
		||||
    objectSpanMethod({ row, column }) {
 | 
			
		||||
      // 直接返回后端给的对应字段的单元格数据
 | 
			
		||||
      return row['mergeData'][column.property]
 | 
			
		||||
    },
 | 
			
		||||
    handleEdit(index, row) {
 | 
			
		||||
      console.log(index, row);
 | 
			
		||||
    },
 | 
			
		||||
    handleDelete(index, row) {
 | 
			
		||||
      console.log(index, row);
 | 
			
		||||
    },
 | 
			
		||||
    handleSizeChange(val) {
 | 
			
		||||
      console.log(`每页 ${val} 条`);
 | 
			
		||||
      this.pageNum = 1;
 | 
			
		||||
      this.pageSize = val;
 | 
			
		||||
      this.queryUser();
 | 
			
		||||
    },
 | 
			
		||||
    handleCurrentChange(val) {
 | 
			
		||||
      console.log(`当前页: ${val}`);
 | 
			
		||||
      this.pageNum = val;
 | 
			
		||||
      this.queryUser();
 | 
			
		||||
    },
 | 
			
		||||
    queryUser() {
 | 
			
		||||
      //列表数据加载
 | 
			
		||||
      this.$axios.post(this.$httpUrl + '/RongQi/queryList', {
 | 
			
		||||
        pageSize: this.pageSize,
 | 
			
		||||
        pageNum: this.pageNum,
 | 
			
		||||
        param: this.param,
 | 
			
		||||
      }).then(res => res.data)
 | 
			
		||||
          .then(res => {
 | 
			
		||||
            if (res.code == 200) {
 | 
			
		||||
 | 
			
		||||
              this.tableData = res.data.rqList
 | 
			
		||||
              this.total = this.tableData.length
 | 
			
		||||
              this.pageSize=this.tableData.length
 | 
			
		||||
              this.rqLtList=res.data.rqLtList
 | 
			
		||||
              this.rqMzList=res.data.rqMzList
 | 
			
		||||
              console.log(this.rqMzList)
 | 
			
		||||
              /*const rqLtMap=res.data.rqLtMap
 | 
			
		||||
              /!* 获取新逻辑数据*!/
 | 
			
		||||
              const rqLtMapNew=rqLtMap.NEW
 | 
			
		||||
              /!* 添加汇总*!/
 | 
			
		||||
              rqLtMapNew.push(rqLtMapNew.reduce((acc, current) => acc + current, 0));
 | 
			
		||||
              /!* 添加表头*!/
 | 
			
		||||
              rqLtMapNew.unshift("头物料+容器逻辑");
 | 
			
		||||
              const propertyKeys = ['workstation', '201', '202', '203', '204', '205', '206', '207', '208', '209', '210', '211', 'total'];
 | 
			
		||||
              const newObj = {};
 | 
			
		||||
              for (let i = 0; i < propertyKeys.length; i++) {
 | 
			
		||||
                newObj[propertyKeys[i]] = rqLtMapNew[i];
 | 
			
		||||
              }
 | 
			
		||||
              this.rqLtList[1]=newObj;
 | 
			
		||||
 | 
			
		||||
              /!* 获取旧逻辑数据*!/
 | 
			
		||||
              const rqLtMapOLD=rqLtMap.OLD
 | 
			
		||||
              /!* 添加汇总*!/
 | 
			
		||||
              rqLtMapOLD.push(rqLtMapOLD.reduce((acc, current) => acc + current, 0));
 | 
			
		||||
              /!* 添加表头*!/
 | 
			
		||||
              rqLtMapOLD.unshift("现有逻辑");
 | 
			
		||||
              const oldObj = {};
 | 
			
		||||
              for (let i = 0; i < propertyKeys.length; i++) {
 | 
			
		||||
                oldObj[propertyKeys[i]] = rqLtMapOLD[i];
 | 
			
		||||
              }
 | 
			
		||||
              this.rqLtList[0]=oldObj;
 | 
			
		||||
 | 
			
		||||
              console.log(this.rqLtList)*/
 | 
			
		||||
            } else {
 | 
			
		||||
              this.$message.error('获取数据失败');
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            // eslint-disable-next-line no-unused-vars
 | 
			
		||||
          },err=>{
 | 
			
		||||
            this.tableloding=false;
 | 
			
		||||
          })
 | 
			
		||||
 | 
			
		||||
    },
 | 
			
		||||
    find(){
 | 
			
		||||
      this.pageNum=1;
 | 
			
		||||
      this.queryUser();
 | 
			
		||||
    },
 | 
			
		||||
    down(){
 | 
			
		||||
      this.exportToExcel();
 | 
			
		||||
    },
 | 
			
		||||
    // 表格数据写入excel,并导出为Excel文件
 | 
			
		||||
    exportToExcel(){
 | 
			
		||||
      /*const worksheet = XLSX.utils.json_to_sheet(this.tableData);
 | 
			
		||||
      const workbook = XLSX.utils.book_new();
 | 
			
		||||
      XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1');
 | 
			
		||||
      XLSX.writeFile(workbook, 'table_data.xlsx');*/
 | 
			
		||||
      const XLSX = require('xlsx')
 | 
			
		||||
      console.log('XLSX',XLSX,FileSaver)
 | 
			
		||||
      // 使用 this.$nextTick 是在dom元素都渲染完成之后再执行
 | 
			
		||||
      this.$nextTick(function () {
 | 
			
		||||
        // 设置导出的内容是否只做解析,不进行格式转换     false:要解析, true:不解析
 | 
			
		||||
        const xlsxParam = { raw: true }
 | 
			
		||||
        const wb = XLSX.utils.table_to_book(document.querySelector('#educe-table'), xlsxParam)
 | 
			
		||||
        // 导出excel文件名
 | 
			
		||||
        let fileName = '容器流通' + new Date().getTime() + '.xlsx'
 | 
			
		||||
 | 
			
		||||
        const wbout = XLSX.write(wb, { bookType: 'xlsx', bookSST: true, type: 'array' })
 | 
			
		||||
        try {
 | 
			
		||||
          // 下载保存文件
 | 
			
		||||
          FileSaver.saveAs(new Blob([wbout], { type: 'application/octet-stream' }), fileName)
 | 
			
		||||
        } catch (e) {
 | 
			
		||||
          if (typeof console !== 'undefined') {
 | 
			
		||||
            console.log(e, wbout)
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
        return wbout
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    parseTime(time, cFormat) {
 | 
			
		||||
      //获取当前时间
 | 
			
		||||
      if (arguments.length === 0) {
 | 
			
		||||
        return null
 | 
			
		||||
      }
 | 
			
		||||
      const format = cFormat || '{y}-{m}-{d} {h}:{i}:{s}'
 | 
			
		||||
      let date
 | 
			
		||||
      if (typeof time === 'undefined' || time === null || time === 'null') {
 | 
			
		||||
        return ''
 | 
			
		||||
      } else if (typeof time === 'object') {
 | 
			
		||||
        date = time
 | 
			
		||||
      } else {
 | 
			
		||||
        if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) {
 | 
			
		||||
          time = parseInt(time)
 | 
			
		||||
        }
 | 
			
		||||
        if ((typeof time === 'number') && (time.toString().length === 10)) {
 | 
			
		||||
          time = time * 1000
 | 
			
		||||
        }
 | 
			
		||||
        date = new Date(time)
 | 
			
		||||
      }
 | 
			
		||||
      const formatObj = {
 | 
			
		||||
        y: date.getFullYear(),
 | 
			
		||||
        m: date.getMonth() + 1,
 | 
			
		||||
        d: date.getDate(),
 | 
			
		||||
        h: date.getHours(),
 | 
			
		||||
        i: date.getMinutes(),
 | 
			
		||||
        s: date.getSeconds(),
 | 
			
		||||
        a: date.getDay()
 | 
			
		||||
      }
 | 
			
		||||
      const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => {
 | 
			
		||||
        let value = formatObj[key]
 | 
			
		||||
        // Note: getDay() returns 0 on Sunday
 | 
			
		||||
        if (key === 'a') { return ['日', '一', '二', '三', '四', '五', '六'][value ] }
 | 
			
		||||
        if (result.length > 0 && value < 10) {
 | 
			
		||||
          value = '0' + value
 | 
			
		||||
        }
 | 
			
		||||
        return value || 0
 | 
			
		||||
      })
 | 
			
		||||
      return time_str
 | 
			
		||||
    },
 | 
			
		||||
    Allquesr(){
 | 
			
		||||
      //查询按钮
 | 
			
		||||
      if(this.checked){
 | 
			
		||||
        this.isShow=true;
 | 
			
		||||
      }else {
 | 
			
		||||
        this.isShow=false;
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    rest() {
 | 
			
		||||
      //条件查询重置
 | 
			
		||||
      this.checked=false;
 | 
			
		||||
      this.isShow=false;
 | 
			
		||||
      this.param={};
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
<style scoped>
 | 
			
		||||
</style>
 | 
			
		||||
| 
						 | 
				
			
			@ -128,7 +128,14 @@ const routes=[
 | 
			
		|||
                },
 | 
			
		||||
                component: () => import('@/components/duochaxun/Xuliehao.vue')
 | 
			
		||||
            },
 | 
			
		||||
 | 
			
		||||
            {
 | 
			
		||||
                path:'/RongQi',
 | 
			
		||||
                name:'RongQi',
 | 
			
		||||
                meta:{
 | 
			
		||||
                    title:'容器流通'
 | 
			
		||||
                },
 | 
			
		||||
                component: () => import('@/components/duochaxun/RongQi.vue')
 | 
			
		||||
            }
 | 
			
		||||
        ]
 | 
			
		||||
    }
 | 
			
		||||
]
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -0,0 +1,24 @@
 | 
			
		|||
package com.yc.wms.controller;
 | 
			
		||||
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
 | 
			
		||||
import javax.persistence.Entity;
 | 
			
		||||
import javax.persistence.Id;
 | 
			
		||||
import java.io.Serializable;
 | 
			
		||||
 | 
			
		||||
@Data
 | 
			
		||||
@Entity
 | 
			
		||||
public class RQTaskModel implements Serializable{
 | 
			
		||||
    @Id
 | 
			
		||||
    private Long id;
 | 
			
		||||
    private int ts;
 | 
			
		||||
    // 料号
 | 
			
		||||
    private String liaohao;
 | 
			
		||||
    // 工作站
 | 
			
		||||
    private String gzz;
 | 
			
		||||
    // 容器
 | 
			
		||||
    private String rqh;
 | 
			
		||||
    // 物料
 | 
			
		||||
    private String zrwh;
 | 
			
		||||
    private String agvId;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,462 @@
 | 
			
		|||
package com.yc.wms.controller;
 | 
			
		||||
 | 
			
		||||
import cn.hutool.json.JSONArray;
 | 
			
		||||
import cn.hutool.json.JSONObject;
 | 
			
		||||
import cn.hutool.json.JSONUtil;
 | 
			
		||||
import com.yc.wms.bean.Xuliehao;
 | 
			
		||||
import com.yc.wms.service.Xuliehaoqingdan;
 | 
			
		||||
import com.yc.wms.until.QueryPageUtil;
 | 
			
		||||
import com.yc.wms.until.Result;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
import lombok.extern.slf4j.Slf4j;
 | 
			
		||||
import org.springframework.beans.factory.annotation.Autowired;
 | 
			
		||||
import org.springframework.web.bind.annotation.PostMapping;
 | 
			
		||||
import org.springframework.web.bind.annotation.RequestBody;
 | 
			
		||||
import org.springframework.web.bind.annotation.RequestMapping;
 | 
			
		||||
import org.springframework.web.bind.annotation.RestController;
 | 
			
		||||
 | 
			
		||||
import javax.persistence.*;
 | 
			
		||||
import javax.servlet.http.HttpServletResponse;
 | 
			
		||||
import java.io.Serializable;
 | 
			
		||||
import java.text.SimpleDateFormat;
 | 
			
		||||
import java.util.*;
 | 
			
		||||
import java.util.stream.Collectors;
 | 
			
		||||
import java.util.stream.IntStream;
 | 
			
		||||
 | 
			
		||||
@RestController
 | 
			
		||||
@Slf4j
 | 
			
		||||
@RequestMapping("/RongQi")
 | 
			
		||||
public class RongQiController {
 | 
			
		||||
    @PersistenceContext
 | 
			
		||||
    private EntityManager entityManager;
 | 
			
		||||
    @Autowired
 | 
			
		||||
    private Xuliehaoqingdan xuliehaoqingdan;
 | 
			
		||||
 | 
			
		||||
    @PostMapping("/queryList")
 | 
			
		||||
    public Result queryList(@RequestBody String  json) {
 | 
			
		||||
        /* 返回data设置*/
 | 
			
		||||
        QueryPageUtil query =new QueryPageUtil();
 | 
			
		||||
        JSONObject jsonObject= JSONUtil.parseObj(json);
 | 
			
		||||
        query.setPageSize((int)jsonObject.get("pageSize"));
 | 
			
		||||
        query.setPageNum((int)jsonObject.get("pageNum"));
 | 
			
		||||
        JSONObject param= (JSONObject)jsonObject.get("param");
 | 
			
		||||
        String wdCode=param.getStr("wdCode");
 | 
			
		||||
//                "BC241225094433013372";
 | 
			
		||||
       /* JSONArray jsonArray=param.getJSONArray("issued_Date");
 | 
			
		||||
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
 | 
			
		||||
        String startDate="";
 | 
			
		||||
        String endDate="";
 | 
			
		||||
        if (jsonArray.size()>0){
 | 
			
		||||
            Date date1=jsonArray.getDate(0);
 | 
			
		||||
            startDate=sdf.format(date1);
 | 
			
		||||
            Date date2=jsonArray.getDate(1);
 | 
			
		||||
            endDate=sdf.format(date2);
 | 
			
		||||
        }else {
 | 
			
		||||
            startDate="2024-05-01";
 | 
			
		||||
            Date date = new Date();
 | 
			
		||||
            endDate=sdf.format(date);
 | 
			
		||||
        }*/
 | 
			
		||||
        /* 基础sql数据查询*/
 | 
			
		||||
        String sql=" SELECT "
 | 
			
		||||
                +" 	MAX(t.id) as id, "
 | 
			
		||||
                +" 	count(t.id) as ts, "
 | 
			
		||||
                +" 	MAX(t.agvTask_ID) as agv_id, "
 | 
			
		||||
                +" 	item.code AS liaohao, "
 | 
			
		||||
                +" 	MAX ( t.END_REGION ) AS gzz, "
 | 
			
		||||
                +" 	MAX ( s2.LP ) AS rqh, "
 | 
			
		||||
                +" 	t.BILLCODE AS zrwh  "
 | 
			
		||||
                +" FROM "
 | 
			
		||||
                +" 	task t "
 | 
			
		||||
                +" 	LEFT JOIN PICK_TICKET_DETAIL ptd ON ptd.id= t.PICK_TICKET_DETAIL_ID "
 | 
			
		||||
                +" 	LEFT JOIN PICK_TICKET pt ON pt.id= ptd.PICK_TICKET_ID "
 | 
			
		||||
                +" 	LEFT JOIN LOCATION loc ON loc.id= t.SRC_LOC_ID "
 | 
			
		||||
                +" 	LEFT JOIN ZONE z ON z.id= loc.ZONE_ID "
 | 
			
		||||
                +" 	LEFT JOIN ITEM_KEY ik ON ik.id= t.ITEM_KEY_ID "
 | 
			
		||||
                +" 	LEFT JOIN ITEM item ON item.id= ik.ITEM_ID "
 | 
			
		||||
                +" 	LEFT JOIN STOCK s2 ON s2.id= t.SRC_LP "
 | 
			
		||||
                +" 	LEFT JOIN STOCK s1 ON s1.id= loc.stock "
 | 
			
		||||
                +" 	LEFT JOIN WAVE_DOC wd ON wd.id= t.WAVE_DOC_ID  "
 | 
			
		||||
                +" WHERE "
 | 
			
		||||
                +" 	1 = 1  "
 | 
			
		||||
                +" 	AND pt.BILL_TYPE_ID= 1094  "
 | 
			
		||||
                +" 	AND wd.code= '"+wdCode+"'  "
 | 
			
		||||
                +" 	AND t.WAVE_DOC_ID IS NOT NULL  and z.id=1763 "
 | 
			
		||||
                +" GROUP BY "
 | 
			
		||||
                +" 	pt.code, "
 | 
			
		||||
                +" 	t.agvTask_ID, "
 | 
			
		||||
                +" 	t.BILLCODE, "
 | 
			
		||||
                +" 	item.id, "
 | 
			
		||||
                +" 	item.code, "
 | 
			
		||||
                +" 	item.BE_MARK_WEIGHT, "
 | 
			
		||||
                +" 	loc.id, "
 | 
			
		||||
                +" 	loc.code, "
 | 
			
		||||
                +" 	ik.PROP_C1, "
 | 
			
		||||
                +" 	ik.PROP_C2, "
 | 
			
		||||
                +" 	ik.PROP_C3, "
 | 
			
		||||
                +" 	ik.PROP_D1, "
 | 
			
		||||
                +" 	ik.PROP_D2, "
 | 
			
		||||
                +" 	item.ISBOM  "
 | 
			
		||||
                ;
 | 
			
		||||
        String sqlCount = "select count(t.id) as nums from (" + sql+") t";
 | 
			
		||||
        /* 总条数*/
 | 
			
		||||
        List<Integer> counts = entityManager.createNativeQuery(sqlCount).getResultList();
 | 
			
		||||
        /* 当前页数据*/
 | 
			
		||||
        int pageNum = query.getPageNum();//当前页
 | 
			
		||||
        int pageSize = counts.get(0);//条数
 | 
			
		||||
        String querySql="";//查询条件
 | 
			
		||||
 | 
			
		||||
        String sqlFy = "select * from( "
 | 
			
		||||
                +  sql
 | 
			
		||||
                + ") t where 1=1 "
 | 
			
		||||
                + querySql
 | 
			
		||||
                +" ORDER BY rqh "
 | 
			
		||||
                + " ,id"
 | 
			
		||||
                +"    OFFSET "+ (pageNum-1) * pageSize +" ROWS "
 | 
			
		||||
                +"    FETCH NEXT "+pageSize+" ROWS ONLY; ";
 | 
			
		||||
 | 
			
		||||
        /* 箱子流通数*/
 | 
			
		||||
        List<RongQiLt> rqLtList=new ArrayList<>();
 | 
			
		||||
        RongQiLt rongQiOLD=new RongQiLt();
 | 
			
		||||
        rongQiOLD.setWorkstation("现有逻辑");
 | 
			
		||||
        rqLtList.add(rongQiOLD);
 | 
			
		||||
 | 
			
		||||
        RongQiLt rongQiNEW=new RongQiLt();
 | 
			
		||||
        rongQiNEW.setWorkstation("头物料+容器逻辑");
 | 
			
		||||
        rqLtList.add(rongQiNEW);
 | 
			
		||||
 | 
			
		||||
        /* 工作站命中率*/
 | 
			
		||||
        List<RongQiMz> rqMzList=new ArrayList<>();
 | 
			
		||||
        RongQiMz rqMzOLD=new RongQiMz();
 | 
			
		||||
        rqMzOLD.setWorkstation("现有逻辑");
 | 
			
		||||
        rqMzList.add(rqMzOLD);
 | 
			
		||||
 | 
			
		||||
        RongQiMz rqMzNEW=new RongQiMz();
 | 
			
		||||
        rqMzNEW.setWorkstation("新逻辑");
 | 
			
		||||
        rqMzList.add(rqMzNEW);
 | 
			
		||||
        /* 详情数据*/
 | 
			
		||||
        List<RongQi> rqList = new ArrayList<>();
 | 
			
		||||
        /* 查询所有数据*/
 | 
			
		||||
        List<RQTaskModel> listAll = entityManager.createNativeQuery(sqlFy, RQTaskModel.class).getResultList();
 | 
			
		||||
        /* 按容器分组*/
 | 
			
		||||
        Map<String, List<RQTaskModel>> groupedByRqh = listAll.stream()
 | 
			
		||||
                .collect(Collectors.groupingBy(RQTaskModel::getRqh));
 | 
			
		||||
        for (String rqh : groupedByRqh.keySet()) {
 | 
			
		||||
            RongQi rongQi=new RongQi();
 | 
			
		||||
            rongQi.setRqh(rqh);
 | 
			
		||||
            List<RQTaskModel> listRqh=groupedByRqh.get(rqh);
 | 
			
		||||
            rongQi.setId(listRqh.get(0).getId());
 | 
			
		||||
            /* 按工作站分组*/
 | 
			
		||||
            Map<String, List<RQTaskModel>> groupedByGzz = listRqh.stream()
 | 
			
		||||
                    .collect(Collectors.groupingBy(RQTaskModel::getGzz));
 | 
			
		||||
            for (String gzz : groupedByGzz.keySet()) {
 | 
			
		||||
                List<RQTaskModel> listGzz=groupedByGzz.get(gzz);
 | 
			
		||||
                /* 按AgvId任务分组,获取分组后的集合长度,算出当前料箱到当前工作站的次数*/
 | 
			
		||||
                Map<String, List<RQTaskModel>> groupedByAgvId = listGzz.stream()
 | 
			
		||||
                        .collect(Collectors.groupingBy(RQTaskModel::getAgvId));
 | 
			
		||||
                /* 工作站搬运任务数*/
 | 
			
		||||
                int gzzCount=groupedByAgvId.size();
 | 
			
		||||
                /* 工作站拣货任务总行数*/
 | 
			
		||||
                int taskCount=0;
 | 
			
		||||
                for (RQTaskModel rqTaskModel : listGzz){
 | 
			
		||||
                    taskCount=taskCount+rqTaskModel.getTs();
 | 
			
		||||
                }
 | 
			
		||||
                int i=1;//1 新逻辑 0 原逻辑
 | 
			
		||||
                RongQiMz rongQiMz=rqMzList.get(i);
 | 
			
		||||
                switch (gzz){
 | 
			
		||||
                    case "201":
 | 
			
		||||
                        rongQi.setG201(taskCount);
 | 
			
		||||
                        rqLtList.get(i).setG201(rqLtList.get(i).getG201()+gzzCount);
 | 
			
		||||
                        rongQiMz.getG201().setTaskCount(rongQiMz.getG201().getTaskCount()+taskCount);
 | 
			
		||||
                        rongQiMz.getG201().setLxCount(rongQiMz.getG201().getLxCount()+1);
 | 
			
		||||
                        break;
 | 
			
		||||
                    case "202":
 | 
			
		||||
                        rongQi.setG202(taskCount);
 | 
			
		||||
                        rqLtList.get(i).setG202(rqLtList.get(i).getG202()+gzzCount);
 | 
			
		||||
                        rongQiMz.getG202().setTaskCount(rongQiMz.getG202().getTaskCount()+taskCount);
 | 
			
		||||
                        rongQiMz.getG202().setLxCount(rongQiMz.getG202().getLxCount()+1);
 | 
			
		||||
                        break;
 | 
			
		||||
                    case "203":
 | 
			
		||||
                        rongQi.setG203(taskCount);
 | 
			
		||||
                        rqLtList.get(i).setG203(rqLtList.get(i).getG203()+gzzCount);
 | 
			
		||||
                        rongQiMz.getG203().setTaskCount(rongQiMz.getG203().getTaskCount()+taskCount);
 | 
			
		||||
                        rongQiMz.getG203().setLxCount(rongQiMz.getG203().getLxCount()+1);
 | 
			
		||||
                        break;
 | 
			
		||||
                    case "204":
 | 
			
		||||
                        rongQi.setG204(taskCount);
 | 
			
		||||
                        rqLtList.get(i).setG204(rqLtList.get(i).getG204()+gzzCount);
 | 
			
		||||
                        rongQiMz.getG204().setTaskCount(rongQiMz.getG204().getTaskCount()+taskCount);
 | 
			
		||||
                        rongQiMz.getG204().setLxCount(rongQiMz.getG204().getLxCount()+1);
 | 
			
		||||
                        break;
 | 
			
		||||
                    case "205":
 | 
			
		||||
                        rongQi.setG205(taskCount);
 | 
			
		||||
                        rqLtList.get(i).setG205(rqLtList.get(i).getG205()+gzzCount);
 | 
			
		||||
                        rongQiMz.getG205().setTaskCount(rongQiMz.getG205().getTaskCount()+taskCount);
 | 
			
		||||
                        rongQiMz.getG205().setLxCount(rongQiMz.getG205().getLxCount()+1);
 | 
			
		||||
                        break;
 | 
			
		||||
                    case "206":
 | 
			
		||||
                        rongQi.setG206(taskCount);
 | 
			
		||||
                        rqLtList.get(i).setG206(rqLtList.get(i).getG206()+gzzCount);
 | 
			
		||||
                        rongQiMz.getG206().setTaskCount(rongQiMz.getG206().getTaskCount()+taskCount);
 | 
			
		||||
                        rongQiMz.getG206().setLxCount(rongQiMz.getG206().getLxCount()+1);
 | 
			
		||||
                        break;
 | 
			
		||||
                    case "207":
 | 
			
		||||
                        rongQi.setG207(taskCount);
 | 
			
		||||
                        rqLtList.get(i).setG207(rqLtList.get(i).getG207()+gzzCount);
 | 
			
		||||
                        rongQiMz.getG207().setTaskCount(rongQiMz.getG207().getTaskCount()+taskCount);
 | 
			
		||||
                        rongQiMz.getG207().setLxCount(rongQiMz.getG207().getLxCount()+1);
 | 
			
		||||
                        break;
 | 
			
		||||
                    case "208":
 | 
			
		||||
                        rongQi.setG208(taskCount);
 | 
			
		||||
                        rqLtList.get(i).setG208(rqLtList.get(i).getG208()+gzzCount);
 | 
			
		||||
                        rongQiMz.getG208().setTaskCount(rongQiMz.getG208().getTaskCount()+taskCount);
 | 
			
		||||
                        rongQiMz.getG208().setLxCount(rongQiMz.getG208().getLxCount()+1);
 | 
			
		||||
                        break;
 | 
			
		||||
                    case "209":
 | 
			
		||||
                        rongQi.setG209(taskCount);
 | 
			
		||||
                        rqLtList.get(i).setG209(rqLtList.get(i).getG209()+gzzCount);
 | 
			
		||||
                        rongQiMz.getG209().setTaskCount(rongQiMz.getG209().getTaskCount()+taskCount);
 | 
			
		||||
                        rongQiMz.getG209().setLxCount(rongQiMz.getG209().getLxCount()+1);
 | 
			
		||||
                        break;
 | 
			
		||||
                    case "210":
 | 
			
		||||
                        rongQi.setG210(taskCount);
 | 
			
		||||
                        rqLtList.get(i).setG210(rqLtList.get(i).getG210()+gzzCount);
 | 
			
		||||
                        rongQiMz.getG210().setTaskCount(rongQiMz.getG210().getTaskCount()+taskCount);
 | 
			
		||||
                        rongQiMz.getG210().setLxCount(rongQiMz.getG210().getLxCount()+1);
 | 
			
		||||
                        break;
 | 
			
		||||
                    case "211":
 | 
			
		||||
                        rongQi.setG211(taskCount);
 | 
			
		||||
                        rqLtList.get(i).setG211(rqLtList.get(i).getG211()+gzzCount);
 | 
			
		||||
                        rongQiMz.getG211().setTaskCount(rongQiMz.getG211().getTaskCount()+taskCount);
 | 
			
		||||
                        rongQiMz.getG211().setLxCount(rongQiMz.getG211().getLxCount()+1);
 | 
			
		||||
                        break;
 | 
			
		||||
                    case "212":
 | 
			
		||||
                        rongQi.setG212(taskCount);
 | 
			
		||||
                        rqLtList.get(i).setG212(rqLtList.get(i).getG212()+gzzCount);
 | 
			
		||||
                        rongQiMz.getG212().setTaskCount(rongQiMz.getG212().getTaskCount()+taskCount);
 | 
			
		||||
                        rongQiMz.getG212().setLxCount(rongQiMz.getG212().getLxCount()+1);
 | 
			
		||||
                        break;
 | 
			
		||||
                    case "213":
 | 
			
		||||
                        rongQi.setG213(taskCount);
 | 
			
		||||
                        rqLtList.get(i).setG213(rqLtList.get(i).getG213()+gzzCount);
 | 
			
		||||
                        rongQiMz.getG213().setTaskCount(rongQiMz.getG213().getTaskCount()+taskCount);
 | 
			
		||||
                        rongQiMz.getG213().setLxCount(rongQiMz.getG213().getLxCount()+1);
 | 
			
		||||
                        break;
 | 
			
		||||
                    case "214":
 | 
			
		||||
                        rongQi.setG214(taskCount);
 | 
			
		||||
                        rqLtList.get(i).setG214(rqLtList.get(i).getG214()+gzzCount);
 | 
			
		||||
                        rongQiMz.getG214().setTaskCount(rongQiMz.getG214().getTaskCount()+taskCount);
 | 
			
		||||
                        rongQiMz.getG214().setLxCount(rongQiMz.getG214().getLxCount()+1);
 | 
			
		||||
                        break;
 | 
			
		||||
                    case "215":
 | 
			
		||||
                        rongQi.setG215(taskCount);
 | 
			
		||||
                        rqLtList.get(i).setG215(rqLtList.get(i).getG215()+gzzCount);
 | 
			
		||||
                        rongQiMz.getG215().setTaskCount(rongQiMz.getG215().getTaskCount()+taskCount);
 | 
			
		||||
                        rongQiMz.getG215().setLxCount(rongQiMz.getG215().getLxCount()+1);
 | 
			
		||||
                        break;
 | 
			
		||||
                    default:
 | 
			
		||||
                        break;
 | 
			
		||||
                }
 | 
			
		||||
                rqLtList.get(i).setTotal(rqLtList.get(i).getTotal()+gzzCount);
 | 
			
		||||
 | 
			
		||||
            }
 | 
			
		||||
            rqList.add(rongQi);
 | 
			
		||||
        }
 | 
			
		||||
        // 使用 Comparator 进行排序
 | 
			
		||||
        Collections.sort(rqList, new Comparator<RongQi>() {
 | 
			
		||||
            @Override
 | 
			
		||||
            public int compare(RongQi r1, RongQi r2) {
 | 
			
		||||
                return r1.getRqh().compareTo(r2.getRqh());
 | 
			
		||||
            }
 | 
			
		||||
        });
 | 
			
		||||
        JSONObject jsonF=new JSONObject();
 | 
			
		||||
        jsonF.accumulate("rqList", rqList);
 | 
			
		||||
        jsonF.accumulate("rqLtList", rqLtList);
 | 
			
		||||
        for (int i = 0; i < rqMzList.size(); i++) {
 | 
			
		||||
            RongQiMz rongQiMz=rqMzList.get(i);//工作站料箱数
 | 
			
		||||
            if (rongQiMz.getG201().getLxCount()!=0){
 | 
			
		||||
                rongQiMz.getG201().setMz(Math.round(rongQiMz.getG201().getTaskCount()/rongQiMz.getG201().getLxCount() * 100) / 100.0);
 | 
			
		||||
                rongQiMz.getTotal().setTaskCount(rongQiMz.getTotal().getTaskCount()+rongQiMz.getG201().getMz());
 | 
			
		||||
                rongQiMz.getTotal().setLxCount(rongQiMz.getTotal().getLxCount()+1);
 | 
			
		||||
            }
 | 
			
		||||
            if (rongQiMz.getG202().getLxCount()!=0) {
 | 
			
		||||
                rongQiMz.getG202().setMz(Math.round(rongQiMz.getG202().getTaskCount() / rongQiMz.getG202().getLxCount() * 100) / 100.0);
 | 
			
		||||
                rongQiMz.getTotal().setTaskCount(rongQiMz.getTotal().getTaskCount()+rongQiMz.getG202().getMz());
 | 
			
		||||
                rongQiMz.getTotal().setLxCount(rongQiMz.getTotal().getLxCount()+1);
 | 
			
		||||
            }
 | 
			
		||||
            if (rongQiMz.getG203().getLxCount()!=0) {
 | 
			
		||||
                rongQiMz.getG203().setMz(Math.round(rongQiMz.getG203().getTaskCount() / rongQiMz.getG203().getLxCount() * 100) / 100.0);
 | 
			
		||||
                rongQiMz.getTotal().setTaskCount(rongQiMz.getTotal().getTaskCount()+rongQiMz.getG201().getMz());
 | 
			
		||||
                rongQiMz.getTotal().setLxCount(rongQiMz.getTotal().getLxCount()+1);
 | 
			
		||||
            }
 | 
			
		||||
            if (rongQiMz.getG204().getLxCount()!=0) {
 | 
			
		||||
                rongQiMz.getG204().setMz(Math.round(rongQiMz.getG204().getTaskCount() / rongQiMz.getG204().getLxCount() * 100) / 100.0);
 | 
			
		||||
                rongQiMz.getTotal().setTaskCount(rongQiMz.getTotal().getTaskCount()+rongQiMz.getG201().getMz());
 | 
			
		||||
                rongQiMz.getTotal().setLxCount(rongQiMz.getTotal().getLxCount()+1);
 | 
			
		||||
            }
 | 
			
		||||
            if (rongQiMz.getG205().getLxCount()!=0) {
 | 
			
		||||
                rongQiMz.getG205().setMz(Math.round(rongQiMz.getG205().getTaskCount() / rongQiMz.getG205().getLxCount() * 100) / 100.0);
 | 
			
		||||
                rongQiMz.getTotal().setTaskCount(rongQiMz.getTotal().getTaskCount()+rongQiMz.getG205().getMz());
 | 
			
		||||
                rongQiMz.getTotal().setLxCount(rongQiMz.getTotal().getLxCount()+1);
 | 
			
		||||
            }
 | 
			
		||||
            if (rongQiMz.getG206().getLxCount()!=0) {
 | 
			
		||||
                rongQiMz.getG206().setMz(Math.round(rongQiMz.getG206().getTaskCount() / rongQiMz.getG206().getLxCount() * 100) / 100.0);
 | 
			
		||||
                rongQiMz.getTotal().setTaskCount(rongQiMz.getTotal().getTaskCount()+rongQiMz.getG206().getMz());
 | 
			
		||||
                rongQiMz.getTotal().setLxCount(rongQiMz.getTotal().getLxCount()+1);
 | 
			
		||||
            }
 | 
			
		||||
            if (rongQiMz.getG207().getLxCount()!=0) {
 | 
			
		||||
                rongQiMz.getG207().setMz(Math.round(rongQiMz.getG207().getTaskCount() / rongQiMz.getG207().getLxCount() * 100) / 100.0);
 | 
			
		||||
                rongQiMz.getTotal().setTaskCount(rongQiMz.getTotal().getTaskCount()+rongQiMz.getG207().getMz());
 | 
			
		||||
                rongQiMz.getTotal().setLxCount(rongQiMz.getTotal().getLxCount()+1);
 | 
			
		||||
            }
 | 
			
		||||
            if (rongQiMz.getG208().getLxCount()!=0) {
 | 
			
		||||
                rongQiMz.getG208().setMz(Math.round(rongQiMz.getG208().getTaskCount() / rongQiMz.getG208().getLxCount() * 100) / 100.0);
 | 
			
		||||
                rongQiMz.getTotal().setTaskCount(rongQiMz.getTotal().getTaskCount()+rongQiMz.getG208().getMz());
 | 
			
		||||
                rongQiMz.getTotal().setLxCount(rongQiMz.getTotal().getLxCount()+1);
 | 
			
		||||
            }
 | 
			
		||||
            if (rongQiMz.getG209().getLxCount()!=0) {
 | 
			
		||||
                rongQiMz.getG209().setMz(Math.round(rongQiMz.getG209().getTaskCount() / rongQiMz.getG209().getLxCount() * 100) / 100.0);
 | 
			
		||||
                rongQiMz.getTotal().setTaskCount(rongQiMz.getTotal().getTaskCount()+rongQiMz.getG209().getMz());
 | 
			
		||||
                rongQiMz.getTotal().setLxCount(rongQiMz.getTotal().getLxCount()+1);
 | 
			
		||||
            }
 | 
			
		||||
            if (rongQiMz.getG210().getLxCount()!=0) {
 | 
			
		||||
                rongQiMz.getG210().setMz(Math.round(rongQiMz.getG210().getTaskCount() / rongQiMz.getG210().getLxCount() * 100) / 100.0);
 | 
			
		||||
                rongQiMz.getTotal().setTaskCount(rongQiMz.getTotal().getTaskCount()+rongQiMz.getG210().getMz());
 | 
			
		||||
                rongQiMz.getTotal().setLxCount(rongQiMz.getTotal().getLxCount()+1);
 | 
			
		||||
            }
 | 
			
		||||
            if (rongQiMz.getG211().getLxCount()!=0) {
 | 
			
		||||
                rongQiMz.getG211().setMz(Math.round(rongQiMz.getG211().getTaskCount() / rongQiMz.getG211().getLxCount() * 100) / 100.0);
 | 
			
		||||
                rongQiMz.getTotal().setTaskCount(rongQiMz.getTotal().getTaskCount()+rongQiMz.getG211().getMz());
 | 
			
		||||
                rongQiMz.getTotal().setLxCount(rongQiMz.getTotal().getLxCount()+1);
 | 
			
		||||
            }
 | 
			
		||||
            if (rongQiMz.getG212().getLxCount()!=0) {
 | 
			
		||||
                rongQiMz.getG212().setMz(Math.round(rongQiMz.getG212().getTaskCount() / rongQiMz.getG212().getLxCount() * 100) / 100.0);
 | 
			
		||||
                rongQiMz.getTotal().setTaskCount(rongQiMz.getTotal().getTaskCount()+rongQiMz.getG212().getMz());
 | 
			
		||||
                rongQiMz.getTotal().setLxCount(rongQiMz.getTotal().getLxCount()+1);
 | 
			
		||||
            }
 | 
			
		||||
            if (rongQiMz.getG213().getLxCount()!=0) {
 | 
			
		||||
                rongQiMz.getG213().setMz(Math.round(rongQiMz.getG213().getTaskCount() / rongQiMz.getG213().getLxCount() * 100) / 100.0);
 | 
			
		||||
                rongQiMz.getTotal().setTaskCount(rongQiMz.getTotal().getTaskCount()+rongQiMz.getG213().getMz());
 | 
			
		||||
                rongQiMz.getTotal().setLxCount(rongQiMz.getTotal().getLxCount()+1);
 | 
			
		||||
            }
 | 
			
		||||
            if (rongQiMz.getG214().getLxCount()!=0) {
 | 
			
		||||
                rongQiMz.getG214().setMz(Math.round(rongQiMz.getG214().getTaskCount() / rongQiMz.getG214().getLxCount() * 100) / 100.0);
 | 
			
		||||
                rongQiMz.getTotal().setTaskCount(rongQiMz.getTotal().getTaskCount()+rongQiMz.getG214().getMz());
 | 
			
		||||
                rongQiMz.getTotal().setLxCount(rongQiMz.getTotal().getLxCount()+1);
 | 
			
		||||
            }
 | 
			
		||||
            if (rongQiMz.getG215().getLxCount()!=0) {
 | 
			
		||||
                rongQiMz.getG215().setMz(Math.round(rongQiMz.getG215().getTaskCount() / rongQiMz.getG215().getLxCount() * 100) / 100.0);
 | 
			
		||||
                rongQiMz.getTotal().setTaskCount(rongQiMz.getTotal().getTaskCount()+rongQiMz.getG215().getMz());
 | 
			
		||||
                rongQiMz.getTotal().setLxCount(rongQiMz.getTotal().getLxCount()+1);
 | 
			
		||||
            }
 | 
			
		||||
            if (rongQiMz.getTotal().getLxCount()!=0) {
 | 
			
		||||
                rongQiMz.getTotal().setMz(Math.round(rongQiMz.getTotal().getTaskCount() / rongQiMz.getTotal().getLxCount() * 100) / 100.0);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        jsonF.accumulate("rqMzList", rqMzList);
 | 
			
		||||
 | 
			
		||||
        Result result=Result.result(200,"操作成功",Long.parseLong(counts.get(0).toString()), jsonF);
 | 
			
		||||
 | 
			
		||||
        return result;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @PostMapping(value = "/download")
 | 
			
		||||
    public void exportCompany(HttpServletResponse response, @RequestBody String  json) throws Exception {
 | 
			
		||||
 | 
			
		||||
        QueryPageUtil query =new QueryPageUtil();
 | 
			
		||||
        JSONObject jsonObject= JSONUtil.parseObj(json);
 | 
			
		||||
        query.setPageSize((int)jsonObject.get("pageSize"));
 | 
			
		||||
        query.setPageNum((int)jsonObject.get("pageNum"));
 | 
			
		||||
 | 
			
		||||
        JSONObject param= (JSONObject)jsonObject.get("param");
 | 
			
		||||
 | 
			
		||||
        Xuliehao j = JSONUtil.toBean(param.toString(), Xuliehao.class);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        xuliehaoqingdan.download( (List<Map<String,Object>>)xuliehaoqingdan.QueryJson(query,j).getData(), response);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@Data
 | 
			
		||||
@Entity
 | 
			
		||||
class RongQi implements Serializable{
 | 
			
		||||
    @Id
 | 
			
		||||
    private Long id;
 | 
			
		||||
    /* 容器号*/
 | 
			
		||||
    private String rqh;
 | 
			
		||||
    private int g201=0;
 | 
			
		||||
    private int g202=0;
 | 
			
		||||
    private int g203=0;
 | 
			
		||||
    private int g204=0;
 | 
			
		||||
    private int g205=0;
 | 
			
		||||
    private int g206=0;
 | 
			
		||||
    private int g207=0;
 | 
			
		||||
    private int g208=0;
 | 
			
		||||
    private int g209=0;
 | 
			
		||||
    private int g210=0;
 | 
			
		||||
    private int g211=0;
 | 
			
		||||
    private int g212=0;
 | 
			
		||||
    private int g213=0;
 | 
			
		||||
    private int g214=0;
 | 
			
		||||
    private int g215=0;
 | 
			
		||||
}
 | 
			
		||||
@Data
 | 
			
		||||
@Entity
 | 
			
		||||
class RongQiLt implements Serializable{
 | 
			
		||||
    @Id
 | 
			
		||||
    private Long id;
 | 
			
		||||
    /* 容器号*/
 | 
			
		||||
    private String workstation;
 | 
			
		||||
    private int g201=0;
 | 
			
		||||
    private int g202=0;
 | 
			
		||||
    private int g203=0;
 | 
			
		||||
    private int g204=0;
 | 
			
		||||
    private int g205=0;
 | 
			
		||||
    private int g206=0;
 | 
			
		||||
    private int g207=0;
 | 
			
		||||
    private int g208=0;
 | 
			
		||||
    private int g209=0;
 | 
			
		||||
    private int g210=0;
 | 
			
		||||
    private int g211=0;
 | 
			
		||||
    private int g212=0;
 | 
			
		||||
    private int g213=0;
 | 
			
		||||
    private int g214=0;
 | 
			
		||||
    private int g215=0;
 | 
			
		||||
    private int total=0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@Data
 | 
			
		||||
@Entity
 | 
			
		||||
class RongQiMz implements Serializable {
 | 
			
		||||
    @Id
 | 
			
		||||
    private Long id;
 | 
			
		||||
    /* 容器号*/
 | 
			
		||||
    private String workstation;
 | 
			
		||||
    private RQMzModel g201=new RQMzModel();
 | 
			
		||||
    private RQMzModel g202=new RQMzModel();
 | 
			
		||||
    private RQMzModel g203=new RQMzModel();
 | 
			
		||||
    private RQMzModel g204=new RQMzModel();
 | 
			
		||||
    private RQMzModel g205=new RQMzModel();
 | 
			
		||||
    private RQMzModel g206=new RQMzModel();
 | 
			
		||||
    private RQMzModel g207=new RQMzModel();
 | 
			
		||||
    private RQMzModel g208=new RQMzModel();
 | 
			
		||||
    private RQMzModel g209=new RQMzModel();
 | 
			
		||||
    private RQMzModel g210=new RQMzModel();
 | 
			
		||||
    private RQMzModel g211=new RQMzModel();
 | 
			
		||||
    private RQMzModel g212=new RQMzModel();
 | 
			
		||||
    private RQMzModel g213=new RQMzModel();
 | 
			
		||||
    private RQMzModel g214=new RQMzModel();
 | 
			
		||||
    private RQMzModel g215=new RQMzModel();
 | 
			
		||||
    private RQMzModel total=new RQMzModel();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@Data
 | 
			
		||||
class RQMzModel implements Serializable {
 | 
			
		||||
    @Id
 | 
			
		||||
    private Long id;
 | 
			
		||||
    /*任务行*/
 | 
			
		||||
    private double taskCount=0;
 | 
			
		||||
    /*料箱数*/
 | 
			
		||||
    private double lxCount=0;
 | 
			
		||||
    /*命中率*/
 | 
			
		||||
    private double mz=0;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -34,7 +34,7 @@ public class UserController {
 | 
			
		|||
    public Result login(@RequestBody String user) {
 | 
			
		||||
        JSONArray array=new JSONArray();
 | 
			
		||||
        JSONObject data=new JSONObject();
 | 
			
		||||
        int menuCount=12;
 | 
			
		||||
        int menuCount=13;
 | 
			
		||||
        for (int i=1;i<=menuCount;i++){
 | 
			
		||||
            JSONObject menu=new JSONObject();
 | 
			
		||||
            menu.put("id",i);
 | 
			
		||||
| 
						 | 
				
			
			@ -87,6 +87,10 @@ public class UserController {
 | 
			
		|||
                menu.put("menuName", "人效管理");
 | 
			
		||||
                menu.put("menuComponent","/RenXiao");
 | 
			
		||||
                menu.put("menuClick","RenXiao");
 | 
			
		||||
            }else if(i==13) {
 | 
			
		||||
                menu.put("menuName", "容器流通");
 | 
			
		||||
                menu.put("menuComponent","/RongQi");
 | 
			
		||||
                menu.put("menuClick","RongQi");
 | 
			
		||||
            }
 | 
			
		||||
            menu.put("menuLevel",i);
 | 
			
		||||
            menu.put("menuParentCode",i);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -13,7 +13,7 @@ server:
 | 
			
		|||
spring:
 | 
			
		||||
  datasource:
 | 
			
		||||
#    url: jdbc:sqlserver://10.1.96.105:1433;DatabaseName=LD_WMSDB
 | 
			
		||||
    url: jdbc:sqlserver://47.103.100.52:1433;DatabaseName=zwtest
 | 
			
		||||
    url: jdbc:sqlserver://47.103.100.52:1433;DatabaseName=zwlgtest
 | 
			
		||||
    driver-class-name:  com.microsoft.sqlserver.jdbc.SQLServerDriver
 | 
			
		||||
#    username: wmsdb
 | 
			
		||||
#    password: AmecDDbb32A
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue