guoyujia 2 mesi fa
parent
commit
2720a092a3

+ 92 - 0
src/main/java/cn/ezhizao/project/business/controller/BizCompanyProductPackageController.java

@@ -0,0 +1,92 @@
+package cn.ezhizao.project.business.controller;
+
+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 cn.ezhizao.project.business.domain.BizCompanyProductPackage;
+import cn.ezhizao.project.business.service.IBizCompanyProductPackageService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+
+/**
+ * 产品包装客户关联Controller
+ *
+ * @author ezhizao
+ * @date 2024-09-10
+ */
+@Api("包装方式管理")
+@RestController
+@RequestMapping("/business/companyProductPackage")
+public class BizCompanyProductPackageController extends BaseController
+{
+    @Resource
+    private IBizCompanyProductPackageService bizCompanyProductPackageService;
+
+    /**
+     * 查询产品包装客户关联列表
+     */
+    @ApiOperation("获取包装方式详细")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "productDescription", value = "产品描述", dataType = "String", paramType = "path", dataTypeClass = String.class),
+            @ApiImplicitParam(name = "packageCode", value = "包装箱辅料编码",  dataType = "String", paramType = "path", dataTypeClass = String.class),
+            @ApiImplicitParam(name = "productCode", value = "产品编码", dataType = "String", paramType = "path", dataTypeClass = String.class),
+    })
+    @Log(title = "产品包装客户关联查询")
+    @GetMapping("/list")
+    public TableDataInfo list(BizCompanyProductPackage bizCompanyProductPackage) throws NoSuchFieldException, IllegalAccessException
+    {
+        List<BizCompanyProductPackage> list = bizCompanyProductPackageService.getList(bizCompanyProductPackage);
+        return getDataTable(list);
+    }
+
+    /**
+     * 获取产品包装客户关联详细信息
+     */
+    @Log(title = "产品包装客户关联查询详细信息")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(bizCompanyProductPackageService.getById(id));
+    }
+
+    /**
+     * 新增产品包装客户关联
+     */
+    @Log(title = "产品包装客户关联新增", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody BizCompanyProductPackage bizCompanyProductPackage) throws NoSuchFieldException, IllegalAccessException
+    {
+        return toAjax(bizCompanyProductPackageService.save(bizCompanyProductPackage));
+    }
+
+    /**
+     * 修改产品包装客户关联
+     */
+    @Log(title = "产品包装客户关联修改", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody BizCompanyProductPackage bizCompanyProductPackage) throws NoSuchFieldException, IllegalAccessException
+    {
+        return toAjax(bizCompanyProductPackageService.updateById(bizCompanyProductPackage));
+    }
+
+    /**
+     * 删除产品包装客户关联
+     */
+    @Log(title = "产品包装客户关联删除", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable List<Long> ids)
+    {
+        return toAjax(bizCompanyProductPackageService.removeBatchByIds(ids));
+    }
+}

+ 115 - 2
src/main/java/cn/ezhizao/project/business/controller/BizSupplierController.java

@@ -1,21 +1,28 @@
 package cn.ezhizao.project.business.controller;
 
+import java.math.BigDecimal;
 import java.util.List;
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletResponse;
 
+import cn.ezhizao.common.utils.SecurityUtils;
 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 cn.ezhizao.project.business.domain.BizSupplier;
+import cn.ezhizao.project.business.domain.BizSupplierUser;
+import cn.ezhizao.project.business.domain.BizTenant;
 import cn.ezhizao.project.business.service.IBizSupplierService;
+import cn.ezhizao.project.business.service.IBizSupplierUserService;
+import cn.ezhizao.project.business.service.IBizTenantService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 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;
@@ -39,6 +46,10 @@ public class BizSupplierController extends BaseController
 {
     @Resource
     private IBizSupplierService bizSupplierService;
+    @Resource
+    private IBizSupplierUserService BizSupplierUserService;
+    @Resource
+    private IBizTenantService bizTenantService;
 
     /**
      * 查询外协厂信息列表
@@ -59,33 +70,135 @@ public class BizSupplierController extends BaseController
     /**
      * 新增外协厂信息
      */
+            @ApiOperation("新增供应商")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "tenantId", value = "租户ID",dataType = "Long", paramType = "path", dataTypeClass = Long.class),
+            @ApiImplicitParam(name = "code", value = "供应商编码", required = true, dataType = "String", paramType = "path", dataTypeClass = String.class),
+            @ApiImplicitParam(name = "name", value = "供应商名称", required = true, dataType = "String", paramType = "path", dataTypeClass = String.class),
+            @ApiImplicitParam(name = "alias", value = "供应商别名", required = true, dataType = "String", paramType = "path", dataTypeClass = String.class),
+            @ApiImplicitParam(name = "mnemonicCode", value = "供应商助记码",required = true,  dataType = "String", paramType = "path", dataTypeClass = String.class),
+            @ApiImplicitParam(name = "deliveryMethod", value = "发货方式", dataType = "String", paramType = "path", dataTypeClass = String.class),
+            @ApiImplicitParam(name = "settlementType", value = "结算方式", required = true, dataType = "String", paramType = "path", dataTypeClass = String.class),
+            @ApiImplicitParam(name = "freightPrice", value = "外协单价",  dataType = "BigDecimal", paramType = "path", dataTypeClass = BigDecimal.class),
+            @ApiImplicitParam(name = "lossLimit", value = "损耗上限", dataType = "BigDecimal", paramType = "path", dataTypeClass = BigDecimal.class),
+            @ApiImplicitParam(name = "remark", value = "备注",  dataType = "String", paramType = "path", dataTypeClass = String.class),
+            @ApiImplicitParam(name = "isInnerOutsource", value = "是否内部外协商", dataType = "Integer", paramType = "path", dataTypeClass = Integer.class),
+    })
     @Log(title = "外协厂信息", businessType = BusinessType.INSERT)
     @PostMapping
+    @Transactional
     public AjaxResult add(@RequestBody BizSupplier bizSupplier) throws NoSuchFieldException, IllegalAccessException
     {
         if(bizSupplier.getCode() == null || bizSupplier.getCode() == ""||bizSupplier.getName() == null || bizSupplier.getName() == "" || bizSupplier.getMnemonicCode() == null
                 ||bizSupplier.getMnemonicCode() == null || bizSupplier.getMnemonicCode() == "" ||bizSupplier.getSettlementType() == null || bizSupplier.getSettlementType() == ""){
             return error("新增供应商失败,必填项:供应商编码,供应商名称,供应商助记码,结算方式不能为空");
         }
+        if (bizSupplier.getTenantId() != null) {
+            List<BizTenant> tenantList = bizTenantService.query().eq("id", bizSupplier.getTenantId()).list();
+            if(tenantList.isEmpty()){
+                return error("新增供应商失败,租户ID不存在");
+            }
+        }
         if(!bizSupplier.getSettlementType().equals("1") && !bizSupplier.getSettlementType().equals("2")){
-
+            return error("新增供应商失败,结算方式只能为1或2");
+        }
+        if(bizSupplier.getIsInnerOutsource() !=null && !(bizSupplier.getIsInnerOutsource() ==0 || bizSupplier.getIsInnerOutsource() ==1)){
+            return error("新增供应商失败,是否内部外协只能是0或1");
         }
-        return toAjax(bizSupplierService.save(bizSupplier));
+        if(bizSupplier.getDeliveryMethod()!=null &&bizSupplier.getDeliveryMethod()!="" && !(bizSupplier.getDeliveryMethod().equals("0") || bizSupplier.getDeliveryMethod().equals("1"))){
+            return error("新增供应商失败,送货方式只能为0或1");
+        }
+        List<BizSupplier> supplierList = bizSupplierService.query().eq("code", bizSupplier.getCode()).list();
+        if (!supplierList.isEmpty()) {
+            return AjaxResult.error("供应商编号不能重复");
+        }
+        supplierList = bizSupplierService.query().eq("mnemonic_code", bizSupplier.getMnemonicCode()).list();
+        if (!supplierList.isEmpty()) {
+            return AjaxResult.error("助记码不能重复");
+        }
+        bizSupplierService.save(bizSupplier);
+        BizSupplierUser user = new BizSupplierUser();
+        user.setTenantId(bizSupplier.getTenantId());
+        user.setSupplierId(bizSupplier.getId());
+        user.setSupplierCode(bizSupplier.getCode());
+        user.setSupplierName(bizSupplier.getName());
+        user.setUsername(bizSupplier.getCode());
+        user.setPassword(SecurityUtils.encryptPassword("123456"));
+        user.setIsAdmin("1");
+        boolean bool = BizSupplierUserService.save(user);
+        if(!bool){
+            return error("新增供应商失败,请重试");
+        }
+        return success();
+
     }
 
     /**
      * 修改外协厂信息
      */
+    @ApiOperation("修改供应商")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "供应商ID", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class),
+            @ApiImplicitParam(name = "tenantId", value = "租户ID",dataType = "Long", paramType = "path", dataTypeClass = Long.class),
+            @ApiImplicitParam(name = "code", value = "供应商编码",  dataType = "String", paramType = "path", dataTypeClass = String.class),
+            @ApiImplicitParam(name = "name", value = "供应商名称",  dataType = "String", paramType = "path", dataTypeClass = String.class),
+            @ApiImplicitParam(name = "alias", value = "供应商别名",  dataType = "String", paramType = "path", dataTypeClass = String.class),
+            @ApiImplicitParam(name = "mnemonicCode", value = "供应商助记码",  dataType = "String", paramType = "path", dataTypeClass = String.class),
+            @ApiImplicitParam(name = "deliveryMethod", value = "发货方式", dataType = "String", paramType = "path", dataTypeClass = String.class),
+            @ApiImplicitParam(name = "settlementType", value = "结算方式",  dataType = "String", paramType = "path", dataTypeClass = String.class),
+            @ApiImplicitParam(name = "freightPrice", value = "外协单价",  dataType = "BigDecimal", paramType = "path", dataTypeClass = BigDecimal.class),
+            @ApiImplicitParam(name = "lossLimit", value = "损耗上限", dataType = "BigDecimal", paramType = "path", dataTypeClass = BigDecimal.class),
+            @ApiImplicitParam(name = "remark", value = "备注",  dataType = "String", paramType = "path", dataTypeClass = String.class),
+            @ApiImplicitParam(name = "isInnerOutsource", value = "是否内部外协商", dataType = "Integer", paramType = "path", dataTypeClass = Integer.class),
+    })
     @Log(title = "外协厂信息", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody BizSupplier bizSupplier) throws NoSuchFieldException, IllegalAccessException
     {
+        if(bizSupplier.getId() == null){
+            return error("修改供应商失败,供应商ID不能为空");
+        }
+        if(bizSupplier.getCode() == ""||bizSupplier.getName() == "" || bizSupplier.getMnemonicCode() == "" ||bizSupplier.getSettlementType() == ""){
+            return error("修改供应商失败,供应商编码,供应商名称,供应商助记码,结算方式不能为空");
+        }
+        if (bizSupplier.getTenantId() != null) {
+            List<BizTenant> tenantList = bizTenantService.query().eq("id", bizSupplier.getTenantId()).list();
+            if(tenantList.isEmpty()){
+                return error("修改供应商失败,租户ID不存在");
+            }
+        }
+        if(bizSupplier.getSettlementType() !=null && bizSupplier.getSettlementType() != "" &&!bizSupplier.getSettlementType().equals("1") && !bizSupplier.getSettlementType().equals("2")){
+            return error("修改供应商失败,结算方式只能为1或2");
+        }
+        if(bizSupplier.getIsInnerOutsource() !=null && !(bizSupplier.getIsInnerOutsource() ==0 || bizSupplier.getIsInnerOutsource() ==1)){
+            return error("修改供应商失败,是否内部外协只能是0或1");
+        }
+        if(bizSupplier.getDeliveryMethod()!=null &&bizSupplier.getDeliveryMethod()!="" && !(bizSupplier.getDeliveryMethod().equals("0") || bizSupplier.getDeliveryMethod().equals("1"))){
+            return error("修改供应商失败,送货方式只能为0或1");
+        }
+
+        if(bizSupplier.getCode() != null) {
+            List<BizSupplier> supplierList = bizSupplierService.query().eq("code", bizSupplier.getCode()).ne("id", bizSupplier.getId()).list();
+            if (!supplierList.isEmpty()) {
+                return AjaxResult.error("供应商编号不能重复");
+            }
+        }
+        if(bizSupplier.getMnemonicCode() != null) {
+            List<BizSupplier> supplierList = bizSupplierService.query().eq("mnemonic_code", bizSupplier.getMnemonicCode()).ne("id", bizSupplier.getId()).list();
+            if (!supplierList.isEmpty()) {
+                return AjaxResult.error("助记码不能重复");
+            }
+        }
         return toAjax(bizSupplierService.updateById(bizSupplier));
     }
 
     /**
      * 删除外协厂信息
      */
+            @ApiOperation("删除外协商")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "供应商ID", required = true, dataType = "List<Long>", paramType = "path", dataTypeClass = List.class)
+    })
     @Log(title = "外协厂信息", businessType = BusinessType.DELETE)
 	@DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable List<Long> ids)

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

@@ -0,0 +1,163 @@
+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;
+
+import java.math.BigDecimal;
+
+/**
+ * 产品包装客户关联对象 biz_company_product_package
+ *
+ * @author ezhizao
+ * @date 2024-09-10
+ */
+@Data
+@TableName(value = "biz_company_product_package")
+public class BizCompanyProductPackage extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 产品id */
+    @ApiModelProperty(value = "${comment}")
+    private Long productId;
+
+    /** 产品编码 */
+    @Excel(name = "产品编码")
+    @ApiModelProperty(value = "产品编码")
+    private String productCode;
+
+    /** 客户id */
+    @ApiModelProperty(value = "产品编码")
+    private Long companyId;
+
+    /** 客户编码 */
+    @Excel(name = "客户编码")
+    @ApiModelProperty(value = "客户编码")
+    private String companyCode;
+
+    /** 包装形式码 */
+    @Excel(name = "包装形式码")
+    @ApiModelProperty(value = "包装形式码")
+    private String packageTypeCode;
+
+    /** 产品描述 */
+    @Excel(name = "产品描述")
+    @ApiModelProperty(value = "产品描述")
+    private String productDescription;
+
+    /** 客户助记码 */
+    @Excel(name = "客户助记码")
+    @ApiModelProperty(value = "客户助记码")
+    private String mnemonicCode;
+
+    /** 客户简称 */
+    @Excel(name = "客户简称")
+    @ApiModelProperty(value = "客户简称")
+    private String companyAlias;
+
+    @Excel(name = "包装外键")
+    @ApiModelProperty(value = "包装外键")
+    private Long accessoriesId;
+
+    /** 包装箱辅料编码 */
+    @Excel(name = "包装箱辅料编码")
+    @ApiModelProperty(value = "包装箱辅料编码")
+    private String packageCode;
+
+    /** 包装箱号 */
+    @Excel(name = "包装箱号")
+    @ApiModelProperty(value = "包装箱号")
+    private String packageNo;
+
+    /** 包装尺寸 */
+    @Excel(name = "包装尺寸")
+    @ApiModelProperty(value = "包装尺寸")
+    private String packageStandard;
+
+    /** 包装长度 */
+    @Excel(name = "包装长度")
+    @ApiModelProperty(value = "包装长度")
+    private String packageLength;
+
+    /** 包装宽度 */
+    @Excel(name = "包装宽度")
+    @ApiModelProperty(value = "包装宽度")
+    private String packageWidth;
+
+    /** 包装箱高度 */
+    @Excel(name = "包装箱高度")
+    @ApiModelProperty(value = "包装箱高度")
+    private String packageHeight;
+
+    /** 单箱毛重 */
+    @Excel(name = "单箱毛重")
+    @ApiModelProperty(value = "单箱毛重")
+    private BigDecimal singleGrossWeight;
+
+    /** 单箱支数 */
+    @Excel(name = "单箱支数")
+    @ApiModelProperty(value = "单箱支数")
+    private Long singleNumber;
+
+    /** 每层箱数 */
+    @Excel(name = "每层箱数")
+    @ApiModelProperty(value = "每层箱数")
+    private Long perNumber;
+
+    /** 满托最小箱数 */
+    @Excel(name = "满托最小箱数")
+    @ApiModelProperty(value = "满托最小箱数")
+    private Long minNumber;
+
+    /** 满托最大箱数 */
+    @Excel(name = "满托最大箱数")
+    @ApiModelProperty(value = "满托最大箱数")
+    private Long maxNumber;
+
+    /** 满托支数 */
+    @Excel(name = "满托支数")
+    @ApiModelProperty(value = "满托支数")
+    private Long maxBranchNumber;
+
+    /** 托盘规格 */
+    @Excel(name = "托盘规格")
+    @ApiModelProperty(value = "托盘规格")
+    private String palletStandard;
+
+    /** 托盘类型:0川字1田字 */
+    @Excel(name = "托盘类型:0川字1田字")
+    @ApiModelProperty(value = "托盘类型:0川字1田字")
+    private String palletType;
+
+    /** "Manual"字符-- 人工区;Automatic字符代表智能区 */
+    @Excel(name = "Manual字符-- 人工区;Automatic字符代表智能区")
+    @ApiModelProperty(value = "Manual字符-- 人工区;Automatic字符代表智能区")
+    private String areaType;
+
+    /** 库存单位 */
+    @Excel(name = "库存单位")
+    @ApiModelProperty(value = "库存单位")
+    private String unit;
+
+    /** 传送状态 */
+    @Excel(name = "传送状态")
+    @ApiModelProperty(value = "传送状态")
+    private String deliveryStatus;
+
+    /** 外箱高度 */
+    @Excel(name = "外箱高度")
+    @ApiModelProperty(value = "外箱高度")
+    private Long outboxHeight;
+
+    /** 租户id */
+    @ApiModelProperty(value = "外箱高度")
+    private Long tenantId;
+
+    @TableField(exist = true)
+    private String remark;
+
+}

+ 47 - 0
src/main/java/cn/ezhizao/project/business/domain/BizSupplierUser.java

@@ -0,0 +1,47 @@
+package cn.ezhizao.project.business.domain;
+
+import cn.ezhizao.framework.web.domain.BaseEntity;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 外协商的用户表
+ *
+ * @author ezhizao
+ * date    2024-04-29
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@TableName(value = "biz_supplier_user")
+public class BizSupplierUser extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(value = "租户(厂别)id")
+    private Long tenantId;
+
+    @ApiModelProperty(value = "外协商id")
+    private Long supplierId;
+
+    @ApiModelProperty(value = "公司编码")
+    private String supplierCode;
+
+    @ApiModelProperty(value = "公司名")
+    private String supplierName;
+
+    @ApiModelProperty(value = "用户名")
+    private String username;
+
+    @ApiModelProperty(value = "密码")
+    private String password;
+
+    @ApiModelProperty(value = "姓名")
+    private String name;
+
+    @ApiModelProperty(value = "是否管理员(0:否,1:是)")
+    private String isAdmin;
+
+    @ApiModelProperty(value = "备注")
+    private String remark;
+}

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

@@ -0,0 +1,30 @@
+package cn.ezhizao.project.business.mapper;
+
+import cn.ezhizao.project.business.domain.BizCompanyProductPackage;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+import java.util.List;
+
+/**
+ * 产品包装客户关联Mapper接口
+ *
+ * @author ezhizao
+ * @date 2024-09-10
+ */
+public interface BizCompanyProductPackageMapper extends BaseMapper<BizCompanyProductPackage>
+{
+    /**
+     * 查询产品包装客户关联列表
+     *
+     * @param bizCompanyProductPackage 产品包装客户关联
+     * @return 产品包装客户关联集合
+     */
+    public List<BizCompanyProductPackage> getList(BizCompanyProductPackage bizCompanyProductPackage);
+
+    /**
+     * 物理删除
+     * @param bizCompanyProductPackage
+     * @return 删除结果
+    */
+    public int physicalDelete(BizCompanyProductPackage bizCompanyProductPackage);
+}

+ 16 - 0
src/main/java/cn/ezhizao/project/business/mapper/BizSupplierUserMapper.java

@@ -0,0 +1,16 @@
+package cn.ezhizao.project.business.mapper;
+
+import cn.ezhizao.project.business.domain.BizSupplierUser;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 外协单主
+带箱方式,是整单的。如果换新箱子,明细中,都需要更换箱子Mapper接口
+ *
+ * @author ezhizao
+ * @date 2024-04-26
+ */
+public interface BizSupplierUserMapper extends BaseMapper<BizSupplierUser>
+{
+
+}

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

@@ -0,0 +1,31 @@
+package cn.ezhizao.project.business.service;
+
+import cn.ezhizao.project.business.domain.BizCompanyProductPackage;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+import java.util.List;
+
+/**
+ * 产品包装客户关联Service接口
+ *
+ * @author ezhizao
+ * @date 2024-09-10
+ */
+public interface IBizCompanyProductPackageService extends IService<BizCompanyProductPackage>
+{
+    /**
+     * 查询产品包装客户关联列表
+     *
+     * @param bizCompanyProductPackage 产品包装客户关联
+     * @return 产品包装客户关联集合
+     */
+    public List<BizCompanyProductPackage> getList(BizCompanyProductPackage bizCompanyProductPackage);
+
+    /**
+     * 物理删除
+     * @param bizCompanyProductPackage
+     * @return 删除结果
+     */
+    public int physicalDelete(BizCompanyProductPackage bizCompanyProductPackage);
+
+}

+ 20 - 0
src/main/java/cn/ezhizao/project/business/service/IBizSupplierUserService.java

@@ -0,0 +1,20 @@
+package cn.ezhizao.project.business.service;
+
+import cn.ezhizao.project.business.domain.BizSupplierUser;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * 用户 业务层
+ *
+ * @author ruoyi
+ */
+public interface IBizSupplierUserService extends IService<BizSupplierUser>
+{
+    /**
+     * 通过用户名查询用户
+     *
+     * @param supplierId 租户id
+     * @return 用户对象信息
+     */
+    BizSupplierUser getAdminInfo(Long supplierId);
+}

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

@@ -0,0 +1,44 @@
+package cn.ezhizao.project.business.service.impl;
+
+import cn.ezhizao.project.business.domain.BizCompanyProductPackage;
+import cn.ezhizao.project.business.mapper.BizCompanyProductPackageMapper;
+import cn.ezhizao.project.business.service.IBizCompanyProductPackageService;
+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-10
+ */
+@Service
+public class BizCompanyProductPackageServiceImpl extends ServiceImpl<BizCompanyProductPackageMapper, BizCompanyProductPackage> implements IBizCompanyProductPackageService
+{
+    @Resource
+    private BizCompanyProductPackageMapper bizCompanyProductPackageMapper;
+
+    /**
+     * 查询产品包装客户关联列表
+     *
+     * @param bizCompanyProductPackage 产品包装客户关联
+     * @return 产品包装客户关联
+     */
+    @Override
+    public List<BizCompanyProductPackage> getList(BizCompanyProductPackage bizCompanyProductPackage)
+    {
+        return bizCompanyProductPackageMapper.getList(bizCompanyProductPackage);
+    }
+
+    /**
+     * 物理删除
+     * @param bizCompanyProductPackage
+     * @return 删除结果
+     */
+    @Override
+    public int physicalDelete(BizCompanyProductPackage bizCompanyProductPackage){ return bizCompanyProductPackageMapper.physicalDelete(bizCompanyProductPackage); };
+
+}

+ 34 - 0
src/main/java/cn/ezhizao/project/business/service/impl/BizSupplierUserServiceImpl.java

@@ -0,0 +1,34 @@
+package cn.ezhizao.project.business.service.impl;
+
+import cn.ezhizao.project.business.domain.BizSupplierUser;
+import cn.ezhizao.project.business.mapper.BizSupplierUserMapper;
+import cn.ezhizao.project.business.service.IBizSupplierUserService;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+
+/**
+ * 用户 业务层处理
+ *
+ * @author ruoyi
+ */
+@Service
+public class BizSupplierUserServiceImpl extends ServiceImpl<BizSupplierUserMapper, BizSupplierUser> implements IBizSupplierUserService {
+    private static final Logger log = LoggerFactory.getLogger(BizSupplierUserServiceImpl.class);
+
+    @Resource
+    private BizSupplierUserMapper bizSupplierUserMapper;
+
+    @Override
+    public BizSupplierUser getAdminInfo(Long supplierId) {
+        QueryWrapper<BizSupplierUser> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("supplier_id", supplierId);
+        queryWrapper.eq("is_admin", "1");
+
+        return bizSupplierUserMapper.selectOne(queryWrapper);
+    }
+}

+ 52 - 0
src/main/resources/mybatis/business/BizCompanyProductPackageMapper.xml

@@ -0,0 +1,52 @@
+<?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.BizCompanyProductPackageMapper">
+
+    <resultMap type="cn.ezhizao.project.business.domain.BizCompanyProductPackage" id="BizCompanyProductPackageResult">
+        <id column="id" property="id"/>
+    </resultMap>
+
+
+    <select id="getList" parameterType="BizCompanyProductPackage" resultMap="BizCompanyProductPackageResult">
+        SELECT * FROM biz_company_product_package
+        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
+            deleted = 0
+            <if test="productCode != null  and productCode != ''"> AND product_code = #{productCode}</if>
+            <if test="companyCode != null  and companyCode != ''"> AND company_code like concat('%',#{companyCode},'%') </if>
+            <if test="packageTypeCode != null  and packageTypeCode != ''"> AND package_type_code = #{packageTypeCode}</if>
+            <if test="productDescription != null  and productDescription != ''"> AND product_description like concat('%',#{productDescription}, '%')</if>
+            <if test="mnemonicCode != null  and mnemonicCode != ''"> AND mnemonic_code = #{mnemonicCode}</if>
+            <if test="companyAlias != null  and companyAlias != ''"> AND company_alias = #{companyAlias}</if>
+            <if test="packageCode != null  and packageCode != ''"> AND package_code like concat('%',#{packageCode},'%') </if>
+            <if test="packageNo != null  and packageNo != ''"> AND package_no = #{packageNo}</if>
+            <if test="packageStandard != null  and packageStandard != ''"> AND package_standard = #{packageStandard}</if>
+            <if test="packageLength != null  and packageLength != ''"> AND package_length = #{packageLength}</if>
+            <if test="packageWidth != null  and packageWidth != ''"> AND package_width = #{packageWidth}</if>
+            <if test="packageHeight != null  and packageHeight != ''"> AND package_height = #{packageHeight}</if>
+            <if test="singleGrossWeight != null "> AND single_gross_weight = #{singleGrossWeight}</if>
+            <if test="singleNumber != null "> AND single_number = #{singleNumber}</if>
+            <if test="perNumber != null "> AND per_number = #{perNumber}</if>
+            <if test="minNumber != null "> AND min_number = #{minNumber}</if>
+            <if test="maxNumber != null "> AND max_number = #{maxNumber}</if>
+            <if test="maxBranchNumber != null "> AND max_branch_number = #{maxBranchNumber}</if>
+            <if test="palletStandard != null  and palletStandard != ''"> AND pallet_standard = #{palletStandard}</if>
+            <if test="palletType != null  and palletType != ''"> AND pallet_type = #{palletType}</if>
+            <if test="areaType != null  and areaType != ''"> AND area_type = #{areaType}</if>
+            <if test="unit != null  and unit != ''"> AND unit = #{unit}</if>
+            <if test="deliveryStatus != null  and deliveryStatus != ''"> AND delivery_status = #{deliveryStatus}</if>
+            <if test="outboxHeight != null "> AND outbox_height = #{outboxHeight}</if>
+        </trim>
+    </select>
+
+    <delete id="physicalDelete">
+        DELETE FROM biz_company_product_package
+        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
+            <if test="id != null">
+                id = #{id} AND
+            </if>
+       <!-- 删除条件为其他外键可以在这里加 -->
+        </trim>
+    </delete>
+</mapper>