add: 手持人工组盘
This commit is contained in:
@@ -280,4 +280,21 @@ public class PdaController {
|
||||
public JSONObject getPointListByRegion(@RequestBody JSONObject region_code) {
|
||||
return PdaUtils.buildSuccessResultJSON(pdaService.getPointListByRegion(region_code));
|
||||
}
|
||||
|
||||
@PostMapping("/getAllYZList")
|
||||
@Log("查询所有压机下料位下拉框信息")
|
||||
@ApiOperation("查询所有压机下料位下拉框信息")
|
||||
@PdaAnnotation
|
||||
public JSONObject getAllYZList() {
|
||||
return PdaUtils.buildSuccessResultJSON(pdaService.getAllYZList());
|
||||
}
|
||||
|
||||
@PostMapping("/pdaToGroup")
|
||||
@Log("手持组盘")
|
||||
@ApiOperation("手持组盘")
|
||||
@PdaAnnotation
|
||||
public JSONObject pdaToGroup(@RequestBody JSONObject param) {
|
||||
pdaService.pdaToGroup(param);
|
||||
return PdaUtils.buildSuccessResultJSON(null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.wms.pda.service;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
@@ -147,4 +148,16 @@ public interface PdaService {
|
||||
* @return 库存信息
|
||||
*/
|
||||
JSONArray getRegionPointList(JSONObject param);
|
||||
|
||||
/**
|
||||
* 获取压机列表
|
||||
* @return /
|
||||
*/
|
||||
JSONArray getAllYZList();
|
||||
|
||||
/**
|
||||
* 创建组盘
|
||||
* @param param /
|
||||
*/
|
||||
void pdaToGroup(JSONObject param);
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ 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;
|
||||
import org.nl.wms.sch.manage.PointStatus;
|
||||
import org.nl.wms.sch.manage.Region;
|
||||
@@ -609,4 +610,55 @@ public class PdaServiceImpl implements PdaService {
|
||||
return WQL.getWO("PDA").addParamMap(MapOf.of("flag", "5", "region_code", regionCode))
|
||||
.process().getResultJSONArray(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONArray getAllYZList() {
|
||||
return WQLObject.getWQLObject("sch_base_point")
|
||||
.query("region_code = 'YZ' AND point_type = '1' AND is_used = '1'")
|
||||
.getResultJSONArray(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void pdaToGroup(JSONObject param) {
|
||||
// param:vehicle_code, point_code, qty, weight, is_full
|
||||
WQLObject pointTab = WQLObject.getWQLObject("sch_base_point");
|
||||
WQLObject groupTab = WQLObject.getWQLObject("st_ivt_vehicle_detail");
|
||||
WQLObject orderTab = WQLObject.getWQLObject("PDM_BD_WorkOrder");
|
||||
String pointCode = param.getString("point_code");
|
||||
int qty = param.getIntValue("qty");
|
||||
if (qty == 0) {
|
||||
throw new BadRequestException("数量不能为空!");
|
||||
}
|
||||
double weight = param.getDoubleValue("weight");
|
||||
if (weight == 0) {
|
||||
throw new BadRequestException("重量不能为空!");
|
||||
}
|
||||
JSONObject point = pointTab
|
||||
.query("point_code = '" + pointCode + "'")
|
||||
.uniqueResult(0);
|
||||
JSONObject orderObj = orderTab
|
||||
.query("device_code = '" + point.getString("device_code") + "' AND order_status = '3'")
|
||||
.uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(orderObj)) {
|
||||
throw new BadRequestException("压机:" + point.getString("point_code") + "工单不存在");
|
||||
}
|
||||
// 组盘
|
||||
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("material_id", orderObj.getString("material_id"));
|
||||
vd.put("qty", qty);
|
||||
vd.put("weight", weight);
|
||||
vd.put("dz", weight / qty);
|
||||
vd.put("is_full", param.getString("is_full"));
|
||||
vd.put("workorder_id", orderObj.getString("workorder_id"));
|
||||
vd.put("point_code", pointCode);
|
||||
vd.put("create_id", ACSSystem.id);
|
||||
vd.put("create_name", ACSSystem.nick_name);
|
||||
vd.put("create_time", DateUtil.now());
|
||||
vd.put("is_delete", TrueOrFalse.FALSE.value());
|
||||
|
||||
groupTab.insert(vd);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -194,7 +194,7 @@
|
||||
DISTINCT p.*
|
||||
FROM
|
||||
sch_base_point p
|
||||
LEFT JOIN pdm_bd_workorder w ON p.device_code = w.device_code AND w.order_status < '4'
|
||||
LEFT JOIN pdm_bd_workorder w ON p.device_code = w.device_code AND w.order_status = '3'
|
||||
WHERE
|
||||
p.is_used = '1'
|
||||
AND p.lock_type = '1'
|
||||
|
||||
Reference in New Issue
Block a user