自动化立体仓库 - WMS系统
#
luxiaotao1123
2022-12-08 592f175ea0ad02c4e22cb62e77ea9e1e9cfbe516
src/main/java/com/zy/common/service/erp/ErpService.java
@@ -1,5 +1,7 @@
package com.zy.common.service.erp;
import com.core.common.Cools;
import com.zy.common.service.erp.dto.VoucherDto;
import com.zy.common.service.erp.entity.Goods;
import com.zy.common.service.erp.entity.Voucher;
import com.zy.common.service.erp.entity.VoucherDetail;
@@ -8,6 +10,7 @@
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
@@ -27,27 +30,44 @@
    /**
     * 获取GOODS表
     */
    public List<Goods> selectGoods(Integer IsGetData) {
//        String sql = "select * from Goods where IsGetData = '" + IsGetData +"'";
        String sql = "select * from Goods where 1=1";
    public List<Goods> selectGoods(Integer state) {
        String sql = "select * from Goods where 1=1 where state = '" + state + "'";
        return erpSqlServer.select(sql, Goods.class);
    }
    public List<VoucherDto> selectOrder(Integer state) {
        List<VoucherDto> list = new ArrayList<>();
        List<Voucher> voucherList = this.selectVoucher(state);
        if (!Cools.isEmpty(voucherList)) {
            for (Voucher voucher : voucherList) {
                List<VoucherDetail> voucherDetails = this.selectVoucherDetail(voucher.getVoucherID());
                if (!Cools.isEmpty(voucherDetails)) {
                    VoucherDto dto = new VoucherDto();
                    list.add(dto);
                    dto.setVoucher(voucher);
                    dto.setDetails(voucherDetails);
                } else {
                    log.error("{}单据找不到明细,请注意检查", voucher.getVoucherID());
                }
            }
        }
        return list;
    }
    /**
     * 获取Voucher表
     */
    public List<Voucher> selectVoucher(Integer IsGetData) {
//        String sql = "select * from Goods where IsGetData = '" + IsGetData +"'";
        String sql = "select * from Voucher where 1=1";
    public List<Voucher> selectVoucher(Integer state) {
        String sql = "select * from Voucher where 1=1 where state = '" + state + "'";
        return erpSqlServer.select(sql, Voucher.class);
    }
    /**
     * 获取VoucherDetail表
     */
    public List<VoucherDetail> selectVoucherDetail(Integer IsGetData) {
//        String sql = "select * from Goods where IsGetData = '" + IsGetData +"'";
        String sql = "select * from VoucherDetail where 1=1";
    public List<VoucherDetail> selectVoucherDetail(String VoucherID) {
        String sql = "select * from VoucherDetail where 1=1 where VoucherID = '" + VoucherID + "'";
        return erpSqlServer.select(sql, VoucherDetail.class);
    }