收货地址

This commit is contained in:
sxu 2024-12-16 11:00:02 +08:00
parent 40fe03f1b4
commit 19ff2c9619
7 changed files with 474 additions and 3 deletions

View File

@ -0,0 +1,119 @@
package com.bonus.material.basic.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.bonus.common.log.enums.OperaType;
import com.bonus.material.common.annotation.PreventRepeatSubmit;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
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.bonus.common.log.annotation.SysLog;
import com.bonus.common.security.annotation.RequiresPermissions;
import com.bonus.material.basic.domain.BmCompanyAddress;
import com.bonus.material.basic.service.IBmCompanyAddressService;
import com.bonus.common.core.web.controller.BaseController;
import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.common.core.utils.poi.ExcelUtil;
import com.bonus.common.core.web.page.TableDataInfo;
/**
* 企业信息Controller
*
* @author xsheng
* @date 2024-12-16
*/
@Api(tags = "企业信息接口")
@RestController
@RequestMapping("/bm_company_address")
public class BmCompanyAddressController extends BaseController {
@Autowired
private IBmCompanyAddressService bmCompanyAddressService;
/**
* 查询企业信息列表
*/
@ApiOperation(value = "查询企业信息列表")
@RequiresPermissions("basic:address:list")
@GetMapping("/list")
public TableDataInfo list(BmCompanyAddress bmCompanyAddress) {
startPage();
List<BmCompanyAddress> list = bmCompanyAddressService.selectBmCompanyAddressList(bmCompanyAddress);
return getDataTable(list);
}
/**
* 导出企业信息列表
*/
@ApiOperation(value = "导出企业信息列表")
@PreventRepeatSubmit
@RequiresPermissions("basic:address:export")
@SysLog(title = "企业信息", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出企业信息")
@PostMapping("/export")
public void export(HttpServletResponse response, BmCompanyAddress bmCompanyAddress) {
List<BmCompanyAddress> list = bmCompanyAddressService.selectBmCompanyAddressList(bmCompanyAddress);
ExcelUtil<BmCompanyAddress> util = new ExcelUtil<BmCompanyAddress>(BmCompanyAddress.class);
util.exportExcel(response, list, "企业信息数据");
}
/**
* 获取企业信息详细信息
*/
@ApiOperation(value = "获取企业信息详细信息")
@RequiresPermissions("basic:address:query")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return success(bmCompanyAddressService.selectBmCompanyAddressById(id));
}
/**
* 新增企业信息
*/
@ApiOperation(value = "新增企业信息")
@PreventRepeatSubmit
@RequiresPermissions("basic:address:add")
@SysLog(title = "企业信息", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增企业信息")
@PostMapping
public AjaxResult add(@RequestBody BmCompanyAddress bmCompanyAddress) {
try {
return toAjax(bmCompanyAddressService.insertBmCompanyAddress(bmCompanyAddress));
} catch (Exception e) {
return error("系统错误, " + e.getMessage());
}
}
/**
* 修改企业信息
*/
@ApiOperation(value = "修改企业信息")
@PreventRepeatSubmit
@RequiresPermissions("basic:address:edit")
@SysLog(title = "企业信息", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改企业信息")
@PostMapping("/edit")
public AjaxResult edit(@RequestBody BmCompanyAddress bmCompanyAddress) {
try {
return toAjax(bmCompanyAddressService.updateBmCompanyAddress(bmCompanyAddress));
} catch (Exception e) {
return error("系统错误, " + e.getMessage());
}
}
/**
* 删除企业信息
*/
@ApiOperation(value = "删除企业信息")
@PreventRepeatSubmit
@RequiresPermissions("basic:address:remove")
@SysLog(title = "企业信息", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除企业信息")
@PostMapping("/del/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(bmCompanyAddressService.deleteBmCompanyAddressByIds(ids));
}
}

View File

@ -0,0 +1,51 @@
package com.bonus.material.basic.domain;
import com.bonus.common.core.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import com.bonus.common.core.web.domain.BaseEntity;
/**
* 企业信息对象 bm_company_address
*
* @author xsheng
* @date 2024-12-16
*/
@Data
@ToString
public class BmCompanyAddress extends BaseEntity {
private static final long serialVersionUID = 1L;
/** id主键 */
private Long id;
/** dept_id */
@Excel(name = "dept_id")
@ApiModelProperty(value = "dept_id")
private Long companyId;
/** 需求所在省code */
@Excel(name = "需求所在省code")
@ApiModelProperty(value = "需求所在省code")
private Long provinceCode;
/** 需求所在市code */
@Excel(name = "需求所在市code")
@ApiModelProperty(value = "需求所在市code")
private Long cityCode;
/** 需求所在区code */
@Excel(name = "需求所在区code")
@ApiModelProperty(value = "需求所在区code")
private Long areaCode;
/** 企业名称 */
@Excel(name = "企业名称")
@ApiModelProperty(value = "企业名称")
private String address;
}

View File

@ -0,0 +1,60 @@
package com.bonus.material.basic.mapper;
import java.util.List;
import com.bonus.material.basic.domain.BmCompanyAddress;
/**
* 企业信息Mapper接口
*
* @author xsheng
* @date 2024-12-16
*/
public interface BmCompanyAddressMapper {
/**
* 查询企业信息
*
* @param id 企业信息主键
* @return 企业信息
*/
public BmCompanyAddress selectBmCompanyAddressById(Long id);
/**
* 查询企业信息列表
*
* @param bmCompanyAddress 企业信息
* @return 企业信息集合
*/
public List<BmCompanyAddress> selectBmCompanyAddressList(BmCompanyAddress bmCompanyAddress);
/**
* 新增企业信息
*
* @param bmCompanyAddress 企业信息
* @return 结果
*/
public int insertBmCompanyAddress(BmCompanyAddress bmCompanyAddress);
/**
* 修改企业信息
*
* @param bmCompanyAddress 企业信息
* @return 结果
*/
public int updateBmCompanyAddress(BmCompanyAddress bmCompanyAddress);
/**
* 删除企业信息
*
* @param id 企业信息主键
* @return 结果
*/
public int deleteBmCompanyAddressById(Long id);
/**
* 批量删除企业信息
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteBmCompanyAddressByIds(Long[] ids);
}

View File

@ -0,0 +1,60 @@
package com.bonus.material.basic.service;
import java.util.List;
import com.bonus.material.basic.domain.BmCompanyAddress;
/**
* 企业信息Service接口
*
* @author xsheng
* @date 2024-12-16
*/
public interface IBmCompanyAddressService {
/**
* 查询企业信息
*
* @param id 企业信息主键
* @return 企业信息
*/
public BmCompanyAddress selectBmCompanyAddressById(Long id);
/**
* 查询企业信息列表
*
* @param bmCompanyAddress 企业信息
* @return 企业信息集合
*/
public List<BmCompanyAddress> selectBmCompanyAddressList(BmCompanyAddress bmCompanyAddress);
/**
* 新增企业信息
*
* @param bmCompanyAddress 企业信息
* @return 结果
*/
public int insertBmCompanyAddress(BmCompanyAddress bmCompanyAddress);
/**
* 修改企业信息
*
* @param bmCompanyAddress 企业信息
* @return 结果
*/
public int updateBmCompanyAddress(BmCompanyAddress bmCompanyAddress);
/**
* 批量删除企业信息
*
* @param ids 需要删除的企业信息主键集合
* @return 结果
*/
public int deleteBmCompanyAddressByIds(Long[] ids);
/**
* 删除企业信息信息
*
* @param id 企业信息主键
* @return 结果
*/
public int deleteBmCompanyAddressById(Long id);
}

View File

@ -0,0 +1,98 @@
package com.bonus.material.basic.service.impl;
import java.util.List;
import com.bonus.common.core.exception.ServiceException;
import com.bonus.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.bonus.material.basic.mapper.BmCompanyAddressMapper;
import com.bonus.material.basic.domain.BmCompanyAddress;
import com.bonus.material.basic.service.IBmCompanyAddressService;
/**
* 企业信息Service业务层处理
*
* @author xsheng
* @date 2024-12-16
*/
@Service
public class BmCompanyAddressServiceImpl implements IBmCompanyAddressService {
@Autowired
private BmCompanyAddressMapper bmCompanyAddressMapper;
/**
* 查询企业信息
*
* @param id 企业信息主键
* @return 企业信息
*/
@Override
public BmCompanyAddress selectBmCompanyAddressById(Long id) {
return bmCompanyAddressMapper.selectBmCompanyAddressById(id);
}
/**
* 查询企业信息列表
*
* @param bmCompanyAddress 企业信息
* @return 企业信息
*/
@Override
public List<BmCompanyAddress> selectBmCompanyAddressList(BmCompanyAddress bmCompanyAddress) {
return bmCompanyAddressMapper.selectBmCompanyAddressList(bmCompanyAddress);
}
/**
* 新增企业信息
*
* @param bmCompanyAddress 企业信息
* @return 结果
*/
@Override
public int insertBmCompanyAddress(BmCompanyAddress bmCompanyAddress) {
bmCompanyAddress.setCreateTime(DateUtils.getNowDate());
try {
return bmCompanyAddressMapper.insertBmCompanyAddress(bmCompanyAddress);
} catch (Exception e) {
throw new ServiceException("错误信息描述");
}
}
/**
* 修改企业信息
*
* @param bmCompanyAddress 企业信息
* @return 结果
*/
@Override
public int updateBmCompanyAddress(BmCompanyAddress bmCompanyAddress) {
bmCompanyAddress.setUpdateTime(DateUtils.getNowDate());
try {
return bmCompanyAddressMapper.updateBmCompanyAddress(bmCompanyAddress);
} catch (Exception e) {
throw new ServiceException("错误信息描述");
}
}
/**
* 批量删除企业信息
*
* @param ids 需要删除的企业信息主键
* @return 结果
*/
@Override
public int deleteBmCompanyAddressByIds(Long[] ids) {
return bmCompanyAddressMapper.deleteBmCompanyAddressByIds(ids);
}
/**
* 删除企业信息信息
*
* @param id 企业信息主键
* @return 结果
*/
@Override
public int deleteBmCompanyAddressById(Long id) {
return bmCompanyAddressMapper.deleteBmCompanyAddressById(id);
}
}

View File

@ -51,11 +51,11 @@ public class MaLeaseInfo extends BaseEntity implements Serializable {
private Integer leaseStatus; private Integer leaseStatus;
@ApiModelProperty(value = "租赁开始时间") @ApiModelProperty(value = "租赁开始时间")
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date leaseStartTime; private Date leaseStartTime;
@ApiModelProperty(value = "租赁结束时间") @ApiModelProperty(value = "租赁结束时间")
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date leaseEndTime; private Date leaseEndTime;
/** /**
@ -75,7 +75,7 @@ public class MaLeaseInfo extends BaseEntity implements Serializable {
/** /**
* 需求截止日期(年月日) * 需求截止日期(年月日)
*/ */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date endTime; private Date endTime;
/** /**

View File

@ -0,0 +1,83 @@
<?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.bonus.material.basic.mapper.BmCompanyAddressMapper">
<resultMap type="com.bonus.material.basic.domain.BmCompanyAddress" id="BmCompanyAddressResult">
<result property="id" column="id" />
<result property="companyId" column="company_id" />
<result property="provinceCode" column="province_code" />
<result property="cityCode" column="city_code" />
<result property="areaCode" column="area_code" />
<result property="address" column="address" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectBmCompanyAddressVo">
select id, company_id, province_code, city_code, area_code, address, create_time, update_time from bm_company_address
</sql>
<select id="selectBmCompanyAddressList" parameterType="com.bonus.material.basic.domain.BmCompanyAddress" resultMap="BmCompanyAddressResult">
<include refid="selectBmCompanyAddressVo"/>
<where>
<if test="companyId != null "> and company_id = #{companyId}</if>
<if test="provinceCode != null "> and province_code = #{provinceCode}</if>
<if test="cityCode != null "> and city_code = #{cityCode}</if>
<if test="areaCode != null "> and area_code = #{areaCode}</if>
<if test="address != null and address != ''"> and address = #{address}</if>
</where>
</select>
<select id="selectBmCompanyAddressById" parameterType="Long" resultMap="BmCompanyAddressResult">
<include refid="selectBmCompanyAddressVo"/>
where id = #{id}
</select>
<insert id="insertBmCompanyAddress" parameterType="com.bonus.material.basic.domain.BmCompanyAddress" useGeneratedKeys="true" keyProperty="id">
insert into bm_company_address
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="companyId != null">company_id,</if>
<if test="provinceCode != null">province_code,</if>
<if test="cityCode != null">city_code,</if>
<if test="areaCode != null">area_code,</if>
<if test="address != null">address,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="companyId != null">#{companyId},</if>
<if test="provinceCode != null">#{provinceCode},</if>
<if test="cityCode != null">#{cityCode},</if>
<if test="areaCode != null">#{areaCode},</if>
<if test="address != null">#{address},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateBmCompanyAddress" parameterType="com.bonus.material.basic.domain.BmCompanyAddress">
update bm_company_address
<trim prefix="SET" suffixOverrides=",">
<if test="companyId != null">company_id = #{companyId},</if>
<if test="provinceCode != null">province_code = #{provinceCode},</if>
<if test="cityCode != null">city_code = #{cityCode},</if>
<if test="areaCode != null">area_code = #{areaCode},</if>
<if test="address != null">address = #{address},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteBmCompanyAddressById" parameterType="Long">
delete from bm_company_address where id = #{id}
</delete>
<delete id="deleteBmCompanyAddressByIds" parameterType="String">
delete from bm_company_address where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>