add:手持新增页面-人工放行

This commit is contained in:
2024-08-05 16:04:57 +08:00
parent f1444b0c4c
commit e030a2d92c
3 changed files with 50 additions and 0 deletions

View File

@@ -61,4 +61,11 @@ public class ProductOutTwoController {
return new ResponseEntity<>(productOutTwoService.queryBoxIvt(whereJson), HttpStatus.OK);
}
@PostMapping("/confirmPass")
@Log("捆扎点位放行")
@SaIgnore
public ResponseEntity<Object> confirmPass(@RequestBody JSONObject whereJson) {
return new ResponseEntity<>(productOutTwoService.confirmPass(whereJson), HttpStatus.OK);
}
}

View File

@@ -56,4 +56,13 @@ public interface ProductOutTwoService {
* @return JSONObject 返回前端参数
*/
JSONObject queryBoxIvt(JSONObject whereJson);
/**
* 捆扎点位放行
* @param whereJson {
* point_code: 点位编码
* }
* @return JSONObject 返回前端参数
*/
JSONObject confirmPass(JSONObject whereJson);
}

View File

@@ -1,6 +1,7 @@
package org.nl.b_lms.pda.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import lombok.extern.slf4j.Slf4j;
@@ -10,6 +11,8 @@ import org.nl.b_lms.storage_manage.database.service.dao.BstIvtBoxlashbound;
import org.nl.b_lms.storage_manage.database.service.dao.mapper.BstIvtBoxinfoMapper;
import org.nl.modules.common.exception.BadRequestException;
import org.nl.modules.wql.core.bean.WQLObject;
import org.nl.modules.wql.util.SpringContextHolder;
import org.nl.wms.ext.acs.service.WmsToAcsService;
import org.nl.wms.pda.st.service.impl.ProductionOutServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -116,4 +119,35 @@ public class ProductOutTwoServiceImpl implements ProductOutTwoService {
return jo;
}
@Override
@Transactional(rollbackFor = Exception.class)
public JSONObject confirmPass(JSONObject whereJson) {
WQLObject pointTab = WQLObject.getWQLObject("sch_base_point");
if (ObjectUtil.isEmpty(whereJson.getString("point_code"))) {
throw new BadRequestException("点位不能为空!");
}
// 通知acs可离开
WmsToAcsService wmsToAcsService = SpringContextHolder.getBean(WmsToAcsService.class);
JSONArray action_rows = new JSONArray();
JSONObject action_jo = new JSONObject();
action_jo.put("device_code", whereJson.getString("point_code"));
action_jo.put("code", "to_command");
action_jo.put("product_area", "BLK");
action_jo.put("value", "26");
action_rows.add(action_jo);
wmsToAcsService.action(action_rows);
// 更新点位载具、数量
JSONObject pointDao = pointTab.query("point_code = '" + whereJson.getString("point_code") + "'").uniqueResult(0);
pointDao.put("vehicle_code", "");
pointDao.put("vehicle_qty", 0);
WQLObject.getWQLObject("sch_base_point").update(pointDao);
JSONObject result = new JSONObject();
result.put("message", "成功放行!");
return result;
}
}