add: 手持解锁
This commit is contained in:
@@ -297,4 +297,12 @@ public class PdaController {
|
||||
pdaService.pdaToGroup(param);
|
||||
return PdaUtils.buildSuccessResultJSON(null);
|
||||
}
|
||||
@PostMapping("/pdaToUntie")
|
||||
@Log("手持组盘解绑")
|
||||
@ApiOperation("手持组盘解绑")
|
||||
@PdaAnnotation
|
||||
public JSONObject pdaToUntie(@RequestBody JSONObject param) {
|
||||
pdaService.pdaToUntie(param);
|
||||
return PdaUtils.buildSuccessResultJSON(null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -160,4 +160,10 @@ public interface PdaService {
|
||||
* @param param /
|
||||
*/
|
||||
void pdaToGroup(JSONObject param);
|
||||
|
||||
/**
|
||||
* 手持解绑
|
||||
* @param param
|
||||
*/
|
||||
void pdaToUntie(JSONObject param);
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ package org.nl.wms.pda.service.impl;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -15,7 +14,6 @@ import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.wms.basedata.eum.StandStatus;
|
||||
import org.nl.wms.basedata.eum.TrueOrFalse;
|
||||
import org.nl.wms.basedata.eum.VehicleType;
|
||||
import org.nl.wms.ext.acs.service.WmsToAcsService;
|
||||
import org.nl.wms.pda.service.PdaService;
|
||||
import org.nl.wms.sch.manage.ACSSystem;
|
||||
import org.nl.wms.sch.manage.CreateMode;
|
||||
@@ -39,6 +37,8 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import static org.nl.wms.sch.task.util.TaskUtils.formatVehicleCode;
|
||||
|
||||
/**
|
||||
* @author 张江玮
|
||||
* @date 2022/12/02 10:04
|
||||
@@ -625,6 +625,14 @@ public class PdaServiceImpl implements PdaService {
|
||||
WQLObject groupTab = WQLObject.getWQLObject("st_ivt_vehicle_detail");
|
||||
WQLObject orderTab = WQLObject.getWQLObject("PDM_BD_WorkOrder");
|
||||
String pointCode = param.getString("point_code");
|
||||
String vehicleCode = formatVehicleCode(param.getString("vehicle_code"));
|
||||
JSONObject oldVd = groupTab.query("is_delete = '0' AND vehicle_type = '1'" +
|
||||
" AND vehicle_code = '" + vehicleCode + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(oldVd)) {
|
||||
oldVd.put("is_delete", "1");
|
||||
TaskUtils.addCurrentUpdateColum(oldVd);
|
||||
groupTab.update(oldVd);
|
||||
}
|
||||
int qty = param.getIntValue("qty");
|
||||
if (qty == 0) {
|
||||
throw new BadRequestException("数量不能为空!");
|
||||
@@ -646,11 +654,11 @@ public class PdaServiceImpl implements PdaService {
|
||||
JSONObject vd = new JSONObject();
|
||||
vd.put("vd_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
vd.put("vehicle_type", "2");
|
||||
vd.put("vehicle_code", param.getString("vehicle_code"));
|
||||
vd.put("vehicle_code", vehicleCode);
|
||||
vd.put("material_id", orderObj.getString("material_id"));
|
||||
vd.put("qty", qty);
|
||||
vd.put("weight", weight);
|
||||
vd.put("dz", weight / qty);
|
||||
vd.put("weight", weight * qty);
|
||||
vd.put("dz", weight);
|
||||
vd.put("is_full", param.getString("is_full"));
|
||||
vd.put("workorder_id", orderObj.getString("workorder_id"));
|
||||
vd.put("point_code", pointCode);
|
||||
@@ -661,4 +669,23 @@ public class PdaServiceImpl implements PdaService {
|
||||
|
||||
groupTab.insert(vd);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void pdaToUntie(JSONObject param) {
|
||||
// param: vehicle_code、vehicle_type
|
||||
String vehicleCode = formatVehicleCode(param.getString("vehicle_code"));
|
||||
WQLObject vdTab = WQLObject.getWQLObject("st_ivt_vehicle_detail");
|
||||
JSONObject vd = vdTab.query("is_delete = '0' AND vehicle_type = '" +
|
||||
param.getString("vehicle_type") + "' AND vehicle_code = '" +
|
||||
vehicleCode + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(vd)) {
|
||||
throw new BadRequestException("载具号:[" + vehicleCode + "]不存在!");
|
||||
}
|
||||
JSONObject updateParam = new JSONObject();
|
||||
updateParam.put("is_delete", "1");
|
||||
TaskUtils.addCurrentUpdateColum(updateParam);
|
||||
vdTab.update(updateParam, "is_delete = '0' AND vehicle_type = '" +
|
||||
param.getString("vehicle_type") + "' AND vehicle_code = '" +
|
||||
vehicleCode + "'");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user