| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.entity.LocDetl; |
| | | import com.zy.asrs.entity.LocMast; |
| | | import com.zy.asrs.entity.param.CombParam; |
| | | import com.zy.asrs.service.LocDetlService; |
| | | import com.zy.asrs.service.LocMastService; |
| | | import com.zy.asrs.service.MobileService; |
| | | import com.zy.common.model.MobileLocDetlVo; |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 移动端接口控制器 |
| | |
| | | |
| | | @Autowired |
| | | private MobileService mobileService; |
| | | @Autowired |
| | | private LocMastService locMastService; |
| | | @Autowired |
| | | private LocDetlService locDetlService; |
| | | |
| | | /** |
| | | * 组托 |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 根据库位号查找库存明细 |
| | | */ |
| | | @RequestMapping("/locDetl") |
| | | @ManagerAuth |
| | | public R getLocDetl(@RequestParam(required = false)String locNo){ |
| | | if (Cools.isEmpty(locNo)) { |
| | | return R.parse(BaseRes.PARAM); |
| | | } |
| | | LocMast locMast = locMastService.selectById(locNo); |
| | | if (null == locMast || !"F".equals(locMast.getLocType())) { |
| | | return R.parse(BaseRes.EMPTY); |
| | | } |
| | | List<LocDetl> locDetls = locDetlService.selectList(new EntityWrapper<LocDetl>().eq("loc_no", locNo)); |
| | | List<MobileLocDetlVo> res = new ArrayList<>(); |
| | | locDetls.forEach(locDetl -> { |
| | | MobileLocDetlVo vo = new MobileLocDetlVo(); |
| | | vo.setLocNo(locNo); |
| | | vo.setMatNo(locDetl.getMatnr()); |
| | | vo.setMatName(locDetl.getMaktx()); |
| | | vo.setCount(locDetl.getAnfme()); |
| | | res.add(vo); |
| | | }); |
| | | return R.ok().add(res); |
| | | } |
| | | } |
New file |
| | |
| | | package com.zy.common.model; |
| | | |
| | | /** |
| | | * Created by vincent on 2020/6/29 |
| | | */ |
| | | public class MobileLocDetlVo { |
| | | |
| | | private String locNo; |
| | | |
| | | private String matNo; |
| | | |
| | | private String matName; |
| | | |
| | | private Double count; |
| | | |
| | | public String getLocNo() { |
| | | return locNo; |
| | | } |
| | | |
| | | public void setLocNo(String locNo) { |
| | | this.locNo = locNo; |
| | | } |
| | | |
| | | public String getMatNo() { |
| | | return matNo; |
| | | } |
| | | |
| | | public void setMatNo(String matNo) { |
| | | this.matNo = matNo; |
| | | } |
| | | |
| | | public String getMatName() { |
| | | return matName; |
| | | } |
| | | |
| | | public void setMatName(String matName) { |
| | | this.matName = matName; |
| | | } |
| | | |
| | | public Double getCount() { |
| | | return count; |
| | | } |
| | | |
| | | public void setCount(Double count) { |
| | | this.count = count; |
| | | } |
| | | } |
| | |
| | | return; |
| | | } |
| | | $.ajax({ |
| | | url: baseUrl + "/matCode/auth", |
| | | url: baseUrl + "/mobile/locDetl", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: { |
| | | id: el.value |
| | | locNo: el.value |
| | | }, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | if (res.data != null) { |
| | | $('#matName').val(res.data.matName); |
| | | $('#str1').val(res.data.str1); |
| | | $('#str2').val(res.data.str2); |
| | | countDom.focus().val(initMatCount) |
| | | locDetlData = res.data; |
| | | tableIns.reload({data: locDetlData}); |
| | | } |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/pda"; |
| | | } else { |
| | | alert(res.msg) |
| | | locDetlData = []; |
| | | tableIns.reload({data: locDetlData}); |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | var locDetlData = []; |
| | | var tableIns; |
| | | layui.use(['table','laydate', 'form'], function() { |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var form = layui.form; |
| | | |
| | | tableIns = table.render({ |
| | | elem: '#dataByLoc', |
| | | data: [], |
| | | limit: 500, |
| | | cellMinWidth: 50, |
| | | cols: [[ |
| | | {type: 'checkbox', fixed: 'left', width:30}, |
| | | {field: 'count', align: 'center', title: '量', style:'color: blue', width:30}, |
| | | {field: 'matNo', align: 'center', title: '编码'}, |
| | | {field: 'matName', align: 'center', title: '名称'}, |
| | | {field: 'locNo', align: 'center', title: '库位'} |
| | | ]], |
| | | done: function (res, curr, count) { |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | // 获取出库口 |
| | | function getOutBound(){ |
| | |
| | | } |
| | | }) |
| | | } |
| | | |
| | | layui.use(['table','laydate', 'form'], function() { |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var form = layui.form; |
| | | |
| | | tableIns = table.render({ |
| | | elem: '#dataByLoc', |
| | | data: [], |
| | | limit: 500, |
| | | cellMinWidth: 50, |
| | | cols: [[ |
| | | {type: 'checkbox', fixed: 'left', width:30}, |
| | | {fixed: 'left', align: 'center', field: 'count', title: '量', style:'color: blue', width:30}, |
| | | {field: 'matNo', align: 'center', title: '物料编码'}, |
| | | {field: 'matName', align: 'center', title: '物料名称'} |
| | | ]], |
| | | done: function (res, curr, count) { |
| | | } |
| | | }); |
| | | }); |
| | | </script> |
| | | <script type="text/template" id="outSitesTemplate"> |
| | | {{#each data}} |