| | |
| | | import com.core.common.R; |
| | | import com.zy.asrs.entity.LocDetl; |
| | | import com.zy.asrs.entity.LocMast; |
| | | import com.zy.asrs.entity.WrkMast; |
| | | import com.zy.asrs.entity.param.LocMastInitParam; |
| | | import com.zy.asrs.service.LocDetlService; |
| | | import com.zy.asrs.service.LocMastService; |
| | | import com.zy.asrs.service.WrkMastService; |
| | | import com.zy.common.entity.Parameter; |
| | | import com.zy.common.model.Shelves; |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.*; |
| | |
| | | private LocMastService locMastService; |
| | | @Autowired |
| | | private LocDetlService locDetlService; |
| | | @Value("${channel.equipmentRow}") |
| | | private Integer equipmentRow; |
| | | @Value("${channel.quietRow}") |
| | | private Integer quietRow; |
| | | @Value("${channel.equipmentCount}") |
| | | private Integer equipmentCount; |
| | | @Value("${channel.channelMax}") |
| | | private Integer channelMax; |
| | | @Autowired |
| | | private WrkMastService wrkMastService; |
| | | |
| | | @RequestMapping(value = "/locMast/init/pwd") |
| | | public R locMastInitPwd(@RequestParam(required = false) String pwd) { |
| | |
| | | wrapper.ge(entry.getKey(), DateUtils.convert(dates[0])); |
| | | wrapper.le(entry.getKey(), DateUtils.convert(dates[1])); |
| | | } else { |
| | | wrapper.like(entry.getKey(), val); |
| | | if (entry.getKey().equals("loc_type1")){ |
| | | wrapper.eq(entry.getKey(), val); |
| | | }else { |
| | | wrapper.like(entry.getKey(), val); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | if (locMast.getLocSts().equals("O") || locMast.getLocSts().equals("D")) { |
| | | locDetlService.delete(new EntityWrapper<LocDetl>().eq("loc_no", locMast.getLocNo())); |
| | | } |
| | | } |
| | | if(locMast.getFreeze()==1&&locMast.getPackStatus()==6){ |
| | | locMast.setPackStatus(5); |
| | | locMast.setLocSts("F"); |
| | | wrkMastService.delete(new EntityWrapper<WrkMast>().eq("source_loc_no",locMast.getLocNo())); |
| | | } |
| | | locMast.setModiUser(getUserId()); |
| | | locMast.setModiTime(new Date()); |
| | |
| | | locMast.setBay1(b); // 列 |
| | | locMast.setLev1(l); // 层 |
| | | locMast.setCrnNo(crnNo); // 堆垛机 |
| | | locMast.setLocType1(!Cools.isEmpty(param.getLocType1()) ? param.getLocType1() : 1); |
| | | locMast.setLocType2(param.getLocType2()); |
| | | locMast.setLocType3(param.getLocType3()); |
| | | locMast.setLocType1((short)0); |
| | | locMast.setLocType2((short)0); |
| | | locMast.setLocType3((short)0); |
| | | locMast.setAppeUser(getUserId()); |
| | | locMast.setAppeTime(now); |
| | | locMast.setModiUser(getUserId()); |
| | | locMast.setModiTime(now); |
| | | if (r==equipmentRow && b<3){ |
| | | locMast.setChannel(l+(b-2)*param.getEndLev()); |
| | | locMast.setLocType1((short)1); |
| | | int i = (locMast.getChannel() - 1) / (channelMax / equipmentCount) + 1; |
| | | locMast.setLocType2((short)i); |
| | | } |
| | | if (r==quietRow && b<3){ |
| | | locMast.setLocType1((short)2); |
| | | } |
| | | list.add(locMast); |
| | | } |
| | | } |
| | | } |
| | | // locMastService.delete(new EntityWrapper<>()); |
| | | locMastService.delete(new EntityWrapper<>()); |
| | | locDetlService.delete(new EntityWrapper<>()); |
| | | locMastService.insertBatch(list); |
| | | return R.ok("初始化成功"); |
| | |
| | | } |
| | | |
| | | private R updateAll(String param,String locSts){ |
| | | List<LocMast> list = JSONArray.parseArray(param, LocMast.class); |
| | | if (Cools.isEmpty(list)){ |
| | | List<LocMast> locMasts = JSONArray.parseArray(param, LocMast.class); |
| | | if (Cools.isEmpty(locMasts)){ |
| | | return R.error(); |
| | | } |
| | | int locType2=99; |
| | | for (LocMast locMast : list){ |
| | | if (!locMast.getLocSts().equals(locSts)){ |
| | | for (LocMast locMast : locMasts){ |
| | | if (Cools.isEmpty(locMast.getLocType2()) || locMast.getLocType2() == 0){ |
| | | return R.error("请选择测试库位"); |
| | | }else if (!locMast.getLocSts().equals(locSts)){ |
| | | if (locSts.equals("O")){ |
| | | return R.error("此设备下有库位非空,库位号:"+locMast.getLocNo()+"\t请查看库位"); |
| | | }else if (locSts.equals("X")){ |
| | |
| | | }else if (locSts.equals("X")){ |
| | | locSts="O"; |
| | | } |
| | | for (LocMast locMast : list){ |
| | | for (LocMast locMast : locMasts){ |
| | | if (Cools.isEmpty(locMast) || null==locMast.getLocNo()){ |
| | | return R.error("库位号为空:"+locMast); |
| | | } |