Commit 18fd14d2 authored by 耿迪迪's avatar 耿迪迪

入库websocket同步物料信息

parent 8a67af0d
...@@ -111,11 +111,7 @@ public class TShelfStorageLocationController extends BaseController ...@@ -111,11 +111,7 @@ public class TShelfStorageLocationController extends BaseController
*/ */
@PostMapping("/rackInOutput") @PostMapping("/rackInOutput")
public AjaxResult rackInOutput(@RequestBody String param) { public AjaxResult rackInOutput(@RequestBody String param) {
String result = shelfApiService.rackInOutput(param); shelfApiService.rackInOutput(param);
JSONObject resultJson = JSONObject.parseObject(result);
if("1".equals(resultJson.getString("FLAG"))) {
return AjaxResult.error(resultJson.getString("MESSAGE"));
}
return AjaxResult.success(); return AjaxResult.success();
} }
......
...@@ -19,6 +19,13 @@ public interface TRackMaterialRelationMapper ...@@ -19,6 +19,13 @@ public interface TRackMaterialRelationMapper
*/ */
public TRackMaterialRelation selectTRackMaterialRelationById(Long relationId); public TRackMaterialRelation selectTRackMaterialRelationById(Long relationId);
/**
* 查询料架和物料维护
* @param rackCode 料架号
* @return 料架和物料维护
*/
TRackMaterialRelation selectTRackMaterialRelationByRackCode(String rackCode);
/** /**
* 查询料架和物料维护列表 * 查询料架和物料维护列表
* *
......
...@@ -83,7 +83,7 @@ public class ITShelfApiServiceImpl implements ITShelfApiService{ ...@@ -83,7 +83,7 @@ public class ITShelfApiServiceImpl implements ITShelfApiService{
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@PlatformDockingTaskLog(type = DockingTaskType.CALL_RACK_SYSTEM) @PlatformDockingTaskLog(type = DockingTaskType.CALL_RACK_SYSTEM)
public String rackInOutput(String param){ public void rackInOutput(String param){
log.info("rackInOutput...param==========" + param); log.info("rackInOutput...param==========" + param);
JSONObject paramJson = JSONObject.parseObject(param); JSONObject paramJson = JSONObject.parseObject(param);
if(paramJson.containsKey("relationParam")){ if(paramJson.containsKey("relationParam")){
...@@ -91,13 +91,15 @@ public class ITShelfApiServiceImpl implements ITShelfApiService{ ...@@ -91,13 +91,15 @@ public class ITShelfApiServiceImpl implements ITShelfApiService{
addRelationInfo(paramJson.getJSONObject("relationParam")); addRelationInfo(paramJson.getJSONObject("relationParam"));
String result = HttpClientUtils.doPost(shelfApiUrl + RACK_IN_OUT_PUT_URL,paramJson.getString("inStoreParam"),null); String result = HttpClientUtils.doPost(shelfApiUrl + RACK_IN_OUT_PUT_URL,paramJson.getString("inStoreParam"),null);
if(StringUtils.isEmpty(result)) throw new CustomException("料架出入库接口错误"); if(StringUtils.isEmpty(result)) throw new CustomException("料架出入库接口错误");
return result; JSONObject resultJson = JSONObject.parseObject(result);
if("1".equals(resultJson.getString("FLAG"))) throw new CustomException("料架入库失败" + resultJson.getString("MESSAGE"));
}else{ }else{
//出库 //出库
delRelationInfo(JSONObject.parseObject(param)); delRelationInfo(JSONObject.parseObject(param));
String result = HttpClientUtils.doPost(shelfApiUrl + RACK_IN_OUT_PUT_URL,param,null); String result = HttpClientUtils.doPost(shelfApiUrl + RACK_IN_OUT_PUT_URL,param,null);
if(StringUtils.isEmpty(result)) throw new CustomException("料架出入库接口错误"); if(StringUtils.isEmpty(result)) throw new CustomException("料架出入库接口错误");
return result; JSONObject resultJson = JSONObject.parseObject(result);
if("1".equals(resultJson.getString("FLAG"))) throw new CustomException("料架出库失败" + resultJson.getString("MESSAGE"));
} }
} }
...@@ -163,6 +165,11 @@ public class ITShelfApiServiceImpl implements ITShelfApiService{ ...@@ -163,6 +165,11 @@ public class ITShelfApiServiceImpl implements ITShelfApiService{
if("I".equals(request.getString("optype"))){ if("I".equals(request.getString("optype"))){
tShelfStorageLocation.setInboundTime(new SimpleDateFormat("yyyy/MM/dd HH:mm:ss").parse(request.getString("operateDate"))); tShelfStorageLocation.setInboundTime(new SimpleDateFormat("yyyy/MM/dd HH:mm:ss").parse(request.getString("operateDate")));
tShelfStorageLocation.setRid(request.getString("rid")); tShelfStorageLocation.setRid(request.getString("rid"));
//查询物料信息
TRackMaterialRelation materialInfo = rackMaterialRelationMapper.selectTRackMaterialRelationByRackCode(request.getString("rid"));
request.put("materialCode",materialInfo.getMaterialCode());
request.put("materialName",materialInfo.getMaterialName());
request.put("materialSpecifications",materialInfo.getMaterialSpecifications());
} }
if("O".equals(request.getString("optype"))){ if("O".equals(request.getString("optype"))){
tShelfStorageLocation.setOutboundTime(new SimpleDateFormat("yyyy/MM/dd HH:mm:ss").parse(request.getString("operateDate"))); tShelfStorageLocation.setOutboundTime(new SimpleDateFormat("yyyy/MM/dd HH:mm:ss").parse(request.getString("operateDate")));
......
...@@ -20,7 +20,7 @@ public interface ITShelfApiService { ...@@ -20,7 +20,7 @@ public interface ITShelfApiService {
* @param param * @param param
* @return * @return
*/ */
String rackInOutput(String param); void rackInOutput(String param);
/** /**
*4 获取料架所有储位信息 *4 获取料架所有储位信息
......
...@@ -48,6 +48,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -48,6 +48,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where relation.relation_id = #{relationId} where relation.relation_id = #{relationId}
</select> </select>
<select id="selectTRackMaterialRelationByRackCode" parameterType="String" resultMap="TRackMaterialRelationResult">
<include refid="selectTRackMaterialRelationVo"/>
where relation.rack_code = #{rackCode}
</select>
<insert id="insertTRackMaterialRelation" parameterType="TRackMaterialRelation" useGeneratedKeys="true" keyProperty="relationId"> <insert id="insertTRackMaterialRelation" parameterType="TRackMaterialRelation" useGeneratedKeys="true" keyProperty="relationId">
insert into t_rack_material_relation insert into t_rack_material_relation
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
......
...@@ -310,6 +310,9 @@ ...@@ -310,6 +310,9 @@
if("I" == message.optype){ if("I" == message.optype){
const locationInfo = this.shelfLayoutList.flat().find(location => location.location === message.location); const locationInfo = this.shelfLayoutList.flat().find(location => location.location === message.location);
locationInfo.rid = message.rid; locationInfo.rid = message.rid;
locationInfo.materialCode = message.materialCode;
locationInfo.materialName = message.materialName;
locationInfo.materialSpecifications = message.materialSpecifications;
} }
//出库 //出库
if("O" == message.optype){ if("O" == message.optype){
......
...@@ -310,6 +310,9 @@ ...@@ -310,6 +310,9 @@
if("I" == message.optype){ if("I" == message.optype){
const locationInfo = this.shelfLayoutList.flat().find(location => location.location === message.location); const locationInfo = this.shelfLayoutList.flat().find(location => location.location === message.location);
locationInfo.rid = message.rid; locationInfo.rid = message.rid;
locationInfo.materialCode = message.materialCode;
locationInfo.materialName = message.materialName;
locationInfo.materialSpecifications = message.materialSpecifications;
} }
//出库 //出库
if("O" == message.optype){ if("O" == message.optype){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment