采购订单付款方式对象

This commit is contained in:
sxu 2025-07-22 16:33:25 +08:00
parent c322ddd3a9
commit a1d13d3e15
6 changed files with 496 additions and 0 deletions

View File

@ -0,0 +1,119 @@
package com.bonus.canteen.core.ims.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.bonus.common.log.enums.OperaType;
//import com.bonus.canteen.core.ims.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.canteen.core.ims.domain.OrderGoodsPayStyle;
import com.bonus.canteen.core.ims.service.IOrderGoodsPayStyleService;
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 2025-07-22
*/
@Api(tags = "采购订单付款方式接口")
@RestController
@RequestMapping("/ims_order_goods_pay_style")
public class OrderGoodsPayStyleController extends BaseController {
@Autowired
private IOrderGoodsPayStyleService orderGoodsPayStyleService;
/**
* 查询采购订单付款方式列表
*/
@ApiOperation(value = "查询采购订单付款方式列表")
//@RequiresPermissions("ims:style:list")
@GetMapping("/list")
public TableDataInfo list(OrderGoodsPayStyle orderGoodsPayStyle) {
startPage();
List<OrderGoodsPayStyle> list = orderGoodsPayStyleService.selectOrderGoodsPayStyleList(orderGoodsPayStyle);
return getDataTable(list);
}
/**
* 导出采购订单付款方式列表
*/
@ApiOperation(value = "导出采购订单付款方式列表")
//@PreventRepeatSubmit
//@RequiresPermissions("ims:style:export")
@SysLog(title = "采购订单付款方式", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出采购订单付款方式")
@PostMapping("/export")
public void export(HttpServletResponse response, OrderGoodsPayStyle orderGoodsPayStyle) {
List<OrderGoodsPayStyle> list = orderGoodsPayStyleService.selectOrderGoodsPayStyleList(orderGoodsPayStyle);
ExcelUtil<OrderGoodsPayStyle> util = new ExcelUtil<OrderGoodsPayStyle>(OrderGoodsPayStyle.class);
util.exportExcel(response, list, "采购订单付款方式数据");
}
/**
* 获取采购订单付款方式详细信息
*/
@ApiOperation(value = "获取采购订单付款方式详细信息")
//@RequiresPermissions("ims:style:query")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return success(orderGoodsPayStyleService.selectOrderGoodsPayStyleById(id));
}
/**
* 新增采购订单付款方式
*/
@ApiOperation(value = "新增采购订单付款方式")
//@PreventRepeatSubmit
//@RequiresPermissions("ims:style:add")
@SysLog(title = "采购订单付款方式", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增采购订单付款方式")
@PostMapping
public AjaxResult add(@RequestBody OrderGoodsPayStyle orderGoodsPayStyle) {
try {
return toAjax(orderGoodsPayStyleService.insertOrderGoodsPayStyle(orderGoodsPayStyle));
} catch (Exception e) {
return error(e.getMessage());
}
}
/**
* 修改采购订单付款方式
*/
@ApiOperation(value = "修改采购订单付款方式")
//@PreventRepeatSubmit
//@RequiresPermissions("ims:style:edit")
@SysLog(title = "采购订单付款方式", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改采购订单付款方式")
@PostMapping("/edit")
public AjaxResult edit(@RequestBody OrderGoodsPayStyle orderGoodsPayStyle) {
try {
return toAjax(orderGoodsPayStyleService.updateOrderGoodsPayStyle(orderGoodsPayStyle));
} catch (Exception e) {
return error(e.getMessage());
}
}
/**
* 删除采购订单付款方式
*/
@ApiOperation(value = "删除采购订单付款方式")
//@PreventRepeatSubmit
//@RequiresPermissions("ims:style:remove")
@SysLog(title = "采购订单付款方式", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除采购订单付款方式")
@PostMapping("/del/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(orderGoodsPayStyleService.deleteOrderGoodsPayStyleByIds(ids));
}
}

View File

@ -0,0 +1,59 @@
package com.bonus.canteen.core.ims.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
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;
/**
* 采购订单付款方式对象 ims_order_goods_pay_style
*
* @author xsheng
* @date 2025-07-22
*/
@Data
@ToString
public class OrderGoodsPayStyle extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 主键id */
private Long id;
/** 采购订单号 */
@Excel(name = "采购订单号")
@ApiModelProperty(value = "采购订单号")
private String orderGoodsId;
/** 付款方式(1一次性付款,2分期付款) */
@Excel(name = "付款方式(1一次性付款,2分期付款)")
@ApiModelProperty(value = "付款方式(1一次性付款,2分期付款)")
private Long payMoneyStyle;
/** 付款日期 */
@ApiModelProperty(value = "付款日期")
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "付款日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date payMoneyDate;
/** 收款银行 */
@Excel(name = "收款银行")
@ApiModelProperty(value = "收款银行")
private String collectMoneyBank;
/** 收款账号 */
@Excel(name = "收款账号")
@ApiModelProperty(value = "收款账号")
private String collectMoneyAccount;
/** 账户名称 */
@Excel(name = "账户名称")
@ApiModelProperty(value = "账户名称")
private String collectMoneyAccountName;
}

View File

@ -0,0 +1,60 @@
package com.bonus.canteen.core.ims.mapper;
import java.util.List;
import com.bonus.canteen.core.ims.domain.OrderGoodsPayStyle;
/**
* 采购订单付款方式Mapper接口
*
* @author xsheng
* @date 2025-07-22
*/
public interface OrderGoodsPayStyleMapper {
/**
* 查询采购订单付款方式
*
* @param id 采购订单付款方式主键
* @return 采购订单付款方式
*/
public OrderGoodsPayStyle selectOrderGoodsPayStyleById(Long id);
/**
* 查询采购订单付款方式列表
*
* @param orderGoodsPayStyle 采购订单付款方式
* @return 采购订单付款方式集合
*/
public List<OrderGoodsPayStyle> selectOrderGoodsPayStyleList(OrderGoodsPayStyle orderGoodsPayStyle);
/**
* 新增采购订单付款方式
*
* @param orderGoodsPayStyle 采购订单付款方式
* @return 结果
*/
public int insertOrderGoodsPayStyle(OrderGoodsPayStyle orderGoodsPayStyle);
/**
* 修改采购订单付款方式
*
* @param orderGoodsPayStyle 采购订单付款方式
* @return 结果
*/
public int updateOrderGoodsPayStyle(OrderGoodsPayStyle orderGoodsPayStyle);
/**
* 删除采购订单付款方式
*
* @param id 采购订单付款方式主键
* @return 结果
*/
public int deleteOrderGoodsPayStyleById(Long id);
/**
* 批量删除采购订单付款方式
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteOrderGoodsPayStyleByIds(Long[] ids);
}

View File

@ -0,0 +1,60 @@
package com.bonus.canteen.core.ims.service;
import java.util.List;
import com.bonus.canteen.core.ims.domain.OrderGoodsPayStyle;
/**
* 采购订单付款方式Service接口
*
* @author xsheng
* @date 2025-07-22
*/
public interface IOrderGoodsPayStyleService {
/**
* 查询采购订单付款方式
*
* @param id 采购订单付款方式主键
* @return 采购订单付款方式
*/
public OrderGoodsPayStyle selectOrderGoodsPayStyleById(Long id);
/**
* 查询采购订单付款方式列表
*
* @param orderGoodsPayStyle 采购订单付款方式
* @return 采购订单付款方式集合
*/
public List<OrderGoodsPayStyle> selectOrderGoodsPayStyleList(OrderGoodsPayStyle orderGoodsPayStyle);
/**
* 新增采购订单付款方式
*
* @param orderGoodsPayStyle 采购订单付款方式
* @return 结果
*/
public int insertOrderGoodsPayStyle(OrderGoodsPayStyle orderGoodsPayStyle);
/**
* 修改采购订单付款方式
*
* @param orderGoodsPayStyle 采购订单付款方式
* @return 结果
*/
public int updateOrderGoodsPayStyle(OrderGoodsPayStyle orderGoodsPayStyle);
/**
* 批量删除采购订单付款方式
*
* @param ids 需要删除的采购订单付款方式主键集合
* @return 结果
*/
public int deleteOrderGoodsPayStyleByIds(Long[] ids);
/**
* 删除采购订单付款方式信息
*
* @param id 采购订单付款方式主键
* @return 结果
*/
public int deleteOrderGoodsPayStyleById(Long id);
}

View File

@ -0,0 +1,98 @@
package com.bonus.canteen.core.ims.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.canteen.core.ims.mapper.OrderGoodsPayStyleMapper;
import com.bonus.canteen.core.ims.domain.OrderGoodsPayStyle;
import com.bonus.canteen.core.ims.service.IOrderGoodsPayStyleService;
/**
* 采购订单付款方式Service业务层处理
*
* @author xsheng
* @date 2025-07-22
*/
@Service
public class OrderGoodsPayStyleServiceImpl implements IOrderGoodsPayStyleService {
@Autowired
private OrderGoodsPayStyleMapper orderGoodsPayStyleMapper;
/**
* 查询采购订单付款方式
*
* @param id 采购订单付款方式主键
* @return 采购订单付款方式
*/
@Override
public OrderGoodsPayStyle selectOrderGoodsPayStyleById(Long id) {
return orderGoodsPayStyleMapper.selectOrderGoodsPayStyleById(id);
}
/**
* 查询采购订单付款方式列表
*
* @param orderGoodsPayStyle 采购订单付款方式
* @return 采购订单付款方式
*/
@Override
public List<OrderGoodsPayStyle> selectOrderGoodsPayStyleList(OrderGoodsPayStyle orderGoodsPayStyle) {
return orderGoodsPayStyleMapper.selectOrderGoodsPayStyleList(orderGoodsPayStyle);
}
/**
* 新增采购订单付款方式
*
* @param orderGoodsPayStyle 采购订单付款方式
* @return 结果
*/
@Override
public int insertOrderGoodsPayStyle(OrderGoodsPayStyle orderGoodsPayStyle) {
orderGoodsPayStyle.setCreateTime(DateUtils.getNowDate());
try {
return orderGoodsPayStyleMapper.insertOrderGoodsPayStyle(orderGoodsPayStyle);
} catch (Exception e) {
throw new ServiceException(e.getMessage());
}
}
/**
* 修改采购订单付款方式
*
* @param orderGoodsPayStyle 采购订单付款方式
* @return 结果
*/
@Override
public int updateOrderGoodsPayStyle(OrderGoodsPayStyle orderGoodsPayStyle) {
orderGoodsPayStyle.setUpdateTime(DateUtils.getNowDate());
try {
return orderGoodsPayStyleMapper.updateOrderGoodsPayStyle(orderGoodsPayStyle);
} catch (Exception e) {
throw new ServiceException(e.getMessage());
}
}
/**
* 批量删除采购订单付款方式
*
* @param ids 需要删除的采购订单付款方式主键
* @return 结果
*/
@Override
public int deleteOrderGoodsPayStyleByIds(Long[] ids) {
return orderGoodsPayStyleMapper.deleteOrderGoodsPayStyleByIds(ids);
}
/**
* 删除采购订单付款方式信息
*
* @param id 采购订单付款方式主键
* @return 结果
*/
@Override
public int deleteOrderGoodsPayStyleById(Long id) {
return orderGoodsPayStyleMapper.deleteOrderGoodsPayStyleById(id);
}
}

View File

@ -0,0 +1,100 @@
<?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.canteen.core.ims.mapper.OrderGoodsPayStyleMapper">
<resultMap type="com.bonus.canteen.core.ims.domain.OrderGoodsPayStyle" id="OrderGoodsPayStyleResult">
<result property="id" column="id" />
<result property="orderGoodsId" column="order_goods_id" />
<result property="payMoneyStyle" column="pay_money_style" />
<result property="payMoneyDate" column="pay_money_date" />
<result property="collectMoneyBank" column="collect_money_bank" />
<result property="collectMoneyAccount" column="collect_money_account" />
<result property="collectMoneyAccountName" column="collect_money_account_name" />
<result property="remark" column="remark" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectOrderGoodsPayStyleVo">
select id, order_goods_id, pay_money_style, pay_money_date, collect_money_bank, collect_money_account, collect_money_account_name, remark, create_by, create_time, update_by, update_time from ims_order_goods_pay_style
</sql>
<select id="selectOrderGoodsPayStyleList" parameterType="com.bonus.canteen.core.ims.domain.OrderGoodsPayStyle" resultMap="OrderGoodsPayStyleResult">
<include refid="selectOrderGoodsPayStyleVo"/>
<where>
<if test="orderGoodsId != null and orderGoodsId != ''"> and order_goods_id = #{orderGoodsId}</if>
<if test="payMoneyStyle != null "> and pay_money_style = #{payMoneyStyle}</if>
<if test="payMoneyDate != null "> and pay_money_date = #{payMoneyDate}</if>
<if test="collectMoneyBank != null and collectMoneyBank != ''"> and collect_money_bank = #{collectMoneyBank}</if>
<if test="collectMoneyAccount != null and collectMoneyAccount != ''"> and collect_money_account = #{collectMoneyAccount}</if>
<if test="collectMoneyAccountName != null and collectMoneyAccountName != ''"> and collect_money_account_name like concat('%', #{collectMoneyAccountName}, '%')</if>
</where>
</select>
<select id="selectOrderGoodsPayStyleById" parameterType="Long" resultMap="OrderGoodsPayStyleResult">
<include refid="selectOrderGoodsPayStyleVo"/>
where id = #{id}
</select>
<insert id="insertOrderGoodsPayStyle" parameterType="com.bonus.canteen.core.ims.domain.OrderGoodsPayStyle" useGeneratedKeys="true" keyProperty="id">
insert into ims_order_goods_pay_style
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="orderGoodsId != null and orderGoodsId != ''">order_goods_id,</if>
<if test="payMoneyStyle != null">pay_money_style,</if>
<if test="payMoneyDate != null">pay_money_date,</if>
<if test="collectMoneyBank != null">collect_money_bank,</if>
<if test="collectMoneyAccount != null">collect_money_account,</if>
<if test="collectMoneyAccountName != null">collect_money_account_name,</if>
<if test="remark != null">remark,</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>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="orderGoodsId != null and orderGoodsId != ''">#{orderGoodsId},</if>
<if test="payMoneyStyle != null">#{payMoneyStyle},</if>
<if test="payMoneyDate != null">#{payMoneyDate},</if>
<if test="collectMoneyBank != null">#{collectMoneyBank},</if>
<if test="collectMoneyAccount != null">#{collectMoneyAccount},</if>
<if test="collectMoneyAccountName != null">#{collectMoneyAccountName},</if>
<if test="remark != null">#{remark},</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>
</trim>
</insert>
<update id="updateOrderGoodsPayStyle" parameterType="com.bonus.canteen.core.ims.domain.OrderGoodsPayStyle">
update ims_order_goods_pay_style
<trim prefix="SET" suffixOverrides=",">
<if test="orderGoodsId != null and orderGoodsId != ''">order_goods_id = #{orderGoodsId},</if>
<if test="payMoneyStyle != null">pay_money_style = #{payMoneyStyle},</if>
<if test="payMoneyDate != null">pay_money_date = #{payMoneyDate},</if>
<if test="collectMoneyBank != null">collect_money_bank = #{collectMoneyBank},</if>
<if test="collectMoneyAccount != null">collect_money_account = #{collectMoneyAccount},</if>
<if test="collectMoneyAccountName != null">collect_money_account_name = #{collectMoneyAccountName},</if>
<if test="remark != null">remark = #{remark},</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>
</trim>
where id = #{id}
</update>
<delete id="deleteOrderGoodsPayStyleById" parameterType="Long">
delete from ims_order_goods_pay_style where id = #{id}
</delete>
<delete id="deleteOrderGoodsPayStyleByIds" parameterType="String">
delete from ims_order_goods_pay_style where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>