| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | |
| | | } |
| | | return R.ok(manLocDetlService.getPage(toPage(curr, limit, param, ManLocDetl.class))); |
| | | } |
| | | |
| | | |
| | | @RequestMapping("/manLocDetl/list") |
| | | public R outList(@RequestParam(defaultValue = "1")Integer curr, |
| | | @RequestParam(defaultValue = "10")Integer limit, |
| | | @RequestParam(required = false)String orderByField, |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam Map<String, Object> param){ |
| | | |
| | | Page<ManLocDetl> manLocDetlPage = toPage(curr, limit, param, ManLocDetl.class); |
| | | Page<ManLocDetl> outPage = manLocDetlService.getOutPage(manLocDetlPage); |
| | | // Page<ManLocDetl> page = manLocDetlService.getPage(manLocDetlPage); |
| | | return R.ok(outPage); |
| | | } |
| | | } |
| | |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.ManLocDetl; |
| | | import com.zy.asrs.entity.Node; |
| | | import com.zy.asrs.entity.param.InitPakoutParam; |
| | | import com.zy.asrs.entity.param.PakinParam; |
| | | import com.zy.asrs.mapper.ManLocDetlMapper; |
| | | import com.zy.asrs.service.NodeService; |
| | |
| | | return nodeService.stockPakin(number, getUserId(), getHostId()); |
| | | } |
| | | |
| | | @RequestMapping("/work/stock/pakout") |
| | | @ManagerAuth(memo = "生成拣货单") |
| | | public R initPakout(@RequestBody List<InitPakoutParam> params) { |
| | | return nodeService.initPakout(params, getUserId(), getHostId()); |
| | | } |
| | | } |
New file |
| | |
| | | package com.zy.asrs.entity.param; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * Created by vincent on 2021/3/10 |
| | | */ |
| | | @Data |
| | | public class InitPakoutParam { |
| | | |
| | | private Long nodeId; |
| | | |
| | | private String matnr; |
| | | |
| | | private Double count; |
| | | |
| | | } |
| | |
| | | int deleteLocNo0(String locNo, String matnr); |
| | | |
| | | int updateAnfme0(double anfme, Long nodeId); |
| | | |
| | | List<ManLocDetl> listByOutPage(Map<String, Object> condition); |
| | | |
| | | long listByOutPageCount(Map<String, Object> condition); |
| | | } |
| | |
| | | List<ManLocDetl> unreason(); |
| | | |
| | | Double getLocDetlSumQty(String locNo); |
| | | |
| | | Page<ManLocDetl> getOutPage(Page<ManLocDetl> manLocDetlPage); |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.entity.Node; |
| | | import com.zy.asrs.entity.param.InitPakoutParam; |
| | | import com.zy.asrs.entity.param.PakinParam; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface NodeService extends IService<Node> { |
| | | |
| | |
| | | Node selectByUuid(String uuid, Long hostId, Integer type, Long parentId); |
| | | |
| | | R stockPakin(PakinParam number, Long userId, Long hostId); |
| | | |
| | | R initPakout(List<InitPakoutParam> params, Long userId, Long hostId); |
| | | } |
| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | |
| | | @Service("manLocDetlService") |
| | |
| | | |
| | | @Override |
| | | public Page<ManLocDetl> getPage(Page<ManLocDetl> page) { |
| | | page.setRecords(baseMapper.listByPage(page.getCondition())); |
| | | Map<String, Object> condition = page.getCondition(); |
| | | List<ManLocDetl> manLocDetls = baseMapper.listByPage(condition); |
| | | page.setRecords(manLocDetls); |
| | | page.setTotal(baseMapper.listByPageCount(page.getCondition())); |
| | | return page; |
| | | } |
| | |
| | | return this.baseMapper.selectLocDetlSumQty(locNo); |
| | | } |
| | | |
| | | @Override |
| | | public Page<ManLocDetl> getOutPage(Page<ManLocDetl> manLocDetlPage) { |
| | | Map<String, Object> condition = manLocDetlPage.getCondition(); |
| | | List<ManLocDetl> manLocDetls = baseMapper.listByOutPage(condition); |
| | | manLocDetlPage.setRecords(manLocDetls); |
| | | manLocDetlPage.setTotal(baseMapper.listByOutPageCount(manLocDetlPage.getCondition())); |
| | | return manLocDetlPage; |
| | | } |
| | | |
| | | } |
| | |
| | | import com.zy.asrs.entity.ManLocDetl; |
| | | import com.zy.asrs.entity.Mat; |
| | | import com.zy.asrs.entity.Node; |
| | | import com.zy.asrs.entity.param.InitPakoutParam; |
| | | import com.zy.asrs.entity.param.MatnrDto; |
| | | import com.zy.asrs.entity.param.PakinParam; |
| | | import com.zy.asrs.entity.result.Pakin; |
| | |
| | | import com.zy.asrs.utils.VersionUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.beans.Transient; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Service("nodeService") |
| | | public class NodeServiceImpl extends ServiceImpl<NodeMapper, Node> implements NodeService { |
| | |
| | | } |
| | | return R.ok("入库成功"); |
| | | } |
| | | |
| | | @Transactional |
| | | @Override |
| | | public R initPakout(List<InitPakoutParam> params, Long userId, Long hostId) { |
| | | if (!Cools.isEmpty(params)) { |
| | | Date now = new Date(); |
| | | for (InitPakoutParam param : params) { |
| | | ManLocDetl manLocDetl = manLocDetlService.selectOne(new EntityWrapper<ManLocDetl>() |
| | | .eq("node_id", param.getNodeId()) |
| | | .eq("matnr", param.getMatnr())); |
| | | Node node = nodeService.selectOne(new EntityWrapper<Node>() |
| | | .eq("id", param.getNodeId())); |
| | | if (node == null) { |
| | | return R.error("找不到该库位,请联系管理员:" + param.getNodeId() ); |
| | | } |
| | | if (manLocDetl == null) { |
| | | return R.error("物料:"+ param.getMatnr() + " 在库位中不存在"); |
| | | } |
| | | if (manLocDetl.getAnfme() - param.getCount() < 0) { |
| | | return R.error("物料:"+ param.getMatnr() + " 在库位中数量不足"); |
| | | }else { |
| | | manLocDetl.setAnfme(manLocDetl.getAnfme() - param.getCount()); |
| | | manLocDetlService.update(manLocDetl,new EntityWrapper<ManLocDetl>() |
| | | .eq("loc_no",node.getUuid()) |
| | | .eq("matnr",param.getMatnr())); |
| | | } |
| | | } |
| | | } |
| | | return R.ok("出库成功"); |
| | | } |
| | | } |
| | |
| | | maxRequestSize: 100MB |
| | | |
| | | mybatis-plus: |
| | | mapper-locations: classpath:mapper/*.xml |
| | | mapper-locations: classpath:mapper/*.xml |
| | | # global-config: |
| | | # field-strategy: 0 |
| | | # configuration: |
| | |
| | | LEFT JOIN man_mat mm ON mld.matnr = mm.matnr |
| | | LEFT JOIN man_tag mt ON mm.tag_id = mt.id |
| | | WHERE 1=1 |
| | | AND (CHARINDEX(','+#{node_id}+',', ','+mn.path+',') > 0 OR mn.id = #{node_id}) |
| | | AND (CHARINDEX(','+#{tag_id}+',', ','+mt.path+',') > 0 OR mt.id = #{tag_id}) |
| | | AND (CHARINDEX(','+#{node_id}+',', ','+mn.path+',') > 0 OR mn.id = #{node_id}) |
| | | AND (CHARINDEX(','+#{tag_id}+',', ','+mt.path+',') > 0 OR mt.id = #{tag_id}) |
| | | <include refid="locDetlCondition"></include> |
| | | ) t where t.row between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize}) |
| | | </select> |
| | |
| | | and matnr = #{matnr} |
| | | </select> |
| | | |
| | | <select id="listByOutPage" resultMap="BaseResultMap"> |
| | | select * from |
| | | ( |
| | | SELECT |
| | | ROW_NUMBER() over (order by mld.create_time desc) as row, |
| | | mld.* |
| | | FROM man_loc_detl mld |
| | | LEFT JOIN man_node mn ON mld.node_id = mn.id |
| | | LEFT JOIN man_mat mm ON mld.matnr = mm.matnr |
| | | LEFT JOIN man_tag mt ON mm.tag_id = mt.id |
| | | WHERE 1=1 |
| | | <include refid="locDetlCondition"></include> |
| | | ) t where t.row between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize}) |
| | | </select> |
| | | <select id="listByOutPageCount" resultType="java.lang.Long"> |
| | | select |
| | | count(1) |
| | | FROM man_loc_detl mld |
| | | LEFT JOIN man_node mn ON mld.node_id = mn.id |
| | | LEFT JOIN man_mat mm ON mld.matnr = mm.matnr |
| | | LEFT JOIN man_tag mt ON mm.tag_id = mt.id |
| | | WHERE 1=1 |
| | | <include refid="locDetlCondition"></include> |
| | | </select> |
| | | |
| | | |
| | | <update id="updateLocNo0"> |
| | | update man_loc_detl set loc_no = #{locNo} |
| | |
| | | var detlCols = [ |
| | | {field: 'matnr', align: 'center',title: '商品编号', sort:true} |
| | | ,{field: 'maktx', align: 'center',title: '商品名称', sort:true} |
| | | ,{field: 'orderNo', align: 'center',title: '单据编号', hide: false} |
| | | ,{field: 'orderNo', align: 'center',title: '单据编号', hide: true} |
| | | ,{field: 'batch', align: 'center',title: '批号', sort:true} |
| | | ,{field: 'anfme', align: 'center',title: '数量'} |
| | | ,{field: 'zpallet', align: 'center',title: '托盘条码'} |
| | |
| | | locDetls.push({nodeId: elem.nodeId, matnr: elem.matnr, count: elem.count}); |
| | | }); |
| | | $.ajax({ |
| | | url: baseUrl+"/work/pakout/init", |
| | | url: baseUrl+"/work/stock/pakout", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify(locDetls), |
| | | contentType:'application/json;charset=UTF-8', |
| | |
| | | </div> |
| | | </div> |
| | | <!-- 日期范围 --> |
| | | <div class="layui-inline" style="width: 300px"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input layui-laydate-range" name="update_time" type="text" placeholder="起始时间 - 终止时间" autocomplete="off" style="width: 300px"> |
| | | </div> |
| | | </div> |
| | | <!-- <div class="layui-inline" style="width: 300px">--> |
| | | <!-- <div class="layui-input-inline">--> |
| | | <!-- <input class="layui-input layui-laydate-range" name="update_time" 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> |
| | |
| | | locDetlTableIns = table.render({ |
| | | elem: '#stockOut', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl+'/locDetl/list/auth', |
| | | url: baseUrl+'/manLocDetl/list', |
| | | page: true, |
| | | limit: 10, |
| | | even: true, |
| | |
| | | |
| | | #btn-outbound { |
| | | margin-left: 20px; |
| | | display: none; |
| | | /*display: none;*/ |
| | | } |
| | | |
| | | /*----------------------------------*/ |
| | |
| | | } |
| | | |
| | | #mat-query { |
| | | display: none; |
| | | /*display: none;*/ |
| | | } |
| | | </style> |
| | | </head> |