增加供应商、用户流水
This commit is contained in:
parent
a3f575b931
commit
c2bd501ff2
|
|
@ -0,0 +1,22 @@
|
|||
-- 菜单 SQL
|
||||
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('客户账户流水', '3', '1', 'customerTransaction', 'wms/customerTransaction/index', 1, 0, 'C', '0', '0', 'wms:customerTransaction:list', '#', 1, sysdate(), '', null, '客户账户流水菜单');
|
||||
|
||||
-- 按钮父菜单ID
|
||||
SELECT @parentId := LAST_INSERT_ID();
|
||||
|
||||
-- 按钮 SQL
|
||||
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('客户账户流水查询', @parentId, '1', '#', '', 1, 0, 'F', '0', '0', 'wms:customerTransaction:query', '#', 1, sysdate(), '', null, '');
|
||||
|
||||
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('客户账户流水新增', @parentId, '2', '#', '', 1, 0, 'F', '0', '0', 'wms:customerTransaction:add', '#', 1, sysdate(), '', null, '');
|
||||
|
||||
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('客户账户流水修改', @parentId, '3', '#', '', 1, 0, 'F', '0', '0', 'wms:customerTransaction:edit', '#', 1, sysdate(), '', null, '');
|
||||
|
||||
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('客户账户流水删除', @parentId, '4', '#', '', 1, 0, 'F', '0', '0', 'wms:customerTransaction:remove', '#', 1, sysdate(), '', null, '');
|
||||
|
||||
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('客户账户流水导出', @parentId, '5', '#', '', 1, 0, 'F', '0', '0', 'wms:customerTransaction:export', '#', 1, sysdate(), '', null, '');
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
-- 菜单 SQL
|
||||
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('供应商账户流水', '3', '1', 'supplierTransaction', 'wms/supplierTransaction/index', 1, 0, 'C', '0', '0', 'wms:supplierTransaction:list', '#', 1, sysdate(), '', null, '供应商账户流水菜单');
|
||||
|
||||
-- 按钮父菜单ID
|
||||
SELECT @parentId := LAST_INSERT_ID();
|
||||
|
||||
-- 按钮 SQL
|
||||
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('供应商账户流水查询', @parentId, '1', '#', '', 1, 0, 'F', '0', '0', 'wms:supplierTransaction:query', '#', 1, sysdate(), '', null, '');
|
||||
|
||||
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('供应商账户流水新增', @parentId, '2', '#', '', 1, 0, 'F', '0', '0', 'wms:supplierTransaction:add', '#', 1, sysdate(), '', null, '');
|
||||
|
||||
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('供应商账户流水修改', @parentId, '3', '#', '', 1, 0, 'F', '0', '0', 'wms:supplierTransaction:edit', '#', 1, sysdate(), '', null, '');
|
||||
|
||||
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('供应商账户流水删除', @parentId, '4', '#', '', 1, 0, 'F', '0', '0', 'wms:supplierTransaction:remove', '#', 1, sysdate(), '', null, '');
|
||||
|
||||
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('供应商账户流水导出', @parentId, '5', '#', '', 1, 0, 'F', '0', '0', 'wms:supplierTransaction:export', '#', 1, sysdate(), '', null, '');
|
||||
|
|
@ -0,0 +1,93 @@
|
|||
package com.cyl.wms.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.data.domain.PageImpl;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
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.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.cyl.wms.convert.CustomerTransactionConvert;
|
||||
import com.cyl.wms.domain.CustomerTransaction;
|
||||
import com.cyl.wms.pojo.query.CustomerTransactionQuery;
|
||||
import com.cyl.wms.service.CustomerTransactionService;
|
||||
import com.cyl.wms.pojo.vo.CustomerTransactionVO;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
/**
|
||||
* 客户账户流水Controller
|
||||
*
|
||||
* @author zcc
|
||||
* @date 2023-05-04
|
||||
*/
|
||||
@Api(description ="客户账户流水接口列表")
|
||||
@RestController
|
||||
@RequestMapping("/wms/customerTransaction")
|
||||
public class CustomerTransactionController extends BaseController {
|
||||
@Autowired
|
||||
private CustomerTransactionService service;
|
||||
@Autowired
|
||||
private CustomerTransactionConvert convert;
|
||||
|
||||
@ApiOperation("查询客户账户流水列表")
|
||||
@PreAuthorize("@ss.hasPermi('wms:customerTransaction:list')")
|
||||
@PostMapping("/list")
|
||||
public ResponseEntity<Page<CustomerTransaction>> list(@RequestBody CustomerTransactionQuery query, Pageable page) {
|
||||
List<CustomerTransaction> list = service.selectList(query, page);
|
||||
return ResponseEntity.ok(new PageImpl<>(list, page, ((com.github.pagehelper.Page)list).getTotal()));
|
||||
}
|
||||
|
||||
@ApiOperation("导出客户账户流水列表")
|
||||
@PreAuthorize("@ss.hasPermi('wms:customerTransaction:export')")
|
||||
@Log(title = "客户账户流水", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public ResponseEntity<String> export(CustomerTransactionQuery query) {
|
||||
List<CustomerTransaction> list = service.selectList(query, null);
|
||||
ExcelUtil<CustomerTransactionVO> util = new ExcelUtil<>(CustomerTransactionVO.class);
|
||||
return ResponseEntity.ok(util.writeExcel(convert.dos2vos(list), "客户账户流水数据"));
|
||||
}
|
||||
|
||||
@ApiOperation("获取客户账户流水详细信息")
|
||||
@PreAuthorize("@ss.hasPermi('wms:customerTransaction:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public ResponseEntity<CustomerTransaction> getInfo(@PathVariable("id") Integer id) {
|
||||
return ResponseEntity.ok(service.selectById(id));
|
||||
}
|
||||
|
||||
@ApiOperation("新增客户账户流水")
|
||||
@PreAuthorize("@ss.hasPermi('wms:customerTransaction:add')")
|
||||
@Log(title = "客户账户流水", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public ResponseEntity<Integer> add(@RequestBody CustomerTransaction customerTransaction) {
|
||||
return ResponseEntity.ok(service.insert(customerTransaction));
|
||||
}
|
||||
|
||||
@ApiOperation("修改客户账户流水")
|
||||
@PreAuthorize("@ss.hasPermi('wms:customerTransaction:edit')")
|
||||
@Log(title = "客户账户流水", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public ResponseEntity<Integer> edit(@RequestBody CustomerTransaction customerTransaction) {
|
||||
return ResponseEntity.ok(service.update(customerTransaction));
|
||||
}
|
||||
|
||||
@ApiOperation("删除客户账户流水")
|
||||
@PreAuthorize("@ss.hasPermi('wms:customerTransaction:remove')")
|
||||
@Log(title = "客户账户流水", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public ResponseEntity<Integer> remove(@PathVariable Long[] ids) {
|
||||
return ResponseEntity.ok(service.deleteByIds(ids));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,93 @@
|
|||
package com.cyl.wms.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.data.domain.PageImpl;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
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.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.cyl.wms.convert.SupplierTransactionConvert;
|
||||
import com.cyl.wms.domain.SupplierTransaction;
|
||||
import com.cyl.wms.pojo.query.SupplierTransactionQuery;
|
||||
import com.cyl.wms.service.SupplierTransactionService;
|
||||
import com.cyl.wms.pojo.vo.SupplierTransactionVO;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
/**
|
||||
* 供应商账户流水Controller
|
||||
*
|
||||
* @author zcc
|
||||
* @date 2023-05-04
|
||||
*/
|
||||
@Api(description ="供应商账户流水接口列表")
|
||||
@RestController
|
||||
@RequestMapping("/wms/supplierTransaction")
|
||||
public class SupplierTransactionController extends BaseController {
|
||||
@Autowired
|
||||
private SupplierTransactionService service;
|
||||
@Autowired
|
||||
private SupplierTransactionConvert convert;
|
||||
|
||||
@ApiOperation("查询供应商账户流水列表")
|
||||
@PreAuthorize("@ss.hasPermi('wms:supplierTransaction:list')")
|
||||
@PostMapping("/list")
|
||||
public ResponseEntity<Page<SupplierTransaction>> list(@RequestBody SupplierTransactionQuery query, Pageable page) {
|
||||
List<SupplierTransaction> list = service.selectList(query, page);
|
||||
return ResponseEntity.ok(new PageImpl<>(list, page, ((com.github.pagehelper.Page)list).getTotal()));
|
||||
}
|
||||
|
||||
@ApiOperation("导出供应商账户流水列表")
|
||||
@PreAuthorize("@ss.hasPermi('wms:supplierTransaction:export')")
|
||||
@Log(title = "供应商账户流水", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public ResponseEntity<String> export(SupplierTransactionQuery query) {
|
||||
List<SupplierTransaction> list = service.selectList(query, null);
|
||||
ExcelUtil<SupplierTransactionVO> util = new ExcelUtil<>(SupplierTransactionVO.class);
|
||||
return ResponseEntity.ok(util.writeExcel(convert.dos2vos(list), "供应商账户流水数据"));
|
||||
}
|
||||
|
||||
@ApiOperation("获取供应商账户流水详细信息")
|
||||
@PreAuthorize("@ss.hasPermi('wms:supplierTransaction:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public ResponseEntity<SupplierTransaction> getInfo(@PathVariable("id") Integer id) {
|
||||
return ResponseEntity.ok(service.selectById(id));
|
||||
}
|
||||
|
||||
@ApiOperation("新增供应商账户流水")
|
||||
@PreAuthorize("@ss.hasPermi('wms:supplierTransaction:add')")
|
||||
@Log(title = "供应商账户流水", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public ResponseEntity<Integer> add(@RequestBody SupplierTransaction supplierTransaction) {
|
||||
return ResponseEntity.ok(service.insert(supplierTransaction));
|
||||
}
|
||||
|
||||
@ApiOperation("修改供应商账户流水")
|
||||
@PreAuthorize("@ss.hasPermi('wms:supplierTransaction:edit')")
|
||||
@Log(title = "供应商账户流水", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public ResponseEntity<Integer> edit(@RequestBody SupplierTransaction supplierTransaction) {
|
||||
return ResponseEntity.ok(service.update(supplierTransaction));
|
||||
}
|
||||
|
||||
@ApiOperation("删除供应商账户流水")
|
||||
@PreAuthorize("@ss.hasPermi('wms:supplierTransaction:remove')")
|
||||
@Log(title = "供应商账户流水", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public ResponseEntity<Integer> remove(@PathVariable Long[] ids) {
|
||||
return ResponseEntity.ok(service.deleteByIds(ids));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
package com.cyl.wms.convert;
|
||||
|
||||
import org.mapstruct.Mapper;
|
||||
import com.cyl.wms.domain.CustomerTransaction;
|
||||
import com.cyl.wms.pojo.dto.CustomerTransactionDTO;
|
||||
import com.cyl.wms.pojo.vo.CustomerTransactionVO;
|
||||
import java.util.List;
|
||||
/**
|
||||
* 客户账户流水 DO <=> DTO <=> VO / BO / Query
|
||||
*
|
||||
* @author zcc
|
||||
*/
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface CustomerTransactionConvert {
|
||||
|
||||
/**
|
||||
* @param source DO
|
||||
* @return DTO
|
||||
*/
|
||||
CustomerTransactionDTO do2dto(CustomerTransaction source);
|
||||
|
||||
/**
|
||||
* @param source DTO
|
||||
* @return DO
|
||||
*/
|
||||
CustomerTransaction dto2do(CustomerTransactionDTO source);
|
||||
|
||||
List<CustomerTransactionVO> dos2vos(List<CustomerTransaction> list);
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
package com.cyl.wms.convert;
|
||||
|
||||
import org.mapstruct.Mapper;
|
||||
import com.cyl.wms.domain.SupplierTransaction;
|
||||
import com.cyl.wms.pojo.dto.SupplierTransactionDTO;
|
||||
import com.cyl.wms.pojo.vo.SupplierTransactionVO;
|
||||
import java.util.List;
|
||||
/**
|
||||
* 供应商账户流水 DO <=> DTO <=> VO / BO / Query
|
||||
*
|
||||
* @author zcc
|
||||
*/
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface SupplierTransactionConvert {
|
||||
|
||||
/**
|
||||
* @param source DO
|
||||
* @return DTO
|
||||
*/
|
||||
SupplierTransactionDTO do2dto(SupplierTransaction source);
|
||||
|
||||
/**
|
||||
* @param source DTO
|
||||
* @return DO
|
||||
*/
|
||||
SupplierTransaction dto2do(SupplierTransactionDTO source);
|
||||
|
||||
List<SupplierTransactionVO> dos2vos(List<SupplierTransaction> list);
|
||||
}
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
package com.cyl.wms.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
/**
|
||||
* 客户账户流水对象 wms_customer_transaction
|
||||
*
|
||||
* @author zcc
|
||||
*/
|
||||
@ApiModel(description="客户账户流水对象")
|
||||
@Data
|
||||
@TableName("wms_customer_transaction")
|
||||
public class CustomerTransaction {
|
||||
public static String ENTER = "11";
|
||||
public static String EXIT = "22";
|
||||
public static String SHIPMENT = "33";
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("id")
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty("交易编号")
|
||||
@Excel(name = "交易编号")
|
||||
private String transactionCode;
|
||||
|
||||
@ApiModelProperty("用户编号")
|
||||
@Excel(name = "用户编号")
|
||||
private String customerId;
|
||||
|
||||
@ApiModelProperty("交易类型 1:结款 2:应付 ")
|
||||
@Excel(name = "交易类型 1:结款 2:应付 ")
|
||||
private String transactionType;
|
||||
|
||||
@ApiModelProperty("交易金额")
|
||||
@Excel(name = "交易金额")
|
||||
private BigDecimal transactionAmount;
|
||||
|
||||
@ApiModelProperty("上期余额")
|
||||
@Excel(name = "上期余额")
|
||||
private BigDecimal previousBalance;
|
||||
|
||||
@ApiModelProperty("当前余额")
|
||||
@Excel(name = "当前余额")
|
||||
private BigDecimal currentBalance;
|
||||
|
||||
@ApiModelProperty("出库单号")
|
||||
@Excel(name = "出库单号")
|
||||
private int shipmentOrderId;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
@Excel(name = "备注")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty("删除标志")
|
||||
private Integer delFlag;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@ApiModelProperty("更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
package com.cyl.wms.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
/**
|
||||
* 供应商账户流水对象 wms_supplier_transaction
|
||||
*
|
||||
* @author zcc
|
||||
*/
|
||||
@ApiModel(description="供应商账户流水对象")
|
||||
@Data
|
||||
@TableName("wms_supplier_transaction")
|
||||
public class SupplierTransaction {
|
||||
public static String ENTER = "11";
|
||||
public static String EXIT = "22";
|
||||
public static String RECEIPT = "33";
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private int id;
|
||||
|
||||
@ApiModelProperty("交易编号")
|
||||
@Excel(name = "交易编号")
|
||||
private String transactionCode;
|
||||
|
||||
@ApiModelProperty("供应商编号")
|
||||
@Excel(name = "供应商编号")
|
||||
private String supplierId;
|
||||
|
||||
@ApiModelProperty("交易类型 1:结款 2:应付 ")
|
||||
@Excel(name = "交易类型 1:结款 2:应付 ")
|
||||
private String transactionType;
|
||||
|
||||
@ApiModelProperty("交易金额")
|
||||
@Excel(name = "交易金额")
|
||||
private BigDecimal transactionAmount;
|
||||
|
||||
@ApiModelProperty("上期余额")
|
||||
@Excel(name = "上期余额")
|
||||
private BigDecimal previousBalance;
|
||||
|
||||
@ApiModelProperty("当前余额")
|
||||
@Excel(name = "当前余额")
|
||||
private BigDecimal currentBalance;
|
||||
|
||||
@ApiModelProperty("入库单号")
|
||||
@Excel(name = "入库单号")
|
||||
private int receiptOrderId;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
@Excel(name = "备注")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty("删除标志")
|
||||
private Integer delFlag;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@ApiModelProperty("更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
package com.cyl.wms.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.cyl.wms.pojo.query.CustomerTransactionQuery;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.cyl.wms.domain.CustomerTransaction;
|
||||
|
||||
/**
|
||||
* 客户账户流水Mapper接口
|
||||
*
|
||||
* @author zcc
|
||||
*/
|
||||
public interface CustomerTransactionMapper extends BaseMapper<CustomerTransaction> {
|
||||
/**
|
||||
* 查询客户账户流水列表
|
||||
*
|
||||
* @param customerTransaction 客户账户流水
|
||||
* @return 客户账户流水集合
|
||||
*/
|
||||
List<CustomerTransaction> selectByEntity(CustomerTransaction customerTransaction);
|
||||
|
||||
/**
|
||||
* 批量软删除
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
int updateDelFlagByIds(@Param("ids") Long[] ids);
|
||||
|
||||
List<CustomerTransaction> selectList(CustomerTransactionQuery customerTransactionQuery);
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
package com.cyl.wms.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.cyl.wms.pojo.query.SupplierTransactionQuery;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.cyl.wms.domain.SupplierTransaction;
|
||||
|
||||
/**
|
||||
* 供应商账户流水Mapper接口
|
||||
*
|
||||
* @author zcc
|
||||
*/
|
||||
public interface SupplierTransactionMapper extends BaseMapper<SupplierTransaction> {
|
||||
/**
|
||||
* 查询供应商账户流水列表
|
||||
*
|
||||
* @param supplierTransaction 供应商账户流水
|
||||
* @return 供应商账户流水集合
|
||||
*/
|
||||
List<SupplierTransaction> selectByEntity(SupplierTransaction supplierTransaction);
|
||||
|
||||
/**
|
||||
* 批量软删除
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
int updateDelFlagByIds(@Param("ids") Long[] ids);
|
||||
|
||||
List<SupplierTransaction> selectList(SupplierTransactionQuery supplierTransactionQuery);
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
package com.cyl.wms.pojo.dto;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Data;
|
||||
/**
|
||||
* 客户账户流水 DTO 对象
|
||||
*
|
||||
* @author zcc
|
||||
*/
|
||||
@Data
|
||||
public class CustomerTransactionDTO {
|
||||
private Integer id;
|
||||
private String transactionCode;
|
||||
private String customerId;
|
||||
private String transactionType;
|
||||
private BigDecimal transactionAmount;
|
||||
private BigDecimal previousBalance;
|
||||
private BigDecimal currentBalance;
|
||||
private Long shipmentOrderId;
|
||||
private String remark;
|
||||
private LocalDateTime createTime;
|
||||
private LocalDateTime updateTime;
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
package com.cyl.wms.pojo.dto;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Data;
|
||||
/**
|
||||
* 供应商账户流水 DTO 对象
|
||||
*
|
||||
* @author zcc
|
||||
*/
|
||||
@Data
|
||||
public class SupplierTransactionDTO {
|
||||
private Integer id;
|
||||
private String transactionCode;
|
||||
private String supplierId;
|
||||
private String transactionType;
|
||||
private BigDecimal transactionAmount;
|
||||
private BigDecimal previousBalance;
|
||||
private BigDecimal currentBalance;
|
||||
private Long receiptOrderId;
|
||||
private String remark;
|
||||
private LocalDateTime createTime;
|
||||
private LocalDateTime updateTime;
|
||||
}
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
package com.cyl.wms.pojo.query;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* 客户账户流水 查询 对象
|
||||
*
|
||||
* @author zcc
|
||||
*/
|
||||
@ApiModel(description="客户账户流水 查询 对象")
|
||||
@Data
|
||||
public class CustomerTransactionQuery {
|
||||
@ApiModelProperty("交易编号 精确匹配")
|
||||
private String transactionCode;
|
||||
|
||||
@ApiModelProperty("用户编号 精确匹配")
|
||||
private String customerId;
|
||||
|
||||
@ApiModelProperty("交易类型 1:结款 2:应付 精确匹配")
|
||||
private String transactionType;
|
||||
|
||||
@ApiModelProperty("交易金额 精确匹配")
|
||||
private BigDecimal transactionAmount;
|
||||
|
||||
@ApiModelProperty("上期余额 精确匹配")
|
||||
private BigDecimal previousBalance;
|
||||
|
||||
@ApiModelProperty("当前余额 精确匹配")
|
||||
private BigDecimal currentBalance;
|
||||
|
||||
@ApiModelProperty("出库单号 精确匹配")
|
||||
private Long shipmentOrderId;
|
||||
|
||||
@ApiModelProperty("开始时间 精确匹配")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime startTime;
|
||||
|
||||
@ApiModelProperty("结束时间 精确匹配")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime endTime;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
package com.cyl.wms.pojo.query;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* 供应商账户流水 查询 对象
|
||||
*
|
||||
* @author zcc
|
||||
*/
|
||||
@ApiModel(description="供应商账户流水 查询 对象")
|
||||
@Data
|
||||
public class SupplierTransactionQuery {
|
||||
@ApiModelProperty("交易编号 精确匹配")
|
||||
private String transactionCode;
|
||||
|
||||
@ApiModelProperty("供应商编号 精确匹配")
|
||||
private String supplierId;
|
||||
|
||||
@ApiModelProperty("交易类型 1:结款 2:应付 精确匹配")
|
||||
private String transactionType;
|
||||
|
||||
@ApiModelProperty("交易金额 精确匹配")
|
||||
private BigDecimal transactionAmount;
|
||||
|
||||
@ApiModelProperty("上期余额 精确匹配")
|
||||
private BigDecimal previousBalance;
|
||||
|
||||
@ApiModelProperty("当前余额 精确匹配")
|
||||
private BigDecimal currentBalance;
|
||||
|
||||
@ApiModelProperty("入库单号 精确匹配")
|
||||
private Long receiptOrderId;
|
||||
|
||||
@ApiModelProperty("开始时间 精确匹配")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime startTime;
|
||||
|
||||
@ApiModelProperty("结束时间 精确匹配")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime endTime;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
package com.cyl.wms.pojo.vo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
/**
|
||||
* 客户账户流水 数据视图对象
|
||||
*
|
||||
* @author zcc
|
||||
*/
|
||||
@Data
|
||||
public class CustomerTransactionVO {
|
||||
/** id */
|
||||
private Integer id;
|
||||
/** 交易编号 */
|
||||
@Excel(name = "交易编号")
|
||||
private String transactionCode;
|
||||
/** 用户编号 */
|
||||
@Excel(name = "用户编号")
|
||||
private String customerId;
|
||||
/** 交易类型 1:结款 2:应付 */
|
||||
@Excel(name = "交易类型 1:结款 2:应付 ")
|
||||
private String transactionType;
|
||||
/** 交易金额 */
|
||||
@Excel(name = "交易金额")
|
||||
private BigDecimal transactionAmount;
|
||||
/** 上期余额 */
|
||||
@Excel(name = "上期余额")
|
||||
private BigDecimal previousBalance;
|
||||
/** 当前余额 */
|
||||
@Excel(name = "当前余额")
|
||||
private BigDecimal currentBalance;
|
||||
/** 出库单号 */
|
||||
@Excel(name = "出库单号")
|
||||
private Long shipmentOrderId;
|
||||
/** 备注 */
|
||||
@Excel(name = "备注")
|
||||
private String remark;
|
||||
/** 创建时间 */
|
||||
private LocalDateTime createTime;
|
||||
/** 更新时间 */
|
||||
private LocalDateTime updateTime;
|
||||
}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
package com.cyl.wms.pojo.vo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
/**
|
||||
* 供应商账户流水 数据视图对象
|
||||
*
|
||||
* @author zcc
|
||||
*/
|
||||
@Data
|
||||
public class SupplierTransactionVO {
|
||||
/** id */
|
||||
private Integer id;
|
||||
/** 交易编号 */
|
||||
@Excel(name = "交易编号")
|
||||
private String transactionCode;
|
||||
/** 供应商编号 */
|
||||
@Excel(name = "供应商编号")
|
||||
private String supplierId;
|
||||
/** 交易类型 1:结款 2:应付 */
|
||||
@Excel(name = "交易类型 1:结款 2:应付 ")
|
||||
private String transactionType;
|
||||
/** 交易金额 */
|
||||
@Excel(name = "交易金额")
|
||||
private BigDecimal transactionAmount;
|
||||
/** 上期余额 */
|
||||
@Excel(name = "上期余额")
|
||||
private BigDecimal previousBalance;
|
||||
/** 当前余额 */
|
||||
@Excel(name = "当前余额")
|
||||
private BigDecimal currentBalance;
|
||||
/** 入库单号 */
|
||||
@Excel(name = "入库单号")
|
||||
private Long receiptOrderId;
|
||||
/** 备注 */
|
||||
@Excel(name = "备注")
|
||||
private String remark;
|
||||
/** 创建时间 */
|
||||
private LocalDateTime createTime;
|
||||
/** 更新时间 */
|
||||
private LocalDateTime updateTime;
|
||||
}
|
||||
|
|
@ -0,0 +1,138 @@
|
|||
package com.cyl.wms.service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.cyl.wms.domain.Customer;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.cyl.wms.mapper.CustomerTransactionMapper;
|
||||
import com.cyl.wms.domain.CustomerTransaction;
|
||||
import com.cyl.wms.pojo.query.CustomerTransactionQuery;
|
||||
|
||||
/**
|
||||
* 客户账户流水Service业务层处理
|
||||
*
|
||||
*
|
||||
* @author zcc
|
||||
*/
|
||||
@Service
|
||||
public class CustomerTransactionService {
|
||||
@Autowired
|
||||
private CustomerTransactionMapper customerTransactionMapper;
|
||||
|
||||
@Autowired
|
||||
private CustomerService customerService;
|
||||
|
||||
/**
|
||||
* 查询客户账户流水
|
||||
*
|
||||
* @param id 客户账户流水主键
|
||||
* @return 客户账户流水
|
||||
*/
|
||||
public CustomerTransaction selectById(Integer id) {
|
||||
return customerTransactionMapper.selectById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询客户账户流水列表
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @param page 分页条件
|
||||
* @return 客户账户流水
|
||||
*/
|
||||
public List<CustomerTransaction> selectList(CustomerTransactionQuery query, Pageable page) {
|
||||
if (page != null) {
|
||||
PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize());
|
||||
}
|
||||
return customerTransactionMapper.selectList(query);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增客户账户流水
|
||||
*
|
||||
* @param customerTransaction 客户账户流水
|
||||
* @return 结果
|
||||
*/
|
||||
public int insert(CustomerTransaction customerTransaction) {
|
||||
Customer customer = customerService.selectById(Long.valueOf(customerTransaction.getCustomerId()));
|
||||
if (customer == null){
|
||||
return 0;
|
||||
}
|
||||
customerTransaction.setCreateTime(LocalDateTime.now());
|
||||
customerTransaction.setPreviousBalance(customer.getReceivableAmount());
|
||||
BigDecimal duePay = customer.getReceivableAmount();
|
||||
BigDecimal after = customer.getReceivableAmount();
|
||||
if (CustomerTransaction.ENTER.equals(customerTransaction.getTransactionType())){
|
||||
after = duePay.subtract(customerTransaction.getTransactionAmount());
|
||||
}else if (CustomerTransaction.EXIT.equals(customerTransaction.getTransactionType())){
|
||||
after = duePay.add(customerTransaction.getTransactionAmount());
|
||||
}else if (CustomerTransaction.SHIPMENT.equals(customerTransaction.getTransactionType())){
|
||||
//查询该出库单是否已经添加
|
||||
LambdaQueryWrapper<CustomerTransaction> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(CustomerTransaction::getShipmentOrderId, customerTransaction.getShipmentOrderId());
|
||||
queryWrapper.orderByDesc(CustomerTransaction::getId);
|
||||
List<CustomerTransaction> customerTransactions = customerTransactionMapper.selectList(queryWrapper);
|
||||
if (customerTransactions.size() > 0){
|
||||
//更新出库单金额
|
||||
CustomerTransaction customerTransaction1 = customerTransactions.get(0);
|
||||
if (customerTransaction1.getTransactionAmount().compareTo(customerTransaction.getTransactionAmount()) != 0){
|
||||
//发生金额变化
|
||||
after = duePay.add(customerTransaction.getTransactionAmount().subtract(customerTransaction1.getTransactionAmount()));
|
||||
}else {
|
||||
//无金额变化
|
||||
return 0;
|
||||
}
|
||||
}else {
|
||||
//新增
|
||||
after = duePay.add(customerTransaction.getTransactionAmount());
|
||||
}
|
||||
}
|
||||
customerTransaction.setCurrentBalance(after);
|
||||
|
||||
//更新客户 应收款
|
||||
customer.setReceivableAmount(after);
|
||||
customerService.update(customer);
|
||||
|
||||
return customerTransactionMapper.insert(customerTransaction);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改客户账户流水
|
||||
*
|
||||
* @param customerTransaction 客户账户流水
|
||||
* @return 结果
|
||||
*/
|
||||
public int update(CustomerTransaction customerTransaction) {
|
||||
return customerTransactionMapper.updateById(customerTransaction);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除客户账户流水
|
||||
*
|
||||
* @param ids 需要删除的客户账户流水主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteByIds(Long[] ids) {
|
||||
return customerTransactionMapper.updateDelFlagByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除客户账户流水信息
|
||||
*
|
||||
* @param id 客户账户流水主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteById(Long id) {
|
||||
Long[] ids = {id};
|
||||
return customerTransactionMapper.updateDelFlagByIds(ids);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,140 @@
|
|||
package com.cyl.wms.service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.cyl.wms.domain.Supplier;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.cyl.wms.mapper.SupplierTransactionMapper;
|
||||
import com.cyl.wms.domain.SupplierTransaction;
|
||||
import com.cyl.wms.pojo.query.SupplierTransactionQuery;
|
||||
|
||||
/**
|
||||
* 供应商账户流水Service业务层处理
|
||||
*
|
||||
*
|
||||
* @author zcc
|
||||
*/
|
||||
@Service
|
||||
public class SupplierTransactionService {
|
||||
@Autowired
|
||||
private SupplierTransactionMapper supplierTransactionMapper;
|
||||
|
||||
@Autowired
|
||||
private SupplierService supplierService;
|
||||
|
||||
/**
|
||||
* 查询供应商账户流水
|
||||
*
|
||||
* @param id 供应商账户流水主键
|
||||
* @return 供应商账户流水
|
||||
*/
|
||||
public SupplierTransaction selectById(Integer id) {
|
||||
return supplierTransactionMapper.selectById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询供应商账户流水列表
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @param page 分页条件
|
||||
* @return 供应商账户流水
|
||||
*/
|
||||
public List<SupplierTransaction> selectList(SupplierTransactionQuery query, Pageable page) {
|
||||
if (page != null) {
|
||||
PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize());
|
||||
}
|
||||
return supplierTransactionMapper.selectList(query);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增供应商账户流水
|
||||
*
|
||||
* @param supplierTransaction 供应商账户流水
|
||||
* @return 结果
|
||||
*/
|
||||
public int insert(SupplierTransaction supplierTransaction) {
|
||||
Supplier supplier = supplierService.selectById(Long.valueOf(supplierTransaction.getSupplierId()));
|
||||
if (supplier == null) {
|
||||
return 0;
|
||||
}
|
||||
supplierTransaction.setCreateTime(LocalDateTime.now());
|
||||
supplierTransaction.setPreviousBalance(supplier.getPayableAmount());
|
||||
BigDecimal duePay = supplier.getPayableAmount();
|
||||
BigDecimal after = supplier.getPayableAmount();
|
||||
if (SupplierTransaction.ENTER.equals(supplierTransaction.getTransactionType())) {
|
||||
after = duePay.subtract(supplierTransaction.getTransactionAmount());
|
||||
} else if (SupplierTransaction.EXIT.equals(supplierTransaction.getTransactionType())) {
|
||||
after = duePay.add(supplierTransaction.getTransactionAmount());
|
||||
} else if (SupplierTransaction.RECEIPT.equals(supplierTransaction.getTransactionType())) {
|
||||
|
||||
//查询 该入库单是否已经添加
|
||||
LambdaQueryWrapper<SupplierTransaction> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(SupplierTransaction::getReceiptOrderId, supplierTransaction.getReceiptOrderId());
|
||||
queryWrapper.orderByDesc(SupplierTransaction::getId);
|
||||
List<SupplierTransaction> supplierTransactions = supplierTransactionMapper.selectList(queryWrapper);
|
||||
if (supplierTransactions.size() > 0) {
|
||||
//更新入库单金额
|
||||
SupplierTransaction supplierTransaction1 = supplierTransactions.get(0);
|
||||
if (supplierTransaction1.getTransactionAmount().compareTo(supplierTransaction.getTransactionAmount()) != 0) {
|
||||
//发生金额变化
|
||||
after = duePay.add(supplierTransaction.getTransactionAmount().subtract(supplierTransaction1.getTransactionAmount()));
|
||||
}else {
|
||||
//无金额变化
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
//新增
|
||||
after = duePay.add(supplierTransaction.getTransactionAmount());
|
||||
}
|
||||
|
||||
}
|
||||
supplierTransaction.setCurrentBalance(after);
|
||||
|
||||
//更新供应商 应付款
|
||||
supplier.setPayableAmount(after);
|
||||
supplierService.update(supplier);
|
||||
|
||||
return supplierTransactionMapper.insert(supplierTransaction);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改供应商账户流水
|
||||
*
|
||||
* @param supplierTransaction 供应商账户流水
|
||||
* @return 结果
|
||||
*/
|
||||
public int update(SupplierTransaction supplierTransaction) {
|
||||
return supplierTransactionMapper.updateById(supplierTransaction);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除供应商账户流水
|
||||
*
|
||||
* @param ids 需要删除的供应商账户流水主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteByIds(Long[] ids) {
|
||||
return supplierTransactionMapper.updateDelFlagByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除供应商账户流水信息
|
||||
*
|
||||
* @param id 供应商账户流水主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteById(Long id) {
|
||||
Long[] ids = {id};
|
||||
return supplierTransactionMapper.updateDelFlagByIds(ids);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
<?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.cyl.wms.mapper.CustomerTransactionMapper">
|
||||
|
||||
<resultMap type="CustomerTransaction" id="CustomerTransactionResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="transactionCode" column="transaction_code"/>
|
||||
<result property="customerId" column="customer_id"/>
|
||||
<result property="transactionType" column="transaction_type"/>
|
||||
<result property="transactionAmount" column="transaction_amount"/>
|
||||
<result property="previousBalance" column="previous_balance"/>
|
||||
<result property="currentBalance" column="current_balance"/>
|
||||
<result property="shipmentOrderId" column="shipment_order_id"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectCustomerTransactionVo">
|
||||
select id, transaction_code, customer_id, transaction_type, transaction_amount, previous_balance, current_balance, shipment_order_id, remark, del_flag, create_time, update_time from wms_customer_transaction
|
||||
</sql>
|
||||
|
||||
<select id="selectByEntity" parameterType="CustomerTransaction" resultMap="CustomerTransactionResult">
|
||||
<include refid="selectCustomerTransactionVo"/>
|
||||
<where>
|
||||
<if test="transactionCode != null and transactionCode != ''"> and transaction_code = #{transactionCode}</if>
|
||||
<if test="customerId != null and customerId != ''"> and customer_id = #{customerId}</if>
|
||||
<if test="transactionType != null and transactionType != ''"> and transaction_type = #{transactionType}</if>
|
||||
<if test="transactionAmount != null "> and transaction_amount = #{transactionAmount}</if>
|
||||
<if test="previousBalance != null "> and previous_balance = #{previousBalance}</if>
|
||||
<if test="currentBalance != null "> and current_balance = #{currentBalance}</if>
|
||||
<if test="shipmentOrderId != null "> and shipment_order_id = #{shipmentOrderId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectList" resultMap="CustomerTransactionResult">
|
||||
<include refid="selectCustomerTransactionVo"/>
|
||||
<where>
|
||||
<if test="customerId != null and customerId != ''">
|
||||
customer_id=#{customerId}
|
||||
</if>
|
||||
<if test="transactionCode != null and transactionCode != ''">
|
||||
and transaction_code=#{transactionCode}
|
||||
</if>
|
||||
<if test="transactionType != null and transactionType != ''">
|
||||
and transaction_type=#{transactionType}
|
||||
</if>
|
||||
<if test="startTime != null and endTime != null ">
|
||||
and create_time between #{startTime} and #{endTime}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<update id="updateDelFlagByIds">
|
||||
update wms_customer_transaction set del_flag=1
|
||||
<where>
|
||||
id in <foreach collection="ids" open="(" item="it" close=")" separator=",">#{it}</foreach>
|
||||
</where>
|
||||
</update>
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
<?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.cyl.wms.mapper.SupplierTransactionMapper">
|
||||
|
||||
<resultMap type="SupplierTransaction" id="SupplierTransactionResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="transactionCode" column="transaction_code"/>
|
||||
<result property="supplierId" column="supplier_id"/>
|
||||
<result property="transactionType" column="transaction_type"/>
|
||||
<result property="transactionAmount" column="transaction_amount"/>
|
||||
<result property="previousBalance" column="previous_balance"/>
|
||||
<result property="currentBalance" column="current_balance"/>
|
||||
<result property="receiptOrderId" column="receipt_order_id"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSupplierTransactionVo">
|
||||
select id, transaction_code, supplier_id, transaction_type, transaction_amount, previous_balance, current_balance, receipt_order_id, remark, del_flag, create_time, update_time from wms_supplier_transaction
|
||||
</sql>
|
||||
|
||||
<select id="selectByEntity" parameterType="SupplierTransaction" resultMap="SupplierTransactionResult">
|
||||
<include refid="selectSupplierTransactionVo"/>
|
||||
<where>
|
||||
<if test="transactionCode != null and transactionCode != ''"> and transaction_code = #{transactionCode}</if>
|
||||
<if test="supplierId != null and supplierId != ''"> and supplier_id = #{supplierId}</if>
|
||||
<if test="transactionType != null and transactionType != ''"> and transaction_type = #{transactionType}</if>
|
||||
<if test="transactionAmount != null "> and transaction_amount = #{transactionAmount}</if>
|
||||
<if test="previousBalance != null "> and previous_balance = #{previousBalance}</if>
|
||||
<if test="currentBalance != null "> and current_balance = #{currentBalance}</if>
|
||||
<if test="receiptOrderId != null "> and receipt_order_id = #{receiptOrderId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectList" resultMap="SupplierTransactionResult">
|
||||
<include refid="selectSupplierTransactionVo"/>
|
||||
<where>
|
||||
<if test="supplierId != null and supplierId != ''">
|
||||
supplier_id=#{supplierId}
|
||||
</if>
|
||||
<if test="transactionCode != null and transactionCode != ''">
|
||||
and transaction_code=#{transactionCode}
|
||||
</if>
|
||||
<if test="transactionType != null and transactionType != ''">
|
||||
and transaction_type=#{transactionType}
|
||||
</if>
|
||||
<if test="startTime != null and endTime != null ">
|
||||
and create_time between #{startTime} and #{endTime}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<update id="updateDelFlagByIds">
|
||||
update wms_supplier_transaction set del_flag=1
|
||||
<where>
|
||||
id in <foreach collection="ids" open="(" item="it" close=")" separator=",">#{it}</foreach>
|
||||
</where>
|
||||
</update>
|
||||
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue