Переглянути джерело

Merge remote-tracking branch 'origin/master'

guoyujia 3 тижнів тому
батько
коміт
b1d847e591
24 змінених файлів з 1772 додано та 1 видалено
  1. 26 0
      src/main/java/cn/ezhizao/common/utils/PdfUtil.java
  2. 512 0
      src/main/java/cn/ezhizao/project/business/controller/BizInboundOrderController.java
  3. 109 0
      src/main/java/cn/ezhizao/project/business/controller/BizInboundOrderDetailController.java
  4. 4 0
      src/main/java/cn/ezhizao/project/business/domain/BizCertificateLot.java
  5. 63 0
      src/main/java/cn/ezhizao/project/business/domain/BizCompany.java
  6. 33 0
      src/main/java/cn/ezhizao/project/business/domain/BizCompanyProductPackage.java
  7. 219 0
      src/main/java/cn/ezhizao/project/business/domain/BizInboundOrder.java
  8. 202 0
      src/main/java/cn/ezhizao/project/business/domain/BizInboundOrderDetail.java
  9. 4 0
      src/main/java/cn/ezhizao/project/business/domain/BizProduct.java
  10. 30 0
      src/main/java/cn/ezhizao/project/business/mapper/BizCompanyMapper.java
  11. 29 0
      src/main/java/cn/ezhizao/project/business/mapper/BizInboundOrderDetailMapper.java
  12. 29 0
      src/main/java/cn/ezhizao/project/business/mapper/BizInboundOrderMapper.java
  13. 31 0
      src/main/java/cn/ezhizao/project/business/service/IBizCompanyService.java
  14. 30 0
      src/main/java/cn/ezhizao/project/business/service/IBizInboundOrderDetailService.java
  15. 30 0
      src/main/java/cn/ezhizao/project/business/service/IBizInboundOrderService.java
  16. 44 0
      src/main/java/cn/ezhizao/project/business/service/impl/BizCompanyServiceImpl.java
  17. 43 0
      src/main/java/cn/ezhizao/project/business/service/impl/BizInboundOrderDetailServiceImpl.java
  18. 43 0
      src/main/java/cn/ezhizao/project/business/service/impl/BizInboundOrderServiceImpl.java
  19. 4 0
      src/main/java/cn/ezhizao/project/system/domain/SysDept.java
  20. 34 0
      src/main/resources/mybatis/business/BizCompanyMapper.xml
  21. 39 0
      src/main/resources/mybatis/business/BizInboundOrderDetailMapper.xml
  22. 62 0
      src/main/resources/mybatis/business/BizInboundOrderMapper.xml
  23. 2 1
      src/main/resources/mybatis/system/SysDeptMapper.xml
  24. 150 0
      src/main/resources/templates/inboundOrderPdf.html

+ 26 - 0
src/main/java/cn/ezhizao/common/utils/PdfUtil.java

@@ -91,4 +91,30 @@ public class PdfUtil {
         }
         return outputStream.toByteArray();
     }
+
+    public static byte[] html3Pdf(String content) {
+        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
+        try {
+            ConverterProperties converterProperties = new ConverterProperties();
+            converterProperties.setCharset("UTF-8");
+            FontProvider fontProvider = new FontProvider();
+            PdfFont simsun = PdfFontFactory.createFont(FontProgramFactory.createFont("simsun.ttc", 1, false));
+            fontProvider.addFont(simsun.getFontProgram());
+            fontProvider.addSystemFonts();
+            converterProperties.setFontProvider(fontProvider);
+            //设置pdf纸张
+            PdfWriter writer = new PdfWriter(outputStream);
+            PdfDocument pdf = new PdfDocument(writer);
+            pdf.setTagged();
+            //设置纸张的大小,并且设置默认的pdf大小
+            PageSize pageSize = new PageSize(211f / 72 * 25.4f, 93f / 72 * 25.4f);
+//            PageSize pageSize = new PageSize(241f,140f);
+
+            pdf.setDefaultPageSize(pageSize);
+            HtmlConverter.convertToPdf(content,pdf,converterProperties);
+        } catch (Exception e) {
+            System.out.print("生成 PDF 失败,{}"+e);
+        }
+        return outputStream.toByteArray();
+    }
 }

+ 512 - 0
src/main/java/cn/ezhizao/project/business/controller/BizInboundOrderController.java

@@ -0,0 +1,512 @@
+package cn.ezhizao.project.business.controller;
+
+import java.io.StringWriter;
+import java.io.Writer;
+import java.util.*;
+import java.util.stream.Collectors;
+import javax.annotation.Resource;
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.HttpServletResponse;
+
+import cn.ezhizao.common.utils.PdfUtil;
+import cn.ezhizao.common.utils.poi.ExcelUtil;
+import cn.ezhizao.framework.aspectj.lang.annotation.Log;
+import cn.ezhizao.framework.aspectj.lang.enums.BusinessType;
+import cn.ezhizao.framework.redis.RedisCache;
+import cn.ezhizao.framework.web.controller.BaseController;
+import cn.ezhizao.framework.web.domain.AjaxResult;
+import cn.ezhizao.framework.web.page.TableDataInfo;
+import cn.ezhizao.project.business.domain.*;
+import cn.ezhizao.project.business.service.*;
+import cn.ezhizao.project.system.domain.SysDept;
+import cn.ezhizao.project.system.service.ISysDeptService;
+import cn.hutool.core.date.DateTime;
+import cn.hutool.core.date.DateUtil;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import freemarker.template.Template;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer;
+
+/**
+ * 生产入库Controller
+ *
+ * @author ezhizao
+ * @date 2025-05-20
+ */
+@RestController
+@RequestMapping("/business/inboundOrder")
+public class BizInboundOrderController extends BaseController {
+    @Resource
+    private IBizInboundOrderService bizInboundOrderService;
+    @Resource
+    private IBizCertificateLotService bizCertificateLotService;
+    @Resource
+    private IBizCertificateService bizCertificateService;
+    @Resource
+    private IBizPackageResourceGroupService bizPackageResourceGroupService;
+    @Resource
+    private IBizPackageResourceGroupDetailService bizPackageResourceGroupDetailService;
+    @Resource
+    private IBizCompanyProductPackageService bizCompanyProductPackageService;
+    @Resource
+    private IBizProductionPlanDetailService bizProductionPlanDetailService;
+    @Resource
+    private IBizInboundOrderDetailService bizInboundOrderDetailService;
+    @Resource
+    private IBizProductService bizProductService;
+    @Resource
+    private ISysDeptService iSysDeptService;
+    @Resource
+    private IBizCompanyService bizCompanyService;
+    @Resource
+    private IBizTransferCodeService bizTransferCodeService;
+    @Resource
+    private IBizDayworkItemService  bizDayworkItemService;
+    @Resource
+    private RedisCache redisCache;
+    /**
+     * 生成pdf
+     */
+    @Autowired
+    private FreeMarkerConfigurer freeMarkerConfigurer;
+
+    final private String inboundOrderCodeKey = "inboundOrderCode";
+
+    /**
+     * 查询生产入库列表
+     */
+    @PreAuthorize("@ss.hasPermi('business:inboundOrder:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(BizInboundOrder bizInboundOrder) throws NoSuchFieldException, IllegalAccessException {
+        setTenantId(bizInboundOrder);
+        startPage();
+        List<BizInboundOrder> list = bizInboundOrderService.getList(bizInboundOrder);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出生产入库列表
+     */
+    @PreAuthorize("@ss.hasPermi('business:inboundOrder:export')")
+    @Log(title = "生产入库", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, BizInboundOrder bizInboundOrder) throws NoSuchFieldException, IllegalAccessException {
+        setTenantId(bizInboundOrder);
+        List<BizInboundOrder> list = bizInboundOrderService.getList(bizInboundOrder);
+        ExcelUtil<BizInboundOrder> util = new ExcelUtil<>(BizInboundOrder.class);
+        util.exportExcel(response, list, "生产入库数据");
+    }
+
+    /**
+     * 获取生产入库详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('business:inboundOrder:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
+        BizInboundOrder bizInboundOrder = bizInboundOrderService.getById(id);
+        List<BizInboundOrderDetail> details = bizInboundOrderDetailService.query().eq("inbound_order_id", id).list();
+        details.forEach(l -> {
+            l.setDeptName(bizInboundOrder.getDeptName());
+            l.setPackageResourceGroupName(bizInboundOrder.getPackageResourceGroupName());
+            l.setDeptId(bizInboundOrder.getDeptId());
+            l.setProductType(bizInboundOrder.getProductType());
+            l.setIsSubclass(bizInboundOrder.getIsSubclass());
+            l.setPackageResourceGroupId(bizInboundOrder.getPackageResourceGroupId());
+            l.setBgyno(bizInboundOrder.getStorageUserName());
+            l.setBgyna(bizInboundOrder.getStorageNickName());
+            l.setBgyId(bizInboundOrder.getStorageUserId());
+            l.setStandard(bizInboundOrder.getStandard());
+            l.setDrawingNo(bizInboundOrder.getDrawingNo());
+            l.setCompanyId(bizInboundOrder.getCompanyId());
+            l.setCompanyAlias(bizInboundOrder.getCompanyAlias());
+            l.setCompanyCode(bizInboundOrder.getCompanyCode());
+            l.setLabelNumber(bizInboundOrder.getLabelNumber());
+            l.setPackageTypeCode(bizInboundOrder.getPackageType());
+            l.setProductDescription(bizInboundOrder.getProductDescription());
+            l.setProductCode(bizInboundOrder.getProductCode());
+            l.setDeptCode(bizInboundOrder.getDeptCode());
+            l.setPackageResourceGroupLineNo(bizInboundOrder.getPackageResourceGroupLineNo());
+        });
+        bizInboundOrder.setDetails(details);
+        return success(bizInboundOrder);
+    }
+
+    /**
+     * 新增生产入库
+     */
+    @PreAuthorize("@ss.hasPermi('business:inboundOrder:add')")
+    @Log(title = "生产入库", businessType = BusinessType.INSERT)
+    @PostMapping
+    @Transactional
+    public AjaxResult add(@RequestBody BizInboundOrder bizInboundOrder) throws NoSuchFieldException, IllegalAccessException {
+        setTenantId(bizInboundOrder);
+        // 判断当前托盘是否与当前部门绑定
+        BizTransferCode transferCode = bizTransferCodeService.query().eq("code", bizInboundOrder.getTransferCode()).eq("dept_id", bizInboundOrder.getDeptId()).one();
+        if (transferCode == null) {
+            return error("该托盘不存在或未绑定当前工段");
+        }
+        bizInboundOrder.setTransferId(transferCode.getId());
+        // 判断转运托盘是否绑定5个以上的产品
+        List<BizInboundOrder> bizInboundOrders = bizInboundOrderService.query().eq("transfer_code", bizInboundOrder.getTransferCode()).list();
+        List<String> productCodes = bizInboundOrders.stream().map(BizInboundOrder::getProductCode).distinct().collect(Collectors.toList());
+        if (productCodes.stream().noneMatch(t -> t.equals(bizInboundOrder.getProductCode()))) {
+            productCodes.add(bizInboundOrder.getProductCode());
+        }
+        if (productCodes.size() > 5) {
+            return error("转运托盘绑定的产品不能超过5个");
+        }
+        // 入库单号生成
+        SysDept dept = iSysDeptService.selectDeptById(bizInboundOrder.getDeptId());
+        String beginCode = dept.getDeptKey() + DateTime.now().toString("yy");
+        String previous = redisCache.hasKey(inboundOrderCodeKey + "-" + dept.getDeptKey()) ? redisCache.getCacheObject(inboundOrderCodeKey + "-" + dept.getDeptKey()) : "";
+        String codeValue = "";
+        // 固定部分的位数为 x位 的部门助记码 + 2位年份
+        int beginIndex = dept.getDeptKey().length() + 2;
+        if (previous.isEmpty()) {
+            BizInboundOrder maxCode = bizInboundOrderService.query().like("inbound_number", beginCode + "%").orderByDesc("inbound_number").last("limit 1").one();
+
+            if (maxCode != null) {
+                codeValue = maxCode.getInboundNumber();
+                // 获取4位尾数部分
+                int lastFourDigits = Integer.parseInt(codeValue.substring(beginIndex, beginIndex + 4));
+                lastFourDigits++; // 加1
+                codeValue = codeValue.substring(0, beginIndex) + String.format("%04d", lastFourDigits);
+                previous = codeValue;
+            } else {
+                previous = (beginCode + "0001");
+            }
+        } else {
+            codeValue = previous.startsWith(beginCode) ? previous : beginCode + "0000";
+            int lastFourDigits = Integer.parseInt(codeValue.substring(beginIndex, beginIndex + 4));
+            lastFourDigits++; // 加1
+            codeValue = codeValue.substring(0, beginIndex) + String.format("%04d", lastFourDigits);
+            previous = codeValue;
+        }
+
+        bizInboundOrder.setInboundNumber(previous);
+        redisCache.setCacheObject(inboundOrderCodeKey + "-" + dept.getDeptKey(), previous);
+        bizInboundOrderService.save(bizInboundOrder);
+        List<BizInboundOrderDetail> details = bizInboundOrder.getDetails();
+        details.forEach(l -> {
+            l.setInboundOrderId(bizInboundOrder.getId());
+        });
+        bizInboundOrderDetailService.saveBatch(details);
+        return success(bizInboundOrder);
+    }
+
+    /**
+     * 修改生产入库
+     */
+    @PreAuthorize("@ss.hasPermi('business:inboundOrder:edit')")
+    @Log(title = "生产入库", businessType = BusinessType.UPDATE)
+    @PutMapping
+    @Transactional
+    public AjaxResult edit(@RequestBody BizInboundOrder bizInboundOrder) throws NoSuchFieldException, IllegalAccessException {
+        setTenantId(bizInboundOrder);
+        // 判断当前托盘是否与当前部门绑定
+        BizTransferCode transferCode = bizTransferCodeService.query().eq("code", bizInboundOrder.getTransferCode()).eq("dept_id", bizInboundOrder.getDeptId()).one();
+        if (transferCode == null) {
+            return error("该托盘不存在或未绑定当前工段");
+        }
+        bizInboundOrder.setTransferId(transferCode.getId());
+        // 判断转运托盘是否绑定5个以上的产品
+        List<BizInboundOrder> bizInboundOrders = bizInboundOrderService.query().eq("transfer_code", bizInboundOrder.getTransferCode()).list();
+        List<String> productCodes = bizInboundOrders.stream().map(BizInboundOrder::getProductCode).distinct().collect(Collectors.toList());
+        if (productCodes.stream().noneMatch(t -> t.equals(bizInboundOrder.getProductCode()))) {
+            productCodes.add(bizInboundOrder.getProductCode());
+        }
+        if (productCodes.size() > 5) {
+            return error("转运托盘绑定的产品不能超过5个");
+        }
+        List<BizInboundOrderDetail> oldDetails = bizInboundOrderDetailService.query().eq("inbound_order_id", bizInboundOrder.getId()).list();
+        BizInboundOrder old = bizInboundOrderService.getById(bizInboundOrder.getId());
+        // 判断转运托盘是否变更
+        if (!old.getTransferCode().equals(bizInboundOrder.getTransferCode())) {
+            bizInboundOrder.setOriginalTransferCode(old.getTransferCode());
+        }
+        bizInboundOrderService.updateById(bizInboundOrder);
+        List<BizInboundOrderDetail> details = bizInboundOrder.getDetails();
+        details.forEach(l -> {
+            l.setInboundOrderId(bizInboundOrder.getId());
+        });
+        bizInboundOrderDetailService.saveOrUpdateBatch(details);
+        bizInboundOrderDetailService.removeBatchByIds(oldDetails.stream().filter(t -> details.stream().noneMatch(v -> v.getId().equals(t.getId()))).collect(Collectors.toList()));
+        return success(bizInboundOrder);
+    }
+
+    /**
+     * 删除生产入库
+     */
+    @PreAuthorize("@ss.hasPermi('business:inboundOrder:remove')")
+    @Log(title = "生产入库", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    @Transactional
+    public AjaxResult remove(@PathVariable List<Long> ids) {
+        bizInboundOrderService.removeBatchByIds(ids);
+        // 删除明细
+        QueryWrapper<BizInboundOrderDetail> detailQueryWrapper = new QueryWrapper<>();
+        detailQueryWrapper.in("inbound_order_id", ids);
+        bizInboundOrderDetailService.remove(detailQueryWrapper);
+        return success();
+    }
+
+    @PostMapping("/getCertificateListByCodes")
+    public AjaxResult getCertificateListByCodes(@RequestBody List<BizInboundOrderDetail> inputDetails) {
+        List<String> codes = inputDetails.stream().filter(v -> v.getIsFirst() == null || !v.getIsFirst()).map(BizInboundOrderDetail::getCertificateCode).collect(Collectors.toList());
+        BizInboundOrderDetail first = inputDetails.stream().filter(v -> v.getIsFirst() != null && v.getIsFirst()).findFirst().orElse(null);
+        // 根据合格证编码获取合格证信息
+        List<BizCertificateLot> bizCertificateLotList = bizCertificateLotService.query().in("barcode", codes).list();
+        if (bizCertificateLotList.isEmpty()) {
+            return error("未找到相关合格证");
+        }
+        List<BizCertificate> bizCertificates = bizCertificateService.query().in("id", bizCertificateLotList.isEmpty() ? Collections.singleton(0L) : bizCertificateLotList.stream().map(BizCertificateLot::getCertificateId).collect(Collectors.toList())).list();
+        List<BizCompany> bizCompanies = bizCompanyService.query().in("id", bizCertificates.isEmpty() ? Collections.singletonList(0L) : bizCertificates.stream().map(BizCertificate::getCompanyId).collect(Collectors.toList())).list();
+        List<BizPackageResourceGroup> bizPackageResourceGroups = bizPackageResourceGroupService.query().in("id", bizCertificates.isEmpty() ? Collections.singletonList(0L) : bizCertificates.stream().map(BizCertificate::getPackageResourceGroupId).collect(Collectors.toList())).list();
+        List<SysDept> depts = bizPackageResourceGroups.isEmpty() ? new ArrayList<>() : iSysDeptService.getDeptOptions(bizPackageResourceGroups.stream().map(BizPackageResourceGroup::getDeptId).collect(Collectors.toList()));
+        List<BizPackageResourceGroupDetail> bizPackageResourceGroupDetails = bizPackageResourceGroupDetailService.query().in("package_resource_group_id", bizPackageResourceGroups.isEmpty() ? Collections.singletonList(0L) : bizPackageResourceGroups.stream().map(BizPackageResourceGroup::getId).collect(Collectors.toList())).list();
+        List<BizProduct> products = bizProductService.query().in("product_code", bizCertificates.isEmpty() ? Collections.singletonList("") : bizCertificates.stream().map(BizCertificate::getProductCode).collect(Collectors.toList())).list();
+        List<BizProductionPlanDetail> bizProductionPlanDetails = bizCertificates.isEmpty() ? new ArrayList<>() : bizProductionPlanDetailService.query().in("id", bizCertificates.stream().map(BizCertificate::getProductionPlanDetailId).collect(Collectors.toList())).list();
+        List<BizInboundOrderDetail> checkDetails = bizInboundOrderDetailService.query().in("certificate_code", codes).ne("inbound_order_id", inputDetails.get(0).getInboundOrderId()).list();
+        List<BizCompanyProductPackage> packages = bizCertificates.isEmpty() ? new ArrayList<>() : bizCompanyProductPackageService.query().in("concat(product_code, package_code)", bizCertificates.stream().map(t -> t.getProductCode() + t.getPackageCode()).collect(Collectors.toList())).list();
+        List<BizInboundOrderDetail> details = new ArrayList<>();
+        codes.forEach(l -> {
+            BizCertificateLot item = bizCertificateLotList.stream().filter(x -> x.getBarcode().equals(l)).findFirst().orElse(null);
+            BizCertificate certificate = item != null ? bizCertificates.stream().filter(x -> x.getId().equals(item.getCertificateId())).findFirst().orElse(null) : null;
+            BizCompany company = certificate != null ? bizCompanies.stream().filter(x -> x.getId().equals(certificate.getCompanyId())).findFirst().orElse(null) : null;
+            BizCompanyProductPackage packageItem = certificate != null ? packages.stream().filter(x -> x.getProductCode().equals(certificate.getProductCode()) && x.getPackageCode().equals(certificate.getPackageCode())).findFirst().orElse(null) : null;
+            BizProduct product = certificate != null ? products.stream().filter(x -> x.getProductCode().equals(certificate.getProductCode())).findFirst().orElse(null) : null;
+            BizPackageResourceGroup group = certificate != null ? bizPackageResourceGroups.stream().filter(x -> x.getId().equals(certificate.getPackageResourceGroupId())).findFirst().orElse(null) : null;
+            List<BizPackageResourceGroupDetail> packageResourceGroupDetails = group != null ? bizPackageResourceGroupDetails.stream().filter(x -> x.getPackageResourceGroupId().equals(group.getId())).collect(Collectors.toList()) : new ArrayList<>();
+            BizProductionPlanDetail productionPlanDetail = certificate == null ? null : bizProductionPlanDetails.stream().filter(x -> x.getId().equals(certificate.getProductionPlanDetailId())).findFirst().orElse(null);
+            SysDept dept = group != null ? depts.stream().filter(x -> x.getValue().equals(group.getDeptId())).findFirst().orElse(null) : null;
+            BizInboundOrderDetail detail = new BizInboundOrderDetail();
+            detail.setCertificateCode(l);
+            if (checkDetails.stream().noneMatch(x -> x.getCertificateCode().equals(l))) {
+                detail.setCertificateId(item != null ? item.getCertificateId() : null);
+                detail.setCertificateLotId(item != null ? item.getId() : null);
+                detail.setInboundNum(certificate != null ? Long.valueOf(certificate.getPackageNumber()) : null);
+                // 第一个操作人
+                detail.setFirstOperatorUserId(!packageResourceGroupDetails.isEmpty() ? packageResourceGroupDetails.get(0).getUserId() : null);
+                detail.setFirstOperatorUserName(!packageResourceGroupDetails.isEmpty() ? packageResourceGroupDetails.get(0).getUserName() : null);
+                detail.setFirstOperatorNickName(!packageResourceGroupDetails.isEmpty() ? packageResourceGroupDetails.get(0).getNickName() : null);
+                // 第二个操作人
+                detail.setSecondOperatorUserId(packageResourceGroupDetails.size() >= 2 ? packageResourceGroupDetails.get(1).getUserId() : null);
+                detail.setSecondOperatorUserName(packageResourceGroupDetails.size() >= 2 ? packageResourceGroupDetails.get(1).getUserName() : null);
+                detail.setSecondOperatorNickName(packageResourceGroupDetails.size() >= 2 ? packageResourceGroupDetails.get(1).getNickName() : null);
+                // 第三个操作人
+                detail.setThirdOperatorUserId(packageResourceGroupDetails.size() >= 3 ? packageResourceGroupDetails.get(2).getUserId() : null);
+                detail.setThirdOperatorUserName(packageResourceGroupDetails.size() >= 3 ? packageResourceGroupDetails.get(2).getUserName() : null);
+                detail.setThirdOperatorNickName(packageResourceGroupDetails.size() >= 3 ? packageResourceGroupDetails.get(2).getNickName() : null);
+
+                detail.setPackageTypeCode(certificate != null ? certificate.getPackageTypeCode() : null);
+                detail.setUnit("支");
+                detail.setProductId(certificate != null ? certificate.getProductId() : null);
+                detail.setCompanyId(certificate != null ? certificate.getCompanyId() : null);
+                detail.setCustomerName(certificate != null ? certificate.getCustomerName() : null);
+                detail.setDeptName(certificate != null ? certificate.getDeptName() : null);
+                detail.setPackageResourceGroupName(group != null ? group.getName() : null);
+                detail.setPackageResourceGroupLineNo(group != null ? group.getPackageLineNo() : null);
+                detail.setProductDescription(certificate != null ? certificate.getProductDescription() : null);
+                detail.setProductType(productionPlanDetail != null ? productionPlanDetail.getProductionTypeCode() : null);
+                detail.setProductCode(product != null ? product.getProductCode() : null);
+                detail.setIsSubclass(product != null ? product.getIsSubclass() : null);
+                detail.setLotCode(certificate != null ? certificate.getLotCode() : null);
+                detail.setLotId(certificate != null ? certificate.getLotId() : null);
+                detail.setDeptId(group != null ? group.getDeptId() : null);
+                detail.setDeptName(dept != null ? dept.getLabel() : null);
+                detail.setPackageResourceGroupId(group != null ? group.getId() : null);
+                detail.setStandard(product != null ? product.getSpecification() : null);
+                detail.setDrawingNo(product != null ? product.getDrawingNumber() : null);
+                detail.setCompanyCode(company != null ? company.getCompanyCode() : null);
+                detail.setCompanyAlias(company != null ? company.getCompanyAlias() : null);
+                detail.setLabelNumber(packageItem != null ? packageItem.getSingleNumber() : null);
+                detail.setDeptCode(dept != null ? dept.getDeptCode() : null);
+                detail.setInboundOrderId(inputDetails.get(0).getInboundOrderId());
+            }
+            details.add(detail);
+        });
+        // 获取第一个可使用合格证号
+        if (first == null) {
+            first = details.stream().filter(v -> v.getCertificateId() != null).findFirst().orElse(null);
+        }
+        if (first != null) {
+            // 判断和第一个合格证是否是同一产品同一部门,同一包装线,同一包装形式,假设不同 设置 checked false 否则设置 true
+            BizInboundOrderDetail finalFirst = first;
+            details.forEach(l -> {
+                l.setChecked(finalFirst.getProductCode().equals(l.getProductCode()) && finalFirst.getDeptId().equals(l.getDeptId()) && finalFirst.getPackageResourceGroupId().equals(l.getPackageResourceGroupId()) && finalFirst.getPackageTypeCode().equals(l.getPackageTypeCode()) && details.stream().filter(t -> t.getCertificateCode().equals(l.getCertificateCode())).count() <= 1);
+            });
+        }
+
+        AjaxResult result = success(details);
+        result.put("checked", details.stream().allMatch(BizInboundOrderDetail::getChecked));
+        return result;
+    }
+
+    @PostMapping("/exportPdfForOrder")
+    public void exportPdfForOrder(BizInboundOrder bizInboundOrder, HttpServletResponse response) throws Exception {
+
+        bizInboundOrder = bizInboundOrderService.getList(bizInboundOrder).get(0);
+        List<BizInboundOrderDetail> details = bizInboundOrderDetailService.query().eq("inbound_order_id", bizInboundOrder.getId()).list();
+        // 根据批次汇总明细表
+        Map<String, List<BizInboundOrderDetail>> groupedByProductDescription =
+                details.stream()
+                        .collect(Collectors.groupingBy(
+                                BizInboundOrderDetail::getLotCode, // 分组依据的函数
+                                Collectors.toList() // 指定分组内的元素收集为 List
+                        ));
+        List<List<BizInboundOrderDetail>> list = new ArrayList<>();
+        List<BizInboundOrderDetail> group = new ArrayList<>();
+        for (Map.Entry<String, List<BizInboundOrderDetail>> entry : groupedByProductDescription.entrySet()) {
+            List<BizInboundOrderDetail> item = entry.getValue(); // 获取对应的 List,即 Map 的值
+//            // 用于临时存储每组数据的列表
+            // 遍历 outsourcedOrderDetails 列表
+//            for (BizInboundOrderDetail detail : item) {
+            BizInboundOrderDetail detail = item.get(0);
+            detail.setInboundNum(item.stream().mapToLong(BizInboundOrderDetail::getInboundNum).sum());
+            group.add(detail);
+            // 每添加 14 个元素后,将其添加到 list 中,并重置 group
+            if (group.size() == 10) {
+                list.add(new ArrayList<>(group));
+                group = new ArrayList<>();
+            }
+//            }
+
+        }
+        // 如果最后一组不足 10 个元素,也将其添加到 list 中
+        if (!group.isEmpty()) {
+            BizInboundOrderDetail orderDetail = new BizInboundOrderDetail();
+            while (group.size() < 10) {
+                group.add(orderDetail); // 添加默认元素直到总数为14
+            }
+            list.add(group);
+        }
+        for (List<BizInboundOrderDetail> listItem : list) {
+            // 使用流过滤出 productNum 不为空的元素,并对其 productNum 值求和
+            Long sum = listItem.stream()
+                    .filter(item -> item.getInboundNum() != null) // 过滤出 productNum 不为空的元素
+                    .mapToLong(BizInboundOrderDetail::getInboundNum) // 映射到 productNum 属性
+                    .sum(); // 计算总和
+            // 然后,给每个对象的 sum 属性赋值
+            for (BizInboundOrderDetail item : listItem) {
+                item.setSum(sum);
+            }
+        }
+        bizInboundOrder.setDetailLists(list);
+//        bizInboundOrder.setTenantName("德迈仕");
+        bizInboundOrder.setInboundDateStr(DateUtil.format(bizInboundOrder.getInboundTime(), "yyyy-MM-dd"));
+        Map<String, Object> paramMap = new HashMap<>();
+        paramMap.put("inboundOrder", bizInboundOrder);
+        Writer out = new StringWriter();
+        //获取模板地址
+        Template template = freeMarkerConfigurer.getConfiguration().getTemplate("inboundOrderPdf.html");
+        template.process(paramMap, out);
+        out.flush();
+        out.close();
+        String templateContent = out.toString();
+        response.setCharacterEncoding("UTF-8");
+        response.setContentType("application/pdf");
+        String fileName = "产品入库单";
+        response.setHeader("Content-Disposition", "filename=" + new String(fileName.getBytes()));
+        byte[] resources = PdfUtil.html3Pdf(templateContent);
+        ServletOutputStream outputStream = response.getOutputStream();
+        outputStream.write(resources);
+        outputStream.close();
+
+    }
+
+    @PostMapping("/setPrint")
+    public void setPrint(@RequestBody BizInboundOrder bizInboundOrder) throws Exception {
+        bizInboundOrder.setIsPrint(1);
+        bizInboundOrderService.updateById(bizInboundOrder);
+    }
+
+    @PostMapping("/exportCertificateLots")
+    public void exportCertificateLots(HttpServletResponse response, BizCertificateLot bizCertificateLot) {
+        List<BizCertificateLot> lots = bizCertificateLotService.query().in("id", bizCertificateLot.getIds()).list();
+        if (lots.isEmpty()) {
+            throw new RuntimeException("请选择导出合格证");
+        }
+        List<BizCertificate> items = bizCertificateService.query().in("id", lots.stream().map(BizCertificateLot::getCertificateId).collect(Collectors.toList())).list();
+        List<Long> dayworkIds = items.stream().map(BizCertificate::getDayworkId).collect(Collectors.toList());
+        List<BizDayworkItem> dayworkItemList = bizDayworkItemService.query().in("daywork_id", dayworkIds).list();
+        //包装详情
+        List<Long> packageIds = items.stream().map(v -> v.getPackageId()).distinct().collect(Collectors.toList());
+        List<BizCompanyProductPackage> packageList = bizCompanyProductPackageService.query().in("id", packageIds).list();
+        List<BizCertificateExport> list = new ArrayList<>();
+
+        for(BizCertificate certificate : items){
+            BizDayworkItem bizDayworkItem = dayworkItemList.stream().filter(v -> v.getDayworkId().equals(certificate.getDayworkId())).max(Comparator.comparing(BizDayworkItem::getCreateTime)).orElse(null);
+            List<BizCertificateLot> certificateLots = lots.stream().filter(v -> v.getCertificateId().equals(certificate.getId())).collect(Collectors.toList());
+            for(BizCertificateLot item : certificateLots){
+                BizCertificateExport bizCertificateExport = new BizCertificateExport();
+                bizCertificateExport.setLotCode(certificate.getLotCode());
+                bizCertificateExport.setProductDescription(certificate.getProductDescription());
+                bizCertificateExport.setDeptName(certificate.getDeptName());
+                bizCertificateExport.setLabelNumber(certificate.getLabelNumber());
+                bizCertificateExport.setPackageLineNo(certificate.getPackageLineNo());
+                bizCertificateExport.setPackageNo(certificate.getPackageNo());
+                bizCertificateExport.setNumber(certificate.getNumber());
+                bizCertificateExport.setPrintPages(certificate.getPrintPages());
+                bizCertificateExport.setPrintDate(certificate.getPrintDate());
+                bizCertificateExport.setCompanyName(certificate.getCompanyName());
+                bizCertificateExport.setPurchaseOrderNo(certificate.getPurchaseOrderNo());
+                bizCertificateExport.setFurnaceNumber(certificate.getFurnaceNumber());
+                bizCertificateExport.setPackageStandard(certificate.getPackageStandard());
+                bizCertificateExport.setPackageTypeCode(certificate.getPackageTypeCode());
+                bizCertificateExport.setSpecification(certificate.getSpecification());
+                bizCertificateExport.setDrawingNumber(certificate.getDrawingNumber());
+                bizCertificateExport.setMaterialNum(certificate.getMaterialNum());
+                bizCertificateExport.setSubmitTime(bizDayworkItem.getEndTime());
+                bizCertificateExport.setBarCode(item.getBarcode());
+                bizCertificateExport.setFirst_1(certificate.getFirst_1());
+                bizCertificateExport.setFirst_2(certificate.getFirst_2());
+                bizCertificateExport.setFirst_3(certificate.getFirst_3());
+                bizCertificateExport.setFirst_4(certificate.getFirst_4());
+                bizCertificateExport.setFirst_5(certificate.getFirst_5());
+                bizCertificateExport.setFirst_6(certificate.getFirst_6());
+                bizCertificateExport.setFirst_7(certificate.getFirst_7());
+                bizCertificateExport.setFirst_8(certificate.getFirst_8());
+                bizCertificateExport.setFirst_9(certificate.getFirst_9());
+                bizCertificateExport.setFirst_10(certificate.getFirst_10());
+                //包装
+                BizCompanyProductPackage packageItem = packageList.stream().filter(v -> v.getId().equals(certificate.getPackageId())).findFirst().orElse(null);
+                bizCertificateExport.setRecipientName(packageItem.getRecipientName());
+                bizCertificateExport.setPackingOrder(packageItem.getPackingOrder());
+                bizCertificateExport.setCustomerPartNo(packageItem.getCustomerPartNo());
+                bizCertificateExport.setCustomerPartName(packageItem.getCustomerPartName());
+                bizCertificateExport.setProductCode(packageItem.getProductCode());
+                bizCertificateExport.setNetWeight(packageItem.getNetWeight());
+                bizCertificateExport.setSingleGrossWeight(packageItem.getSingleGrossWeight());
+                bizCertificateExport.setEngineerChangeNumber(packageItem.getEngineerChangeNumber());
+                bizCertificateExport.setSupplierCode(packageItem.getSupplierCode());
+                list.add(bizCertificateExport);
+            }
+        }
+        ExcelUtil<BizCertificateExport> util = new ExcelUtil<BizCertificateExport>(BizCertificateExport.class);
+        util.exportExcel(response, list, "合格证打印");
+    }
+
+    @PostMapping("/inboundAllLot")
+    @Transactional
+    public AjaxResult inboundAllLot(@RequestBody BizInboundOrder bizInboundOrder) throws Exception {
+        bizInboundOrder.setStatus("2");
+        bizInboundOrder.setIsAllInbound(1);
+        List<BizInboundOrderDetail> detailList = bizInboundOrderDetailService.query().eq("inbound_order_id", bizInboundOrder.getId()).list();
+        detailList.forEach(l -> {
+            l.setIsInbound(1);
+        });
+        bizInboundOrderService.updateById(bizInboundOrder);
+        bizInboundOrderDetailService.updateBatchById(detailList);
+        return success();
+    }
+}

+ 109 - 0
src/main/java/cn/ezhizao/project/business/controller/BizInboundOrderDetailController.java

@@ -0,0 +1,109 @@
+package cn.ezhizao.project.business.controller;
+
+import java.util.List;
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+
+import cn.ezhizao.common.utils.poi.ExcelUtil;
+import cn.ezhizao.framework.aspectj.lang.annotation.Log;
+import cn.ezhizao.framework.aspectj.lang.enums.BusinessType;
+import cn.ezhizao.framework.web.controller.BaseController;
+import cn.ezhizao.framework.web.domain.AjaxResult;
+import cn.ezhizao.framework.web.page.TableDataInfo;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import cn.ezhizao.project.business.domain.BizInboundOrderDetail;
+import cn.ezhizao.project.business.service.IBizInboundOrderDetailService;
+
+/**
+ * 生产入库明细Controller
+ *
+ * @author ezhizao
+ * @date 2025-05-20
+ */
+@RestController
+@RequestMapping("/business/inboundOrderDetail")
+public class BizInboundOrderDetailController extends BaseController
+{
+    @Resource
+    private IBizInboundOrderDetailService bizInboundOrderDetailService;
+
+    /**
+     * 查询生产入库明细列表
+     */
+    @PreAuthorize("@ss.hasPermi('business:inboundOrderDetail:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(BizInboundOrderDetail bizInboundOrderDetail) throws NoSuchFieldException, IllegalAccessException
+    {
+        setTenantId(bizInboundOrderDetail);
+        startPage();
+        List<BizInboundOrderDetail> list = bizInboundOrderDetailService.getList(bizInboundOrderDetail);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出生产入库明细列表
+     */
+    @PreAuthorize("@ss.hasPermi('business:inboundOrderDetail:export')")
+    @Log(title = "生产入库明细", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, BizInboundOrderDetail bizInboundOrderDetail) throws NoSuchFieldException, IllegalAccessException
+    {
+        setTenantId(bizInboundOrderDetail);
+        List<BizInboundOrderDetail> list = bizInboundOrderDetailService.getList(bizInboundOrderDetail);
+        ExcelUtil<BizInboundOrderDetail> util = new ExcelUtil<BizInboundOrderDetail>(BizInboundOrderDetail.class);
+        util.exportExcel(response, list, "生产入库明细数据");
+    }
+
+    /**
+     * 获取生产入库明细详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('business:inboundOrderDetail:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(bizInboundOrderDetailService.getById(id));
+    }
+
+    /**
+     * 新增生产入库明细
+     */
+    @PreAuthorize("@ss.hasPermi('business:inboundOrderDetail:add')")
+    @Log(title = "生产入库明细", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody BizInboundOrderDetail bizInboundOrderDetail) throws NoSuchFieldException, IllegalAccessException
+    {
+        setTenantId(bizInboundOrderDetail);
+        return toAjax(bizInboundOrderDetailService.save(bizInboundOrderDetail));
+    }
+
+    /**
+     * 修改生产入库明细
+     */
+    @PreAuthorize("@ss.hasPermi('business:inboundOrderDetail:edit')")
+    @Log(title = "生产入库明细", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody BizInboundOrderDetail bizInboundOrderDetail) throws NoSuchFieldException, IllegalAccessException
+    {
+        setTenantId(bizInboundOrderDetail);
+        return toAjax(bizInboundOrderDetailService.updateById(bizInboundOrderDetail));
+    }
+
+    /**
+     * 删除生产入库明细
+     */
+    @PreAuthorize("@ss.hasPermi('business:inboundOrderDetail:remove')")
+    @Log(title = "生产入库明细", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable List<Long> ids)
+    {
+        return toAjax(bizInboundOrderDetailService.removeBatchByIds(ids));
+    }
+}

+ 4 - 0
src/main/java/cn/ezhizao/project/business/domain/BizCertificateLot.java

@@ -1,6 +1,7 @@
 package cn.ezhizao.project.business.domain;
 
 import java.util.Date;
+import java.util.List;
 
 import cn.ezhizao.framework.aspectj.lang.annotation.Excel;
 import cn.ezhizao.framework.web.domain.BaseEntity;
@@ -77,4 +78,7 @@ public class BizCertificateLot extends BaseEntity
     @TableField(exist = false)
     private String barcodeUrl2Src;
     private String companyName;
+
+    @TableField(exist = false)
+    private List<Long> ids;
 }

+ 63 - 0
src/main/java/cn/ezhizao/project/business/domain/BizCompany.java

@@ -0,0 +1,63 @@
+package cn.ezhizao.project.business.domain;
+
+import cn.ezhizao.framework.aspectj.lang.annotation.Excel;
+import cn.ezhizao.framework.web.domain.BaseEntity;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * 客户名称对象 biz_company
+ *
+ * @author ezhizao
+ * @date 2024-09-12
+ */
+@Data
+@TableName(value = "biz_company")
+public class BizCompany extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 租户id */
+    @ApiModelProperty(value = "${comment}")
+    private Long tenantId;
+
+    /** 公司编码 */
+    @Excel(name = "公司编码")
+    @ApiModelProperty(value = "公司编码")
+    private String companyCode;
+
+    /** 公司名称 */
+    @Excel(name = "公司名称")
+    @ApiModelProperty(value = "公司名称")
+    private String companyName;
+
+    /** 公司别名 */
+    @Excel(name = "公司别名")
+    @ApiModelProperty(value = "公司别名")
+    private String companyAlias;
+
+    /** 助记码 */
+    @Excel(name = "助记码")
+    @ApiModelProperty(value = "助记码")
+    private String mnemonicCode;
+
+    /** 地区 */
+    @Excel(name = "地区")
+    @ApiModelProperty(value = "地区")
+    private String region;
+
+    /** 业务员id(对应sys_user的id) */
+    @ApiModelProperty(value = "地区")
+    private Long salemanId;
+
+    /** 业务员编码(对应sys_user的user_name) */
+    @Excel(name = "业务员编码", readConverterExp = "对=应sys_user的user_name")
+    @ApiModelProperty(value = "业务员编码")
+    private String salemanCode;
+
+    @TableField(exist = false)
+    private String remark;
+
+}

+ 33 - 0
src/main/java/cn/ezhizao/project/business/domain/BizCompanyProductPackage.java

@@ -161,4 +161,37 @@ public class BizCompanyProductPackage extends BaseEntity
     private String netWeight;
     private String engineerChangeNumber;
     private String supplierCode;
+
+
+    private Long xsyId;
+    private Long bgyId;
+    private Long jsyId;
+    /** 销售员号 */
+    @Excel(name = "销售员号")
+    @ApiModelProperty(value = "销售员号")
+    private String xsyno;
+
+    /** 销售员名 */
+    @Excel(name = "销售员名")
+    @ApiModelProperty(value = "销售员名")
+    private String xsyna;
+
+    /** 保管员号 */
+    @Excel(name = "保管员号")
+    @ApiModelProperty(value = "保管员号")
+    private String bgyno;
+
+    /** 保管员名 */
+    @Excel(name = "保管员名")
+    @ApiModelProperty(value = "保管员名")
+    private String bgyna;
+    /** 技术员号 */
+    @Excel(name = "技术员号")
+    @ApiModelProperty(value = "技术员号")
+    private String jsyno;
+
+    /** 技术员名 */
+    @Excel(name = "技术员名")
+    @ApiModelProperty(value = "技术员名")
+    private String jsyna;
 }

+ 219 - 0
src/main/java/cn/ezhizao/project/business/domain/BizInboundOrder.java

@@ -0,0 +1,219 @@
+package cn.ezhizao.project.business.domain;
+
+import java.util.Date;
+import java.util.List;
+
+import cn.ezhizao.framework.aspectj.lang.annotation.Excel;
+import cn.ezhizao.framework.web.domain.BaseEntity;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * 生产入库对象 biz_inbound_order
+ *
+ * @author ezhizao
+ * @date 2025-05-20
+ */
+@Data
+@TableName(value = "biz_inbound_order")
+public class BizInboundOrder extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 租户id */
+    @ApiModelProperty(value = "${comment}")
+    private Long tenantId;
+
+    /** 入库类别 */
+    @Excel(name = "入库类别")
+    @ApiModelProperty(value = "入库类别")
+    private Integer type;
+
+    /** 入库部门id */
+    @ApiModelProperty(value = "入库类别")
+    private Long deptId;
+
+    /** 入库部门 */
+    @Excel(name = "入库部门")
+    @ApiModelProperty(value = "入库部门")
+    private String deptName;
+
+    /** 入库日期 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "入库日期", width = 30, dateFormat = "yyyy-MM-dd")
+    @ApiModelProperty(value = "入库日期")
+    private Date inboundTime;
+
+    /** 入库单号 */
+    @Excel(name = "入库单号")
+    @ApiModelProperty(value = "入库单号")
+    private String inboundNumber;
+
+    /** 客户id */
+    @ApiModelProperty(value = "入库单号")
+    private Long companyId;
+
+    /** 客户简称 */
+    @Excel(name = "客户简称")
+    @ApiModelProperty(value = "客户简称")
+    private String companyAlias;
+
+    /** 客户编码 */
+    @Excel(name = "客户编码")
+    @ApiModelProperty(value = "客户编码")
+    private String companyCode;
+
+    /** 保管员id */
+    @ApiModelProperty(value = "客户编码")
+    private Long storageUserId;
+
+    /** 保管员编码 */
+    @Excel(name = "保管员编码")
+    @ApiModelProperty(value = "保管员编码")
+    private String storageUserName;
+
+    /** 保管员姓名 */
+    @Excel(name = "保管员姓名")
+    @ApiModelProperty(value = "保管员姓名")
+    private String storageNickName;
+
+    /** 包装线id */
+    @ApiModelProperty(value = "包装线id")
+    private Long packageResourceGroupId;
+
+    /** 包装线名称 */
+    @Excel(name = "包装线名称")
+    @ApiModelProperty(value = "包装线名称")
+    private String packageResourceGroupName;
+
+    /** 包装线号 */
+    @Excel(name = "包装线号")
+    @ApiModelProperty(value = "包装线号")
+    private Long packageResourceGroupLineNo;
+
+    /** 料号 */
+    @Excel(name = "料号")
+    @ApiModelProperty(value = "料号")
+    private String productCode;
+
+    /** 产品种类 */
+    @Excel(name = "产品种类")
+    @ApiModelProperty(value = "产品种类")
+    private String productType;
+
+    /** 有无子件 */
+    @Excel(name = "有无子件")
+    @ApiModelProperty(value = "有无子件")
+    private Integer isSubItem;
+
+    /** 录入者id */
+    @ApiModelProperty(value = "录入者id")
+    private Long inputUserId;
+
+    /** 录入者编码 */
+    @Excel(name = "录入者编码")
+    @ApiModelProperty(value = "录入者编码")
+    private String inputUserName;
+
+    /** 录入者姓名 */
+    @Excel(name = "录入者姓名")
+    @ApiModelProperty(value = "录入者姓名")
+    private String inputNickName;
+
+    /** 入库总量 */
+    @Excel(name = "入库总量")
+    @ApiModelProperty(value = "入库总量")
+    private Long inboundTotalNum;
+
+    /** 存储区域 */
+    @Excel(name = "存储区域")
+    @ApiModelProperty(value = "存储区域")
+    private String storageArea;
+
+    /** 单箱支数 */
+    @Excel(name = "单箱支数")
+    @ApiModelProperty(value = "单箱支数")
+    private Long labelNumber;
+
+    /** 转运码code */
+    @Excel(name = "转运码code")
+    @ApiModelProperty(value = "转运码code")
+    private String transferCode;
+
+    /** 转运码id */
+    @ApiModelProperty(value = "转运码code")
+    private Long transferId;
+
+    /** 原转运码code */
+    @Excel(name = "原转运码code")
+    @ApiModelProperty(value = "原转运码code")
+    private String originalTransferCode;
+
+    /** 是否打印 */
+    @Excel(name = "是否打印")
+    @ApiModelProperty(value = "是否打印")
+    private Integer isPrint;
+
+    /** 反选出库单号 */
+    @Excel(name = "反选出库单号")
+    @ApiModelProperty(value = "反选出库单号")
+    private String reSelectOutgoingOrderNumber;
+
+    /** 箱数 */
+    @Excel(name = "箱数")
+    @ApiModelProperty(value = "箱数")
+    private Long boxNumber;
+
+    /** 厂库 */
+    @Excel(name = "厂库")
+    @ApiModelProperty(value = "厂库")
+    private String factoryWarehouse;
+
+    /** 单位 */
+    @Excel(name = "单位")
+    @ApiModelProperty(value = "单位")
+    private String unit;
+
+    /** 包装形式 */
+    @Excel(name = "包装形式")
+    @ApiModelProperty(value = "包装形式")
+    private String packageType;
+
+    /** 状态 */
+    @Excel(name = "状态")
+    @ApiModelProperty(value = "状态")
+    private String status;
+
+    /** 是否全部入库 */
+    @Excel(name = "是否全部入库")
+    @ApiModelProperty(value = "是否全部入库")
+    private Integer isAllInbound;
+
+
+    private String standard;
+
+    private String drawingNo;
+
+    private Integer isSubclass;
+
+    private String productDescription;
+
+    private String deptCode;
+
+    @TableField(exist = false)
+    private List<BizInboundOrderDetail> details;
+    @TableField(exist = false)
+    private List<List<BizInboundOrderDetail>> detailLists;
+
+    @TableField(exist = false)
+    private Date startTime;
+    @TableField(exist = false)
+    private Date endTime;
+    @TableField(exist = false)
+    private String tenantName;
+    @TableField(exist = false)
+    private String inboundDateStr;
+}

+ 202 - 0
src/main/java/cn/ezhizao/project/business/domain/BizInboundOrderDetail.java

@@ -0,0 +1,202 @@
+package cn.ezhizao.project.business.domain;
+
+import cn.ezhizao.framework.aspectj.lang.annotation.Excel;
+import cn.ezhizao.framework.web.domain.BaseEntity;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * 生产入库明细对象 biz_inbound_order_detail
+ *
+ * @author ezhizao
+ * @date 2025-05-20
+ */
+@Data
+@TableName(value = "biz_inbound_order_detail")
+public class BizInboundOrderDetail extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 入库单id */
+    @ApiModelProperty(value = "${comment}")
+    private Long inboundOrderId;
+
+    /** 合格证id */
+    @ApiModelProperty(value = "${comment}")
+    private Long certificateId;
+
+    /** 合格证批次id */
+    @ApiModelProperty(value = "${comment}")
+    private Long certificateLotId;
+
+    /** 合格证编码 */
+    @Excel(name = "合格证编码")
+    @ApiModelProperty(value = "合格证编码")
+    private String certificateCode;
+
+    private String lotCode;
+    private Long lotId;
+
+    /** 入库数量 */
+    @Excel(name = "入库数量")
+    @ApiModelProperty(value = "入库数量")
+    private Long inboundNum;
+
+    /** 是否入库 */
+    @Excel(name = "是否入库")
+    @ApiModelProperty(value = "是否入库")
+    private Integer isInbound;
+
+    /** 操作者1id */
+    @ApiModelProperty(value = "是否入库")
+    private Long firstOperatorUserId;
+
+    /** 操作者1编码 */
+    @Excel(name = "操作者1编码")
+    @ApiModelProperty(value = "操作者1编码")
+    private String firstOperatorUserName;
+
+    /** 操作者1名称 */
+    @Excel(name = "操作者1名称")
+    @ApiModelProperty(value = "操作者1名称")
+    private String firstOperatorNickName;
+
+    /** 操作者2id */
+    @ApiModelProperty(value = "操作者1名称")
+    private Long secondOperatorUserId;
+
+    /** 操作者2编码 */
+    @Excel(name = "操作者2编码")
+    @ApiModelProperty(value = "操作者2编码")
+    private String secondOperatorUserName;
+
+    /** 操作者2名称 */
+    @Excel(name = "操作者2名称")
+    @ApiModelProperty(value = "操作者2名称")
+    private String secondOperatorNickName;
+
+    /** 操作者3id */
+    @ApiModelProperty(value = "操作者2名称")
+    private Long thirdOperatorUserId;
+
+    /** 操作者3编码 */
+    @Excel(name = "操作者3编码")
+    @ApiModelProperty(value = "操作者3编码")
+    private String thirdOperatorUserName;
+
+    /** 操作者3名称 */
+    @Excel(name = "操作者3名称")
+    @ApiModelProperty(value = "操作者3名称")
+    private String thirdOperatorNickName;
+
+    /** 包装形式码 */
+    @Excel(name = "包装形式码")
+    @ApiModelProperty(value = "包装形式码")
+    private String packageTypeCode;
+
+    /** 转运托盘码 */
+    @Excel(name = "转运托盘码")
+    @ApiModelProperty(value = "转运托盘码")
+    private String transferCode;
+
+    @TableField(exist = false)
+    private Long productId;
+    @TableField(exist = false)
+    private String productDescription;
+    @TableField(exist = false)
+    private Long companyId;
+    @TableField(exist = false)
+    private String customerName;
+    @TableField(exist = false)
+    private Long deptId;
+    @TableField(exist = false)
+    private Long packageResourceGroupId;
+    @TableField(exist = false)
+    private String deptName;
+    @TableField(exist = false)
+    private String packageResourceGroupName;
+    @TableField(exist = false)
+    private Long packageResourceGroupLineNo;
+    @TableField(exist = false)
+    private String unit;
+    @TableField(exist = false)
+    private String productType;
+    @TableField(exist = false)
+    private Integer isSubclass;
+    @TableField(exist = false)
+    private String standard;
+    @TableField(exist = false)
+    private String drawingNo;
+    @TableField(exist = false)
+    private Long xsyId;
+    @TableField(exist = false)
+    private Long bgyId;
+    @TableField(exist = false)
+    private Long jsyId;
+    /** 销售员号 */
+    @Excel(name = "销售员号")
+    @TableField(exist = false)
+    private String xsyno;
+
+    /** 销售员名 */
+    @Excel(name = "销售员名")
+    @TableField(exist = false)
+    private String xsyna;
+
+    /** 保管员号 */
+    @Excel(name = "保管员号")
+    @ApiModelProperty(value = "保管员号")
+    @TableField(exist = false)
+    private String bgyno;
+
+    /** 保管员名 */
+    @Excel(name = "保管员名")
+    @ApiModelProperty(value = "保管员名")
+    @TableField(exist = false)
+    private String bgyna;
+    /** 技术员号 */
+    @Excel(name = "技术员号")
+    @ApiModelProperty(value = "技术员号")
+    @TableField(exist = false)
+    private String jsyno;
+
+    /** 技术员名 */
+    @Excel(name = "技术员名")
+    @ApiModelProperty(value = "技术员名")
+    @TableField(exist = false)
+    private String jsyna;
+
+    /** 客户简称 */
+    @Excel(name = "客户简称")
+    @ApiModelProperty(value = "客户简称")
+    @TableField(exist = false)
+    private String companyAlias;
+
+    /** 客户编码 */
+    @Excel(name = "客户编码")
+    @TableField(exist = false)
+    @ApiModelProperty(value = "客户编码")
+    private String companyCode;
+
+    /** 单箱支数 */
+    @Excel(name = "单箱支数")
+    @ApiModelProperty(value = "单箱支数")
+    @TableField(exist = false)
+    private Long labelNumber;
+    // 判断可添加
+    @TableField(exist = false)
+    private Boolean checked;
+
+    @TableField(exist = false)
+    private Boolean isFirst;
+
+    @TableField(exist = false)
+    private String productCode;
+    @TableField(exist = false)
+    private String deptCode;
+
+    @TableField(exist =  false)
+    private Long sum;
+}

+ 4 - 0
src/main/java/cn/ezhizao/project/business/domain/BizProduct.java

@@ -185,4 +185,8 @@ public class BizProduct extends BaseEntity
     @ApiModelProperty("产品单价")
     private BigDecimal unprc;
 
+    /** 有无子件 */
+    @ApiModelProperty("有无子件")
+    private Integer isSubclass;
+
 }

+ 30 - 0
src/main/java/cn/ezhizao/project/business/mapper/BizCompanyMapper.java

@@ -0,0 +1,30 @@
+package cn.ezhizao.project.business.mapper;
+
+import cn.ezhizao.project.business.domain.BizCompany;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+import java.util.List;
+
+/**
+ * 客户名称Mapper接口
+ *
+ * @author ezhizao
+ * @date 2024-09-12
+ */
+public interface BizCompanyMapper extends BaseMapper<BizCompany>
+{
+    /**
+     * 查询客户名称列表
+     *
+     * @param bizCompany 客户名称
+     * @return 客户名称集合
+     */
+    public List<BizCompany> getList(BizCompany bizCompany);
+
+    /**
+     * 物理删除
+     * @param bizCompany
+     * @return 删除结果
+    */
+    public int physicalDelete(BizCompany bizCompany);
+}

+ 29 - 0
src/main/java/cn/ezhizao/project/business/mapper/BizInboundOrderDetailMapper.java

@@ -0,0 +1,29 @@
+package cn.ezhizao.project.business.mapper;
+
+import java.util.List;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import cn.ezhizao.project.business.domain.BizInboundOrderDetail;
+
+/**
+ * 生产入库明细Mapper接口
+ *
+ * @author ezhizao
+ * @date 2025-05-20
+ */
+public interface BizInboundOrderDetailMapper extends BaseMapper<BizInboundOrderDetail>
+{
+    /**
+     * 查询生产入库明细列表
+     *
+     * @param bizInboundOrderDetail 生产入库明细
+     * @return 生产入库明细集合
+     */
+    public List<BizInboundOrderDetail> getList(BizInboundOrderDetail bizInboundOrderDetail);
+
+    /**
+     * 物理删除
+     * @param bizInboundOrderDetail
+     * @return 删除结果
+    */
+    public int physicalDelete(BizInboundOrderDetail bizInboundOrderDetail);
+}

+ 29 - 0
src/main/java/cn/ezhizao/project/business/mapper/BizInboundOrderMapper.java

@@ -0,0 +1,29 @@
+package cn.ezhizao.project.business.mapper;
+
+import java.util.List;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import cn.ezhizao.project.business.domain.BizInboundOrder;
+
+/**
+ * 生产入库Mapper接口
+ *
+ * @author ezhizao
+ * @date 2025-05-20
+ */
+public interface BizInboundOrderMapper extends BaseMapper<BizInboundOrder>
+{
+    /**
+     * 查询生产入库列表
+     *
+     * @param bizInboundOrder 生产入库
+     * @return 生产入库集合
+     */
+    public List<BizInboundOrder> getList(BizInboundOrder bizInboundOrder);
+
+    /**
+     * 物理删除
+     * @param bizInboundOrder
+     * @return 删除结果
+    */
+    public int physicalDelete(BizInboundOrder bizInboundOrder);
+}

+ 31 - 0
src/main/java/cn/ezhizao/project/business/service/IBizCompanyService.java

@@ -0,0 +1,31 @@
+package cn.ezhizao.project.business.service;
+
+import cn.ezhizao.project.business.domain.BizCompany;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+import java.util.List;
+
+/**
+ * 客户名称Service接口
+ *
+ * @author ezhizao
+ * @date 2024-09-12
+ */
+public interface IBizCompanyService extends IService<BizCompany>
+{
+    /**
+     * 查询客户名称列表
+     *
+     * @param bizCompany 客户名称
+     * @return 客户名称集合
+     */
+    public List<BizCompany> getList(BizCompany bizCompany);
+
+    /**
+     * 物理删除
+     * @param bizCompany
+     * @return 删除结果
+     */
+    public int physicalDelete(BizCompany bizCompany);
+
+}

+ 30 - 0
src/main/java/cn/ezhizao/project/business/service/IBizInboundOrderDetailService.java

@@ -0,0 +1,30 @@
+package cn.ezhizao.project.business.service;
+
+import java.util.List;
+import com.baomidou.mybatisplus.extension.service.IService;
+import cn.ezhizao.project.business.domain.BizInboundOrderDetail;
+
+/**
+ * 生产入库明细Service接口
+ *
+ * @author ezhizao
+ * @date 2025-05-20
+ */
+public interface IBizInboundOrderDetailService extends IService<BizInboundOrderDetail>
+{
+    /**
+     * 查询生产入库明细列表
+     *
+     * @param bizInboundOrderDetail 生产入库明细
+     * @return 生产入库明细集合
+     */
+    public List<BizInboundOrderDetail> getList(BizInboundOrderDetail bizInboundOrderDetail);
+
+    /**
+     * 物理删除
+     * @param bizInboundOrderDetail
+     * @return 删除结果
+     */
+    public int physicalDelete(BizInboundOrderDetail bizInboundOrderDetail);
+
+}

+ 30 - 0
src/main/java/cn/ezhizao/project/business/service/IBizInboundOrderService.java

@@ -0,0 +1,30 @@
+package cn.ezhizao.project.business.service;
+
+import java.util.List;
+import com.baomidou.mybatisplus.extension.service.IService;
+import cn.ezhizao.project.business.domain.BizInboundOrder;
+
+/**
+ * 生产入库Service接口
+ *
+ * @author ezhizao
+ * @date 2025-05-20
+ */
+public interface IBizInboundOrderService extends IService<BizInboundOrder>
+{
+    /**
+     * 查询生产入库列表
+     *
+     * @param bizInboundOrder 生产入库
+     * @return 生产入库集合
+     */
+    public List<BizInboundOrder> getList(BizInboundOrder bizInboundOrder);
+
+    /**
+     * 物理删除
+     * @param bizInboundOrder
+     * @return 删除结果
+     */
+    public int physicalDelete(BizInboundOrder bizInboundOrder);
+
+}

+ 44 - 0
src/main/java/cn/ezhizao/project/business/service/impl/BizCompanyServiceImpl.java

@@ -0,0 +1,44 @@
+package cn.ezhizao.project.business.service.impl;
+
+import cn.ezhizao.project.business.domain.BizCompany;
+import cn.ezhizao.project.business.mapper.BizCompanyMapper;
+import cn.ezhizao.project.business.service.IBizCompanyService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * 客户名称Service业务层处理
+ *
+ * @author ezhizao
+ * @date 2024-09-12
+ */
+@Service
+public class BizCompanyServiceImpl extends ServiceImpl<BizCompanyMapper, BizCompany> implements IBizCompanyService
+{
+    @Resource
+    private BizCompanyMapper bizCompanyMapper;
+
+    /**
+     * 查询客户名称列表
+     *
+     * @param bizCompany 客户名称
+     * @return 客户名称
+     */
+    @Override
+    public List<BizCompany> getList(BizCompany bizCompany)
+    {
+        return bizCompanyMapper.getList(bizCompany);
+    }
+
+    /**
+     * 物理删除
+     * @param bizCompany
+     * @return 删除结果
+     */
+    @Override
+    public int physicalDelete(BizCompany bizCompany){ return bizCompanyMapper.physicalDelete(bizCompany); };
+
+}

+ 43 - 0
src/main/java/cn/ezhizao/project/business/service/impl/BizInboundOrderDetailServiceImpl.java

@@ -0,0 +1,43 @@
+package cn.ezhizao.project.business.service.impl;
+
+import java.util.List;
+import javax.annotation.Resource;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+import cn.ezhizao.project.business.mapper.BizInboundOrderDetailMapper;
+import cn.ezhizao.project.business.domain.BizInboundOrderDetail;
+import cn.ezhizao.project.business.service.IBizInboundOrderDetailService;
+
+/**
+ * 生产入库明细Service业务层处理
+ *
+ * @author ezhizao
+ * @date 2025-05-20
+ */
+@Service
+public class BizInboundOrderDetailServiceImpl  extends ServiceImpl<BizInboundOrderDetailMapper, BizInboundOrderDetail> implements IBizInboundOrderDetailService
+{
+    @Resource
+    private BizInboundOrderDetailMapper bizInboundOrderDetailMapper;
+
+    /**
+     * 查询生产入库明细列表
+     *
+     * @param bizInboundOrderDetail 生产入库明细
+     * @return 生产入库明细
+     */
+    @Override
+    public List<BizInboundOrderDetail> getList(BizInboundOrderDetail bizInboundOrderDetail)
+    {
+        return bizInboundOrderDetailMapper.getList(bizInboundOrderDetail);
+    }
+
+    /**
+     * 物理删除
+     * @param bizInboundOrderDetail
+     * @return 删除结果
+     */
+    @Override
+    public int physicalDelete(BizInboundOrderDetail bizInboundOrderDetail){ return bizInboundOrderDetailMapper.physicalDelete(bizInboundOrderDetail); };
+
+}

+ 43 - 0
src/main/java/cn/ezhizao/project/business/service/impl/BizInboundOrderServiceImpl.java

@@ -0,0 +1,43 @@
+package cn.ezhizao.project.business.service.impl;
+
+import java.util.List;
+import javax.annotation.Resource;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+import cn.ezhizao.project.business.mapper.BizInboundOrderMapper;
+import cn.ezhizao.project.business.domain.BizInboundOrder;
+import cn.ezhizao.project.business.service.IBizInboundOrderService;
+
+/**
+ * 生产入库Service业务层处理
+ *
+ * @author ezhizao
+ * @date 2025-05-20
+ */
+@Service
+public class BizInboundOrderServiceImpl  extends ServiceImpl<BizInboundOrderMapper, BizInboundOrder> implements IBizInboundOrderService
+{
+    @Resource
+    private BizInboundOrderMapper bizInboundOrderMapper;
+
+    /**
+     * 查询生产入库列表
+     *
+     * @param bizInboundOrder 生产入库
+     * @return 生产入库
+     */
+    @Override
+    public List<BizInboundOrder> getList(BizInboundOrder bizInboundOrder)
+    {
+        return bizInboundOrderMapper.getList(bizInboundOrder);
+    }
+
+    /**
+     * 物理删除
+     * @param bizInboundOrder
+     * @return 删除结果
+     */
+    @Override
+    public int physicalDelete(BizInboundOrder bizInboundOrder){ return bizInboundOrderMapper.physicalDelete(bizInboundOrder); };
+
+}

+ 4 - 0
src/main/java/cn/ezhizao/project/system/domain/SysDept.java

@@ -93,6 +93,10 @@ public class SysDept extends BaseEntity {
      * 角色名称
      */
     private String role;
+    /**
+     * 角色id
+     */
+    private String deptKey;
 
     /**
      * 是否为企业

+ 34 - 0
src/main/resources/mybatis/business/BizCompanyMapper.xml

@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.ezhizao.project.business.mapper.BizCompanyMapper">
+
+    <resultMap type="cn.ezhizao.project.business.domain.BizCompany" id="BizCompanyResult">
+        <id column="id" property="id"/>
+    </resultMap>
+
+
+    <select id="getList" parameterType="BizCompany" resultMap="BizCompanyResult">
+        SELECT * FROM biz_company
+        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
+            deleted = 0
+            <if test="companyCode != null  and companyCode != ''"> AND company_code = #{companyCode}</if>
+            <if test="companyName != null  and companyName != ''"> AND company_name like concat('%', #{companyName}, '%')</if>
+            <if test="companyAlias != null  and companyAlias != ''"> AND company_alias = #{companyAlias}</if>
+            <if test="mnemonicCode != null  and mnemonicCode != ''"> AND mnemonic_code = #{mnemonicCode}</if>
+            <if test="region != null  and region != ''"> AND region = #{region}</if>
+            <if test="salemanCode != null  and salemanCode != ''"> AND saleman_code = #{salemanCode}</if>
+        </trim>
+    </select>
+
+    <delete id="physicalDelete">
+        DELETE FROM biz_company
+        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
+            <if test="id != null">
+                id = #{id} AND
+            </if>
+       <!-- 删除条件为其他外键可以在这里加 -->
+        </trim>
+    </delete>
+</mapper>

+ 39 - 0
src/main/resources/mybatis/business/BizInboundOrderDetailMapper.xml

@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.ezhizao.project.business.mapper.BizInboundOrderDetailMapper">
+
+    <resultMap type="cn.ezhizao.project.business.domain.BizInboundOrderDetail" id="BizInboundOrderDetailResult">
+        <id column="id" property="id"/>
+    </resultMap>
+
+
+    <select id="getList" parameterType="BizInboundOrderDetail" resultMap="BizInboundOrderDetailResult">
+        SELECT * FROM biz_inbound_order_detail
+        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
+            deleted = 0
+            <if test="certificateCode != null  and certificateCode != ''"> AND certificate_code = #{certificateCode}</if>
+            <if test="inboundNum != null "> AND inbound_num = #{inboundNum}</if>
+            <if test="isInbound != null "> AND is_inbound = #{isInbound}</if>
+            <if test="firstOperatorUserName != null  and firstOperatorUserName != ''"> AND first_operator_user_name like concat('%', #{firstOperatorUserName}, '%')</if>
+            <if test="firstOperatorNickName != null  and firstOperatorNickName != ''"> AND first_operator_nick_name like concat('%', #{firstOperatorNickName}, '%')</if>
+            <if test="secondOperatorUserName != null  and secondOperatorUserName != ''"> AND second_operator_user_name like concat('%', #{secondOperatorUserName}, '%')</if>
+            <if test="secondOperatorNickName != null  and secondOperatorNickName != ''"> AND second_operator_nick_name like concat('%', #{secondOperatorNickName}, '%')</if>
+            <if test="thirdOperatorUserName != null  and thirdOperatorUserName != ''"> AND third_operator_user_name like concat('%', #{thirdOperatorUserName}, '%')</if>
+            <if test="thirdOperatorNickName != null  and thirdOperatorNickName != ''"> AND third_operator_nick_name like concat('%', #{thirdOperatorNickName}, '%')</if>
+            <if test="packageTypeCode != null  and packageTypeCode != ''"> AND package_type_code = #{packageTypeCode}</if>
+            <if test="transferCode != null  and transferCode != ''"> AND transfer_code = #{transferCode}</if>
+        </trim>
+    </select>
+
+    <delete id="physicalDelete">
+        DELETE FROM biz_inbound_order_detail
+        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
+            <if test="id != null">
+                id = #{id} AND
+            </if>
+       <!-- 删除条件为其他外键可以在这里加 -->
+        </trim>
+    </delete>
+</mapper>

+ 62 - 0
src/main/resources/mybatis/business/BizInboundOrderMapper.xml

@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.ezhizao.project.business.mapper.BizInboundOrderMapper">
+
+    <resultMap type="cn.ezhizao.project.business.domain.BizInboundOrder" id="BizInboundOrderResult">
+        <id column="id" property="id"/>
+    </resultMap>
+
+
+    <select id="getList" parameterType="BizInboundOrder" resultMap="BizInboundOrderResult">
+        SELECT t1.*, t2.alias as tenant_name FROM biz_inbound_order t1 left join biz_tenant t2 on t2.id = t1.tenant_id
+        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
+            t1.deleted = 0
+            <if test="type != null "> AND t1.type = #{type}</if>
+            <if test="deptName != null  and deptName != ''"> AND t1.dept_name like concat('%', #{deptName}, '%')</if>
+            <if test="inboundTime != null "> AND t1.inbound_time = #{inboundTime}</if>
+            <if test="inboundNumber != null  and inboundNumber != ''"> AND t1.inbound_number like concat('%', #{inboundNumber}, '%')</if>
+            <if test="productDescription != null  and productDescription != ''"> AND t1.product_description like concat('%', #{productDescription}, '%')</if>
+            <if test="deptId != null "> and t1.dept_id = #{deptId}</if>
+            <if test="companyAlias != null  and companyAlias != ''"> AND t1.company_alias = #{companyAlias}</if>
+            <if test="companyCode != null  and companyCode != ''"> AND t1.company_code = #{companyCode}</if>
+            <if test="storageUserName != null  and storageUserName != ''"> AND t1.storage_user_name like concat('%', #{storageUserName}, '%')</if>
+            <if test="storageNickName != null  and storageNickName != ''"> AND t1.storage_nick_name like concat('%', #{storageNickName}, '%')</if>
+            <if test="packageResourceGroupName != null  and packageResourceGroupName != ''"> AND t1.package_resource_group_name like concat('%', #{packageResourceGroupName}, '%')</if>
+            <if test="packageResourceGroupLineNo != null "> AND t1.package_resource_group_line_no = #{packageResourceGroupLineNo}</if>
+            <if test="productCode != null  and productCode != ''"> AND t1.product_code = #{productCode}</if>
+            <if test="productType != null "> AND t1.product_type = #{productType}</if>
+            <if test="isSubItem != null "> AND t1.is_sub_item = #{isSubItem}</if>
+            <if test="inputUserName != null  and inputUserName != ''"> AND t1.input_user_name like concat('%', #{inputUserName}, '%')</if>
+            <if test="inputNickName != null  and inputNickName != ''"> AND t1.input_nick_name like concat('%', #{inputNickName}, '%')</if>
+            <if test="inboundTotalNum != null "> AND t1.inbound_total_num = #{inboundTotalNum}</if>
+            <if test="storageArea != null  and storageArea != ''"> AND t1.storage_area = #{storageArea}</if>
+            <if test="labelNumber != null "> AND t1.label_number = #{labelNumber}</if>
+            <if test="transferCode != null  and transferCode != ''"> AND t1.transfer_code = #{transferCode}</if>
+            <if test="originalTransferCode != null  and originalTransferCode != ''"> AND t1.original_transfer_code = #{originalTransferCode}</if>
+            <if test="isPrint != null "> AND is_print = #{isPrint}</if>
+            <if test="reSelectOutgoingOrderNumber != null  and reSelectOutgoingOrderNumber != ''"> AND t1.re_select_outgoing_order_number like concat('%', #{reSelectOutgoingOrderNumber}, '%')</if>
+            <if test="boxNumber != null "> AND t1.box_number = #{boxNumber}</if>
+            <if test="factoryWarehouse != null  and factoryWarehouse != ''"> AND t1.factory_warehouse = #{factoryWarehouse}</if>
+            <if test="unit != null  and unit != ''"> AND t1.unit = #{unit}</if>
+            <if test="packageType != null  and packageType != ''"> AND t1.package_type = #{packageType}</if>
+            <if test="status != null  and status != ''"> AND t1.status = #{status}</if>
+            <if test="isAllInbound != null "> AND t1.is_all_inbound = #{isAllInbound}</if>
+            <if test="startTime != null ">AND date_format(t1.create_time,'%y%m%d') &gt;=date_format(#{startTime},'%y%m%d') </if>
+            <if test="endTime != null ">AND date_format(t1.create_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')</if>
+            <if test="id != null">and t1.id = #{id}</if>
+        </trim>
+        order by t1.is_print asc, t1.status asc , t1.create_time desc
+    </select>
+
+    <delete id="physicalDelete">
+        DELETE FROM biz_inbound_order
+        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
+            <if test="id != null">
+                id = #{id} AND
+            </if>
+       <!-- 删除条件为其他外键可以在这里加 -->
+        </trim>
+    </delete>
+</mapper>

+ 2 - 1
src/main/resources/mybatis/system/SysDeptMapper.xml

@@ -133,7 +133,8 @@
 
 	<select id="selectDeptById" parameterType="Long" resultMap="SysDeptResult">
 		select d.type,d.dept_id,d.is_work_section,d.tenant_id,d.parent_id, d.ancestors, d.dept_name,d.dept_code, d.order_num, d.phone, d.email, d.status,d.auto_allocation,d.supplier_id,d.is_outsourcing,
-			   (select dept_name from sys_dept where dept_id = d.parent_id) parent_name
+			   (select dept_name from sys_dept where dept_id = d.parent_id) parent_name,
+		d.dept_key
 		from sys_dept d
 		where d.dept_id = #{deptId}
 	</select>

+ 150 - 0
src/main/resources/templates/inboundOrderPdf.html

@@ -0,0 +1,150 @@
+<!DOCTYPE html>
+<html lang="zh">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <style>
+        @page {
+            margin: 30px 20px 20px 10px;
+            size: 210mm 93mm;
+        }
+
+        body {
+            font-family: Helvetica Neue,Helvetica,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Arial,sans-serif;
+            -webkit-font-smoothing: antialiased;
+            -moz-osx-font-smoothing: grayscale;
+            color-adjust: exact;
+            -webkit-print-color-adjust: exact;
+        }
+
+        table {
+            width: 100%;
+            border-collapse: collapse;
+            font-size: 10px;
+            table-layout:fixed;
+        }
+
+        th, td {
+            text-align: center;
+            padding: 2px;
+            border: 1px solid #000;
+        }
+
+        .total-row {
+            font-weight: bold;
+            /*background-color: lightgray;*/
+            text-align: center;
+        }
+
+        .right-align { text-align: right; }
+        .center-align { text-align: center; }
+        .left-align { text-align: left; }
+
+        .right-align1 {
+            font-size: 12px;
+            margin-left: auto;
+            padding-right: 110px;
+        }
+        .center-align1 {
+            font-size: 13px;
+            padding-right: 90px;
+        }
+        .left-align1 {
+            font-size: 14px;
+            margin-right: 5px;
+        }
+        .title-row {
+            font-size: 13px ;
+            display: flex;
+            justify-content: space-between; /* 元素之间的间距均匀分布 */
+            align-items: center; /* 垂直居中对齐 */
+            width: 100%; /* 确保标题行占满整个容器宽度 */
+            /*margin-bottom: 10px; !* 根据需要调整间距 *!*/
+        }
+
+        .title-row div {
+            /* 移除默认的外边距 */
+            margin: 0 ;
+        }
+
+    </style>
+</head>
+<#list inboundOrder.detailLists as detail>
+<body>
+
+<!-- 标题行 -->
+<div class="title-row">
+    <div class="right-align1" style=" font-size: 14px ; margin-left: 5px;padding-right: 40px ">
+        厂别: <#if inboundOrder.tenantName??>${inboundOrder.tenantName} </#if>
+    </div>
+    <div class="right-align1" style=" font-size: 14px ; margin-left: 5px;padding-right: 65px;">包装形式: ${inboundOrder.packageType} </div>
+    <div class="center-align1"  style="font-size: 16px ;padding-right: 90px; font-weight: 600;">大连德迈仕精密科技股份有限公司</div>
+    <div class="left-align1"  style=" font-size: 14px ;font-weight: 600;">入库单号:${inboundOrder.inboundNumber}</div>
+</div>
+<!-- 标题行 -->
+<div class="title-row" style="margin-top: 3px ; font-size: 14px ;">
+    <div class="right-align" style="margin-left: 5px; padding-right:220px;" >部门:${inboundOrder.deptCode} ${inboundOrder.deptName}</div>
+    <div class="center-align" style="font-size: 14px ; padding-right: 210px; font-weight: 600;">产成品入库单</div>
+    <div class="left-align" style="margin-right: 5px">第${detail_index+1}页 共 ${inboundOrder.detailLists?size}页</div>
+</div>
+<div class="title-row" style="margin-top: 3px ; font-size: 12px ;">
+    <div class="right-align" style="margin-left: 5px;">客户: ${ inboundOrder.companyCode  } ${ inboundOrder.companyAlias} </div>
+    <div class="left-align" style="margin-left: 258px;">单据日期: ${inboundOrder.inboundDateStr } </div>
+    <div class="left-align" style="margin-left: 103px;">CDMS/JH-1-019</div>
+</div>
+<div class="title-row" style="margin-top: 3px ; font-size: 12px ;">
+    <div class="right-align" style="margin-left: 5px;">图号: ${ inboundOrder.drawingNo }</div>
+    <div class="center-align" style="margin-left: 150px;">规格: ${ inboundOrder.standard }</div>
+    <div class="left-align" style="margin-left: 30px;">产品编码: ${ inboundOrder.productCode }</div>
+    <div class="left-align" style="margin-left: 30px;">箱数: ${ inboundOrder.boxNumber }</div>
+</div>
+<table>
+    <!-- 第三行 -->
+    <tr>
+        <td style="width: 12px;">序号</td>
+        <td style="width: 60px;">批号</td>
+        <td style="width: 20px;">数量(支)</td>
+        <td style="width: 180px;">备注/客户批号/箱号等信息</td>
+    </tr>
+
+    <!-- 动态数据行 -->
+    <#list detail as item>
+    <tr>
+        <td style="width: 14px;">${ item_index + 1 }</td>
+        <td style="width: 60px;"  >
+            <#if item.lotCode??>
+                ${ item.lotCode }
+            </#if>
+        </td>
+        <td style="width: 20px;text-align: right;" >
+            <#if item.inboundNum??>
+                ${ item.inboundNum }
+        </#if>
+        </td>
+        <td style="width: 180px;" >
+            <#if item.remark??>
+                ${ item.remark }
+            <#else>
+        </#if>
+        </td>
+
+    </tr>
+</#list>
+<!--小计行-->
+<tr class="total-row">
+    <td></td>
+    <td>总计</td>
+    <td>${inboundOrder.inboundTotalNum}</td>
+    <td>支</td>
+</tr>
+</table>
+<div class="title-row"  style="margin-bottom: 5px;font-size: 12px ;">
+    <!--    <div  style=" height: 25px"></div>-->
+    <div class="center-align"  style="margin-left: 60px;padding-right: 48px">保管员:${inboundOrder.storageNickName}</div>
+    <div class="center-align"  style="margin-left: 60px;padding-right: 78px">搬运员:</div>
+    <div class="center-align" style="margin-left: 60px;padding-right: 78px">录入员:${inboundOrder.inputNickName}</div>
+    <div class="left-align" style="margin-right: 15px">白-库房, 红-财务, 黄-存根</div>
+</div>
+</body>
+</#list>
+</html>