增加仓库物资配置
This commit is contained in:
parent
d66658f73d
commit
49cbcb3036
|
|
@ -56,11 +56,9 @@ public class BmCustomerController extends BaseController {
|
|||
*/
|
||||
@ApiOperation(value = "获取往来单位下拉选")
|
||||
@GetMapping("/getUnitInfoSelect")
|
||||
public AjaxResult getUnitInfoSelect(BmCustomer bmCustomer)
|
||||
{
|
||||
public AjaxResult getUnitInfoSelect(BmCustomer bmCustomer) {
|
||||
List<BmCustomer> list = customerService.selectCustomerList(bmCustomer);
|
||||
return AjaxResult.success(list);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -128,9 +126,9 @@ public class BmCustomerController extends BaseController {
|
|||
* 导出往来单位列表
|
||||
*/
|
||||
@ApiOperation(value = "导出往来单位列表")
|
||||
@RequiresPermissions("base:customer:export")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BmCustomer bmCustomer)
|
||||
{
|
||||
public void export(HttpServletResponse response, BmCustomer bmCustomer) {
|
||||
List<BmCustomer> list = customerService.selectCustomerList(bmCustomer);
|
||||
list.forEach(item->{
|
||||
item.setStatusName(Objects.equals(item.getIsActive(), "1") ? "启用":"不启用");
|
||||
|
|
|
|||
|
|
@ -0,0 +1,91 @@
|
|||
package com.bonus.material.controller;
|
||||
import com.bonus.common.core.domain.ResultBean;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.page.TableDataInfo;
|
||||
import com.bonus.common.security.annotation.RequiresPermissions;
|
||||
import com.bonus.material.service.impl.MaHouseSetService;
|
||||
import com.bonus.material.domain.MaHouseSet;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 仓库和物资配置(ma_house_set)表控制层
|
||||
*
|
||||
* @author 阮世耀
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/ma_house_set")
|
||||
public class MaHouseSetController extends BaseController {
|
||||
|
||||
/**
|
||||
* 服务对象
|
||||
*/
|
||||
@Autowired
|
||||
private MaHouseSetService maHouseSetService;
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询数据
|
||||
*/
|
||||
@GetMapping(value = "/list")
|
||||
@RequiresPermissions("material:maHouseSet:query")
|
||||
public TableDataInfo getList(MaHouseSet maHouseSet) {
|
||||
startPage();
|
||||
List<MaHouseSet> list = this.maHouseSetService.selectAll(maHouseSet);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过主键查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 单条数据
|
||||
*/
|
||||
@GetMapping("{id}")
|
||||
@RequiresPermissions("material:maHouseSet:query")
|
||||
public ResultBean<MaHouseSet> queryById(@PathVariable("id") Integer id) {
|
||||
return ResultBean.success(this.maHouseSetService.selectByPrimaryKey(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param maHouseSet 实体
|
||||
* @return 新增结果
|
||||
*/
|
||||
@PostMapping(value = "/add")
|
||||
@RequiresPermissions("material:maHouseSet:add")
|
||||
public ResultBean< Boolean> add(@RequestBody MaHouseSet maHouseSet) {
|
||||
this.maHouseSetService.insertSelective(maHouseSet);
|
||||
return ResultBean.success(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑数据
|
||||
*
|
||||
* @param maHouseSet 实体
|
||||
* @return 编辑结果
|
||||
*/
|
||||
@PutMapping(value = "/update")
|
||||
@RequiresPermissions("material:maHouseSet:edit")
|
||||
public ResultBean< Boolean> edit(@RequestBody MaHouseSet maHouseSet) {
|
||||
this.maHouseSetService.updateByPrimaryKeySelective(maHouseSet);
|
||||
return ResultBean.success(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 删除是否成功
|
||||
*/
|
||||
@PostMapping(value = "/delete/{id}")
|
||||
@RequiresPermissions("material:maHouseSet:remove")
|
||||
public ResultBean< Boolean> deleteById(@PathVariable("id") Integer id) {
|
||||
this.maHouseSetService.deleteByPrimaryKey(id);
|
||||
return ResultBean.success(true);
|
||||
}
|
||||
}
|
||||
|
|
@ -2,6 +2,7 @@ package com.bonus.material.controller;
|
|||
import com.bonus.common.core.domain.ResultBean;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.page.TableDataInfo;
|
||||
import com.bonus.common.security.annotation.RequiresPermissions;
|
||||
import com.bonus.material.service.impl.MaUserSetService;
|
||||
import com.bonus.material.domain.MaUserSet;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
|
@ -29,6 +30,7 @@ public class MaUserSetController extends BaseController {
|
|||
* 分页查询数据
|
||||
*/
|
||||
@GetMapping(value = "/list")
|
||||
@RequiresPermissions("material:maUserSet:query")
|
||||
public TableDataInfo getList(MaUserSet maUserSet) {
|
||||
startPage();
|
||||
List<MaUserSet> list = this.maUserSetService.selectAll(maUserSet);
|
||||
|
|
@ -42,6 +44,7 @@ public class MaUserSetController extends BaseController {
|
|||
* @return 单条数据
|
||||
*/
|
||||
@GetMapping("{id}")
|
||||
@RequiresPermissions("material:maUserSet:query")
|
||||
public ResultBean<MaUserSet> queryById(@PathVariable("id") Integer id) {
|
||||
return ResultBean.success(this.maUserSetService.selectByPrimaryKey(id));
|
||||
}
|
||||
|
|
@ -53,6 +56,7 @@ public class MaUserSetController extends BaseController {
|
|||
* @return 新增结果
|
||||
*/
|
||||
@PostMapping(value = "/add")
|
||||
@RequiresPermissions("material:maUserSet:add")
|
||||
public ResultBean< Boolean> add(@RequestBody MaUserSet maUserSet) {
|
||||
this.maUserSetService.insertSelective(maUserSet);
|
||||
return ResultBean.success(true);
|
||||
|
|
@ -65,6 +69,7 @@ public class MaUserSetController extends BaseController {
|
|||
* @return 编辑结果
|
||||
*/
|
||||
@PutMapping(value = "/update")
|
||||
@RequiresPermissions("material:maUserSet:edit")
|
||||
public ResultBean< Boolean> edit(@RequestBody MaUserSet maUserSet) {
|
||||
this.maUserSetService.updateByPrimaryKeySelective(maUserSet);
|
||||
return ResultBean.success(true);
|
||||
|
|
@ -77,6 +82,7 @@ public class MaUserSetController extends BaseController {
|
|||
* @return 删除是否成功
|
||||
*/
|
||||
@PostMapping(value = "/delete/{id}")
|
||||
@RequiresPermissions("material:maUserSet:remove")
|
||||
public ResultBean< Boolean> deleteById(@PathVariable("id") Integer id) {
|
||||
this.maUserSetService.deleteByPrimaryKey(id);
|
||||
return ResultBean.success(true);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,40 @@
|
|||
package com.bonus.material.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/**
|
||||
* 仓库和物资配置
|
||||
* @author 阮世耀
|
||||
*/
|
||||
@ApiModel(description="仓库和物资配置")
|
||||
@Data
|
||||
public class MaHouseSet implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 6368040076262260197L;
|
||||
|
||||
@ApiModelProperty(value="")
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 机具规格id
|
||||
*/
|
||||
@ApiModelProperty(value="机具规格id")
|
||||
private Integer typeId;
|
||||
|
||||
@ApiModelProperty(value="机具规格名称")
|
||||
private String typeName;
|
||||
|
||||
/**
|
||||
* 仓库id
|
||||
*/
|
||||
@ApiModelProperty(value="仓库id")
|
||||
private Integer houseId;
|
||||
|
||||
@ApiModelProperty(value="仓库名称")
|
||||
private String houseName;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
package com.bonus.material.mapper;
|
||||
|
||||
import com.bonus.material.domain.MaHouseSet;
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
*@PackagePath: com.bonus.material
|
||||
*@author : 阮世耀
|
||||
*@CreateTime: 2024-08-13 16:47
|
||||
*@Description: 描述
|
||||
*@version : 1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface MaHouseSetMapper {
|
||||
/**
|
||||
* delete by primary key
|
||||
* @param id primaryKey
|
||||
* @return deleteCount
|
||||
*/
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
/**
|
||||
* insert record to table
|
||||
* @param record the record
|
||||
* @return insert count
|
||||
*/
|
||||
int insert(MaHouseSet record);
|
||||
|
||||
int insertOrUpdate(MaHouseSet record);
|
||||
|
||||
int insertOrUpdateSelective(MaHouseSet record);
|
||||
|
||||
/**
|
||||
* insert record to table selective
|
||||
* @param record the record
|
||||
* @return insert count
|
||||
*/
|
||||
int insertSelective(MaHouseSet record);
|
||||
|
||||
/**
|
||||
* select by primary key
|
||||
* @param id primary key
|
||||
* @return object by primary key
|
||||
*/
|
||||
MaHouseSet selectByPrimaryKey(Integer id);
|
||||
|
||||
/**
|
||||
* update record selective
|
||||
* @param record the updated record
|
||||
* @return update count
|
||||
*/
|
||||
int updateByPrimaryKeySelective(MaHouseSet record);
|
||||
|
||||
/**
|
||||
* update record
|
||||
* @param record the updated record
|
||||
* @return update count
|
||||
*/
|
||||
int updateByPrimaryKey(MaHouseSet record);
|
||||
|
||||
List<MaHouseSet> selectAll(MaHouseSet record);
|
||||
}
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
package com.bonus.material.service.impl;
|
||||
|
||||
import com.bonus.material.mapper.MaHouseSetMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.bonus.material.domain.MaHouseSet;
|
||||
/**
|
||||
* @PackagePath: com.bonus.material
|
||||
* @author : 阮世耀
|
||||
* @CreateTime: 2024-08-13 16:47
|
||||
* @version : 1.0
|
||||
*/
|
||||
@Service
|
||||
public class MaHouseSetService{
|
||||
|
||||
@Autowired
|
||||
private MaHouseSetMapper maHouseSetMapper;
|
||||
|
||||
|
||||
public int deleteByPrimaryKey(Integer id) {
|
||||
return maHouseSetMapper.deleteByPrimaryKey(id);
|
||||
}
|
||||
|
||||
|
||||
public int insert(MaHouseSet record) {
|
||||
return maHouseSetMapper.insert(record);
|
||||
}
|
||||
|
||||
|
||||
public int insertOrUpdate(MaHouseSet record) {
|
||||
return maHouseSetMapper.insertOrUpdate(record);
|
||||
}
|
||||
|
||||
|
||||
public int insertOrUpdateSelective(MaHouseSet record) {
|
||||
return maHouseSetMapper.insertOrUpdateSelective(record);
|
||||
}
|
||||
|
||||
|
||||
public int insertSelective(MaHouseSet record) {
|
||||
return maHouseSetMapper.insertSelective(record);
|
||||
}
|
||||
|
||||
|
||||
public MaHouseSet selectByPrimaryKey(Integer id) {
|
||||
return maHouseSetMapper.selectByPrimaryKey(id);
|
||||
}
|
||||
|
||||
|
||||
public int updateByPrimaryKeySelective(MaHouseSet record) {
|
||||
return maHouseSetMapper.updateByPrimaryKeySelective(record);
|
||||
}
|
||||
|
||||
|
||||
public int updateByPrimaryKey(MaHouseSet record) {
|
||||
return maHouseSetMapper.updateByPrimaryKey(record);
|
||||
}
|
||||
|
||||
|
||||
public List<MaHouseSet> selectAll(MaHouseSet maHouseSet) {
|
||||
return maHouseSetMapper.selectAll(maHouseSet);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,147 @@
|
|||
<?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.mapper.MaHouseSetMapper">
|
||||
<resultMap id="BaseResultMap" type="com.bonus.material.domain.MaHouseSet">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table ma_house_set-->
|
||||
<id column="id" jdbcType="INTEGER" property="id" />
|
||||
<result column="type_id" jdbcType="INTEGER" property="typeId" />
|
||||
<result column="house_id" jdbcType="INTEGER" property="houseId" />
|
||||
<result column="type_name" jdbcType="VARCHAR" property="typeName" />
|
||||
<result column="house_name" jdbcType="VARCHAR" property="houseName" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
ma_house_set.id, ma_house_set.type_id, ma_house_set.house_id
|
||||
</sql>
|
||||
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
<!--@mbg.generated-->
|
||||
select
|
||||
<include refid="Base_Column_List" />,mt.name as type_name, mh.name as house_name
|
||||
from ma_house_set
|
||||
left join `bns-smartwh`.ma_type mt on ma_house_set.type_id = mt.id
|
||||
left join `bns-smartwh`.ma_house mh on ma_house_set.house_id = mh.id
|
||||
where ma_house_set.id = #{id,jdbcType=INTEGER}
|
||||
</select>
|
||||
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
<!--@mbg.generated-->
|
||||
delete from ma_house_set
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</delete>
|
||||
|
||||
<insert id="insert" parameterType="com.bonus.material.domain.MaHouseSet">
|
||||
<!--@mbg.generated-->
|
||||
insert into ma_house_set (id, type_id, house_id)
|
||||
values (#{id,jdbcType=INTEGER}, #{typeId,jdbcType=INTEGER}, #{houseId,jdbcType=INTEGER})
|
||||
</insert>
|
||||
|
||||
<insert id="insertSelective" parameterType="com.bonus.material.domain.MaHouseSet">
|
||||
<!--@mbg.generated-->
|
||||
insert into ma_house_set
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="typeId != null">
|
||||
type_id,
|
||||
</if>
|
||||
<if test="houseId != null">
|
||||
house_id,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="typeId != null">
|
||||
#{typeId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="houseId != null">
|
||||
#{houseId,jdbcType=INTEGER},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.bonus.material.domain.MaHouseSet">
|
||||
<!--@mbg.generated-->
|
||||
update ma_house_set
|
||||
<set>
|
||||
<if test="typeId != null">
|
||||
type_id = #{typeId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="houseId != null">
|
||||
house_id = #{houseId,jdbcType=INTEGER},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
|
||||
<update id="updateByPrimaryKey" parameterType="com.bonus.material.domain.MaHouseSet">
|
||||
<!--@mbg.generated-->
|
||||
update ma_house_set
|
||||
set type_id = #{typeId,jdbcType=INTEGER},house_id = #{houseId,jdbcType=INTEGER}
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
|
||||
<select id="selectAll" resultMap="BaseResultMap">
|
||||
<!--@mbg.generated-->
|
||||
select
|
||||
<include refid="Base_Column_List"/>,mt.name as type_name, mh.name as house_name
|
||||
from ma_house_set
|
||||
left join `bns-smartwh`.ma_type mt on ma_house_set.type_id = mt.id
|
||||
left join `bns-smartwh`.ma_house mh on ma_house_set.house_id = mh.id
|
||||
</select>
|
||||
|
||||
<insert id="insertOrUpdate" parameterType="com.bonus.material.domain.MaHouseSet">
|
||||
<!--@mbg.generated-->
|
||||
insert into ma_house_set(id, type_id, house_id)
|
||||
values
|
||||
(#{id,jdbcType=INTEGER}, #{typeId,jdbcType=INTEGER}, #{houseId,jdbcType=INTEGER})
|
||||
on duplicate key update
|
||||
id = #{id,jdbcType=INTEGER}, type_id = #{typeId,jdbcType=INTEGER}, house_id = #{houseId,jdbcType=INTEGER}
|
||||
</insert>
|
||||
|
||||
<insert id="insertOrUpdateSelective" parameterType="com.bonus.material.domain.MaHouseSet">
|
||||
<!--@mbg.generated-->
|
||||
insert into ma_house_set
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="typeId != null">
|
||||
type_id,
|
||||
</if>
|
||||
<if test="houseId != null">
|
||||
house_id,
|
||||
</if>
|
||||
</trim>
|
||||
values
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="typeId != null">
|
||||
#{typeId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="houseId != null">
|
||||
#{houseId,jdbcType=INTEGER},
|
||||
</if>
|
||||
</trim>
|
||||
on duplicate key update
|
||||
<trim suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id = #{id,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="typeId != null">
|
||||
type_id = #{typeId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="houseId != null">
|
||||
house_id = #{houseId,jdbcType=INTEGER},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue