feat(供应商管理): 初始化

This commit is contained in:
LJW 2024-11-20 14:59:34 +08:00
parent bdb4ffc47f
commit cf4cbc8365
6 changed files with 624 additions and 0 deletions

View File

@ -0,0 +1,121 @@
<?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.ktg.mes.wm.mapper.WmsSupplierMapper">
<resultMap type="WmsSupplier" id="WmsSupplierResult">
<result property="id" column="ID" />
<result property="supplierName" column="SUPPLIER_NAME" />
<result property="supplierTypeName" column="SUPPLIER_TYPE_NAME" />
<result property="supplierTypeCode" column="SUPPLIER_TYPE_CODE" />
<result property="contactName" column="CONTACT_NAME" />
<result property="contactPhone" column="CONTACT_PHONE" />
<result property="contactEmail" column="CONTACT_EMAIL" />
<result property="contactAddress" column="CONTACT_ADDRESS" />
<result property="region" column="REGION" />
<result property="website" column="WEBSITE" />
<result property="createBy" column="CREATE_BY" />
<result property="createTime" column="CREATE_TIME" />
<result property="updateBy" column="UPDATE_BY" />
<result property="updateTime" column="UPDATE_TIME" />
<result property="isDelete" column="IS_DELETE" />
</resultMap>
<sql id="selectWmsSupplierVo">
select ID, SUPPLIER_NAME, SUPPLIER_TYPE_NAME, SUPPLIER_TYPE_CODE, CONTACT_NAME, CONTACT_PHONE, CONTACT_EMAIL, CONTACT_ADDRESS, REGION, WEBSITE, CREATE_BY, CREATE_TIME, UPDATE_BY, UPDATE_TIME, IS_DELETE from WMS_SUPPLIER
</sql>
<select id="selectWmsSupplierList" parameterType="WmsSupplier" resultMap="WmsSupplierResult">
<include refid="selectWmsSupplierVo"/>
<where>
<if test="supplierName != null and supplierName != ''"> and SUPPLIER_NAME like concat('%', #{supplierName}, '%')</if>
<if test="supplierTypeName != null and supplierTypeName != ''"> and SUPPLIER_TYPE_NAME like concat('%', #{supplierTypeName}, '%')</if>
<if test="supplierTypeCode != null and supplierTypeCode != ''"> and SUPPLIER_TYPE_CODE = #{supplierTypeCode}</if>
<if test="contactName != null and contactName != ''"> and CONTACT_NAME like concat('%', #{contactName}, '%')</if>
<if test="contactPhone != null and contactPhone != ''"> and CONTACT_PHONE = #{contactPhone}</if>
<if test="contactEmail != null and contactEmail != ''"> and CONTACT_EMAIL = #{contactEmail}</if>
<if test="contactAddress != null and contactAddress != ''"> and CONTACT_ADDRESS = #{contactAddress}</if>
<if test="region != null and region != ''"> and REGION = #{region}</if>
<if test="website != null and website != ''"> and WEBSITE = #{website}</if>
<if test="createBy != null and createBy != ''"> and CREATE_BY = #{createBy}</if>
<if test="createTime != null and createTime != ''"> and CREATE_TIME = #{createTime}</if>
<if test="updateBy != null and updateBy != ''"> and UPDATE_BY = #{updateBy}</if>
<if test="updateTime != null and updateTime != ''"> and UPDATE_TIME = #{updateTime}</if>
<if test="isDelete != null and isDelete != ''"> and IS_DELETE = #{isDelete}</if>
</where>
</select>
<select id="selectWmsSupplierById" parameterType="Long" resultMap="WmsSupplierResult">
<include refid="selectWmsSupplierVo"/>
where ID = #{id}
</select>
<insert id="insertWmsSupplier" parameterType="WmsSupplier" useGeneratedKeys="true" keyProperty="id">
insert into WMS_SUPPLIER
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="supplierName != null">SUPPLIER_NAME,</if>
<if test="supplierTypeName != null">SUPPLIER_TYPE_NAME,</if>
<if test="supplierTypeCode != null">SUPPLIER_TYPE_CODE,</if>
<if test="contactName != null">CONTACT_NAME,</if>
<if test="contactPhone != null">CONTACT_PHONE,</if>
<if test="contactEmail != null">CONTACT_EMAIL,</if>
<if test="contactAddress != null">CONTACT_ADDRESS,</if>
<if test="region != null">REGION,</if>
<if test="website != null">WEBSITE,</if>
<if test="createBy != null">CREATE_BY,</if>
<if test="createTime != null">CREATE_TIME,</if>
<if test="updateBy != null">UPDATE_BY,</if>
<if test="updateTime != null">UPDATE_TIME,</if>
<if test="isDelete != null">IS_DELETE,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="supplierName != null">#{supplierName},</if>
<if test="supplierTypeName != null">#{supplierTypeName},</if>
<if test="supplierTypeCode != null">#{supplierTypeCode},</if>
<if test="contactName != null">#{contactName},</if>
<if test="contactPhone != null">#{contactPhone},</if>
<if test="contactEmail != null">#{contactEmail},</if>
<if test="contactAddress != null">#{contactAddress},</if>
<if test="region != null">#{region},</if>
<if test="website != null">#{website},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="isDelete != null">#{isDelete},</if>
</trim>
</insert>
<update id="updateWmsSupplier" parameterType="WmsSupplier">
update WMS_SUPPLIER
<trim prefix="SET" suffixOverrides=",">
<if test="supplierName != null">SUPPLIER_NAME = #{supplierName},</if>
<if test="supplierTypeName != null">SUPPLIER_TYPE_NAME = #{supplierTypeName},</if>
<if test="supplierTypeCode != null">SUPPLIER_TYPE_CODE = #{supplierTypeCode},</if>
<if test="contactName != null">CONTACT_NAME = #{contactName},</if>
<if test="contactPhone != null">CONTACT_PHONE = #{contactPhone},</if>
<if test="contactEmail != null">CONTACT_EMAIL = #{contactEmail},</if>
<if test="contactAddress != null">CONTACT_ADDRESS = #{contactAddress},</if>
<if test="region != null">REGION = #{region},</if>
<if test="website != null">WEBSITE = #{website},</if>
<if test="createBy != null">CREATE_BY = #{createBy},</if>
<if test="createTime != null">CREATE_TIME = #{createTime},</if>
<if test="updateBy != null">UPDATE_BY = #{updateBy},</if>
<if test="updateTime != null">UPDATE_TIME = #{updateTime},</if>
<if test="isDelete != null">IS_DELETE = #{isDelete},</if>
</trim>
where ID = #{id}
</update>
<delete id="deleteWmsSupplierById" parameterType="Long">
delete from WMS_SUPPLIER where ID = #{id}
</delete>
<delete id="deleteWmsSupplierByIds" parameterType="String">
delete from WMS_SUPPLIER where ID in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,104 @@
package com.ktg.mes.wm.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
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 com.ktg.common.annotation.Log;
import com.ktg.common.core.controller.BaseController;
import com.ktg.common.core.domain.AjaxResult;
import com.ktg.common.enums.BusinessType;
import com.ktg.mes.wm.domain.WmsSupplier;
import com.ktg.mes.wm.service.IWmsSupplierService;
import com.ktg.common.utils.poi.ExcelUtil;
import com.ktg.common.core.page.TableDataInfo;
/**
* 供应商基础信息Controller
*
* @author yinjinlu
* @date 2024-11-20
*/
@RestController
@RequestMapping("/wm/wmsSupplier")
public class WmsSupplierController extends BaseController
{
@Autowired
private IWmsSupplierService wmsSupplierService;
/**
* 查询供应商基础信息列表
*/
@PreAuthorize("@ss.hasPermi('wm:wmsSupplier:list')")
@GetMapping("/list")
public TableDataInfo list(WmsSupplier wmsSupplier)
{
startPage();
List<WmsSupplier> list = wmsSupplierService.selectWmsSupplierList(wmsSupplier);
return getDataTable(list);
}
/**
* 导出供应商基础信息列表
*/
@PreAuthorize("@ss.hasPermi('wm:wmsSupplier:export')")
@Log(title = "供应商基础信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, WmsSupplier wmsSupplier)
{
List<WmsSupplier> list = wmsSupplierService.selectWmsSupplierList(wmsSupplier);
ExcelUtil<WmsSupplier> util = new ExcelUtil<WmsSupplier>(WmsSupplier.class);
util.exportExcel(response, list, "供应商基础信息数据");
}
/**
* 获取供应商基础信息详细信息
*/
@PreAuthorize("@ss.hasPermi('wm:wmsSupplier:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(wmsSupplierService.selectWmsSupplierById(id));
}
/**
* 新增供应商基础信息
*/
@PreAuthorize("@ss.hasPermi('wm:wmsSupplier:add')")
@Log(title = "供应商基础信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody WmsSupplier wmsSupplier)
{
return toAjax(wmsSupplierService.insertWmsSupplier(wmsSupplier));
}
/**
* 修改供应商基础信息
*/
@PreAuthorize("@ss.hasPermi('wm:wmsSupplier:edit')")
@Log(title = "供应商基础信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody WmsSupplier wmsSupplier)
{
return toAjax(wmsSupplierService.updateWmsSupplier(wmsSupplier));
}
/**
* 删除供应商基础信息
*/
@PreAuthorize("@ss.hasPermi('wm:wmsSupplier:remove')")
@Log(title = "供应商基础信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(wmsSupplierService.deleteWmsSupplierByIds(ids));
}
}

View File

@ -0,0 +1,181 @@
package com.ktg.mes.wm.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ktg.common.annotation.Excel;
import com.ktg.common.core.domain.BaseEntity;
/**
* 供应商基础信息对象 WMS_SUPPLIER
*
* @author yinjinlu
* @date 2024-11-20
*/
public class WmsSupplier extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
private Long id;
/** 供应商名称 */
@Excel(name = "供应商名称")
private String supplierName;
/** 供应商类型名称 */
@Excel(name = "供应商类型名称")
private String supplierTypeName;
/** 供应商类型编码 */
@Excel(name = "供应商类型编码")
private String supplierTypeCode;
/** 主要联系人姓名 */
@Excel(name = "主要联系人姓名")
private String contactName;
/** 联系人电话 */
@Excel(name = "联系人电话")
private String contactPhone;
/** 联系人电子邮箱 */
@Excel(name = "联系人电子邮箱")
private String contactEmail;
/** 联系地址 */
@Excel(name = "联系地址")
private String contactAddress;
/** 供应商所在地理位置/地区 */
@Excel(name = "供应商所在地理位置/地区")
private String region;
/** 供应商公司官网 */
@Excel(name = "供应商公司官网")
private String website;
/** $column.columnComment */
@Excel(name = "供应商公司官网")
private String isDelete;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setSupplierName(String supplierName)
{
this.supplierName = supplierName;
}
public String getSupplierName()
{
return supplierName;
}
public void setSupplierTypeName(String supplierTypeName)
{
this.supplierTypeName = supplierTypeName;
}
public String getSupplierTypeName()
{
return supplierTypeName;
}
public void setSupplierTypeCode(String supplierTypeCode)
{
this.supplierTypeCode = supplierTypeCode;
}
public String getSupplierTypeCode()
{
return supplierTypeCode;
}
public void setContactName(String contactName)
{
this.contactName = contactName;
}
public String getContactName()
{
return contactName;
}
public void setContactPhone(String contactPhone)
{
this.contactPhone = contactPhone;
}
public String getContactPhone()
{
return contactPhone;
}
public void setContactEmail(String contactEmail)
{
this.contactEmail = contactEmail;
}
public String getContactEmail()
{
return contactEmail;
}
public void setContactAddress(String contactAddress)
{
this.contactAddress = contactAddress;
}
public String getContactAddress()
{
return contactAddress;
}
public void setRegion(String region)
{
this.region = region;
}
public String getRegion()
{
return region;
}
public void setWebsite(String website)
{
this.website = website;
}
public String getWebsite()
{
return website;
}
public void setIsDelete(String isDelete)
{
this.isDelete = isDelete;
}
public String getIsDelete()
{
return isDelete;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("supplierName", getSupplierName())
.append("supplierTypeName", getSupplierTypeName())
.append("supplierTypeCode", getSupplierTypeCode())
.append("contactName", getContactName())
.append("contactPhone", getContactPhone())
.append("contactEmail", getContactEmail())
.append("contactAddress", getContactAddress())
.append("region", getRegion())
.append("website", getWebsite())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("isDelete", getIsDelete())
.toString();
}
}

View File

@ -0,0 +1,61 @@
package com.ktg.mes.wm.mapper;
import java.util.List;
import com.ktg.mes.wm.domain.WmsSupplier;
/**
* 供应商基础信息Mapper接口
*
* @author yinjinlu
* @date 2024-11-20
*/
public interface WmsSupplierMapper
{
/**
* 查询供应商基础信息
*
* @param id 供应商基础信息主键
* @return 供应商基础信息
*/
public WmsSupplier selectWmsSupplierById(Long id);
/**
* 查询供应商基础信息列表
*
* @param wmsSupplier 供应商基础信息
* @return 供应商基础信息集合
*/
public List<WmsSupplier> selectWmsSupplierList(WmsSupplier wmsSupplier);
/**
* 新增供应商基础信息
*
* @param wmsSupplier 供应商基础信息
* @return 结果
*/
public int insertWmsSupplier(WmsSupplier wmsSupplier);
/**
* 修改供应商基础信息
*
* @param wmsSupplier 供应商基础信息
* @return 结果
*/
public int updateWmsSupplier(WmsSupplier wmsSupplier);
/**
* 删除供应商基础信息
*
* @param id 供应商基础信息主键
* @return 结果
*/
public int deleteWmsSupplierById(Long id);
/**
* 批量删除供应商基础信息
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteWmsSupplierByIds(Long[] ids);
}

View File

@ -0,0 +1,61 @@
package com.ktg.mes.wm.service;
import java.util.List;
import com.ktg.mes.wm.domain.WmsSupplier;
/**
* 供应商基础信息Service接口
*
* @author yinjinlu
* @date 2024-11-20
*/
public interface IWmsSupplierService
{
/**
* 查询供应商基础信息
*
* @param id 供应商基础信息主键
* @return 供应商基础信息
*/
public WmsSupplier selectWmsSupplierById(Long id);
/**
* 查询供应商基础信息列表
*
* @param wmsSupplier 供应商基础信息
* @return 供应商基础信息集合
*/
public List<WmsSupplier> selectWmsSupplierList(WmsSupplier wmsSupplier);
/**
* 新增供应商基础信息
*
* @param wmsSupplier 供应商基础信息
* @return 结果
*/
public int insertWmsSupplier(WmsSupplier wmsSupplier);
/**
* 修改供应商基础信息
*
* @param wmsSupplier 供应商基础信息
* @return 结果
*/
public int updateWmsSupplier(WmsSupplier wmsSupplier);
/**
* 批量删除供应商基础信息
*
* @param ids 需要删除的供应商基础信息主键集合
* @return 结果
*/
public int deleteWmsSupplierByIds(Long[] ids);
/**
* 删除供应商基础信息信息
*
* @param id 供应商基础信息主键
* @return 结果
*/
public int deleteWmsSupplierById(Long id);
}

View File

@ -0,0 +1,96 @@
package com.ktg.mes.wm.service.impl;
import java.util.List;
import com.ktg.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ktg.mes.wm.mapper.WmsSupplierMapper;
import com.ktg.mes.wm.domain.WmsSupplier;
import com.ktg.mes.wm.service.IWmsSupplierService;
/**
* 供应商基础信息Service业务层处理
*
* @author yinjinlu
* @date 2024-11-20
*/
@Service
public class WmsSupplierServiceImpl implements IWmsSupplierService
{
@Autowired
private WmsSupplierMapper wmsSupplierMapper;
/**
* 查询供应商基础信息
*
* @param id 供应商基础信息主键
* @return 供应商基础信息
*/
@Override
public WmsSupplier selectWmsSupplierById(Long id)
{
return wmsSupplierMapper.selectWmsSupplierById(id);
}
/**
* 查询供应商基础信息列表
*
* @param wmsSupplier 供应商基础信息
* @return 供应商基础信息
*/
@Override
public List<WmsSupplier> selectWmsSupplierList(WmsSupplier wmsSupplier)
{
return wmsSupplierMapper.selectWmsSupplierList(wmsSupplier);
}
/**
* 新增供应商基础信息
*
* @param wmsSupplier 供应商基础信息
* @return 结果
*/
@Override
public int insertWmsSupplier(WmsSupplier wmsSupplier)
{
wmsSupplier.setCreateTime(DateUtils.getNowDate());
return wmsSupplierMapper.insertWmsSupplier(wmsSupplier);
}
/**
* 修改供应商基础信息
*
* @param wmsSupplier 供应商基础信息
* @return 结果
*/
@Override
public int updateWmsSupplier(WmsSupplier wmsSupplier)
{
wmsSupplier.setUpdateTime(DateUtils.getNowDate());
return wmsSupplierMapper.updateWmsSupplier(wmsSupplier);
}
/**
* 批量删除供应商基础信息
*
* @param ids 需要删除的供应商基础信息主键
* @return 结果
*/
@Override
public int deleteWmsSupplierByIds(Long[] ids)
{
return wmsSupplierMapper.deleteWmsSupplierByIds(ids);
}
/**
* 删除供应商基础信息信息
*
* @param id 供应商基础信息主键
* @return 结果
*/
@Override
public int deleteWmsSupplierById(Long id)
{
return wmsSupplierMapper.deleteWmsSupplierById(id);
}
}