Commit aa2a70efd876785ba9679199c2d6801643624d42

Authored by yeqianyong
1 parent 1d9e0338

楚江erp:应收款台账明细相关接口开发

  1 +package com.lframework.xingyun.sc.bo.ledger.receipt;
  2 +
  3 +import com.fasterxml.jackson.annotation.JsonFormat;
  4 +import com.lframework.xingyun.sc.entity.ReceiptLedgerInfo;
  5 +import java.math.BigDecimal;
  6 +import com.lframework.starter.common.constants.StringPool;
  7 +import com.lframework.starter.web.core.bo.BaseBo;
  8 +import java.time.LocalDate;
  9 +import java.time.LocalDateTime;
  10 +import com.lframework.starter.web.core.components.validation.TypeMismatch;
  11 +import io.swagger.annotations.ApiModelProperty;
  12 +
  13 +import lombok.Data;
  14 +
  15 +/**
  16 + * <p>
  17 + * 应收款台账明细 GetBo
  18 + * </p>
  19 + *
  20 + */
  21 +@Data
  22 +public class GetReceiptLedgerInfoBo extends BaseBo<ReceiptLedgerInfo> {
  23 +
  24 + /**
  25 + * ID
  26 + */
  27 + @ApiModelProperty("ID")
  28 + private String id;
  29 +
  30 + /**
  31 + * 客户简称ID
  32 + */
  33 + @ApiModelProperty("客户简称ID")
  34 + private String customerShortId;
  35 +
  36 + /**
  37 + * 额度
  38 + */
  39 + @ApiModelProperty("额度")
  40 + private BigDecimal quota;
  41 +
  42 + /**
  43 + * 结算期限
  44 + */
  45 + @ApiModelProperty("结算期限")
  46 + private String settleTerm;
  47 +
  48 + /**
  49 + * 办事处ID
  50 + */
  51 + @ApiModelProperty("办事处ID")
  52 + private String deptId;
  53 +
  54 + /**
  55 + * 区域ID
  56 + */
  57 + @ApiModelProperty("区域ID")
  58 + private String region;
  59 +
  60 + /**
  61 + * 备货单位ID
  62 + */
  63 + @ApiModelProperty("备货单位ID")
  64 + private String stockUpCompanyId;
  65 +
  66 + /**
  67 + * 客户ID
  68 + */
  69 + @ApiModelProperty("客户ID")
  70 + private String customerId;
  71 +
  72 + /**
  73 + * 厂别
  74 + */
  75 + @ApiModelProperty("厂别")
  76 + private String factoryType;
  77 +
  78 + /**
  79 + * 发货日期
  80 + */
  81 + @ApiModelProperty("发货日期")
  82 + @JsonFormat(pattern = StringPool.DATE_PATTERN)
  83 + private LocalDate shipmentDate;
  84 +
  85 + /**
  86 + * 期初应收账款
  87 + */
  88 + @ApiModelProperty("期初应收账款")
  89 + private BigDecimal startAccountReceivable;
  90 +
  91 + /**
  92 + * 到货日期
  93 + */
  94 + @ApiModelProperty("到货日期")
  95 + @JsonFormat(pattern = StringPool.DATE_PATTERN)
  96 + private LocalDate arrivalDate;
  97 +
  98 + /**
  99 + * 应办理日期
  100 + */
  101 + @ApiModelProperty("应办理日期")
  102 + @JsonFormat(pattern = StringPool.DATE_PATTERN)
  103 + private LocalDate processedDate;
  104 +
  105 + /**
  106 + * 实际回笼日期
  107 + */
  108 + @ApiModelProperty("实际回笼日期")
  109 + @JsonFormat(pattern = StringPool.DATE_PATTERN)
  110 + private LocalDate actualReturnedDate;
  111 +
  112 + /**
  113 + * 回笼金额
  114 + */
  115 + @ApiModelProperty("回笼金额")
  116 + private BigDecimal returnedAmount;
  117 +
  118 + /**
  119 + * 实际回笼金额
  120 + */
  121 + @ApiModelProperty("实际回笼金额")
  122 + private BigDecimal actualReturnedAmount;
  123 +
  124 + /**
  125 + * 期末应收账款
  126 + */
  127 + @ApiModelProperty("期末应收账款")
  128 + private BigDecimal endAccountReceivable;
  129 +
  130 + /**
  131 + * 申请状态
  132 + */
  133 + @ApiModelProperty("申请状态")
  134 + private String applyStatus;
  135 +
  136 + /**
  137 + * 协调办理日期
  138 + */
  139 + @ApiModelProperty("协调办理日期")
  140 + @JsonFormat(pattern = StringPool.DATE_PATTERN)
  141 + private LocalDate coordinateDate;
  142 +
  143 + /**
  144 + * 备注
  145 + */
  146 + @ApiModelProperty("备注")
  147 + private String remark;
  148 +
  149 + /**
  150 + * 二次协调日期
  151 + */
  152 + @ApiModelProperty("二次协调日期")
  153 + @JsonFormat(pattern = StringPool.DATE_PATTERN)
  154 + private LocalDate secondCoordinateDate;
  155 +
  156 + /**
  157 + * 三次协调日期
  158 + */
  159 + @ApiModelProperty("三次协调日期")
  160 + @JsonFormat(pattern = StringPool.DATE_PATTERN)
  161 + private LocalDate thirdCoordinateDate;
  162 +
  163 + /**
  164 + * 四次协调日期
  165 + */
  166 + @ApiModelProperty("四次协调日期")
  167 + @JsonFormat(pattern = StringPool.DATE_PATTERN)
  168 + private LocalDate fourthCoordinateDate;
  169 +
  170 + /**
  171 + * 五次协调日期
  172 + */
  173 + @ApiModelProperty("五次协调日期")
  174 + @JsonFormat(pattern = StringPool.DATE_PATTERN)
  175 + private LocalDate fifthCoordinateDate;
  176 +
  177 + /**
  178 + * 说明
  179 + */
  180 + @ApiModelProperty("说明")
  181 + private String description;
  182 +
  183 + /**
  184 + * 是否删除
  185 + */
  186 + @ApiModelProperty("是否删除")
  187 + private Integer delFlag;
  188 +
  189 + /**
  190 + * 创建人ID
  191 + */
  192 + @ApiModelProperty("创建人ID")
  193 + private String createById;
  194 +
  195 + /**
  196 + * 更新人ID
  197 + */
  198 + @ApiModelProperty("更新人ID")
  199 + private String updateById;
  200 +
  201 + /**
  202 + * 创建时间
  203 + */
  204 + @ApiModelProperty("创建时间")
  205 + @JsonFormat(pattern = StringPool.DATE_TIME_PATTERN)
  206 + private LocalDateTime createTime;
  207 +
  208 + /**
  209 + * 更新时间
  210 + */
  211 + @ApiModelProperty("更新时间")
  212 + @JsonFormat(pattern = StringPool.DATE_TIME_PATTERN)
  213 + private LocalDateTime updateTime;
  214 +
  215 + public GetReceiptLedgerInfoBo() {
  216 +
  217 + }
  218 +
  219 + public GetReceiptLedgerInfoBo(ReceiptLedgerInfo dto) {
  220 +
  221 + super(dto);
  222 + }
  223 +
  224 + @Override
  225 + public BaseBo<ReceiptLedgerInfo> convert(ReceiptLedgerInfo dto) {
  226 + return super.convert(dto);
  227 + }
  228 +
  229 + @Override
  230 + protected void afterInit(ReceiptLedgerInfo dto) {
  231 +
  232 + }
  233 +}
... ...
  1 +package com.lframework.xingyun.sc.bo.ledger.receipt;
  2 +
  3 +import com.fasterxml.jackson.annotation.JsonFormat;
  4 +import com.lframework.xingyun.sc.entity.ReceiptLedgerInfo;
  5 +import java.math.BigDecimal;
  6 +import com.lframework.starter.common.constants.StringPool;
  7 +import com.lframework.starter.web.core.bo.BaseBo;
  8 +import java.time.LocalDate;
  9 +import java.time.LocalDateTime;
  10 +import com.lframework.starter.web.core.components.validation.TypeMismatch;
  11 +import io.swagger.annotations.ApiModelProperty;
  12 +
  13 +import lombok.Data;
  14 +
  15 +/**
  16 + * <p>
  17 + * 应收款台账明细 QueryBo
  18 + * </p>
  19 + *
  20 + */
  21 +@Data
  22 +public class QueryReceiptLedgerInfoBo extends BaseBo<ReceiptLedgerInfo> {
  23 +
  24 + /**
  25 + * ID
  26 + */
  27 + @ApiModelProperty("ID")
  28 + private String id;
  29 +
  30 + /**
  31 + * 客户简称ID
  32 + */
  33 + @ApiModelProperty("客户简称ID")
  34 + private String customerShortId;
  35 +
  36 + /**
  37 + * 额度
  38 + */
  39 + @ApiModelProperty("额度")
  40 + private BigDecimal quota;
  41 +
  42 + /**
  43 + * 结算期限
  44 + */
  45 + @ApiModelProperty("结算期限")
  46 + private String settleTerm;
  47 +
  48 + /**
  49 + * 办事处ID
  50 + */
  51 + @ApiModelProperty("办事处ID")
  52 + private String deptId;
  53 +
  54 + /**
  55 + * 区域ID
  56 + */
  57 + @ApiModelProperty("区域ID")
  58 + private String region;
  59 +
  60 + /**
  61 + * 备货单位ID
  62 + */
  63 + @ApiModelProperty("备货单位ID")
  64 + private String stockUpCompanyId;
  65 +
  66 + /**
  67 + * 客户ID
  68 + */
  69 + @ApiModelProperty("客户ID")
  70 + private String customerId;
  71 +
  72 + /**
  73 + * 厂别
  74 + */
  75 + @ApiModelProperty("厂别")
  76 + private String factoryType;
  77 +
  78 + /**
  79 + * 发货日期
  80 + */
  81 + @ApiModelProperty("发货日期")
  82 + @JsonFormat(pattern = StringPool.DATE_PATTERN)
  83 + private LocalDate shipmentDate;
  84 +
  85 + /**
  86 + * 期初应收账款
  87 + */
  88 + @ApiModelProperty("期初应收账款")
  89 + private BigDecimal startAccountReceivable;
  90 +
  91 + /**
  92 + * 到货日期
  93 + */
  94 + @ApiModelProperty("到货日期")
  95 + @JsonFormat(pattern = StringPool.DATE_PATTERN)
  96 + private LocalDate arrivalDate;
  97 +
  98 + /**
  99 + * 应办理日期
  100 + */
  101 + @ApiModelProperty("应办理日期")
  102 + @JsonFormat(pattern = StringPool.DATE_PATTERN)
  103 + private LocalDate processedDate;
  104 +
  105 + /**
  106 + * 实际回笼日期
  107 + */
  108 + @ApiModelProperty("实际回笼日期")
  109 + @JsonFormat(pattern = StringPool.DATE_PATTERN)
  110 + private LocalDate actualReturnedDate;
  111 +
  112 + /**
  113 + * 回笼金额
  114 + */
  115 + @ApiModelProperty("回笼金额")
  116 + private BigDecimal returnedAmount;
  117 +
  118 + /**
  119 + * 实际回笼金额
  120 + */
  121 + @ApiModelProperty("实际回笼金额")
  122 + private BigDecimal actualReturnedAmount;
  123 +
  124 + /**
  125 + * 期末应收账款
  126 + */
  127 + @ApiModelProperty("期末应收账款")
  128 + private BigDecimal endAccountReceivable;
  129 +
  130 + /**
  131 + * 申请状态
  132 + */
  133 + @ApiModelProperty("申请状态")
  134 + private String applyStatus;
  135 +
  136 + /**
  137 + * 协调办理日期
  138 + */
  139 + @ApiModelProperty("协调办理日期")
  140 + @JsonFormat(pattern = StringPool.DATE_PATTERN)
  141 + private LocalDate coordinateDate;
  142 +
  143 + /**
  144 + * 备注
  145 + */
  146 + @ApiModelProperty("备注")
  147 + private String remark;
  148 +
  149 + /**
  150 + * 二次协调日期
  151 + */
  152 + @ApiModelProperty("二次协调日期")
  153 + @JsonFormat(pattern = StringPool.DATE_PATTERN)
  154 + private LocalDate secondCoordinateDate;
  155 +
  156 + /**
  157 + * 三次协调日期
  158 + */
  159 + @ApiModelProperty("三次协调日期")
  160 + @JsonFormat(pattern = StringPool.DATE_PATTERN)
  161 + private LocalDate thirdCoordinateDate;
  162 +
  163 + /**
  164 + * 四次协调日期
  165 + */
  166 + @ApiModelProperty("四次协调日期")
  167 + @JsonFormat(pattern = StringPool.DATE_PATTERN)
  168 + private LocalDate fourthCoordinateDate;
  169 +
  170 + /**
  171 + * 五次协调日期
  172 + */
  173 + @ApiModelProperty("五次协调日期")
  174 + @JsonFormat(pattern = StringPool.DATE_PATTERN)
  175 + private LocalDate fifthCoordinateDate;
  176 +
  177 + /**
  178 + * 说明
  179 + */
  180 + @ApiModelProperty("说明")
  181 + private String description;
  182 +
  183 + /**
  184 + * 创建人ID
  185 + */
  186 + @ApiModelProperty("创建人ID")
  187 + private String createById;
  188 +
  189 + /**
  190 + * 更新人ID
  191 + */
  192 + @ApiModelProperty("更新人ID")
  193 + private String updateById;
  194 +
  195 + /**
  196 + * 创建时间
  197 + */
  198 + @ApiModelProperty("创建时间")
  199 + @JsonFormat(pattern = StringPool.DATE_TIME_PATTERN)
  200 + private LocalDateTime createTime;
  201 +
  202 + /**
  203 + * 更新时间
  204 + */
  205 + @ApiModelProperty("更新时间")
  206 + @JsonFormat(pattern = StringPool.DATE_TIME_PATTERN)
  207 + private LocalDateTime updateTime;
  208 +
  209 + public QueryReceiptLedgerInfoBo() {
  210 +
  211 + }
  212 +
  213 + public QueryReceiptLedgerInfoBo(ReceiptLedgerInfo dto) {
  214 +
  215 + super(dto);
  216 + }
  217 +
  218 + @Override
  219 + public BaseBo<ReceiptLedgerInfo> convert(ReceiptLedgerInfo dto) {
  220 + return super.convert(dto);
  221 + }
  222 +
  223 + @Override
  224 + protected void afterInit(ReceiptLedgerInfo dto) {
  225 +
  226 + }
  227 +}
... ...
  1 +package com.lframework.xingyun.sc.controller.ledger;
  2 +
  3 +import com.lframework.xingyun.sc.bo.ledger.receipt.GetReceiptLedgerInfoBo;
  4 +import com.lframework.xingyun.sc.bo.ledger.receipt.QueryReceiptLedgerInfoBo;
  5 +import com.lframework.xingyun.sc.vo.ledger.receipt.QueryReceiptLedgerInfoVo;
  6 +import com.lframework.xingyun.sc.service.ledger.ReceiptLedgerInfoService;
  7 +import com.lframework.xingyun.sc.vo.ledger.receipt.CreateReceiptLedgerInfoVo;
  8 +import com.lframework.xingyun.sc.entity.ReceiptLedgerInfo;
  9 +import com.lframework.starter.web.core.utils.PageResultUtil;
  10 +
  11 +import javax.annotation.Resource;
  12 +import javax.validation.constraints.NotBlank;
  13 +import com.lframework.starter.common.exceptions.impl.DefaultClientException;
  14 +import com.lframework.xingyun.sc.vo.ledger.receipt.UpdateReceiptLedgerInfoVo;
  15 +import io.swagger.annotations.ApiOperation;
  16 +import com.lframework.starter.common.utils.CollectionUtil;
  17 +import io.swagger.annotations.Api;
  18 +import org.springframework.web.bind.annotation.DeleteMapping;
  19 +import com.lframework.starter.web.core.components.resp.PageResult;
  20 +import com.lframework.starter.web.core.components.resp.InvokeResult;
  21 +import io.swagger.annotations.ApiImplicitParam;
  22 +import com.lframework.starter.web.core.components.resp.InvokeResultBuilder;
  23 +import com.lframework.starter.web.core.controller.DefaultBaseController;
  24 +import com.lframework.starter.web.core.annotations.security.HasPermission;
  25 +import org.springframework.validation.annotation.Validated;
  26 +import org.springframework.web.bind.annotation.*;
  27 +
  28 +import javax.validation.Valid;
  29 +import java.util.List;
  30 +import java.util.stream.Collectors;
  31 +
  32 +/**
  33 + * 应收款台账明细 Controller
  34 + *
  35 + */
  36 +@Api(tags = "应收款台账明细")
  37 +@Validated
  38 +@RestController
  39 +@RequestMapping("/ledger/receipt")
  40 +public class ReceiptLedgerInfoController extends DefaultBaseController {
  41 +
  42 +
  43 +
  44 + @Resource
  45 + private ReceiptLedgerInfoService receiptLedgerInfoService;
  46 +
  47 +
  48 +
  49 + /**
  50 + * 查询列表
  51 + */
  52 + @ApiOperation("查询列表")
  53 + @HasPermission({"ledger:receipt:query"})
  54 + @GetMapping("/query")
  55 + public InvokeResult<PageResult<QueryReceiptLedgerInfoBo>> query(@Valid QueryReceiptLedgerInfoVo vo) {
  56 + PageResult<ReceiptLedgerInfo> pageResult = receiptLedgerInfoService.query(getPageIndex(vo), getPageSize(vo), vo);
  57 + List<ReceiptLedgerInfo> dataList = pageResult.getDatas();
  58 + List<QueryReceiptLedgerInfoBo> results = null;
  59 + if (!CollectionUtil.isEmpty(dataList)) {
  60 + results = dataList.stream().map(QueryReceiptLedgerInfoBo::new).collect(Collectors.toList());
  61 + }
  62 +
  63 + return InvokeResultBuilder.success(PageResultUtil.rebuild(pageResult, results));
  64 + }
  65 +
  66 + /**
  67 + * 根据ID查询
  68 + */
  69 + @ApiOperation("根据ID查询")
  70 + @ApiImplicitParam(value = "id", name = "id", paramType = "query", required = true)
  71 + @HasPermission({"ledger:receipt:query"})
  72 + @GetMapping
  73 + public InvokeResult<GetReceiptLedgerInfoBo> get(@NotBlank(message = "id不能为空!") String id) {
  74 + ReceiptLedgerInfo data = receiptLedgerInfoService.findById(id);
  75 + if (data == null) {
  76 + throw new DefaultClientException("应收款台账明细不存在!");
  77 + }
  78 + GetReceiptLedgerInfoBo result = new GetReceiptLedgerInfoBo(data);
  79 +
  80 + return InvokeResultBuilder.success(result);
  81 + }
  82 +
  83 + /**
  84 + * 新增
  85 + */
  86 + @ApiOperation("新增")
  87 + @HasPermission({"ledger:receipt:add"})
  88 + @PostMapping
  89 + public InvokeResult<Void> create(@Valid CreateReceiptLedgerInfoVo vo) {
  90 + receiptLedgerInfoService.create(vo);
  91 + return InvokeResultBuilder.success();
  92 + }
  93 +
  94 + /**
  95 + * 根据ID删除
  96 + */
  97 + @ApiOperation("根据ID删除")
  98 + @ApiImplicitParam(value = "id", name = "id", paramType = "query", required = true)
  99 + @HasPermission({"ledger:receipt:delete"})
  100 + @DeleteMapping
  101 + public InvokeResult<Void> deleteById(@NotBlank(message = "id不能为空!") String id) {
  102 + receiptLedgerInfoService.deleteById(id);
  103 + return InvokeResultBuilder.success();
  104 + }
  105 +}
... ...
  1 +package com.lframework.xingyun.sc.entity;
  2 +
  3 +import com.baomidou.mybatisplus.annotation.TableName;
  4 +import java.math.BigDecimal;
  5 +import com.lframework.starter.web.core.dto.BaseDto;
  6 +import java.time.LocalDate;
  7 +import java.time.LocalDateTime;
  8 +import com.baomidou.mybatisplus.annotation.FieldFill;
  9 +import com.lframework.starter.web.core.entity.BaseEntity;
  10 +import com.baomidou.mybatisplus.annotation.TableField;
  11 +import lombok.Data;
  12 +
  13 +/**
  14 + * <p>
  15 + * 应收款台账明细
  16 + * </p>
  17 + *
  18 + */
  19 +@Data
  20 +@TableName("receipt_ledger_info")
  21 +public class ReceiptLedgerInfo extends BaseEntity implements BaseDto {
  22 +
  23 + private static final long serialVersionUID = 1L;
  24 +
  25 + public static final String CACHE_NAME = "ReceiptLedgerInfo";
  26 +
  27 + /**
  28 + * ID
  29 + */
  30 + private String id;
  31 +
  32 + /**
  33 + * 客户简称ID
  34 + */
  35 + private String customerShortId;
  36 +
  37 + /**
  38 + * 客户简称
  39 + */
  40 + @TableField(exist = false)
  41 + private String customerShortName;
  42 +
  43 + /**
  44 + * 客户类型
  45 + */
  46 + @TableField(exist = false)
  47 + private String customerType;
  48 +
  49 + /**
  50 + * 额度
  51 + */
  52 + private BigDecimal quota;
  53 +
  54 + /**
  55 + * 结算期限
  56 + */
  57 + private String settleTerm;
  58 +
  59 + /**
  60 + * 办事处ID
  61 + */
  62 + private String deptId;
  63 +
  64 + /**
  65 + * 办事处名称
  66 + */
  67 + @TableField(exist = false)
  68 + private String deptName;
  69 +
  70 + /**
  71 + * 区域ID
  72 + */
  73 + private String region;
  74 +
  75 + /**
  76 + * 区域名称
  77 + */
  78 + @TableField(exist = false)
  79 + private String regionName;
  80 +
  81 + /**
  82 + * 备货单位ID
  83 + */
  84 + private String stockUpCompanyId;
  85 +
  86 + /**
  87 + * 备货单位名称
  88 + */
  89 + @TableField(exist = false)
  90 + private String stockUpCompanyName;
  91 +
  92 + /**
  93 + * 客户ID
  94 + */
  95 + private String customerId;
  96 +
  97 + /**
  98 + * 客户名称
  99 + */
  100 + @TableField(exist = false)
  101 + private String customerName;
  102 +
  103 + /**
  104 + * 厂别
  105 + */
  106 + private String factoryType;
  107 +
  108 + /**
  109 + * 发货日期
  110 + */
  111 + private LocalDate shipmentDate;
  112 +
  113 + /**
  114 + * 期初应收账款
  115 + */
  116 + private BigDecimal startAccountReceivable;
  117 +
  118 + /**
  119 + * 到货日期
  120 + */
  121 + private LocalDate arrivalDate;
  122 +
  123 + /**
  124 + * 应办理日期
  125 + */
  126 + private LocalDate processedDate;
  127 +
  128 + /**
  129 + * 实际回笼日期
  130 + */
  131 + private LocalDate actualReturnedDate;
  132 +
  133 + /**
  134 + * 回笼金额
  135 + */
  136 + private BigDecimal returnedAmount;
  137 +
  138 + /**
  139 + * 实际回笼金额
  140 + */
  141 + private BigDecimal actualReturnedAmount;
  142 +
  143 + /**
  144 + * 期末应收账款
  145 + */
  146 + private BigDecimal endAccountReceivable;
  147 +
  148 + /**
  149 + * 申请状态
  150 + */
  151 + private String applyStatus;
  152 +
  153 + /**
  154 + * 协调办理日期
  155 + */
  156 + private LocalDate coordinateDate;
  157 +
  158 + /**
  159 + * 备注
  160 + */
  161 + private String remark;
  162 +
  163 + /**
  164 + * 二次协调日期
  165 + */
  166 + private LocalDate secondCoordinateDate;
  167 +
  168 + /**
  169 + * 三次协调日期
  170 + */
  171 + private LocalDate thirdCoordinateDate;
  172 +
  173 + /**
  174 + * 四次协调日期
  175 + */
  176 + private LocalDate fourthCoordinateDate;
  177 +
  178 + /**
  179 + * 五次协调日期
  180 + */
  181 + private LocalDate fifthCoordinateDate;
  182 +
  183 + /**
  184 + * 说明
  185 + */
  186 + private String description;
  187 +
  188 + /**
  189 + * 是否删除
  190 + */
  191 + private Integer delFlag;
  192 +
  193 + /**
  194 + * 创建人ID
  195 + */
  196 + @TableField(fill = FieldFill.INSERT)
  197 + private String createById;
  198 +
  199 + /**
  200 + * 更新人ID
  201 + */
  202 + @TableField(fill = FieldFill.INSERT_UPDATE)
  203 + private String updateById;
  204 +
  205 + /**
  206 + * 创建时间
  207 + */
  208 + @TableField(fill = FieldFill.INSERT)
  209 + private LocalDateTime createTime;
  210 +
  211 + /**
  212 + * 更新时间
  213 + */
  214 + @TableField(fill = FieldFill.INSERT_UPDATE)
  215 + private LocalDateTime updateTime;
  216 +
  217 +}
... ...
  1 +package com.lframework.xingyun.sc.impl.ledger;
  2 +
  3 +import com.github.pagehelper.PageInfo;
  4 +import com.lframework.xingyun.sc.entity.ReceiptLedgerInfo;
  5 +import com.lframework.starter.web.core.impl.BaseMpServiceImpl;
  6 +import com.lframework.starter.web.core.utils.PageResultUtil;
  7 +import com.lframework.starter.web.core.utils.OpLogUtil;
  8 +import com.lframework.starter.web.core.utils.IdUtil;
  9 +import com.lframework.starter.web.core.annotations.oplog.OpLog;
  10 +import com.lframework.starter.web.core.utils.PageHelperUtil;
  11 +import com.lframework.starter.web.inner.components.oplog.OtherOpLogType;
  12 +import com.lframework.starter.web.core.components.resp.PageResult;
  13 +import com.lframework.starter.common.utils.Assert;
  14 +import org.springframework.transaction.annotation.Transactional;
  15 +import com.lframework.xingyun.sc.mappers.ReceiptLedgerInfoMapper;
  16 +import com.lframework.xingyun.sc.service.ledger.ReceiptLedgerInfoService;
  17 +import com.lframework.xingyun.sc.vo.ledger.receipt.CreateReceiptLedgerInfoVo;
  18 +import com.lframework.xingyun.sc.vo.ledger.receipt.QueryReceiptLedgerInfoVo;
  19 +import org.springframework.stereotype.Service;
  20 +
  21 +import java.util.List;
  22 +
  23 +@Service
  24 +public class ReceiptLedgerInfoServiceImpl extends BaseMpServiceImpl<ReceiptLedgerInfoMapper, ReceiptLedgerInfo> implements ReceiptLedgerInfoService {
  25 +
  26 + @Override
  27 + public PageResult<ReceiptLedgerInfo> query(Integer pageIndex, Integer pageSize, QueryReceiptLedgerInfoVo vo) {
  28 + Assert.greaterThanZero(pageIndex);
  29 + Assert.greaterThanZero(pageSize);
  30 +
  31 + PageHelperUtil.startPage(pageIndex, pageSize);
  32 + List<ReceiptLedgerInfo> dataList = this.query(vo);
  33 +
  34 + return PageResultUtil.convert(new PageInfo<>(dataList));
  35 + }
  36 +
  37 + @Override
  38 + public List<ReceiptLedgerInfo> query(QueryReceiptLedgerInfoVo vo) {
  39 +
  40 + return getBaseMapper().query(vo);
  41 + }
  42 +
  43 + @Override
  44 + public ReceiptLedgerInfo findById(String id) {
  45 + QueryReceiptLedgerInfoVo ledgerInfoVo = new QueryReceiptLedgerInfoVo();
  46 + ledgerInfoVo.setId(id);
  47 + return getBaseMapper().query(ledgerInfoVo).get(0);
  48 + }
  49 +
  50 + @OpLog(type = OtherOpLogType.class, name = "新增应收款台账明细,ID:{}", params = {"#id"})
  51 + @Transactional(rollbackFor = Exception.class)
  52 + @Override
  53 + public String create(CreateReceiptLedgerInfoVo vo) {
  54 + ReceiptLedgerInfo data = new ReceiptLedgerInfo();
  55 + data.setId(IdUtil.getId());
  56 + data.setCustomerShortId(vo.getCustomerShortId());
  57 + data.setQuota(vo.getQuota());
  58 + data.setSettleTerm(vo.getSettleTerm());
  59 + data.setDeptId(vo.getDeptId());
  60 + data.setRegion(vo.getRegion());
  61 + data.setStockUpCompanyId(vo.getStockUpCompanyId());
  62 + data.setCustomerId(vo.getCustomerId());
  63 + data.setFactoryType(vo.getFactoryType());
  64 + data.setShipmentDate(vo.getShipmentDate());
  65 + data.setStartAccountReceivable(vo.getStartAccountReceivable());
  66 + data.setArrivalDate(vo.getArrivalDate());
  67 + data.setProcessedDate(vo.getProcessedDate());
  68 + data.setActualReturnedDate(vo.getActualReturnedDate());
  69 + data.setReturnedAmount(vo.getReturnedAmount());
  70 + data.setActualReturnedAmount(vo.getActualReturnedAmount());
  71 + data.setEndAccountReceivable(vo.getEndAccountReceivable());
  72 + data.setApplyStatus(vo.getApplyStatus());
  73 + data.setCoordinateDate(vo.getCoordinateDate());
  74 + data.setRemark(vo.getRemark());
  75 + data.setSecondCoordinateDate(vo.getSecondCoordinateDate());
  76 + data.setThirdCoordinateDate(vo.getThirdCoordinateDate());
  77 + data.setFourthCoordinateDate(vo.getFourthCoordinateDate());
  78 + data.setFifthCoordinateDate(vo.getFifthCoordinateDate());
  79 + data.setDescription(vo.getDescription());
  80 +
  81 + getBaseMapper().insert(data);
  82 +
  83 + OpLogUtil.setVariable("id", data.getId());
  84 + OpLogUtil.setExtra(vo);
  85 +
  86 + return data.getId();
  87 + }
  88 +
  89 + @OpLog(type = OtherOpLogType.class, name = "删除应收款台账明细,ID:{}", params = {"#id"})
  90 + @Transactional(rollbackFor = Exception.class)
  91 + @Override
  92 + public void deleteById(String id) {
  93 + getBaseMapper().deleteById(id);
  94 + }
  95 +}
... ...
  1 +package com.lframework.xingyun.sc.mappers;
  2 +
  3 +import com.lframework.xingyun.sc.entity.ReceiptLedgerInfo;
  4 +import com.lframework.starter.web.core.mapper.BaseMapper;
  5 +import com.lframework.xingyun.sc.vo.ledger.receipt.QueryReceiptLedgerInfoVo;
  6 +import org.apache.ibatis.annotations.Param;
  7 +
  8 +import java.util.List;
  9 +
  10 +/**
  11 + * <p>
  12 + * 应收款台账明细 Mapper 接口
  13 + * </p>
  14 + *
  15 + */
  16 +public interface ReceiptLedgerInfoMapper extends BaseMapper<ReceiptLedgerInfo> {
  17 +
  18 + /**
  19 + * 查询列表
  20 + *
  21 + * @param vo 查询条件
  22 + * @return List<ReceiptLedgerInfo>
  23 + */
  24 + List<ReceiptLedgerInfo> query(@Param("vo") QueryReceiptLedgerInfoVo vo);
  25 +}
... ...
  1 +package com.lframework.xingyun.sc.service.ledger;
  2 +
  3 +import com.lframework.xingyun.sc.vo.ledger.receipt.CreateReceiptLedgerInfoVo;
  4 +import com.lframework.xingyun.sc.vo.ledger.receipt.QueryReceiptLedgerInfoVo;
  5 +import com.lframework.xingyun.sc.entity.ReceiptLedgerInfo;
  6 +import com.lframework.starter.web.core.service.BaseMpService;
  7 +import com.lframework.starter.web.core.components.resp.PageResult;
  8 +import java.util.List;
  9 +
  10 +/**
  11 + * 应收款台账明细 Service
  12 + */
  13 +public interface ReceiptLedgerInfoService extends BaseMpService<ReceiptLedgerInfo> {
  14 +
  15 + /**
  16 + * 查询列表
  17 + *
  18 + * @return PageResult<ReceiptLedgerInfo>
  19 + */
  20 + PageResult<ReceiptLedgerInfo> query(Integer pageIndex, Integer pageSize, QueryReceiptLedgerInfoVo vo);
  21 +
  22 + /**
  23 + * 查询列表
  24 + *
  25 + * @param vo 查询条件
  26 + * @return List<ReceiptLedgerInfo>
  27 + */
  28 + List<ReceiptLedgerInfo> query(QueryReceiptLedgerInfoVo vo);
  29 +
  30 + /**
  31 + * 根据ID查询
  32 + *
  33 + * @param id 主键ID
  34 + * @return ReceiptLedgerInfo
  35 + */
  36 + ReceiptLedgerInfo findById(String id);
  37 +
  38 + /**
  39 + * 创建
  40 + *
  41 + * @param vo 数据实体
  42 + * @return String
  43 + */
  44 + String create(CreateReceiptLedgerInfoVo vo);
  45 +
  46 +
  47 + /**
  48 + * 根据ID删除
  49 + *
  50 + * @param id 主键ID
  51 + */
  52 + void deleteById(String id);
  53 +}
... ...
  1 +package com.lframework.xingyun.sc.vo.ledger.receipt;
  2 +
  3 +import com.lframework.starter.web.core.components.validation.IsNumberPrecision;
  4 +import java.math.BigDecimal;
  5 +import javax.validation.constraints.NotBlank;
  6 +import java.time.LocalDate;
  7 +import com.lframework.starter.web.core.utils.IdUtil;
  8 +import com.lframework.starter.web.core.vo.BaseVo;
  9 +import javax.validation.constraints.NotNull;
  10 +import io.swagger.annotations.ApiModelProperty;
  11 +import com.lframework.starter.web.core.components.validation.TypeMismatch;
  12 +import org.hibernate.validator.constraints.Length;
  13 +import java.io.Serializable;
  14 +import lombok.Data;
  15 +
  16 +@Data
  17 +public class CreateReceiptLedgerInfoVo implements BaseVo, Serializable {
  18 +
  19 + private static final long serialVersionUID = 1L;
  20 +
  21 + /**
  22 + * 客户简称ID
  23 + */
  24 + @ApiModelProperty(value = "客户简称ID", required = true)
  25 + @NotBlank(message = "请输入客户简称ID!")
  26 + @Length(message = "客户简称ID最多允许32个字符!")
  27 + private String customerShortId;
  28 +
  29 + /**
  30 + * 额度
  31 + */
  32 + @ApiModelProperty(value = "额度", required = true)
  33 + @NotNull(message = "请输入额度!")
  34 + @TypeMismatch(message = "额度格式有误!")
  35 + @IsNumberPrecision(message = "额度最多允许4位小数!", value = 4)
  36 + private BigDecimal quota;
  37 +
  38 + /**
  39 + * 结算期限
  40 + */
  41 + @ApiModelProperty(value = "结算期限", required = true)
  42 + @NotBlank(message = "请输入结算期限!")
  43 + @Length(message = "结算期限最多允许50个字符!")
  44 + private String settleTerm;
  45 +
  46 + /**
  47 + * 办事处ID
  48 + */
  49 + @ApiModelProperty(value = "办事处ID", required = true)
  50 + @NotBlank(message = "请输入办事处ID!")
  51 + @Length(message = "办事处ID最多允许32个字符!")
  52 + private String deptId;
  53 +
  54 + /**
  55 + * 区域ID
  56 + */
  57 + @ApiModelProperty(value = "区域ID", required = true)
  58 + @NotBlank(message = "请输入区域ID!")
  59 + @Length(message = "区域ID最多允许32个字符!")
  60 + private String region;
  61 +
  62 + /**
  63 + * 备货单位ID
  64 + */
  65 + @ApiModelProperty(value = "备货单位ID", required = true)
  66 + @NotBlank(message = "请输入备货单位ID!")
  67 + @Length(message = "备货单位ID最多允许32个字符!")
  68 + private String stockUpCompanyId;
  69 +
  70 + /**
  71 + * 客户ID
  72 + */
  73 + @ApiModelProperty(value = "客户ID", required = true)
  74 + @NotBlank(message = "请输入客户ID!")
  75 + @Length(message = "客户ID最多允许32个字符!")
  76 + private String customerId;
  77 +
  78 + /**
  79 + * 厂别
  80 + */
  81 + @ApiModelProperty(value = "厂别", required = true)
  82 + @NotBlank(message = "请输入厂别!")
  83 + @Length(message = "厂别最多允许20个字符!")
  84 + private String factoryType;
  85 +
  86 + /**
  87 + * 发货日期
  88 + */
  89 + @ApiModelProperty(value = "发货日期", required = true)
  90 + @NotNull(message = "请输入发货日期!")
  91 + @TypeMismatch(message = "发货日期格式有误!")
  92 + private LocalDate shipmentDate;
  93 +
  94 + /**
  95 + * 期初应收账款
  96 + */
  97 + @ApiModelProperty(value = "期初应收账款", required = true)
  98 + @NotNull(message = "请输入期初应收账款!")
  99 + @TypeMismatch(message = "期初应收账款格式有误!")
  100 + @IsNumberPrecision(message = "期初应收账款最多允许4位小数!", value = 4)
  101 + private BigDecimal startAccountReceivable;
  102 +
  103 + /**
  104 + * 到货日期
  105 + */
  106 + @ApiModelProperty(value = "到货日期", required = true)
  107 + @NotNull(message = "请输入到货日期!")
  108 + @TypeMismatch(message = "到货日期格式有误!")
  109 + private LocalDate arrivalDate;
  110 +
  111 + /**
  112 + * 应办理日期
  113 + */
  114 + @ApiModelProperty(value = "应办理日期", required = true)
  115 + @NotNull(message = "请输入应办理日期!")
  116 + @TypeMismatch(message = "应办理日期格式有误!")
  117 + private LocalDate processedDate;
  118 +
  119 + /**
  120 + * 实际回笼日期
  121 + */
  122 + @ApiModelProperty(value = "实际回笼日期", required = true)
  123 + @NotNull(message = "请输入实际回笼日期!")
  124 + @TypeMismatch(message = "实际回笼日期格式有误!")
  125 + private LocalDate actualReturnedDate;
  126 +
  127 + /**
  128 + * 回笼金额
  129 + */
  130 + @ApiModelProperty(value = "回笼金额", required = true)
  131 + @NotNull(message = "请输入回笼金额!")
  132 + @TypeMismatch(message = "回笼金额格式有误!")
  133 + @IsNumberPrecision(message = "回笼金额最多允许4位小数!", value = 4)
  134 + private BigDecimal returnedAmount;
  135 +
  136 + /**
  137 + * 实际回笼金额
  138 + */
  139 + @ApiModelProperty(value = "实际回笼金额", required = true)
  140 + @NotNull(message = "请输入实际回笼金额!")
  141 + @TypeMismatch(message = "实际回笼金额格式有误!")
  142 + @IsNumberPrecision(message = "实际回笼金额最多允许4位小数!", value = 4)
  143 + private BigDecimal actualReturnedAmount;
  144 +
  145 + /**
  146 + * 期末应收账款
  147 + */
  148 + @ApiModelProperty(value = "期末应收账款", required = true)
  149 + @NotNull(message = "请输入期末应收账款!")
  150 + @TypeMismatch(message = "期末应收账款格式有误!")
  151 + @IsNumberPrecision(message = "期末应收账款最多允许4位小数!", value = 4)
  152 + private BigDecimal endAccountReceivable;
  153 +
  154 + /**
  155 + * 申请状态
  156 + */
  157 + @ApiModelProperty(value = "申请状态", required = true)
  158 + @NotBlank(message = "请输入申请状态!")
  159 + @Length(message = "申请状态最多允许20个字符!")
  160 + private String applyStatus;
  161 +
  162 + /**
  163 + * 协调办理日期
  164 + */
  165 + @ApiModelProperty(value = "协调办理日期", required = true)
  166 + @NotNull(message = "请输入协调办理日期!")
  167 + @TypeMismatch(message = "协调办理日期格式有误!")
  168 + private LocalDate coordinateDate;
  169 +
  170 + /**
  171 + * 备注
  172 + */
  173 + @ApiModelProperty(value = "备注", required = true)
  174 + @NotBlank(message = "请输入备注!")
  175 + @Length(message = "备注最多允许200个字符!")
  176 + private String remark;
  177 +
  178 + /**
  179 + * 二次协调日期
  180 + */
  181 + @ApiModelProperty(value = "二次协调日期", required = true)
  182 + @NotNull(message = "请输入二次协调日期!")
  183 + @TypeMismatch(message = "二次协调日期格式有误!")
  184 + private LocalDate secondCoordinateDate;
  185 +
  186 + /**
  187 + * 三次协调日期
  188 + */
  189 + @ApiModelProperty(value = "三次协调日期", required = true)
  190 + @NotNull(message = "请输入三次协调日期!")
  191 + @TypeMismatch(message = "三次协调日期格式有误!")
  192 + private LocalDate thirdCoordinateDate;
  193 +
  194 + /**
  195 + * 四次协调日期
  196 + */
  197 + @ApiModelProperty(value = "四次协调日期", required = true)
  198 + @NotNull(message = "请输入四次协调日期!")
  199 + @TypeMismatch(message = "四次协调日期格式有误!")
  200 + private LocalDate fourthCoordinateDate;
  201 +
  202 + /**
  203 + * 五次协调日期
  204 + */
  205 + @ApiModelProperty(value = "五次协调日期", required = true)
  206 + @NotNull(message = "请输入五次协调日期!")
  207 + @TypeMismatch(message = "五次协调日期格式有误!")
  208 + private LocalDate fifthCoordinateDate;
  209 +
  210 + /**
  211 + * 说明
  212 + */
  213 + @ApiModelProperty(value = "说明", required = true)
  214 + @NotBlank(message = "请输入说明!")
  215 + @Length(message = "说明最多允许200个字符!")
  216 + private String description;
  217 +
  218 +}
... ...
  1 +package com.lframework.xingyun.sc.vo.ledger.receipt;
  2 +
  3 +import lombok.Data;
  4 +import com.lframework.starter.web.core.vo.PageVo;
  5 +import com.lframework.starter.web.core.vo.BaseVo;
  6 +import com.lframework.starter.web.core.components.validation.TypeMismatch;
  7 +import io.swagger.annotations.ApiModelProperty;
  8 +import java.io.Serializable;
  9 +
  10 +@Data
  11 +public class QueryReceiptLedgerInfoVo extends PageVo implements BaseVo, Serializable {
  12 +
  13 + private static final long serialVersionUID = 1L;
  14 +
  15 + /**
  16 + * ID
  17 + */
  18 + @ApiModelProperty("ID")
  19 + private String id;
  20 +
  21 + /**
  22 + * 客户简称ID
  23 + */
  24 + @ApiModelProperty("客户简称ID")
  25 + private String customerShortId;
  26 +
  27 + /**
  28 + * 客户简称
  29 + */
  30 + @ApiModelProperty("客户简称")
  31 + private String customerShortName;
  32 +
  33 + /**
  34 + * 办事处ID
  35 + */
  36 + @ApiModelProperty("办事处ID")
  37 + private String deptId;
  38 +
  39 + /**
  40 + * 办事处名称
  41 + */
  42 + @ApiModelProperty("办事处名称")
  43 + private String deptName;
  44 +
  45 + /**
  46 + * 客户ID
  47 + */
  48 + @ApiModelProperty("客户ID")
  49 + private String customerId;
  50 +
  51 + /**
  52 + * 客户名称
  53 + */
  54 + @ApiModelProperty("客户名称")
  55 + private String customerName;
  56 +}
... ...
  1 +package com.lframework.xingyun.sc.vo.ledger.receipt;
  2 +
  3 +import lombok.Data;
  4 +import javax.validation.constraints.NotBlank;
  5 +import java.time.LocalDate;
  6 +import com.lframework.starter.web.core.vo.BaseVo;
  7 +import javax.validation.constraints.NotNull;
  8 +import com.lframework.starter.web.core.components.validation.TypeMismatch;
  9 +import io.swagger.annotations.ApiModelProperty;
  10 +import org.hibernate.validator.constraints.Length;
  11 +import java.io.Serializable;
  12 +
  13 +@Data
  14 +public class UpdateReceiptLedgerInfoVo implements BaseVo, Serializable {
  15 +
  16 + private static final long serialVersionUID = 1L;
  17 +
  18 + /**
  19 + * ID
  20 + */
  21 + @ApiModelProperty(value = "ID", required = true)
  22 + @NotBlank(message = "id不能为空!")
  23 + private String id;
  24 +
  25 + /**
  26 + * 应办理日期
  27 + */
  28 + @ApiModelProperty(value = "应办理日期", required = true)
  29 + @TypeMismatch(message = "应办理日期格式有误!")
  30 + @NotNull(message = "请输入应办理日期!")
  31 + private LocalDate processedDate;
  32 +
  33 + /**
  34 + * 备注
  35 + */
  36 + @ApiModelProperty(value = "备注", required = true)
  37 + @NotBlank(message = "请输入备注!")
  38 + @Length(message = "备注最多允许200个字符!")
  39 + private String remark;
  40 +
  41 + /**
  42 + * 说明
  43 + */
  44 + @ApiModelProperty(value = "说明", required = true)
  45 + @NotBlank(message = "请输入说明!")
  46 + @Length(message = "说明最多允许200个字符!")
  47 + private String description;
  48 +
  49 +}
... ...
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3 +<mapper namespace="com.lframework.xingyun.sc.mappers.ReceiptLedgerInfoMapper">
  4 +
  5 + <resultMap id="ReceiptLedgerInfo" type="com.lframework.xingyun.sc.entity.ReceiptLedgerInfo">
  6 + <id column="id" property="id"/>
  7 + <result column="customer_short_id" property="customerShortId"/>
  8 + <result column="customer_short_name" property="customerShortName"/>
  9 + <result column="customer_type" property="customerType"/>
  10 + <result column="quota" property="quota"/>
  11 + <result column="settle_term" property="settleTerm"/>
  12 + <result column="dept_id" property="deptId"/>
  13 + <result column="dept_name" property="deptName"/>
  14 + <result column="region" property="region"/>
  15 + <result column="region_name" property="regionName"/>
  16 + <result column="stock_up_company_id" property="stockUpCompanyId"/>
  17 + <result column="stock_up_company_name" property="stockUpCompanyName"/>
  18 + <result column="customer_id" property="customerId"/>
  19 + <result column="customer_name" property="customerName"/>
  20 + <result column="factory_type" property="factoryType"/>
  21 + <result column="shipment_date" property="shipmentDate"/>
  22 + <result column="start_account_receivable" property="startAccountReceivable"/>
  23 + <result column="arrival_date" property="arrivalDate"/>
  24 + <result column="processed_date" property="processedDate"/>
  25 + <result column="actual_returned_date" property="actualReturnedDate"/>
  26 + <result column="returned_amount" property="returnedAmount"/>
  27 + <result column="actual_returned_amount" property="actualReturnedAmount"/>
  28 + <result column="end_account_receivable" property="endAccountReceivable"/>
  29 + <result column="apply_status" property="applyStatus"/>
  30 + <result column="coordinate_date" property="coordinateDate"/>
  31 + <result column="remark" property="remark"/>
  32 + <result column="second_coordinate_date" property="secondCoordinateDate"/>
  33 + <result column="third_coordinate_date" property="thirdCoordinateDate"/>
  34 + <result column="fourth_coordinate_date" property="fourthCoordinateDate"/>
  35 + <result column="fifth_coordinate_date" property="fifthCoordinateDate"/>
  36 + <result column="description" property="description"/>
  37 + <result column="del_flag" property="delFlag"/>
  38 + <result column="create_by_id" property="createById"/>
  39 + <result column="update_by_id" property="updateById"/>
  40 + <result column="create_time" property="createTime"/>
  41 + <result column="update_time" property="updateTime"/>
  42 + </resultMap>
  43 +
  44 + <sql id="ReceiptLedgerInfo_sql">
  45 + SELECT
  46 + tb.id,
  47 + tb.customer_short_id,
  48 + cs.short_name as customer_short_name,
  49 + cs.type as customer_type,
  50 + tb.quota,
  51 + tb.settle_term,
  52 + tb.dept_id,
  53 + d.name as dept_name,
  54 + tb.region,
  55 + r.name as region_name,
  56 + tb.stock_up_company_id,
  57 + sc.name as stock_up_company_name,
  58 + tb.customer_id,
  59 + oc.name as customer_name,
  60 + tb.factory_type,
  61 + tb.shipment_date,
  62 + tb.start_account_receivable,
  63 + tb.arrival_date,
  64 + tb.processed_date,
  65 + tb.actual_returned_date,
  66 + tb.returned_amount,
  67 + tb.end_account_receivable,
  68 + tb.apply_status,
  69 + tb.coordinate_date,
  70 + tb.remark,
  71 + tb.second_coordinate_date,
  72 + tb.third_coordinate_date,
  73 + tb.fourth_coordinate_date,
  74 + tb.fifth_coordinate_date,
  75 + tb.description,
  76 + tb.del_flag,
  77 + tb.create_by_id,
  78 + tb.update_by_id,
  79 + tb.create_time,
  80 + tb.update_time
  81 + FROM receipt_ledger_info AS tb
  82 + LEFT JOIN base_data_customer_short cs ON tb.customer_short_id = cs.id
  83 + LEFT JOIN base_data_customer sc ON tb.stock_up_company_id = sc.id
  84 + LEFT JOIN base_data_customer oc ON tb.customer_id = oc.id
  85 + LEFT JOIN sys_dept d ON tb.dept_id = d.id
  86 + LEFT JOIN sys_dept r ON tb.region = r.id
  87 + </sql>
  88 +
  89 + <select id="query" resultMap="ReceiptLedgerInfo">
  90 + <include refid="ReceiptLedgerInfo_sql"/>
  91 + <where>
  92 + <if test="vo.id != null and vo.id != ''">
  93 + AND tb.id = #{id}
  94 + </if>
  95 + <if test="vo.customerShortId != null and vo.customerShortId != ''">
  96 + AND tb.customer_short_id = #{vo.customerShortId}
  97 + </if>
  98 + <if test="vo.deptId != null and vo.deptId != ''">
  99 + AND tb.dept_id = #{vo.deptId}
  100 + </if>
  101 + <if test="vo.customerId != null and vo.customerId != ''">
  102 + AND tb.customer_id = #{vo.customerId}
  103 + </if>
  104 + <if test="vo.customerName != null and vo.customerName != ''">
  105 + AND oc.name LIKE CONCAT('%', #{vo.customerName}, '%')
  106 + </if>
  107 + <if test="vo.customerShortName != null and vo.customerShortName != ''">
  108 + AND cs.short_name LIKE CONCAT('%', #{vo.customerShortName}, '%')
  109 + </if>
  110 + <if test="vo.deptName != null and vo.deptName != ''">
  111 + AND d.name LIKE CONCAT('%', #{vo.deptName}, '%')
  112 + </if>
  113 + </where>
  114 + </select>
  115 +</mapper>
... ...