fix: 1、来料入库 2、空载具入库 3、手工叫料 4、手工退料 5、物料组盘 6、新增 确认取货 问题修复
This commit is contained in:
@@ -108,31 +108,18 @@ public class GroupController {
|
||||
|
||||
if (!CollectionUtils.isEmpty(pmFormDataList)) {
|
||||
|
||||
if((new BigDecimal(1)).compareTo(pmFormDataList.get(0).getQty().subtract(pmFormDataList.get(0).getAssign_qty())) > 0){
|
||||
throw new BadRequestException("组盘数量大于单据剩余数量,请核对!");
|
||||
}
|
||||
|
||||
if(!pmFormDataList.get(0).getMaterial_code().equals(groupPlate.getMaterial_code())){
|
||||
throw new BadRequestException("组盘的物料编码与单据的物料编码不一致,请核对!");
|
||||
}
|
||||
|
||||
if ((new BigDecimal(1)).compareTo(pmFormDataList.get(0).getQty().subtract(pmFormDataList.get(0).getAssign_qty())) == 0) {
|
||||
iPmFormDataService.update(
|
||||
new LambdaUpdateWrapper<PmFormData>()
|
||||
.set(PmFormData::getStatus, StatusEnum.FORM_STATUS.code("已分配"))
|
||||
.set(PmFormData::getAssign_qty, pmFormDataList.get(0).getAssign_qty().add(new BigDecimal(1)))
|
||||
.set(PmFormData::getUpdate_time, DateUtil.now())
|
||||
.set(PmFormData::getUpdate_name, SecurityUtils.getCurrentNickName())
|
||||
.eq(PmFormData::getCode, groupPlate.getExt_code()));
|
||||
} else {
|
||||
iPmFormDataService.update(
|
||||
new LambdaUpdateWrapper<PmFormData>()
|
||||
.set(PmFormData::getAssign_qty, pmFormDataList.get(0).getAssign_qty().add(new BigDecimal(1)))
|
||||
.set(PmFormData::getStatus, StatusEnum.FORM_STATUS.code("执行中"))
|
||||
.set(PmFormData::getUpdate_time, DateUtil.now())
|
||||
.set(PmFormData::getUpdate_name, SecurityUtils.getCurrentNickName())
|
||||
.eq(PmFormData::getCode, groupPlate.getExt_code()));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
//修改点位表中的点位为有料
|
||||
|
||||
@@ -49,12 +49,14 @@ public class SupplierController {
|
||||
iMdCsSupplierbaseService.create(dto);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PostMapping("/drop-list")
|
||||
@Log("获取供应商下拉框")
|
||||
public ResponseEntity<Object> dropList(@RequestBody MdCsSupplierbase dto) {
|
||||
return new ResponseEntity<>(iMdCsSupplierbaseService.list(), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@PutMapping
|
||||
@Log("修改供应商")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody MdCsSupplierbase dto) {
|
||||
@@ -82,4 +84,6 @@ public class SupplierController {
|
||||
iMdCsSupplierbaseService.downloadImportSuppTemplate(response);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -9,9 +9,11 @@ import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.common.base.TableDataInfo;
|
||||
import org.nl.common.logging.annotation.Log;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdCsSupplierbase;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdMeMaterialbase;
|
||||
import org.nl.wms.pda_manage.ios_manage.dto.ZwConfirmInDto;
|
||||
import org.nl.wms.pda_manage.ios_manage.dto.ZwConfirmInParamDto;
|
||||
import org.nl.wms.pda_manage.ios_manage.service.PdaIosCheckService;
|
||||
import org.nl.wms.pda_manage.ios_manage.service.PdaIosInService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
@@ -38,6 +40,9 @@ public class PdaIosInController {
|
||||
@Autowired
|
||||
private PdaIosInService pdaIosInService;
|
||||
|
||||
@Autowired
|
||||
private PdaIosCheckService pdaIosCheckService;
|
||||
|
||||
|
||||
@PostMapping("/groupPlate")
|
||||
@Log("物料组盘确认")
|
||||
@@ -98,7 +103,6 @@ public class PdaIosInController {
|
||||
}
|
||||
|
||||
|
||||
|
||||
@PostMapping("/getRegion")
|
||||
@Log("获取区域")
|
||||
public ResponseEntity<Object> getRegion(@RequestBody JSONObject whereJson) {
|
||||
@@ -162,7 +166,7 @@ public class PdaIosInController {
|
||||
*/
|
||||
@PostMapping("/getFormDataList")
|
||||
@Log("中钨单据查询")
|
||||
public ResponseEntity<Object> getFormDataList(@RequestParam Map whereJson) {
|
||||
public ResponseEntity<Object> getFormDataList(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaIosInService.getFormDataList(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -203,4 +207,42 @@ public class PdaIosInController {
|
||||
assertNotBlankJson(whereJson, "请求参数不能为空", "sect_code", "vehicle_code");
|
||||
return new ResponseEntity<>(pdaIosInService.vehicleInConfirm(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* PDA下拉框
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
|
||||
@PostMapping("/supplier-drop-list")
|
||||
@Log("PDA获取供应商下拉框")
|
||||
public ResponseEntity<Object> pdaDropList(@RequestBody MdCsSupplierbase dto) {
|
||||
return new ResponseEntity<>(pdaIosInService.supplierDroplist(dto), HttpStatus.OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* PDA下拉框
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
|
||||
@PostMapping("/inCheck")
|
||||
@Log("PDA来料入库校验点位和托盘码")
|
||||
public ResponseEntity<Object> inCheck(@RequestBody ZwConfirmInParamDto dto) {
|
||||
return new ResponseEntity<>(pdaIosInService.inCheck(dto), HttpStatus.OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过载具编码获取点位
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
|
||||
@PostMapping("/getPointCodeByVehicleCode")
|
||||
@Log("通过载具编码获取点位")
|
||||
public ResponseEntity<Object> getPointCodeByVehicleCode(@RequestBody JSONObject whereJson) {
|
||||
assertNotBlankJson(whereJson, "请求参数不能为空", "vehicle_code");
|
||||
return new ResponseEntity<>(pdaIosInService.getPointCodeByVehicleCode(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -118,5 +118,30 @@ public class PdaIosOutController {
|
||||
return new ResponseEntity<>(pdaIosOutService.vehicleOutConfirm(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* 确认取货
|
||||
*/
|
||||
@PostMapping("pickUp")
|
||||
@Log("确认取货")
|
||||
public ResponseEntity<Object> pickUp(@RequestBody JSONObject whereJson) {
|
||||
assertNotBlankJson(whereJson, "请求参数不能为空", "point_code","point_status");
|
||||
return new ResponseEntity<>(pdaIosOutService.pickUp(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/getPdaVehicleCodeBySectCode")
|
||||
@Log("PDA根据库区获取料桶号")
|
||||
public ResponseEntity<Object> getPdaVehicleCodeBySectCode(@RequestBody JSONObject whereJson) {
|
||||
assertNotBlankJson(whereJson, "请求参数不能为空", "sect_code");
|
||||
return new ResponseEntity<>(pdaIosOutService.getPdaVehicleCodeBySectCode(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/getMaterialSuppByVehicleCode")
|
||||
@Log("PDA根据库区获取料桶号")
|
||||
public ResponseEntity<Object> getMaterialSuppByVehicleCode(@RequestBody JSONObject whereJson) {
|
||||
assertNotBlankJson(whereJson, "请求参数不能为空", "vehicle_code");
|
||||
return new ResponseEntity<>(pdaIosOutService.getMaterialSuppByVehicleCode(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package org.nl.wms.pda_manage.ios_manage.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdCsSupplierbase;
|
||||
import org.nl.wms.pda_manage.util.PdaResponse;
|
||||
import org.nl.wms.warehouse_manage.service.dao.StIvtCheckdtl;
|
||||
|
||||
|
||||
@@ -3,8 +3,10 @@ package org.nl.wms.pda_manage.ios_manage.service;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.common.base.TableDataInfo;
|
||||
import org.nl.common.domain.vo.SelectItemVo;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdCsSupplierbase;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdMeMaterialbase;
|
||||
import org.nl.wms.pda_manage.ios_manage.dto.ZwConfirmInDto;
|
||||
import org.nl.wms.pda_manage.ios_manage.dto.ZwConfirmInParamDto;
|
||||
import org.nl.wms.pda_manage.util.PdaResponse;
|
||||
|
||||
import java.util.List;
|
||||
@@ -108,6 +110,13 @@ public interface PdaIosInService {
|
||||
*/
|
||||
PdaResponse getPdaStruct(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 查询料桶号
|
||||
*
|
||||
* @return PdaResponse
|
||||
*/
|
||||
PdaResponse getPdaVehicleCodeBySectCode(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 查询区域
|
||||
*
|
||||
@@ -121,7 +130,7 @@ public interface PdaIosInService {
|
||||
*
|
||||
* @return PdaResponse
|
||||
*/
|
||||
PdaResponse getFormDataList(Map whereJson);
|
||||
PdaResponse getFormDataList(JSONObject whereJson);
|
||||
|
||||
|
||||
/**
|
||||
@@ -204,4 +213,21 @@ public interface PdaIosInService {
|
||||
* @return PdaResponse
|
||||
*/
|
||||
PdaResponse vehicleInConfirm(JSONObject whereJson);
|
||||
|
||||
|
||||
|
||||
PdaResponse supplierDroplist (MdCsSupplierbase dto);
|
||||
|
||||
|
||||
|
||||
PdaResponse inCheck (ZwConfirmInParamDto dto);
|
||||
|
||||
/**
|
||||
* 通过载具编码获取点位
|
||||
* @param whereJson {
|
||||
* vehicle_code : 载具编码
|
||||
* }
|
||||
* @return PdaResponse
|
||||
*/
|
||||
PdaResponse getPointCodeByVehicleCode(JSONObject whereJson);
|
||||
}
|
||||
|
||||
@@ -106,4 +106,29 @@ public interface PdaIosOutService {
|
||||
PdaResponse vehicleOutConfirm(JSONObject whereJson);
|
||||
|
||||
|
||||
/**
|
||||
* 确认取货
|
||||
*
|
||||
* @param whereJson {
|
||||
* vehicle_code: 点位
|
||||
* point_status: 点位状态
|
||||
* }
|
||||
* @return PdaResponse
|
||||
*/
|
||||
PdaResponse pickUp(JSONObject whereJson);
|
||||
|
||||
|
||||
/**
|
||||
* 查询料桶号
|
||||
*
|
||||
* @return PdaResponse
|
||||
*/
|
||||
PdaResponse getPdaVehicleCodeBySectCode(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 查询组盘信息通过载具编号
|
||||
*
|
||||
* @return PdaResponse
|
||||
*/
|
||||
PdaResponse getMaterialSuppByVehicleCode(JSONObject whereJson);
|
||||
}
|
||||
|
||||
@@ -155,6 +155,9 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
||||
@Autowired
|
||||
private PdaIosOutService pdaIosOutService;
|
||||
|
||||
@Autowired
|
||||
private IMdCsSupplierbaseService iMdCsSupplierbaseService;
|
||||
|
||||
/**
|
||||
* 入库服务
|
||||
*/
|
||||
@@ -261,31 +264,17 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
||||
if (!org.springframework.util.CollectionUtils.isEmpty(pmFormDataList)) {
|
||||
|
||||
groupDao.setPcsn(pmFormDataList.get(0).getPcsn());
|
||||
if((new BigDecimal(1)).compareTo(pmFormDataList.get(0).getQty().subtract(pmFormDataList.get(0).getAssign_qty())) > 0){
|
||||
throw new BadRequestException("组盘数量大于单据剩余数量,请核对!");
|
||||
}
|
||||
|
||||
if(!pmFormDataList.get(0).getMaterial_code().equals(groupDao.getMaterial_code())){
|
||||
throw new BadRequestException("组盘的物料编码与单据的物料编码不一致,请核对!");
|
||||
}
|
||||
|
||||
if ((new BigDecimal(1)).compareTo(pmFormDataList.get(0).getQty().subtract(pmFormDataList.get(0).getAssign_qty())) == 0) {
|
||||
iPmFormDataService.update(
|
||||
new LambdaUpdateWrapper<PmFormData>()
|
||||
.set(PmFormData::getStatus, StatusEnum.FORM_STATUS.code("已分配"))
|
||||
.set(PmFormData::getAssign_qty, pmFormDataList.get(0).getAssign_qty().add(new BigDecimal(1)))
|
||||
.set(PmFormData::getUpdate_time, DateUtil.now())
|
||||
.set(PmFormData::getUpdate_name, SecurityUtils.getCurrentNickName())
|
||||
.eq(PmFormData::getCode, groupDao.getExt_code()));
|
||||
} else {
|
||||
iPmFormDataService.update(
|
||||
new LambdaUpdateWrapper<PmFormData>()
|
||||
.set(PmFormData::getAssign_qty, pmFormDataList.get(0).getAssign_qty().add(new BigDecimal(1)))
|
||||
.set(PmFormData::getStatus,StatusEnum.FORM_STATUS.code("执行中"))
|
||||
.set(PmFormData::getUpdate_time, DateUtil.now())
|
||||
.set(PmFormData::getUpdate_name, SecurityUtils.getCurrentNickName())
|
||||
.eq(PmFormData::getCode, groupDao.getExt_code()));
|
||||
}
|
||||
}
|
||||
}
|
||||
//修改点位表中的点位为有料
|
||||
@@ -390,6 +379,26 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
||||
return PdaResponse.requestParamOk(selectList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PdaResponse getPdaVehicleCodeBySectCode(JSONObject whereJson) {
|
||||
List<Structattr> structattrList = iStructattrService.list(new LambdaQueryWrapper<Structattr>()
|
||||
.eq(Structattr::getOccupancy_state, 3)
|
||||
.eq(Structattr::getLock_type, "0")
|
||||
.and(wp -> wp
|
||||
.eq(Structattr::getSect_id, whereJson.getString("sect_code"))
|
||||
.or()
|
||||
.eq(Structattr::getSect_code, whereJson.getString("sect_code"))
|
||||
)
|
||||
.isNotNull(Structattr::getStoragevehicle_code)
|
||||
.isNull(Structattr::getTask_code));
|
||||
|
||||
List<SelectItemVo> selectList = new ArrayList<>();
|
||||
structattrList.forEach(r ->
|
||||
selectList.add(SelectItemVo.builder().text(r.getStoragevehicle_code()).value(r.getStoragevehicle_code()).build())
|
||||
);
|
||||
return PdaResponse.requestParamOk(selectList);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public PdaResponse getRegion(JSONObject whereJson) {
|
||||
@@ -423,7 +432,7 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public PdaResponse getFormDataList(Map whereJson) {
|
||||
public PdaResponse getFormDataList(JSONObject whereJson) {
|
||||
List<Dict> dictList = sysDictMapper.selectList(new LambdaQueryWrapper<Dict>()
|
||||
.eq(Dict::getCode, "INANDOUT_BILL_TYPE")
|
||||
.eq(Dict::getLabel,"来料入库"));
|
||||
@@ -432,8 +441,13 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
||||
throw new BadRequestException("出入库单据类型中,来料入库字典未配置。");
|
||||
}
|
||||
|
||||
if(!whereJson.containsKey("date")){
|
||||
whereJson.put("date",DateUtil.formatDate(new Date()));
|
||||
}
|
||||
|
||||
List<PmFormData> pmFormDataList = iPmFormDataService.list(new LambdaUpdateWrapper<PmFormData>()
|
||||
.eq(PmFormData::getIs_finish, 0)
|
||||
.likeRight(PmFormData::getSource_form_date,whereJson.getString("date"))
|
||||
.like(whereJson.containsKey("form_data_code"),
|
||||
PmFormData::getCode, whereJson.get("form_data_code"))
|
||||
.eq(PmFormData::getForm_type, dictList.get(0).getValue())
|
||||
@@ -1297,7 +1311,101 @@ public class PdaIosInServiceImpl implements PdaIosInService {
|
||||
iRawAssistIStorService.divPoint(jsonMst);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PdaResponse supplierDroplist(MdCsSupplierbase dto) {
|
||||
List<MdCsSupplierbase> mdCsSupplierbaseList = iMdCsSupplierbaseService.list();
|
||||
|
||||
List<SelectItemVo> selectList = new ArrayList<>();
|
||||
mdCsSupplierbaseList.forEach(r ->
|
||||
selectList.add(SelectItemVo.builder().text(r.getSupp_name()).value(r.getSupp_code()).build())
|
||||
);
|
||||
return PdaResponse.requestParamOk(selectList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PdaResponse inCheck(ZwConfirmInParamDto dto) {
|
||||
//判断点位和仓位是否有正在执行的任务
|
||||
List<SchBaseTask> schBaseTaskList = iSchBaseTaskService.list(new LambdaQueryWrapper<SchBaseTask>()
|
||||
.eq(SchBaseTask::getIs_delete, IOSConstant.IS_DELETE_NO)
|
||||
.and(wp -> wp
|
||||
.eq(SchBaseTask::getPoint_code2, dto.getSite_code())
|
||||
.or()
|
||||
.eq(SchBaseTask::getPoint_code3, dto.getSite_code())
|
||||
.or()
|
||||
.eq(SchBaseTask::getPoint_code1, dto.getSite_code())
|
||||
.or()
|
||||
.eq(SchBaseTask::getPoint_code4, dto.getSite_code())
|
||||
)
|
||||
.le(SchBaseTask::getTask_status, TaskStatus.EXECUTING.getCode()));
|
||||
|
||||
if(CollectionUtils.isNotEmpty(schBaseTaskList)){
|
||||
throw new BadRequestException("存在正在执行任务的点位"+dto.getSite_code());
|
||||
}
|
||||
|
||||
JSONObject whereJson = new JSONObject();
|
||||
whereJson.put("vehicle_code", dto.getVehicle_code());
|
||||
whereJson.put("search", dto.getVehicle_code());
|
||||
|
||||
//起点
|
||||
whereJson.put("site_code", dto.getSite_code());
|
||||
whereJson.put("noEmptyVehicle", "1");
|
||||
String material_model = getVehicleMaterial(whereJson).getString("material_model");
|
||||
if (StringUtils.isEmpty(material_model)) {
|
||||
throw new BadRequestException("组盘的物料未配置【物料型号】!");
|
||||
}
|
||||
|
||||
//判断每个物料是否都已经配置库区
|
||||
|
||||
|
||||
//查询字典表
|
||||
List<Dict> dictList = sysDictMapper.selectList(new LambdaQueryWrapper<Dict>()
|
||||
.eq(Dict::getCode, "MATERIAL_MODEL_SECT"));
|
||||
|
||||
List<Dict> dicts = dictList.stream().filter(a -> material_model.equals(a.getPara1())).collect(Collectors.toList());
|
||||
if (CollectionUtils.isEmpty(dicts)) {
|
||||
throw new BadRequestException("字典MATERIAL_MODEL_SECT未配置物料类型" + material_model + "与库区的对应关系,请核对!");
|
||||
}
|
||||
|
||||
String sect_code = dicts.get(0).getValue();
|
||||
//根据库区编码获取库区id sect_id
|
||||
List<Sectattr> sectattrList = sectattrMapper.selectList(new LambdaQueryWrapper<Sectattr>()
|
||||
.eq(Sectattr::getSect_code, sect_code));
|
||||
|
||||
if (CollectionUtils.isEmpty(sectattrList)) {
|
||||
throw new BadRequestException("库区" + sect_code + "不存在,请核对!");
|
||||
}
|
||||
|
||||
whereJson.put("sect_id",sectattrList.get(0).getSect_id());
|
||||
|
||||
//获取起点
|
||||
SchBasePoint schBasePoint = iSchBasePointService
|
||||
.getOne(new LambdaQueryWrapper<SchBasePoint>().eq(SchBasePoint::getVehicle_code, whereJson.get("vehicle_code")));
|
||||
if (ObjectUtil.isEmpty(schBasePoint)) {
|
||||
throw new BadRequestException("未找到载具所在的点位信息,请检查该载具是否绑定点位");
|
||||
}
|
||||
|
||||
if(!"3".equals(schBasePoint.getPoint_status())){
|
||||
throw new BadRequestException("系统显示点位"+schBasePoint.getPoint_code()+"不是有料状态,请确认是否组盘!");
|
||||
}
|
||||
|
||||
if (!schBasePoint.getPoint_code().equals(dto.getSite_code())) {
|
||||
throw new BadRequestException("载具" + dto.getVehicle_code() + "不在" + dto.getSite_code() + "上");
|
||||
}
|
||||
|
||||
return PdaResponse.requestOk();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public PdaResponse getPointCodeByVehicleCode(JSONObject whereJson) {
|
||||
List<SchBasePoint> schBasePointList = iSchBasePointService.list(new LambdaQueryWrapper<SchBasePoint>()
|
||||
.eq(SchBasePoint::getVehicle_code, whereJson.getString("vehicle_code")));
|
||||
|
||||
if(schBasePointList.isEmpty()){
|
||||
return PdaResponse.requestOk();
|
||||
}
|
||||
return PdaResponse.requestParamOk(schBasePointList.get(0).getPoint_code());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -4,11 +4,13 @@ import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.common.domain.vo.SelectItemVo;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.CodeUtil;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
@@ -42,6 +44,7 @@ import org.nl.wms.sch_manage.service.util.tasks.VehicleOutTask;
|
||||
import org.nl.wms.warehouse_manage.enums.IOSConstant;
|
||||
import org.nl.wms.warehouse_manage.enums.IOSEnum;
|
||||
import org.nl.wms.warehouse_manage.inAndOut.service.IInBillService;
|
||||
import org.nl.wms.warehouse_manage.service.IMdPbGroupplateService;
|
||||
import org.nl.wms.warehouse_manage.service.dao.GroupPlate;
|
||||
import org.nl.wms.warehouse_manage.inAndOut.service.dao.IOStorInv;
|
||||
import org.nl.wms.warehouse_manage.inAndOut.service.dao.IOStorInvDis;
|
||||
@@ -57,6 +60,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
@@ -87,6 +91,9 @@ public class PdaIosOutServiceImpl implements PdaIosOutService {
|
||||
@Autowired
|
||||
private ISectattrService iSectattrService;
|
||||
|
||||
@Autowired
|
||||
private IMdPbGroupplateService iMdPbGroupPlateService;
|
||||
|
||||
/**
|
||||
* 出入库单主表
|
||||
*/
|
||||
@@ -347,6 +354,106 @@ public class PdaIosOutServiceImpl implements PdaIosOutService {
|
||||
return PdaResponse.requestOk();
|
||||
}
|
||||
|
||||
@Override
|
||||
public PdaResponse pickUp(JSONObject whereJson) {
|
||||
|
||||
if (!"1".equals(whereJson.getString("point_status")) && "2".equals(whereJson.getString("point_status"))) {
|
||||
throw new BadRequestException("确认取货功能只能将点位设置成空载具/空位");
|
||||
}
|
||||
|
||||
//判断点位和仓位是否有正在执行的任务
|
||||
List<SchBaseTask> schBaseTaskList = taskService.list(new LambdaQueryWrapper<SchBaseTask>()
|
||||
.eq(SchBaseTask::getIs_delete, IOSConstant.IS_DELETE_NO)
|
||||
.and(wp -> wp
|
||||
.eq(SchBaseTask::getPoint_code1, whereJson.getString("point_code"))
|
||||
.or()
|
||||
.eq(SchBaseTask::getPoint_code2, whereJson.getString("point_code"))
|
||||
.or()
|
||||
.eq(SchBaseTask::getPoint_code3, whereJson.getString("point_code"))
|
||||
.or()
|
||||
.eq(SchBaseTask::getPoint_code4, whereJson.getString("point_code"))
|
||||
)
|
||||
.le(SchBaseTask::getTask_status, TaskStatus.EXECUTING.getCode()));
|
||||
if (CollectionUtils.isNotEmpty(schBaseTaskList)) {
|
||||
throw new BadRequestException("存在正在执行的点位,请核对!");
|
||||
}
|
||||
|
||||
iSchBasePointService.update(new LambdaUpdateWrapper<SchBasePoint>()
|
||||
.set(SchBasePoint::getPoint_status, whereJson.getString("point_status"))
|
||||
.set("1".equals(whereJson.getString("point_status")), SchBasePoint::getVehicle_code, null)
|
||||
.set("1".equals(whereJson.getString("point_status")), SchBasePoint::getVehicle_qty, 0)
|
||||
.eq(SchBasePoint::getPoint_code, whereJson.getString("point_code")));
|
||||
return PdaResponse.requestOk();
|
||||
}
|
||||
|
||||
@Override
|
||||
public PdaResponse getPdaVehicleCodeBySectCode(JSONObject whereJson) {
|
||||
List<Structattr> structattrList = iStructattrService.list(new LambdaQueryWrapper<Structattr>()
|
||||
.eq(Structattr::getOccupancy_state, 3)
|
||||
.eq(Structattr::getLock_type, "0")
|
||||
.and(wp -> wp
|
||||
.eq(Structattr::getSect_id, whereJson.getString("sect_code"))
|
||||
.or()
|
||||
.eq(Structattr::getSect_code, whereJson.getString("sect_code"))
|
||||
)
|
||||
.isNotNull(Structattr::getStoragevehicle_code)
|
||||
.isNull(Structattr::getTask_code));
|
||||
|
||||
List<SelectItemVo> selectList = new ArrayList<>();
|
||||
structattrList.forEach(r ->
|
||||
selectList.add(SelectItemVo.builder().text(r.getStoragevehicle_code()).value(r.getStoragevehicle_code()).build())
|
||||
);
|
||||
return PdaResponse.requestParamOk(selectList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PdaResponse getMaterialSuppByVehicleCode(JSONObject whereJson) {
|
||||
|
||||
//从库存判断
|
||||
List<Structattr> structattrList = iStructattrService.list(new LambdaQueryWrapper<Structattr>()
|
||||
.eq(Structattr::getOccupancy_state, 3)
|
||||
.eq(Structattr::getLock_type, "0")
|
||||
.eq(Structattr::getStoragevehicle_code, whereJson.getString("vehicle_code")));
|
||||
|
||||
if (structattrList.isEmpty()) {
|
||||
throw new BadRequestException("载具不在库位中或库位已锁定,请核对!");
|
||||
}
|
||||
|
||||
//查找状态为入库状态的组盘表
|
||||
List<GroupPlate> groupPlateList = iMdPbGroupPlateService.list(new QueryWrapper<GroupPlate>().lambda()
|
||||
.eq(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("入库"))
|
||||
.ne(GroupPlate::getPcsn, "空托盘入库")
|
||||
.eq(GroupPlate::getStoragevehicle_code, whereJson.getString("vehicle_code"))
|
||||
);
|
||||
|
||||
if (CollectionUtils.isEmpty(groupPlateList)) {
|
||||
throw new BadRequestException("载具组盘信息不存在,请核对!");
|
||||
|
||||
}
|
||||
|
||||
if (groupPlateList.size() > 1) {
|
||||
throw new BadRequestException("载具组盘信息重复,请核对!");
|
||||
}
|
||||
|
||||
|
||||
JSONObject outJson = new JSONObject();
|
||||
|
||||
//根据物料id获取物料名称等信息
|
||||
|
||||
MdMeMaterialbase materialbase = iMdMeMaterialbaseService.getByCode(groupPlateList.get(0).getMaterial_id(), false);
|
||||
if (materialbase != null) {
|
||||
outJson.put("material_code", materialbase.getMaterial_code());
|
||||
outJson.put("material_name", materialbase.getMaterial_name());
|
||||
outJson.put("material_spec", materialbase.getMaterial_spec());
|
||||
outJson.put("material_model", materialbase.getMaterial_model());
|
||||
}
|
||||
outJson.put("supp_code", groupPlateList.get(0).getSupp_code());
|
||||
outJson.put("supp_name", groupPlateList.get(0).getSupp_name());
|
||||
|
||||
return PdaResponse.requestParamOk(outJson);
|
||||
}
|
||||
|
||||
|
||||
private String createOutBills(JSONObject whereJson) {
|
||||
String now = DateUtil.now();
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
|
||||
@@ -13,6 +13,8 @@ import org.nl.wms.pm_manage.service.IPmFormDataService;
|
||||
import org.nl.wms.pm_manage.service.dao.PmFormData;
|
||||
import org.nl.wms.pm_manage.service.dto.PmFormDataParam;
|
||||
import org.nl.wms.pm_manage.service.dto.FormDataQuery;
|
||||
import org.nl.wms.sch_manage.enums.StatusEnum;
|
||||
import org.nl.wms.warehouse_manage.enums.IOSEnum;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
@@ -109,6 +111,25 @@ public class PmFormDataController {
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/finish")
|
||||
@SaIgnore
|
||||
@Log("单据完成")
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public ResponseEntity<Object> finish(@RequestBody JSONObject whereJson) {
|
||||
String id = whereJson.getString("id");
|
||||
iPmFormDataService.update(
|
||||
new LambdaUpdateWrapper<PmFormData>()
|
||||
.set(PmFormData::getStatus, StatusEnum.FORM_STATUS.code("完成"))
|
||||
.set(PmFormData::getUpdate_time,DateUtil.now())
|
||||
.set(PmFormData::getUpdate_name, "人工手动完成")
|
||||
.eq(PmFormData::getId, id));
|
||||
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@GetMapping("/sync/{type}")
|
||||
@Log("单据同步")
|
||||
public ResponseEntity<Object> sync(@RequestParam String type, String formDtl) {
|
||||
|
||||
@@ -20,158 +20,10 @@ import java.math.BigDecimal;
|
||||
@Data
|
||||
public class PmFormDataSelectDto extends Model<PmFormDataSelectDto> {
|
||||
|
||||
private static final long serialVersionUID = -7739291296662381393L;
|
||||
//@TableId(type = IdType.ASSIGN_ID)
|
||||
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private String id;
|
||||
/**
|
||||
* 仓库编号
|
||||
*/
|
||||
private String stor_id;
|
||||
/**
|
||||
* 仓库信息
|
||||
*/
|
||||
private String stor_name;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
private String code;
|
||||
|
||||
|
||||
/**
|
||||
* 单据状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
|
||||
/**
|
||||
* 单据类型
|
||||
*/
|
||||
private String form_type;
|
||||
|
||||
|
||||
/**
|
||||
* 源单单据日期
|
||||
*/
|
||||
private String source_form_date;
|
||||
|
||||
|
||||
/**
|
||||
* 物料code
|
||||
*/
|
||||
private String material_code;
|
||||
|
||||
|
||||
/**
|
||||
* 批次号
|
||||
*/
|
||||
private String pcsn;
|
||||
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private BigDecimal qty;
|
||||
|
||||
|
||||
/**
|
||||
* 分配数量
|
||||
*/
|
||||
private BigDecimal assign_qty;
|
||||
|
||||
/**
|
||||
* 实际数量
|
||||
*/
|
||||
private BigDecimal actual_qty;
|
||||
|
||||
|
||||
/**
|
||||
* 数量单位
|
||||
*/
|
||||
private String unit_id;
|
||||
|
||||
|
||||
/**
|
||||
* 单位名称
|
||||
*/
|
||||
private String unit_name;
|
||||
|
||||
|
||||
/**
|
||||
* 载具信息
|
||||
*/
|
||||
private String vehicle_code;
|
||||
|
||||
|
||||
/**
|
||||
* 载具组盘id
|
||||
*/
|
||||
private String vehicle_id;
|
||||
|
||||
|
||||
/**
|
||||
* 自定义表单字段
|
||||
*/
|
||||
private String form_data;
|
||||
|
||||
|
||||
/**
|
||||
* 创建id
|
||||
*/
|
||||
private String create_time;
|
||||
|
||||
|
||||
/**
|
||||
* 创建id
|
||||
*/
|
||||
private String create_name;
|
||||
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private String update_time;
|
||||
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
private String update_name;
|
||||
|
||||
|
||||
/**
|
||||
* 说明
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
/**
|
||||
* 是否完结
|
||||
*/
|
||||
private Integer is_finish;
|
||||
private String supp_code;
|
||||
private String supp_name;
|
||||
|
||||
private String text;
|
||||
|
||||
private String value;
|
||||
|
||||
|
||||
/**
|
||||
* 获取主键值
|
||||
*
|
||||
* @return 主键值
|
||||
*/
|
||||
@Override
|
||||
protected Serializable pkVal() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -224,6 +224,7 @@ public class DownEmptyUpFullTask extends AbstractTask {
|
||||
.set(SchBasePoint::getUpdate_id, SecurityUtils.getCurrentUserId())
|
||||
.set(SchBasePoint::getUpdate_name, SecurityUtils.getCurrentNickName())
|
||||
.set(SchBasePoint::getUpdate_time, DateUtil.now())
|
||||
.set(SchBasePoint::getIng_task_code,null)
|
||||
.eq(SchBasePoint::getPoint_code, taskObj.getPoint_code1()));
|
||||
//点位3
|
||||
pointService.update(new LambdaUpdateWrapper<SchBasePoint>()
|
||||
@@ -233,6 +234,7 @@ public class DownEmptyUpFullTask extends AbstractTask {
|
||||
.set(SchBasePoint::getUpdate_id, SecurityUtils.getCurrentUserId())
|
||||
.set(SchBasePoint::getUpdate_name, SecurityUtils.getCurrentNickName())
|
||||
.set(SchBasePoint::getUpdate_time, DateUtil.now())
|
||||
.set(SchBasePoint::getIng_task_code,null)
|
||||
.eq(SchBasePoint::getPoint_code, taskObj.getPoint_code2()));
|
||||
//点位4
|
||||
pointService.update(new LambdaUpdateWrapper<SchBasePoint>()
|
||||
@@ -242,6 +244,7 @@ public class DownEmptyUpFullTask extends AbstractTask {
|
||||
.set(SchBasePoint::getUpdate_id, SecurityUtils.getCurrentUserId())
|
||||
.set(SchBasePoint::getUpdate_name, SecurityUtils.getCurrentNickName())
|
||||
.set(SchBasePoint::getUpdate_time, DateUtil.now())
|
||||
.set(SchBasePoint::getIng_task_code,null)
|
||||
.eq(SchBasePoint::getPoint_code, taskObj.getPoint_code3()));
|
||||
|
||||
//点位1
|
||||
|
||||
@@ -232,24 +232,13 @@ public class InBillTask extends AbstractTask {
|
||||
}
|
||||
|
||||
//判断单据剩余数量(总数量-已完成数量)与组盘数量的差距
|
||||
//todo 判断已经完成数量是否是actual_qty,如果后期调整,可以更改此处
|
||||
if( (new BigDecimal(1)).compareTo(pmFormDataList.get(0).getQty().subtract(pmFormDataList.get(0).getActual_qty())) ==0){
|
||||
iPmFormDataService.update(
|
||||
new LambdaUpdateWrapper<PmFormData>()
|
||||
.set(PmFormData::getStatus, StatusEnum.FORM_STATUS.code("完成"))
|
||||
.set(PmFormData::getIs_finish, 1)
|
||||
.set(PmFormData::getActual_qty,pmFormDataList.get(0).getActual_qty().add(new BigDecimal(1)))
|
||||
.set(PmFormData::getUpdate_time,DateUtil.now())
|
||||
.set(PmFormData::getUpdate_name, "task")
|
||||
.eq(PmFormData::getCode, taskObj.getForm_data_code()));
|
||||
} else {
|
||||
iPmFormDataService.update(
|
||||
new LambdaUpdateWrapper<PmFormData>()
|
||||
.set(PmFormData::getActual_qty,pmFormDataList.get(0).getActual_qty().add(new BigDecimal(1)))
|
||||
.set(PmFormData::getUpdate_time,DateUtil.now())
|
||||
.set(PmFormData::getUpdate_name, "task")
|
||||
.eq(PmFormData::getCode, taskObj.getForm_data_code()));
|
||||
}
|
||||
iPmFormDataService.update(
|
||||
new LambdaUpdateWrapper<PmFormData>()
|
||||
|
||||
.set(PmFormData::getActual_qty, pmFormDataList.get(0).getActual_qty().add(new BigDecimal(1)))
|
||||
.set(PmFormData::getUpdate_time, DateUtil.now())
|
||||
.set(PmFormData::getUpdate_name, "task")
|
||||
.eq(PmFormData::getCode, taskObj.getForm_data_code()));
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
|
||||
@@ -32,8 +32,9 @@ public class MesManualCallMaterialRequestDto {
|
||||
@NotBlank(message = "任务类型不可为空")
|
||||
private String task_type;
|
||||
|
||||
@NotBlank(message = "供应商编码不可为空")
|
||||
private String supp_code;
|
||||
|
||||
@NotBlank(message = "供应商名称不可为空")
|
||||
private String supp_name;
|
||||
|
||||
/**
|
||||
|
||||
@@ -38,6 +38,15 @@ export function getParentFormTypes() {
|
||||
})
|
||||
}
|
||||
|
||||
export function finishFormData(data) {
|
||||
return request({
|
||||
url: 'api/pmFormData/finish',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
export function getSonFormData(id) {
|
||||
return request({
|
||||
url: 'api/pmFormData/getSonFormData/' + id,
|
||||
|
||||
@@ -100,6 +100,16 @@
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="warning"
|
||||
icon="el-icon-check"
|
||||
size="mini"
|
||||
@click="finishForm"
|
||||
>
|
||||
强制完成
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
@@ -235,6 +245,10 @@
|
||||
v-loading="crud.loading"
|
||||
lazy
|
||||
:data="crud.data"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
@current-change="handleCurrentChange"
|
||||
@select="handleSelectionChange"
|
||||
@select-all="onSelectAll"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="code" label="单据编码" show-overflow-tooltip width="120" />
|
||||
@@ -243,8 +257,8 @@
|
||||
<el-table-column prop="material_code" label="物料编码" show-overflow-tooltip width="180" />
|
||||
<el-table-column prop="material_name" label="物料名称" show-overflow-tooltip width="180" />
|
||||
<el-table-column prop="material_spec" label="物料规格" show-overflow-tooltip width="180" />
|
||||
<el-table-column prop="qty" label="计划数量" show-overflow-tooltip />
|
||||
<el-table-column prop="assign_qty" label="分配数量" show-overflow-tooltip width="120" />
|
||||
<!-- <el-table-column prop="qty" label="计划数量" show-overflow-tooltip />
|
||||
<el-table-column prop="assign_qty" label="分配数量" show-overflow-tooltip width="120" />-->
|
||||
<el-table-column prop="actual_qty" label="处理数量" show-overflow-tooltip width="120" />
|
||||
<el-table-column prop="pcsn" label="批次" show-overflow-tooltip width="120" />
|
||||
<el-table-column prop="unit_name" label="单位" show-overflow-tooltip width="120" />
|
||||
@@ -286,7 +300,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudFormData from './formData'
|
||||
import crudFormData, { finishFormData } from './formData'
|
||||
import crudSupp from '../../basedata/supp/supplierbase'
|
||||
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||
import crudOperation from '@crud/CRUD.operation.vue'
|
||||
@@ -354,6 +368,7 @@ export default {
|
||||
permission: {},
|
||||
materShow: false,
|
||||
materOptCode: '',
|
||||
currentRow: null,
|
||||
rules: {
|
||||
stor_id: [{ required: true, message: '请选择仓库', trigger: 'change' }],
|
||||
form_type: [{ required: true, message: '请选择单据类型', trigger: 'change' }],
|
||||
@@ -393,6 +408,16 @@ export default {
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
finishForm() {
|
||||
if (!this.currentRow) {
|
||||
this.crud.notify('请选择一条单据', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
finishFormData(this.currentRow).then(res => {
|
||||
this.crud.notify('单据完成成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
})
|
||||
},
|
||||
getSuppList() {
|
||||
crudSupp.dropList({}).then(res => {
|
||||
this.supplist = res
|
||||
@@ -434,6 +459,37 @@ export default {
|
||||
this.form.material_spec = row.material_spec
|
||||
this.form.unit_id = row.base_unit_id
|
||||
},
|
||||
handleSelectionChange(val, row) {
|
||||
if (val.length > 1) {
|
||||
this.$refs.table.clearSelection()
|
||||
this.$refs.table.toggleRowSelection(val.pop())
|
||||
this.buttonChange(row)
|
||||
} else if (val.length === 1) {
|
||||
this.buttonChange(row)
|
||||
} else {
|
||||
this.handleCurrentChange(null)
|
||||
}
|
||||
},
|
||||
onSelectAll() {
|
||||
this.$refs.table.clearSelection()
|
||||
this.handleCurrentChange(null)
|
||||
},
|
||||
buttonChange(current) {
|
||||
if (current !== null) {
|
||||
this.currentRow = current
|
||||
}
|
||||
}
|
||||
,
|
||||
querytable() {
|
||||
this.onSelectAll()
|
||||
this.crud.toQuery()
|
||||
this.handleCurrentChange(null)
|
||||
},
|
||||
handleCurrentChange(currentRow) {
|
||||
if (currentRow === null) {
|
||||
this.currentRow = {}
|
||||
}
|
||||
},
|
||||
// getFromTypes() {
|
||||
// crudFormData.getParentFormTypes().then((res) => { // 获取分类名称,查询根据分类编码查找对应分支树
|
||||
// this.fromTypes = res
|
||||
@@ -459,4 +515,3 @@ export default {
|
||||
</script>
|
||||
<style scoped>
|
||||
</style>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user