自动化立体仓库 - WMS系统
王佳豪
2021-06-03 a1844a7fc934ca943db810b1bd2a450f948607cd
src/main/java/com/zy/asrs/controller/OpenController.java
@@ -15,11 +15,9 @@
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.*;
@@ -40,6 +38,8 @@
    private BasDevpService basDevpService;
    @Autowired
    private WrkMastService wrkMastService;
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @PostMapping("/stockOut/prew")
    @Transactional
@@ -139,6 +139,8 @@
                    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);
@@ -147,16 +149,28 @@
                            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(113);
                                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();