代码更新
This commit is contained in:
@@ -51,4 +51,11 @@ public class ProductInstorController {
|
|||||||
return new ResponseEntity<>(productInstorService.mendCode(whereJson),HttpStatus.OK);
|
return new ResponseEntity<>(productInstorService.mendCode(whereJson),HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/bale")
|
||||||
|
@Log("捆扎")
|
||||||
|
@ApiOperation("捆扎")
|
||||||
|
public ResponseEntity<Object> bale(@RequestBody JSONObject whereJson){
|
||||||
|
return new ResponseEntity<>(productInstorService.bale(whereJson),HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,4 +21,6 @@ public interface ProductInstorService {
|
|||||||
JSONObject confirm(JSONObject whereJson);
|
JSONObject confirm(JSONObject whereJson);
|
||||||
|
|
||||||
JSONObject mendCode(JSONObject whereJson);
|
JSONObject mendCode(JSONObject whereJson);
|
||||||
|
|
||||||
|
JSONObject bale(JSONObject whereJson);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import cn.hutool.core.date.DateUtil;
|
|||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
@@ -17,6 +18,7 @@ import org.nl.modules.wql.core.bean.WQLObject;
|
|||||||
import org.nl.modules.wql.util.SpringContextHolder;
|
import org.nl.modules.wql.util.SpringContextHolder;
|
||||||
import org.nl.modules.wql.util.WqlUtil;
|
import org.nl.modules.wql.util.WqlUtil;
|
||||||
import org.nl.wms.ext.acs.service.impl.AcsToWmsServiceImpl;
|
import org.nl.wms.ext.acs.service.impl.AcsToWmsServiceImpl;
|
||||||
|
import org.nl.wms.ext.acs.service.impl.WmsToAcsServiceImpl;
|
||||||
import org.nl.wms.pda.st.service.CoolInService;
|
import org.nl.wms.pda.st.service.CoolInService;
|
||||||
import org.nl.wms.pda.st.service.ProductInstorService;
|
import org.nl.wms.pda.st.service.ProductInstorService;
|
||||||
import org.nl.wms.sch.manage.AbstractAcsTask;
|
import org.nl.wms.sch.manage.AbstractAcsTask;
|
||||||
@@ -251,6 +253,7 @@ public class ProductInstorServiceImpl implements ProductInstorService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public JSONObject mendCode(JSONObject whereJson) {
|
public JSONObject mendCode(JSONObject whereJson) {
|
||||||
String vehicle_code = whereJson.getString("box_no");
|
String vehicle_code = whereJson.getString("box_no");
|
||||||
if (ObjectUtil.isEmpty(vehicle_code)) throw new BadRequestException("木箱号不能为空");
|
if (ObjectUtil.isEmpty(vehicle_code)) throw new BadRequestException("木箱号不能为空");
|
||||||
@@ -266,4 +269,43 @@ public class ProductInstorServiceImpl implements ProductInstorService {
|
|||||||
jo.put("message", "补码成功!");
|
jo.put("message", "补码成功!");
|
||||||
return jo;
|
return jo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public JSONObject bale(JSONObject whereJson) {
|
||||||
|
String vehicle_code = whereJson.getString("box_no");
|
||||||
|
String point_code = whereJson.getString("point_code");
|
||||||
|
|
||||||
|
if (StrUtil.isEmpty(vehicle_code)) {
|
||||||
|
throw new BadRequestException("木箱码不能为空!");
|
||||||
|
}
|
||||||
|
if (StrUtil.isEmpty(point_code)) {
|
||||||
|
throw new BadRequestException("点位不能为空!");
|
||||||
|
}
|
||||||
|
|
||||||
|
JSONObject sub_jo = WQLObject.getWQLObject("pdm_bi_subpackagerelation").query("package_box_sn = '" + vehicle_code + "'").uniqueResult(0);
|
||||||
|
if (ObjectUtil.isEmpty(sub_jo)) {
|
||||||
|
throw new BadRequestException("未查询到该木箱对应的包装关系!");
|
||||||
|
}
|
||||||
|
|
||||||
|
String box_length = sub_jo.getString("box_length");
|
||||||
|
String box_width = sub_jo.getString("box_width");
|
||||||
|
String box_high = sub_jo.getString("box_high");
|
||||||
|
|
||||||
|
JSONArray array = new JSONArray();
|
||||||
|
|
||||||
|
JSONObject jsonLength = new JSONObject();
|
||||||
|
jsonLength.put("device_code", point_code);
|
||||||
|
jsonLength.put("code", "");
|
||||||
|
jsonLength.put("value", box_length);
|
||||||
|
array.add(jsonLength);
|
||||||
|
|
||||||
|
// 调用接口返回数据
|
||||||
|
WmsToAcsServiceImpl wmsToAcsServiceImpl = SpringContextHolder.getBean(WmsToAcsServiceImpl.class);
|
||||||
|
wmsToAcsServiceImpl.action(array);
|
||||||
|
|
||||||
|
JSONObject jo = new JSONObject();
|
||||||
|
jo.put("message", "捆扎成功!");
|
||||||
|
return jo;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user