| | |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.common.model.LocDetlDto; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.jdbc.core.JdbcTemplate; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.*; |
| | | |
| | |
| | | @RequestMapping("/open/api") |
| | | public class OpenController { |
| | | |
| | | private boolean pickSite = false; |
| | | @Autowired |
| | | private LocDetlService locDetlService; |
| | | @Autowired |
| | |
| | | private BasDevpService basDevpService; |
| | | @Autowired |
| | | private WrkMastService wrkMastService; |
| | | @Autowired |
| | | private JdbcTemplate jdbcTemplate; |
| | | |
| | | @PostMapping("/stockOut/prew") |
| | | @Transactional |
| | |
| | | if (issued > 0) { |
| | | // 生成出库工作档 |
| | | |
| | | int priorCount = jdbcTemplate.queryForObject("select isnull(count(*),0) from man_prior where 1=1 and matnr = '" + param.getMatnr() + "'", Integer.class); |
| | | |
| | | // 全板 |
| | | if (issued>=locDetl.getAnfme()) { |
| | | BasDevp staNo = basDevpService.checkSiteStatus(103); |
| | |
| | | dto.setLocDetl(locDetl); |
| | | dto.setCount(issued>=locDetl.getAnfme()?locDetl.getAnfme():issued); |
| | | detlDtos.add(dto); |
| | | workService.stockOut(staNo, detlDtos, 101, 9527L, param.getAllotNo(), Cools.isEmpty(param.getAllotNo())); |
| | | workService.stockOut(staNo, detlDtos, 101, 9527L, param.getAllotNo(), Cools.isEmpty(param.getAllotNo()), null); |
| | | // 拣料 |
| | | } else { |
| | | BasDevp staNo = basDevpService.checkSiteStatus(107); |
| | | List<LocDetlDto> detlDtos = new ArrayList<>(); |
| | | LocDetlDto dto = new LocDetlDto(); |
| | | dto.setLocDetl(locDetl); |
| | | dto.setCount(issued>=locDetl.getAnfme()?locDetl.getAnfme():issued); |
| | | detlDtos.add(dto); |
| | | workService.stockOut(staNo, detlDtos, 103, 9527L, param.getAllotNo(), Cools.isEmpty(param.getAllotNo())); |
| | | |
| | | if (priorCount > 0) { |
| | | BasDevp staNo = basDevpService.checkSiteStatus(103); |
| | | List<LocDetlDto> detlDtos = new ArrayList<>(); |
| | | LocDetlDto dto = new LocDetlDto(); |
| | | dto.setLocDetl(locDetl); |
| | | dto.setCount(locDetl.getAnfme()); |
| | | detlDtos.add(dto); |
| | | workService.stockOut(staNo, detlDtos, 101, 9527L, param.getAllotNo(), Cools.isEmpty(param.getAllotNo()), locDetl.getAnfme()-issued); |
| | | } else { |
| | | BasDevp staNo = basDevpService.checkSiteStatus(pickSite?113:109); |
| | | List<LocDetlDto> detlDtos = new ArrayList<>(); |
| | | LocDetlDto dto = new LocDetlDto(); |
| | | dto.setLocDetl(locDetl); |
| | | dto.setCount(issued>=locDetl.getAnfme()?locDetl.getAnfme():issued); |
| | | detlDtos.add(dto); |
| | | workService.stockOut(staNo, detlDtos, 103, 9527L, param.getAllotNo(), Cools.isEmpty(param.getAllotNo()), null); |
| | | } |
| | | |
| | | } |
| | | |
| | | PakoutVo pakoutVo = new PakoutVo(); |
| | |
| | | |
| | | } |
| | | } |
| | | |
| | | pickSite = !pickSite; |
| | | return R.ok().add(result); |
| | | } |
| | | |
| | |
| | | dto.setLocDetl(locDetl); |
| | | dto.setCount(issued>=locDetl.getAnfme()?locDetl.getAnfme():issued); |
| | | detlDtos.add(dto); |
| | | workService.stockOut(staNo, detlDtos, 101, 9527L, param.getAllotNo(), Cools.isEmpty(param.getAllotNo())); |
| | | workService.stockOut(staNo, detlDtos, 101, 9527L, param.getAllotNo(), Cools.isEmpty(param.getAllotNo()), null); |
| | | } else { // 拣料 |
| | | BasDevp staNo = basDevpService.checkSiteStatus(107); |
| | | List<LocDetlDto> detlDtos = new ArrayList<>(); |
| | |
| | | dto.setLocDetl(locDetl); |
| | | dto.setCount(issued>=locDetl.getAnfme()?locDetl.getAnfme():issued); |
| | | detlDtos.add(dto); |
| | | workService.stockOut(staNo, detlDtos, 103, 9527L, param.getAllotNo(), Cools.isEmpty(param.getAllotNo())); |
| | | workService.stockOut(staNo, detlDtos, 103, 9527L, param.getAllotNo(), Cools.isEmpty(param.getAllotNo()), null); |
| | | } |
| | | PakoutVo pakoutVo = new PakoutVo(); |
| | | pakoutVo.setLocNo(locDetl.getLocNo()); |