| | |
| | | } catch (Exception e){ |
| | | return R.error("单据编号[order_id]以 "+sign_arm_sku+" 与 "+sign_arm_order+" 作为拆分标记拆分失败!!!"); |
| | | } |
| | | if (param.getArm_no()>4){ |
| | | return R.ok().add(true); |
| | | } |
| | | |
| | | boolean taskArmWorkOrderSign = openService.TaskArmWorkOrderSign(param); |
| | | return R.ok().add(taskArmWorkOrderSign); |
| | |
| | | return R.error("库位不存在或无明细"); |
| | | } |
| | | |
| | | /** |
| | | * AGV申请过光栅 |
| | | */ |
| | | @PostMapping("/agv/arm/grating/v1/agvCallback") |
| | | @AppAuth(memo = "AGV申请过光栅") |
| | | public synchronized R agvGrating(@RequestHeader(required = false) String appkey, |
| | | @RequestBody AgvGoTheArnParam param, |
| | | HttpServletRequest request) { |
| | | // auth(appkey, param, request); |
| | | if (Cools.isEmpty(param)) { |
| | | return R.parse(BaseRes.PARAM); |
| | | } |
| | | if (Cools.isEmpty(param.getCurrentPositionCode())) { |
| | | return R.error("位置[currentPositionCode]不能为空"); |
| | | } |
| | | boolean bindCtnrAndBin = true; |
| | | List<ArmAgvGratingParam> armList = param.getArmNo(); |
| | | if (armList.isEmpty()){ |
| | | return R.error("库位不存在或无明细"); |
| | | } |
| | | for (ArmAgvGratingParam arm : armList){ |
| | | if (bindCtnrAndBin){ |
| | | bindCtnrAndBin = openService.agvApplicationPassedTheGrating(arm); |
| | | // System.out.println("请求通过光栅"+armNo); |
| | | } |
| | | } |
| | | if (bindCtnrAndBin) { |
| | | return new R(0,"成功"); |
| | | } |
| | | return R.error("库位不存在或无明细"); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.entity.param; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class AgvGoTheArnParam { |
| | | String reqCode; //任务号 |
| | | String reqTime; // |
| | | String currentPositionCode; // 位置 |
| | | String method; // |
| | | String robotCode; // |
| | | String taskCode; // |
| | | |
| | | public List<ArmAgvGratingParam> getArmNo() { |
| | | List<ArmAgvGratingParam> armList = new ArrayList<>(); |
| | | if (this.currentPositionCode == null) return armList; |
| | | switch (this.currentPositionCode) { |
| | | case "028370CC015200": |
| | | case "029870CC015200": |
| | | case "3100101": |
| | | case "3100201": |
| | | ArmAgvGratingParam armAgvGratingParam1 = new ArmAgvGratingParam(); |
| | | armAgvGratingParam1.setArmNo(5); |
| | | armAgvGratingParam1.setChannel("A1"); |
| | | armList.add(armAgvGratingParam1); |
| | | return armList; |
| | | case "028440CC024257": |
| | | case "029940CC024257": |
| | | case "3000101": |
| | | case "3000201": |
| | | case "2900101": |
| | | case "2900201": |
| | | ArmAgvGratingParam armAgvGratingParam2 = new ArmAgvGratingParam(); |
| | | armAgvGratingParam2.setArmNo(5); |
| | | armAgvGratingParam2.setChannel("A2"); |
| | | armList.add(armAgvGratingParam2); |
| | | ArmAgvGratingParam armAgvGratingParam3 = new ArmAgvGratingParam(); |
| | | armAgvGratingParam3.setArmNo(6); |
| | | armAgvGratingParam3.setChannel("A1"); |
| | | armList.add(armAgvGratingParam3); |
| | | return armList; |
| | | case "028440CC031993": |
| | | case "029940CC031993": |
| | | case "2800101": |
| | | case "2800201": |
| | | ArmAgvGratingParam armAgvGratingParam4 = new ArmAgvGratingParam(); |
| | | armAgvGratingParam4.setArmNo(6); |
| | | armAgvGratingParam4.setChannel("A2"); |
| | | armList.add(armAgvGratingParam4); |
| | | return armList; |
| | | default: |
| | | return armList; |
| | | } |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.entity.param; |
| | | |
| | | import com.core.common.DateUtils; |
| | | import lombok.Data; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class ArmAgvGratingParam { |
| | | Integer armNo; // |
| | | String channel; // |
| | | String date_time = DateUtils.convert(new Date(), DateUtils.yyyyMMddHHmmss_F); // |
| | | |
| | | } |
| | |
| | | @Mapper |
| | | @Repository |
| | | public interface BasArmMastMapper extends BaseMapper<BasArmMast> { |
| | | boolean updateArmMastStatus(@Param("armNo")int armNo, @Param("sortingLine")int sortingLine, @Param("status")int status, @Param("endStatus")int endStatus); |
| | | boolean updateArmMastStatus(@Param("armNo")int armNo, @Param("sortingLine")int sortingLine, @Param("status")int status, @Param("endStatus")int endStatus, @Param("staNoEnd")int staNoEnd); |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | |
| | | public interface BasArmMastService extends IService<BasArmMast> { |
| | | boolean updateArmMastStatus(int armNo,int sortingLine,int status,int endStatus); |
| | | boolean updateArmMastStatus(int armNo,int sortingLine,int status,int endStatus,int staNoEnd); |
| | | |
| | | } |
| | |
| | | boolean taskAgvCreate(TaskAgvCreateParam param); |
| | | List<AgvLocListDetlParam> getAgvLocList(AgvLocListParam param); |
| | | boolean bindCtnrAndBin(bindCtnrAndBinParam param); |
| | | boolean agvApplicationPassedTheGrating(ArmAgvGratingParam arm); |
| | | } |
| | |
| | | @Service("basArmMastService") |
| | | public class BasArmMastServiceImpl extends ServiceImpl<BasArmMastMapper, BasArmMast> implements BasArmMastService { |
| | | @Override |
| | | public boolean updateArmMastStatus(int armNo,int sortingLine,int status,int endStatus){ |
| | | return this.baseMapper.updateArmMastStatus(armNo,sortingLine,status,endStatus); |
| | | public boolean updateArmMastStatus(int armNo,int sortingLine,int status,int endStatus,int staNoEnd){ |
| | | return this.baseMapper.updateArmMastStatus(armNo,sortingLine,status,endStatus,staNoEnd); |
| | | } |
| | | } |
| | |
| | | import com.zy.asrs.entity.result.StockVo; |
| | | import com.zy.asrs.mapper.TagMapper; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.task.core.ReturnT; |
| | | import com.zy.asrs.utils.MatUtils; |
| | | import com.zy.asrs.utils.OrderInAndOutUtil; |
| | | import com.zy.asrs.utils.Utils; |
| | | import com.zy.common.constant.ArmConstant; |
| | | import com.zy.common.model.DetlDto; |
| | | import com.zy.common.service.CommonService; |
| | | import com.zy.common.utils.HttpHandler; |
| | | import com.zy.common.utils.NodeUtils; |
| | | import com.zy.erp.kingdee.utils.PostMesDataUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | .eq("status", 1) |
| | | ); |
| | | if (Cools.isEmpty(basArm)){ |
| | | throw new CoolException("机械臂配置异常,查询不到机械臂数据!!!"+ JSON.toJSONString(param)); |
| | | return; |
| | | // throw new CoolException("机械臂配置异常,查询不到机械臂数据!!!"+ JSON.toJSONString(param)); |
| | | } |
| | | |
| | | try{ |
| | |
| | | if (Cools.isEmpty(basArmMast)){ |
| | | throw new CoolException("未查询到相关机械臂拆码垛任务!!!"+ JSON.toJSONString(param)); |
| | | } |
| | | basArmMastService.updateArmMastStatus(param.getArm_no(),basArmMast.getSortingLine(),2,3); |
| | | basArmMastService.updateArmMastStatus(param.getArm_no(),basArmMast.getSortingLine(),basArmMast.getStaNo(),1,3); |
| | | basArmMastService.updateArmMastStatus(param.getArm_no(),basArmMast.getSortingLine(),basArmMast.getStaNo(),2,3); |
| | | } |
| | | |
| | | @Override |
| | |
| | | .eq("status", 5) |
| | | ); |
| | | if (!Cools.isEmpty(basArmMast)){ |
| | | basArmMastService.updateArmMastStatus(param.getArm_no(),basArmMast.getSortingLine(), 5,6); |
| | | basArmMastService.updateArmMastStatus(param.getArm_no(),basArmMast.getSortingLine(),basArmMast.getStaNo(), 5,6); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | @Transactional |
| | | public boolean agvApplicationPassedTheGrating(ArmAgvGratingParam arm) { |
| | | ReturnT<String> result = new PostMesDataUtils().postMesDataArmGrating("光栅请求下发:", ArmConstant.getArmUrl(arm.getArmNo()), ArmConstant.ARM_ADAPTOR_GRATING_AGVENTER, arm); |
| | | if (result.getCode()==200){ |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | if (!locDetls2.isEmpty()) { |
| | | locDetlService.delete(new EntityWrapper<LocDetl>().eq("loc_no", basAgvMast.getLocNo())); |
| | | } |
| | | |
| | | LocMast locMast2 = locMastService.selectById(basAgvMast.getLocNo()); |
| | | // 修改库位状态 S ====>> F |
| | | if (locMast2.getLocSts().equals("S")) { |
| | | locMast2.setLocSts("F"); |
| | | locMast2.setIoTime(now); |
| | | locMast2.setModiTime(now); |
| | | } else { |
| | | return FAIL.setMsg("库位状态异常"); |
| | | } |
| | | List<LocDetl> locDetlList1 = new ArrayList<>(); |
| | | List<LocDetl> locDetlList2 = new ArrayList<>(); |
| | | List<BasAgvLocDetl> basAgvLocDetlList = basAgvLocDetlService.selectList(new EntityWrapper<BasAgvLocDetl>().eq("loc_no", basAgvMast.getSourceLocNo())); |
| | |
| | | } |
| | | } else if (!basAgvWrkDetlList.isEmpty()){ |
| | | for (BasAgvWrkDetl wrkDetl : basAgvWrkDetlList){ |
| | | LocDetl locDetl = new LocDetl(); |
| | | locDetl.sync(wrkDetl); |
| | | locDetl.setLocNo(basAgvMast.getLocNo()); // 库位号 |
| | | locDetl.setAnfme(wrkDetl.getAnfme()); // 数量 |
| | | locDetl.setZpallet(wrkDetl.getZpallet()); // 托盘条码 |
| | | locDetl.setModiTime(now); |
| | | locDetl.setAppeTime(now); |
| | | locDetl.setOrigin("在库"); |
| | | locDetlList2.add(locDetl); |
| | | |
| | | LocDetl locDetl = locDetlService.selectItem(basAgvMast.getLocNo(), wrkDetl.getMatnr(), wrkDetl.getBatch(),wrkDetl.getBrand() |
| | | ,wrkDetl.getStandby1(),wrkDetl.getStandby2(),wrkDetl.getStandby3(),wrkDetl.getBoxType1(),wrkDetl.getBoxType2(),wrkDetl.getBoxType3()); |
| | | } |
| | | } else { |
| | | locMast2.setLocSts("D"); |
| | | } |
| | | |
| | | if (!locMastService.updateById(locMast2)) { |
| | | return FAIL; |
| | | } |
| | | if (!locDetlList1.isEmpty()){ |
| | | for (LocDetl locDetlold : locDetlList1) { |
| | | LocDetl locDetl = locDetlService.selectItem(basAgvMast.getLocNo(), locDetlold.getMatnr(), locDetlold.getBatch(),locDetlold.getBrand() |
| | | ,locDetlold.getStandby1(),locDetlold.getStandby2(),locDetlold.getStandby3(),locDetlold.getBoxType1(),locDetlold.getBoxType2(),locDetlold.getBoxType3()); |
| | | if (null != locDetl) { |
| | | if (!locDetlService.updateAnfme(wrkDetl.getAnfme(), basAgvMast.getLocNo(), wrkDetl.getMatnr(), wrkDetl.getBatch(),wrkDetl.getBrand(),wrkDetl.getStandby1(),wrkDetl.getStandby2(),wrkDetl.getStandby3() |
| | | ,wrkDetl.getBoxType1(),wrkDetl.getBoxType2(),wrkDetl.getBoxType3())) { |
| | | // exceptionHandle("全板入库 ===>> 更新库存明细失败;[workNo={0}],[locNo={1}]", wrkMast.getWrkNo(), wrkMast.getLocNo()); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | return FAIL.setMsg("全板入库 ===>> 更新库存明细失败; [workNo=" + basAgvMast.getTaskNo() + "],[locNo=" + basAgvMast.getLocNo() + "]"); |
| | | if (!locDetlService.updateAnfme(locDetlold.getAnfme(), basAgvMast.getLocNo(), locDetlold.getMatnr(), locDetlold.getBatch(),locDetlold.getBrand(),locDetlold.getStandby1(),locDetlold.getStandby2(),locDetlold.getStandby3() |
| | | ,locDetlold.getBoxType1(),locDetlold.getBoxType2(),locDetlold.getBoxType3())) { |
| | | } |
| | | } else { |
| | | locDetl = new LocDetl(); |
| | | locDetl.sync(wrkDetl); |
| | | locDetl.setLocNo(basAgvMast.getLocNo()); // 库位号 |
| | | locDetl.setAnfme(wrkDetl.getAnfme()); // 数量 |
| | | locDetl.setZpallet(wrkDetl.getZpallet()); // 托盘条码 |
| | | locDetl.setModiTime(now); |
| | | locDetl.setAppeTime(now); |
| | | locDetl.setOrigin("在库"); |
| | | if (!locDetlService.insert(locDetl)) { |
| | | // exceptionHandle("全板入库 ===>> 添加库存明细失败;[workNo={0}],[locNo={1}]", wrkMast.getWrkNo(), wrkMast.getLocNo()); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | return FAIL.setMsg("入库 ===>> 添加库存明细失败; [workNo=" + basAgvMast.getTaskNo() + "],[locNo=" + basAgvMast.getLocNo() + "]"); |
| | | if (!locDetlService.insert(locDetlold)) { |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | LocMast locMast2 = locMastService.selectById(basAgvMast.getLocNo()); |
| | | |
| | | |
| | | // 修改库位状态 S ====>> F |
| | | if (locMast2.getLocSts().equals("S")) { |
| | | locMast2.setLocSts("F"); |
| | | locMast2.setIoTime(now); |
| | | locMast2.setModiTime(now); |
| | | if (!locMastService.updateById(locMast2)) { |
| | | // exceptionHandle("全板入库 ===>> 修改库位状态失败;[workNo={0}],[locNo={1}]", wrkMast.getWrkNo(), wrkMast.getLocNo()); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | return FAIL.setMsg("全入库 ===>> 修改库位状态失败; [TaskNo=" + basAgvMast.getTaskNo() + "],[locNo=" + basAgvMast.getLocNo() + "]"); |
| | | } |
| | | } |
| | | |
| | | |
| | | if (!locDetlList1.isEmpty()){ |
| | | for (LocDetl locDetl : locDetlList1) { |
| | | locDetlService.insert(locDetl); |
| | | } |
| | | } |
| | | if (!locDetlList2.isEmpty()){ |
| | | for (LocDetl locDetl : locDetlList2) { |
| | | locDetlService.insert(locDetl); |
| | | for (LocDetl locDetlold : locDetlList2) { |
| | | LocDetl locDetl = locDetlService.selectItem(basAgvMast.getLocNo(), locDetlold.getMatnr(), locDetlold.getBatch(),locDetlold.getBrand() |
| | | ,locDetlold.getStandby1(),locDetlold.getStandby2(),locDetlold.getStandby3(),locDetlold.getBoxType1(),locDetlold.getBoxType2(),locDetlold.getBoxType3()); |
| | | if (null != locDetl) { |
| | | if (!locDetlService.updateAnfme(locDetlold.getAnfme(), basAgvMast.getLocNo(), locDetlold.getMatnr(), locDetlold.getBatch(),locDetlold.getBrand(),locDetlold.getStandby1(),locDetlold.getStandby2(),locDetlold.getStandby3() |
| | | ,locDetlold.getBoxType1(),locDetlold.getBoxType2(),locDetlold.getBoxType3())) { |
| | | } |
| | | } else { |
| | | if (!locDetlService.insert(locDetlold)) { |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | // jsonObject.put("start_biztime", latestUpdateTime);//业务起始日期 |
| | | jsonObject.put("start_biztime", "2025-01-01 00:00:00");//业务起始日期 |
| | | jsonObject.put("end_biztime", sdf1.format(now));//业务结束日期 |
| | | jsonObject.put("billno", "CGSL-251125-000001"); |
| | | jsonObject.put("billno", "CGSL-251126-000001"); |
| | | jsonObject.put("billstatus", Arrays.asList("C"));//数据状态 [A:暂存, B:已提交, C:已审核] |
| | | jsonObject.put("start_auditdate", "2025-11-25 00:00:00"); |
| | | jsonObject.put("end_auditdate", sdf1.format(now)); |
| | |
| | | Double length = jsonObjectNew.get("length") != null ? new BigDecimal(jsonObjectNew.get("eap7_decimalfield7").toString()).doubleValue() : 0.0; |
| | | Double netweight = jsonObjectNew.get("netweight") != null ? new BigDecimal(jsonObjectNew.get("eap7_decimalfield").toString()).doubleValue() : 0.0; |
| | | // 生成商品档案 |
| | | height = height*10; |
| | | width = width*10; |
| | | length = length*10; |
| | | Mat mat = matService.selectByMatnr(matnr); |
| | | if (mat == null) { |
| | | mat = new Mat(); |
| | |
| | | mat.setTagId(tag.getId()); |
| | | mat.setWeight(grossweight);//净重 |
| | | mat.setUnits(netweight);//毛重 |
| | | mat.setManLength(length*10); |
| | | mat.setHeight(height*10); |
| | | mat.setWidth(width*10); |
| | | mat.setManLength(length); |
| | | mat.setHeight(height); |
| | | mat.setWidth(width); |
| | | mat.setCreateTime(sdf1.parse(createTime)); |
| | | mat.setUpdateTime(modifyTime); |
| | | mat.setStatus(1); |
| New file |
| | |
| | | package com.zy.common.constant; |
| | | |
| | | /* |
| | | * Created by Monkey D. Luffy on 2025.09.09 |
| | | * */ |
| | | public class ArmConstant { |
| | | |
| | | public static final String ARM_URL = "http://10.10.10.171:7002"; |
| | | public static final String ARM_URL1 = "http://10.10.10.171:7002"; |
| | | public static final String ARM_URL2 = "http://10.10.10.174:7002"; |
| | | public static final String ARM_URL3 = "http://10.10.10.177:7002"; |
| | | public static final String ARM_URL4 = "http://10.10.10.180:7002"; |
| | | public static final String ARM_URL5 = "http://10.10.10.183:7002"; |
| | | public static final String ARM_URL6 = "http://10.10.10.186:7002"; |
| | | |
| | | public static final String ARM_ADAPTOR = "adaptor/api/wcs/order";//创建订单 |
| | | public static final String ARM_ADAPTOR_GRATING_AGVLEAVE = "adaptor/api/wcs/agvleave";//创建订单 |
| | | public static final String ARM_ADAPTOR_GRATING_AGVENTER = "adaptor/api/wcs/agventer";//创建订单 |
| | | |
| | | public static final String ARM_WORKSPACE = "adaptor/api/wcs/workspace/ready";//通知工作空间已就绪 |
| | | |
| | | public static String getArmUrl(int armNo) { |
| | | switch (armNo) { |
| | | case 1: |
| | | return ARM_URL1; |
| | | case 2: |
| | | return ARM_URL2; |
| | | case 3: |
| | | return ARM_URL3; |
| | | case 4: |
| | | return ARM_URL4; |
| | | case 5: |
| | | return ARM_URL5; |
| | | case 6: |
| | | return ARM_URL6; |
| | | default: |
| | | return ARM_URL; |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.Cools; |
| | | import com.core.common.SpringUtils; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.ApiLog; |
| | | import com.zy.asrs.service.ApiLogService; |
| | | import com.zy.asrs.task.AbstractHandler; |
| | | import com.zy.asrs.task.core.ReturnT; |
| | | import com.zy.common.utils.HttpHandler; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import java.util.Date; |
| | | import java.util.Map; |
| | | |
| | | @Slf4j |
| | |
| | | } |
| | | return SUCCESS; |
| | | } |
| | | |
| | | public ReturnT<String> postMesDataArmGrating(String name, String URL, String mesPath, Object combParam){ |
| | | // if (true){ |
| | | // System.out.println("name:"+name+",URL:"+URL+",mesPath:"+mesPath+",combParam:"+combParam); |
| | | // return SUCCESS; |
| | | // } |
| | | if(combParam != null){ |
| | | String response = ""; |
| | | boolean success = false; |
| | | try { |
| | | // Map<String, Object> map = new HashMap<>() |
| | | // map.put("appkey","ea1f0459efc02a79f046f982767939ae"); |
| | | response = new HttpHandler.Builder() |
| | | // .setHeaders(map) |
| | | .setUri(URL) |
| | | .setPath(mesPath) |
| | | .setJson(JSON.toJSONString(combParam)) |
| | | .build() |
| | | .doPost(); |
| | | System.out.println("response:"+response); |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | |
| | | if (jsonObject.getInteger("code").equals(0)) { |
| | | success = true; |
| | | } else { |
| | | log.error("请求接口失败!!!url:{};request:{};response:{}", URL+"/"+mesPath, JSON.toJSONString(combParam), response); |
| | | throw new CoolException(name); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("请求接口失败!!!url:{};request:{};response:{}", URL+"/"+mesPath, JSON.toJSONString(combParam), response); |
| | | // TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | return FAIL.setMsg(e.getMessage()); |
| | | } finally { |
| | | try { |
| | | if (success){ |
| | | // 保存接口日志 |
| | | ApiLogService apiLogService = SpringUtils.getBean(ApiLogService.class); |
| | | apiLogService.save( |
| | | name, |
| | | URL +"/"+ mesPath, |
| | | null, |
| | | "127.0.0.1", |
| | | JSON.toJSONString(combParam), |
| | | response, |
| | | success |
| | | ); |
| | | } else { |
| | | postMesDataCallApiLogSave(response,success,name, URL, mesPath, combParam); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("", e); } |
| | | } |
| | | } |
| | | return SUCCESS; |
| | | } |
| | | |
| | | public void postMesDataCallApiLogSave(String response,boolean success,String name, String URL, String mesPath, Object combParam) { |
| | | ApiLogService apiLogService = SpringUtils.getBean(ApiLogService.class); |
| | | |
| | | ApiLog apiLog = apiLogService.selectOne(new EntityWrapper<ApiLog>() |
| | | .eq("namespace", name) |
| | | .eq("response", response) |
| | | .eq("url", URL +"/"+ mesPath) |
| | | .eq("result", success? 1:0) |
| | | .orderBy("create_time", false) |
| | | ); |
| | | |
| | | if (!Cools.isEmpty(apiLog)){ |
| | | long parseLong = Long.parseLong(apiLog.getTimestamp()); |
| | | if (new Date().getTime()-parseLong<5*1000*60){ |
| | | return; |
| | | } |
| | | } |
| | | // 保存接口日志 |
| | | apiLogService.save( |
| | | name, |
| | | URL +"/"+ mesPath, |
| | | null, |
| | | "127.0.0.1", |
| | | JSON.toJSONString(combParam), |
| | | response, |
| | | success |
| | | ); |
| | | } |
| | | } |
| | |
| | | where 1=1 |
| | | and arm_no = #{armNo} |
| | | and sorting_line = #{sortingLine} |
| | | and sta_no = #{staNoEnd} |
| | | and status = #{status} |
| | | </update> |
| | | |