物料,组盘后端
This commit is contained in:
@@ -87,6 +87,21 @@ public class MaterialDto implements Serializable {
|
||||
*/
|
||||
private String is_delete;
|
||||
|
||||
/**
|
||||
* 是否人工打包
|
||||
*/
|
||||
private String is_manmade;
|
||||
|
||||
/**
|
||||
* 码垛数量
|
||||
*/
|
||||
private Long palletize_num;
|
||||
|
||||
/**
|
||||
* 托盘类型
|
||||
*/
|
||||
private String vehicle_type;
|
||||
|
||||
/**
|
||||
* 外部标识
|
||||
*/
|
||||
|
||||
@@ -44,10 +44,10 @@ public class MaterialServiceImpl implements MaterialService {
|
||||
String sql = "1=1";
|
||||
if (StrUtil.isNotEmpty(name)) {
|
||||
sql = " (material_code like '%"+name+"%' OR material_code like '%"+name+"%')";
|
||||
|
||||
}
|
||||
ResultBean rb = wo.pagequery(WqlUtil.getHttpContext(page), sql+ " and is_delete='0'", "update_time desc");
|
||||
ResultBean rb = wo.pagequery(WqlUtil.getHttpContext(page), sql + " and is_delete='0'", "update_time desc");
|
||||
final JSONObject json = rb.pageResult();
|
||||
log.info("json:{}",json);
|
||||
return json;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,11 @@
|
||||
package org.nl.wms.sch.rest;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.mysql.cj.xdevapi.JsonArray;
|
||||
import org.nl.wms.sch.AcsUtil;
|
||||
import org.nl.wms.sch.service.PointService;
|
||||
import org.nl.wms.sch.service.dto.PointDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
@@ -13,6 +17,8 @@ import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@@ -88,4 +94,12 @@ public class PointController {
|
||||
return new ResponseEntity<>(pointService.getEndPoint(whereJson,page),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/getPointStatu")
|
||||
@Log("获取点位状态")
|
||||
@ApiOperation("获取点位状态")
|
||||
public ResponseEntity<Object> getPointStatu(@RequestBody JSONArray ja) {
|
||||
pointService.getPointStatuAndChage(ja);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
|
||||
package org.nl.wms.sch.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.wms.sch.service.dto.PointDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
@@ -79,4 +80,6 @@ public interface PointService {
|
||||
* 获取终点点位
|
||||
*/
|
||||
Map<String,Object> getEndPoint(Map whereJson, Pageable page);
|
||||
|
||||
void getPointStatuAndChage(JSONArray ja);
|
||||
}
|
||||
|
||||
@@ -7,14 +7,18 @@ import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.nl.exception.BadRequestException;
|
||||
import org.nl.wms.sch.AcsUtil;
|
||||
import org.nl.wms.sch.service.PointService;
|
||||
import org.nl.wms.sch.service.dto.PointDto;
|
||||
import org.nl.wql.WQL;
|
||||
import org.nl.wql.core.bean.ResultBean;
|
||||
import org.nl.wql.core.bean.WQLData;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -252,4 +256,26 @@ public class PointServiceImpl implements PointService {
|
||||
return json;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getPointStatuAndChage(JSONArray ja) {
|
||||
//发起请求获取数据
|
||||
try {
|
||||
JSONObject jsona = AcsUtil.notifyAcs("/api/wms/getPointStatus", ja);
|
||||
JSONArray arr = jsona.getJSONArray("key");
|
||||
WQLObject wql = WQLObject.getWQLObject("sch_base_point");
|
||||
for (int i = 0; i < arr.size(); i++) {
|
||||
JSONObject jsonObject = ja.getJSONObject(i);
|
||||
Long point_id = (Long) jsonObject.get("point_id");
|
||||
String point_status = (String) jsonObject.get("point_status");
|
||||
//获得单条数据
|
||||
JSONObject jo = wql.query("point_id='" + point_id + "'").uniqueResult(0);
|
||||
jo.put("point_status",point_status);
|
||||
//获取数据表,更新状态
|
||||
wql.update(jo);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user