WwucErpService.java 1.52 KB
package com.huaheng.pc.receipt.receiving.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.huaheng.framework.aspectj.lang.annotation.Ds;
import com.huaheng.framework.aspectj.lang.constant.DataSourceName;
import com.huaheng.pc.config.address.domain.Address;
import com.huaheng.pc.receipt.receiving.domain.ProductAErp;
import com.huaheng.pc.receipt.receiving.domain.WwucErp;
import com.huaheng.pc.receipt.receiving.mapper.ProductAErpMapper;
import com.huaheng.pc.receipt.receiving.mapper.WwucErpMapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.text.SimpleDateFormat;
import java.util.List;


@Service
public class WwucErpService extends ServiceImpl<WwucErpMapper, WwucErp>{



    /**
     * 查找erp数据库的客户数据
     * @return
     */
    @Ds(name= DataSourceName.SLAVE)
    @Transactional(propagation = Propagation.REQUIRES_NEW)
    public List<WwucErp> findProductAData(String workCode,String erpcompanyCode,Address address){
        QueryWrapper<WwucErp> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("pmdlsite", erpcompanyCode);
        queryWrapper.eq("pmdp003", workCode);
//        queryWrapper.eq("企业编号", address.getUserDef2());
//        queryWrapper.eq("企业编号","98");
        List<WwucErp> lists = this.list(queryWrapper);
        return lists;
    }
}