This commit is contained in:
zj
2025-12-31 14:38:44 +08:00
parent 8f247d2797
commit 4fda2477f6
31 changed files with 587 additions and 218 deletions

View File

@@ -8,7 +8,7 @@
"app-plus" : {
"usingComponents" : true,
"nvueCompiler" : "uni-app",
"splashscreen" : {
"splash" : {
"alwaysShowBeforeRender" : true,
"waiting" : true,
"autoclose" : true,

View File

@@ -32,7 +32,7 @@ public class ToErpApiController {
/**
* 回传其他出入库单
*/
// @Scheduled(fixedDelay = 1500)
@Scheduled(fixedDelay = 1500)
public void callbackTransferBill() {
toErpService.callbackTransferBill();
}

View File

@@ -1,24 +1,36 @@
package com.ruoyi.api.controller;
import cn.hutool.core.date.DateUtil;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
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.api.service.IToWmsService;
import com.ruoyi.bas.BasCustomer.domain.BasCustomer;
import com.ruoyi.bas.BasCustomer.service.IBasCustomerService;
import com.ruoyi.bas.BasProduct.domain.BasProduct;
import com.ruoyi.bas.BasProduct.service.IBasProductService;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.uuid.UUID;
import com.ruoyi.log.domain.RequestLog;
import com.ruoyi.log.service.IRequestLogService;
import com.ruoyi.out.outStockout.domain.OutStockout;
import com.ruoyi.out.outStockout.domain.OutStockoutVo;
import com.ruoyi.out.outStockout.service.IOutStockoutService;
import com.ruoyi.out.outStockoutDetail.domain.OutStockoutDetail;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
@@ -36,6 +48,8 @@ public class ToWmsApiController {
private IOutStockoutService outStockoutService;
@Autowired
private IBasProductService basProductService;
@Autowired
private IBasCustomerService basCustomerService;
/**
* 入库请求生成作业
@@ -117,16 +131,66 @@ public class ToWmsApiController {
/**
* 出库单据保存
*
* @param outStockoutVo
* @param json
* @return
*/
@Log(title = "出库主单保存", businessType = BusinessType.OTHER)
//@Log(title = "出库主单保存", businessType = BusinessType.OTHER)
@PostMapping("/saveOutBill")
@ResponseBody
public AjaxResult saveBill(@RequestBody OutStockoutVo outStockoutVo) {
String stockOutId = outStockoutService.saveBill(outStockoutVo);
public AjaxResult saveBill(@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);
OutStockoutVo outStockoutVo = new OutStockoutVo();
OutStockout outStockout = new OutStockout();
List<OutStockoutDetail> list = new ArrayList<>();
outStockout.setStockoutId(param.get("doc_no").toString());
List<OutStockout> outStockout1 = outStockoutService.selectOutStockoutList(outStockout);
if(outStockout1.size()>0){
return AjaxResult.error("单据已推送!");
}
outStockout.setStockoutGuid(UUID.randomUUID().toString());
outStockout.setOutType("1");
outStockout.setCreateDate(DateUtil.formatDateTime(new Date()));
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){
BasCustomer basCustomer = new BasCustomer();
basCustomer.setId(UUID.randomUUID().toString());
basCustomer.setCustomerNo(param.get("customer_no").toString());
basCustomer.setCustomerName(param.get("customer_name").toString());
basCustomer.setUseable("1");
basCustomerService.insertBasCustomer(basCustomer);
}
outStockout.setStatus("1");
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++){
JSONObject msg = (JSONObject) erpList.get(i);
OutStockoutDetail detail = new OutStockoutDetail();
detail.setStockoutDetailId(msg.get("sales_delivery_no").toString());
detail.setStockoutGuid(outStockout.getStockoutGuid());
detail.setStockoutId(outStockout.getStockoutId());
detail.setProductId(msg.get("item_no").toString());
detail.setProductName(msg.get("item_name").toString());
detail.setSpec(msg.get("item_spec").toString());
detail.setQuantity(new BigDecimal(msg.get("business_qty").toString()));
detail.setAllotQuantity(BigDecimal.ZERO);
detail.setAssignNum(BigDecimal.ZERO);
detail.setRemark(msg.get("udf021").toString());
list.add(detail);
}
}
outStockoutVo.setOutStockout(outStockout);
outStockoutVo.setDetailList(list);
String stockOutId = outStockoutService.saveBillErp(outStockoutVo);
AjaxResult ajaxResult = AjaxResult.success(stockOutId);
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(outStockoutVo), "出库单据保存", ajaxResult);
RequestLog requestLog = requestLogService.getRequestLog(json, "出库单据保存", ajaxResult);
requestLogService.insertRequestLog(requestLog);
return ajaxResult;
}

View File

@@ -0,0 +1,22 @@
package com.ruoyi.api.domain;
public class Condition {
private String filed_name;
private String value;
public String getFiled_name() {
return filed_name;
}
public void setFiled_name(String filed_name) {
this.filed_name = filed_name;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}

View File

@@ -18,8 +18,8 @@ public class ErpInOutBoundOrder {
@Alias("DOC_ID_DOC_CODE")
private String DOC_ID_DOC_CODE;
//单据类型.组织类型.工厂/储运.工厂/储运编号 B0801
@Alias("DOC_ID_Owner_Org_PLANT_CODR")
private String DOC_ID_Owner_Org_PLANT_CODR;
@Alias("DOC_ID_Owner_Org_PLANT_PLANT_CODE")
private String DOC_ID_Owner_Org_PLANT_PLANT_CODE;
//单据日期
@Alias("DOC_DATE")
private String DOC_DATE;

View File

@@ -10,5 +10,5 @@ import lombok.NoArgsConstructor;
public class RequestEnterResponse {
private String cargoSpaceId;
private String trayCode;
private String taskNo;
private String jobId;
}

View File

@@ -50,12 +50,6 @@ public class WipTransferDoc {
@Alias("Owner_Dept_ADMIN_UNIT_CODE")
private String Owner_Dept_ADMIN_UNIT_CODE;
/**
* 移出部门, 生效日期
*/
@Alias("Owner_Dept_START_DATE")
private String Owner_Dept_START_DATE;
/**
* 关联员工, 员工编号
*/
@@ -74,6 +68,12 @@ public class WipTransferDoc {
@Alias("WAREHOUSE_ID_WAREHOUSE_CODE")
private String WAREHOUSE_ID_WAREHOUSE_CODE;
@Alias("FROM_ADMIN_UNIT_ID_START_DATE")
private String FROM_ADMIN_UNIT_ID_START_DATE;
@Alias("Owner_Dept_START_DATE")
private String Owner_Dept_START_DATE;
/**
* WIP 转移文档明细列表
*/

View File

@@ -15,5 +15,5 @@ public interface IToErpService {
void callbackTransferBill();
AjaxResult createWorkshopInboundOrder(BasProduct basProduct);
AjaxResult createWorkshopInboundOrder(BasProduct basProduct,String erpBill);
}

View File

@@ -40,12 +40,12 @@ public class ToErpServiceImpl implements IToErpService {
@Autowired
private IRequestLogService requestLogService;
private static final String TO_ERP_URL = "http://192.168.1.100:8080/api/";
private static final String TO_ERP_URL = "http://223.113.254.106:9990/CROSS/RESTful";
//todo 需要调试
private static final String WORKSHOP_INBOUND_ORDER_URL = TO_ERP_URL+"TRANSACTION_DOC";
private static final String WORKSHOP_INBOUND_ORDER_URL = TO_ERP_URL;
//todo 需要调试
private static final String OTHER_IN_OUTBOUND_ORDER_URL = TO_ERP_URL+"WIP_TRANSFER_DOC";
private static final String OTHER_IN_OUTBOUND_ORDER_URL = TO_ERP_URL;
@Override
@@ -56,7 +56,7 @@ public class ToErpServiceImpl implements IToErpService {
for (TransferBillCallback transferBillCallback : list) {
//todo 请求其他出入库单回传接口
AjaxResult otherInOutboundOrder = createOtherInOutboundOrder(transferBillCallback);
if (otherInOutboundOrder.isSuccess()){
if (otherInOutboundOrder.isSuccess()) {
transferBillCallback.setStatus("1");
transferBillCallback.setFinishTime(DateUtil.formatDateTime(new Date()));
transferBillCallbackService.updateTransferBillCallback(transferBillCallback);
@@ -65,37 +65,46 @@ public class ToErpServiceImpl implements IToErpService {
}
@Override
public AjaxResult createWorkshopInboundOrder(BasProduct basProduct) {
public AjaxResult createWorkshopInboundOrder(BasProduct basProduct,String erpBill) {
ErpInterfaceParam<WipTransferDoc> param = new ErpInterfaceParam<>();
ErpStdData<WipTransferDoc> erpStdData = new ErpStdData<>();
ErpParameter<WipTransferDoc> objectErpParameter = new ErpParameter<>();
ArrayList<WipTransferDocD> list = new ArrayList<WipTransferDocD>();
WipTransferDoc wipTransferDoc = new WipTransferDoc();
wipTransferDoc.setDOC_NO(basJobIdService.getJobId("5C21"));
wipTransferDoc.setDOC_NO(basJobIdService.getJobIdBy("5C21"));
wipTransferDoc.setDOC_ID_DOC_CODE("5C21");
wipTransferDoc.setDOC_DATE(DateUtil.formatDateTime(new Date()));
wipTransferDoc.setSOURCE_ID_WORK_CENTER_WORK_CENTER_CODE("QD09");
wipTransferDoc.setFROM_ADMIN_UNIT_ID_ADMIN_UNIT_CODE("HM01G");
wipTransferDoc.setFROM_ADMIN_UNIT_ID_START_DATE(DateUtil.formatDateTime(new Date()));
wipTransferDoc.setOwner_Dept_ADMIN_UNIT_CODE("HM01G");
wipTransferDoc.setOwner_Dept_START_DATE(DateUtil.formatDateTime(new Date()));
wipTransferDoc.setOwner_Emp_EMPLOYEE_CODE("HM01G");
String docNo = requestLogService.getRequestLogDoc(WORKSHOP_INBOUND_ORDER_URL,erpBill, basProduct.getProductId() , "获取工艺单号", "wms", "erp");
if("".equals(docNo) || docNo == null) {
return AjaxResult.error();
}
WipTransferDocD wipTransferDocD = new WipTransferDocD();
wipTransferDocD.setMO_ID_DOC_NO(basJobIdService.getJobId("5C21"));
wipTransferDocD.setMO_ID_DOC_NO(docNo);
wipTransferDocD.setTO_ADMIN_UNIT_ID_START_DATE(DateUtil.formatDateTime(new Date()));
wipTransferDocD.setQTY("1");
wipTransferDocD.setITEM_ID_ITEM_CODE(DateUtil.formatDateTime(new Date()));
wipTransferDocD.setITEM_ID_ITEM_CODE(basProduct.getProductId());
wipTransferDocD.setITEM_NAME(basProduct.getProductName());
wipTransferDocD.setITEM_SPECIFICATION(basProduct.getSpec());
wipTransferDocD.setSOURCE_ID_WAREHOUSE_WAREHOUSE_CODE("Z251");
wipTransferDocD.setSOURCE_ID_WAREHOUSE_WAREHOUSE_CODE("H041-1");
wipTransferDocD.setFROM_MO_ROUTING_D_ID_SequenceNumber(1);
wipTransferDocD.setFROM_MO_ROUTING_D_ID_Parent_MO_ID_DOC_NO(docNo);
list.add(wipTransferDocD);
wipTransferDoc.setWIP_TRANSFER_DOC_D(list);
objectErpParameter.setDatas(List.of(wipTransferDoc));
erpStdData.setParameter(objectErpParameter);
param.setStd_data(erpStdData);
RequestLog requestLog = requestLogService.getRequestLog(WORKSHOP_INBOUND_ORDER_URL, JSONUtil.toJsonStr(param), "创建工艺单","wms","erp");
// String post = requestLog.getResponseBody();
// ErpInterfaceParam bean = JSONUtil.toBean(post, ErpInterfaceParam.class);
// if ("0".equals(bean.getStd_data().getExecution().getCode())) {
// return AjaxResult.success();
// }
if(requestLog != null && "1".equals(requestLog.getIsSuccessful())){
RequestLog requestLog = requestLogService.getRequestLogGd(WORKSHOP_INBOUND_ORDER_URL, JSONUtil.toJsonStr(param), "创建工艺单", "wms", "erp");
if (requestLog != null && "1".equals(requestLog.getIsSuccessful())) {
return AjaxResult.success();
}else{
} else {
return AjaxResult.error();
}
}
@@ -109,51 +118,49 @@ public class ToErpServiceImpl implements IToErpService {
ErpInOutBoundOrder erpInOutBoundOrder = new ErpInOutBoundOrder();
String docNo = "";
String docIdDocCode = "";
if ("1".equals(transferBillCallback.getType())){
docNo = basJobIdService.getJobId("11T1");
if ("1".equals(transferBillCallback.getType())) {
docNo = basJobIdService.getJobIdBy("11T1");
docIdDocCode = "11T1";
}else {
docNo = basJobIdService.getJobId("11T2");
} else {
docNo = basJobIdService.getJobIdBy("11T2");
docIdDocCode = "11T2";
}
erpInOutBoundOrder.setDOC_NO(docNo);
erpInOutBoundOrder.setDOC_ID_DOC_CODE(docIdDocCode);
erpInOutBoundOrder.setDOC_ID_Owner_Org_PLANT_CODR("B0801");
erpInOutBoundOrder.setDOC_ID_Owner_Org_PLANT_PLANT_CODE("B0801");
erpInOutBoundOrder.setDOC_DATE(DateUtil.formatDateTime(new Date()));
erpInOutBoundOrder.setTRANSACTION_DATE(DateUtil.formatDateTime(new Date()));
erpInOutBoundOrder.setOwner_Emp_EMPLOYEE_CODE("");
erpInOutBoundOrder.setOwner_Emp_EMPLOYEE_CODE("E11173");
erpInOutBoundOrder.setOwner_Org_PLANT_PLANT_CODE("B0801");
erpInOutBoundOrder.setApproveStatus("N");
erpInOutBoundOrder.setCATEGORY("11");
erpInOutBoundOrder.setCOMPANY_ID_COMPANY_CODE("B08");
erpInOutBoundOrder.setOwner_Dept_ADMIN_UNIT_CODE("");
erpInOutBoundOrder.setOwner_Dept_ADMIN_UNIT_CODE("HM01F");
erpInOutBoundOrder.setSTOCK_ACTION(1);
List<MydoJobDetail> mydoJobDetails = mydoJobDetailService.selectMydoJobDetailListByJobId(transferBillCallback.getJobId());
//List<MydoJobDetail> mydoJobDetails = mydoJobDetailService.selectMydoJobDetailListByJobId(transferBillCallback.getJobId());
ArrayList<ErpTransactionDocD> erpTransactionDocDS = new ArrayList<>();
for (int i = 0; i < mydoJobDetails.size(); i++) {
MydoJobDetail mydoJobDetail = mydoJobDetails.get(i);
ErpTransactionDocD erpTransactionDocD = new ErpTransactionDocD();
erpTransactionDocD.setSequenceNumber(i+1);
erpTransactionDocD.setITEM_ID_ITEM_CODE(mydoJobDetail.getProductId());
erpTransactionDocD.setITEM_DESCRIPTION(mydoJobDetail.getProductName());
erpTransactionDocD.setITEM_SPECIFICATION(mydoJobDetail.getSpec());
erpTransactionDocD.setSequenceNumber(1);
erpTransactionDocD.setITEM_ID_ITEM_CODE(transferBillCallback.getSpare1());
erpTransactionDocD.setITEM_DESCRIPTION(transferBillCallback.getSpare2());
erpTransactionDocD.setITEM_SPECIFICATION(transferBillCallback.getSpare3());
erpTransactionDocD.setBUSINESS_QTY(1.0);
erpTransactionDocD.setWAREHOUSE_ID_WAREHOUSE_CODE("");
erpTransactionDocD.setWAREHOUSE_ID_Owner_Org_PLANT_PLANT_CODE("");
erpTransactionDocD.setBUSINESS_UNIT_ID_UNIT_CODE("");
erpTransactionDocD.setWAREHOUSE_ID_WAREHOUSE_CODE("H041-1");
erpTransactionDocD.setWAREHOUSE_ID_Owner_Org_PLANT_PLANT_CODE("B0801");
erpTransactionDocD.setBUSINESS_UNIT_ID_UNIT_CODE("TAI");
erpTransactionDocD.setGENERATE_SOURCE("");
erpTransactionDocDS.add(erpTransactionDocD);
}
erpInOutBoundOrder.setTRANSACTION_DOC_D(erpTransactionDocDS);
list.add(erpInOutBoundOrder);
objectErpParameter.setDatas(list);
erpStdData.setParameter(objectErpParameter);
param.setStd_data(erpStdData);
RequestLog requestLog = requestLogService.getRequestLog( OTHER_IN_OUTBOUND_ORDER_URL, JSONUtil.toJsonStr(param), "创建其他入出库单","wms","erp");
RequestLog requestLog = requestLogService.getRequestLogOther(OTHER_IN_OUTBOUND_ORDER_URL, JSONUtil.toJsonStr(param), "创建其他入出库单", "wms", "erp");
if(requestLog != null && "1".equals(requestLog.getIsSuccessful())){
if (requestLog != null && "1".equals(requestLog.getIsSuccessful())) {
return AjaxResult.success();
}else{
} else {
return AjaxResult.error();
}
// String post = requestLog.getResponseBody();

View File

@@ -33,13 +33,13 @@ public class ToWcsServiceImpl implements IToWcsService {
@Autowired
private IAgvContainerTaskService agvContainerTaskService;
public static final String PUSH_OUT_MYDO_JOB = "http://localhost:8081/wcs2Wms/api/receiveOutMydoJob";
public static final String PUSH_IN_MYDO_JOB = "http://localhost:8081/wcs2Wms/api/receiveInMydoJob";
public static final String PUSH_AGV_MOVE_JOB = "http://localhost:8081/agv/api/receiveAgvMoveJob";
public static final String OUT_MYDOJOB_MS = "http://localhost:8081/wcs2Wms/api/outMydojobMakesure";
public static final String CANCEL_MYDOJOB = "http://localhost:8081/wcs2Wms/api/cancelMydoJob";
public static final String SELECT_WCS_PORT = "http://localhost:8081/wcs2Wms/api/selectWcsPort";
public static final String UPDATE_WCS_PORT = "http://localhost:8081/wcs2Wms/api/updateWcsPort";
public static final String PUSH_OUT_MYDO_JOB = "http://192.168.58.162:8084/wcs2Wms/api/receiveOutMydoJob";
public static final String PUSH_IN_MYDO_JOB = "http://192.168.58.162:8084/wcs2Wms/api/receiveInMydoJob";
public static final String PUSH_AGV_MOVE_JOB = "http://192.168.58.162:8084/agv/api/receiveAgvMoveJob";
public static final String OUT_MYDOJOB_MS = "http://192.168.58.162:8084/wcs2Wms/api/outMydojobMakesure";
public static final String CANCEL_MYDOJOB = "http://192.168.58.162:8084/wcs2Wms/api/cancelMydoJob";
public static final String SELECT_WCS_PORT = "http://192.168.58.162:8084/wcs2Wms/api/selectWcsPort";
public static final String UPDATE_WCS_PORT = "http://192.168.58.162:8084/wcs2Wms/api/updateWcsPort";
@Override

View File

@@ -87,26 +87,6 @@ public class ToWmsServiceImpl implements IToWmsService {
@Autowired
private IBasStockService stockService;
private static final Map<String, Pattern> PATTERNS = createPatterns();
private static Map<String, Pattern> createPatterns() {
Map<String, Pattern> map = new LinkedHashMap<>();
map.put("MODEL", Pattern.compile("MODEL:([^\\s]+)", Pattern.CASE_INSENSITIVE));
map.put("COLOR", Pattern.compile("COLOR:([^\\s]+)", Pattern.CASE_INSENSITIVE));
map.put("SERIAL", Pattern.compile("SERIAL:([^\\s]+)", Pattern.CASE_INSENSITIVE));
map.put("V", Pattern.compile("V:([^\\s]+)", Pattern.CASE_INSENSITIVE));
map.put("Hz", Pattern.compile("Hz:([^\\s]+)", Pattern.CASE_INSENSITIVE));
map.put("PH", Pattern.compile("PH:([^\\s]+)", Pattern.CASE_INSENSITIVE));
map.put("NW", Pattern.compile("N\\.W\\.:([^\\s]+)", Pattern.CASE_INSENSITIVE));
map.put("GW", Pattern.compile("G\\.W\\.:([^\\s]+)", Pattern.CASE_INSENSITIVE));
map.put("ITEM_CODE", Pattern.compile("ITEM_CODE:([^\\s]+)", Pattern.CASE_INSENSITIVE));
map.put("@", Pattern.compile("@:([^\\s]+)", Pattern.CASE_INSENSITIVE));
return map;
}
private static String findFirst(Pattern pattern, String input) {
if (pattern == null || input == null) return null;
Matcher m = pattern.matcher(input);
return m.find() ? m.group(1) : null;
}
@Override
@Transactional(rollbackFor = Exception.class)
@@ -115,10 +95,10 @@ public class ToWmsServiceImpl implements IToWmsService {
HashMap<String, String> result = new HashMap<>();
// if (StrUtil.isEmpty(requestEnter.getTrayCode())) {
// return AjaxResult.error("托盘条码不能为空");
// }
// log.info("扫码内容{}", requestEnter.getTrayCode());
if (StrUtil.isEmpty(requestEnter.getTrayCode())) {
return AjaxResult.error("托盘条码不能为空");
}
log.info("扫码内容{}", requestEnter.getTrayCode());
//解析扫码内容
String trayCode = requestEnter.getTrayCode();
@@ -147,6 +127,7 @@ public class ToWmsServiceImpl implements IToWmsService {
return new AjaxResult(1, "二维码内容错误!");
}
}
List<MydoJob> inList = mydoJobService.getInJobBySerial(serial);
List<BasStock> stockList = stockService.getStockBySerial(serial);
if(!CollUtil.isEmpty(inList) || !CollUtil.isEmpty(stockList)) {
@@ -175,7 +156,6 @@ public class ToWmsServiceImpl implements IToWmsService {
return new AjaxResult(5, "超大托盘!");
}
//托盘大小与电气返回不匹配
if (StrUtil.isNotBlank(requestEnter.getSize()) && !"1".equals(requestEnter.getType()) && size != Integer.parseInt(requestEnter.getSize())) {
return new AjaxResult(6, "托盘大小不匹配!");
}
@@ -284,7 +264,7 @@ public class ToWmsServiceImpl implements IToWmsService {
//todo 创建工艺入库单
if ("2".equals(requestEnter.getFloor())){
AjaxResult workshopInboundOrder = toErpService.createWorkshopInboundOrder(basProduct);
AjaxResult workshopInboundOrder = toErpService.createWorkshopInboundOrder(basProduct,erpBill);
if (!workshopInboundOrder.isSuccess()){
//throw new RuntimeException("创建工单失败");
return new AjaxResult(9, "创建工艺入库单失败!");
@@ -339,8 +319,15 @@ public class ToWmsServiceImpl implements IToWmsService {
if (size == 5) {
return new AjaxResult(3, "超大托盘");
}
if(size == 1){
if("L1001".equals(requestEnter.getEntranceId()) || "L2004".equals(requestEnter.getEntranceId())){
return new AjaxResult(4, "入口与托盘尺寸对应错误!");
}
}
//托盘大小与电气返回不匹配
if (size != Integer.parseInt(requestEnter.getSize())) {
if (requestEnter.getSize() != null && !"".equals(requestEnter.getSize()) && size != Integer.parseInt(requestEnter.getSize())) {
return new AjaxResult(4, "托盘大小不匹配");
}
@@ -352,6 +339,7 @@ public class ToWmsServiceImpl implements IToWmsService {
result.put("trayCode", mydoJob.getTrayCode());
result.put("entranceId", mydoJob.getEntranceId());
result.put("flag", mydoJob.getWorkshopId());
result.put("traySize", mydoJob.getDepartmentId());
mydoJob.setStatus("3");
mydoJob.setStartTime(DateUtil.formatDateTime(new Date()));
mydoJobService.updateMydoJob(mydoJob);
@@ -411,15 +399,21 @@ public class ToWmsServiceImpl implements IToWmsService {
public AjaxResult reAssign(ReMaterialParam reMaterialParam) {
//重新分配货位
MydoJob mydoJob = mydoJobService.selectMydoJobByJobId(reMaterialParam.getJobId());
String warehouseId = mydoJob.getWarehouseId();
//String warehouseId = mydoJob.getWarehouseId();
BasCargoSpace basCargoSpaceParam = new BasCargoSpace();
basCargoSpaceParam.setWarehouseId(warehouseId);
//basCargoSpaceParam.setWarehouseId(warehouseId);
basCargoSpaceParam.setRoadwayId(mydoJob.getRoadwayId());
BasCargoSpace basCargoSpace = basCargoSpaceService.selectEmptyCargoSpaceByWarehouseId(basCargoSpaceParam);
if (basCargoSpace == null) {
log.error("没有空货位");
return AjaxResult.error(MessageUtils.message("error.message20"));
} else {
BasCargoSpace space = basCargoSpaceService.selectBasCargoSpaceByCargoSpaceId(mydoJob.getCargoSpaceId());
space.setStatus("5");
basCargoSpaceService.updateBasCargoSpace(space);
basCargoSpace.setStatus("3");
basCargoSpaceService.updateBasCargoSpace(basCargoSpace);
mydoJob.setCargoSpaceId(basCargoSpace.getCargoSpaceId());
mydoJob.setFaultFlag("1");
mydoJobService.updateMydoJob(mydoJob);
@@ -450,20 +444,21 @@ public class ToWmsServiceImpl implements IToWmsService {
}
log.info("扫码内容{}", requestEnter.getTrayCode());
//解析扫码内容
String trayCode = requestEnter.getTrayCode();
String[] split = trayCode.split(" ");
String model = split[0].substring(6);
String color = split[1].substring(6);
String serial = split[2].substring(7);
String v = split[3].substring(2);
String hz = split[4].substring(3);
String ph = split[5].substring(3);
String nw = split[6].substring(5);
String gw = split[7].substring(5);
String productId = split[8].substring(10);
String bm = split[9].substring(2, split[9].length() - 1);
String[] split = trayCode.split("\\s+");
String model = findFirst(PATTERNS.get("MODEL"), trayCode);
model=model.replace("<EFBFBD>"," ");
String color = findFirst(PATTERNS.get("COLOR"), trayCode);
String serial = findFirst(PATTERNS.get("SERIAL"), trayCode);
String v = findFirst(PATTERNS.get("V"), trayCode);
String hz = findFirst(PATTERNS.get("Hz"), trayCode);
String ph = findFirst(PATTERNS.get("PH"), trayCode);
String nw = findFirst(PATTERNS.get("NW"), trayCode);
String gw = findFirst(PATTERNS.get("GW"), trayCode);;
String productId = findFirst(PATTERNS.get("ITEM_CODE"), trayCode);
String bm = findFirst(PATTERNS.get("@"), trayCode);
bm=bm.substring(0,bm.length()-1);
String[] decode = ProcodeUtils.decode(bm);
String erpBill = decode[0];
String xh = decode[1];
@@ -504,12 +499,17 @@ public class ToWmsServiceImpl implements IToWmsService {
//根据包装方式 主要包装方式 描述 长 宽 高 包装材积
int size = Convert.toInt(basProduct.getSpare10());
if(size == 1){
if("L1001".equals(requestEnter.getEntranceId()) || "L2004".equals(requestEnter.getEntranceId())){
return new AjaxResult(4, "入口与托盘尺寸对应错误!");
}
}
//超大托盘不处理 直接返回
if (size == 5) {
return new AjaxResult(3, "超大托盘");
}
//托盘大小与电气返回不匹配
if (StrUtil.isNotBlank(requestEnter.getSize()) && !"1".equals(requestEnter.getType()) && size != Integer.parseInt(requestEnter.getSize())) {
return new AjaxResult(4, "托盘大小不匹配");
}
@@ -523,6 +523,7 @@ public class ToWmsServiceImpl implements IToWmsService {
result.put("trayCode", mydoJob.getTrayCode());
result.put("flag", mydoJob.getWorkshopId());
result.put("inOrOut", mydoJob.getInOrOut());
result.put("traySize", mydoJob.getDepartmentId());
mydoJob.setStatus("3");
mydoJob.setStartTime(DateUtil.formatDateTime(new Date()));
@@ -584,4 +585,24 @@ public class ToWmsServiceImpl implements IToWmsService {
}
private static final Map<String, Pattern> PATTERNS = createPatterns();
private static Map<String, Pattern> createPatterns() {
Map<String, Pattern> map = new LinkedHashMap<>();
map.put("MODEL", Pattern.compile("MODEL:([^\\s]+)", Pattern.CASE_INSENSITIVE));
map.put("COLOR", Pattern.compile("COLOR:([^\\s]+)", Pattern.CASE_INSENSITIVE));
map.put("SERIAL", Pattern.compile("SERIAL:([^\\s]+)", Pattern.CASE_INSENSITIVE));
map.put("V", Pattern.compile("V:([^\\s]+)", Pattern.CASE_INSENSITIVE));
map.put("Hz", Pattern.compile("Hz:([^\\s]+)", Pattern.CASE_INSENSITIVE));
map.put("PH", Pattern.compile("PH:([^\\s]+)", Pattern.CASE_INSENSITIVE));
map.put("NW", Pattern.compile("N\\.W\\.:([^\\s]+)", Pattern.CASE_INSENSITIVE));
map.put("GW", Pattern.compile("G\\.W\\.:([^\\s]+)", Pattern.CASE_INSENSITIVE));
map.put("ITEM_CODE", Pattern.compile("ITEM_CODE:([^\\s]+)", Pattern.CASE_INSENSITIVE));
map.put("@", Pattern.compile("@:([^\\s]+)", Pattern.CASE_INSENSITIVE));
return map;
}
private static String findFirst(Pattern pattern, String input) {
if (pattern == null || input == null) return null;
Matcher m = pattern.matcher(input);
return m.find() ? m.group(1) : null;
}
}

View File

@@ -59,4 +59,6 @@ public interface BasCustomerMapper
* @return 结果
*/
public int deleteBasCustomerByIds(String[] ids);
BasCustomer selectBasCustomerByNo(String customerNo);
}

View File

@@ -59,4 +59,6 @@ public interface IBasCustomerService
* @return 结果
*/
public int deleteBasCustomerById(String id);
BasCustomer selectBasCustomerByNo(String customerNo);
}

View File

@@ -91,4 +91,9 @@ public class BasCustomerServiceImpl implements IBasCustomerService
{
return basCustomerMapper.deleteBasCustomerById(id);
}
@Override
public BasCustomer selectBasCustomerByNo(String customerNo) {
return basCustomerMapper.selectBasCustomerByNo(customerNo);
}
}

View File

@@ -67,4 +67,6 @@ public interface IBasJobIdService
*/
public String getJobId(String type);
public String getJobIdBy(String type);
}

View File

@@ -137,4 +137,42 @@ public class BasJobIdServiceImpl implements IBasJobIdService
return outStockId;
}
@Override
public String getJobIdBy(String type) {
SimpleDateFormat format=new SimpleDateFormat("yyyyMMdd");
String date = format.format(new Date());
BasJobId basJobId1 = new BasJobId();
basJobId1.setStockId(date);
basJobId1.setType(type);
int count=basJobIdMapper.getIdByDate(basJobId1);
String outStockId="";
if(count>0){
int i=Integer.valueOf(basJobIdMapper.getIdByType(type));
// String[] split=outStockIdPre.split(date);
// int i=Integer.parseInt(split[1]);
if(i>99999){
i=1;
}
String num=String.format("%04d",++i);
outStockId=type+"-"+date+num;
BasJobId basJobId=new BasJobId();
basJobId.setJobId(num);
basJobId.setType(type);
basJobId.setStockId(date);
basJobIdMapper.updateBasJobId(basJobId);
}else{
int i=1;
String num=String.format("%04d",i);
outStockId=type+"-"+date+num;
BasJobId basJobId=new BasJobId();
basJobId.setJobId(num);
basJobId.setType(type);
basJobId.setStockId(date);
basJobIdMapper.updateBasJobId(basJobId);
}
return outStockId;
}
}

View File

@@ -39,17 +39,20 @@ public class TransferBillCallback extends BaseEntity
private String finishTime;
/** 备用字段1 */
@Excel(name = "备用字段1")
@Excel(name = "品号")
private String spare1;
/** 备用字段2 */
@Excel(name = "备用字段2")
@Excel(name = "品名")
private String spare2;
/** 备用字段3 */
@Excel(name = "备用字段3")
@Excel(name = "规格")
private String spare3;
@Excel(name = "序列号")
private String trayCode;
public void setId(Long id)
{
this.id = id;
@@ -140,19 +143,27 @@ public class TransferBillCallback extends BaseEntity
return spare3;
}
public String getTrayCode() {
return trayCode;
}
public void setTrayCode(String trayCode) {
this.trayCode = trayCode;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("jobId", getJobId())
.append("erpBill", getErpBill())
.append("type", getType())
.append("status", getStatus())
.append("createTime", getCreateTime())
.append("finishTime", getFinishTime())
.append("spare1", getSpare1())
.append("spare2", getSpare2())
.append("spare3", getSpare3())
.toString();
return "TransferBillCallback{" +
"id=" + id +
", jobId='" + jobId + '\'' +
", erpBill='" + erpBill + '\'' +
", type='" + type + '\'' +
", status='" + status + '\'' +
", finishTime='" + finishTime + '\'' +
", spare1='" + spare1 + '\'' +
", spare2='" + spare2 + '\'' +
", spare3='" + spare3 + '\'' +
", trayCode='" + trayCode + '\'' +
'}';
}
}

View File

@@ -5,6 +5,8 @@ import cn.hutool.core.convert.Convert;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.ruoyi.api.service.IToWcsService;
import com.ruoyi.bas.BasProduct.domain.BasProduct;
import com.ruoyi.bas.BasProduct.mapper.BasProductMapper;
import com.ruoyi.bas.basJobId.service.IBasJobIdService;
import com.ruoyi.bas.cargoSpace.domain.BasCargoSpace;
import com.ruoyi.bas.cargoSpace.service.IBasCargoSpaceService;
@@ -84,6 +86,8 @@ public class MydoJobServiceImpl implements IMydoJobService {
@Autowired
private BasStockMapper basStockMapper;
@Autowired
private BasProductMapper basProductMapper;
@Autowired
private PdaMapper pdaMapper;
@Autowired
private ICheckDifferenceRecordService checkDifferenceRecordService;
@@ -203,15 +207,15 @@ public class MydoJobServiceImpl implements IMydoJobService {
param.setJobId(jobId);
List<MydoJobDetail> mydoJobDetails = mydoJobDetailService.selectMydoJobDetailList(param);
for (MydoJobDetail mydoJobDetail : mydoJobDetails) {
String inOrOutDId = mydoJobDetail.getInOrOutDId();
InStockinDetail inStockinDetail = inStockinDetailService.selectInStockinDetailByStockinDetailId(inOrOutDId);
BigDecimal stockInNum = Convert.toBigDecimal(inStockinDetail.getScanNum());
BigDecimal jobInNum = Convert.toBigDecimal(mydoJobDetail.getInQuantity());
BigDecimal subtract = stockInNum.subtract(jobInNum);
inStockinDetail.setScanNum(Convert.toStr(subtract));
inStockinDetailService.updateInStockinDetail(inStockinDetail);
}
// for (MydoJobDetail mydoJobDetail : mydoJobDetails) {
// String inOrOutDId = mydoJobDetail.getInOrOutDId();
// InStockinDetail inStockinDetail = inStockinDetailService.selectInStockinDetailByStockinDetailId(inOrOutDId);
// BigDecimal stockInNum = Convert.toBigDecimal(inStockinDetail.getScanNum());
// BigDecimal jobInNum = Convert.toBigDecimal(mydoJobDetail.getInQuantity());
// BigDecimal subtract = stockInNum.subtract(jobInNum);
// inStockinDetail.setScanNum(Convert.toStr(subtract));
// inStockinDetailService.updateInStockinDetail(inStockinDetail);
// }
//修改货位状态
BasCargoSpace basCargoSpace = basCargoSpaceService.selectBasCargoSpaceByCargoSpaceId(job.getCargoSpaceId());
basCargoSpace.setStatus("1");
@@ -224,8 +228,8 @@ public class MydoJobServiceImpl implements IMydoJobService {
insertHistory(mydoJob.getJobId());
}
//通知wcs
AjaxResult ajaxResult = iToWcsService.cancelTaskByTaskNo(job.getTaskNo());
log.info("取消任务结果:{}", ajaxResult);
//AjaxResult ajaxResult = iToWcsService.cancelTaskByTaskNo(job.getTaskNo());
//log.info("取消任务结果:{}", ajaxResult);
return AjaxResult.success();
}
@@ -262,8 +266,6 @@ public class MydoJobServiceImpl implements IMydoJobService {
BasCargoSpace basCargoSpace = basCargoSpaceService.selectBasCargoSpaceByCargoSpaceId(mydoJob.getCargoSpaceId());
if (CollUtil.isNotEmpty(mydoJobDetails)) {
List<BasStock> list = new ArrayList<>();
//查询盘点信息中的异常信息
CheckDifferenceRecord checkDifferenceRecordParam = new CheckDifferenceRecord();
checkDifferenceRecordParam.setTrayCode(mydoJob.getTrayCode());
@@ -354,6 +356,13 @@ public class MydoJobServiceImpl implements IMydoJobService {
transferBillCallback.setErpBill(mydoJob.getLineId());
transferBillCallback.setType("1");
transferBillCallback.setStatus("0");
BasProduct product = basProductMapper.selectBasProductByProductId(mydoJobDetails.get(0).getProductId());
transferBillCallback.setSpare1(mydoJobDetails.get(0).getProductId());
if(product != null) {
transferBillCallback.setSpare2(product.getProductName());
}
transferBillCallback.setSpare3(mydoJobDetails.get(0).getSpec());
transferBillCallback.setTrayCode(mydoJob.getTrayCode());
transferBillCallbackService.insertTransferBillCallback(transferBillCallback);
return AjaxResult.success();
} else {

View File

@@ -77,4 +77,10 @@ public interface IRequestLogService
* @return
*/
public RequestLog getRequestLog(String param, String remark, AjaxResult ajaxResult);
RequestLog getRequestLogGd(String workshopInboundOrderUrl, String jsonStr, String 创建工艺单, String wms, String erp);
RequestLog getRequestLogOther(String otherInOutboundOrderUrl, String jsonStr, String 创建其他入出库单, String wms, String erp);
String getRequestLogDoc(String workshopInboundOrderUrl, String erpBill, String productId, String 获取工艺单号, String wms, String erp);
}

View File

@@ -3,16 +3,19 @@ package com.ruoyi.log.service.impl;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil;
import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.ruoyi.api.domain.Condition;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.log.domain.RequestLog;
import com.ruoyi.log.mapper.RequestLogMapper;
import com.ruoyi.log.service.IRequestLogService;
import com.ruoyi.utils.HttpUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@@ -24,8 +27,7 @@ import java.util.List;
*/
@Service
@Slf4j
public class RequestLogServiceImpl implements IRequestLogService
{
public class RequestLogServiceImpl implements IRequestLogService {
@Autowired
private RequestLogMapper requestLogMapper;
@@ -36,8 +38,7 @@ public class RequestLogServiceImpl implements IRequestLogService
* @return 接口记录
*/
@Override
public RequestLog selectRequestLogByRequestId(Long requestId)
{
public RequestLog selectRequestLogByRequestId(Long requestId) {
return requestLogMapper.selectRequestLogByRequestId(requestId);
}
@@ -48,8 +49,7 @@ public class RequestLogServiceImpl implements IRequestLogService
* @return 接口记录
*/
@Override
public List<RequestLog> selectRequestLogList(RequestLog requestLog)
{
public List<RequestLog> selectRequestLogList(RequestLog requestLog) {
return requestLogMapper.selectRequestLogList(requestLog);
}
@@ -60,11 +60,10 @@ public class RequestLogServiceImpl implements IRequestLogService
* @return 结果
*/
@Override
public int insertRequestLog(RequestLog requestLog)
{
if (requestLog.getIsSuccessful().equals("1")){
public int insertRequestLog(RequestLog requestLog) {
if (requestLog.getIsSuccessful().equals("1")) {
return requestLogMapper.insertRequestLog(requestLog);
}else {
} else {
return 0;
}
}
@@ -76,8 +75,7 @@ public class RequestLogServiceImpl implements IRequestLogService
* @return 结果
*/
@Override
public int updateRequestLog(RequestLog requestLog)
{
public int updateRequestLog(RequestLog requestLog) {
return requestLogMapper.updateRequestLog(requestLog);
}
@@ -88,8 +86,7 @@ public class RequestLogServiceImpl implements IRequestLogService
* @return 结果
*/
@Override
public int deleteRequestLogByRequestIds(Long[] requestIds)
{
public int deleteRequestLogByRequestIds(Long[] requestIds) {
return requestLogMapper.deleteRequestLogByRequestIds(requestIds);
}
@@ -100,8 +97,7 @@ public class RequestLogServiceImpl implements IRequestLogService
* @return 结果
*/
@Override
public int deleteRequestLogByRequestId(Long requestId)
{
public int deleteRequestLogByRequestId(Long requestId) {
return requestLogMapper.deleteRequestLogByRequestId(requestId);
}
@@ -113,7 +109,7 @@ public class RequestLogServiceImpl implements IRequestLogService
* @return requestLog
*/
@Override
public RequestLog getRequestLog(String url, String param, String remark,String source,String target) {
public RequestLog getRequestLog(String url, String param, String remark, String source, String target) {
RequestLog requestLog = new RequestLog();
requestLog.setRequestTime(DateUtil.formatDateTime(new Date()));
requestLog.setSourceSystem(source);
@@ -124,8 +120,8 @@ public class RequestLogServiceImpl implements IRequestLogService
requestLog.setRequestBody(param);
requestLog.setRequestUrl(url);
try {
String resStr = HttpUtil.post(url, param);
String resStr = HttpUtils.sendPost(url, param, "application/json");
System.out.println(param);
// 判断resStr的状态码,如果不是200抛出异常让catch捕获
if (!JSONUtil.isJsonObj(resStr)) {
throw new RuntimeException("返回结果不是有效的JSON对象");
@@ -150,13 +146,172 @@ public class RequestLogServiceImpl implements IRequestLogService
return requestLog;
}
@Override
public RequestLog getRequestLogGd(String url, String param, String remark, String source, String target) {
RequestLog requestLog = new RequestLog();
requestLog.setRequestTime(DateUtil.formatDateTime(new Date()));
requestLog.setSourceSystem(source);
requestLog.setTargetSystem(target);
requestLog.setEndpoint(remark);
requestLog.setRequestMethod("post");
requestLog.setRequestHeaders(null);
requestLog.setRequestBody(param);
requestLog.setRequestUrl(url);
try {
String resStr = HttpUtils.sendPostGd(url, param, "application/json");
System.out.println(param);
// 判断resStr的状态码,如果不是200抛出异常让catch捕获
if (!JSONUtil.isJsonObj(resStr)) {
throw new RuntimeException("返回结果不是有效的JSON对象");
}
JSONObject jsonObject = JSONUtil.parseObj(resStr);
if (jsonObject == null) {
throw new RuntimeException("请求失败");
}
Object codeObj = jsonObject.get("std_data");
JSONObject obj = JSONUtil.parseObj(codeObj.toString());
String docNo = JSONUtil.parseObj(JSONUtil.parseObj(obj.get("parameter").toString()).get("result").toString()).get("success").toString();
if (docNo.length() > 0 && JSONUtil.parseArray(docNo).size() > 0) {
requestLog.setResponseBody(resStr);
requestLog.setResponseTime(DateUtil.formatDateTime(new Date()));
requestLog.setResponseStatus("1");
requestLog.setDuration(Convert.toStr(DateUtil.between(Convert.toDate(requestLog.getRequestTime()), Convert.toDate(requestLog.getResponseTime()), DateUnit.MS)));
requestLog.setIsSuccessful("1");
} else {
throw new RuntimeException("请求失败");
}
} catch (Exception e) {
requestLog.setErrorDetails(e.getMessage());
requestLog.setIsSuccessful("0");
requestLog.setResponseStatus("0");
} finally {
insertRequestLog(requestLog);
}
return requestLog;
}
@Override
public RequestLog getRequestLogOther(String url, String param, String remark, String source, String target) {
RequestLog requestLog = new RequestLog();
requestLog.setRequestTime(DateUtil.formatDateTime(new Date()));
requestLog.setSourceSystem(source);
requestLog.setTargetSystem(target);
requestLog.setEndpoint(remark);
requestLog.setRequestMethod("post");
requestLog.setRequestHeaders(null);
requestLog.setRequestBody(param);
requestLog.setRequestUrl(url);
try {
String resStr = HttpUtils.sendPostOther(url, param, "application/json");
System.out.println(param);
// 判断resStr的状态码,如果不是200抛出异常让catch捕获
if (!JSONUtil.isJsonObj(resStr)) {
throw new RuntimeException("返回结果不是有效的JSON对象");
}
JSONObject jsonObject = JSONUtil.parseObj(resStr);
if (jsonObject == null) {
throw new RuntimeException("请求失败");
}
Object codeObj = jsonObject.get("std_data");
JSONObject obj = JSONUtil.parseObj(codeObj.toString());
String docNo = JSONUtil.parseObj(JSONUtil.parseObj(obj.get("parameter").toString()).get("result").toString()).get("success").toString();
if (docNo.length() > 0 && JSONUtil.parseArray(docNo).size() > 0) {
requestLog.setResponseBody(resStr);
requestLog.setResponseTime(DateUtil.formatDateTime(new Date()));
requestLog.setResponseStatus("1");
requestLog.setDuration(Convert.toStr(DateUtil.between(Convert.toDate(requestLog.getRequestTime()), Convert.toDate(requestLog.getResponseTime()), DateUnit.MS)));
requestLog.setIsSuccessful("1");
} else {
throw new RuntimeException("请求失败");
}
} catch (Exception e) {
requestLog.setErrorDetails(e.getMessage());
requestLog.setIsSuccessful("0");
requestLog.setResponseStatus("0");
} finally {
insertRequestLog(requestLog);
}
return requestLog;
}
@Override
public String getRequestLogDoc(String url, String erpBill, String productId, String remark, String source, String target) {
String param = "{" +
" \"std_data\": {\n" +
" \"parameter\": {\n" +
" \"pageSize\": 20,\n" +
" \"pageNo\": 1,\n" +
" \"isGetSchema\": false,\n" +
" \"isGetCount\": false,\n" +
" \"conditions\": [\n" +
"\t {\n" +
"\t\t\t\"field_name\":\"DEMAND_NO\",\n" +
"\t\t\t\"value\":\""+erpBill+"\"\n" +
"\t\t},\n" +
"\t\t{\n" +
"\t\t\t\"field_name\":\"ITEM_CODE\",\n" +
"\t\t\t\"value\":\""+productId+"\"\n" +
"\t\t}\n" +
"\t ],\n" +
" \"orders\": []\n" +
" }\n" +
" }\n" +
"}";
String docNo = "";
RequestLog requestLog = new RequestLog();
requestLog.setRequestTime(DateUtil.formatDateTime(new Date()));
requestLog.setSourceSystem(source);
requestLog.setTargetSystem(target);
requestLog.setEndpoint(remark);
requestLog.setRequestMethod("post");
requestLog.setRequestHeaders(null);
requestLog.setRequestBody(param);
requestLog.setRequestUrl(url);
try {
String resStr = HttpUtils.sendPostDoc(url, param, "application/json");
System.out.println(param);
// 判断resStr的状态码,如果不是200抛出异常让catch捕获
if (!JSONUtil.isJsonObj(resStr)) {
throw new RuntimeException("返回结果不是有效的JSON对象");
}
JSONObject jsonObject = JSONUtil.parseObj(resStr);
if (jsonObject == null) {
throw new RuntimeException("请求失败");
}
Object codeObj = jsonObject.get("std_data");
JSONObject obj = JSONUtil.parseObj(codeObj.toString());
String docArr = JSONUtil.parseObj(obj.get("parameter").toString()).get("rows").toString();
if (docArr.length() > 0 && JSONUtil.parseArray(docArr).size() > 0) {
Object docObj = JSONUtil.parseArray(docArr).get(0);
docNo = JSONUtil.parseObj(docObj.toString()).get("DOC_NO").toString();
requestLog.setResponseBody(resStr);
requestLog.setResponseTime(DateUtil.formatDateTime(new Date()));
requestLog.setResponseStatus("1");
requestLog.setDuration(Convert.toStr(DateUtil.between(Convert.toDate(requestLog.getRequestTime()), Convert.toDate(requestLog.getResponseTime()), DateUnit.MS)));
requestLog.setIsSuccessful("1");
} else {
throw new RuntimeException("请求失败");
}
} catch (Exception e) {
requestLog.setErrorDetails(e.getMessage());
requestLog.setIsSuccessful("0");
requestLog.setResponseStatus("0");
} finally {
insertRequestLog(requestLog);
}
return docNo;
}
/**
* 插入请求日志
*
* @return requestLog
*/
@Override
public RequestLog getRequestLog(String param, String remark,AjaxResult ajaxResult) {
public RequestLog getRequestLog(String param, String remark, AjaxResult ajaxResult) {
RequestLog requestLog = new RequestLog();
requestLog.setRequestTime(DateUtil.formatDateTime(new Date()));
requestLog.setRequestBody(param);
@@ -167,9 +322,9 @@ public class RequestLogServiceImpl implements IRequestLogService
requestLog.setResponseTime(DateUtil.formatDateTime(new Date()));
requestLog.setDuration(Convert.toStr(DateUtil.between(Convert.toDate(requestLog.getRequestTime()), Convert.toDate(requestLog.getResponseTime()), DateUnit.MS)));
requestLog.setResponseStatus("1");
if (ajaxResult.isSuccess()){
if (ajaxResult.isSuccess()) {
requestLog.setIsSuccessful("1");
}else {
} else {
requestLog.setIsSuccessful("0");
}
requestLog.setResponseBody(Convert.toStr(ajaxResult.get("msg")));

View File

@@ -73,4 +73,6 @@ public interface IOutStockoutService
List<OutStockout> selectOutStockoutListApi(OutStockout outStockoutParam);
AjaxResult manualAllot(String[] stockList,String stockoutDetailId);
String saveBillErp(OutStockoutVo outStockoutVo);
}

View File

@@ -146,6 +146,18 @@ public class OutStockoutServiceImpl implements IOutStockoutService
return stockOutId;
}
@Override
@Transactional(rollbackFor = Exception.class)
public String saveBillErp(OutStockoutVo outStockoutVo) {
for (int i = 0; i < outStockoutVo.getDetailList().size(); i++) {
OutStockoutDetail outStockoutDetail = outStockoutVo.getDetailList().get(i);
outStockoutDetailMapper.insertOutStockoutDetail(outStockoutDetail);
}
outStockoutMapper.insertOutStockout(outStockoutVo.getOutStockout());
return outStockoutVo.getOutStockout().getStockoutId();
}
@Override
public String updateOutStockoutStatus(String[] stockoutIds, String status, String newStatus,String exitId) {
HashMap<String, String> map = new HashMap<>();

View File

@@ -6,9 +6,9 @@ spring:
druid:
# 主库数据源
master:
url: jdbc:sqlserver://172.16.2.170:1433;databaseName=FT517-wms;encrypt=true;trustServerCertificate=true;
url: jdbc:sqlserver://192.168.58.10:1433;databaseName=FT517-wms;encrypt=true;trustServerCertificate=true;
username: sa
password: Flrd0914.
password: www.123.com
# 从库数据源
slave:
# 从数据源开关/默认关闭

View File

@@ -16,7 +16,7 @@ ruoyi:
# 开发环境配置
server:
# 服务器的HTTP端口,默认为8080
port: 8080
port: 8082
servlet:
# 应用的访问路径
context-path: /
@@ -71,7 +71,7 @@ spring:
# redis 配置
redis:
# 地址
host: 172.16.2.170
host: 192.168.58.10
# 端口,默认为6379
port: 6379
# 数据库索引

View File

@@ -62,6 +62,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where id = #{id}
</select>
<select id="selectBasCustomerByNo" parameterType="String" resultMap="BasCustomerResult">
<include refid="selectBasCustomerVo"/>
where customer_no = #{customerNo}
</select>
<insert id="insertBasCustomer" parameterType="BasCustomer">
insert into bas_customer
<trim prefix="(" suffix=")" suffixOverrides=",">

View File

@@ -193,7 +193,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="roadwayId != null">
and roadway_id = #{roadwayId}
</if>
ORDER BY the_platoon, the_floor,the_column
ORDER BY the_floor,the_column desc,the_platoon
</select>
<select id="selectBasCargoSpaceListByRoadway" parameterType="BasCargoSpace" resultMap="BasCargoSpaceResult">
select bcs.cargo_space_id, bcs.warehouse_id, bcs.roadway_id, bcs.cargo_space_name,

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.in.erp.mapper.TransferBillCallbackMapper">
<resultMap type="TransferBillCallback" id="TransferBillCallbackResult">
@@ -15,10 +15,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="spare1" column="spare1" />
<result property="spare2" column="spare2" />
<result property="spare3" column="spare3" />
<result property="trayCode" column="tray_code" />
</resultMap>
<sql id="selectTransferBillCallbackVo">
select id, job_id, erp_bill, type, status, create_time, finish_time, spare1, spare2, spare3 from transfer_bill_callback
select id, job_id, erp_bill, type, status, create_time, finish_time,
spare1, spare2, spare3, tray_code from transfer_bill_callback
</sql>
<select id="selectTransferBillCallbackList" parameterType="TransferBillCallback" resultMap="TransferBillCallbackResult">
@@ -52,6 +54,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="spare1 != null">spare1,</if>
<if test="spare2 != null">spare2,</if>
<if test="spare3 != null">spare3,</if>
<if test="trayCode != null">tray_code,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="jobId != null">#{jobId},</if>
@@ -63,6 +66,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="spare1 != null">#{spare1},</if>
<if test="spare2 != null">#{spare2},</if>
<if test="spare3 != null">#{spare3},</if>
<if test="trayCode != null">#{trayCode},</if>
</trim>
</insert>

View File

@@ -148,10 +148,11 @@ public class HttpUtils
log.info("sendPost - {}", url);
URL realUrl = new URL(url);
URLConnection conn = realUrl.openConnection();
conn.setRequestProperty("accept", "*/*");
conn.setRequestProperty("connection", "Keep-Alive");
conn.setRequestProperty("user-agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64)");
conn.setRequestProperty("Accept-Charset", "utf-8");
conn.setRequestProperty("digi-key", "8462368FDC41FF7AA846DDDAF283D52E");
conn.setRequestProperty("digi-host", "{\"ver\":\"5.7\",\"prod\":\"YLTK\",\"timezone\":\"+8\",\"ip\":\"192.168.116.1\",\"id\":\"\",\"lang\":\"zh_CN\",\"acct\":\"dcms\",\"timestamp\":\"2018071990007275\"}");
conn.setRequestProperty("digi-service", "{\"prod\":\"E10\",\"ip\":\"192.168.116.179\",\"name\":\"yltk.transaction_doc.create\",\"id\":\"BY_External\"}");
conn.setRequestProperty("digi-data-exchange-protocol", "1.0");
conn.setRequestProperty("digi-type", "sync");
conn.setRequestProperty("Content-Type", contentType);
conn.setDoOutput(true);
conn.setDoInput(true);

View File

@@ -17,7 +17,7 @@ npm install --registry=https://registry.npmmirror.com
npm run dev
```
浏览器访问 http://localhost:80
浏览器访问 http://localhost:82
## 发布

View File

@@ -147,7 +147,7 @@
</template>
</el-table-column>
<el-table-column :label="'出口'" align="left" prop="exitId" sortable/>
<!-- <el-table-column :label="'客户编码'" align="left" prop="customerNo" />-->
<el-table-column :label="'客户编码'" align="left" prop="customerNo" />
<el-table-column :label="'客户名称'" align="left" prop="customerName" width="200"/>
<el-table-column :label="'建单人'" align="left" prop="createManId" />
<el-table-column :label="'创建时间'" align="left" prop="createDate" width="160" sortable/>
@@ -170,23 +170,24 @@
<el-table-column :label="'出库子单编号'" align="center" prop="stockoutDetailId" width="160" /> <!-- 出库子单编号 -->
<el-table-column :label="'品号'" align="center" prop="productId" sortable/> <!-- 品号 -->
<el-table-column :label="'品名'" align="center" prop="productName" />
<el-table-column :label="'批次号'" align="center" prop="lotNo"/><!--英文描述-->
<el-table-column :label="'序列号'" align="center" prop="printDate"/> <!--序列号-->
<el-table-column label="订单号" align="center" prop="orderId" width="160" />
<el-table-column :label="'规格'" align="center" prop="spec" /> <!--规格-->
<!-- <el-table-column :label="'批次号'" align="center" prop="lotNo"/>&lt;!&ndash;英文描述&ndash;&gt;-->
<!-- <el-table-column :label="'序列号'" align="center" prop="printDate"/> &lt;!&ndash;序列号&ndash;&gt;-->
<!-- <el-table-column label="订单号" align="center" prop="orderId" width="160" />-->
<el-table-column :label="'计划数量'" align="center" prop="quantity" /> <!-- 计划数量 -->
<el-table-column :label="'分配数量'" align="center" prop="allotQuantity" /> <!-- 分配数量 -->
<el-table-column :label="'实际数量'" align="center" prop="assignNum" /> <!-- 实际数量 -->
<el-table-column :label="'颜色'" align="center" prop="price"/><!--箱号-->
<el-table-column :label="'单位'" align="center" prop="unit"/><!--单位-->
<el-table-column :label="'规格'" align="center" prop="spec" /> <!--规格-->
<el-table-column :label="'型号'" align="center" prop="cargoNo" /> <!--型号-->
<el-table-column label="电压" align="center" prop="voltage" />
<el-table-column label="功率" align="center" prop="power" />
<el-table-column label="相位" align="center" prop="phase" />
<el-table-column label="净重" align="center" prop="netWeight" />
<el-table-column label="毛重" align="center" prop="grossWeight" />
<el-table-column label="分销" align="center" prop="distribution" />
<el-table-column label="机型" align="center" prop="model" />
<!-- <el-table-column :label="'颜色'" align="center" prop="price"/>&lt;!&ndash;箱号&ndash;&gt;-->
<!-- <el-table-column :label="'单位'" align="center" prop="unit"/>&lt;!&ndash;单位&ndash;&gt;-->
<!-- -->
<!-- <el-table-column :label="'型号'" align="center" prop="cargoNo" /> &lt;!&ndash;型号&ndash;&gt;-->
<!-- <el-table-column label="电压" align="center" prop="voltage" />-->
<!-- <el-table-column label="功率" align="center" prop="power" />-->
<!-- <el-table-column label="相位" align="center" prop="phase" />-->
<!-- <el-table-column label="净重" align="center" prop="netWeight" />-->
<!-- <el-table-column label="毛重" align="center" prop="grossWeight" />-->
<!-- <el-table-column label="分销" align="center" prop="distribution" />-->
<!-- <el-table-column label="机型" align="center" prop="model" />-->
<el-table-column :label="'备注'" align="center" prop="remark" /> <!-- 备注 -->
</el-table>

View File

@@ -9,10 +9,10 @@ const CompressionPlugin = require('compression-webpack-plugin')
const name = process.env.VUE_APP_TITLE || '若依管理系统' // 网页标题
const baseUrl = 'http://localhost:8080' // 后端接口
const port = process.env.port || process.env.npm_config_port || 80 // 端口
const baseUrl = 'http://localhost:8082' // 后端接口
// const port = process.env.port || process.env.npm_config_port || 80 // 端口
const port = 8081 // 端口
// vue.config.js 配置说明
//官方vue.config.js 参考文档 https://cli.vuejs.org/zh/config/#css-loaderoptions
// 这里只列一部分,具体配置参考文档