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