优化
This commit is contained in:
@@ -57,7 +57,7 @@ public class ToWmsApiController {
|
|||||||
@PostMapping("/requestEnterByTrayCode")
|
@PostMapping("/requestEnterByTrayCode")
|
||||||
public AjaxResult requestEnterByTrayCode(@RequestBody RequestEnter requestEnter) {
|
public AjaxResult requestEnterByTrayCode(@RequestBody RequestEnter requestEnter) {
|
||||||
AjaxResult ajaxResult = toWmsService.requestEnterByTrayCode(requestEnter);
|
AjaxResult ajaxResult = toWmsService.requestEnterByTrayCode(requestEnter);
|
||||||
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(requestEnter), "入库任务创建请求",ajaxResult);
|
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(requestEnter), "入库任务创建请求", ajaxResult);
|
||||||
requestLogService.insertRequestLog(requestLog);
|
requestLogService.insertRequestLog(requestLog);
|
||||||
return ajaxResult;
|
return ajaxResult;
|
||||||
}
|
}
|
||||||
@@ -68,7 +68,7 @@ public class ToWmsApiController {
|
|||||||
@RequestMapping("/requestByNoTrayCode")
|
@RequestMapping("/requestByNoTrayCode")
|
||||||
public AjaxResult requestByNoTrayCode(@RequestBody RequestEnter requestEnter) {
|
public AjaxResult requestByNoTrayCode(@RequestBody RequestEnter requestEnter) {
|
||||||
AjaxResult ajaxResult = toWmsService.selectMydoJobByEntranceId(requestEnter);
|
AjaxResult ajaxResult = toWmsService.selectMydoJobByEntranceId(requestEnter);
|
||||||
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(requestEnter), "请求补码作业",ajaxResult);
|
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(requestEnter), "请求补码作业", ajaxResult);
|
||||||
requestLogService.insertRequestLog(requestLog);
|
requestLogService.insertRequestLog(requestLog);
|
||||||
return ajaxResult;
|
return ajaxResult;
|
||||||
}
|
}
|
||||||
@@ -79,7 +79,7 @@ public class ToWmsApiController {
|
|||||||
@RequestMapping("/requestEnterByTrayCodeAndEntranceId")
|
@RequestMapping("/requestEnterByTrayCodeAndEntranceId")
|
||||||
public AjaxResult requestEnterByTrayCodeAndEntranceId(@RequestBody RequestEnter requestEnter) {
|
public AjaxResult requestEnterByTrayCodeAndEntranceId(@RequestBody RequestEnter requestEnter) {
|
||||||
AjaxResult ajaxResult = toWmsService.requestEnterByTrayCodeAndEntranceId(requestEnter);
|
AjaxResult ajaxResult = toWmsService.requestEnterByTrayCodeAndEntranceId(requestEnter);
|
||||||
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(requestEnter), "获取入库作业",ajaxResult);
|
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(requestEnter), "获取入库作业", ajaxResult);
|
||||||
requestLogService.insertRequestLog(requestLog);
|
requestLogService.insertRequestLog(requestLog);
|
||||||
return ajaxResult;
|
return ajaxResult;
|
||||||
}
|
}
|
||||||
@@ -88,18 +88,17 @@ public class ToWmsApiController {
|
|||||||
/**
|
/**
|
||||||
* 入库、出库 任务完成回传
|
* 入库、出库 任务完成回传
|
||||||
* Map<String, String>
|
* Map<String, String>
|
||||||
* "wmsType": "任务类型" 1-入库 2-出库 3-agv搬运,
|
* "wmsType": "任务类型" 1-入库 2-出库 3-agv搬运,
|
||||||
* taskNo:出库 入库任务号
|
* taskNo:出库 入库任务号
|
||||||
* trayCode:托盘码
|
* trayCode:托盘码
|
||||||
* positionCode1:起点
|
* positionCode1:起点
|
||||||
* positionCode2:终点
|
* positionCode2:终点
|
||||||
* containerCode:容器编码
|
* containerCode:容器编码
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@PostMapping("/jobFinish")
|
@PostMapping("/jobFinish")
|
||||||
public AjaxResult jobFinish(@RequestBody WmsJobRequest wmsJobRequest) {
|
public AjaxResult jobFinish(@RequestBody WmsJobRequest wmsJobRequest) {
|
||||||
AjaxResult ajaxResult = toWmsService.jobFinish(wmsJobRequest);
|
AjaxResult ajaxResult = toWmsService.jobFinish(wmsJobRequest);
|
||||||
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(wmsJobRequest), "jobFinish",ajaxResult);
|
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(wmsJobRequest), "jobFinish", ajaxResult);
|
||||||
requestLogService.insertRequestLog(requestLog);
|
requestLogService.insertRequestLog(requestLog);
|
||||||
return ajaxResult;
|
return ajaxResult;
|
||||||
}
|
}
|
||||||
@@ -110,7 +109,7 @@ public class ToWmsApiController {
|
|||||||
@PostMapping("/reAssign")
|
@PostMapping("/reAssign")
|
||||||
public AjaxResult reAssign(@RequestBody ReMaterialParam reMaterialParam) {
|
public AjaxResult reAssign(@RequestBody ReMaterialParam reMaterialParam) {
|
||||||
AjaxResult ajaxResult = toWmsService.reAssign(reMaterialParam);
|
AjaxResult ajaxResult = toWmsService.reAssign(reMaterialParam);
|
||||||
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(reMaterialParam), "reAssign",ajaxResult);
|
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(reMaterialParam), "reAssign", ajaxResult);
|
||||||
requestLogService.insertRequestLog(requestLog);
|
requestLogService.insertRequestLog(requestLog);
|
||||||
return ajaxResult;
|
return ajaxResult;
|
||||||
}
|
}
|
||||||
@@ -121,13 +120,12 @@ public class ToWmsApiController {
|
|||||||
@PostMapping("/reMaterial")
|
@PostMapping("/reMaterial")
|
||||||
public AjaxResult reMaterial(@RequestBody ReMaterialParam reMaterialParam) {
|
public AjaxResult reMaterial(@RequestBody ReMaterialParam reMaterialParam) {
|
||||||
AjaxResult ajaxResult = toWmsService.reMaterial(reMaterialParam);
|
AjaxResult ajaxResult = toWmsService.reMaterial(reMaterialParam);
|
||||||
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(reMaterialParam), "reMaterial",ajaxResult);
|
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(reMaterialParam), "reMaterial", ajaxResult);
|
||||||
requestLogService.insertRequestLog(requestLog);
|
requestLogService.insertRequestLog(requestLog);
|
||||||
return ajaxResult;
|
return ajaxResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 出库单据保存
|
* 出库单据保存
|
||||||
*
|
*
|
||||||
@@ -148,7 +146,7 @@ public class ToWmsApiController {
|
|||||||
List<OutStockoutDetail> list = new ArrayList<>();
|
List<OutStockoutDetail> list = new ArrayList<>();
|
||||||
outStockout.setStockoutId(param.get("doc_no").toString());
|
outStockout.setStockoutId(param.get("doc_no").toString());
|
||||||
List<OutStockout> outStockout1 = outStockoutService.selectOutStockoutList(outStockout);
|
List<OutStockout> outStockout1 = outStockoutService.selectOutStockoutList(outStockout);
|
||||||
if(outStockout1.size()>0){
|
if (outStockout1.size() > 0) {
|
||||||
return AjaxResult.error("单据已推送!");
|
return AjaxResult.error("单据已推送!");
|
||||||
}
|
}
|
||||||
outStockout.setStockoutGuid(UUID.randomUUID().toString());
|
outStockout.setStockoutGuid(UUID.randomUUID().toString());
|
||||||
@@ -157,7 +155,7 @@ public class ToWmsApiController {
|
|||||||
outStockout.setCreateManId(param.get("create_user_name").toString());
|
outStockout.setCreateManId(param.get("create_user_name").toString());
|
||||||
outStockout.setCustomerNo(param.get("customer_no").toString());
|
outStockout.setCustomerNo(param.get("customer_no").toString());
|
||||||
BasCustomer customer = basCustomerService.selectBasCustomerByNo(param.get("customer_no").toString());
|
BasCustomer customer = basCustomerService.selectBasCustomerByNo(param.get("customer_no").toString());
|
||||||
if(customer == null){
|
if (customer == null) {
|
||||||
BasCustomer basCustomer = new BasCustomer();
|
BasCustomer basCustomer = new BasCustomer();
|
||||||
basCustomer.setId(UUID.randomUUID().toString());
|
basCustomer.setId(UUID.randomUUID().toString());
|
||||||
basCustomer.setCustomerNo(param.get("customer_no").toString());
|
basCustomer.setCustomerNo(param.get("customer_no").toString());
|
||||||
@@ -169,8 +167,8 @@ public class ToWmsApiController {
|
|||||||
outStockout.setStockoutSource("1");
|
outStockout.setStockoutSource("1");
|
||||||
outStockout.setWarehouseId("01");
|
outStockout.setWarehouseId("01");
|
||||||
JSONArray erpList = JSONUtil.parseArray(param.get("sales_issue_detail").toString());
|
JSONArray erpList = JSONUtil.parseArray(param.get("sales_issue_detail").toString());
|
||||||
if(erpList.size()>0){
|
if (erpList.size() > 0) {
|
||||||
for(int i=0;i<erpList.size();i++){
|
for (int i = 0; i < erpList.size(); i++) {
|
||||||
JSONObject msg = (JSONObject) erpList.get(i);
|
JSONObject msg = (JSONObject) erpList.get(i);
|
||||||
OutStockoutDetail detail = new OutStockoutDetail();
|
OutStockoutDetail detail = new OutStockoutDetail();
|
||||||
detail.setStockoutDetailId(msg.get("sales_delivery_no").toString());
|
detail.setStockoutDetailId(msg.get("sales_delivery_no").toString());
|
||||||
@@ -199,12 +197,23 @@ public class ToWmsApiController {
|
|||||||
/**
|
/**
|
||||||
* 接收物料
|
* 接收物料
|
||||||
*/
|
*/
|
||||||
@Log(title = "接收物料", businessType = BusinessType.INSERT)
|
//@Log(title = "接收物料", businessType = BusinessType.INSERT)
|
||||||
@PutMapping("/receiveProduct")
|
@PutMapping("/receiveProduct")
|
||||||
public AjaxResult receiveProduct(@RequestBody ErpProduct erpProduct)
|
public AjaxResult receiveProduct(@RequestBody String json) {
|
||||||
{
|
JSONObject jsonObject = JSONUtil.parseObj(json);
|
||||||
AjaxResult ajaxResult = toWmsService.receiveProduct(erpProduct);
|
Object codeObj = jsonObject.get("std_data");
|
||||||
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(erpProduct), "接收物料", ajaxResult);
|
JSONObject obj = JSONUtil.parseObj(codeObj.toString());
|
||||||
|
String doc = JSONUtil.parseObj(obj.get("parameter").toString()).get("data").toString();
|
||||||
|
JSONObject param = JSONUtil.parseObj(doc);
|
||||||
|
BasProduct basProduct = new BasProduct();
|
||||||
|
basProduct.setProductGuid(param.get("item_no").toString());
|
||||||
|
basProduct.setProductId(param.get("item_no").toString());
|
||||||
|
basProduct.setProductName(param.get("item_name").toString());
|
||||||
|
basProduct.setPrice(param.get("item_desc").toString());
|
||||||
|
basProduct.setSpec(param.get("item_spec").toString());
|
||||||
|
basProduct.setUnit(param.get("inv_unit_no").toString());
|
||||||
|
AjaxResult ajaxResult = toWmsService.receiveProduct(basProduct);
|
||||||
|
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(basProduct), "接收物料", ajaxResult);
|
||||||
requestLogService.insertRequestLog(requestLog);
|
requestLogService.insertRequestLog(requestLog);
|
||||||
return ajaxResult;
|
return ajaxResult;
|
||||||
}
|
}
|
||||||
@@ -212,10 +221,9 @@ public class ToWmsApiController {
|
|||||||
/**
|
/**
|
||||||
* 修改物料管理
|
* 修改物料管理
|
||||||
*/
|
*/
|
||||||
@Log(title = "修改物料管理", businessType = BusinessType.UPDATE)
|
//@Log(title = "修改物料管理", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping("/updateProduct")
|
@PutMapping("/updateProduct")
|
||||||
public AjaxResult updateProduct(@RequestBody ErpProduct erpProduct)
|
public AjaxResult updateProduct(@RequestBody ErpProduct erpProduct) {
|
||||||
{
|
|
||||||
AjaxResult ajaxResult = toWmsService.updateProduct(erpProduct);
|
AjaxResult ajaxResult = toWmsService.updateProduct(erpProduct);
|
||||||
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(erpProduct), "修改物料管理", ajaxResult);
|
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(erpProduct), "修改物料管理", ajaxResult);
|
||||||
requestLogService.insertRequestLog(requestLog);
|
requestLogService.insertRequestLog(requestLog);
|
||||||
@@ -225,12 +233,23 @@ public class ToWmsApiController {
|
|||||||
/**
|
/**
|
||||||
* 作废物料
|
* 作废物料
|
||||||
*/
|
*/
|
||||||
@Log(title = "作废物料", businessType = BusinessType.UPDATE)
|
//@Log(title = "作废物料", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping("/InvalidProduct")
|
@PutMapping("/InvalidProduct")
|
||||||
public AjaxResult InvalidProduct(@RequestBody ErpProduct erpProduct)
|
public AjaxResult InvalidProduct(@RequestBody String json) {
|
||||||
{
|
JSONObject jsonObject = JSONUtil.parseObj(json);
|
||||||
AjaxResult ajaxResult = toWmsService.InvalidProduct(erpProduct);
|
Object codeObj = jsonObject.get("std_data");
|
||||||
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(erpProduct), "作废物料", ajaxResult);
|
JSONObject obj = JSONUtil.parseObj(codeObj.toString());
|
||||||
|
String doc = JSONUtil.parseObj(obj.get("parameter").toString()).get("data").toString();
|
||||||
|
JSONObject param = JSONUtil.parseObj(doc);
|
||||||
|
BasProduct basProduct = new BasProduct();
|
||||||
|
basProduct.setProductGuid(param.get("item_no").toString());
|
||||||
|
basProduct.setProductId(param.get("item_no").toString());
|
||||||
|
basProduct.setProductName(param.get("item_name").toString());
|
||||||
|
basProduct.setPrice(param.get("item_desc").toString());
|
||||||
|
basProduct.setSpec(param.get("item_spec").toString());
|
||||||
|
basProduct.setUnit(param.get("inv_unit_no").toString());
|
||||||
|
AjaxResult ajaxResult = toWmsService.InvalidProduct(basProduct);
|
||||||
|
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(basProduct), "作废物料", ajaxResult);
|
||||||
requestLogService.insertRequestLog(requestLog);
|
requestLogService.insertRequestLog(requestLog);
|
||||||
return ajaxResult;
|
return ajaxResult;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import com.ruoyi.api.domain.ErpProduct;
|
|||||||
import com.ruoyi.api.domain.ReMaterialParam;
|
import com.ruoyi.api.domain.ReMaterialParam;
|
||||||
import com.ruoyi.api.domain.RequestEnter;
|
import com.ruoyi.api.domain.RequestEnter;
|
||||||
import com.ruoyi.api.domain.WmsJobRequest;
|
import com.ruoyi.api.domain.WmsJobRequest;
|
||||||
|
import com.ruoyi.bas.BasProduct.domain.BasProduct;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -48,7 +49,7 @@ public interface IToWmsService {
|
|||||||
/**
|
/**
|
||||||
* 接收物料
|
* 接收物料
|
||||||
*/
|
*/
|
||||||
AjaxResult receiveProduct(ErpProduct erpProduct);
|
AjaxResult receiveProduct(BasProduct basProduct);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改物料
|
* 修改物料
|
||||||
@@ -58,5 +59,5 @@ public interface IToWmsService {
|
|||||||
/**
|
/**
|
||||||
* 作废物料
|
* 作废物料
|
||||||
*/
|
*/
|
||||||
AjaxResult InvalidProduct(ErpProduct erpProduct);
|
AjaxResult InvalidProduct(BasProduct basProduct);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -532,8 +532,7 @@ public class ToWmsServiceImpl implements IToWmsService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult receiveProduct(ErpProduct erpProduct) {
|
public AjaxResult receiveProduct(BasProduct basProduct) {
|
||||||
BasProduct basProduct = getBasProductByErpProduct(erpProduct);
|
|
||||||
BasProduct oldProduct = basProductService.selectBasProductByProductGuid(basProduct.getProductGuid());
|
BasProduct oldProduct = basProductService.selectBasProductByProductGuid(basProduct.getProductGuid());
|
||||||
if (ObjUtil.isNull(oldProduct)){
|
if (ObjUtil.isNull(oldProduct)){
|
||||||
basProductService.insertBasProduct(basProduct);
|
basProductService.insertBasProduct(basProduct);
|
||||||
@@ -572,16 +571,13 @@ public class ToWmsServiceImpl implements IToWmsService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult InvalidProduct(ErpProduct erpProduct) {
|
public AjaxResult InvalidProduct(BasProduct basProduct) {
|
||||||
BasProduct oldProduct = basProductService.selectBasProductByProductGuid(erpProduct.getSys_MainId());
|
BasProduct oldProduct = basProductService.selectBasProductByProductGuid(basProduct.getProductGuid());
|
||||||
if (ObjUtil.isNotNull(oldProduct)) {
|
if (ObjUtil.isNotNull(oldProduct)) {
|
||||||
BasProduct basProduct = new BasProduct();
|
basProductService.deleteBasProductByProductGuid(basProduct.getProductGuid());
|
||||||
basProduct.setProductGuid(oldProduct.getProductGuid());
|
|
||||||
basProduct.setSpare21(oldProduct.getProductId());
|
|
||||||
basProductService.updateBasProduct(oldProduct);
|
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}
|
}
|
||||||
return AjaxResult.error(erpProduct.getSys_MainId()+"物料不存在");
|
return AjaxResult.error(basProduct.getProductGuid()+"物料不存在");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user