| | |
| | | return R.ok().add(matParam); |
| | | } |
| | | |
| | | @RequestMapping(value = "/mat/back") |
| | | @ManagerAuth |
| | | public R pdaSearchBack(@RequestParam String matnr) { |
| | | EntityWrapper<NccJcQilibcBarcodeflowWms> wrapper = new EntityWrapper<>(); |
| | | wrapper.eq("VBARCODE", matnr).orderBy("ts", false); |
| | | NccJcQilibcBarcodeflowWms nccJcQilibcBarcodeflowWms = nccJcQilibcBarcodeflowWmsService.selectOne(wrapper); |
| | | if (null == nccJcQilibcBarcodeflowWms) { |
| | | return R.error("未找到此条码"); |
| | | } else { |
| | | if (!nccJcQilibcBarcodeflowWms.getInfla().equals("出库")) { |
| | | return R.error("该条码最后一次不是出库"); |
| | | } |
| | | } |
| | | Mat mat = matService.selectByMatnr(nccJcQilibcBarcodeflowWms.getWlbm()); |
| | | MatParam matParam = new MatParam(); |
| | | Synchro.Copy(mat, matParam); |
| | | matParam.setBatch(nccJcQilibcBarcodeflowWms.getVbatchcode()); |
| | | matParam.setAnfme(nccJcQilibcBarcodeflowWms.getAsnnum() == null ? 0.0D : nccJcQilibcBarcodeflowWms.getAsnnum().doubleValue()); |
| | | matParam.setAnfme2(nccJcQilibcBarcodeflowWms.getNastnum() == null ? 0.0D : nccJcQilibcBarcodeflowWms.getNastnum().doubleValue()); |
| | | matParam.setTiaoma(nccJcQilibcBarcodeflowWms.getVbarcode()); |
| | | return R.ok().add(matParam); |
| | | } |
| | | |
| | | @RequestMapping("/comb/auth") |
| | | @ManagerAuth(memo = "组托") |
| | | public R comb(@RequestBody CombParam combParam) { |
| | |
| | | @Param("brand")String brand,@Param("standby1")String standby1,@Param("standby2")String standby2, |
| | | @Param("standby3")String standby3,@Param("boxType1")String boxType1,@Param("boxType2")String boxType2,@Param("boxType3")String boxType3 ); |
| | | |
| | | int updateWeight(@Param("weight")Double weight, @Param("locNo")String locNo, @Param("matnr")String matnr, @Param("batch")String batch, |
| | | @Param("brand")String brand,@Param("standby1")String standby1,@Param("standby2")String standby2, |
| | | @Param("standby3")String standby3,@Param("boxType1")String boxType1,@Param("boxType2")String boxType2,@Param("boxType3")String boxType3 ); |
| | | |
| | | |
| | | List<LocDetl> getStockOutPage(Map<String, Object> map); |
| | | |
| | | Integer getStockOutPageCount(Map<String, Object> map); |
| | |
| | | import com.core.common.R; |
| | | import com.zy.asrs.entity.FrozenParam; |
| | | import com.zy.asrs.entity.LocDetl; |
| | | import com.zy.asrs.entity.Mat; |
| | | import com.zy.asrs.entity.result.LocDetlAll; |
| | | import com.zy.asrs.entity.result.LocDetlDTO; |
| | | import com.zy.asrs.entity.result.StockVo; |
| | | import com.zy.asrs.mapper.LocDetlMapper; |
| | | import com.zy.asrs.service.LocDetlService; |
| | | import com.zy.asrs.service.MatService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | |
| | | |
| | | @Service("locDetlService") |
| | | public class LocDetlServiceImpl extends ServiceImpl<LocDetlMapper, LocDetl> implements LocDetlService { |
| | | |
| | | @Autowired |
| | | private MatService matService; |
| | | |
| | | @Override |
| | | public Page<LocDetl> getPage(Page<LocDetl> page) { |
| | |
| | | if (anfme <= 0) { |
| | | return this.baseMapper.deleteItem(locNo, matnr, batch, brand, standby1, standby2, standby3, boxType1, boxType2, boxType3) > 0; |
| | | } else { |
| | | return baseMapper.updateAnfme(anfme, locNo, matnr, batch, brand, standby1, standby2, standby3, boxType1, boxType2, boxType3) > 0; |
| | | boolean result = baseMapper.updateAnfme(anfme, locNo, matnr, batch, brand, standby1, standby2, standby3, boxType1, boxType2, boxType3) > 0; |
| | | if (!result) { |
| | | return false; |
| | | } |
| | | |
| | | //更新辅料 |
| | | Mat mat = matService.selectByMatnr(matnr); |
| | | if (mat == null) { |
| | | return false; |
| | | } |
| | | |
| | | //转换关系 |
| | | String origin = mat.getOrigin(); |
| | | String[] split = origin.split("/"); |
| | | //辅单位 |
| | | Double weight = (anfme / Double.parseDouble(split[1])) / Double.parseDouble(split[0]); |
| | | return this.baseMapper.updateWeight(weight, locNo, matnr, batch, brand, standby1, standby2, standby3, boxType1, boxType2, boxType3) > 0; |
| | | } |
| | | } |
| | | |
| | |
| | | <include refid="batchSeqNew"></include> |
| | | </update> |
| | | |
| | | <update id="updateWeight"> |
| | | update asr_loc_detl |
| | | set weight = #{weight} |
| | | , modi_time = getdate() |
| | | where 1=1 |
| | | and loc_no = #{locNo} |
| | | and matnr = #{matnr} |
| | | <include refid="batchSeqNew"></include> |
| | | </update> |
| | | |
| | | <sql id="stockOutCondition"> |
| | | <if test="loc_no!=null and loc_no!='' "> |
| | | and a.loc_no like '%' + #{loc_no} + '%' |