
13 changed files with 1161 additions and 1 deletions
@ -0,0 +1,116 @@ |
|||||
|
package com.yxt.anrui.fin.api.finvehicleinvoice; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
|
import com.yxt.common.core.domain.BaseEntity; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* Project: anrui-fin(财务管理) <br/> |
||||
|
* File: FinVehicleInvoice.java <br/> |
||||
|
* Class: com.yxt.anrui.fin.api.finvehicleinvoice.FinVehicleInvoice <br/> |
||||
|
* Description: 车辆发票信息. <br/> |
||||
|
* Copyright: Copyright (c) 2011 <br/> |
||||
|
* Company: https://gitee.com/liuzp315 <br/>
|
||||
|
* Makedate: 2021-10-27 09:36:11 <br/> |
||||
|
* |
||||
|
* @author liupopo |
||||
|
* @version 1.0 |
||||
|
* @since 1.0 |
||||
|
*/ |
||||
|
@ApiModel(value = "车辆发票信息", description = "车辆发票信息") |
||||
|
@TableName("fin_vehicle_invoice") |
||||
|
@Data |
||||
|
public class FinVehicleInvoice extends BaseEntity { |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
@ApiModelProperty("销售申请sid") |
||||
|
private String Sid; |
||||
|
|
||||
|
@ApiModelProperty("版本锁") |
||||
|
private Integer lockVersion; |
||||
|
|
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
||||
|
@ApiModelProperty("创建时间") |
||||
|
private Date createTime; |
||||
|
|
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
||||
|
@ApiModelProperty("修改时间") |
||||
|
private Date modifyTime; |
||||
|
|
||||
|
@ApiModelProperty("是否可用:1可用,0不可用") |
||||
|
private Integer isEnable; |
||||
|
|
||||
|
@ApiModelProperty("开票状态:0未开票,1已开票,2作废") |
||||
|
private Integer state; |
||||
|
|
||||
|
@ApiModelProperty("是否删除:0未删除,1已删除") |
||||
|
private Integer isDelete; |
||||
|
|
||||
|
@ApiModelProperty("备注") |
||||
|
private String remarks; |
||||
|
|
||||
|
@ApiModelProperty("创建人sid") |
||||
|
private String createBySid; |
||||
|
|
||||
|
@ApiModelProperty("修改人sid") |
||||
|
private String updateBySid; |
||||
|
|
||||
|
@ApiModelProperty("车辆sid") |
||||
|
private String vehicleSid; |
||||
|
|
||||
|
@ApiModelProperty("车架号") |
||||
|
private String VIN; |
||||
|
|
||||
|
@ApiModelProperty("车辆类型Key") |
||||
|
private String vehicleTypeKey; |
||||
|
|
||||
|
@ApiModelProperty("车辆类型") |
||||
|
private String vehicleType; |
||||
|
|
||||
|
@ApiModelProperty("车辆金额") |
||||
|
private BigDecimal vehiclAmount; |
||||
|
|
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
||||
|
@ApiModelProperty("最大发票开票日期") |
||||
|
private Date invoiceDate; |
||||
|
|
||||
|
@ApiModelProperty("发票号") |
||||
|
private String invoiceNo; |
||||
|
|
||||
|
@ApiModelProperty("发票代码") |
||||
|
private String invoiceCode; |
||||
|
|
||||
|
@ApiModelProperty("车辆发票金额") |
||||
|
private BigDecimal invoiceAmount; |
||||
|
|
||||
|
@ApiModelProperty("发票类别Key(增值税专用发票/机动车销售统一发票/增值税普通发票)") |
||||
|
private String invoiceTypeKey; |
||||
|
|
||||
|
@ApiModelProperty("发票类别") |
||||
|
private String invoiceType; |
||||
|
|
||||
|
@ApiModelProperty("开票单位") |
||||
|
private String invoiceTitle; |
||||
|
|
||||
|
@ApiModelProperty("移交状态:0未交接,1已交接") |
||||
|
private String invoiceState; |
||||
|
|
||||
|
@ApiModelProperty("客户名称") |
||||
|
private String customerName; |
||||
|
|
||||
|
@ApiModelProperty("开票名称") |
||||
|
private String invoiceName; |
||||
|
|
||||
|
@ApiModelProperty("合同编号") |
||||
|
private String contractNo; |
||||
|
|
||||
|
@ApiModelProperty("图片地址") |
||||
|
private String filePath; |
||||
|
|
||||
|
} |
@ -0,0 +1,61 @@ |
|||||
|
package com.yxt.anrui.fin.api.finvehicleinvoice; |
||||
|
|
||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
|
import com.yxt.common.core.vo.Vo; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* @author Administrator |
||||
|
* @description |
||||
|
* @date 2023/4/5 20:30 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class FinVehicleInvoiceDetailsVo implements Vo { |
||||
|
|
||||
|
@ApiModelProperty("sid") |
||||
|
private String sid; |
||||
|
|
||||
|
@ApiModelProperty("开票单位") |
||||
|
private String invoiceTitle; |
||||
|
|
||||
|
@ApiModelProperty("合同编号") |
||||
|
private String contractNo; |
||||
|
|
||||
|
@ApiModelProperty("客户名称") |
||||
|
private String customerName; |
||||
|
|
||||
|
@ApiModelProperty("车架号") |
||||
|
private String VIN; |
||||
|
|
||||
|
@ApiModelProperty("发票类别") |
||||
|
private String invoiceType; |
||||
|
|
||||
|
@ApiModelProperty("车辆发票金额") |
||||
|
private BigDecimal invoiceAmount; |
||||
|
|
||||
|
@ApiModelProperty("开票状态:0未开票,1已开票,2作废") |
||||
|
private String state; |
||||
|
|
||||
|
@ApiModelProperty("开票名称") |
||||
|
private String invoiceName; |
||||
|
|
||||
|
@ApiModelProperty("开票人") |
||||
|
private String name; |
||||
|
|
||||
|
@ApiModelProperty("开票时间") |
||||
|
private String createTime; |
||||
|
|
||||
|
@ApiModelProperty("发票号") |
||||
|
private String invoiceNo; |
||||
|
|
||||
|
@ApiModelProperty("发票代码") |
||||
|
private String invoiceCode; |
||||
|
|
||||
|
@ApiModelProperty("图片地址") |
||||
|
private String filePath; |
||||
|
|
||||
|
} |
@ -0,0 +1,70 @@ |
|||||
|
package com.yxt.anrui.fin.api.finvehicleinvoice; |
||||
|
|
||||
|
|
||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
|
import com.yxt.common.core.dto.Dto; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* Project: anrui-fin(财务管理) <br/> |
||||
|
* File: LoanVehicleInvoiceDto.java <br/> |
||||
|
* Class: com.yxt.anrui.fin.api.finvehicleinvoice.FinVehicleInvoiceDto <br/> |
||||
|
* Description: 车辆发票信息 数据传输对象. <br/> |
||||
|
* Copyright: Copyright (c) 2011 <br/> |
||||
|
* Company: https://gitee.com/liuzp315 <br/>
|
||||
|
* Makedate: 2021-10-27 09:36:11 <br/> |
||||
|
* |
||||
|
* @author liupopo |
||||
|
* @version 1.0 |
||||
|
* @since 1.0 |
||||
|
*/ |
||||
|
@ApiModel(value = "车辆发票信息 数据传输对象", description = "车辆发票信息 数据传输对象") |
||||
|
@Data |
||||
|
public class FinVehicleInvoiceDto implements Dto { |
||||
|
|
||||
|
|
||||
|
@ApiModelProperty("开票单位") |
||||
|
private String invoiceTitle; |
||||
|
|
||||
|
@ApiModelProperty("合同编号") |
||||
|
private String contractNo; |
||||
|
|
||||
|
@ApiModelProperty("客户名称") |
||||
|
private String customerName; |
||||
|
|
||||
|
@ApiModelProperty("车架号") |
||||
|
private String VIN; |
||||
|
|
||||
|
@ApiModelProperty("发票类别") |
||||
|
private String invoiceType; |
||||
|
|
||||
|
@ApiModelProperty("车辆发票金额") |
||||
|
private BigDecimal invoiceAmount; |
||||
|
|
||||
|
@ApiModelProperty("开票状态:0未开票,1已开票,2作废") |
||||
|
private String state; |
||||
|
|
||||
|
@ApiModelProperty("开票名称") |
||||
|
private String invoiceName; |
||||
|
|
||||
|
@ApiModelProperty("开票人") |
||||
|
private String name; |
||||
|
|
||||
|
@ApiModelProperty("开票时间") |
||||
|
private String createTime; |
||||
|
|
||||
|
@ApiModelProperty("发票号") |
||||
|
private String invoiceNo; |
||||
|
|
||||
|
@ApiModelProperty("发票代码") |
||||
|
private String invoiceCode; |
||||
|
|
||||
|
@ApiModelProperty("图片地址") |
||||
|
private String filePath; |
||||
|
|
||||
|
} |
@ -0,0 +1,38 @@ |
|||||
|
package com.yxt.anrui.fin.api.finvehicleinvoice; |
||||
|
|
||||
|
import com.yxt.common.core.utils.ExportEntityMap; |
||||
|
import com.yxt.common.core.vo.Vo; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author Administrator |
||||
|
* @description |
||||
|
* @date 2023/4/4 17:40 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class FinVehicleInvoiceExportVo implements Vo { |
||||
|
|
||||
|
|
||||
|
@ExportEntityMap(CnName = "序号", EnName = "rankNo") |
||||
|
private Integer rankNo; |
||||
|
@ExportEntityMap(CnName = "发票状态", EnName = "state") |
||||
|
private String state; |
||||
|
@ExportEntityMap(CnName = "交接状态", EnName = "invoiceState") |
||||
|
private String invoiceState; |
||||
|
@ExportEntityMap(CnName = "开票类型", EnName = "invoiceType") |
||||
|
private String invoiceType; |
||||
|
@ExportEntityMap(CnName = "合同编号", EnName = "contractNo") |
||||
|
private String contractNo; |
||||
|
@ExportEntityMap(CnName = "客户名称", EnName = "customerName") |
||||
|
private String customerName; |
||||
|
@ExportEntityMap(CnName = "车架号", EnName = "VIN") |
||||
|
private String VIN; |
||||
|
@ExportEntityMap(CnName = "开票名称", EnName = "invoiceName") |
||||
|
private String invoiceName; |
||||
|
@ExportEntityMap(CnName = "开票金额", EnName = "invoiceAmount") |
||||
|
private String invoiceAmount; |
||||
|
@ExportEntityMap(CnName = "开票日期", EnName = "createTime") |
||||
|
private String createTime; |
||||
|
@ExportEntityMap(CnName = "发票代码", EnName = "invoiceCode") |
||||
|
private String invoiceCode; |
||||
|
} |
@ -0,0 +1,78 @@ |
|||||
|
package com.yxt.anrui.fin.api.finvehicleinvoice; |
||||
|
|
||||
|
import com.yxt.common.core.query.PagerQuery; |
||||
|
import com.yxt.common.core.result.ResultBean; |
||||
|
import com.yxt.common.core.vo.PagerVo; |
||||
|
import io.swagger.annotations.Api; |
||||
|
import io.swagger.annotations.ApiImplicitParam; |
||||
|
import io.swagger.annotations.ApiOperation; |
||||
|
import org.springframework.cloud.openfeign.FeignClient; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
import org.springframework.web.multipart.MultipartFile; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* Project: anrui-fin(财务管理) <br/> |
||||
|
* File: FinVehicleInvoiceFeign.java <br/> |
||||
|
* Class: com.yxt.anrui.fin.api.finvehicleinvoice.FinVehicleInvoiceFeign <br/> |
||||
|
* Description: 车辆发票信息. <br/> |
||||
|
* Copyright: Copyright (c) 2011 <br/> |
||||
|
* Company: https://gitee.com/liuzp315 <br/>
|
||||
|
* Makedate: 2021-10-27 09:36:11 <br/> |
||||
|
* |
||||
|
* @author liupopo |
||||
|
* @version 1.0 |
||||
|
* @since 1.0 |
||||
|
*/ |
||||
|
@Api(tags = "车辆发票信息") |
||||
|
@FeignClient( |
||||
|
contextId = "anrui-fin-FinVehicleInvoice", |
||||
|
name = "anrui-fin", |
||||
|
path = "v1/finvehicleinvoice", |
||||
|
fallback = FinVehicleInvoiceFeignFallback.class) |
||||
|
public interface FinVehicleInvoiceFeign { |
||||
|
|
||||
|
@ApiOperation("根据条件分页查询数据的列表") |
||||
|
@PostMapping("/listPage") |
||||
|
public ResultBean<PagerVo<FinVehicleInvoiceVo>> listPage(@RequestBody PagerQuery<FinVehicleInvoiceQuery> pq); |
||||
|
|
||||
|
@ApiOperation("根据条件查询所有数据列表") |
||||
|
@PostMapping("/listAll") |
||||
|
public ResultBean<List<FinVehicleInvoiceVo>> listAll(@RequestBody FinVehicleInvoiceQuery query); |
||||
|
|
||||
|
@ApiOperation("所有数据列表") |
||||
|
@GetMapping("/list") |
||||
|
public ResultBean<List<FinVehicleInvoiceVo>> list(); |
||||
|
|
||||
|
@ApiOperation("新增保存") |
||||
|
@PostMapping("/save") |
||||
|
public ResultBean save(@RequestBody FinVehicleInvoiceDto dto); |
||||
|
|
||||
|
@ApiOperation("修改保存") |
||||
|
@PostMapping("/update/{sid}") |
||||
|
public ResultBean update(@RequestBody FinVehicleInvoiceDto dto, @PathVariable("sid") String sid); |
||||
|
|
||||
|
@ApiOperation("图片上传") |
||||
|
@ApiImplicitParam(name = "file", value = "文件", required = true, dataType = "MultipartFile", dataTypeClass = MultipartFile.class) |
||||
|
@PostMapping("/pictureUpload") |
||||
|
public ResultBean pictureUpload(@RequestParam(value = "sid")String sid,@RequestParam(value = "file") MultipartFile file); |
||||
|
|
||||
|
@ApiOperation("删除记录") |
||||
|
@GetMapping("/del/{ids}") |
||||
|
public ResultBean del(@PathVariable("ids") String ids); |
||||
|
|
||||
|
@ApiOperation("获取一条记录") |
||||
|
@GetMapping("/fetch/{id}") |
||||
|
public ResultBean<FinVehicleInvoiceVo> fetch(@PathVariable("id") String id); |
||||
|
|
||||
|
@ApiOperation("获取详情记录") |
||||
|
@GetMapping("/fetchSid/{sid}") |
||||
|
public ResultBean<FinVehicleInvoiceDetailsVo> fetchBySid(@PathVariable("sid") String sid); |
||||
|
|
||||
|
@PostMapping("/exportExcel") |
||||
|
@ApiOperation(value = "车辆发票信息列表导出") |
||||
|
@ResponseBody |
||||
|
public void exportExcel(@RequestBody FinVehicleInvoiceQuery query); |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,83 @@ |
|||||
|
package com.yxt.anrui.fin.api.finvehicleinvoice; |
||||
|
|
||||
|
import com.yxt.common.core.query.PagerQuery; |
||||
|
import com.yxt.common.core.result.ResultBean; |
||||
|
import com.yxt.common.core.vo.PagerVo; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
import org.springframework.web.multipart.MultipartFile; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* Project: anrui-fin(财务管理) <br/> |
||||
|
* File: FinVehicleInvoiceFeignFallback.java <br/> |
||||
|
* Class: com.yxt.anrui.fin.api.finvehicleinvoice.FinVehicleInvoiceFeignFallback <br/> |
||||
|
* Description: 车辆发票信息. <br/> |
||||
|
* Copyright: Copyright (c) 2011 <br/> |
||||
|
* Company: https://gitee.com/liuzp315 <br/>
|
||||
|
* Makedate: 2021-10-27 09:36:11 <br/> |
||||
|
* |
||||
|
* @author liupopo |
||||
|
* @version 1.0 |
||||
|
* @since 1.0 |
||||
|
*/ |
||||
|
@Component |
||||
|
public class FinVehicleInvoiceFeignFallback implements FinVehicleInvoiceFeign { |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean<PagerVo<FinVehicleInvoiceVo>> listPage(PagerQuery<FinVehicleInvoiceQuery> pq){ |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
return rb.setMsg("接口anrui-fin/finvehicleinvoice/listPage无法访问"); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean<List<FinVehicleInvoiceVo>> listAll(FinVehicleInvoiceQuery query){ |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
return rb.setMsg("接口anrui-fin/finvehicleinvoice/listAll无法访问"); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean<List<FinVehicleInvoiceVo>> list(){ |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
return rb.setMsg("接口anrui-fin/finvehicleinvoice/list无法访问"); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean save(FinVehicleInvoiceDto dto){ |
||||
|
return ResultBean.fireFail().setMsg("接口anrui-fin/finvehicleinvoice/save无法访问"); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean update(FinVehicleInvoiceDto dto, String sid){ |
||||
|
return ResultBean.fireFail().setMsg("接口anrui-fin/finvehicleinvoice/update无法访问"); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean pictureUpload(String sid, MultipartFile file) { |
||||
|
return ResultBean.fireFail().setMsg("接口anrui-fin/finvehicleinvoice/pictureUpload无法访问"); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean del(String ids){ |
||||
|
return ResultBean.fireFail().setMsg("接口anrui-fin/finvehicleinvoice/del无法访问"); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean<FinVehicleInvoiceVo> fetch(String id){ |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
return rb.setMsg("接口anrui-fin/finvehicleinvoice/fetch无法访问"); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean<FinVehicleInvoiceDetailsVo> fetchBySid(String sid){ |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
return rb.setMsg("接口anrui-fin/finvehicleinvoice/fetch无法访问"); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public void exportExcel(FinVehicleInvoiceQuery query) { |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,68 @@ |
|||||
|
package com.yxt.anrui.fin.api.finvehicleinvoice; |
||||
|
|
||||
|
|
||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
|
import com.yxt.common.core.query.Query; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
import java.util.Date; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* Project: anrui-fin(财务管理) <br/> |
||||
|
* File: FinVehicleInvoiceQuery.java <br/> |
||||
|
* Class: com.yxt.anrui.fin.api.finvehicleinvoice.FinVehicleInvoiceQuery <br/> |
||||
|
* Description: 车辆发票信息 查询条件. <br/> |
||||
|
* Copyright: Copyright (c) 2011 <br/> |
||||
|
* Company: https://gitee.com/liuzp315 <br/>
|
||||
|
* Makedate: 2021-10-27 09:36:11 <br/> |
||||
|
* |
||||
|
* @author liupopo |
||||
|
* @version 1.0 |
||||
|
* @since 1.0 |
||||
|
*/ |
||||
|
@ApiModel(value = "车辆发票信息 查询条件", description = "车辆发票信息 查询条件") |
||||
|
@Data |
||||
|
public class FinVehicleInvoiceQuery implements Query { |
||||
|
|
||||
|
|
||||
|
@ApiModelProperty(value = "sids", required = false) |
||||
|
private List<String> sids; |
||||
|
|
||||
|
@ApiModelProperty("开票单位") |
||||
|
private String invoiceTitle; |
||||
|
|
||||
|
@ApiModelProperty("发票类别") |
||||
|
private String invoiceType; |
||||
|
|
||||
|
@ApiModelProperty("合同编号") |
||||
|
private String contractNo; |
||||
|
|
||||
|
@ApiModelProperty("客户名称") |
||||
|
private String customerName; |
||||
|
|
||||
|
@ApiModelProperty("车架号") |
||||
|
private String VIN; |
||||
|
|
||||
|
@ApiModelProperty("发票状态") |
||||
|
private String state; |
||||
|
|
||||
|
@ApiModelProperty("移交状态") |
||||
|
private String invoiceState; |
||||
|
|
||||
|
@ApiModelProperty("开票名称") |
||||
|
private String invoiceName; |
||||
|
|
||||
|
@ApiModelProperty("开票开始日期") |
||||
|
private String createStartTime ; |
||||
|
|
||||
|
@ApiModelProperty("开票结束日期") |
||||
|
private String createEndTime ; |
||||
|
|
||||
|
@ApiModelProperty("发票代码") |
||||
|
private String invoiceCode; |
||||
|
|
||||
|
} |
@ -0,0 +1,74 @@ |
|||||
|
package com.yxt.anrui.fin.api.finvehicleinvoice; |
||||
|
|
||||
|
|
||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
|
import com.yxt.common.core.vo.Vo; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* Project: anrui-fin(财务管理) <br/> |
||||
|
* File: FinVehicleInvoiceVo.java <br/> |
||||
|
* Class: com.yxt.anrui.fin.api.finvehicleinvoice.FinVehicleInvoiceVo <br/> |
||||
|
* Description: 车辆发票信息 视图数据对象. <br/> |
||||
|
* Copyright: Copyright (c) 2011 <br/> |
||||
|
* Company: https://gitee.com/liuzp315 <br/>
|
||||
|
* Makedate: 2021-10-27 09:36:11 <br/> |
||||
|
* |
||||
|
* @author liupopo |
||||
|
* @version 1.0 |
||||
|
* @since 1.0 |
||||
|
*/ |
||||
|
@ApiModel(value = "车辆发票信息 视图数据对象", description = "车辆发票信息 视图数据对象") |
||||
|
@Data |
||||
|
public class FinVehicleInvoiceVo implements Vo { |
||||
|
|
||||
|
|
||||
|
@ApiModelProperty("车辆发票信息Sid") |
||||
|
private String Sid; |
||||
|
|
||||
|
@ApiModelProperty("发票状态") |
||||
|
private String state; |
||||
|
|
||||
|
@ApiModelProperty("交接状态") |
||||
|
private String invoiceState; |
||||
|
|
||||
|
@ApiModelProperty("开票单位") |
||||
|
private String invoiceTitle; |
||||
|
|
||||
|
@ApiModelProperty("开票类型") |
||||
|
private String invoiceType; |
||||
|
|
||||
|
@ApiModelProperty("合同编号") |
||||
|
private String contractNo; |
||||
|
|
||||
|
@ApiModelProperty("客户名称") |
||||
|
private String customerName; |
||||
|
|
||||
|
@ApiModelProperty("车架号") |
||||
|
private String VIN; |
||||
|
|
||||
|
@ApiModelProperty("开票名称") |
||||
|
private String invoiceName; |
||||
|
|
||||
|
@ApiModelProperty("开票金额") |
||||
|
private String invoiceAmount; |
||||
|
|
||||
|
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") |
||||
|
@ApiModelProperty("开票日期") |
||||
|
private Date createTime; |
||||
|
|
||||
|
@ApiModelProperty("发票代码") |
||||
|
private String invoiceCode; |
||||
|
|
||||
|
@ApiModelProperty("发票号") |
||||
|
private String invoiceNo; |
||||
|
|
||||
|
@ApiModelProperty("发票图片") |
||||
|
private String filePath; |
||||
|
|
||||
|
} |
@ -0,0 +1,50 @@ |
|||||
|
package com.yxt.anrui.fin.biz.finvehicleinvoice; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
import com.baomidou.mybatisplus.core.toolkit.Constants; |
||||
|
import com.yxt.anrui.fin.api.finvehicleinvoice.FinVehicleInvoice; |
||||
|
import com.yxt.anrui.fin.api.finvehicleinvoice.FinVehicleInvoiceDetailsVo; |
||||
|
import com.yxt.anrui.fin.api.finvehicleinvoice.FinVehicleInvoiceExportVo; |
||||
|
import com.yxt.anrui.fin.api.finvehicleinvoice.FinVehicleInvoiceVo; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
import org.apache.ibatis.annotations.Select; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* Project: anrui-fin(财务管理) <br/> |
||||
|
* File: FinVehicleInvoiceMapper.java <br/> |
||||
|
* Class: com.yxt.anrui.fin.biz.finvehicleinvoice.FinVehicleInvoiceMapper <br/> |
||||
|
* Description: 车辆发票信息. <br/> |
||||
|
* Copyright: Copyright (c) 2011 <br/> |
||||
|
* Company: https://gitee.com/liuzp315 <br/>
|
||||
|
* Makedate: 2021-10-27 09:36:11 <br/> |
||||
|
* |
||||
|
* @author liupopo |
||||
|
* @version 1.0 |
||||
|
* @since 1.0 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface FinVehicleInvoiceMapper extends BaseMapper<FinVehicleInvoice> { |
||||
|
|
||||
|
//@Update("update fin_vehicle_invoice set name=#{msg} where id=#{id}")
|
||||
|
//IPage<FinVehicleInvoiceVo> voPage(IPage<FinVehicleInvoice> page, @Param(Constants.WRAPPER) QueryWrapper<FinVehicleInvoice> qw);
|
||||
|
|
||||
|
IPage<FinVehicleInvoiceVo> selectPageVo(IPage<FinVehicleInvoice> page, @Param(Constants.WRAPPER) Wrapper<FinVehicleInvoice> qw); |
||||
|
|
||||
|
List<FinVehicleInvoiceVo> selectListAllVo(@Param(Constants.WRAPPER) Wrapper<FinVehicleInvoice> qw); |
||||
|
|
||||
|
@Select("select * from fin_vehicle_invoice where isDelete = '0'") |
||||
|
List<FinVehicleInvoiceVo> selectListVo(); |
||||
|
|
||||
|
List<FinVehicleInvoiceExportVo> selByExcel(@Param(Constants.WRAPPER)QueryWrapper<FinVehicleInvoiceExportVo> qw); |
||||
|
|
||||
|
|
||||
|
Boolean updatePictureBySid(String state,String filePath,String sid); |
||||
|
|
||||
|
FinVehicleInvoiceDetailsVo getInvoiceDetailsBySid(String sid); |
||||
|
} |
@ -0,0 +1,85 @@ |
|||||
|
<?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.yxt.anrui.fin.biz.finvehicleinvoice.FinVehicleInvoiceMapper"> |
||||
|
|
||||
|
<!-- <where> ${ew.sqlSegment} </where>--> |
||||
|
<!-- ${ew.customSqlSegment} --> |
||||
|
<select id="selectPageVo" resultType="com.yxt.anrui.fin.api.finvehicleinvoice.FinVehicleInvoiceVo"> |
||||
|
SELECT DISTINCT |
||||
|
sid, |
||||
|
`state`, |
||||
|
invoiceState, |
||||
|
invoiceTitle, |
||||
|
invoiceType, |
||||
|
contractNo, |
||||
|
customerName, |
||||
|
VIN, |
||||
|
invoiceName, |
||||
|
invoiceAmount, |
||||
|
createTime, |
||||
|
invoiceCode, |
||||
|
invoiceNo, |
||||
|
filePath |
||||
|
FROM fin_vehicle_invoice |
||||
|
<where> |
||||
|
${ew.sqlSegment} |
||||
|
</where> |
||||
|
</select> |
||||
|
|
||||
|
<select id="selectListAllVo" resultType="com.yxt.anrui.fin.api.finvehicleinvoice.FinVehicleInvoiceVo"> |
||||
|
SELECT * FROM fin_vehicle_invoice |
||||
|
<where>${ew.sqlSegment}</where> |
||||
|
</select> |
||||
|
<select id="selByExcel" resultType="com.yxt.anrui.fin.api.finvehicleinvoice.FinVehicleInvoiceExportVo"> |
||||
|
SELECT DISTINCT |
||||
|
sid, |
||||
|
`state`, |
||||
|
invoiceState, |
||||
|
invoiceTitle, |
||||
|
invoiceType, |
||||
|
contractNo, |
||||
|
customerName, |
||||
|
VIN, |
||||
|
invoiceName, |
||||
|
invoiceAmount, |
||||
|
createTime, |
||||
|
invoiceCode, |
||||
|
invoiceNo, |
||||
|
filePath |
||||
|
FROM fin_vehicle_invoice |
||||
|
<where> |
||||
|
${ew.sqlSegment} |
||||
|
</where> |
||||
|
</select> |
||||
|
|
||||
|
<select id="getInvoiceDetailsBySid" |
||||
|
resultType="com.yxt.anrui.fin.api.finvehicleinvoice.FinVehicleInvoiceDetailsVo"> |
||||
|
SELECT DISTINCT |
||||
|
si.`name`, |
||||
|
v.sid, |
||||
|
v.invoiceTitle, |
||||
|
v.contractNo, |
||||
|
v.customerName, |
||||
|
v.VIN, |
||||
|
v.invoiceType, |
||||
|
v.invoiceAmount, |
||||
|
v.`state`, |
||||
|
v.invoiceName, |
||||
|
v.createTime, |
||||
|
v.invoiceNo, |
||||
|
v.invoiceCode, |
||||
|
v.filePath |
||||
|
FROM fin_vehicle_invoice AS v |
||||
|
LEFT JOIN anrui_portal.sys_user AS u ON v.createBySid = u.sid |
||||
|
LEFT JOIN anrui_portal.sys_staffinfo AS si ON u.staffSid = si.sid |
||||
|
WHERE v.isDelete = '0' AND v.sid = #{sid} |
||||
|
</select> |
||||
|
|
||||
|
<update id="updatePictureBySid"> |
||||
|
Update fin_vehicle_invoice |
||||
|
Set |
||||
|
`state` = #{arg0}, |
||||
|
filePath = #{arg1} |
||||
|
Where sid = #{arg2} |
||||
|
</update> |
||||
|
</mapper> |
@ -0,0 +1,238 @@ |
|||||
|
package com.yxt.anrui.fin.biz.finvehicleinvoice; |
||||
|
import com.yxt.anrui.fin.api.finvehicleinvoice.*; |
||||
|
import com.yxt.common.base.config.component.FileUploadComponent; |
||||
|
import com.yxt.common.base.utils.ExportExcelUtils; |
||||
|
import com.yxt.common.base.utils.StringUtils; |
||||
|
import com.yxt.common.core.query.PagerQuery; |
||||
|
import com.yxt.common.core.result.FileUploadResult; |
||||
|
import com.yxt.common.core.result.ResultBean; |
||||
|
import com.yxt.common.core.vo.PagerVo; |
||||
|
import io.swagger.annotations.Api; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
import org.springframework.web.multipart.MultipartFile; |
||||
|
|
||||
|
import javax.annotation.Resource; |
||||
|
import javax.servlet.http.HttpServletResponse; |
||||
|
import java.io.UnsupportedEncodingException; |
||||
|
import java.net.URLEncoder; |
||||
|
import java.text.ParseException; |
||||
|
import java.text.SimpleDateFormat; |
||||
|
import java.util.Date; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* Project: anrui-fin(财务管理) <br/> |
||||
|
* File: FinVehicleInvoiceFeignFallback.java <br/> |
||||
|
* Class: com.yxt.anrui.fin.biz.finvehicleinvoice.FinVehicleInvoiceRest <br/> |
||||
|
* Description: 车辆发票信息. <br/> |
||||
|
* Copyright: Copyright (c) 2011 <br/> |
||||
|
* Company: https://gitee.com/liuzp315 <br/>
|
||||
|
* Makedate: 2021-10-27 09:36:11 <br/> |
||||
|
* |
||||
|
* @author liupopo |
||||
|
* @version 1.0 |
||||
|
* @since 1.0 |
||||
|
*/ |
||||
|
@Api(tags = "车辆发票信息") |
||||
|
@RestController |
||||
|
@RequestMapping("v1/finvehicleinvoice") |
||||
|
public class FinVehicleInvoiceRest implements FinVehicleInvoiceFeign { |
||||
|
|
||||
|
@Autowired |
||||
|
private FinVehicleInvoiceService finVehicleInvoiceService; |
||||
|
|
||||
|
@Resource |
||||
|
private FileUploadComponent fileUploadComponent; |
||||
|
|
||||
|
@Autowired |
||||
|
private HttpServletResponse response; |
||||
|
|
||||
|
private List<FinVehicleInvoiceVo> setVo(List<FinVehicleInvoiceVo> list) { |
||||
|
for (FinVehicleInvoiceVo finVehicleInvoiceVo : list) { |
||||
|
if (StringUtils.isNotBlank(finVehicleInvoiceVo.getState())) { |
||||
|
String state = finVehicleInvoiceVo.getState(); |
||||
|
if (state.equals("0")) { |
||||
|
finVehicleInvoiceVo.setState("未开票"); |
||||
|
}else if (state.equals("1")) { |
||||
|
finVehicleInvoiceVo.setState("已开票"); |
||||
|
}else if (state.equals("2")) { |
||||
|
finVehicleInvoiceVo.setState("作废"); |
||||
|
} |
||||
|
} |
||||
|
if (StringUtils.isNotBlank(finVehicleInvoiceVo.getInvoiceState())) { |
||||
|
String invoiceState = finVehicleInvoiceVo.getInvoiceState(); |
||||
|
if (invoiceState.equals("0")) { |
||||
|
finVehicleInvoiceVo.setInvoiceState("未移交"); |
||||
|
} else if (invoiceState.equals("1")) { |
||||
|
finVehicleInvoiceVo.setInvoiceState("已移交"); |
||||
|
} |
||||
|
} |
||||
|
if (StringUtils.isNotBlank(finVehicleInvoiceVo.getFilePath())) { |
||||
|
String filePath = finVehicleInvoiceVo.getFilePath(); |
||||
|
String urlPrefix = fileUploadComponent.getUrlPrefix(); |
||||
|
filePath = urlPrefix + filePath; |
||||
|
finVehicleInvoiceVo.setFilePath(filePath); |
||||
|
} |
||||
|
} |
||||
|
return list; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean<PagerVo<FinVehicleInvoiceVo>> listPage(@RequestBody PagerQuery<FinVehicleInvoiceQuery> pq){ |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
PagerVo<FinVehicleInvoiceVo> pv = finVehicleInvoiceService.listPageVo(pq); |
||||
|
List<FinVehicleInvoiceVo> records = pv.getRecords(); |
||||
|
List<FinVehicleInvoiceVo> finVehicleInvoiceVos = setVo(records); |
||||
|
pv.setRecords(finVehicleInvoiceVos); |
||||
|
return rb.success().setData(pv); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean<List<FinVehicleInvoiceVo>> listAll(@RequestBody FinVehicleInvoiceQuery query){ |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
List<FinVehicleInvoiceVo> list = finVehicleInvoiceService.listAllVo(query); |
||||
|
List<FinVehicleInvoiceVo> finVehicleInvoiceVos = setVo(list); |
||||
|
return rb.success().setData(finVehicleInvoiceVos); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean<List<FinVehicleInvoiceVo>> list(){ |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
List<FinVehicleInvoiceVo> list = finVehicleInvoiceService.listVo(); |
||||
|
List<FinVehicleInvoiceVo> finVehicleInvoiceVos = setVo(list); |
||||
|
return rb.success().setData(finVehicleInvoiceVos); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean save(FinVehicleInvoiceDto dto){ |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
finVehicleInvoiceService.saveOrUpdateDto(dto); |
||||
|
return rb.success(); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean update(FinVehicleInvoiceDto dto,String sid){ |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
finVehicleInvoiceService.updateBySid(dto.toMap(),sid); |
||||
|
return rb.success(); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean del(String ids){ |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
finVehicleInvoiceService.delByIds(ids); |
||||
|
return rb.success(); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean<FinVehicleInvoiceVo> fetch(String id){ |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
FinVehicleInvoiceVo vo = finVehicleInvoiceService.fetchByIdVo(id); |
||||
|
return rb.success().setData(vo); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean<FinVehicleInvoiceDetailsVo> fetchBySid(String sid){ |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
FinVehicleInvoiceDetailsVo vo = finVehicleInvoiceService.getInvoiceDetailsBySid(sid); |
||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
||||
|
if (StringUtils.isNotBlank(vo.getState())) { |
||||
|
String state = vo.getState(); |
||||
|
if (state.equals("0")) { |
||||
|
vo.setState("未开票"); |
||||
|
}else if (state.equals("1")) { |
||||
|
vo.setState("已开票"); |
||||
|
}else if (state.equals("2")) { |
||||
|
vo.setState("作废"); |
||||
|
} |
||||
|
} |
||||
|
if (StringUtils.isNotBlank(vo.getCreateTime())) { |
||||
|
String createTime = vo.getCreateTime(); |
||||
|
try { |
||||
|
Date date = sdf.parse(createTime); |
||||
|
String createTimeBySdf = sdf.format(date); |
||||
|
vo.setCreateTime(createTimeBySdf); |
||||
|
} catch (ParseException e) { |
||||
|
e.printStackTrace(); |
||||
|
} |
||||
|
} |
||||
|
if (StringUtils.isNotBlank(vo.getFilePath())) { |
||||
|
String filePath = vo.getFilePath(); |
||||
|
String urlPrefix = fileUploadComponent.getUrlPrefix(); |
||||
|
filePath = urlPrefix + filePath; |
||||
|
vo.setFilePath(filePath); |
||||
|
} |
||||
|
return rb.success().setData(vo); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public void exportExcel(FinVehicleInvoiceQuery query) { |
||||
|
//得到所有要导出的数据
|
||||
|
List<FinVehicleInvoiceExportVo> invoiceExportVoList = finVehicleInvoiceService.listExcel(query); |
||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
||||
|
for (FinVehicleInvoiceExportVo invoiceExportVo : invoiceExportVoList) { |
||||
|
if (StringUtils.isNotBlank(invoiceExportVo.getState())) { |
||||
|
String state = invoiceExportVo.getState(); |
||||
|
if (state.equals("0")) { |
||||
|
invoiceExportVo.setState("未开票"); |
||||
|
}else if (state.equals("1")) { |
||||
|
invoiceExportVo.setState("已开票"); |
||||
|
}else if (state.equals("2")) { |
||||
|
invoiceExportVo.setState("作废"); |
||||
|
} |
||||
|
} |
||||
|
if (StringUtils.isNotBlank(invoiceExportVo.getInvoiceState())) { |
||||
|
String invoiceState = invoiceExportVo.getInvoiceState(); |
||||
|
if (invoiceState.equals("0")) { |
||||
|
invoiceExportVo.setInvoiceState("未移交"); |
||||
|
} else if (invoiceState.equals("1")) { |
||||
|
invoiceExportVo.setInvoiceState("已移交"); |
||||
|
} |
||||
|
} |
||||
|
if (StringUtils.isNotBlank(invoiceExportVo.getCreateTime())) { |
||||
|
String createTime = invoiceExportVo.getCreateTime(); |
||||
|
try { |
||||
|
Date date = sdf.parse(createTime); |
||||
|
String createTimeBySdf = sdf.format(date); |
||||
|
invoiceExportVo.setCreateTime(createTimeBySdf); |
||||
|
} catch (ParseException e) { |
||||
|
e.printStackTrace(); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
//定义导出的excel名字
|
||||
|
String excelName = "车辆发票信息列表"; |
||||
|
String fileNameURL = ""; |
||||
|
try { |
||||
|
fileNameURL = URLEncoder.encode(excelName, "UTF-8"); |
||||
|
} catch (UnsupportedEncodingException e) { |
||||
|
e.printStackTrace(); |
||||
|
} |
||||
|
//导出车辆管理列表
|
||||
|
ExportExcelUtils.export(fileNameURL, invoiceExportVoList, FinVehicleInvoiceExportVo.class, response); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean pictureUpload(String sid,MultipartFile file) { |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
if (file == null || file.isEmpty()) { |
||||
|
return rb.setMsg("文件为空"); |
||||
|
} |
||||
|
rb = fileUploadComponent.uploadFile(file); |
||||
|
FileUploadResult data = (FileUploadResult) rb.getData(); |
||||
|
FinVehicleInvoiceDetailsVo invoice= finVehicleInvoiceService.getInvoiceDetailsBySid(sid); |
||||
|
invoice.setFilePath(data.getFilePath()); |
||||
|
String filePath = invoice.getFilePath(); |
||||
|
invoice.setState("1"); |
||||
|
String state = invoice.getState(); |
||||
|
Boolean isSuccess = finVehicleInvoiceService.updatePictureBySid(state,filePath,sid); |
||||
|
if (isSuccess) { |
||||
|
return rb.success().setMsg("上传成功"); |
||||
|
}else { |
||||
|
return rb.fail().setMsg("上传失败"); |
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,169 @@ |
|||||
|
package com.yxt.anrui.fin.biz.finvehicleinvoice; |
||||
|
|
||||
|
import cn.hutool.core.bean.BeanUtil; |
||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
import com.yxt.anrui.fin.api.finvehicleinvoice.*; |
||||
|
import com.yxt.common.base.service.MybatisBaseService; |
||||
|
import com.yxt.common.base.utils.PagerUtil; |
||||
|
import com.yxt.common.core.query.PagerQuery; |
||||
|
import com.yxt.common.core.vo.PagerVo; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* Project: anrui-fin(财务管理) <br/> |
||||
|
* File: FinVehicleInvoiceService.java <br/> |
||||
|
* Class: com.yxt.anrui.fin.biz.finvehicleinvoice.FinVehicleInvoiceService <br/> |
||||
|
* Description: 车辆发票信息 业务逻辑. <br/> |
||||
|
* Copyright: Copyright (c) 2011 <br/> |
||||
|
* Company: https://gitee.com/liuzp315 <br/>
|
||||
|
* Makedate: 2021-10-27 09:36:11 <br/> |
||||
|
* |
||||
|
* @author liupopo |
||||
|
* @version 1.0 |
||||
|
* @since 1.0 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class FinVehicleInvoiceService extends MybatisBaseService<FinVehicleInvoiceMapper, FinVehicleInvoice> { |
||||
|
public PagerVo<FinVehicleInvoice> listPage(PagerQuery<FinVehicleInvoiceQuery> pq) { |
||||
|
FinVehicleInvoiceQuery query = pq.getParams(); |
||||
|
QueryWrapper<FinVehicleInvoice> qw = createQueryWrapper(query); |
||||
|
IPage<FinVehicleInvoice> page = PagerUtil.queryToPage(pq); |
||||
|
IPage<FinVehicleInvoice> pagging = baseMapper.selectPage(page, qw); |
||||
|
PagerVo<FinVehicleInvoice> p = PagerUtil.pageToVo(pagging, null); |
||||
|
return p; |
||||
|
} |
||||
|
|
||||
|
public List<FinVehicleInvoice> listAll(FinVehicleInvoiceQuery query) { |
||||
|
QueryWrapper<FinVehicleInvoice> qw = createQueryWrapper(query); |
||||
|
return baseMapper.selectList(qw); |
||||
|
} |
||||
|
|
||||
|
private QueryWrapper<FinVehicleInvoice> createQueryWrapper(FinVehicleInvoiceQuery query) { |
||||
|
// todo: 这里根据具体业务调整查询条件
|
||||
|
// 多字段Like示例:qw.and(wrapper -> wrapper.like("name", query.getName()).or().like("remark", query.getName()));
|
||||
|
QueryWrapper<FinVehicleInvoice> qw = new QueryWrapper<>(); |
||||
|
|
||||
|
qw.eq("isDelete", "0"); |
||||
|
if (StringUtils.isNotBlank(query.getInvoiceTitle())) { |
||||
|
qw.like("invoiceTitle", query.getInvoiceTitle()); |
||||
|
} |
||||
|
if (StringUtils.isNotBlank(query.getInvoiceType())) { |
||||
|
qw.like("invoiceType", query.getInvoiceType()); |
||||
|
} |
||||
|
if (StringUtils.isNotBlank(query.getContractNo())) { |
||||
|
qw.like("contractNo", query.getContractNo()); |
||||
|
} |
||||
|
if (StringUtils.isNotBlank(query.getCustomerName())) { |
||||
|
qw.like("customerName", query.getCustomerName()); |
||||
|
} |
||||
|
if (StringUtils.isNotBlank(query.getVIN())) { |
||||
|
qw.like("VIN", query.getVIN()); |
||||
|
} |
||||
|
if (StringUtils.isNotBlank(query.getState())) { |
||||
|
qw.eq("state", query.getState()); |
||||
|
} |
||||
|
if (StringUtils.isNotBlank(query.getInvoiceState())) { |
||||
|
qw.eq("invoiceState", query.getInvoiceState()); |
||||
|
} |
||||
|
if (StringUtils.isNotBlank(query.getInvoiceName())) { |
||||
|
qw.like("invoiceName", query.getInvoiceName()); |
||||
|
} |
||||
|
if (StringUtils.isNotBlank(query.getInvoiceCode())) { |
||||
|
qw.like("invoiceCode", query.getInvoiceCode()); |
||||
|
} |
||||
|
String createStartTime = query.getCreateStartTime(); |
||||
|
String createEndTime = query.getCreateEndTime(); |
||||
|
qw.apply(org.apache.commons.lang3.StringUtils.isNotEmpty(createStartTime), "date_format (vi.createTime,'%Y-%m-%d') >= date_format('" + createStartTime + "','%Y-%m-%d')"). |
||||
|
apply(org.apache.commons.lang3.StringUtils.isNotEmpty(createEndTime), "date_format (vi.createTime,'%Y-%m-%d') <= date_format('" + createEndTime + "','%Y-%m-%d')" |
||||
|
); |
||||
|
return qw; |
||||
|
} |
||||
|
|
||||
|
public PagerVo<FinVehicleInvoiceVo> listPageVo(PagerQuery<FinVehicleInvoiceQuery> pq) { |
||||
|
FinVehicleInvoiceQuery query = pq.getParams(); |
||||
|
QueryWrapper<FinVehicleInvoice> qw = createQueryWrapper(query); |
||||
|
IPage<FinVehicleInvoice> page = PagerUtil.queryToPage(pq); |
||||
|
IPage<FinVehicleInvoiceVo> pagging = baseMapper.selectPageVo(page, qw); |
||||
|
PagerVo<FinVehicleInvoiceVo> p = PagerUtil.pageToVo(pagging, null); |
||||
|
return p; |
||||
|
} |
||||
|
|
||||
|
public List<FinVehicleInvoiceVo> listAllVo(FinVehicleInvoiceQuery query) { |
||||
|
QueryWrapper<FinVehicleInvoice> qw = createQueryWrapper(query); |
||||
|
return baseMapper.selectListAllVo(qw); |
||||
|
} |
||||
|
|
||||
|
public List<FinVehicleInvoiceVo> listVo() { |
||||
|
return baseMapper.selectListVo(); |
||||
|
} |
||||
|
|
||||
|
public void saveOrUpdateDto(FinVehicleInvoiceDto dto) { |
||||
|
FinVehicleInvoice entity = new FinVehicleInvoice(); |
||||
|
dto.fillEntity(entity); |
||||
|
this.saveOrUpdate(entity); |
||||
|
} |
||||
|
|
||||
|
public FinVehicleInvoiceVo fetchByIdVo(String id) { |
||||
|
FinVehicleInvoice entity = this.fetchById(id); |
||||
|
FinVehicleInvoiceVo vo = new FinVehicleInvoiceVo(); |
||||
|
BeanUtil.copyProperties(entity, vo); |
||||
|
return vo; |
||||
|
} |
||||
|
|
||||
|
public List<FinVehicleInvoiceExportVo> listExcel(FinVehicleInvoiceQuery query) { |
||||
|
QueryWrapper<FinVehicleInvoiceExportVo> qw = new QueryWrapper<>(); |
||||
|
qw.eq("isDelete", "0"); |
||||
|
if (StringUtils.isNotBlank(query.getInvoiceTitle())) { |
||||
|
qw.like("invoiceTitle", query.getInvoiceTitle()); |
||||
|
} |
||||
|
if (StringUtils.isNotBlank(query.getInvoiceType())) { |
||||
|
qw.like("invoiceType", query.getInvoiceType()); |
||||
|
} |
||||
|
if (StringUtils.isNotBlank(query.getContractNo())) { |
||||
|
qw.like("contractNo", query.getContractNo()); |
||||
|
} |
||||
|
if (StringUtils.isNotBlank(query.getCustomerName())) { |
||||
|
qw.like("customerName", query.getCustomerName()); |
||||
|
} |
||||
|
if (StringUtils.isNotBlank(query.getVIN())) { |
||||
|
qw.like("VIN", query.getVIN()); |
||||
|
} |
||||
|
if (StringUtils.isNotBlank(query.getState())) { |
||||
|
qw.eq("state", query.getState()); |
||||
|
} |
||||
|
if (StringUtils.isNotBlank(query.getInvoiceState())) { |
||||
|
qw.eq("invoiceState", query.getInvoiceState()); |
||||
|
} |
||||
|
if (StringUtils.isNotBlank(query.getInvoiceName())) { |
||||
|
qw.like("invoiceName", query.getInvoiceName()); |
||||
|
} |
||||
|
if (StringUtils.isNotBlank(query.getInvoiceCode())) { |
||||
|
qw.like("invoiceCode", query.getInvoiceCode()); |
||||
|
} |
||||
|
String createStartTime = query.getCreateStartTime(); |
||||
|
String createEndTime = query.getCreateEndTime(); |
||||
|
qw.apply(org.apache.commons.lang3.StringUtils.isNotEmpty(createStartTime), "date_format (vi.createTime,'%Y-%m-%d') >= date_format('" + createStartTime + "','%Y-%m-%d')"). |
||||
|
apply(org.apache.commons.lang3.StringUtils.isNotEmpty(createEndTime), "date_format (vi.createTime,'%Y-%m-%d') <= date_format('" + createEndTime + "','%Y-%m-%d')" |
||||
|
); |
||||
|
List<FinVehicleInvoiceExportVo> invoiceExportVoList = baseMapper.selByExcel(qw); |
||||
|
int id = 1; |
||||
|
for (FinVehicleInvoiceExportVo invoiceExportVo : invoiceExportVoList) { |
||||
|
invoiceExportVo.setRankNo(id); |
||||
|
id = id + 1; |
||||
|
} |
||||
|
return invoiceExportVoList; |
||||
|
} |
||||
|
|
||||
|
public FinVehicleInvoiceDetailsVo getInvoiceDetailsBySid(String sid) { |
||||
|
FinVehicleInvoiceDetailsVo vo = baseMapper.getInvoiceDetailsBySid(sid); |
||||
|
return vo; |
||||
|
} |
||||
|
|
||||
|
public Boolean updatePictureBySid(String filePath,String state,String sid) { |
||||
|
return baseMapper.updatePictureBySid(filePath,state,sid); |
||||
|
} |
||||
|
} |
Loading…
Reference in new issue