| | |
| | | return R.ok("成功导入" + listener.getTotal() + "条物料信息"); |
| | | } |
| | | |
| | | /* 导出 */ |
| | | @RequestMapping(value = "/locNormal/export/auth") |
| | | @ManagerAuth(memo = "平仓管理导出") |
| | | public R export(@RequestBody JSONObject param){ |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | EntityWrapper<LocNormal> wrapper = new EntityWrapper<LocNormal>(); |
| | | wrapper.ne("state", "3"); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("exportData")); |
| | | convert(map, wrapper); |
| | | List<LocNormal> list = locNormalService.selectList(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | /* 平仓入库 成品 */ |
| | | @RequestMapping(value = "/locNormal/in") |
| | | @ManagerAuth(memo = "平仓入库") |
| | |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.zy.asrs.service.LocMastService; |
| | | import com.zy.system.entity.User; |
| | | import com.zy.system.service.UserService; |
| | | import com.zy.asrs.service.LocAreaService; |
| | | import com.core.common.Cools; |
| | | import com.core.common.SpringUtils; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | @TableField(exist = false) |
| | | private String warehouseName; |
| | | |
| | | @TableField(exist = false) |
| | | private String warehouse$; |
| | | |
| | | @ApiModelProperty(value= "品牌") |
| | | private String brand; |
| | | |
| | |
| | | private String state; |
| | | |
| | | @TableField(exist = false) |
| | | private String getState$; |
| | | |
| | | @TableField(exist = false) |
| | | private BigDecimal anfmeOut; |
| | | |
| | | public String getModiUser$(){ |
| | |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.appeTime); |
| | | } |
| | | |
| | | public String getWarehouse$() { |
| | | LocAreaService warehouse = SpringUtils.getBean(LocAreaService.class); |
| | | LocArea warehouseName = warehouse.selectOne(new EntityWrapper<LocArea>().eq("uuid", this.warehouse)); |
| | | if (!Cools.isEmpty(warehouseName)){ |
| | | return String.valueOf(warehouseName.getName()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getState$() { |
| | | String txt = ""; |
| | | switch (this.state) { |
| | | case "1": |
| | | txt = "已入库"; |
| | | break; |
| | | case "2": |
| | | txt = "已出库"; |
| | | break; |
| | | } |
| | | return txt; |
| | | } |
| | | |
| | | } |
| | |
| | | cols.push.apply(cols, locNormalCols); |
| | | cols.push( |
| | | {field: 'warehouse$', align: 'center', title: '库区'} |
| | | , {field: 'state', align: 'center', title: '出入库状态', templet: '#locNormalState'} |
| | | , {field: 'state$', align: 'center', title: '出入库状态', templet: '#locNormalState'} |
| | | , {field: 'modiUser$', align: 'center', title: '修改人员', hide: true} |
| | | , {field: 'modiTime$', align: 'center', title: '修改时间', hide: true} |
| | | , {field: 'appeTime$', align: 'center', title: '创建时间', hide: true} |
| | |
| | | } |
| | | }); |
| | | break; |
| | | // 导出 |
| | | case 'exportData': |
| | | layer.confirm('确定导出Excel吗', {shadeClose: true}, function(){ |
| | | var fields=[]; |
| | | var titles=[]; |
| | | var exportData = {}; |
| | | obj.config.cols[0].map(function (col) { |
| | | if (col.type === 'normal' && col.hide === false && col.toolbar == null) { |
| | | titles.push(col.title); |
| | | fields.push(col.field); |
| | | } |
| | | }); |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | exportData[this.name] = this.value; |
| | | }); |
| | | var param = { |
| | | 'exportData': exportData, |
| | | 'fields': fields |
| | | }; |
| | | $.ajax({ |
| | | url: baseUrl+"/locNormal/export/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify(param), |
| | | dataType:'json', |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.closeAll(); |
| | | if (res.code === 200) { |
| | | table.exportFile(titles,res.data,'xls'); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | |
| | | 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, |
| | |
| | | <script type="text/html" id="toolbar"> |
| | | <div class="layui-btn-container"> |
| | | <button class="layui-btn layui-btn-sm" id="btn-locNormal-into" lay-event="intoData">导入</button> |
| | | <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData">导出</button> |
| | | </div> |
| | | </script> |
| | | |