ezhizao_zx 9 ay önce
ebeveyn
işleme
090cac9e67

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

@@ -0,0 +1,109 @@
+package cn.ezhizao.project.business.company.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.company.domain.BizCompany;
+import cn.ezhizao.project.business.company.service.IBizCompanyService;
+
+/**
+ * 客户名称Controller
+ *
+ * @author ezhizao
+ * @date 2024-09-12
+ */
+@RestController
+@RequestMapping("/business/company")
+public class BizCompanyController extends BaseController
+{
+    @Resource
+    private IBizCompanyService bizCompanyService;
+
+    /**
+     * 查询客户名称列表
+     */
+    @PreAuthorize("@ss.hasPermi('business:company:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(BizCompany bizCompany) throws NoSuchFieldException, IllegalAccessException
+    {
+        setTenantId(bizCompany);
+        startPage();
+        List<BizCompany> list = bizCompanyService.getList(bizCompany);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出客户名称列表
+     */
+    @PreAuthorize("@ss.hasPermi('business:company:export')")
+    @Log(title = "客户名称", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, BizCompany bizCompany) throws NoSuchFieldException, IllegalAccessException
+    {
+        setTenantId(bizCompany);
+        List<BizCompany> list = bizCompanyService.getList(bizCompany);
+        ExcelUtil<BizCompany> util = new ExcelUtil<BizCompany>(BizCompany.class);
+        util.exportExcel(response, list, "客户名称数据");
+    }
+
+    /**
+     * 获取客户名称详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('business:company:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(bizCompanyService.getById(id));
+    }
+
+    /**
+     * 新增客户名称
+     */
+    @PreAuthorize("@ss.hasPermi('business:company:add')")
+    @Log(title = "客户名称", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody BizCompany bizCompany) throws NoSuchFieldException, IllegalAccessException
+    {
+        setTenantId(bizCompany);
+        return toAjax(bizCompanyService.save(bizCompany));
+    }
+
+    /**
+     * 修改客户名称
+     */
+    @PreAuthorize("@ss.hasPermi('business:company:edit')")
+    @Log(title = "客户名称", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody BizCompany bizCompany) throws NoSuchFieldException, IllegalAccessException
+    {
+        setTenantId(bizCompany);
+        return toAjax(bizCompanyService.updateById(bizCompany));
+    }
+
+    /**
+     * 删除客户名称
+     */
+    @PreAuthorize("@ss.hasPermi('business:company:remove')")
+    @Log(title = "客户名称", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable List<Long> ids)
+    {
+        return toAjax(bizCompanyService.removeBatchByIds(ids));
+    }
+}

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

@@ -0,0 +1,59 @@
+package cn.ezhizao.project.business.company.domain;
+
+import cn.ezhizao.framework.aspectj.lang.annotation.Excel;
+import cn.ezhizao.framework.web.domain.BaseEntity;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * 客户名称对象 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;
+
+}

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

@@ -0,0 +1,29 @@
+package cn.ezhizao.project.business.company.mapper;
+
+import java.util.List;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import cn.ezhizao.project.business.company.domain.BizCompany;
+
+/**
+ * 客户名称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);
+}

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

@@ -0,0 +1,30 @@
+package cn.ezhizao.project.business.company.service;
+
+import java.util.List;
+import com.baomidou.mybatisplus.extension.service.IService;
+import cn.ezhizao.project.business.company.domain.BizCompany;
+
+/**
+ * 客户名称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);
+
+}

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

@@ -0,0 +1,43 @@
+package cn.ezhizao.project.business.company.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.company.mapper.BizCompanyMapper;
+import cn.ezhizao.project.business.company.domain.BizCompany;
+import cn.ezhizao.project.business.company.service.IBizCompanyService;
+
+/**
+ * 客户名称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); };
+
+}

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

@@ -4,6 +4,7 @@ import java.math.BigDecimal;
 
 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;
@@ -58,6 +59,10 @@ public class BizCompanyProductPackage extends BaseEntity
     @ApiModelProperty(value = "客户简称")
     private String companyAlias;
 
+    @Excel(name = "包装外键")
+    @ApiModelProperty(value = "包装外键")
+    private Long accessoriesId;
+
     /** 包装箱辅料编码 */
     @Excel(name = "包装箱辅料编码")
     @ApiModelProperty(value = "包装箱辅料编码")
@@ -152,4 +157,7 @@ public class BizCompanyProductPackage extends BaseEntity
     @ApiModelProperty(value = "外箱高度")
     private Long tenantId;
 
+    @TableField(exist = true)
+    private String remark;
+
 }

+ 2 - 2
src/main/resources/mybatis/business/accessories/BizAccessoriesMapper.xml

@@ -13,10 +13,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         SELECT * FROM biz_accessories
         <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
             deleted = 0
-            <if test="accessoriesCode != null  and accessoriesCode != ''"> AND accessories_code = #{accessoriesCode}</if>
+            <if test="accessoriesCode != null  and accessoriesCode != ''"> AND accessories_code like concat('%',#{accessoriesCode},'%')</if>
             <if test="itype != null  and itype != ''"> AND itype = #{itype}</if>
             <if test="cusven != null  and cusven != ''"> AND cusven = #{cusven}</if>
-            <if test="description != null  and description != ''"> AND description = #{description}</if>
+            <if test="description != null  and description != ''"> AND description like concat('%',#{description},'%')</if>
             <if test="unit != null  and unit != ''"> AND unit = #{unit}</if>
             <if test="cruser != null  and cruser != ''"> AND cruser = #{cruser}</if>
             <if test="mddate != null "> AND mddate = #{mddate}</if>

+ 34 - 0
src/main/resources/mybatis/business/company/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.company.mapper.BizCompanyMapper">
+
+    <resultMap type="cn.ezhizao.project.business.company.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>

+ 3 - 3
src/main/resources/mybatis/business/companyProductPackage/BizCompanyProductPackageMapper.xml

@@ -14,12 +14,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <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 = #{companyCode}</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 = #{productDescription}</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 = #{packageCode}</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>