fix:来料入库接口
This commit is contained in:
@@ -16,10 +16,9 @@ import org.nl.wms.pda_manage.ios_manage.service.PdaIosInService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
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.Map;
|
||||
|
||||
import static org.nl.common.utils.ValidationUtil.assertNotBlankJson;
|
||||
|
||||
@@ -120,18 +119,21 @@ public class PdaIosInController {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 中钨来料入库
|
||||
*/
|
||||
@PostMapping("/zwConfirmIn")
|
||||
@Log("中钨组盘入库确认")
|
||||
public ResponseEntity<Object> zwConfirmIn(@RequestBody ZwConfirmInDto dto) {
|
||||
if(StringUtils.isEmpty(dto.getFormDataCode())){
|
||||
if(StringUtils.isEmpty(dto.getForm_data_code())){
|
||||
throw new IllegalArgumentException("单据编码不能为空!");
|
||||
}
|
||||
|
||||
if(CollectionUtils.isEmpty(dto.getParamList())){
|
||||
if(CollectionUtils.isEmpty(dto.getParam_list())){
|
||||
throw new IllegalArgumentException("请传入参数!");
|
||||
}
|
||||
|
||||
for(ZwConfirmInParamDto paramDto : dto.getParamList()){
|
||||
for(ZwConfirmInParamDto paramDto : dto.getParam_list()){
|
||||
if(StringUtils.isBlank(paramDto.getVehicle_code()) || StringUtils.isBlank(paramDto.getSite_code()))
|
||||
throw new IllegalArgumentException("载具且卸货区点位不能为空!");
|
||||
}
|
||||
@@ -139,6 +141,15 @@ public class PdaIosInController {
|
||||
return new ResponseEntity<>(pdaIosInService.zwConfirmIn(dto), HttpStatus.OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* 中钨单据查询
|
||||
*/
|
||||
@GetMapping("/getFormDataList")
|
||||
@Log("中钨单据查询")
|
||||
public ResponseEntity<Object> getFormDataList(@RequestParam Map whereJson) {
|
||||
return new ResponseEntity<>(pdaIosInService.getFormDataList(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 拣选余料回库物料查询
|
||||
|
||||
@@ -6,6 +6,6 @@ import java.util.List;
|
||||
|
||||
@Data
|
||||
public class ZwConfirmInDto {
|
||||
private String formDataCode;
|
||||
private List<ZwConfirmInParamDto> paramList;
|
||||
private String form_data_code;
|
||||
private List<ZwConfirmInParamDto> param_list;
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import org.nl.wms.pda_manage.ios_manage.dto.ZwConfirmInDto;
|
||||
import org.nl.wms.pda_manage.util.PdaResponse;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -102,7 +103,12 @@ public interface PdaIosInService {
|
||||
PdaResponse getRegion(JSONObject whereJson);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询单据列表
|
||||
*
|
||||
* @return PdaResponse
|
||||
*/
|
||||
PdaResponse getFormDataList(Map whereJson);
|
||||
|
||||
/**
|
||||
* 入库确认
|
||||
|
||||
@@ -310,6 +310,24 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
||||
return PdaResponse.requestParamOk(regionList.getRecords());
|
||||
}
|
||||
|
||||
@Override
|
||||
public PdaResponse getFormDataList(Map whereJson) {
|
||||
List<Dict> dictList = sysDictMapper.selectList(new LambdaQueryWrapper<Dict>()
|
||||
.eq(Dict::getCode, "INANDOUT_BILL_TYPE")
|
||||
.eq(Dict::getLabel,"来料入库"));
|
||||
|
||||
if(CollectionUtils.isEmpty(dictList)){
|
||||
throw new BadRequestException("出入库单据类型中,来料入库字典未配置。");
|
||||
}
|
||||
|
||||
return PdaResponse.requestParamOk(iPmFormDataService.list(new LambdaUpdateWrapper<PmFormData>()
|
||||
.eq(PmFormData::getIs_finish, 0)
|
||||
.like(whereJson.containsKey("form_data_code"),
|
||||
PmFormData::getCode, whereJson.get("form_data_code"))
|
||||
.eq(PmFormData::getForm_type, dictList.get(0).getValue())
|
||||
.ne(PmFormData::getStatus, IOSEnum.BILL_STATUS.code("完成"))));
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject getVehicleMaterial(JSONObject whereJson) {
|
||||
whereJson.put("status", GROUP_PLATE_STATUS.code("组盘"));
|
||||
@@ -566,11 +584,11 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
||||
}
|
||||
|
||||
List<PmFormData> formDataList = iPmFormDataService.list(new LambdaUpdateWrapper<PmFormData>()
|
||||
.eq(PmFormData::getCode, dto.getFormDataCode())
|
||||
.eq(PmFormData::getCode, dto.getForm_data_code())
|
||||
.eq(PmFormData::getStatus, IOSEnum.BILL_STATUS.code("完成")));
|
||||
|
||||
if(CollectionUtils.isNotEmpty(formDataList)){
|
||||
throw new BadRequestException("单据" +dto.getFormDataCode() +"已完成!");
|
||||
throw new BadRequestException("单据" +dto.getForm_data_code() +"已完成!");
|
||||
}
|
||||
|
||||
//循环判断每个 如果有问题,则抛出异常
|
||||
@@ -578,7 +596,7 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
||||
Integer taskGroupSeq = 0 ;
|
||||
String taskGroupId = IdUtil.getStringId();
|
||||
List<JSONObject> jsonObjectList = new ArrayList<>();
|
||||
for (ZwConfirmInParamDto paramDto : dto.getParamList()) {
|
||||
for (ZwConfirmInParamDto paramDto : dto.getParam_list()) {
|
||||
|
||||
//判断点位和仓位是否有正在执行的任务
|
||||
List<SchBaseTask> schBaseTaskList = iSchBaseTaskService.list(new LambdaQueryWrapper<SchBaseTask>()
|
||||
@@ -665,7 +683,7 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
||||
whereJson.put("task_group_seq",taskGroupSeq);
|
||||
whereJson.put("task_group_id",taskGroupId);
|
||||
|
||||
whereJson.put("form_data_code",dto.getFormDataCode());
|
||||
whereJson.put("form_data_code",dto.getForm_data_code());
|
||||
|
||||
jsonObjectList.add(whereJson);
|
||||
//下一个的托盘放置点为本次的起点
|
||||
|
||||
@@ -28,9 +28,5 @@ public class SysParamConstant {
|
||||
*/
|
||||
public final static String ERP_URL = "erp_url";
|
||||
|
||||
/**
|
||||
* MES系统IP
|
||||
*/
|
||||
public final static String MES_URL = "mes_url";
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user