| | |
| | | import com.core.common.R; |
| | | import com.sun.org.apache.bcel.internal.generic.NEW; |
| | | import com.zy.asrs.entity.LocNormal; |
| | | import com.zy.asrs.entity.LocNormalReport; |
| | | import com.zy.asrs.entity.param.LocNormalParam; |
| | | import com.zy.asrs.service.LocNormalReportService; |
| | | import com.zy.asrs.service.LocNormalService; |
| | | import com.zy.common.utils.excel.locNomal.LocNormalExcel; |
| | | import com.zy.common.utils.excel.locNomal.LocNormalExcelListener; |
| | |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.io.IOException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | |
| | | public class LocNormalController extends BaseController { |
| | | @Autowired |
| | | private LocNormalService locNormalService; |
| | | @Autowired |
| | | private LocNormalReportService locNormalReportService; |
| | | |
| | | @RequestMapping(value = "/locNomal/list/auth") |
| | | @ManagerAuth |
| | |
| | | locNormalService.pdaLocNormalMove(list); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/locNomal/getInListByDay") |
| | | @ManagerAuth(memo = "平仓日出入库查询") |
| | | public R getInListByDay(@RequestParam(defaultValue = "1") Integer curr, |
| | | @RequestParam(defaultValue = "10") Integer limit, |
| | | @RequestParam(required = false) String orderByField, |
| | | @RequestParam(required = false) String orderByType, |
| | | @RequestParam(required = false) String condition, |
| | | @RequestParam Map<String, Object> param) { |
| | | excludeTrash(param); |
| | | EntityWrapper<LocNormalReport> wrapper = new EntityWrapper<>(); |
| | | List<String> orderList = new ArrayList<>(); |
| | | orderList.add("time"); |
| | | wrapper.eq("state", param.get("state").toString()).orderDesc(orderList); |
| | | String timeRange = ""; |
| | | String time1 = ""; |
| | | String time2 = ""; |
| | | if (!Cools.isEmpty(param.get("query_date"))) { |
| | | timeRange = param.get("query_date").toString(); |
| | | time1 = timeRange.substring(0, 19); |
| | | time2 = timeRange.substring(21, timeRange.length()); |
| | | } |
| | | param.remove("query_date"); |
| | | convert(param, wrapper); |
| | | if (time1 != "" && time2 != "") { |
| | | SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | Date dateTime1 = new Date(); |
| | | Date dateTime2 = new Date(); |
| | | try { |
| | | dateTime1 = formatter.parse(time1); |
| | | dateTime2 = formatter.parse(time2); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | wrapper.ge("time", dateTime1).and().le("time", dateTime2); |
| | | } |
| | | allLike(LocNormalReport.class, param.keySet(), wrapper, condition); |
| | | return R.ok(locNormalReportService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | } |
New file |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.core.common.Cools; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.system.entity.User; |
| | | import com.zy.system.service.UserService; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @TableName("asr_loc_normal_report") |
| | | public class LocNormalReport implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value= "物料") |
| | | @TableId(value = "matnr", type = IdType.INPUT) |
| | | private String matnr; |
| | | |
| | | @ApiModelProperty(value= "物料描述") |
| | | private String maktx; |
| | | |
| | | @ApiModelProperty(value= "规格") |
| | | private String lgnum; |
| | | |
| | | @ApiModelProperty(value= "物料类别") |
| | | private String type; |
| | | |
| | | @ApiModelProperty(value= "助记码") |
| | | private String mnemonic; |
| | | |
| | | @ApiModelProperty(value= "通知单号") |
| | | private String supplier; |
| | | |
| | | @ApiModelProperty(value= "仓库") |
| | | private String warehouse; |
| | | |
| | | @TableField(exist = false) |
| | | private String warehouseName; |
| | | |
| | | @ApiModelProperty(value= "数量") |
| | | private BigDecimal anfme; |
| | | |
| | | @ApiModelProperty(value= "单位") |
| | | private String altme; |
| | | |
| | | @ApiModelProperty(value= "备注") |
| | | private String memo; |
| | | |
| | | @ApiModelProperty(value= "出/入库时间") |
| | | private Date time; |
| | | |
| | | @ApiModelProperty(value= "物料出入库状态") |
| | | @TableField("state") |
| | | private String state; |
| | | |
| | | public String getAppeTime$(){ |
| | | if (Cools.isEmpty(this.time)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.time); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.zy.asrs.entity.LocNormal; |
| | | import com.zy.asrs.entity.LocNormalReport; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface LocNormalReportMapper extends BaseMapper<LocNormalReport> { |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.zy.asrs.entity.LocNormal; |
| | | import com.zy.asrs.entity.LocNormalReport; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | public interface LocNormalReportService extends IService<LocNormalReport> { |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.core.common.Cools; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.LocNormalReport; |
| | | |
| | | import com.zy.asrs.mapper.LocNormalReportMapper; |
| | | |
| | | import com.zy.asrs.service.LocNormalReportService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.text.MessageFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Slf4j |
| | | @Service("locNormalReportService") |
| | | public class LocNormalReportServiceImpl extends ServiceImpl<LocNormalReportMapper, LocNormalReport> implements LocNormalReportService { |
| | | |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.zy.asrs.mapper.LocNormalReportMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.zy.asrs.entity.LocNormalReport"> |
| | | <result column="matnr" property="matnr"/> |
| | | <result column="maktx" property="maktx"/> |
| | | <result column="lgnum" property="lgnum"/> |
| | | <result column="type" property="type"/> |
| | | <result column="mnemonic" property="mnemonic"/> |
| | | <result column="supplier" property="supplier"/> |
| | | <result column="warehouse" property="warehouse"/> |
| | | <result column="warehouseName" property="warehouseName"/> |
| | | <result column="anfme" property="anfme"/> |
| | | <result column="memo" property="memo"/> |
| | | <result column="time" property="time"/> |
| | | <result column="state" property="state"/> |
| | | </resultMap> |
| | | |
| | | </mapper> |
New file |
| | |
| | | var pageCurr; |
| | | var locNormalList = []; |
| | | var locArea = []; |
| | | |
| | | function getCol() { |
| | | var cols = []; |
| | | cols.push( |
| | | {field: 'appeTime$', align: 'center', title: '出入库时间', width: 180} |
| | | , {field: 'warehouse', align: 'center', title: '库区'} |
| | | , {field: 'matnr', align: 'center', title: '物料编码'} |
| | | , {field: 'maktx', align: 'center', title: '物料名称', width: 400} |
| | | , {field: 'lgnum', align: 'center', title: '规格'} |
| | | , {field: 'type', align: 'center', title: '物料类别'} |
| | | , {field: 'mnemonic', align: 'center', title: '生产单号'} |
| | | , {field: 'supplier', align: 'center', title: '通知单号'} |
| | | , {field: 'altme', align: 'center', title: '单位', hide: true} |
| | | , {field: 'anfme', align: 'center', title: '数量'} |
| | | ) |
| | | return cols; |
| | | } |
| | | |
| | | // 获取仓库下拉 |
| | | $.ajax({ |
| | | url: baseUrl + "/locArea/queryAll/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | // data: top.reObject(data), |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.data && res.data.length > 0) { |
| | | locArea = res.data; |
| | | } |
| | | }, |
| | | }); |
| | | |
| | | // 库区下拉 |
| | | // 获取仓库下拉 |
| | | $.ajax({ |
| | | url: baseUrl + "/locArea/queryAll/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | var html = ""; |
| | | if (res.data && res.data.length > 0) { |
| | | html += res.data.map(function (item) { |
| | | return "<Option value=" + item.uuid + ">" + item.name + "</Option>"; |
| | | }); |
| | | } |
| | | $('#putSiteSelect').append(html); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }) |
| | | |
| | | layui.use(['table', 'laydate', 'form', 'upload'], function () { |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var layDate = layui.laydate; |
| | | var form = layui.form; |
| | | var upload = layui.upload; |
| | | |
| | | // 数据渲染 |
| | | tableIns = table.render({ |
| | | elem: '#locNormal', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl + '/locNomal/getInListByDay', |
| | | where: { |
| | | state: '1', |
| | | }, |
| | | page: true, |
| | | limit: 16, |
| | | limits: [16, 30, 50, 100, 200, 500], |
| | | even: true, |
| | | toolbar: '#toolbar', |
| | | cellMinWidth: 50, |
| | | cols: [getCol()], |
| | | request: { |
| | | pageName: 'curr', |
| | | pageSize: 'limit' |
| | | }, |
| | | parseData: function (res) { |
| | | // 解析库区名称 |
| | | var records = res.data.records; |
| | | records.map(function (item) { |
| | | locArea.map(function (d) { |
| | | if (d.uuid == item.warehouse) { |
| | | item.warehouse = d.name; |
| | | } |
| | | }) |
| | | }); |
| | | return { |
| | | 'code': res.code, |
| | | 'msg': res.msg, |
| | | 'count': res.data.total, |
| | | 'data': res.data.records, |
| | | } |
| | | }, |
| | | response: { |
| | | statusCode: 200 |
| | | }, |
| | | done: function (res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } |
| | | pageCurr = curr; |
| | | limit(); |
| | | // 当前分页数据存储 |
| | | locNormalList = res.data; |
| | | } |
| | | }); |
| | | |
| | | // 搜索栏重置事件 |
| | | form.on('submit(reset)', function (data) { |
| | | pageCurr = 1; |
| | | clearFormVal($('#search-box')); |
| | | tableReload(false); |
| | | }); |
| | | |
| | | // 搜索栏搜索事件 |
| | | form.on('submit(search)', function (data) { |
| | | pageCurr = 1; |
| | | tableReload(false); |
| | | }); |
| | | |
| | | layDate.render({ |
| | | elem: '.layui-laydate-range' |
| | | , type: 'datetime' |
| | | , range: true |
| | | }); |
| | | }); |
| | | |
| | | /* 表格数据重载 */ |
| | | function tableReload(child) { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function () { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | (child ? parent.tableIns : tableIns).reload({ |
| | | where: searchData, |
| | | page: { |
| | | curr: pageCurr |
| | | }, |
| | | done: function (res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } |
| | | pageCurr = curr; |
| | | if (res.data.length === 0 && count !== 0) { |
| | | tableIns.reload({ |
| | | where: searchData, |
| | | page: { |
| | | curr: pageCurr - 1 |
| | | } |
| | | }); |
| | | pageCurr -= 1; |
| | | } |
| | | limit(child); |
| | | // 当前分页数据存储 |
| | | locNormalList = res.data; |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /* 监听回车事件 */ |
| | | $('body').keydown(function () { |
| | | if (event.keyCode === 13) { |
| | | $("#search").click(); |
| | | } |
| | | }); |
| | | |
| | | |
New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="en"> |
| | | <head> |
| | | <meta charset="utf-8"> |
| | | <title></title> |
| | | <meta name="renderer" content="webkit"> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> |
| | | <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/cool.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/common.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/print.css" media="all"> |
| | | </head> |
| | | <style> |
| | | #search-box { |
| | | padding: 30px 30px 10px 30px; |
| | | } |
| | | |
| | | #search-box .layui-inline { |
| | | margin-right: 5px; |
| | | } |
| | | |
| | | #data-search-btn { |
| | | margin-top: 10px; |
| | | } |
| | | |
| | | #data-search-btn.layui-btn-container .layui-btn { |
| | | margin-right: 20px; |
| | | } |
| | | |
| | | .btn-print { |
| | | display: none; |
| | | } |
| | | |
| | | #btn-print-batch { |
| | | display: none; |
| | | } |
| | | |
| | | .layui-btn-danger { |
| | | background-color: lightsalmon; |
| | | color: #333; |
| | | } |
| | | |
| | | /* ------------------------- 打印表格 ----------------------- */ |
| | | .template-preview { |
| | | height: 200px; |
| | | display: inline-block; |
| | | } |
| | | |
| | | .contain { |
| | | } |
| | | |
| | | .contain td { |
| | | border: 1px solid #000; |
| | | /*line-height: 46px;*/ |
| | | } |
| | | |
| | | .function-area { |
| | | padding: 15px 0 20px 40px; |
| | | } |
| | | |
| | | .function-btn { |
| | | font-size: 16px; |
| | | padding: 1px 1px 1px 1px; |
| | | width: 120px; |
| | | height: 40px; |
| | | border-color: #2b425b; |
| | | border-radius: 4px; |
| | | border-width: 1px; |
| | | background: none; |
| | | border-style: solid; |
| | | transition: 0.4s; |
| | | cursor: pointer; |
| | | } |
| | | |
| | | .function-btn:hover { |
| | | background-color: #2b425b; |
| | | color: #fff; |
| | | } |
| | | |
| | | #btn-locNormal-into { |
| | | display: none; |
| | | } |
| | | |
| | | .btn-out { |
| | | display: none; |
| | | } |
| | | |
| | | .btn-remove { |
| | | display: none; |
| | | } |
| | | |
| | | </style> |
| | | <body> |
| | | <div> |
| | | <!-- 搜索栏 --> |
| | | <div id="search-box" class="layui-form layui-card-header"> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="matnr" placeholder="物料编码" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="condition" placeholder="请输入" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width: 150px; margin-top: 4px"> |
| | | <select id="putSiteSelect" name="warehouse"> |
| | | <option value="">请选择库区</option> |
| | | </select> |
| | | </div> |
| | | |
| | | <div class="layui-inline" style="width: 150px; margin-top: 4px"> |
| | | <select id="state" name="state"> |
| | | <option value="1">入库</option> |
| | | <option value="2">出库</option> |
| | | </select> |
| | | </div> |
| | | |
| | | <div class="layui-inline" style="width: 300px"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input layui-laydate-range" name="query_date" type="text" placeholder="起始时间 - 终止时间" autocomplete="off" style="width: 300px"> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- 待添加 --> |
| | | <div id="data-search-btn" class="layui-btn-container layui-form-item" style="display: inline-block"> |
| | | <button id="search" class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="search">搜索 |
| | | </button> |
| | | <button id="reset" class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="reset">重置 |
| | | </button> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- 表格 --> |
| | | <div class="layui-form"> |
| | | <table class="layui-hide" id="locNormal" lay-filter="locNormal"></table> |
| | | </div> |
| | | |
| | | <script type="text/html" id="locArea"> |
| | | {{ |
| | | locArea.map(function(item){ |
| | | if (d.warehouse == item.uuid) { |
| | | return item.name; |
| | | } |
| | | }); |
| | | }} |
| | | </script> |
| | | |
| | | </div> |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/handlebars/handlebars-v4.5.3.js"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/locNormal/normalReport.js"></script> |
| | | </body> |
| | | </html> |