| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.net.URLEncoder; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/order/printExport/auth") |
| | | // @ManagerAuth(memo = "盘点单导出") |
| | | public void export(HttpServletResponse response, @RequestParam String orderNo) throws IOException { |
| | | //从数据库查询数据 |
| | | EntityWrapper<OrderDetl> locCheckEntityWrapper = new EntityWrapper<>(); |
| | | locCheckEntityWrapper.eq("order_no",orderNo); |
| | | List<OrderDetl> list = orderDetlService.selectList(locCheckEntityWrapper); |
| | | |
| | | response.setContentType("application/vnd.ms-excel"); |
| | | response.setCharacterEncoding("utf-8"); |
| | | String fileName = URLEncoder.encode("单据", "UTF-8"); |
| | | response.setHeader("Content-disposition", "attachment;filename=" + fileName+ orderNo + ".xlsx"); |
| | | Set<String> includeColumnFiledNames = new HashSet<String>(); |
| | | includeColumnFiledNames.add("orderNo"); |
| | | includeColumnFiledNames.add("matnr"); |
| | | includeColumnFiledNames.add("maktx"); |
| | | includeColumnFiledNames.add("specs"); |
| | | includeColumnFiledNames.add("owner"); |
| | | includeColumnFiledNames.add("payment"); |
| | | includeColumnFiledNames.add("anfme"); |
| | | includeColumnFiledNames.add("qty"); |
| | | includeColumnFiledNames.add("workQty"); |
| | | includeColumnFiledNames.add("weight"); |
| | | EasyExcel.write(response.getOutputStream(), OrderDetl.class) |
| | | .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) |
| | | .includeColumnFiledNames(includeColumnFiledNames) |
| | | .sheet("表1") |
| | | .doWrite(list); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.net.URLEncoder; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/orderLog/printExport/auth") |
| | | // @ManagerAuth(memo = "盘点单导出") |
| | | public void export(HttpServletResponse response, @RequestParam String orderNo) throws IOException { |
| | | //从数据库查询数据 |
| | | EntityWrapper<OrderDetlLog> locCheckEntityWrapper = new EntityWrapper<>(); |
| | | locCheckEntityWrapper.eq("order_no",orderNo); |
| | | List<OrderDetlLog> list = orderDetlLogService.selectList(locCheckEntityWrapper); |
| | | |
| | | response.setContentType("application/vnd.ms-excel"); |
| | | response.setCharacterEncoding("utf-8"); |
| | | String fileName = URLEncoder.encode("单据", "UTF-8"); |
| | | response.setHeader("Content-disposition", "attachment;filename=" + fileName+ orderNo + ".xlsx"); |
| | | Set<String> includeColumnFiledNames = new HashSet<String>(); |
| | | includeColumnFiledNames.add("orderNo"); |
| | | includeColumnFiledNames.add("matnr"); |
| | | includeColumnFiledNames.add("maktx"); |
| | | includeColumnFiledNames.add("specs"); |
| | | includeColumnFiledNames.add("owner"); |
| | | includeColumnFiledNames.add("payment"); |
| | | includeColumnFiledNames.add("anfme"); |
| | | includeColumnFiledNames.add("qty"); |
| | | includeColumnFiledNames.add("workQty"); |
| | | includeColumnFiledNames.add("weight"); |
| | | EasyExcel.write(response.getOutputStream(), OrderDetl.class) |
| | | .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) |
| | | .includeColumnFiledNames(includeColumnFiledNames) |
| | | .sheet("表1") |
| | | .doWrite(list); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | |
| | | */ |
| | | @ApiModelProperty(value= "单据编号") |
| | | @TableField("order_no") |
| | | @ExcelProperty({"单据", "单据编号"}) |
| | | private String orderNo; |
| | | |
| | | |
| | |
| | | * 数量 |
| | | */ |
| | | @ApiModelProperty(value= "数量") |
| | | @ExcelProperty({"单据", "数量"}) |
| | | private Double anfme; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @ApiModelProperty(value= "作业数量") |
| | | @TableField("work_qty") |
| | | @ExcelProperty({"单据", "作业数量"}) |
| | | private Double workQty; |
| | | |
| | | /** |
| | |
| | | * 出库 : qty 👆 |
| | | */ |
| | | @ApiModelProperty(value= "完成数量") |
| | | @ExcelProperty({"单据", "完成数量"}) |
| | | private Double qty; |
| | | |
| | | /** |
| | | * 商品编码 |
| | | */ |
| | | @ApiModelProperty(value= "商品编码") |
| | | @ExcelProperty({"单据", "商品编码"}) |
| | | private String matnr; |
| | | |
| | | /** |
| | | * 商品名称 |
| | | */ |
| | | @ApiModelProperty(value= "商品名称") |
| | | @ExcelProperty({"单据", "商品名称"}) |
| | | private String maktx; |
| | | |
| | | /** |
| | |
| | | * 规格 |
| | | */ |
| | | @ApiModelProperty(value= "规格") |
| | | @ExcelProperty({"单据", "规格"}) |
| | | private String specs; |
| | | |
| | | /** |
| | |
| | | * 重量 |
| | | */ |
| | | @ApiModelProperty(value= "重量") |
| | | @ExcelProperty({"单据", "重量"}) |
| | | private Double weight; |
| | | |
| | | /** |
| | |
| | | * 拥有者 |
| | | */ |
| | | @ApiModelProperty(value= "拥有者 1: 杰克 ") |
| | | @ExcelProperty({"单据", "货主ID"}) |
| | | private Integer owner; |
| | | |
| | | /** |
| | | * 货物形态:0:代采、1:仓储 |
| | | */ |
| | | @ApiModelProperty(value= "货物形态:0:代采、1:仓储") |
| | | @ExcelProperty({"单据", "货物形态ID"}) |
| | | private Integer payment; |
| | | |
| | | /** |
| | |
| | | ,{field: 'maktx', align: 'center',title: '商品名称', width: 200} |
| | | // ,{field: 'name', align: 'center',title: '别名'} |
| | | ,{field: 'specs', align: 'center',title: '规格'} |
| | | ,{field: 'model', align: 'center',title: '代码', hide: false} |
| | | ,{field: 'model', align: 'center',title: '代码', hide: true} |
| | | ,{field: 'color', align: 'center',title: '颜色', hide: true} |
| | | ,{field: 'brand', align: 'center',title: '品牌', hide: true} |
| | | ,{field: 'unit', align: 'center',title: '单位', hide: true} |
| | |
| | | ,{field: 'manuDate', align: 'center',title: '生产日期', hide: true} |
| | | ,{field: 'itemNum', align: 'center',title: '品项数', hide: true} |
| | | ,{field: 'safeQty', align: 'center',title: '安全库存量', hide: true} |
| | | ,{field: 'weight', align: 'center',title: '单箱净重', hide: false} |
| | | ,{field: 'length', align: 'center',title: '单箱毛重', hide: false} |
| | | ,{field: 'volume', align: 'center',title: '单箱体积', hide: false} |
| | | ,{field: 'threeCode', align: 'center',title: '箱子尺寸', hide: false} |
| | | ,{field: 'weight', align: 'center',title: '单箱净重', hide: true} |
| | | ,{field: 'length', align: 'center',title: '单箱毛重', hide: true} |
| | | ,{field: 'volume', align: 'center',title: '单箱体积', hide: true} |
| | | ,{field: 'threeCode', align: 'center',title: '箱子尺寸', hide: true} |
| | | ,{field: 'supp', align: 'center',title: '供应商', hide: true} |
| | | ,{field: 'suppCode', align: 'center',title: '供应商编码', hide: true} |
| | | ,{field: 'beBatch$', align: 'center',title: '是否批次', hide: true} |
| | |
| | | // {field: 'inQty', title: '已入库量'}, |
| | | // {field: 'color', title: '颜色'}, |
| | | // {field: 'specs', title: '规格'}, |
| | | // {field: 'weight', title: '重量'} |
| | | {field: 'weight', title: '重量'} |
| | | ]], |
| | | request: { |
| | | pageName: 'curr', |
| | |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | else if (layEvent === 'printExcel'){ |
| | | printExcel(data); |
| | | } |
| | | }); |
| | | |
| | |
| | | {type: 'numbers', title: '#'}, |
| | | {field: 'matnr', title: '商品编码', width: 160}, |
| | | {field: 'maktx', title: '商品名称', width: 200}, |
| | | {field: 'batch', title: '批号', edit: true}, |
| | | {field: 'specs', title: '规格'}, |
| | | {field: 'weight', title: '重量', edit: true}, |
| | | {field: 'anfme', title: '数量(修改)', style: 'color: blue;font-weight: bold', edit: true, minWidth: 110, width: 110}, |
| | | {field: 'owner', title: '货主编号', style: 'color: blue;font-weight: bold', edit: true, minWidth: 110, width: 110}, |
| | | {field: 'payment', title: '货物状态', style: 'color: blue;font-weight: bold', templet: '#payment'}, |
| | |
| | | ,range: true |
| | | }); |
| | | |
| | | function printExcel(data){ |
| | | layer.confirm('确定导出Excel吗', {shadeClose: true}, function(){ |
| | | layer.closeAll(); |
| | | layer.load(1, {shade: [0.1,'#fff']}); |
| | | // location.href = "http://192.168.4.121:8082/stwms/orderCheck/printExport/auth?orderNo="+data.orderNo; |
| | | location.href = "http://10.114.97.100:8080/stwms/order/printExport/auth?orderNo="+data.orderNo; |
| | | layer.closeAll('loading'); |
| | | }); |
| | | } |
| | | |
| | | |
| | | |
| | | }); |
| | |
| | | {align: 'center', title: '明细', toolbar: '#tbLook', minWidth: 160}, |
| | | {field: 'createTime$', title: '创建时间', minWidth: 200}, |
| | | {field: 'settle$', align: 'center', title: '状态', templet: '#settleTpl', minWidth: 160}, |
| | | {field: 'memo', align: 'center',title: '备注', hide: true} |
| | | |
| | | {field: 'memo', align: 'center',title: '备注', hide: true}, |
| | | {align: 'center', title: '操作', toolbar: '#operate', width: 260} |
| | | ]], |
| | | request: { |
| | | pageName: 'curr', |
| | |
| | | {field: 'anfme', title: '数量'}, |
| | | {field: 'workQty', title: '作业数量'}, |
| | | {field: 'qty', title: '完成数量', style: 'font-weight: bold'}, |
| | | {field: 'owner$', title: '规格'}, |
| | | {field: 'payment$', title: '规格'} |
| | | {field: 'owner$', title: '货主'}, |
| | | {field: 'payment$', title: '货物形态'}, |
| | | {field: 'weight', title: '重量'} |
| | | ]], |
| | | request: { |
| | | pageName: 'curr', |
| | |
| | | }); |
| | | }else if (layEvent === 'wrkTrace'){ |
| | | showWrkTrace(data.id); |
| | | } |
| | | else if (layEvent === 'printExcel'){ |
| | | printExcel(data); |
| | | } |
| | | }); |
| | | |
| | |
| | | } |
| | | }) |
| | | } |
| | | function printExcel(data){ |
| | | layer.confirm('确定导出Excel吗', {shadeClose: true}, function(){ |
| | | layer.closeAll(); |
| | | layer.load(1, {shade: [0.1,'#fff']}); |
| | | // location.href = "http://192.168.4.121:8082/stwms/orderCheck/printExport/auth?orderNo="+data.orderNo; |
| | | location.href = "http://10.114.97.100:8080/stwms/orderLog/printExport/auth?orderNo="+data.orderNo; |
| | | layer.closeAll('loading'); |
| | | }); |
| | | } |
| | | }); |
| | |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">单箱净重</label> |
| | | <div class="layui-input-block"> |
| | | <input name="weight" placeholder="请输入单箱净重格" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <!-- <div class="layui-form-item">--> |
| | | <!-- <label class="layui-form-label">单箱净重</label>--> |
| | | <!-- <div class="layui-input-block">--> |
| | | <!-- <input name="weight" placeholder="请输入单箱净重格" class="layui-input">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">单箱体积</label> |
| | | <div class="layui-input-block"> |
| | | <input name="volume" placeholder="请输入单箱体积" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <!-- <div class="layui-form-item">--> |
| | | <!-- <label class="layui-form-label">单箱体积</label>--> |
| | | <!-- <div class="layui-input-block">--> |
| | | <!-- <input name="volume" placeholder="请输入单箱体积" class="layui-input">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | |
| | | </div> |
| | | |
| | |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">单箱毛重</label> |
| | | <div class="layui-input-block"> |
| | | <input name="length" placeholder="请输入单箱毛重" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <!-- <div class="layui-form-item">--> |
| | | <!-- <label class="layui-form-label">单箱毛重</label>--> |
| | | <!-- <div class="layui-input-block">--> |
| | | <!-- <input name="length" placeholder="请输入单箱毛重" class="layui-input">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">单箱体积</label> |
| | | <div class="layui-input-block"> |
| | | <input name="threeCode" placeholder="请输入箱子尺寸" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <!-- <div class="layui-form-item">--> |
| | | <!-- <label class="layui-form-label">单箱体积</label>--> |
| | | <!-- <div class="layui-input-block">--> |
| | | <!-- <input name="threeCode" placeholder="请输入箱子尺寸" class="layui-input">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | |
| | | </div> |
| | | </div> |
| | |
| | | <div id="box" style="display: block"></div> |
| | | <!-- 表格操作列 --> |
| | | <script type="text/html" id="operate"> |
| | | <a class="layui-btn layui-btn-primary layui-border-blue layui-btn-xs btn-complete" lay-event="printExcel">导出Excel</a> |
| | | {{# if (d.settle == 0 || d.settle == 1) { }} |
| | | <a class="layui-btn layui-btn-primary layui-btn-xs btn-edit" lay-event="edit">修改</a> |
| | | <a class="layui-btn layui-btn-danger layui-btn-xs btn-delete" lay-event="del">删除</a> |
| | |
| | | </div> |
| | | <!-- 表格操作列 --> |
| | | <script type="text/html" id="operate"> |
| | | {{# if (d.settle == 0 || d.settle == 1) { }} |
| | | <a class="layui-btn layui-btn-primary layui-btn-xs btn-edit" lay-event="edit">修改</a> |
| | | <a class="layui-btn layui-btn-danger layui-btn-xs btn-delete" lay-event="del">删除</a> |
| | | {{# } }} |
| | | {{# if ((d.settle == 0 || d.settle == 1) && (d.docType == 21 || d.docType == 11 || d.docType == 12)) { }} |
| | | <a class="layui-btn layui-btn-primary layui-border-blue layui-btn-xs btn-complete" lay-event="manPrint">生成拣货单</a> |
| | | {{# } }} |
| | | {{# if (d.settle == 2) { }} |
| | | <a class="layui-btn layui-btn-primary layui-border-blue layui-btn-xs btn-complete" lay-event="complete">完结</a> |
| | | {{# } }} |
| | | <a class="layui-btn layui-btn-primary layui-border-blue layui-btn-xs btn-complete" lay-event="btnPrint">打印</a> |
| | | <a class="layui-btn layui-btn-primary layui-border-blue layui-btn-xs btn-complete" lay-event="printExcel">导出Excel</a> |
| | | </script> |
| | | <!-- 表格操作列 --> |
| | | <script type="text/html" id="tbLook"> |