代码更新

This commit is contained in:
2023-04-14 17:50:11 +08:00
parent 88cc6a56e7
commit e379a9a86d
18 changed files with 1501 additions and 17 deletions

View File

@@ -194,4 +194,9 @@ public class CustomerbaseDto implements Serializable {
* 送货单明细数
*/
private String shd_dtl_num;
/**
* 是否自动贴标
*/
private String is_auto_table;
}

View File

@@ -82,4 +82,19 @@ public class StructattrController {
JSONArray jsonArray = JSONArray.parseArray(json);
return new ResponseEntity<>(structattrService.getStructByCodes(jsonArray), HttpStatus.OK);
}
@PostMapping("/getStructByCodesFs")
@Log("获取点位信息")
@ApiOperation("获取点位信息")
public ResponseEntity<Object> getStructByCodesFs(@RequestBody String json){
JSONArray jsonArray = JSONArray.parseArray(json);
return new ResponseEntity<>(structattrService.getStructByCodesFs(jsonArray), HttpStatus.OK);
}
@PostMapping("/unLockPoint")
@Log("解锁点位")
@ApiOperation("解锁点位")
public ResponseEntity<Object> unLockPoint(@RequestBody JSONObject whereJson){
return new ResponseEntity<>(structattrService.unLockPoint(whereJson), HttpStatus.OK);
}
}

View File

@@ -75,4 +75,16 @@ public interface StructattrService {
* @return
*/
JSONArray getStructByCodes(JSONArray json);
/**
* 获取点位信息
* @return
*/
JSONArray getStructByCodesFs(JSONArray json);
/**
* 解锁点位
* @return
*/
JSONObject unLockPoint(JSONObject whereJson);
}

View File

@@ -289,4 +289,60 @@ public class StructattrServiceImpl implements StructattrService {
return arr;
}
@Override
public JSONArray getStructByCodesFs(JSONArray jsonArray) {
WQLObject attrTab = WQLObject.getWQLObject("sch_base_point");
JSONArray arr = new JSONArray();
for (int i = 0; i < jsonArray.size(); i++) {
JSONObject obj = new JSONObject();
JSONObject js = jsonArray.getJSONObject(i);
String struct_id = js.getString("struct_id");
if (ObjectUtil.isEmpty(struct_id)) continue;
int struct_status = 2;
// 获取信息 1蓝色空载具 2黄色木箱 3绿色空位 4灰色禁用
// 查找详细信息, 这里可能是有多条数据
JSONArray array = WQL
.getWO("QST_STRUCTATTR")
.addParamMap(MapOf.of("struct_id", struct_id, "flag", "2"))
.process()
.getResultJSONArray(0);
// 获取仓位表中的信息
JSONObject strInfo = attrTab
.query("point_id = '" + struct_id + "'")
.uniqueResult(0);
if (ObjectUtil.isEmpty(strInfo.getString("vehicle_code"))) {
// 空位
struct_status = 3;
}
// 剩余层数货位信息没统计统计可以用obj.put(key, value)返给前端前端在initStatus()就可以遍历去获取,给节点赋值
obj.put("data", array);
obj.put("struct_status", struct_status);
obj.put("struct_id", strInfo.getString("point_id"));
obj.put("struct_code", strInfo.getString("point_code"));
obj.put("id", js.getString("id")); // 设备不存在就只保留id方便前端查看
arr.add(obj);
}
return arr;
}
@Override
@Transactional(rollbackFor = Exception.class)
public JSONObject unLockPoint(JSONObject whereJson) {
WQLObject pointTab = WQLObject.getWQLObject("sch_base_point");
String point_code = whereJson.getString("point_code");
JSONObject jsonPoint = pointTab.query("point_code = '" + point_code + "'").uniqueResult(0);
jsonPoint.put("point_status", "1");
jsonPoint.put("vehicle_code", "");
jsonPoint.put("lock_type", "1");
pointTab.update(jsonPoint);
return null;
}
}