| | |
| | | |
| | | LocDetl selectItem(@Param("locNo")String locNo, @Param("matnr")String matnr, @Param("batch")String batch,@Param("suppCode")String suppCode); |
| | | |
| | | int deleteItem(@Param("locNo")String locNo, @Param("matnr")String matnr, @Param("batch")String batch); |
| | | int deleteItem(@Param("locNo")String locNo, @Param("matnr")String matnr, @Param("batch")String batch, @Param("suppCode")String suppCode, @Param("threeCode")String threeCode, @Param("deadTime")String deadTime); |
| | | |
| | | int updateAnfme(@Param("anfme")Double anfme, @Param("locNo")String locNo, @Param("matnr")String matnr, @Param("batch")String batch); |
| | | int updateAnfme(@Param("anfme")Double anfme, @Param("locNo")String locNo, @Param("matnr")String matnr, @Param("batch")String batch, @Param("suppCode")String suppCode, @Param("threeCode")String threeCode, @Param("deadTime")String deadTime); |
| | | |
| | | List<LocDetl> getStockOutPage(Map<String, Object> map); |
| | | |
| | |
| | | /** |
| | | * 修改库存明细数量,如果数量为0,则删除记录 |
| | | */ |
| | | boolean updateAnfme(Double anfme, String locNo, String matnr, String batch); |
| | | boolean updateAnfme(Double anfme, String locNo, String matnr, String batch, String containerCode, String csoCode, String isoCode); |
| | | |
| | | boolean updateLocNo(String newLocNo, String oldLocNo); |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public boolean updateAnfme(Double anfme, String locNo, String matnr, String batch) { |
| | | public boolean updateAnfme(Double anfme, String locNo, String matnr, String batch, String containerCode, String csoCode, String isoCode) { |
| | | if (anfme <= 0) { |
| | | return this.baseMapper.deleteItem(locNo, matnr, batch) > 0; |
| | | return this.baseMapper.deleteItem(locNo, matnr, batch, containerCode, csoCode, isoCode) > 0; |
| | | } else { |
| | | return baseMapper.updateAnfme(anfme, locNo, matnr, batch) > 0; |
| | | return baseMapper.updateAnfme(anfme, locNo, matnr, batch, containerCode, csoCode, isoCode) > 0; |
| | | } |
| | | } |
| | | |
| | |
| | | if (!locDetl.getAnfme().equals(adjust.getCount())) { |
| | | // todo 盘点记录 |
| | | // 修改库存 |
| | | if (!locDetlService.updateAnfme(adjust.getCount(), locDetl.getLocNo(), locDetl.getMatnr(), locDetl.getBatch())) { |
| | | if (!locDetlService.updateAnfme(adjust.getCount(), locDetl.getLocNo(), locDetl.getMatnr(), locDetl.getBatch(),locDetl.getSuppCode(),locDetl.getThreeCode(),locDetl.getDeadTime())) { |
| | | throw new CoolException(locDetl.getLocNo() + "库位," + locDetl.getMatnr() + "商品," + locDetl.getBatch() + "序列码修改数量失败"); |
| | | } |
| | | // 保存调整记录 |
| | |
| | | // 删除库存 |
| | | for (LocDetl locDetl : locDetls) { |
| | | // todo 盘点记录 |
| | | if (!locDetlService.updateAnfme(-1.0D, locDetl.getLocNo(), locDetl.getMatnr(), locDetl.getBatch())) { |
| | | if (!locDetlService.updateAnfme(-1.0D, locDetl.getLocNo(), locDetl.getMatnr(), locDetl.getBatch(),locDetl.getSuppCode(),locDetl.getThreeCode(),locDetl.getDeadTime())) { |
| | | throw new CoolException("删除" + locDetl.getLocNo() + "库位," + locDetl.getMatnr() + "商品," + locDetl.getBatch() + "序列码库存明细失败"); |
| | | } |
| | | // 保存调整记录 |
| | |
| | | |
| | | LocDetl locDetl = locDetlService.selectItem(locMast.getLocNo(), wrkDetl.getMatnr(), wrkDetl.getBatch(),wrkDetl.getSuppCode()); |
| | | if (null != locDetl) { |
| | | if (!locDetlService.updateAnfme(locDetl.getAnfme() - wrkDetl.getAnfme(), locMast.getLocNo(), wrkDetl.getMatnr(), wrkDetl.getBatch())) { |
| | | if (!locDetlService.updateAnfme(locDetl.getAnfme() - wrkDetl.getAnfme(), |
| | | locMast.getLocNo(), |
| | | wrkDetl.getMatnr(), |
| | | wrkDetl.getBatch(), |
| | | wrkDetl.getSuppCode(), |
| | | wrkDetl.getThreeCode(), |
| | | wrkDetl.getDeadTime())) { |
| | | exceptionHandle("拣料入库 ===>> 修改库存明细数量失败;[workNo={0}],[locNo={1}]", wrkMast.getWrkNo(), wrkMast.getLocNo()); |
| | | } |
| | | } |
| | |
| | | |
| | | LocDetl locDetl = locDetlService.selectItem(locMast.getLocNo(), wrkDetl.getMatnr(), wrkDetl.getBatch(),wrkDetl.getSuppCode()); |
| | | if (null != locDetl) { |
| | | if (!locDetlService.updateAnfme(wrkDetl.getAnfme(), locMast.getLocNo(), wrkDetl.getMatnr(), wrkDetl.getBatch())) { |
| | | if (!locDetlService.updateAnfme(wrkDetl.getAnfme(), locMast.getLocNo(), wrkDetl.getMatnr(), wrkDetl.getBatch(),wrkDetl.getSuppCode(),wrkDetl.getThreeCode(),wrkDetl.getDeadTime())) { |
| | | exceptionHandle("并板入库 ===>> 修改库存明细数量失败;[workNo={0}],[matnr={1}]", wrkMast.getWrkNo(), wrkDetl.getMatnr()); |
| | | } |
| | | } else { |
| | |
| | | and loc_no = #{locNo} |
| | | and matnr = #{matnr} |
| | | <include refid="batchSeq"></include> |
| | | <include refid="locdetlCondition"></include> |
| | | </delete> |
| | | |
| | | <update id="updateAnfme"> |
| | |
| | | where 1=1 |
| | | and loc_no = #{locNo} |
| | | and matnr = #{matnr} |
| | | <include refid="locdetlCondition"></include> |
| | | <include refid="batchSeq"></include> |
| | | </update> |
| | | |
| | | <sql id="locdetlCondition"> |
| | | <if test="threeCode!=null and threeCode!='' "> |
| | | and three_code = #{threeCode} |
| | | </if> |
| | | <if test="suppCode!=null and suppCode!='' "> |
| | | and supp_code = #{suppCode} |
| | | </if> |
| | | <if test="deadTime!=null and deadTime!='' "> |
| | | and dead_time = #{deadTime} |
| | | </if> |
| | | </sql> |
| | | |
| | | <sql id="stockOutCondition"> |
| | | <if test="loc_no!=null and loc_no!='' "> |
| | | and a.loc_no like '%' + #{loc_no} + '%' |
| | |
| | | <hr> |
| | | <!--单选框--> |
| | | <div class="layui-form-item" style="display: inline-block; margin-bottom: 10px"> |
| | | <input type="radio" name="selectTemplate" value="1" title="模板一" lay-filter="selectTemplateRadio" checked=""> |
| | | <input type="radio" name="selectTemplate" value="2" title="模板二" lay-filter="selectTemplateRadio"> |
| | | <input type="radio" name="selectTemplate" value="3" title="模板三" lay-filter="selectTemplateRadio"> |
| | | <input type="radio" name="selectTemplate" value="4" title="模板四" lay-filter="selectTemplateRadio"> |
| | | <!-- <input type="radio" name="selectTemplate" value="1" title="模板一" lay-filter="selectTemplateRadio" checked="">--> |
| | | <!-- <input type="radio" name="selectTemplate" value="2" title="模板二" lay-filter="selectTemplateRadio">--> |
| | | <!-- <input type="radio" name="selectTemplate" value="3" title="模板三" lay-filter="selectTemplateRadio">--> |
| | | <input type="radio" name="selectTemplate" value="4" title="模板四" lay-filter="selectTemplateRadio" checked="checked"> |
| | | </div> |
| | | <fieldset class="layui-elem-field site-demo-button" style="margin-top: 30px;text-align: left;"> |
| | | <legend>打印预览</legend> |
| | | <div id="template-container" style="margin: 20px;text-align: center"> |
| | | |
| | | <!-- 预览图 1 --> |
| | | <div id="template-preview-1" class="template-preview" style="display: inline-block"> |
| | | <div id="template-preview-1" class="template-preview" style="display: none"> |
| | | <table class="contain" width="280" style="overflow: hidden;font-size: xx-small;table-layout: fixed;"> |
| | | <tr style="height: 74px"> |
| | | <td colspan="3" align="center" scope="col">物料号</td> |
| | |
| | | </div> |
| | | |
| | | <!-- 预览图 4 --> |
| | | <div id="template-preview-4" class="template-preview" style="display: none"> |
| | | <div id="template-preview-4" class="template-preview" style="display: inline-block"> |
| | | <table class="contain" width="280" style="overflow: hidden;font-size: xx-small;table-layout: fixed;"> |
| | | <tr style="height: 37px"> |
| | | <td align="center" scope="col" >商品</td> |