自动化立体仓库 - WMS系统
#
luxiaotao1123
2022-04-23 7a779f8de728514ab87de5f786a224b32e1a0c75
src/main/java/com/zy/asrs/task/handler/OrderSyncHandler.java
@@ -2,6 +2,7 @@
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.core.common.Cools;
import com.core.common.DateUtils;
import com.core.exception.CoolException;
import com.zy.asrs.entity.Order;
@@ -19,7 +20,6 @@
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import java.util.List;
@@ -48,7 +48,8 @@
        pakinParam.setLgortFrom("5008");
        pakinParam.setLgortTo("5006");
        for (OrderDetl orderDetl : orderDetls) {
            pakinParam.getList().add(new MesPakinParam.Detl(orderDetl.getMatnr(), orderDetl.getAnfme()));
            String serial = Cools.isEmpty(orderDetl.getBatch()) ? "" : orderDetl.getBatch();
            pakinParam.getList().add(new MesPakinParam.Detl(orderDetl.getMatnr() + (Cools.isEmpty(serial) ? "" : "-" + serial), orderDetl.getAnfme()));
        }
        String response = "";
        boolean success = false;
@@ -72,20 +73,20 @@
            }
        } catch (Exception e) {
            log.error("fail", e);
            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
//            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
            return FAIL.setMsg(e.getMessage());
        } finally {
            try {
                // 保存接口日志
//                apiLogService.save(
//                        "成品库入库上报",
//                        MesConstant.URL + MesConstant.PAKIN_URL,
//                        null,
//                        "127.0.0.1",
//                        JSON.toJSONString(pakinParam),
//                        response,
//                        success
//                );
                apiLogService.save(
                        "成品库入库上报",
                        MesConstant.URL + MesConstant.PAKIN_URL,
                        null,
                        "127.0.0.1",
                        JSON.toJSONString(pakinParam),
                        response,
                        success
                );
            } catch (Exception e) { log.error("", e); }
        }
        return SUCCESS;