| | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.zy.asrs.entity.LocDetl; |
| | | import com.zy.asrs.service.LocDetlService; |
| | | import com.zy.common.web.BaseController; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.entity.LocDetl; |
| | | import com.zy.asrs.service.LocDetlService; |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | return R.ok(locDetlService.selectById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/stock/out/list/auth") |
| | | @ManagerAuth |
| | | public R stockOutList(@RequestParam(defaultValue = "1")Integer curr, |
| | | @RequestParam(defaultValue = "10")Integer limit, |
| | | @RequestParam Map<String, Object> param){ |
| | | return R.ok(locDetlService.getStockOut(new Page<LocDetl>(curr, limit).setCondition(param))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/locDetl/list/auth") |
| | | @ManagerAuth |
| | | public R list(@RequestParam(defaultValue = "1")Integer curr, |
| | |
| | | import com.core.common.R; |
| | | import com.zy.asrs.entity.param.EmptyPlateOutParam; |
| | | import com.zy.asrs.entity.param.FullStoreParam; |
| | | import com.zy.asrs.entity.param.StockOutParam; |
| | | import com.zy.asrs.service.BasDevpService; |
| | | import com.zy.asrs.service.WorkService; |
| | | import com.zy.common.web.BaseController; |
| | |
| | | return R.ok("入库启动成功").add(workService.emptyPlateIn(sourceStaNo, getUserId())); |
| | | } |
| | | |
| | | @RequestMapping("/plate/out/start") |
| | | @ManagerAuth(memo = "全板出库") |
| | | public R fullStoreTakeStart(EmptyPlateOutParam param) { |
| | | workService.emptyPlateOut(param, getUserId()); |
| | | return R.ok("出库启动成功"); |
| | | } |
| | | |
| | | @RequestMapping("/empty/plate/out/start") |
| | | @ManagerAuth(memo = "空板出库") |
| | | public R emptyPlateOutStart(EmptyPlateOutParam param) { |
| | | workService.emptyPlateOut(param, getUserId()); |
| | | public R emptyPlateOutStart(StockOutParam param) { |
| | | |
| | | return R.ok("出库启动成功"); |
| | | } |
| | | |
New file |
| | |
| | | package com.zy.asrs.entity.param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * Created by vincent on 2020/6/13 |
| | | */ |
| | | public class StockOutParam { |
| | | |
| | | // 出站口 |
| | | private Integer outSite; |
| | | |
| | | // 物料编号集合 |
| | | private List<String> matNos; |
| | | |
| | | public Integer getOutSite() { |
| | | return outSite; |
| | | } |
| | | |
| | | public void setOutSite(Integer outSite) { |
| | | this.outSite = outSite; |
| | | } |
| | | |
| | | public List<String> getMatNos() { |
| | | return matNos; |
| | | } |
| | | |
| | | public void setMatNos(List<String> matNos) { |
| | | this.matNos = matNos; |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.zy.asrs.entity.LocDetl; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface LocDetlMapper extends BaseMapper<LocDetl> { |
| | | |
| | | List<LocDetl> getStockOutPage(@Param("pageNumber")int pageNumber, @Param("pageSize")int pageSize, @Param("param") Map param); |
| | | |
| | | Integer getStockOutPageCount(); |
| | | } |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.zy.asrs.entity.LocDetl; |
| | | |
| | | public interface LocDetlService extends IService<LocDetl> { |
| | | |
| | | Page<LocDetl> getStockOut(Page<LocDetl> page); |
| | | |
| | | } |
| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.zy.asrs.entity.LocDetl; |
| | | import com.zy.asrs.mapper.LocDetlMapper; |
| | |
| | | @Service("locDetlService") |
| | | public class LocDetlServiceImpl extends ServiceImpl<LocDetlMapper, LocDetl> implements LocDetlService { |
| | | |
| | | @Override |
| | | public Page<LocDetl> getStockOut(Page<LocDetl> page) { |
| | | page.setRecords(baseMapper.getStockOutPage(page.getCurrent(), page.getSize(), page.getCondition())); |
| | | page.setTotal(baseMapper.getStockOutPageCount()); |
| | | return page; |
| | | } |
| | | } |
| | |
| | | |
| | | </resultMap> |
| | | |
| | | <select id="getStockOutPage" parameterType="java.util.Map" resultMap="BaseResultMap"> |
| | | select * from |
| | | ( |
| | | select |
| | | ROW_NUMBER() over (order by a.appe_time,a.matnr,a.loc_no) as row, |
| | | a.* |
| | | from asr_loc_detl a |
| | | left join asr_loc_mast b on a.loc_no = b.loc_no |
| | | where 1=1 |
| | | and b.loc_type = 'F' |
| | | <if test="loc_no!=null and loc_no!='' "> |
| | | and a.loc_no like '%' + #{loc_no} + '%' |
| | | </if> |
| | | ) t where t.row between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize}) |
| | | </select> |
| | | |
| | | <select id="getStockOutPageCount" parameterType="java.util.Map" resultType="java.lang.Integer"> |
| | | select |
| | | count(1) |
| | | from asr_loc_detl a |
| | | left join asr_loc_mast b on a.loc_no = b.loc_no |
| | | where 1=1 |
| | | and b.loc_type = 'F' |
| | | </select> |
| | | </mapper> |
| | |
| | | tableIns = table.render({ |
| | | elem: '#stockOut', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl+'/locDetl/list/auth', |
| | | url: baseUrl+'/stock/out/list/auth', |
| | | page: true, |
| | | limit: 10, |
| | | skin: 'line', |
| | | even: true, |
| | | toolbar: '#toolbar', |
| | | cellMinWidth: 50, |
| | |
| | | }); |
| | | |
| | | // 监听排序事件 |
| | | table.on('sort(locDetl)', function (obj) { |
| | | table.on('sort(stockOut)', function (obj) { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | searchData[this.name] = this.value; |
| | |
| | | }); |
| | | }); |
| | | |
| | | // 监听头工具栏事件 |
| | | table.on('toolbar(stockOut)', function (obj) { |
| | | var data = table.checkStatus(obj.config.id).data; |
| | | switch (obj.event) { |
| | | case 'outbound': |
| | | var staNo = $("#staNoSelect").val(); |
| | | if (staNo === "" || staNo === null){ |
| | | layer.msg("请选择出库口"); |
| | | return; |
| | | } |
| | | var locNos = []; |
| | | data.forEach(function(elem) { |
| | | locNos.push(elem.locNo); |
| | | }); |
| | | if (data.length === 0){ |
| | | layer.msg('请至少选中一行数据'); |
| | | } else { |
| | | $.ajax({ |
| | | url: baseUrl+"/plate/out/start", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: { |
| | | outSite: staNo, |
| | | locNos: locNos |
| | | }, |
| | | method: 'POST', |
| | | traditional:true, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | tableReload(); // 重载表格 |
| | | getOutBound(); // 重载出库口 |
| | | layer.msg(res.msg); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | // 搜索栏搜索事件 |
| | | form.on('submit(search)', function (data) { |
| | | pageCurr = 1; |
| | |
| | | <script type="text/javascript" src="../../static/js/handlebars/handlebars-v4.5.3.js"></script> |
| | | <script type="text/javascript" src="../../static/js/pakStore/stockOut.js" charset="utf-8"></script> |
| | | |
| | | |
| | | <script type="text/template" id="takeSiteSelectTemplate"> |
| | | {{#each data}} |
| | | <option value="{{this}}">{{this}}</option> |