| | |
| | | if (Cools.isEmpty(bomMat) || null==bomMat.getId()){ |
| | | return R.error(); |
| | | } |
| | | bomMat.setZpalletAnfme(bomMat.getBomAnfme() * bomMat.getBomCount()); |
| | | bomMat.setModiUser(getUserId()); |
| | | bomMat.setModiTime(new Date()); |
| | | bomMatService.updateById(bomMat); |
| | |
| | | Set<String> exist = new HashSet<>(); |
| | | |
| | | for (OrderDetl orderDetl : orderDetls) { |
| | | List<LocDetl> locDetls = new ArrayList<>(); |
| | | double issued = Optional.of(orderDetl.getAnfme() - orderDetl.getWorkQty()).orElse(0.0D); |
| | | if (issued <= 0.0D) { continue; } |
| | | List<LocDetl> locDetls = locDetlService.queryStock(orderDetl.getMatnr(), orderDetl.getBatch(), null, exist); |
| | | //if (Cools.isEmpty(orderDetl.getBomCode())) { |
| | | // locDetls = locDetlService.queryStock(orderDetl.getMatnr(), orderDetl.getBatch(), null, exist); |
| | | //} else { |
| | | // locDetls = locDetlService.queryStockByBomcode(orderDetl.getMatnr(), orderDetl.getBatch(), orderDetl.getBomCode(),null, exist); |
| | | //} |
| | | locDetls = locDetlService.queryStockByBomcode(orderDetl.getMatnr(), orderDetl.getBatch(), orderDetl.getBomCode(),null, exist); |
| | | for (LocDetl locDetl : locDetls) { |
| | | if (issued > 0) { |
| | | LocDto locDto = new LocDto(locDetl.getLocNo(), locDetl.getMatnr(), locDetl.getMaktx(), locDetl.getBatch(), orderDetl.getOrderNo(), |
| | |
| | | @ApiModelProperty(value= "备注") |
| | | private String memo; |
| | | |
| | | @ApiModelProperty(value= "bom号") |
| | | @TableField("bom_code") |
| | | private String bomCode; |
| | | |
| | | public OrderDetl() {} |
| | | |
| | | public OrderDetl(Long orderId, String orderNo, Double anfme, Double qty, String matnr, String maktx, String batch, String specs, String model, String color, String brand, String unit, Double price, String sku, Double units, String barcode, String origin, String manu, String manuDate, String itemNum, Double safeQty, Double weight, Double length, Double volume, String threeCode, String supp, String suppCode, Integer beBatch, String deadTime, Integer deadWarn, Integer source, Integer inspect, Integer danger, Integer status, Long createBy, Date createTime, Long updateBy, Date updateTime, String memo) { |
| | | public OrderDetl(Long orderId, String orderNo, Double anfme, Double qty, String matnr, String maktx, String batch, String specs, String model, String color, String brand, String unit, Double price, String sku, Double units, String barcode, String origin, String manu, String manuDate, String itemNum, Double safeQty, Double weight, Double length, Double volume, String threeCode, String supp, String suppCode, Integer beBatch, String deadTime, Integer deadWarn, Integer source, Integer inspect, Integer danger, Integer status, Long createBy, Date createTime, Long updateBy, Date updateTime, String memo, String bomCode) { |
| | | this.orderId = orderId; |
| | | this.orderNo = orderNo; |
| | | this.anfme = anfme; |
| | |
| | | this.updateBy = updateBy; |
| | | this.updateTime = updateTime; |
| | | this.memo = memo; |
| | | this.bomCode = bomCode; |
| | | } |
| | | |
| | | public String getOrderId$(){ |
| | |
| | | |
| | | @Data |
| | | public class CheckBom { |
| | | // bom号 |
| | | // BOM号 |
| | | private String bomCode; |
| | | |
| | | // 物料号 |
| | |
| | | //订单编号 |
| | | private String orderNo; |
| | | |
| | | // Bom号 |
| | | private String bomCode; |
| | | |
| | | // 物料编号 |
| | | private String matnr; |
| | | |
| | |
| | | |
| | | List<LocDetl> queryStock(@Param("matnr")String matnr, @Param("batch")String batch, @Param("orderNo")String orderNo, @Param("locNos") Set<String> locNos); |
| | | |
| | | List<LocDetl> queryStockByBomcode(@Param("matnr")String matnr, @Param("batch")String batch, @Param("bomCode")String bomCode, @Param("orderNo")String orderNo, @Param("locNos") Set<String> locNos); |
| | | |
| | | Double queryStockAnfme(String matnr, String batch); |
| | | |
| | | List<StockVo> queryStockTotal(); |
| | |
| | | |
| | | List<LocDetl> queryStock(String matnr, String batch, String orderNo, Set<String> locNos); |
| | | |
| | | List<LocDetl> queryStockByBomcode(String matnr, String batch, String bomCode,String orderNo, Set<String> locNos); |
| | | |
| | | Double queryStockAnfme(String matnr, String batch); |
| | | |
| | | List<StockVo> queryStockTotal(); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<LocDetl> queryStockByBomcode(String matnr, String batch, String bomCode,String orderNo, Set<String> locNos) { |
| | | return this.baseMapper.queryStockByBomcode(matnr, batch, bomCode, orderNo, locNos); |
| | | } |
| | | |
| | | @Override |
| | | public Double queryStockAnfme(String matnr, String batch) { |
| | | return this.baseMapper.queryStockAnfme(matnr, batch); |
| | | } |
| | |
| | | } |
| | | WaitPakin waitPakin = new WaitPakin(); |
| | | waitPakin.sync(mat); |
| | | waitPakin.setBomCode(combMat.getBomCode()); |
| | | waitPakin.setOrderNo(order.getOrderNo()); // 单据编号 |
| | | waitPakin.setBatch(combMat.getBatch()); // 序列码 |
| | | waitPakin.setZpallet(param.getBarcode()); // 托盘码 |
| | |
| | | <result column="appe_user" property="appeUser" /> |
| | | <result column="appe_time" property="appeTime" /> |
| | | <result column="memo" property="memo" /> |
| | | <result column="bom_code" property="bomCode" /> |
| | | </resultMap> |
| | | |
| | | <sql id="batchSeq"> |
| | |
| | | </if> |
| | | <if test="zpallet!=null and zpallet!='' "> |
| | | and a.zpallet like '%' + #{zpallet} + '%' |
| | | </if> |
| | | <if test="bomCode!=null and bomCode!='' "> |
| | | and a.bom_code like '%' + #{bomCode} + '%' |
| | | </if> |
| | | </sql> |
| | | |
| | |
| | | desc |
| | | </select> |
| | | |
| | | <select id="queryStockByBomcode" resultMap="BaseResultMap"> |
| | | select 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_sts = 'F' |
| | | and a.matnr = #{matnr} |
| | | <!-- <choose>--> |
| | | <!-- <when test="batch != null and batch != ''">--> |
| | | <!-- and a.batch = #{batch}--> |
| | | <!-- </when>--> |
| | | <!-- <otherwise>--> |
| | | <!-- and (a.batch IS NULL OR a.batch = '')--> |
| | | <!-- </otherwise>--> |
| | | <!-- </choose>--> |
| | | <if test="batch != null"> |
| | | and a.batch = #{batch} |
| | | </if> |
| | | <if test="orderNo != null and orderNo != ''"> |
| | | and a.order_no = #{orderNo} |
| | | </if> |
| | | |
| | | <if test="locNos != null and locNos.size > 0"> |
| | | and b.loc_no not in |
| | | <foreach item="item" collection="locNos" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | and a.bom_code = #{bomCode} |
| | | order by |
| | | DATEPART(yyyy,a.modi_time),DATEPART(mm,a.modi_time),DATEPART(dd,a.modi_time), a.anfme |
| | | desc, |
| | | NEWID(), |
| | | case |
| | | when (left(a.loc_no, 2) = '01') then 0 |
| | | when (left(a.loc_no, 2) = '02') then 1 |
| | | when (left(a.loc_no, 2) = '03') then 1 |
| | | when (left(a.loc_no, 2) = '04') then 0 |
| | | when (left(a.loc_no, 2) = '05') then 0 |
| | | when (left(a.loc_no, 2) = '06') then 1 |
| | | when (left(a.loc_no, 2) = '07') then 1 |
| | | when (left(a.loc_no, 2) = '08') then 0 |
| | | when (left(a.loc_no, 2) = '09') then 0 |
| | | when (left(a.loc_no, 2) = '10') then 1 |
| | | when (left(a.loc_no, 2) = '11') then 1 |
| | | when (left(a.loc_no, 2) = '12') then 0 |
| | | when (left(a.loc_no, 2) = '13') then 0 |
| | | when (left(a.loc_no, 2) = '14') then 1 |
| | | when (left(a.loc_no, 2) = '15') then 1 |
| | | when (left(a.loc_no, 2) = '16') then 0 |
| | | when (left(a.loc_no, 2) = '17') then 0 |
| | | when (left(a.loc_no, 2) = '18') then 1 |
| | | when (left(a.loc_no, 2) = '19') then 1 |
| | | when (left(a.loc_no, 2) = '20') then 0 |
| | | when (left(a.loc_no, 2) = '21') then 0 |
| | | when (left(a.loc_no, 2) = '22') then 1 |
| | | when (left(a.loc_no, 2) = '23') then 1 |
| | | when (left(a.loc_no, 2) = '24') then 0 |
| | | when (left(a.loc_no, 2) = '25') then 0 |
| | | when (left(a.loc_no, 2) = '26') then 1 |
| | | when (left(a.loc_no, 2) = '27') then 1 |
| | | when (left(a.loc_no, 2) = '28') then 0 |
| | | when (left(a.loc_no, 2) = '29') then 0 |
| | | when (left(a.loc_no, 2) = '30') then 1 |
| | | when (left(a.loc_no, 2) = '31') then 1 |
| | | when (left(a.loc_no, 2) = '32') then 0 |
| | | when (left(a.loc_no, 2) = '33') then 0 |
| | | when (left(a.loc_no, 2) = '34') then 1 |
| | | when (left(a.loc_no, 2) = '35') then 1 |
| | | when (left(a.loc_no, 2) = '36') then 0 |
| | | when (left(a.loc_no, 2) = '37') then 0 |
| | | when (left(a.loc_no, 2) = '38') then 1 |
| | | when (left(a.loc_no, 2) = '39') then 1 |
| | | when (left(a.loc_no, 2) = '40') then 0 |
| | | when (left(a.loc_no, 2) = '41') then 0 |
| | | when (left(a.loc_no, 2) = '42') then 1 |
| | | when (left(a.loc_no, 2) = '43') then 1 |
| | | when (left(a.loc_no, 2) = '44') then 0 |
| | | when (left(a.loc_no, 2) = '45') then 0 |
| | | when (left(a.loc_no, 2) = '46') then 1 |
| | | when (left(a.loc_no, 2) = '47') then 1 |
| | | when (left(a.loc_no, 2) = '48') then 0 |
| | | else 0 |
| | | end |
| | | desc |
| | | </select> |
| | | |
| | | <select id="queryStockAnfme" resultType="java.lang.Double"> |
| | | select sum(anfme) as count from man_loc_detl |
| | | where 1=1 |
| | |
| | | <result column="update_by" property="updateBy" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="memo" property="memo" /> |
| | | <result column="bom_code" property="bomCode" /> |
| | | |
| | | </resultMap> |
| | | |
| | |
| | | ,{field: 'model', align: 'center',title: '代码', hide: false} |
| | | ,{field: 'color', align: 'center',title: '颜色', hide: true} |
| | | ,{field: 'brand', align: 'center',title: '类型', hide: false} |
| | | ,{field: 'bomCode', align: 'center',title: 'BOM号', hide: false} |
| | | ,{field: 'unit', align: 'center',title: '单位', hide: true} |
| | | ,{field: 'price', align: 'center',title: '单价', hide: true} |
| | | ,{field: 'sku', align: 'center',title: 'sku', hide: true} |
| | |
| | | ,{field: 'model', align: 'center',title: '代码', hide: true} |
| | | ,{field: 'color', align: 'center',title: '颜色', hide: true} |
| | | ,{field: 'brand', align: 'center',title: '类型', hide: false} |
| | | ,{field: 'bomCode', align: 'center',title: 'bom号', hide: false} |
| | | ,{field: 'unit', align: 'center',title: '单位', hide: true} |
| | | ,{field: 'price', align: 'center',title: '单价', hide: true} |
| | | ,{field: 'sku', align: 'center',title: 'sku', hide: true} |
| | |
| | | {type: 'numbers'}, |
| | | {field: 'matnr', title: '商品编码', width: 160}, |
| | | {field: 'maktx', title: '商品名称', width: 160}, |
| | | {field: 'bomCode', title: 'Bom号'}, |
| | | {field: 'batch', title: '批号'}, |
| | | {field: 'anfme', title: '数量'}, |
| | | {field: 'supp', title: '立库库存', templet: function (item){ |
| | |
| | | {type: 'numbers', title: '#'}, |
| | | {field: 'matnr', title: '商品编码', width: 160}, |
| | | {field: 'maktx', title: '商品名称', width: 200}, |
| | | {field: 'bomCode', title: 'Bom号', style: 'color: blue;font-weight: bold', edit: true, minWidth: 110, width: 110}, |
| | | {field: 'batch', title: '批号', edit: true}, |
| | | {field: 'specs', title: '规格'}, |
| | | {field: 'anfme', title: '数量(修改)', style: 'color: blue;font-weight: bold', edit: true, minWidth: 110, width: 110}, |
| | |
| | | } |
| | | // 打印 |
| | | function btnPrint(orderId, orderNo, settle) { |
| | | console.log(orderId); |
| | | console.log(orderNo); |
| | | console.log(settle); |
| | | printMatCodeNos.push(orderNo) |
| | | var templateNo = 3; |
| | | $.ajax({ |
| | |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | layer.closeAll(); |
| | | console.log(res); |
| | | for (let i=0;i<res.data.length;i++){ |
| | | var templateDom = $("#templatePreview"+templateNo); |
| | | var className = templateDom.attr("class"); |
| | | if (className === 'template-barcode') { |
| | | res.data[i]["barcodeUrl"]=baseUrl+"/mac/code/auth?type=1¶m="+res.data[i].orderNo+ |
| | | ";"+res.data[i].matnr+";"+res.data[i].batch+";"+res.data[i].anfme; |
| | | ";"+res.data[i].matnr+";"+res.data[i].batch+";"+res.data[i].anfme+";"+res.data[i].bomCode; |
| | | } else { |
| | | if (res.data[i].bomCode) { |
| | | res.data[i]["barcodeUrl"]=baseUrl+"/mac/code/auth?type=2¶m="+res.data[i].orderNo+ |
| | | ";"+res.data[i].matnr+";"+res.data[i].batch+";"+res.data[i].anfme+";"+res.data[i].bomCode; |
| | | } else { |
| | | res.data[i]["barcodeUrl"]=baseUrl+"/mac/code/auth?type=2¶m="+res.data[i].orderNo+ |
| | | ";"+res.data[i].matnr+";"+res.data[i].batch+";"+res.data[i].anfme; |
| | | } |
| | | |
| | | } |
| | | } |
| | | var tpl = templateDom.html(); |
| | | var template = Handlebars.compile(tpl); |
| | |
| | | cols: [[ |
| | | {type: 'checkbox'} |
| | | ,{type: 'numbers', title: '#'} |
| | | ,{field: 'orderNo', align: 'center',title: '单据编号', templet: '#orderNoTpl', width: 160} |
| | | ,{field: 'matnr', align: 'center',title: '商品编码', width: 160} |
| | | ,{field: 'maktx', align: 'center',title: '商品名称', width: 200} |
| | | ,{field: 'orderNo', align: 'center',title: '单据编号', templet: '#orderNoTpl', width: 140} |
| | | ,{field: 'matnr', align: 'center',title: '商品编码', width: 140} |
| | | ,{field: 'maktx', align: 'center',title: '商品名称', width: 140} |
| | | ,{field: 'bomCode', align: 'center',title: 'bom号', width: 100} |
| | | ,{field: 'batch', align: 'center',title: '序列码'} |
| | | ,{field: 'specs', align: 'center',title: '规格'} |
| | | ,{field: 'anfme', align: 'center',title: '总数量', style: 'font-weight: bold'} |
| | |
| | | // ,{field: 'updateBy$', align: 'center',title: '修改人员'} |
| | | // ,{field: 'updateTime$', align: 'center',title: '修改时间'} |
| | | // ,{field: 'memo', align: 'center',title: '备注'} |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width: 160} |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width: 100} |
| | | ]], |
| | | request: { |
| | | pageName: 'curr', |
| | |
| | | <input class="layui-input" type="text" name="batch" placeholder="批号" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="bomCode" placeholder="bom号" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <!-- 日期范围 --> |
| | | <div class="layui-inline" style="width: 300px"> |
| | | <div class="layui-input-inline"> |