zouyu
8 天以前 79841a6a5ecd713a9f02d23552619cbba1c991ad
inspect-server/src/main/java/com/ruoyi/inspect/aspect/PushIfsPartPropsRecordAspect.java
@@ -1,6 +1,8 @@
package com.ruoyi.inspect.aspect;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.ruoyi.basic.dto.IfsInventoryQuantityDto;
@@ -47,10 +49,17 @@
        Object[] args = joinPoint.getArgs();
        if(Objects.nonNull(args) && args.length>0) {
            Long ifsInventoryId = (Long)args[0];
            log.info("id:{}",ifsInventoryId);
            IfsInventoryQuantity ifsInventoryQuantity = ifsInventoryQuantityMapper.selectById(ifsInventoryId);
            //查询ifs批次属性记录,有则不执行操作
            Map<String, Object> queryMap = new HashMap<>();
            queryMap.put("LOT_BATCH_NO",ifsInventoryQuantity.getUpdateBatchNo());
            queryMap.put("PART_NO",ifsInventoryQuantity.getPartNo());
            Result queryPartLotResult = ifsApiUtils.queryPartLotAttr(ContractType.KJNS.getValue(), JSONUtil.toJsonStr(queryMap));
            if(queryPartLotResult.getCode()==200){
                JSONObject entries = JSONUtil.parseObj(queryPartLotResult.getData());
                JSONArray listInfo = entries.getJSONArray("LIST_INFO");
            //如果订单是KJNS域的外购订单,免检时同步ZTNS域的IFS批次属性
            if(StringUtils.equals(ContractType.KJNS.getValue(),ifsInventoryQuantity.getContract()) && StringUtils.equals(OrderType.WG.getValue(),ifsInventoryQuantity.getOrderType())){
                if(StringUtils.equals(ContractType.KJNS.getValue(),ifsInventoryQuantity.getContract()) && StringUtils.equals(OrderType.WG.getValue(),ifsInventoryQuantity.getOrderType()) && listInfo.isEmpty()){
                //查询ZTNS域的相同批次订单消息
                IfsInventoryQuantityDto ifsInventoryQuantityDto = new IfsInventoryQuantityDto();
                BeanUtil.copyProperties(ifsInventoryQuantity,ifsInventoryQuantityDto);
@@ -86,5 +95,6 @@
            }
        }
    }
    }
}