Commit ba879b1c95b846f7e9e5ad7cc652f3672cf7b95a

Authored by 房远帅
1 parent f8f7e085

楚江ERP:回笼资金

  1 +package com.lframework.xingyun.sc.bo.ledger.recapitalize;
  2 +
  3 +import com.fasterxml.jackson.annotation.JsonFormat;
  4 +import java.math.BigDecimal;
  5 +import com.lframework.starter.common.constants.StringPool;
  6 +import com.lframework.starter.web.core.bo.BaseBo;
  7 +import java.time.LocalDate;
  8 +import com.lframework.xingyun.sc.entity.Recapitalize;
  9 +import io.swagger.annotations.ApiModelProperty;
  10 +
  11 +import lombok.Data;
  12 +
  13 +/**
  14 + * <p>
  15 + * 回笼资金表 GetBo
  16 + * </p>
  17 + *
  18 + */
  19 +@Data
  20 +public class GetRecapitalizeBo extends BaseBo<Recapitalize> {
  21 +
  22 + /**
  23 + * ID
  24 + */
  25 + @ApiModelProperty("ID")
  26 + private String id;
  27 +
  28 + /**
  29 + * 资金回笼日期
  30 + */
  31 + @ApiModelProperty("资金回笼日期")
  32 + @JsonFormat(pattern = StringPool.DATE_PATTERN)
  33 + private LocalDate recapitalizeDate;
  34 +
  35 + /**
  36 + * 订货单位ID
  37 + */
  38 + @ApiModelProperty("订货单位ID")
  39 + private String orderingUnit;
  40 +
  41 + /**
  42 + * 订货单位名称
  43 + */
  44 + @ApiModelProperty("订货单位名称")
  45 + private String orderingUnitName;
  46 +
  47 + /**
  48 + * 回笼金额
  49 + */
  50 + @ApiModelProperty("回笼金额")
  51 + private BigDecimal returnedAmount;
  52 +
  53 + /**
  54 + * 办事处ID
  55 + */
  56 + @ApiModelProperty("办事处ID")
  57 + private String deptId;
  58 +
  59 + /**
  60 + * 办事处名称
  61 + */
  62 + @ApiModelProperty("办事处名称")
  63 + private String deptName;
  64 +
  65 + /**
  66 + * 厂别
  67 + */
  68 + @ApiModelProperty("厂别")
  69 + private String factoryType;
  70 +
  71 + public GetRecapitalizeBo() {
  72 +
  73 + }
  74 +
  75 + public GetRecapitalizeBo(Recapitalize dto) {
  76 +
  77 + super(dto);
  78 + }
  79 +
  80 + @Override
  81 + public BaseBo<Recapitalize> convert(Recapitalize dto) {
  82 + return super.convert(dto);
  83 + }
  84 +
  85 + @Override
  86 + protected void afterInit(Recapitalize dto) {
  87 +
  88 + }
  89 +}
  1 +package com.lframework.xingyun.sc.bo.ledger.recapitalize;
  2 +
  3 +import com.fasterxml.jackson.annotation.JsonFormat;
  4 +import java.math.BigDecimal;
  5 +import com.lframework.starter.common.constants.StringPool;
  6 +import com.lframework.starter.web.core.bo.BaseBo;
  7 +import java.time.LocalDate;
  8 +import com.lframework.xingyun.sc.entity.Recapitalize;
  9 +import io.swagger.annotations.ApiModelProperty;
  10 +
  11 +import lombok.Data;
  12 +
  13 +/**
  14 + * <p>
  15 + * 回笼资金表 QueryBo
  16 + * </p>
  17 + *
  18 + */
  19 +@Data
  20 +public class QueryRecapitalizeBo extends BaseBo<Recapitalize> {
  21 +
  22 + /**
  23 + * ID
  24 + */
  25 + @ApiModelProperty("ID")
  26 + private String id;
  27 +
  28 + /**
  29 + * 资金回笼日期
  30 + */
  31 + @ApiModelProperty("资金回笼日期")
  32 + @JsonFormat(pattern = StringPool.DATE_PATTERN)
  33 + private LocalDate recapitalizeDate;
  34 +
  35 + /**
  36 + * 订货单位ID
  37 + */
  38 + @ApiModelProperty("订货单位ID")
  39 + private String orderingUnit;
  40 +
  41 + /**
  42 + * 订货单位名称
  43 + */
  44 + @ApiModelProperty("订货单位名称")
  45 + private String orderingUnitName;
  46 +
  47 + /**
  48 + * 回笼金额
  49 + */
  50 + @ApiModelProperty("回笼金额")
  51 + private BigDecimal returnedAmount;
  52 +
  53 + /**
  54 + * 办事处ID
  55 + */
  56 + @ApiModelProperty("办事处ID")
  57 + private String deptId;
  58 +
  59 + /**
  60 + * 办事处名称
  61 + */
  62 + @ApiModelProperty("办事处名称")
  63 + private String deptName;
  64 +
  65 + /**
  66 + * 厂别
  67 + */
  68 + @ApiModelProperty("厂别")
  69 + private String factoryType;
  70 +
  71 + public QueryRecapitalizeBo() {
  72 +
  73 + }
  74 +
  75 + public QueryRecapitalizeBo(Recapitalize dto) {
  76 +
  77 + super(dto);
  78 + }
  79 +
  80 + @Override
  81 + public BaseBo<Recapitalize> convert(Recapitalize dto) {
  82 + return super.convert(dto);
  83 + }
  84 +
  85 + @Override
  86 + protected void afterInit(Recapitalize dto) {
  87 +
  88 + }
  89 +}
  1 +package com.lframework.xingyun.sc.controller.ledger;
  2 +
  3 +import com.lframework.starter.web.core.annotations.security.HasPermission;
  4 +import com.lframework.starter.web.core.controller.DefaultBaseController;
  5 +import com.lframework.starter.web.core.utils.ExcelUtil;
  6 +import com.lframework.starter.web.core.utils.PageResultUtil;
  7 +import com.lframework.starter.web.core.components.resp.PageResult;
  8 +import com.lframework.starter.web.core.components.resp.InvokeResult;
  9 +import javax.servlet.http.HttpServletResponse;
  10 +import javax.validation.constraints.NotBlank;
  11 +import com.lframework.xingyun.sc.bo.ledger.recapitalize.GetRecapitalizeBo;
  12 +import com.lframework.xingyun.sc.bo.ledger.recapitalize.QueryRecapitalizeBo;
  13 +import com.lframework.xingyun.sc.entity.Recapitalize;
  14 +import com.lframework.xingyun.sc.service.ledger.RecapitalizeService;
  15 +import com.lframework.xingyun.sc.vo.ledger.recapitalize.CreateRecapitalizeVo;
  16 +import com.lframework.xingyun.sc.vo.ledger.recapitalize.QueryRecapitalizeVo;
  17 +import com.lframework.xingyun.sc.vo.ledger.recapitalize.UpdateRecapitalizeVo;
  18 +import io.swagger.annotations.ApiImplicitParam;
  19 +import com.lframework.starter.web.core.components.resp.InvokeResultBuilder;
  20 +import com.lframework.starter.common.exceptions.impl.DefaultClientException;
  21 +import io.swagger.annotations.ApiOperation;
  22 +import com.lframework.starter.common.utils.CollectionUtil;
  23 +import io.swagger.annotations.Api;
  24 +import org.springframework.web.bind.annotation.DeleteMapping;
  25 +import org.springframework.beans.factory.annotation.Autowired;
  26 +import org.springframework.validation.annotation.Validated;
  27 +import org.springframework.web.bind.annotation.*;
  28 +import org.springframework.web.multipart.MultipartFile;
  29 +
  30 +import javax.validation.Valid;
  31 +import javax.validation.constraints.NotNull;
  32 +import java.io.IOException;
  33 +import java.util.List;
  34 +import java.util.stream.Collectors;
  35 +
  36 +/**
  37 + * 回笼资金表 Controller
  38 + *
  39 + */
  40 +@Api(tags = "回笼资金表")
  41 +@Validated
  42 +@RestController
  43 +@RequestMapping("/recapitalize")
  44 +public class RecapitalizeController extends DefaultBaseController {
  45 +
  46 + @Autowired
  47 + private RecapitalizeService RecapitalizeService;
  48 +
  49 + /**
  50 + * 查询列表
  51 + */
  52 + @ApiOperation("查询列表")
  53 + @HasPermission({"account-manage:recoup-funds:query"})
  54 + @GetMapping("/query")
  55 + public InvokeResult<PageResult<QueryRecapitalizeBo>> query(@Valid QueryRecapitalizeVo vo) {
  56 +
  57 + PageResult<Recapitalize> pageResult = RecapitalizeService.query(getPageIndex(vo), getPageSize(vo), vo);
  58 +
  59 + List<Recapitalize> datas = pageResult.getDatas();
  60 + List<QueryRecapitalizeBo> results = null;
  61 +
  62 + if (!CollectionUtil.isEmpty(datas)) {
  63 + results = datas.stream().map(QueryRecapitalizeBo::new).collect(Collectors.toList());
  64 + }
  65 +
  66 + return InvokeResultBuilder.success(PageResultUtil.rebuild(pageResult, results));
  67 + }
  68 +
  69 + /**
  70 + * 根据ID查询
  71 + */
  72 + @ApiOperation("根据ID查询")
  73 + @ApiImplicitParam(value = "id", name = "id", paramType = "query", required = true)
  74 + @HasPermission({"account-manage:recoup-funds:query"})
  75 + @GetMapping
  76 + public InvokeResult<GetRecapitalizeBo> get(@NotBlank(message = "id不能为空!") String id) {
  77 +
  78 + Recapitalize data = RecapitalizeService.findById(id);
  79 + if (data == null) {
  80 + throw new DefaultClientException("回笼资金表不存在!");
  81 + }
  82 +
  83 + GetRecapitalizeBo result = new GetRecapitalizeBo(data);
  84 +
  85 + return InvokeResultBuilder.success(result);
  86 + }
  87 +
  88 + /**
  89 + * 新增
  90 + */
  91 + @ApiOperation("新增")
  92 + @HasPermission({"account-manage:recoup-funds:add"})
  93 + @PostMapping
  94 + public InvokeResult<Void> create(@Valid CreateRecapitalizeVo vo) {
  95 +
  96 + RecapitalizeService.create(vo);
  97 +
  98 + return InvokeResultBuilder.success();
  99 + }
  100 +
  101 + /**
  102 + * 修改
  103 + */
  104 + @ApiOperation("修改")
  105 + @HasPermission({"account-manage:recoup-funds:modify"})
  106 + @PutMapping
  107 + public InvokeResult<Void> update(@Valid UpdateRecapitalizeVo vo) {
  108 +
  109 + RecapitalizeService.update(vo);
  110 +
  111 + return InvokeResultBuilder.success();
  112 + }
  113 +
  114 + /**
  115 + * 根据ID删除
  116 + */
  117 + @ApiOperation("根据ID删除")
  118 + @ApiImplicitParam(value = "id", name = "id", paramType = "query", required = true)
  119 + @HasPermission({"account-manage:recoup-funds:delete"})
  120 + @DeleteMapping
  121 + public InvokeResult<Void> deleteById(@NotBlank(message = "id不能为空!") String id) {
  122 +
  123 + RecapitalizeService.deleteById(id);
  124 +
  125 + return InvokeResultBuilder.success();
  126 + }
  127 +
  128 +// @ApiOperation("下载导入模板")
  129 +// @HasPermission({"account-manage:recoup-funds:import"})
  130 +// @GetMapping("/import/template")
  131 +// public void downloadImportTemplate(HttpServletResponse response) throws IOException {
  132 +// ExcelUtil.exportXls("回笼资金导入模板", CustomerCreditChangeImportModel.class);
  133 +// }
  134 +//
  135 +// @ApiOperation("导入")
  136 +// @HasPermission({"account-manage:recoup-funds:import"})
  137 +// @PostMapping("/import")
  138 +// public InvokeResult<Void> importExcel(@NotBlank(message = "ID不能为空") String id,
  139 +// @NotNull(message = "请上传文件") MultipartFile file) {
  140 +//
  141 +// CustomerCreditChangeImportListener listener = new CustomerCreditChangeImportListener();
  142 +// listener.setTaskId(id);
  143 +// ExcelUtil.read(file, CustomerCreditChangeImportModel.class, listener).sheet().doRead();
  144 +//
  145 +// return InvokeResultBuilder.success();
  146 +// }
  147 +}
  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("tbl_recapitalize")
  21 +public class Recapitalize extends BaseEntity implements BaseDto {
  22 +
  23 + private static final long serialVersionUID = 1L;
  24 +
  25 + public static final String CACHE_NAME = "TblRecapitalize";
  26 +
  27 + /**
  28 + * ID
  29 + */
  30 + private String id;
  31 +
  32 + /**
  33 + * 资金回笼日期
  34 + */
  35 + private LocalDate recapitalizeDate;
  36 +
  37 + /**
  38 + * 订货单位ID
  39 + */
  40 + private String orderingUnit;
  41 +
  42 + /**
  43 + * 订货单位名称
  44 + */
  45 + @TableField(exist = false)
  46 + private String orderingUnitName;
  47 +
  48 + /**
  49 + * 回笼金额
  50 + */
  51 + private BigDecimal returnedAmount;
  52 +
  53 + /**
  54 + * 办事处ID
  55 + */
  56 + private String deptId;
  57 +
  58 + /**
  59 + * 办事处名称
  60 + */
  61 + @TableField(exist = false)
  62 + private String deptName;
  63 +
  64 + /**
  65 + * 厂别
  66 + */
  67 + private String factoryType;
  68 +
  69 + /**
  70 + * 创建人ID
  71 + */
  72 + @TableField(fill = FieldFill.INSERT)
  73 + private String createById;
  74 +
  75 + /**
  76 + * 创建人
  77 + */
  78 + @TableField(fill = FieldFill.INSERT)
  79 + private String createBy;
  80 +
  81 + /**
  82 + * 更新人ID
  83 + */
  84 + @TableField(fill = FieldFill.INSERT_UPDATE)
  85 + private String updateById;
  86 +
  87 + /**
  88 + * 更新人
  89 + */
  90 + @TableField(fill = FieldFill.INSERT_UPDATE)
  91 + private String updateBy;
  92 +
  93 + /**
  94 + * 创建时间
  95 + */
  96 + @TableField(fill = FieldFill.INSERT)
  97 + private LocalDateTime createTime;
  98 +
  99 + /**
  100 + * 更新时间
  101 + */
  102 + @TableField(fill = FieldFill.INSERT_UPDATE)
  103 + private LocalDateTime updateTime;
  104 +
  105 +}
  1 +package com.lframework.xingyun.sc.impl.ledger;
  2 +
  3 +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
  4 +import com.baomidou.mybatisplus.core.toolkit.Wrappers;
  5 +import com.github.pagehelper.PageInfo;
  6 +import com.lframework.starter.web.core.impl.BaseMpServiceImpl;
  7 +import com.lframework.starter.web.core.utils.PageResultUtil;
  8 +import com.lframework.starter.web.core.utils.OpLogUtil;
  9 +import com.lframework.starter.common.exceptions.impl.DefaultClientException;
  10 +import java.io.Serializable;
  11 +import com.lframework.starter.web.core.utils.IdUtil;
  12 +import com.lframework.starter.web.core.annotations.oplog.OpLog;
  13 +import com.lframework.starter.web.core.utils.PageHelperUtil;
  14 +import com.lframework.starter.web.inner.components.oplog.OtherOpLogType;
  15 +import com.lframework.starter.web.core.components.resp.PageResult;
  16 +import com.lframework.starter.common.utils.ObjectUtil;
  17 +import com.lframework.starter.common.utils.Assert;
  18 +import com.lframework.xingyun.sc.entity.Recapitalize;
  19 +import com.lframework.xingyun.sc.mappers.RecapitalizeMapper;
  20 +import com.lframework.xingyun.sc.service.ledger.RecapitalizeService;
  21 +import com.lframework.xingyun.sc.vo.ledger.recapitalize.CreateRecapitalizeVo;
  22 +import com.lframework.xingyun.sc.vo.ledger.recapitalize.QueryRecapitalizeVo;
  23 +import com.lframework.xingyun.sc.vo.ledger.recapitalize.UpdateRecapitalizeVo;
  24 +import org.springframework.transaction.annotation.Transactional;
  25 +import org.springframework.stereotype.Service;
  26 +
  27 +import java.util.List;
  28 +
  29 +@Service
  30 +public class RecapitalizeServiceImpl extends BaseMpServiceImpl<RecapitalizeMapper, Recapitalize> implements RecapitalizeService {
  31 +
  32 + @Override
  33 + public PageResult<Recapitalize> query(Integer pageIndex, Integer pageSize, QueryRecapitalizeVo vo) {
  34 +
  35 + Assert.greaterThanZero(pageIndex);
  36 + Assert.greaterThanZero(pageSize);
  37 +
  38 + PageHelperUtil.startPage(pageIndex, pageSize);
  39 + List<Recapitalize> datas = this.query(vo);
  40 +
  41 + return PageResultUtil.convert(new PageInfo<>(datas));
  42 + }
  43 +
  44 + @Override
  45 + public List<Recapitalize> query(QueryRecapitalizeVo vo) {
  46 +
  47 + return getBaseMapper().query(vo);
  48 + }
  49 +
  50 + @Override
  51 + public Recapitalize findById(String id) {
  52 +
  53 + return getBaseMapper().findById(id);
  54 + }
  55 +
  56 + @OpLog(type = OtherOpLogType.class, name = "新增回笼资金表,ID:{}", params = {"#id"})
  57 + @Transactional(rollbackFor = Exception.class)
  58 + @Override
  59 + public String create(CreateRecapitalizeVo vo) {
  60 +
  61 + Recapitalize data = new Recapitalize();
  62 + data.setId(IdUtil.getId());
  63 + data.setRecapitalizeDate(vo.getRecapitalizeDate());
  64 + data.setOrderingUnit(vo.getOrderingUnit());
  65 + data.setReturnedAmount(vo.getReturnedAmount());
  66 + data.setDeptId(vo.getDeptId());
  67 + data.setFactoryType(vo.getFactoryType());
  68 +
  69 + getBaseMapper().insert(data);
  70 +
  71 + OpLogUtil.setVariable("id", data.getId());
  72 + OpLogUtil.setExtra(vo);
  73 +
  74 + return data.getId();
  75 + }
  76 +
  77 + @OpLog(type = OtherOpLogType.class, name = "修改回笼资金表,ID:{}", params = {"#id"})
  78 + @Transactional(rollbackFor = Exception.class)
  79 + @Override
  80 + public void update(UpdateRecapitalizeVo vo) {
  81 +
  82 + Recapitalize data = getBaseMapper().selectById(vo.getId());
  83 + if (ObjectUtil.isNull(data)) {
  84 + throw new DefaultClientException("回笼资金表不存在!");
  85 + }
  86 +
  87 + LambdaUpdateWrapper<Recapitalize> updateWrapper = Wrappers.lambdaUpdate(Recapitalize.class)
  88 + .set(Recapitalize::getRecapitalizeDate, vo.getRecapitalizeDate())
  89 + .set(Recapitalize::getOrderingUnit, vo.getOrderingUnit())
  90 + .set(Recapitalize::getReturnedAmount, vo.getReturnedAmount())
  91 + .set(Recapitalize::getDeptId, vo.getDeptId())
  92 + .set(Recapitalize::getFactoryType, vo.getFactoryType())
  93 + .eq(Recapitalize::getId, vo.getId());
  94 +
  95 + getBaseMapper().update(updateWrapper);
  96 +
  97 + OpLogUtil.setVariable("id", data.getId());
  98 + OpLogUtil.setExtra(vo);
  99 + }
  100 +
  101 + @OpLog(type = OtherOpLogType.class, name = "删除回笼资金表,ID:{}", params = {"#id"})
  102 + @Transactional(rollbackFor = Exception.class)
  103 + @Override
  104 + public void deleteById(String id) {
  105 +
  106 + getBaseMapper().deleteById(id);
  107 + }
  108 +
  109 + @Override
  110 + public void cleanCacheByKey(Serializable key) {
  111 +
  112 + }
  113 +}
  1 +package com.lframework.xingyun.sc.mappers;
  2 +
  3 +import com.lframework.starter.web.core.mapper.BaseMapper;
  4 +import com.lframework.xingyun.sc.entity.Recapitalize;
  5 +import com.lframework.xingyun.sc.vo.ledger.recapitalize.QueryRecapitalizeVo;
  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 RecapitalizeMapper extends BaseMapper<Recapitalize> {
  17 +
  18 + /**
  19 + * 查询列表
  20 + * @param vo
  21 + * @return
  22 + */
  23 + List<Recapitalize> query(@Param("vo") QueryRecapitalizeVo vo);
  24 +
  25 + Recapitalize findById(@Param("id") String id);
  26 +}
  1 +package com.lframework.xingyun.sc.service.ledger;
  2 +
  3 +import com.lframework.starter.web.core.service.BaseMpService;
  4 +import com.lframework.starter.web.core.components.resp.PageResult;
  5 +import com.lframework.xingyun.sc.entity.Recapitalize;
  6 +import com.lframework.xingyun.sc.vo.ledger.recapitalize.CreateRecapitalizeVo;
  7 +import com.lframework.xingyun.sc.vo.ledger.recapitalize.QueryRecapitalizeVo;
  8 +import com.lframework.xingyun.sc.vo.ledger.recapitalize.UpdateRecapitalizeVo;
  9 +import java.util.List;
  10 +
  11 +/**
  12 + * 回笼资金表 Service
  13 + */
  14 +public interface RecapitalizeService extends BaseMpService<Recapitalize> {
  15 +
  16 + /**
  17 + * 查询列表
  18 + * @return
  19 + */
  20 + PageResult<Recapitalize> query(Integer pageIndex, Integer pageSize, QueryRecapitalizeVo vo);
  21 +
  22 + /**
  23 + * 查询列表
  24 + * @param vo
  25 + * @return
  26 + */
  27 + List<Recapitalize> query(QueryRecapitalizeVo vo);
  28 +
  29 + /**
  30 + * 根据ID查询
  31 + * @param id
  32 + * @return
  33 + */
  34 + Recapitalize findById(String id);
  35 +
  36 + /**
  37 + * 创建
  38 + * @param vo
  39 + * @return
  40 + */
  41 + String create(CreateRecapitalizeVo vo);
  42 +
  43 + /**
  44 + * 修改
  45 + * @param vo
  46 + */
  47 + void update(UpdateRecapitalizeVo vo);
  48 +
  49 + /**
  50 + * 根据ID删除
  51 + * @param id
  52 + * @return
  53 + */
  54 + void deleteById(String id);
  55 +}
  1 +package com.lframework.xingyun.sc.vo.ledger.recapitalize;
  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 CreateRecapitalizeVo implements BaseVo, Serializable {
  18 +
  19 + private static final long serialVersionUID = 1L;
  20 +
  21 + /**
  22 + * 资金回笼日期
  23 + */
  24 + @ApiModelProperty(value = "资金回笼日期", required = true)
  25 + @NotNull(message = "请输入资金回笼日期!")
  26 + @TypeMismatch(message = "资金回笼日期格式有误!")
  27 + private LocalDate recapitalizeDate;
  28 +
  29 + /**
  30 + * 订货单位ID
  31 + */
  32 + @ApiModelProperty(value = "订货单位ID", required = true)
  33 + @NotBlank(message = "请输入订货单位ID!")
  34 + @Length(message = "订货单位ID最多允许100个字符!")
  35 + private String orderingUnit;
  36 +
  37 + /**
  38 + * 回笼金额
  39 + */
  40 + @ApiModelProperty(value = "回笼金额", required = true)
  41 + @NotNull(message = "请输入回笼金额!")
  42 + @TypeMismatch(message = "回笼金额格式有误!")
  43 + @IsNumberPrecision(message = "回笼金额最多允许4位小数!", value = 4)
  44 + private BigDecimal returnedAmount;
  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 + * 厂别
  56 + */
  57 + @ApiModelProperty(value = "厂别", required = true)
  58 + @NotBlank(message = "请输入厂别!")
  59 + @Length(message = "厂别最多允许50个字符!")
  60 + private String factoryType;
  61 +
  62 +}
  1 +package com.lframework.xingyun.sc.vo.ledger.recapitalize;
  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 io.swagger.annotations.ApiModelProperty;
  7 +import java.io.Serializable;
  8 +
  9 +@Data
  10 +public class QueryRecapitalizeVo extends PageVo implements BaseVo, Serializable {
  11 +
  12 + private static final long serialVersionUID = 1L;
  13 +
  14 + /**
  15 + * 资金回笼日期开始
  16 + */
  17 + @ApiModelProperty("资金回笼日期开始")
  18 + private String recapitalizeDateStart;
  19 +
  20 + /**
  21 + * 资金回笼日期结束
  22 + */
  23 + @ApiModelProperty("资金回笼日期结束")
  24 + private String recapitalizeDateEnd;
  25 +
  26 + /**
  27 + * 订货单位ID
  28 + */
  29 + @ApiModelProperty("订货单位ID")
  30 + private String orderingUnit;
  31 +
  32 + /**
  33 + * 办事处ID
  34 + */
  35 + @ApiModelProperty("办事处ID")
  36 + private String deptId;
  37 +
  38 + /**
  39 + * 厂别
  40 + */
  41 + @ApiModelProperty("厂别")
  42 + private String factoryType;
  43 +
  44 +}
  1 +package com.lframework.xingyun.sc.vo.ledger.recapitalize;
  2 +
  3 +import lombok.Data;
  4 +import com.lframework.starter.web.core.components.validation.IsNumberPrecision;
  5 +import java.math.BigDecimal;
  6 +import javax.validation.constraints.NotBlank;
  7 +import java.time.LocalDate;
  8 +import com.lframework.starter.web.core.vo.BaseVo;
  9 +import javax.validation.constraints.NotNull;
  10 +import com.lframework.starter.web.core.components.validation.TypeMismatch;
  11 +import io.swagger.annotations.ApiModelProperty;
  12 +import org.hibernate.validator.constraints.Length;
  13 +import java.io.Serializable;
  14 +
  15 +@Data
  16 +public class UpdateRecapitalizeVo implements BaseVo, Serializable {
  17 +
  18 + private static final long serialVersionUID = 1L;
  19 +
  20 + /**
  21 + * ID
  22 + */
  23 + @ApiModelProperty(value = "ID", required = true)
  24 + @NotBlank(message = "id不能为空!")
  25 + private String id;
  26 +
  27 + /**
  28 + * 资金回笼日期
  29 + */
  30 + @ApiModelProperty(value = "资金回笼日期", required = true)
  31 + @TypeMismatch(message = "资金回笼日期格式有误!")
  32 + @NotNull(message = "请输入资金回笼日期!")
  33 + private LocalDate recapitalizeDate;
  34 +
  35 + /**
  36 + * 订货单位ID
  37 + */
  38 + @ApiModelProperty(value = "订货单位ID", required = true)
  39 + @NotBlank(message = "请输入订货单位ID!")
  40 + @Length(message = "订货单位ID最多允许100个字符!")
  41 + private String orderingUnit;
  42 +
  43 + /**
  44 + * 回笼金额
  45 + */
  46 + @ApiModelProperty(value = "回笼金额", required = true)
  47 + @TypeMismatch(message = "回笼金额格式有误!")
  48 + @NotNull(message = "请输入回笼金额!")
  49 + @IsNumberPrecision(message = "回笼金额最多允许4位小数!", value = 4)
  50 + private BigDecimal returnedAmount;
  51 +
  52 + /**
  53 + * 办事处ID
  54 + */
  55 + @ApiModelProperty(value = "办事处ID", required = true)
  56 + @NotBlank(message = "请输入办事处ID!")
  57 + @Length(message = "办事处ID最多允许32个字符!")
  58 + private String deptId;
  59 +
  60 + /**
  61 + * 厂别
  62 + */
  63 + @ApiModelProperty(value = "厂别", required = true)
  64 + @NotBlank(message = "请输入厂别!")
  65 + @Length(message = "厂别最多允许50个字符!")
  66 + private String factoryType;
  67 +
  68 +}
  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.RecapitalizeMapper">
  4 +
  5 + <resultMap id="TblRecapitalize" type="com.lframework.xingyun.sc.entity.Recapitalize">
  6 + <id column="id" property="id"/>
  7 + <result column="recapitalize_date" property="recapitalizeDate"/>
  8 + <result column="ordering_unit" property="orderingUnit"/>
  9 + <result column="ordering_unit_name" property="orderingUnitName"/>
  10 + <result column="returned_amount" property="returnedAmount"/>
  11 + <result column="dept_id" property="deptId"/>
  12 + <result column="dept_name" property="deptName"/>
  13 + <result column="factory_type" property="factoryType"/>
  14 + <result column="create_by_id" property="createById"/>
  15 + <result column="create_by" property="createBy"/>
  16 + <result column="update_by_id" property="updateById"/>
  17 + <result column="update_by" property="updateBy"/>
  18 + <result column="create_time" property="createTime"/>
  19 + <result column="update_time" property="updateTime"/>
  20 + </resultMap>
  21 +
  22 + <sql id="Recapitalize_sql">
  23 + SELECT
  24 + tb.id,
  25 + tb.recapitalize_date,
  26 + tb.ordering_unit,
  27 + tb.ordering_unit_name,
  28 + tb.returned_amount,
  29 + tb.dept_id,
  30 + tb.dept_name,
  31 + tb.factory_type,
  32 + tb.create_by_id,
  33 + tb.create_by,
  34 + tb.update_by_id,
  35 + tb.update_by,
  36 + tb.create_time,
  37 + tb.update_time
  38 + FROM tbl_recapitalize AS tb
  39 + left join base_data_customer as cu on cu.id = tb.ordering_unit
  40 + left join sys_dept d on tb.dept_id = d.id
  41 + </sql>
  42 +
  43 + <select id="query" resultMap="Recapitalize">
  44 + <include refid="Recapitalize_sql"/>
  45 + <where>
  46 + <if test="vo.recapitalizeDateStart != null">
  47 + AND tb.recapitalize_date >= #{vo.recapitalizeDateStart}
  48 + </if>
  49 + <if test="vo.recapitalizeDateEnd != null">
  50 + <![CDATA[
  51 + AND tb.recapitalize_date <= #{vo.recapitalizeDateEnd}
  52 + ]]>
  53 + </if>
  54 + <if test="vo.orderingUnit != null and vo.orderingUnit != ''">
  55 + AND tb.ordering_unit = #{vo.orderingUnit}
  56 + </if>
  57 + <if test="vo.deptId != null and vo.deptId != ''">
  58 + AND tb.dept_id = #{vo.deptId}
  59 + </if>
  60 + <if test="vo.factoryType != null and vo.factoryType != ''">
  61 + AND tb.factory_type = #{vo.factoryType}
  62 + </if>
  63 + </where>
  64 + ORDER BY tb.create_time DESC
  65 + </select>
  66 +
  67 + <select id="findById" resultType="com.lframework.xingyun.sc.entity.Recapitalize">
  68 + <include refid="Recapitalize_sql"/>
  69 + <where>
  70 + <if test="id != null and id != ''">
  71 + AND tb.id = #{id}
  72 + </if>
  73 + </where>
  74 + </select>
  75 +</mapper>