Merge branch 'jsxswms' of http://47.97.1.152:5880/r/zy-asrs into jsxswms
| | |
| | | public enum OrderTypeEnum { |
| | | //上架派工单 |
| | | PICKING(1, "上架派工单"), |
| | | //备货调拨单 |
| | | TRANSFER(2, "备货调拨单"), |
| | | //备货派工单 |
| | | TRANSFER(2, "备货派工单"), |
| | | INVENTORY(3, "盘点单"), |
| | | ADJUSTMENT(4, "库存调整单"), |
| | | //备货单 |
| | | STOCK(5, "备货单"); |
| | | STOCK(5, "备货单"), |
| | | |
| | | //备货出库单 |
| | | STOCK_OUT(6, "备货出库单"), |
| | | |
| | | //备货入库单 |
| | | STOCK_IN(7, "备货入库单"); |
| | | |
| | | |
| | | public Integer type; |
| | |
| | | } |
| | | List<CheckOrderDetl> selectList = checkOrderDetlService.selectList(new EntityWrapper<CheckOrderDetl>().eq("order_id", orderId)); |
| | | for (CheckOrderDetl checkOrderDetl : selectList) { |
| | | if (checkOrderDetl.getDiffQty().compareTo(BigDecimal.ZERO) == 0){ |
| | | continue; |
| | | } |
| | | |
| | | LocDetl locDetl = locDetlService.selectById(checkOrderDetl.getLocDetlId()); |
| | | if (Cools.isEmpty(locDetl)) { |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | import java.util.concurrent.TimeUnit; |
| | | import java.util.stream.Collectors; |
| | |
| | | // OrderPakout orderPakout = orderPakOutService.selectByNo(orderNo); |
| | | CheckOrder checkOrder = checkOrderService.selectOne(new EntityWrapper<CheckOrder>().eq("order_no", orderNo)); |
| | | int ioType = checkOrder.getDocType() == 8 ? 107 : (taskDto.isAll() ? 101 : 103); |
| | | if(ioType == 101){ |
| | | boolean DiffQty = taskDto.getLocDtos().stream().allMatch(locDto -> |
| | | locDetlService.selectOne(new EntityWrapper<LocDetl>() |
| | | .eq("loc_no", locDto.getLocNo()) |
| | | .eq("matnr", locDto.getMatnr()) |
| | | .eq("batch", locDto.getBatch()) |
| | | .eq("standby1",locDto.getStandby2()) |
| | | ).getDiffQty().compareTo(BigDecimal.ZERO) == 0 |
| | | ); |
| | | if (!DiffQty){ |
| | | ioType = 103; |
| | | } |
| | | } |
| | | StaDesc staDesc = staDescService.queryCrnStnAuto(ioType, locMast.getCrnNo(), staNo.getDevNo()); |
| | | // 生成工作号 |
| | | int workNo = commonService.getWorkNo(WorkNoType.getWorkNoType(ioType)); |
| | |
| | | |
| | | import com.core.common.Cools; |
| | | import com.zy.asrs.entity.Order; |
| | | import com.zy.asrs.enums.OrderTypeEnum; |
| | | import com.zy.asrs.service.ApiLogService; |
| | | import com.zy.asrs.service.OrderService; |
| | | import com.zy.asrs.task.core.ReturnT; |
| | |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.DocType; |
| | | import com.zy.asrs.entity.Order; |
| | | import com.zy.asrs.entity.OrderDetl; |
| | | import com.zy.asrs.service.ApiLogService; |
| | | import com.zy.asrs.service.DocTypeService; |
| | | import com.zy.asrs.service.OrderDetlService; |
| | | import com.zy.asrs.service.OrderService; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.enums.OrderTypeEnum; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.task.AbstractHandler; |
| | | import com.zy.asrs.task.core.ReturnT; |
| | | import com.zy.asrs.utils.OrderInAndOutUtil; |
| | |
| | | import com.zy.common.model.MesPakoutParam; |
| | | import com.zy.common.utils.HttpHandler; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.jdbc.core.JdbcTemplate; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | private ApiLogService apiLogService; |
| | | @Autowired |
| | | private DocTypeService docTypeService; |
| | | @Autowired |
| | | private OrderPakinService orderPakinService; |
| | | @Autowired |
| | | private OrderDetlPakinService orderDetlPakinService; |
| | | |
| | | @Transactional |
| | | public ReturnT<String> startOrderIssuedOnceMore(Order order) { |
| | |
| | | for (OrderDetl orderDetl : orderDetlList){ |
| | | orderDetl.setWorkQty(0D); |
| | | OrderInAndOutUtil.insertOrderDetl(order.getPakinPakoutStatus$(),order,orderDetl); |
| | | //小松:如果下发备货派工单,则生成备货出库+备货入库 |
| | | if (order.getDocType().equals(OrderTypeEnum.TRANSFER.type.longValue())){ |
| | | try { |
| | | ifTransfetInsertStockIn(order,orderDetl); |
| | | }catch (Exception e){ |
| | | throw new CoolException(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | } |
| | | // 修改订单状态 1.未作业 ===>> 2.作业中 |
| | | if (!orderService.updateSettle(order.getId(), 2L, null)) { |
| | |
| | | return SUCCESS; |
| | | } |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void ifTransfetInsertStockIn(Order order, OrderDetl orderDetl){ |
| | | OrderPakin orderPakin = new OrderPakin(); |
| | | BeanUtils.copyProperties(order,orderPakin); |
| | | orderPakin.setDocType(OrderTypeEnum.STOCK_IN.type.longValue()); |
| | | |
| | | if (!orderPakinService.insert(orderPakin)){ |
| | | throw new CoolException("插入备货入库单失败"); |
| | | } |
| | | OrderDetlPakin orderDetlPakin = new OrderDetlPakin(); |
| | | BeanUtils.copyProperties(orderDetl,orderDetlPakin); |
| | | orderDetlPakin.setOrderId(orderPakin.getId()); |
| | | |
| | | |
| | | if (!orderDetlPakinService.insert(orderDetlPakin)){ |
| | | throw new CoolException("插入备货入库单失败"); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | @Transactional |
| | | public ReturnT<String> startOrderInAndOutUtil(Order order) { |
| | | //小松:轮训到备货派工单是查询备货入库单是否完成 |
| | | if (order.getDocType().equals(OrderTypeEnum.STOCK_IN.type.longValue())){ |
| | | return SUCCESS; |
| | | } |
| | | if (order.getDocType().equals(OrderTypeEnum.TRANSFER.type.longValue())){ |
| | | OrderPakin orderPakin = orderPakinService.selectByNo(order.getOrderNo()); |
| | | if (null != orderPakin) { |
| | | if (!orderPakin.getSettle().equals(4L)){ |
| | | return SUCCESS; |
| | | } |
| | | } |
| | | } |
| | | DocType docType = docTypeService.selectById(order.getDocType()); |
| | | if (null == docType) { |
| | | return SUCCESS; |
| | |
| | | var offset = $a.offset(); |
| | | var top = offset.top; |
| | | var left = offset.left; |
| | | layer.open({ |
| | | admin.open({ |
| | | type: 1, |
| | | title: false, |
| | | area: '1000px', |
| | | offset: [top + 'px', (left - 700 + $a.outerWidth()) + 'px'], |
| | | shade: .01, |
| | | shadeClose: true, |
| | | fixed: false, |
| | | content: '<table id="lookSSXMTable" lay-filter="lookSSXMTable"></table>', |
| | | success: function (layero) { |
| | | title: '单据明细', |
| | | height: '450px', |
| | | content: $('#orderItem').html(), |
| | | area: '78%', |
| | | success: function (layero, dIndex) { |
| | | table.render({ |
| | | elem: '#lookSSXMTable', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl+'/checkOrderDetl/list/auth', |
| | | elem: '#itemTable', |
| | | headers: { token: localStorage.getItem('token') }, |
| | | url: baseUrl + '/checkOrderDetl/list/auth', |
| | | where: { |
| | | order_id: data.id |
| | | }, |
| | | page: true, |
| | | height: '450px;', |
| | | cellMinWidth: 100, |
| | | cols: [[ |
| | | {type: 'numbers'}, |
| | |
| | | {field: 'maktx', title: '商品名称', width: 160}, |
| | | {field: 'batch', title: '批号'}, |
| | | {field: 'diffQty', title: '差异数量', style: 'font-weight: bold'}, |
| | | // {field: 'unit', title: '单位'}, |
| | | // { |
| | | // field: 'createTime$', title: '创建时间', sort: true, templet: function (d) { |
| | | // return util.toDateString(d.createTime); |
| | | // }, width: 180 |
| | | // }, |
| | | // {field: 'inQty', title: '已入库量'}, |
| | | // {field: 'color', title: '颜色'}, |
| | | {field: 'specs', title: '规格'}, |
| | | {field: 'status$', title: '状态'} |
| | | ]], |
| | |
| | | response: { |
| | | statusCode: 200 |
| | | }, |
| | | done: (res) => { |
| | | if(res.code == 403){ |
| | | window.top.location.href = baseUrl+"/"; |
| | | } |
| | | done: function () { |
| | | $(layero).find('.layui-table-view').css('margin', '0'); |
| | | }, |
| | | size: '' |
| | |
| | | var offset = $a.offset(); |
| | | var top = offset.top; |
| | | var left = offset.left; |
| | | layer.open({ |
| | | admin.open({ |
| | | type: 1, |
| | | title: false, |
| | | area: '1000px', |
| | | offset: [top + 'px', (left - 700 + $a.outerWidth()) + 'px'], |
| | | shade: .01, |
| | | shadeClose: true, |
| | | fixed: false, |
| | | content: '<table id="lookSSXMTable" lay-filter="lookSSXMTable"></table>', |
| | | success: function (layero) { |
| | | title: '单据明细', |
| | | height: '450px', |
| | | content: $('#orderItem').html(), |
| | | area: '78%', |
| | | success: function (layero, dIndex) { |
| | | table.render({ |
| | | elem: '#lookSSXMTable', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl+'/checkOrderDetl/list/auth', |
| | | elem: '#itemTable', |
| | | headers: { token: localStorage.getItem('token') }, |
| | | url: baseUrl + '/checkOrderDetl/list/auth', |
| | | where: { |
| | | order_id: data.id |
| | | }, |
| | | page: true, |
| | | height: '450px;', |
| | | cellMinWidth: 100, |
| | | cols: [[ |
| | | {type: 'numbers'}, |
| | |
| | | {field: 'anfme', title: '数量'}, |
| | | {field: 'workQty', title: '盘点数量'}, |
| | | {field: 'diffQty', title: '差异数量', style: 'font-weight: bold'}, |
| | | // {field: 'unit', title: '单位'}, |
| | | // { |
| | | // field: 'createTime$', title: '创建时间', sort: true, templet: function (d) { |
| | | // return util.toDateString(d.createTime); |
| | | // }, width: 180 |
| | | // }, |
| | | // {field: 'inQty', title: '已入库量'}, |
| | | // {field: 'color', title: '颜色'}, |
| | | {field: 'specs', title: '规格'}, |
| | | {field: 'status$', title: '状态'} |
| | | ]], |
| | |
| | | response: { |
| | | statusCode: 200 |
| | | }, |
| | | done: (res) => { |
| | | if(res.code == 403){ |
| | | window.top.location.href = baseUrl+"/"; |
| | | } |
| | | done: function () { |
| | | $(layero).find('.layui-table-view').css('margin', '0'); |
| | | }, |
| | | size: '' |
| | |
| | | } else { |
| | | var p = time.getMilliseconds(); |
| | | if (p < 10) { |
| | | p = "00" + p; |
| | | p = "0" + p; |
| | | } |
| | | if (p < 100) { |
| | | p = "0" + p; |
| | |
| | | var offset = $a.offset(); |
| | | var top = offset.top; |
| | | var left = offset.left; |
| | | layer.open({ |
| | | |
| | | admin.open({ |
| | | type: 1, |
| | | title: false, |
| | | area: '820px', |
| | | offset: [top + 'px', (left - 530 + $a.outerWidth()) + 'px'], |
| | | shade: .01, |
| | | shadeClose: true, |
| | | fixed: false, |
| | | content: '<table id="lookSSXMTable" lay-filter="lookSSXMTable"></table>', |
| | | success: function (layero) { |
| | | title: '单据明细', |
| | | height: '450px', |
| | | content: $('#orderItem').html(), |
| | | area: '78%', |
| | | success: function (layero, dIndex) { |
| | | table.render({ |
| | | elem: '#lookSSXMTable', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl+'/orderDetl/list/auth', |
| | | elem: '#itemTable', |
| | | headers: { token: localStorage.getItem('token') }, |
| | | url: baseUrl + '/orderDetl/list/auth', |
| | | where: { |
| | | order_id: data.id |
| | | }, |
| | | page: true, |
| | | height: '450px;', |
| | | cellMinWidth: 100, |
| | | cols: [[ |
| | | {type: 'numbers'}, |
| | | {field: 'matnr', title: '商品编码', width: 160}, |
| | | {field: 'maktx', title: '商品名称', width: 160}, |
| | | {field: 'specs', title: '规格'}, |
| | | {field: 'batch', title: '批号'}, |
| | | {field: 'anfme', title: '待完结数量'}, |
| | | {field: 'qty', title: '待上报数量', style: 'font-weight: bold'}, |
| | | {field: 'workQty', title: '已上报数量'}, |
| | | // {field: 'unit', title: '单位'}, |
| | | // { |
| | | // field: 'createTime$', title: '创建时间', sort: true, templet: function (d) { |
| | | // return util.toDateString(d.createTime); |
| | | // }, width: 180 |
| | | // }, |
| | | // {field: 'inQty', title: '已入库量'}, |
| | | // {field: 'color', title: '颜色'} |
| | | { type: 'numbers' }, |
| | | { field: 'matnr', title: '商品编码', width: 160 }, |
| | | { field: 'maktx', title: '商品名称', width: 160 }, |
| | | { field: 'standby1', title: '供应商编码', width: 160 }, |
| | | { field: 'batch', title: '批号' }, |
| | | { field: 'anfme', title: '待完结数量' }, |
| | | { field: 'workQty', title: '待上报数量' }, |
| | | { field: 'qty', title: '已完结数量', style: 'font-weight: bold' }, |
| | | { field: 'specs', title: '规格' } |
| | | ]], |
| | | request: { |
| | | pageName: 'curr', |
| | |
| | | { type: 'numbers' }, |
| | | { field: 'matnr', title: '商品编码', width: 160 }, |
| | | { field: 'maktx', title: '商品名称', width: 160 }, |
| | | { field: 'suppCode', title: '供应商编码', width: 160 }, |
| | | { field: 'standby1', title: '供应商编码', width: 160 }, |
| | | { field: 'batch', title: '批号' }, |
| | | { field: 'anfme', title: '数量' }, |
| | | { field: 'workQty', title: '作业数量' }, |
| | |
| | | doModify(data.id, data.orderNo, 4); |
| | | } else if (layEvent === 'look') { |
| | | var $a = $(obj.tr).find('a[lay-event="look"]'); |
| | | var offset = $a.offset(); |
| | | var top = offset.top; |
| | | var left = offset.left; |
| | | layer.open({ |
| | | admin.open({ |
| | | type: 1, |
| | | title: false, |
| | | area: '820px', |
| | | offset: [top + 'px', (left - 530 + $a.outerWidth()) + 'px'], |
| | | shade: .01, |
| | | shadeClose: true, |
| | | fixed: false, |
| | | content: '<table id="lookSSXMTable" lay-filter="lookSSXMTable"></table>', |
| | | success: function (layero) { |
| | | title: '单据明细', |
| | | height: '450px', |
| | | content: $('#orderItem').html(), |
| | | area: '78%', |
| | | success: function (layero, dIndex) { |
| | | table.render({ |
| | | elem: '#lookSSXMTable', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl+'/order/pakout/orderDetl/list/auth', |
| | | elem: '#itemTable', |
| | | headers: { token: localStorage.getItem('token') }, |
| | | url: baseUrl + '/order/pakout/orderDetl/list/auth', |
| | | where: { |
| | | order_id: data.id |
| | | }, |
| | | page: true, |
| | | height: '450px;', |
| | | cellMinWidth: 100, |
| | | cols: [[ |
| | | {type: 'numbers'}, |
| | | {field: 'matnr', title: '零件代码', width: 160}, |
| | | {field: 'maktx', title: '零件名称', width: 160}, |
| | | // {field: 'batch', title: '批号'}, |
| | | {field: 'standby1', title: '供应商代码'}, |
| | | {field: 'anfme', title: '数量'}, |
| | | {field: 'workQty', title: '作业数量'}, |
| | | {field: 'qty', title: '完成数量', style: 'font-weight: bold'}, |
| | | // {field: 'unit', title: '单位'}, |
| | | // { |
| | | // field: 'createTime$', title: '创建时间', sort: true, templet: function (d) { |
| | | // return util.toDateString(d.createTime); |
| | | // }, width: 180 |
| | | // }, |
| | | // {field: 'inQty', title: '已入库量'}, |
| | | // {field: 'color', title: '颜色'}, |
| | | {field: 'specs', title: '规格'} |
| | | { type: 'numbers' }, |
| | | { field: 'matnr', title: '商品编码', width: 160 }, |
| | | { field: 'maktx', title: '商品名称', width: 160 }, |
| | | { field: 'standby1', title: '供应商编码', width: 160 }, |
| | | { field: 'batch', title: '批号' }, |
| | | { field: 'anfme', title: '数量' }, |
| | | { field: 'workQty', title: '作业数量' }, |
| | | { field: 'qty', title: '完成数量', style: 'font-weight: bold' }, |
| | | { field: 'specs', title: '规格' } |
| | | ]], |
| | | request: { |
| | | pageName: 'curr', |
| | |
| | | </a> |
| | | </span> |
| | | </script> |
| | | <script type="text/html" id="orderItem"> |
| | | <table id="itemTable" lay-filter="itemTable"></table> |
| | | </script> |
| | | <script type="text/html" id="orderNoTpl"> |
| | | {{d.orderNo}} |
| | | {{# if(d.settle > 1 && d.settle !== 3){ }} |
| | |
| | | </a> |
| | | </span> |
| | | </script> |
| | | <script type="text/html" id="orderItem"> |
| | | <table id="itemTable" lay-filter="itemTable"></table> |
| | | </script> |
| | | <script type="text/html" id="orderNoTpl"> |
| | | {{d.orderNo}} |
| | | {{# if(d.settle > 1 && d.settle !== 3){ }} |
| | |
| | | |
| | | |
| | | </script> |
| | | <script type="text/html" id="orderItem"> |
| | | <table id="itemTable" lay-filter="itemTable"></table> |
| | | </script> |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/js/handlebars/handlebars-v4.5.3.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | |
| | | |
| | | |
| | | </script> |
| | | <script type="text/html" id="orderItem"> |
| | | <table id="itemTable" lay-filter="itemTable"></table> |
| | | </script> |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/js/handlebars/handlebars-v4.5.3.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |