This commit is contained in:
linfso 2024-11-29 13:29:02 +08:00
parent 1208a28151
commit a639c38a46
6 changed files with 676 additions and 0 deletions

View File

@ -0,0 +1,134 @@
/**
* @Project: emis
* @Title: EmisOmsSupplierController.java
* @author linfso
* @date 2024-11-29 05:20:05
* @Copyright: ShangHai Duta 2022 All rights reserved.
* @version v1.0
* @Description: <p> 客户供应商表 控制器 </p>
*/
package com.xdadan.erp.oms.web;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.xdadan.erp.oms.common.annotation.Log;
import com.xdadan.erp.oms.common.core.controller.BaseController;
import com.xdadan.erp.oms.common.core.domain.AjaxResult;
import com.xdadan.erp.oms.common.core.page.TableDataInfo;
import com.xdadan.erp.oms.common.enums.BusinessType;
import com.xdadan.erp.oms.common.utils.poi.ExcelUtil;
import com.xdadan.erp.oms.domain.EmisOmsSupplier;
import com.xdadan.erp.oms.service.IEmisOmsSupplierService;
import org.springframework.beans.factory.annotation.Autowired;
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;
/**
* 客户供应商表Controller
*
* @author linfso
* @date 2024-11-29 05:20:05
*/
@RestController
@RequestMapping("/oms2c/emisOmsSupplier")
public class Oms2cOmsSupplierController extends BaseController
{
@Autowired
private IEmisOmsSupplierService emisOmsSupplierService;
/**
* 查询客户供应商表列表
*/
// @PreAuthorize("@ss.hasPermi('emis:emisOmsSupplier:list')")
@GetMapping("/list")
public TableDataInfo list(EmisOmsSupplier emisOmsSupplier)
{
startPage();
emisOmsSupplier.setOmsUserId(getUserId());
List<EmisOmsSupplier> list = emisOmsSupplierService.selectEmisOmsSupplierList(emisOmsSupplier);
return getDataTable(list);
}
/**
* 检查是否重复
*
* @param emisOmsSupplier
* @return 数量
*/
// @PreAuthorize("@ss.hasPermi('emis:emisOmsSupplier:list')")
@GetMapping("/checkUnique")
public AjaxResult checkUnique(EmisOmsSupplier emisOmsSupplier)
{
int cnt=emisOmsSupplierService.checkUnique(emisOmsSupplier);
return AjaxResult.success("检查成功",cnt);
}
/**
* 导出客户供应商表列表
*/
@PreAuthorize("@ss.hasPermi('emis:emisOmsSupplier:export')")
@Log(title = "客户供应商表", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, EmisOmsSupplier emisOmsSupplier)
{
List<EmisOmsSupplier> list = emisOmsSupplierService.selectEmisOmsSupplierList(emisOmsSupplier);
ExcelUtil<EmisOmsSupplier> util = new ExcelUtil<EmisOmsSupplier>(EmisOmsSupplier.class);
util.exportExcel(response, list, "客户供应商表数据");
}
/**
* 获取客户供应商表详细信息
*/
// @PreAuthorize("@ss.hasPermi('emis:emisOmsSupplier:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(emisOmsSupplierService.selectEmisOmsSupplierById(id));
}
/**
* 新增客户供应商表
*/
// @PreAuthorize("@ss.hasPermi('emis:emisOmsSupplier:add')")
@Log(title = "客户供应商表", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody EmisOmsSupplier emisOmsSupplier)
{
emisOmsSupplier.setOmsUserId(getUserId());
return toAjax(emisOmsSupplierService.insertEmisOmsSupplier(emisOmsSupplier));
}
/**
* 修改客户供应商表
*/
// @PreAuthorize("@ss.hasPermi('emis:emisOmsSupplier:edit')")
@Log(title = "客户供应商表", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody EmisOmsSupplier emisOmsSupplier)
{
return toAjax(emisOmsSupplierService.updateEmisOmsSupplier(emisOmsSupplier));
}
/**
* 删除客户供应商表
*/
// @PreAuthorize("@ss.hasPermi('emis:emisOmsSupplier:remove')")
@Log(title = "客户供应商表", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(emisOmsSupplierService.deleteEmisOmsSupplierByIds(ids));
}
}

View File

@ -0,0 +1,64 @@
/**
* @Project: emis
* @Title: EmisOmsSupplier.java
* @author linfso
* @date 2024-11-29 05:20:05
* @Copyright: ShangHai Duta 2022 All rights reserved.
* @version v1.0
* @Description: <p> 客户供应商表 实体类 </p>
*/
package com.xdadan.erp.oms.domain;
import com.xdadan.erp.oms.common.core.domain.BaseEntity;
import lombok.Data;
/**
* @ClassName EmisOmsSupplier
* @Description 客户供应商表
* @author linfso
* @date 2024-11-29 05:20:05
*/
@Data
public class EmisOmsSupplier extends BaseEntity
{
private static final long serialVersionUID = 1L;
/* id */
private Long id;
/* oms用户id */
private Long omsUserId;
/* 供应商名称 */
private String name;
/* 英文名称 */
private String nameEn;
/* 公司名称 */
private String companyName;
/* 公司类型 */
private String companyType;
/* 营业执照号 */
private String licenceNo;
/* 所在国 */
private String country;
/* 所在省 */
private String province;
/* 所在市 */
private String city;
/* 所在区 */
private String district;
/* 地址 */
private String address;
/* 公司电话 */
private String tel;
/* 电子邮件 */
private String email;
/* 联系人 */
private String contact;
/* 联系电话 */
private String phone;
/* 状态 */
private Integer status;
}

View File

@ -0,0 +1,81 @@
/**
* @Project: emis
* @Title: EmisOmsSupplierMapper.java
* @author linfso
* @date 2024-11-29 05:20:05
* @Copyright: ShangHai Doitinfo 2022 All rights reserved.
* @version v1.0
* @Description: <p> 客户供应商表 Mapper 接口 </p>
* <span style='color:red'> Warning : This file is generate by ai tools,don't edit!!! </span>
*/
package com.xdadan.erp.oms.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xdadan.erp.oms.domain.EmisOmsSupplier;
import java.util.List;
/**
* @ClassName EmisOmsSupplierMapper
* @Description <p> 客户供应商表 Mapper 接口 </p>
* @author linfso
* @date 2024-11-29 05:20:05
*/
public interface EmisOmsSupplierMapper extends BaseMapper<EmisOmsSupplier>
{
/**
* 主键查询
* @param id
* @return
*/
public EmisOmsSupplier selectEmisOmsSupplierById(Long id);
/**
* 查询列表
*
* @param emisOmsSupplier
* @return 集合
*/
public List<EmisOmsSupplier> selectEmisOmsSupplierList(EmisOmsSupplier emisOmsSupplier);
/**
* 检查是否重复
*
* @param emisOmsSupplier
* @return 数量
*/
public int checkUnique(EmisOmsSupplier emisOmsSupplier);
/**
* 新增
*
* @param emisOmsSupplier
* @return
*/
public int insertEmisOmsSupplier(EmisOmsSupplier emisOmsSupplier);
/**
* 修改
*
* @param emisOmsSupplier
* @return
*/
public int updateEmisOmsSupplier(EmisOmsSupplier emisOmsSupplier);
/**
* 删除
*
* @param id 主键
* @return 结果
*/
public int deleteEmisOmsSupplierById(Long id);
/**
* 批量删除
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteEmisOmsSupplierByIds(Long[] ids);
}

View File

@ -0,0 +1,79 @@
/**
* @Project: emis
* @Title: EmisOmsSupplierService.java
* @author linfso
* @date 2024-11-29 05:20:05
* @Copyright: ShangHai Duta 2022 All rights reserved.
* @version v1.0
* @Description: <p> 客户供应商表 服务类接口 </p>
*/
package com.xdadan.erp.oms.service;
import com.xdadan.erp.oms.domain.EmisOmsSupplier;
import java.util.List;
/**
* @ClassName EmisOmsSupplierService
* @Description 客户供应商表
* @author linfso
* @date 2024-11-29 05:20:05
*/
public interface IEmisOmsSupplierService
{
/**
* 主键查询
* @param id
* @return
*/
public EmisOmsSupplier selectEmisOmsSupplierById(Long id);
/**
* 查询客户供应商表列表
*
* @param emisOmsSupplier 客户供应商表
* @return 客户供应商表集合
*/
public List<EmisOmsSupplier> selectEmisOmsSupplierList(EmisOmsSupplier emisOmsSupplier);
/**
* 检查是否重复
*
* @param emisOmsSupplier
* @return 数量
*/
public int checkUnique(EmisOmsSupplier emisOmsSupplier);
/**
* 新增客户供应商表
*
* @param emisOmsSupplier 客户供应商表
* @return 结果
*/
public int insertEmisOmsSupplier(EmisOmsSupplier emisOmsSupplier);
/**
* 修改客户供应商表
*
* @param emisOmsSupplier 客户供应商表
* @return 结果
*/
public int updateEmisOmsSupplier(EmisOmsSupplier emisOmsSupplier);
/**
* 批量删除客户供应商表
*
* @param ids 需要删除的客户供应商表主键集合
* @return 结果
*/
public int deleteEmisOmsSupplierByIds(Long[] ids);
/**
* 删除客户供应商表信息
*
* @param id 客户供应商表主键
* @return 结果
*/
public int deleteEmisOmsSupplierById(Long id);
}

View File

@ -0,0 +1,118 @@
/**
* @Project: emis
* @Title: EmisOmsSupplierServiceImpl.java
* @author linfso
* @date 2024-11-29 05:20:05
* @Copyright: ShangHai Duta 2022 All rights reserved.
* @version v1.0
* @Description: <p> 客户供应商表 实体类 </p>
*/
package com.xdadan.erp.oms.service.impl;
import java.util.List;
import com.xdadan.erp.oms.domain.EmisOmsSupplier;
import com.xdadan.erp.oms.mapper.EmisOmsSupplierMapper;
import com.xdadan.erp.oms.service.IEmisOmsSupplierService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* 客户供应商表Service业务层处理
*
* @author linfso
* @date 2024-11-29 05:20:05
*/
@Service
public class EmisOmsSupplierServiceImpl implements IEmisOmsSupplierService
{
@Autowired
private EmisOmsSupplierMapper emisOmsSupplierMapper;
/**
* 查询客户供应商表
*
* @param id 客户供应商表主键
* @return 客户供应商表
*/
@Override
public EmisOmsSupplier selectEmisOmsSupplierById(Long id)
{
return emisOmsSupplierMapper.selectEmisOmsSupplierById(id);
}
/**
* 查询客户供应商表列表
*
* @param emisOmsSupplier 客户供应商表
* @return 客户供应商表
*/
@Override
public List<EmisOmsSupplier> selectEmisOmsSupplierList(EmisOmsSupplier emisOmsSupplier)
{
return emisOmsSupplierMapper.selectEmisOmsSupplierList(emisOmsSupplier);
}
/**
* 检查是否重复
*
* @param emisOmsSupplier
* @return 数量
*/
@Override
public int checkUnique(EmisOmsSupplier emisOmsSupplier)
{
return emisOmsSupplierMapper.checkUnique(emisOmsSupplier);
}
/**
* 新增客户供应商表
*
* @param emisOmsSupplier 客户供应商表
* @return 结果
*/
@Override
public int insertEmisOmsSupplier(EmisOmsSupplier emisOmsSupplier)
{
return emisOmsSupplierMapper.insertEmisOmsSupplier(emisOmsSupplier);
}
/**
* 修改客户供应商表
*
* @param emisOmsSupplier 客户供应商表
* @return 结果
*/
@Override
public int updateEmisOmsSupplier(EmisOmsSupplier emisOmsSupplier)
{
return emisOmsSupplierMapper.updateEmisOmsSupplier(emisOmsSupplier);
}
/**
* 批量删除客户供应商表
*
* @param ids 需要删除的客户供应商表主键
* @return 结果
*/
@Override
public int deleteEmisOmsSupplierByIds(Long[] ids)
{
return emisOmsSupplierMapper.deleteEmisOmsSupplierByIds(ids);
}
/**
* 删除客户供应商表信息
*
* @param id 客户供应商表主键
* @return 结果
*/
@Override
public int deleteEmisOmsSupplierById(Long id)
{
return emisOmsSupplierMapper.deleteEmisOmsSupplierById(id);
}
}

View File

@ -0,0 +1,200 @@
<?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="com.xdadan.erp.oms.mapper.EmisOmsSupplierMapper">
<resultMap type="EmisOmsSupplier" id="EmisOmsSupplierResult">
<result property="id" column="id" />
<result property="omsUserId" column="oms_user_id" />
<result property="name" column="name" />
<result property="nameEn" column="name_en" />
<result property="companyName" column="company_name" />
<result property="companyType" column="company_type" />
<result property="licenceNo" column="licence_no" />
<result property="country" column="country" />
<result property="province" column="province" />
<result property="city" column="city" />
<result property="district" column="district" />
<result property="address" column="address" />
<result property="tel" column="tel" />
<result property="email" column="email" />
<result property="contact" column="contact" />
<result property="phone" column="phone" />
<result property="status" column="status" />
</resultMap>
<sql id="selectEmisOmsSupplierVo">
select id, oms_user_id, name, name_en, company_name, company_type, licence_no, country, province, city, district, address, tel, email, contact, phone, status, remark, del_flag, create_by, create_time, update_by, update_time, create_site, update_site from emis_oms_supplier
</sql>
<select id="selectEmisOmsSupplierList" parameterType="EmisOmsSupplier" resultMap="EmisOmsSupplierResult">
<include refid="selectEmisOmsSupplierVo"/>
<where>
del_flag='0'
<if test="id != null "> and id = #{id}</if>
<if test="omsUserId != null "> and oms_user_id = #{omsUserId}</if>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="nameEn != null and nameEn != ''"> and name_en like concat('%', #{nameEn}, '%')</if>
<if test="companyName != null and companyName != ''"> and company_name like concat('%', #{companyName}, '%')</if>
<if test="companyType != null and companyType != ''"> and company_type like concat('%', #{companyType}, '%')</if>
<if test="licenceNo != null and licenceNo != ''"> and licence_no like concat('%', #{licenceNo}, '%')</if>
<if test="country != null and country != ''"> and country like concat('%', #{country}, '%')</if>
<if test="province != null and province != ''"> and province like concat('%', #{province}, '%')</if>
<if test="city != null and city != ''"> and city like concat('%', #{city}, '%')</if>
<if test="district != null and district != ''"> and district like concat('%', #{district}, '%')</if>
<if test="address != null and address != ''"> and address like concat('%', #{address}, '%')</if>
<if test="tel != null and tel != ''"> and tel like concat('%', #{tel}, '%')</if>
<if test="email != null and email != ''"> and email like concat('%', #{email}, '%')</if>
<if test="contact != null and contact != ''"> and contact like concat('%', #{contact}, '%')</if>
<if test="phone != null and phone != ''"> and phone like concat('%', #{phone}, '%')</if>
<if test="status != null "> and status = #{status}</if>
<if test="remark != null and remark != ''"> and remark like concat('%', #{remark}, '%')</if>
<if test="delFlag != null and delFlag != ''"> and del_flag like concat('%', #{delFlag}, '%')</if>
<if test="createBy != null and createBy != ''"> and create_by like concat('%', #{createBy}, '%')</if>
<if test="createTime != null "> and create_time = #{createTime}</if>
<if test="updateBy != null and updateBy != ''"> and update_by like concat('%', #{updateBy}, '%')</if>
<if test="updateTime != null "> and update_time = #{updateTime}</if>
<if test="createSite != null and createSite != ''"> and create_site like concat('%', #{createSite}, '%')</if>
<if test="updateSite != null and updateSite != ''"> and update_site like concat('%', #{updateSite}, '%')</if>
</where>
order by create_time desc
</select>
<select id="checkUnique" parameterType="EmisOmsSupplier" resultType="int">
select count(1) from emis_oms_supplier
where del_flag='0'
and id = #{id}
and oms_user_id = #{omsUserId}
and name = #{name}
and name_en = #{nameEn}
and company_name = #{companyName}
and company_type = #{companyType}
and licence_no = #{licenceNo}
and country = #{country}
and province = #{province}
and city = #{city}
and district = #{district}
and address = #{address}
and tel = #{tel}
and email = #{email}
and contact = #{contact}
and phone = #{phone}
and status = #{status}
and remark = #{remark}
and del_flag = #{delFlag}
and create_by = #{createBy}
and create_time = #{createTime}
and update_by = #{updateBy}
and update_time = #{updateTime}
and create_site = #{createSite}
and update_site = #{updateSite}
limit 1
</select>
<select id="selectEmisOmsSupplierById" parameterType="Long" resultMap="EmisOmsSupplierResult">
select id, oms_user_id, name, name_en, company_name, company_type, licence_no, country, province, city, district, address, tel, email, contact, phone, status, remark, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
from emis_oms_supplier a
where a.id = #{id}
</select>
<insert id="insertEmisOmsSupplier" parameterType="EmisOmsSupplier" useGeneratedKeys="true" keyProperty="id">
insert into emis_oms_supplier
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="omsUserId != null">oms_user_id,</if>
<if test="name != null and name != ''">name,</if>
<if test="nameEn != null and nameEn != ''">name_en,</if>
<if test="companyName != null and companyName != ''">company_name,</if>
<if test="companyType != null and companyType != ''">company_type,</if>
<if test="licenceNo != null and licenceNo != ''">licence_no,</if>
<if test="country != null and country != ''">country,</if>
<if test="province != null and province != ''">province,</if>
<if test="city != null and city != ''">city,</if>
<if test="district != null and district != ''">district,</if>
<if test="address != null and address != ''">address,</if>
<if test="tel != null and tel != ''">tel,</if>
<if test="email != null and email != ''">email,</if>
<if test="contact != null and contact != ''">contact,</if>
<if test="phone != null and phone != ''">phone,</if>
<if test="status != null">status,</if>
<if test="remark != null and remark != ''">remark,</if>
<if test="delFlag != null and delFlag != ''">del_flag,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null and updateBy != ''">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="createSite != null and createSite != ''">create_site,</if>
<if test="updateSite != null and updateSite != ''">update_site,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="omsUserId != null">#{omsUserId},</if>
<if test="name != null and name != ''">#{name},</if>
<if test="nameEn != null and nameEn != ''">#{nameEn},</if>
<if test="companyName != null and companyName != ''">#{companyName},</if>
<if test="companyType != null and companyType != ''">#{companyType},</if>
<if test="licenceNo != null and licenceNo != ''">#{licenceNo},</if>
<if test="country != null and country != ''">#{country},</if>
<if test="province != null and province != ''">#{province},</if>
<if test="city != null and city != ''">#{city},</if>
<if test="district != null and district != ''">#{district},</if>
<if test="address != null and address != ''">#{address},</if>
<if test="tel != null and tel != ''">#{tel},</if>
<if test="email != null and email != ''">#{email},</if>
<if test="contact != null and contact != ''">#{contact},</if>
<if test="phone != null and phone != ''">#{phone},</if>
<if test="status != null">#{status},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="createSite != null and createSite != ''">#{createSite},</if>
<if test="updateSite != null and updateSite != ''">#{updateSite},</if>
</trim>
</insert>
<update id="updateEmisOmsSupplier" parameterType="EmisOmsSupplier">
update emis_oms_supplier
<trim prefix="SET" suffixOverrides=",">
<if test="omsUserId != null">oms_user_id = #{omsUserId},</if>
<if test="name != null and name != ''">name = #{name},</if>
<if test="nameEn != null and nameEn != ''">name_en = #{nameEn},</if>
<if test="companyName != null and companyName != ''">company_name = #{companyName},</if>
<if test="companyType != null and companyType != ''">company_type = #{companyType},</if>
<if test="licenceNo != null and licenceNo != ''">licence_no = #{licenceNo},</if>
<if test="country != null and country != ''">country = #{country},</if>
<if test="province != null and province != ''">province = #{province},</if>
<if test="city != null and city != ''">city = #{city},</if>
<if test="district != null and district != ''">district = #{district},</if>
<if test="address != null and address != ''">address = #{address},</if>
<if test="tel != null and tel != ''">tel = #{tel},</if>
<if test="email != null and email != ''">email = #{email},</if>
<if test="contact != null and contact != ''">contact = #{contact},</if>
<if test="phone != null and phone != ''">phone = #{phone},</if>
<if test="status != null">status = #{status},</if>
<if test="remark != null and remark != ''">remark = #{remark},</if>
<if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="createSite != null and createSite != ''">create_site = #{createSite},</if>
<if test="updateSite != null and updateSite != ''">update_site = #{updateSite},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteEmisOmsSupplierById" parameterType="Long">
delete from emis_oms_supplier where id = #{id}
</delete>
<delete id="deleteEmisOmsSupplierByIds" parameterType="String">
delete from emis_oms_supplier where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>