| | |
| | | @Select("SELECT SUM(anfme) FROM agv_loc_detl WHERE loc_no = #{locNo}") |
| | | Double sumByLocNo(@Param("locNo")String locNo); |
| | | |
| | | int updateAnfme(@Param("locNo")String locNo, @Param("anfme")Double anfme, @Param("matnr")String matnr, @Param("batch")String batch, @Param("csocode")String csocode, @Param("isocode")String isocode); |
| | | |
| | | int deleteLocDetl(@Param("locNo")String locNo, @Param("anfme")Double anfme, @Param("matnr")String matnr, @Param("batch")String batch, @Param("csocode")String csocode, @Param("isocode")String isocode); |
| | | |
| | | AgvLocDetl selectLocdetl(@Param("locNo")String locNo, @Param("matnr")String matnr, @Param("batch")String batch, @Param("csocode")String csocode, @Param("isocode")String isocode); |
| | | } |
| | |
| | | |
| | | public List<AgvLocDetl> selectByTaskDto(TaskDto taskDto); |
| | | |
| | | public AgvLocDetl selectByMatnrAndBatchAndCsocodeAndisoCode(String matnr, String batch, String csocode, String isocode); |
| | | public AgvLocDetl selectByMatnrAndBatchAndCsocodeAndisoCode(String locNo, String matnr, String batch, String csocode, String isocode); |
| | | |
| | | public Double selectSumAnfmeByLocNo(String locNo); |
| | | |
| | | public AgvLocDetl selectLocdetl(String locNo,String matnr,String batch,String csocode,String isocode); |
| | | |
| | | } |
| | |
| | | Utils.confirmOnlyMat(wrapper,matnr,batch,csocode,isocode); |
| | | wrapper.eq("loc_no", locNo); |
| | | if (anfme <= 0) { |
| | | return this.delete(wrapper); |
| | | return this.baseMapper.deleteLocDetl(locNo,anfme,matnr,batch,csocode,isocode) > 0; |
| | | } else { |
| | | AgvLocDetl agvLocDetl = this.selectOne(wrapper); |
| | | agvLocDetl.setAnfme(anfme); |
| | | return this.update(agvLocDetl,wrapper); |
| | | //return this.update(agvLocDetl,wrapper); |
| | | //return baseMapper.updateAnfme(anfme, locNo, matnr, batch) > 0; |
| | | return this.baseMapper.updateAnfme(locNo,anfme,matnr,batch,csocode,isocode) > 0; |
| | | } |
| | | } |
| | | |
| | |
| | | List<AgvLocDetl> agvLocDetls = new ArrayList<>(); |
| | | |
| | | taskDto.getLocDtos().forEach(locDto -> { |
| | | AgvLocDetl agvLocDetl = this.selectByMatnrAndBatchAndCsocodeAndisoCode(locDto.getMatnr(), locDto.getBatch(), locDto.getCsocode(), locDto.getIsoseq()); |
| | | AgvLocDetl agvLocDetl = this.selectByMatnrAndBatchAndCsocodeAndisoCode(locDto.getLocNo(),locDto.getMatnr(), locDto.getBatch(), locDto.getCsocode(), locDto.getIsoseq()); |
| | | //AgvLocDetl agvLocDetl = this.selectLocdetl(locDto.getLocNo(),locDto.getMatnr(),locDto.getBatch(),locDto.getCsocode(),locDto.getIsoseq()); |
| | | agvLocDetls.add(agvLocDetl); |
| | | }); |
| | | return agvLocDetls; |
| | | } |
| | | |
| | | @Override |
| | | public AgvLocDetl selectByMatnrAndBatchAndCsocodeAndisoCode(String matnr, String batch, String csocode, String isocode) { |
| | | public AgvLocDetl selectByMatnrAndBatchAndCsocodeAndisoCode(String locNo, String matnr, String batch, String csocode, String isocode) { |
| | | EntityWrapper<AgvLocDetl> wrapper = new EntityWrapper<>(); |
| | | wrapper.eq("loc_no",locNo); |
| | | Utils.confirmOnlyMat(wrapper,matnr,batch,csocode,isocode); |
| | | return this.selectOne(wrapper); |
| | | } |
| | |
| | | return this.baseMapper.sumByLocNo(locNo); |
| | | } |
| | | |
| | | @Override |
| | | public AgvLocDetl selectLocdetl(String locNo, String matnr, String batch, String csocode, String isocode) { |
| | | return this.baseMapper.selectLocdetl(locNo,matnr,batch,csocode,isocode); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | long wrkSts = 21L; |
| | | String sourceLocNo = taskDto.getLocNo(); |
| | | String targetLocNo = taskDto.getAgvStaNo(); |
| | | String barcode = agvLocDetls.get(0).getSuppCode(); |
| | | //String barcode = agvLocDetls.get(0).getSuppCode(); |
| | | String containerCode = taskDto.getLocDtos().get(0).getContainerCode(); |
| | | |
| | | |
| | | //判断是否全板出库 |
| | | int ioType = isPakOut(sourceLocNo,taskDto) ? 101 : 103; |
| | | //生成工作档 |
| | | AgvWrkMast wrkMast = createWrkMast(ioType,wrkSts,sourceLocNo,targetLocNo,barcode,now,userId,false); |
| | | AgvWrkMast wrkMast = createWrkMast(ioType,wrkSts,sourceLocNo,targetLocNo,containerCode,now,userId,false); |
| | | //生成工作档明细 |
| | | taskDto.getLocDtos().forEach(locDto -> { |
| | | //明细档所需参数 |
| | |
| | | //agvWrkDetlService.update(agvWrkDetl,new EntityWrapper<AgvWrkDetl>().eq("wrk_no",agvWrkDetl.getWrkNo())); |
| | | //修改库存信息 |
| | | agvWrkDetlList.forEach(agvWrkDetl -> { |
| | | AgvLocDetl agvLocDetl = agvLocDetlService.selectByMatnrAndBatchAndCsocodeAndisoCode(agvWrkDetl.getMatnr(), agvWrkDetl.getBatch(), agvWrkDetl.getThreeCode(), agvWrkDetl.getDeadTime()); |
| | | AgvLocDetl agvLocDetl = agvLocDetlService.selectByMatnrAndBatchAndCsocodeAndisoCode(agvWrkMast.getLocNo(), agvWrkDetl.getMatnr(), agvWrkDetl.getBatch(), agvWrkDetl.getThreeCode(), agvWrkDetl.getDeadTime()); |
| | | |
| | | //AgvLocDetl agvLocDetl = agvLocDetlService.selectLocdetl(agvWrkMast.getLocNo(),agvWrkDetl.getMatnr(),agvWrkDetl.getBatch(),agvWrkDetl.getThreeCode(),agvWrkDetl.getDeadTime()); |
| | | double updateAnfme = agvLocDetl.getAnfme() - agvWrkDetl.getAnfme(); |
| | | agvLocDetlService.updateAnfme(updateAnfme,agvLocDetl.getLocNo(),agvLocDetl.getMatnr(),agvLocDetl.getBatch(),agvLocDetl.getThreeCode(),agvLocDetl.getDeadTime()); |
| | | }); |
| | |
| | | ) t where t.row between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize}) |
| | | </select> |
| | | |
| | | <select id="selectLocdetl" resultType="com.zy.asrs.entity.AgvLocDetl"> |
| | | select * from agv_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> |
| | | <choose> |
| | | <when test="csocode != null and csocode != ''"> |
| | | and three_code = #{csocode} |
| | | </when> |
| | | <otherwise> |
| | | and (three_code IS NULL OR three_code = '') |
| | | </otherwise> |
| | | </choose> |
| | | <choose> |
| | | <when test="isocode != null and isocode != ''"> |
| | | and dead_time = #{isocode} |
| | | </when> |
| | | <otherwise> |
| | | and (dead_time IS NULL OR dead_time = '') |
| | | </otherwise> |
| | | </choose> |
| | | </select> |
| | | |
| | | <update id="updateAnfme"> |
| | | update agv_loc_detl |
| | | set anfme = #{anfme} |
| | | 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> |
| | | <choose> |
| | | <when test="csocode != null and csocode != ''"> |
| | | and three_code = #{csocode} |
| | | </when> |
| | | <otherwise> |
| | | and (three_code IS NULL OR three_code = '') |
| | | </otherwise> |
| | | </choose> |
| | | <choose> |
| | | <when test="isocode != null and isocode != ''"> |
| | | and dead_time = #{isocode} |
| | | </when> |
| | | <otherwise> |
| | | and (dead_time IS NULL OR dead_time = '') |
| | | </otherwise> |
| | | </choose> |
| | | </update> |
| | | |
| | | <delete id = "deleteLocDetl"> |
| | | delete from agv_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> |
| | | <choose> |
| | | <when test="csocode != null and csocode != ''"> |
| | | and three_code = #{csocode} |
| | | </when> |
| | | <otherwise> |
| | | and (three_code IS NULL OR three_code = '') |
| | | </otherwise> |
| | | </choose> |
| | | <choose> |
| | | <when test="isocode != null and isocode != ''"> |
| | | and dead_time = #{isocode} |
| | | </when> |
| | | <otherwise> |
| | | and (dead_time IS NULL OR dead_time = '') |
| | | </otherwise> |
| | | </choose> |
| | | </delete> |
| | | |
| | | <select id="getStockStatisCount" parameterType="java.util.Map" resultType="java.lang.Integer"> |
| | | select count(1) as count from |
| | | ( |
| | |
| | | group by a.matnr |
| | | ) b |
| | | </select> |
| | | |
| | | </mapper> |