| | |
| | | @Repository |
| | | public interface LocDetlMapper extends BaseMapper<LocDetl> { |
| | | |
| | | LocDetl selectItem(@Param("locNo")String locNo, @Param("matnr")String matnr, @Param("batch")String batch); |
| | | |
| | | List<LocDetl> getStockOutPage(Map<String, Object> map); |
| | | |
| | | Integer getStockOutPageCount(Map<String, Object> map); |
| | |
| | | |
| | | public interface LocDetlService extends IService<LocDetl> { |
| | | |
| | | LocDetl selectItem(String locNo, String matnr, String batch); |
| | | |
| | | Page<LocDetl> getStockOut(Page<LocDetl> page); |
| | | |
| | | /** |
| | | * 修改库存明细数量,如果数量为0,则删除记录 |
| | | */ |
| | | boolean updateAnfme(Double anfme, String locNo, String matnr); |
| | | boolean updateAnfme(Double anfme, String locNo, String matnr, String batch); |
| | | |
| | | boolean updateLocNo(String newLocNo, String oldLocNo); |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public boolean updateAnfme(Double anfme, String locNo, String matnr) { |
| | | public boolean updateAnfme(Double anfme, String locNo, String matnr, String batch) { |
| | | if (anfme <= 0) { |
| | | return delete(new EntityWrapper<LocDetl>().eq("loc_no", locNo).eq("matnr", matnr)); |
| | | } else { |
| | |
| | | public Double queryStockAnfme(String matnr, String batch) { |
| | | return this.baseMapper.queryStockAnfme(matnr, batch); |
| | | } |
| | | |
| | | @Override |
| | | public LocDetl selectItem(String locNo, String matnr, String batch) { |
| | | return this.baseMapper.selectItem(locNo, matnr, batch); |
| | | } |
| | | } |
| | |
| | | import com.zy.asrs.task.AbstractHandler; |
| | | import com.zy.asrs.task.core.ReturnT; |
| | | import com.zy.asrs.utils.VersionUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | /** |
| | | * Created by vincent on 2020/7/4 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | @Transactional |
| | | public class WorkMastHandler extends AbstractHandler<String> { |
| | |
| | | if (null == locMast) { |
| | | exceptionHandle("工作档[workNo={0}]库位号错误[locNo={1}]", wrkMast.getWrkNo(), wrkMast.getLocNo()); |
| | | } |
| | | assert locMast != null; |
| | | switch (wrkMast.getIoType()) { |
| | | // 空板入库 |
| | | case 10: |
| | |
| | | } |
| | | // 遍历工作明细,更新库存明细和入库通知档 |
| | | for (WrkDetl wrkDetl : wrkDetls) { |
| | | LocDetl locDetl = locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("loc_no", wrkMast.getLocNo()).eq("matnr", wrkDetl.getMatnr())); |
| | | |
| | | LocDetl locDetl = locDetlService.selectItem(wrkMast.getLocNo(), wrkDetl.getMatnr(), wrkDetl.getBatch()); |
| | | if (null != locDetl) { |
| | | boolean res = locDetlService.updateAnfme(wrkDetl.getAnfme(), wrkMast.getLocNo(), wrkDetl.getMatnr()); |
| | | if (!res) { |
| | | if (!locDetlService.updateAnfme(wrkDetl.getAnfme(), wrkMast.getLocNo(), wrkDetl.getMatnr())) { |
| | | exceptionHandle("全板入库 ===>> 更新库存明细失败;[workNo={0}],[locNo={1}]", wrkMast.getWrkNo(), wrkMast.getLocNo()); |
| | | } |
| | | } else { |
| | |
| | | exceptionHandle("全板入库 ===>> 添加库存明细失败;[workNo={0}],[locNo={1}]", wrkMast.getWrkNo(), wrkMast.getLocNo()); |
| | | } |
| | | } |
| | | |
| | | // 更新入库通知档 ioStatus ===>> Y |
| | | try { |
| | | WaitPakin setParam = new WaitPakin(); |
| | |
| | | exceptionHandle("更新入库完成状态失败;[workNo={0}]", wrkMast.getWrkNo()); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("fail", e); |
| | | e.printStackTrace(); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | return FAIL.setMsg(e.getMessage()); |
| | |
| | | if (null == locMast) { |
| | | exceptionHandle("工作档[workNo={0}]库位号错误[locNo={1}]", wrkMast.getWrkNo(), wrkMast.getLocNo()); |
| | | } |
| | | assert locMast != null; |
| | | switch (wrkMast.getIoType()) { |
| | | // 全板出库 |
| | | case 101: |
| | |
| | | exceptionHandle("更新出库完成状态失败;[workNo={0}]", wrkMast.getWrkNo()); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("fail", e); |
| | | e.printStackTrace(); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | return FAIL.setMsg(e.getMessage()); |
| | |
| | | <result column="appe_time" property="appeTime" /> |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="selectItem" resultMap="BaseResultMap"> |
| | | select top 1 * |
| | | from asr_loc_detl |
| | | where 1=1 |
| | | and loc_no = #{locNo} |
| | | and matnr = #{matnr} |
| | | <choose> |
| | | <when test="batch != null and batch != ''"> |
| | | and batch = #{batch} |
| | | </when> |
| | | <otherwise> |
| | | and (batch IS NULL OR batch = '') |
| | | </otherwise> |
| | | </choose> |
| | | </select> |
| | | |
| | | <sql id="stockOutCondition"> |
| | | <if test="loc_no!=null and loc_no!='' "> |
| | | and a.loc_no like '%' + #{loc_no} + '%' |