add 确认来款记录表基础代码
This commit is contained in:
+144
@@ -0,0 +1,144 @@
|
||||
package com.jero.payment.controller;
|
||||
|
||||
import com.jero.payment.entity.PayConfirmPaymentRecord;
|
||||
import com.jero.payment.service.impl.PayConfirmPaymentRecordService;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* (pay_confirm_payment_record)表控制层
|
||||
*
|
||||
* @author xxxxx
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(tags="确认来款记录表")
|
||||
@RestController
|
||||
@RequestMapping("payConfirmPaymentRecord")
|
||||
public class PayConfirmPaymentRecordController extends JeroController<PayConfirmPaymentRecord, PayConfirmPaymentRecordService>{
|
||||
/**
|
||||
* 服务对象
|
||||
*/
|
||||
@Resource
|
||||
private PayConfirmPaymentRecordService payConfirmPaymentRecordService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*/
|
||||
@ApiOperation(value="-分页列表查询", notes="-分页列表查询")
|
||||
@GetMapping(value = "/page")
|
||||
public Result<?> queryPageList(PayConfirmPaymentRecord payConfirmPaymentRecord,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<PayConfirmPaymentRecord> queryWrapper = QueryGenerator.initQueryWrapper(payConfirmPaymentRecord, req.getParameterMap());
|
||||
Page<PayConfirmPaymentRecord> page = new Page<>(pageNo, pageSize);
|
||||
IPage<PayConfirmPaymentRecord> pageList = payConfirmPaymentRecordService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
/**
|
||||
* 列表查询
|
||||
*/
|
||||
@ApiOperation(value="-列表查询", notes="-列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<PayConfirmPaymentRecord>> queryList(PayConfirmPaymentRecord payConfirmPaymentRecord,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<PayConfirmPaymentRecord> queryWrapper = QueryGenerator.initQueryWrapper(payConfirmPaymentRecord, req.getParameterMap());
|
||||
List<PayConfirmPaymentRecord> list = payConfirmPaymentRecordService.list(queryWrapper);
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*/
|
||||
@AutoLog(value = "-添加")
|
||||
@ApiOperation(value="-添加", notes="-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<?> add(@Validated @RequestBody PayConfirmPaymentRecord payConfirmPaymentRecord) {
|
||||
payConfirmPaymentRecordService.add(payConfirmPaymentRecord);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
@AutoLog(value = "-编辑")
|
||||
@ApiOperation(value="-编辑", notes="-编辑")
|
||||
@PostMapping(value = "/edit")
|
||||
public Result<?> edit(@Validated @RequestBody PayConfirmPaymentRecord payConfirmPaymentRecord) {
|
||||
payConfirmPaymentRecordService.editById(payConfirmPaymentRecord);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*/
|
||||
@AutoLog(value = "-通过id删除")
|
||||
@ApiOperation(value="-通过id删除", notes="-通过id删除")
|
||||
@GetMapping(value = "/delete")
|
||||
public Result<?> delete(@RequestParam(name="id") String id) {
|
||||
payConfirmPaymentRecordService.deleteById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*/
|
||||
@AutoLog(value = "-批量删除")
|
||||
@ApiOperation(value="-批量删除", notes="-批量删除")
|
||||
@GetMapping(value = "/deleteBatch")
|
||||
public Result<?> deleteBatch(@RequestParam(name="ids") String ids) {
|
||||
this.payConfirmPaymentRecordService.deleteByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*/
|
||||
//@AutoLog(value = "-通过id查询")
|
||||
//@ApiOperation(value="-通过id查询", notes="-通过id查询")
|
||||
//@GetMapping(value = "/queryById")
|
||||
//public Result<?> queryById(@RequestParam(name="id") String id) {
|
||||
// PayConfirmPaymentRecord payConfirmPaymentRecord = payConfirmPaymentRecordService.queryById(id);
|
||||
// if(payConfirmPaymentRecord==null) {
|
||||
// return Result.error("未找到对应数据");
|
||||
// }
|
||||
// return Result.OK(payConfirmPaymentRecord);
|
||||
//}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*/
|
||||
@ApiOperation(value="-导出excel")
|
||||
@GetMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, PayConfirmPaymentRecord payConfirmPaymentRecord) {
|
||||
return super.exportXls(request, payConfirmPaymentRecord, PayConfirmPaymentRecord.class, "");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*/
|
||||
@ApiOperation(value="-通过excel导入数据")
|
||||
@PostMapping(value = "/importExcel")
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, PayConfirmPaymentRecord.class);
|
||||
}
|
||||
|
||||
}
|
||||
+99
@@ -0,0 +1,99 @@
|
||||
package com.jero.payment.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*
|
||||
*@author liJiaRao
|
||||
*@date 2022-06-08 17:22
|
||||
*/
|
||||
/**
|
||||
* 确认来款记录表
|
||||
*/
|
||||
@ApiModel(value="确认来款记录表")
|
||||
@Data
|
||||
@TableName(value = "pay_confirm_payment_record")
|
||||
public class PayConfirmPaymentRecord implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value="id")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(value = "create_by")
|
||||
@ApiModelProperty(value="创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建日期
|
||||
*/
|
||||
@TableField(value = "create_time")
|
||||
@ApiModelProperty(value="创建日期")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
@TableField(value = "update_by")
|
||||
@ApiModelProperty(value="更新人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新日期
|
||||
*/
|
||||
@TableField(value = "update_time")
|
||||
@ApiModelProperty(value="更新日期")
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
@TableField(value = "project_id")
|
||||
@ApiModelProperty(value="项目id")
|
||||
private String projectId;
|
||||
|
||||
/**
|
||||
* 到账金额
|
||||
*/
|
||||
@TableField(value = "amount_received")
|
||||
@ApiModelProperty(value="到账金额")
|
||||
private BigDecimal amountReceived;
|
||||
|
||||
/**
|
||||
* 到账日期
|
||||
*/
|
||||
@TableField(value = "payment_date")
|
||||
@ApiModelProperty(value="到账日期")
|
||||
private Date paymentDate;
|
||||
|
||||
public static final String COL_ID = "id";
|
||||
|
||||
public static final String COL_CREATE_BY = "create_by";
|
||||
|
||||
public static final String COL_CREATE_TIME = "create_time";
|
||||
|
||||
public static final String COL_UPDATE_BY = "update_by";
|
||||
|
||||
public static final String COL_UPDATE_TIME = "update_time";
|
||||
|
||||
public static final String COL_PROJECT_ID = "project_id";
|
||||
|
||||
public static final String COL_AMOUNT_RECEIVED = "amount_received";
|
||||
|
||||
public static final String COL_PAYMENT_DATE = "payment_date";
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package com.jero.payment.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.jero.payment.entity.PayConfirmPaymentRecord;
|
||||
|
||||
/**
|
||||
* @author liJiaRao
|
||||
* @date 2022-06-08 17:24
|
||||
*/
|
||||
public interface PayConfirmPaymentRecordMapper extends BaseMapper<PayConfirmPaymentRecord> {
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
<?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.jero.payment.mapper.PayConfirmPaymentRecordMapper">
|
||||
<resultMap id="BaseResultMap" type="com.jero.payment.entity.PayConfirmPaymentRecord">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table pay_confirm_payment_record-->
|
||||
<id column="id" jdbcType="VARCHAR" property="id" />
|
||||
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
<result column="project_id" jdbcType="VARCHAR" property="projectId" />
|
||||
<result column="amount_received" jdbcType="DECIMAL" property="amountReceived" />
|
||||
<result column="payment_date" jdbcType="DATE" property="paymentDate" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
id, create_by, create_time, update_by, update_time, project_id, amount_received,
|
||||
payment_date
|
||||
</sql>
|
||||
</mapper>
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
package com.jero.payment.service.impl;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.payment.entity.PayConfirmPaymentRecord;
|
||||
import com.jero.payment.mapper.PayConfirmPaymentRecordMapper;
|
||||
|
||||
/**
|
||||
* @author liJiaRao
|
||||
* @date 2022-06-08 16:34
|
||||
*/
|
||||
@Service
|
||||
public class PayConfirmPaymentRecordService extends ServiceImpl<PayConfirmPaymentRecordMapper, PayConfirmPaymentRecord> {
|
||||
|
||||
|
||||
public void add(PayConfirmPaymentRecord payConfirmPaymentRecord) {
|
||||
save(payConfirmPaymentRecord);
|
||||
}
|
||||
|
||||
|
||||
public void editById(PayConfirmPaymentRecord payConfirmPaymentRecord) {
|
||||
updateById(payConfirmPaymentRecord);
|
||||
}
|
||||
|
||||
public void deleteById(String id) {
|
||||
removeById(id);
|
||||
}
|
||||
|
||||
public void deleteByIds(List<String> ids) {
|
||||
removeByIds(ids);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user