Showing
12 changed files
with
851 additions
and
0 deletions
| @@ -1050,3 +1050,23 @@ CREATE TABLE `fund_ordering_unit` ( | @@ -1050,3 +1050,23 @@ CREATE TABLE `fund_ordering_unit` ( | ||
| 1050 | `update_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间', | 1050 | `update_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间', |
| 1051 | PRIMARY KEY (`id`) | 1051 | PRIMARY KEY (`id`) |
| 1052 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='资金协调手续订货单位关联表' | 1052 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='资金协调手续订货单位关联表' |
| 1053 | + | ||
| 1054 | +CREATE TABLE `fund_ordering_unit_detail`( | ||
| 1055 | + `id` varchar(32) NOT NULL COMMENT 'ID', | ||
| 1056 | + `fund_ordering_unit_id` varchar(32) DEFAULT NULL COMMENT '资金协调手续订货单位关联表ID', | ||
| 1057 | + `delivery_date` date DEFAULT NULL COMMENT '发货日期', | ||
| 1058 | + `accounts_receivable` varchar(50) DEFAULT NULL COMMENT '应收款(元)', | ||
| 1059 | + `status` varchar(20) DEFAULT NULL COMMENT '当前欠款状态', | ||
| 1060 | + `due_date` date DEFAULT NULL COMMENT '应办理日期', | ||
| 1061 | + `timeout` varchar(20) DEFAULT NULL COMMENT '已超时(天)', | ||
| 1062 | + `coordinate_handle_date` date DEFAULT NULL COMMENT '协调办理日期', | ||
| 1063 | + `actual_timeout` varchar(20) DEFAULT NULL COMMENT '实际超时(天)', | ||
| 1064 | + `remark` varchar(20) DEFAULT NULL COMMENT '备注', | ||
| 1065 | + `create_by_id` varchar(32) NOT NULL COMMENT '创建人ID', | ||
| 1066 | + `create_by` varchar(20) NOT NULL COMMENT '创建人', | ||
| 1067 | + `update_by_id` varchar(32) NOT NULL COMMENT '更新人ID', | ||
| 1068 | + `update_by` varchar(20) NOT NULL COMMENT '更新人', | ||
| 1069 | + `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', | ||
| 1070 | + `update_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间', | ||
| 1071 | + PRIMARY KEY (`id`) | ||
| 1072 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='资金协调手续订货单位应收款明细' |
xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/ledger/detail/GetFundOrderingUnitDetailBo.java
0 → 100644
| 1 | +package com.lframework.xingyun.sc.bo.ledger.detail; | ||
| 2 | + | ||
| 3 | +import com.fasterxml.jackson.annotation.JsonFormat; | ||
| 4 | +import com.lframework.starter.common.constants.StringPool; | ||
| 5 | +import com.lframework.starter.web.core.bo.BaseBo; | ||
| 6 | +import java.time.LocalDate; | ||
| 7 | +import com.lframework.xingyun.sc.entity.FundOrderingUnitDetail; | ||
| 8 | +import io.swagger.annotations.ApiModelProperty; | ||
| 9 | + | ||
| 10 | +import lombok.Data; | ||
| 11 | + | ||
| 12 | +/** | ||
| 13 | + * <p> | ||
| 14 | + * 资金协调手续订货单位明细表 GetBo | ||
| 15 | + * </p> | ||
| 16 | + * | ||
| 17 | + */ | ||
| 18 | +@Data | ||
| 19 | +public class GetFundOrderingUnitDetailBo extends BaseBo<FundOrderingUnitDetail> { | ||
| 20 | + | ||
| 21 | + /** | ||
| 22 | + * ID | ||
| 23 | + */ | ||
| 24 | + @ApiModelProperty("ID") | ||
| 25 | + private String id; | ||
| 26 | + | ||
| 27 | + /** | ||
| 28 | + * 资金协调手续订货单位关联表ID | ||
| 29 | + */ | ||
| 30 | + @ApiModelProperty("资金协调手续订货单位关联表ID") | ||
| 31 | + private String fundOrderingUnitId; | ||
| 32 | + | ||
| 33 | + /** | ||
| 34 | + * 发货日期 | ||
| 35 | + */ | ||
| 36 | + @ApiModelProperty("发货日期") | ||
| 37 | + @JsonFormat(pattern = StringPool.DATE_PATTERN) | ||
| 38 | + private LocalDate deliveryDate; | ||
| 39 | + | ||
| 40 | + /** | ||
| 41 | + * 应收款(元) | ||
| 42 | + */ | ||
| 43 | + @ApiModelProperty("应收款(元)") | ||
| 44 | + private String accountsReceivable; | ||
| 45 | + | ||
| 46 | + /** | ||
| 47 | + * 当前欠款状态 | ||
| 48 | + */ | ||
| 49 | + @ApiModelProperty("当前欠款状态") | ||
| 50 | + private String status; | ||
| 51 | + | ||
| 52 | + /** | ||
| 53 | + * 应办理日期 | ||
| 54 | + */ | ||
| 55 | + @ApiModelProperty("应办理日期") | ||
| 56 | + @JsonFormat(pattern = StringPool.DATE_PATTERN) | ||
| 57 | + private LocalDate dueDate; | ||
| 58 | + | ||
| 59 | + /** | ||
| 60 | + * 已超时(天) | ||
| 61 | + */ | ||
| 62 | + @ApiModelProperty("已超时(天)") | ||
| 63 | + private String timeout; | ||
| 64 | + | ||
| 65 | + /** | ||
| 66 | + * 协调办理日期 | ||
| 67 | + */ | ||
| 68 | + @ApiModelProperty("协调办理日期") | ||
| 69 | + @JsonFormat(pattern = StringPool.DATE_PATTERN) | ||
| 70 | + private LocalDate coordinateHandleDate; | ||
| 71 | + | ||
| 72 | + /** | ||
| 73 | + * 实际超时(天) | ||
| 74 | + */ | ||
| 75 | + @ApiModelProperty("实际超时(天)") | ||
| 76 | + private String actualTimeout; | ||
| 77 | + | ||
| 78 | + /** | ||
| 79 | + * 备注 | ||
| 80 | + */ | ||
| 81 | + @ApiModelProperty("备注") | ||
| 82 | + private String remark; | ||
| 83 | + | ||
| 84 | + public GetFundOrderingUnitDetailBo() { | ||
| 85 | + | ||
| 86 | + } | ||
| 87 | + | ||
| 88 | + public GetFundOrderingUnitDetailBo(FundOrderingUnitDetail dto) { | ||
| 89 | + | ||
| 90 | + super(dto); | ||
| 91 | + } | ||
| 92 | + | ||
| 93 | + @Override | ||
| 94 | + public BaseBo<FundOrderingUnitDetail> convert(FundOrderingUnitDetail dto) { | ||
| 95 | + return super.convert(dto); | ||
| 96 | + } | ||
| 97 | + | ||
| 98 | + @Override | ||
| 99 | + protected void afterInit(FundOrderingUnitDetail dto) { | ||
| 100 | + | ||
| 101 | + } | ||
| 102 | +} |
| 1 | +package com.lframework.xingyun.sc.bo.ledger.detail; | ||
| 2 | + | ||
| 3 | +import com.fasterxml.jackson.annotation.JsonFormat; | ||
| 4 | +import com.lframework.starter.common.constants.StringPool; | ||
| 5 | +import com.lframework.starter.web.core.bo.BaseBo; | ||
| 6 | +import java.time.LocalDate; | ||
| 7 | +import com.lframework.xingyun.sc.entity.FundOrderingUnitDetail; | ||
| 8 | +import io.swagger.annotations.ApiModelProperty; | ||
| 9 | + | ||
| 10 | +import lombok.Data; | ||
| 11 | + | ||
| 12 | +/** | ||
| 13 | + * <p> | ||
| 14 | + * 资金协调手续订货单位明细表 QueryBo | ||
| 15 | + * </p> | ||
| 16 | + * | ||
| 17 | + */ | ||
| 18 | +@Data | ||
| 19 | +public class QueryFundOrderingUnitDetailBo extends BaseBo<FundOrderingUnitDetail> { | ||
| 20 | + | ||
| 21 | + /** | ||
| 22 | + * ID | ||
| 23 | + */ | ||
| 24 | + @ApiModelProperty("ID") | ||
| 25 | + private String id; | ||
| 26 | + | ||
| 27 | + /** | ||
| 28 | + * 资金协调手续订货单位关联表ID | ||
| 29 | + */ | ||
| 30 | + @ApiModelProperty("资金协调手续订货单位关联表ID") | ||
| 31 | + private String fundOrderingUnitId; | ||
| 32 | + | ||
| 33 | + /** | ||
| 34 | + * 发货日期 | ||
| 35 | + */ | ||
| 36 | + @ApiModelProperty("发货日期") | ||
| 37 | + @JsonFormat(pattern = StringPool.DATE_PATTERN) | ||
| 38 | + private LocalDate deliveryDate; | ||
| 39 | + | ||
| 40 | + /** | ||
| 41 | + * 应收款(元) | ||
| 42 | + */ | ||
| 43 | + @ApiModelProperty("应收款(元)") | ||
| 44 | + private String accountsReceivable; | ||
| 45 | + | ||
| 46 | + /** | ||
| 47 | + * 当前欠款状态 | ||
| 48 | + */ | ||
| 49 | + @ApiModelProperty("当前欠款状态") | ||
| 50 | + private String status; | ||
| 51 | + | ||
| 52 | + /** | ||
| 53 | + * 应办理日期 | ||
| 54 | + */ | ||
| 55 | + @ApiModelProperty("应办理日期") | ||
| 56 | + @JsonFormat(pattern = StringPool.DATE_PATTERN) | ||
| 57 | + private LocalDate dueDate; | ||
| 58 | + | ||
| 59 | + /** | ||
| 60 | + * 已超时(天) | ||
| 61 | + */ | ||
| 62 | + @ApiModelProperty("已超时(天)") | ||
| 63 | + private String timeout; | ||
| 64 | + | ||
| 65 | + /** | ||
| 66 | + * 协调办理日期 | ||
| 67 | + */ | ||
| 68 | + @ApiModelProperty("协调办理日期") | ||
| 69 | + @JsonFormat(pattern = StringPool.DATE_PATTERN) | ||
| 70 | + private LocalDate coordinateHandleDate; | ||
| 71 | + | ||
| 72 | + /** | ||
| 73 | + * 实际超时(天) | ||
| 74 | + */ | ||
| 75 | + @ApiModelProperty("实际超时(天)") | ||
| 76 | + private String actualTimeout; | ||
| 77 | + | ||
| 78 | + /** | ||
| 79 | + * 备注 | ||
| 80 | + */ | ||
| 81 | + @ApiModelProperty("备注") | ||
| 82 | + private String remark; | ||
| 83 | + | ||
| 84 | + public QueryFundOrderingUnitDetailBo() { | ||
| 85 | + | ||
| 86 | + } | ||
| 87 | + | ||
| 88 | + public QueryFundOrderingUnitDetailBo(FundOrderingUnitDetail dto) { | ||
| 89 | + | ||
| 90 | + super(dto); | ||
| 91 | + } | ||
| 92 | + | ||
| 93 | + @Override | ||
| 94 | + public BaseBo<FundOrderingUnitDetail> convert(FundOrderingUnitDetail dto) { | ||
| 95 | + return super.convert(dto); | ||
| 96 | + } | ||
| 97 | + | ||
| 98 | + @Override | ||
| 99 | + protected void afterInit(FundOrderingUnitDetail dto) { | ||
| 100 | + | ||
| 101 | + } | ||
| 102 | +} |
| 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.PageResultUtil; | ||
| 6 | +import com.lframework.starter.web.core.components.resp.PageResult; | ||
| 7 | +import com.lframework.starter.web.core.components.resp.InvokeResult; | ||
| 8 | +import javax.validation.constraints.NotBlank; | ||
| 9 | +import com.lframework.xingyun.sc.bo.ledger.detail.GetFundOrderingUnitDetailBo; | ||
| 10 | +import com.lframework.xingyun.sc.bo.ledger.detail.QueryFundOrderingUnitDetailBo; | ||
| 11 | +import com.lframework.xingyun.sc.entity.FundOrderingUnitDetail; | ||
| 12 | +import com.lframework.xingyun.sc.service.ledger.FundOrderingUnitDetailService; | ||
| 13 | +import com.lframework.xingyun.sc.vo.ledger.detail.CreateFundOrderingUnitDetailVo; | ||
| 14 | +import com.lframework.xingyun.sc.vo.ledger.detail.QueryFundOrderingUnitDetailVo; | ||
| 15 | +import com.lframework.xingyun.sc.vo.ledger.detail.UpdateFundOrderingUnitDetailVo; | ||
| 16 | +import io.swagger.annotations.ApiImplicitParam; | ||
| 17 | +import com.lframework.starter.web.core.components.resp.InvokeResultBuilder; | ||
| 18 | +import com.lframework.starter.common.exceptions.impl.DefaultClientException; | ||
| 19 | +import io.swagger.annotations.ApiOperation; | ||
| 20 | +import com.lframework.starter.common.utils.CollectionUtil; | ||
| 21 | +import io.swagger.annotations.Api; | ||
| 22 | +import org.springframework.web.bind.annotation.DeleteMapping; | ||
| 23 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 24 | +import org.springframework.validation.annotation.Validated; | ||
| 25 | +import org.springframework.web.bind.annotation.*; | ||
| 26 | + | ||
| 27 | +import javax.validation.Valid; | ||
| 28 | +import java.util.List; | ||
| 29 | +import java.util.stream.Collectors; | ||
| 30 | + | ||
| 31 | +/** | ||
| 32 | + * 资金协调手续订货单位明细表 Controller | ||
| 33 | + * | ||
| 34 | + */ | ||
| 35 | +@Api(tags = "资金协调手续订货单位明细表") | ||
| 36 | +@Validated | ||
| 37 | +@RestController | ||
| 38 | +@RequestMapping("/fundOrderingUnitDetail") | ||
| 39 | +public class FundOrderingUnitDetailController extends DefaultBaseController { | ||
| 40 | + | ||
| 41 | + @Autowired | ||
| 42 | + private FundOrderingUnitDetailService fundOrderingUnitDetailService; | ||
| 43 | + | ||
| 44 | + /** | ||
| 45 | + * 查询列表 | ||
| 46 | + */ | ||
| 47 | + @ApiOperation("查询列表") | ||
| 48 | + @HasPermission({"fundOrderingUnitDetail:fundorderingunitdetail:query"}) | ||
| 49 | + @GetMapping("/query") | ||
| 50 | + public InvokeResult<PageResult<QueryFundOrderingUnitDetailBo>> query(@Valid QueryFundOrderingUnitDetailVo vo) { | ||
| 51 | + | ||
| 52 | + PageResult<FundOrderingUnitDetail> pageResult = fundOrderingUnitDetailService.query(getPageIndex(vo), getPageSize(vo), vo); | ||
| 53 | + | ||
| 54 | + List<FundOrderingUnitDetail> datas = pageResult.getDatas(); | ||
| 55 | + List<QueryFundOrderingUnitDetailBo> results = null; | ||
| 56 | + | ||
| 57 | + if (!CollectionUtil.isEmpty(datas)) { | ||
| 58 | + results = datas.stream().map(QueryFundOrderingUnitDetailBo::new).collect(Collectors.toList()); | ||
| 59 | + } | ||
| 60 | + | ||
| 61 | + return InvokeResultBuilder.success(PageResultUtil.rebuild(pageResult, results)); | ||
| 62 | + } | ||
| 63 | + | ||
| 64 | + /** | ||
| 65 | + * 根据ID查询 | ||
| 66 | + */ | ||
| 67 | + @ApiOperation("根据ID查询") | ||
| 68 | + @ApiImplicitParam(value = "id", name = "id", paramType = "query", required = true) | ||
| 69 | + @HasPermission({"fundOrderingUnitDetail:fundorderingunitdetail:query"}) | ||
| 70 | + @GetMapping | ||
| 71 | + public InvokeResult<GetFundOrderingUnitDetailBo> get(@NotBlank(message = "id不能为空!") String id) { | ||
| 72 | + | ||
| 73 | + FundOrderingUnitDetail data = fundOrderingUnitDetailService.findById(id); | ||
| 74 | + if (data == null) { | ||
| 75 | + throw new DefaultClientException("资金协调手续订货单位明细表不存在!"); | ||
| 76 | + } | ||
| 77 | + | ||
| 78 | + GetFundOrderingUnitDetailBo result = new GetFundOrderingUnitDetailBo(data); | ||
| 79 | + | ||
| 80 | + return InvokeResultBuilder.success(result); | ||
| 81 | + } | ||
| 82 | + | ||
| 83 | + /** | ||
| 84 | + * 新增 | ||
| 85 | + */ | ||
| 86 | + @ApiOperation("新增") | ||
| 87 | + @HasPermission({"fundOrderingUnitDetail:fundorderingunitdetail:add"}) | ||
| 88 | + @PostMapping | ||
| 89 | + public InvokeResult<Void> create(@Valid CreateFundOrderingUnitDetailVo vo) { | ||
| 90 | + | ||
| 91 | + fundOrderingUnitDetailService.create(vo); | ||
| 92 | + | ||
| 93 | + return InvokeResultBuilder.success(); | ||
| 94 | + } | ||
| 95 | + | ||
| 96 | + /** | ||
| 97 | + * 修改 | ||
| 98 | + */ | ||
| 99 | + @ApiOperation("修改") | ||
| 100 | + @HasPermission({"fundOrderingUnitDetail:fundorderingunitdetail:modify"}) | ||
| 101 | + @PutMapping | ||
| 102 | + public InvokeResult<Void> update(@Valid UpdateFundOrderingUnitDetailVo vo) { | ||
| 103 | + | ||
| 104 | + fundOrderingUnitDetailService.update(vo); | ||
| 105 | + | ||
| 106 | + return InvokeResultBuilder.success(); | ||
| 107 | + } | ||
| 108 | + | ||
| 109 | + /** | ||
| 110 | + * 根据ID删除 | ||
| 111 | + */ | ||
| 112 | + @ApiOperation("根据ID删除") | ||
| 113 | + @ApiImplicitParam(value = "id", name = "id", paramType = "query", required = true) | ||
| 114 | + @HasPermission({"fundOrderingUnitDetail:fundorderingunitdetail:delete"}) | ||
| 115 | + @DeleteMapping | ||
| 116 | + public InvokeResult<Void> deleteById(@NotBlank(message = "id不能为空!") String id) { | ||
| 117 | + | ||
| 118 | + fundOrderingUnitDetailService.deleteById(id); | ||
| 119 | + | ||
| 120 | + return InvokeResultBuilder.success(); | ||
| 121 | + } | ||
| 122 | +} |
| 1 | +package com.lframework.xingyun.sc.entity; | ||
| 2 | + | ||
| 3 | +import com.baomidou.mybatisplus.annotation.TableName; | ||
| 4 | +import com.lframework.starter.web.core.dto.BaseDto; | ||
| 5 | +import java.time.LocalDate; | ||
| 6 | +import java.time.LocalDateTime; | ||
| 7 | +import com.baomidou.mybatisplus.annotation.FieldFill; | ||
| 8 | +import com.lframework.starter.web.core.entity.BaseEntity; | ||
| 9 | +import com.baomidou.mybatisplus.annotation.TableField; | ||
| 10 | +import lombok.Data; | ||
| 11 | + | ||
| 12 | +/** | ||
| 13 | + * <p> | ||
| 14 | + * 资金协调手续订货单位明细表 | ||
| 15 | + * </p> | ||
| 16 | + * | ||
| 17 | + */ | ||
| 18 | +@Data | ||
| 19 | +@TableName("fund_ordering_unit_detail") | ||
| 20 | +public class FundOrderingUnitDetail extends BaseEntity implements BaseDto { | ||
| 21 | + | ||
| 22 | + private static final long serialVersionUID = 1L; | ||
| 23 | + | ||
| 24 | + public static final String CACHE_NAME = "FundOrderingUnitDetail"; | ||
| 25 | + | ||
| 26 | + /** | ||
| 27 | + * ID | ||
| 28 | + */ | ||
| 29 | + private String id; | ||
| 30 | + | ||
| 31 | + /** | ||
| 32 | + * 资金协调手续订货单位关联表ID | ||
| 33 | + */ | ||
| 34 | + private String fundOrderingUnitId; | ||
| 35 | + | ||
| 36 | + /** | ||
| 37 | + * 发货日期 | ||
| 38 | + */ | ||
| 39 | + private LocalDate deliveryDate; | ||
| 40 | + | ||
| 41 | + /** | ||
| 42 | + * 应收款(元) | ||
| 43 | + */ | ||
| 44 | + private String accountsReceivable; | ||
| 45 | + | ||
| 46 | + /** | ||
| 47 | + * 当前欠款状态 | ||
| 48 | + */ | ||
| 49 | + private String status; | ||
| 50 | + | ||
| 51 | + /** | ||
| 52 | + * 应办理日期 | ||
| 53 | + */ | ||
| 54 | + private LocalDate dueDate; | ||
| 55 | + | ||
| 56 | + /** | ||
| 57 | + * 已超时(天) | ||
| 58 | + */ | ||
| 59 | + private String timeout; | ||
| 60 | + | ||
| 61 | + /** | ||
| 62 | + * 协调办理日期 | ||
| 63 | + */ | ||
| 64 | + private LocalDate coordinateHandleDate; | ||
| 65 | + | ||
| 66 | + /** | ||
| 67 | + * 实际超时(天) | ||
| 68 | + */ | ||
| 69 | + private String actualTimeout; | ||
| 70 | + | ||
| 71 | + /** | ||
| 72 | + * 备注 | ||
| 73 | + */ | ||
| 74 | + private String remark; | ||
| 75 | + | ||
| 76 | + /** | ||
| 77 | + * 创建人ID | ||
| 78 | + */ | ||
| 79 | + @TableField(fill = FieldFill.INSERT) | ||
| 80 | + private String createById; | ||
| 81 | + | ||
| 82 | + /** | ||
| 83 | + * 创建人 | ||
| 84 | + */ | ||
| 85 | + @TableField(fill = FieldFill.INSERT) | ||
| 86 | + private String createBy; | ||
| 87 | + | ||
| 88 | + /** | ||
| 89 | + * 更新人ID | ||
| 90 | + */ | ||
| 91 | + @TableField(fill = FieldFill.INSERT_UPDATE) | ||
| 92 | + private String updateById; | ||
| 93 | + | ||
| 94 | + /** | ||
| 95 | + * 更新人 | ||
| 96 | + */ | ||
| 97 | + @TableField(fill = FieldFill.INSERT_UPDATE) | ||
| 98 | + private String updateBy; | ||
| 99 | + | ||
| 100 | + /** | ||
| 101 | + * 创建时间 | ||
| 102 | + */ | ||
| 103 | + @TableField(fill = FieldFill.INSERT) | ||
| 104 | + private LocalDateTime createTime; | ||
| 105 | + | ||
| 106 | + /** | ||
| 107 | + * 更新时间 | ||
| 108 | + */ | ||
| 109 | + @TableField(fill = FieldFill.INSERT_UPDATE) | ||
| 110 | + private LocalDateTime updateTime; | ||
| 111 | + | ||
| 112 | +} |
| 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.components.resp.PageResult; | ||
| 9 | +import com.lframework.starter.web.core.utils.OpLogUtil; | ||
| 10 | +import com.lframework.starter.common.utils.StringUtil; | ||
| 11 | +import com.lframework.starter.common.exceptions.impl.DefaultClientException; | ||
| 12 | +import java.io.Serializable; | ||
| 13 | +import com.lframework.starter.web.core.utils.IdUtil; | ||
| 14 | +import com.lframework.starter.common.utils.ObjectUtil; | ||
| 15 | +import com.lframework.starter.web.core.annotations.oplog.OpLog; | ||
| 16 | +import com.lframework.starter.web.core.utils.PageHelperUtil; | ||
| 17 | +import com.lframework.starter.common.utils.Assert; | ||
| 18 | +import com.lframework.starter.web.inner.components.oplog.OtherOpLogType; | ||
| 19 | +import com.lframework.xingyun.sc.entity.FundOrderingUnitDetail; | ||
| 20 | +import com.lframework.xingyun.sc.mappers.FundOrderingUnitDetailMapper; | ||
| 21 | +import com.lframework.xingyun.sc.service.ledger.FundOrderingUnitDetailService; | ||
| 22 | +import com.lframework.xingyun.sc.vo.ledger.detail.CreateFundOrderingUnitDetailVo; | ||
| 23 | +import com.lframework.xingyun.sc.vo.ledger.detail.QueryFundOrderingUnitDetailVo; | ||
| 24 | +import com.lframework.xingyun.sc.vo.ledger.detail.UpdateFundOrderingUnitDetailVo; | ||
| 25 | +import org.springframework.transaction.annotation.Transactional; | ||
| 26 | +import org.springframework.stereotype.Service; | ||
| 27 | + | ||
| 28 | +import java.util.List; | ||
| 29 | + | ||
| 30 | +@Service | ||
| 31 | +public class FundOrderingUnitDetailServiceImpl extends BaseMpServiceImpl<FundOrderingUnitDetailMapper, FundOrderingUnitDetail> implements FundOrderingUnitDetailService { | ||
| 32 | + | ||
| 33 | + @Override | ||
| 34 | + public PageResult<FundOrderingUnitDetail> query(Integer pageIndex, Integer pageSize, QueryFundOrderingUnitDetailVo vo) { | ||
| 35 | + | ||
| 36 | + Assert.greaterThanZero(pageIndex); | ||
| 37 | + Assert.greaterThanZero(pageSize); | ||
| 38 | + | ||
| 39 | + PageHelperUtil.startPage(pageIndex, pageSize); | ||
| 40 | + List<FundOrderingUnitDetail> datas = this.query(vo); | ||
| 41 | + | ||
| 42 | + return PageResultUtil.convert(new PageInfo<>(datas)); | ||
| 43 | + } | ||
| 44 | + | ||
| 45 | + @Override | ||
| 46 | + public List<FundOrderingUnitDetail> query(QueryFundOrderingUnitDetailVo vo) { | ||
| 47 | + | ||
| 48 | + return getBaseMapper().query(vo); | ||
| 49 | + } | ||
| 50 | + | ||
| 51 | + @Override | ||
| 52 | + public FundOrderingUnitDetail findById(String id) { | ||
| 53 | + | ||
| 54 | + return getBaseMapper().selectById(id); | ||
| 55 | + } | ||
| 56 | + | ||
| 57 | + @OpLog(type = OtherOpLogType.class, name = "新增资金协调手续订货单位明细表,ID:{}", params = {"#id"}) | ||
| 58 | + @Transactional(rollbackFor = Exception.class) | ||
| 59 | + @Override | ||
| 60 | + public String create(CreateFundOrderingUnitDetailVo vo) { | ||
| 61 | + | ||
| 62 | + FundOrderingUnitDetail data = new FundOrderingUnitDetail(); | ||
| 63 | + data.setId(IdUtil.getId()); | ||
| 64 | + data.setFundOrderingUnitId(vo.getFundOrderingUnitId()); | ||
| 65 | + if (vo.getDeliveryDate() != null) { | ||
| 66 | + data.setDeliveryDate(vo.getDeliveryDate()); | ||
| 67 | + } | ||
| 68 | + if (!StringUtil.isBlank(vo.getAccountsReceivable())) { | ||
| 69 | + data.setAccountsReceivable(vo.getAccountsReceivable()); | ||
| 70 | + } | ||
| 71 | + if (!StringUtil.isBlank(vo.getStatus())) { | ||
| 72 | + data.setStatus(vo.getStatus()); | ||
| 73 | + } | ||
| 74 | + if (vo.getDueDate() != null) { | ||
| 75 | + data.setDueDate(vo.getDueDate()); | ||
| 76 | + } | ||
| 77 | + if (!StringUtil.isBlank(vo.getTimeout())) { | ||
| 78 | + data.setTimeout(vo.getTimeout()); | ||
| 79 | + } | ||
| 80 | + if (vo.getCoordinateHandleDate() != null) { | ||
| 81 | + data.setCoordinateHandleDate(vo.getCoordinateHandleDate()); | ||
| 82 | + } | ||
| 83 | + if (!StringUtil.isBlank(vo.getActualTimeout())) { | ||
| 84 | + data.setActualTimeout(vo.getActualTimeout()); | ||
| 85 | + } | ||
| 86 | + if (!StringUtil.isBlank(vo.getRemark())) { | ||
| 87 | + data.setRemark(vo.getRemark()); | ||
| 88 | + } | ||
| 89 | + | ||
| 90 | + getBaseMapper().insert(data); | ||
| 91 | + | ||
| 92 | + OpLogUtil.setVariable("id", data.getId()); | ||
| 93 | + OpLogUtil.setExtra(vo); | ||
| 94 | + | ||
| 95 | + return data.getId(); | ||
| 96 | + } | ||
| 97 | + | ||
| 98 | + @OpLog(type = OtherOpLogType.class, name = "修改资金协调手续订货单位明细表,ID:{}", params = {"#id"}) | ||
| 99 | + @Transactional(rollbackFor = Exception.class) | ||
| 100 | + @Override | ||
| 101 | + public void update(UpdateFundOrderingUnitDetailVo vo) { | ||
| 102 | + | ||
| 103 | + FundOrderingUnitDetail data = getBaseMapper().selectById(vo.getId()); | ||
| 104 | + if (ObjectUtil.isNull(data)) { | ||
| 105 | + throw new DefaultClientException("资金协调手续订货单位明细表不存在!"); | ||
| 106 | + } | ||
| 107 | + | ||
| 108 | + LambdaUpdateWrapper<FundOrderingUnitDetail> updateWrapper = Wrappers.lambdaUpdate(FundOrderingUnitDetail.class) | ||
| 109 | + .set(FundOrderingUnitDetail::getRemark, StringUtil.isBlank(vo.getRemark()) ? null : vo.getRemark()) | ||
| 110 | + .eq(FundOrderingUnitDetail::getId, vo.getId()); | ||
| 111 | + | ||
| 112 | + getBaseMapper().update(updateWrapper); | ||
| 113 | + | ||
| 114 | + OpLogUtil.setVariable("id", data.getId()); | ||
| 115 | + OpLogUtil.setExtra(vo); | ||
| 116 | + } | ||
| 117 | + | ||
| 118 | + @OpLog(type = OtherOpLogType.class, name = "删除资金协调手续订货单位明细表,ID:{}", params = {"#id"}) | ||
| 119 | + @Transactional(rollbackFor = Exception.class) | ||
| 120 | + @Override | ||
| 121 | + public void deleteById(String id) { | ||
| 122 | + | ||
| 123 | + getBaseMapper().deleteById(id); | ||
| 124 | + } | ||
| 125 | + | ||
| 126 | + @Override | ||
| 127 | + public void cleanCacheByKey(Serializable key) { | ||
| 128 | + | ||
| 129 | + } | ||
| 130 | +} |
xingyun-sc/src/main/java/com/lframework/xingyun/sc/mappers/FundOrderingUnitDetailMapper.java
0 → 100644
| 1 | +package com.lframework.xingyun.sc.mappers; | ||
| 2 | + | ||
| 3 | +import com.lframework.starter.web.core.mapper.BaseMapper; | ||
| 4 | +import com.lframework.xingyun.sc.entity.FundOrderingUnitDetail; | ||
| 5 | +import com.lframework.xingyun.sc.vo.ledger.detail.QueryFundOrderingUnitDetailVo; | ||
| 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 FundOrderingUnitDetailMapper extends BaseMapper<FundOrderingUnitDetail> { | ||
| 17 | + | ||
| 18 | + /** | ||
| 19 | + * 查询列表 | ||
| 20 | + * @param vo | ||
| 21 | + * @return | ||
| 22 | + */ | ||
| 23 | + List<FundOrderingUnitDetail> query(@Param("vo") QueryFundOrderingUnitDetailVo vo); | ||
| 24 | +} |
xingyun-sc/src/main/java/com/lframework/xingyun/sc/service/ledger/FundOrderingUnitDetailService.java
0 → 100644
| 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.FundOrderingUnitDetail; | ||
| 6 | +import com.lframework.xingyun.sc.vo.ledger.detail.CreateFundOrderingUnitDetailVo; | ||
| 7 | +import com.lframework.xingyun.sc.vo.ledger.detail.QueryFundOrderingUnitDetailVo; | ||
| 8 | +import com.lframework.xingyun.sc.vo.ledger.detail.UpdateFundOrderingUnitDetailVo; | ||
| 9 | +import java.util.List; | ||
| 10 | + | ||
| 11 | +/** | ||
| 12 | + * 资金协调手续订货单位明细表 Service | ||
| 13 | + */ | ||
| 14 | +public interface FundOrderingUnitDetailService extends BaseMpService<FundOrderingUnitDetail> { | ||
| 15 | + | ||
| 16 | + /** | ||
| 17 | + * 查询列表 | ||
| 18 | + * @return | ||
| 19 | + */ | ||
| 20 | + PageResult<FundOrderingUnitDetail> query(Integer pageIndex, Integer pageSize, QueryFundOrderingUnitDetailVo vo); | ||
| 21 | + | ||
| 22 | + /** | ||
| 23 | + * 查询列表 | ||
| 24 | + * @param vo | ||
| 25 | + * @return | ||
| 26 | + */ | ||
| 27 | + List<FundOrderingUnitDetail> query(QueryFundOrderingUnitDetailVo vo); | ||
| 28 | + | ||
| 29 | + /** | ||
| 30 | + * 根据ID查询 | ||
| 31 | + * @param id | ||
| 32 | + * @return | ||
| 33 | + */ | ||
| 34 | + FundOrderingUnitDetail findById(String id); | ||
| 35 | + | ||
| 36 | + /** | ||
| 37 | + * 创建 | ||
| 38 | + * @param vo | ||
| 39 | + * @return | ||
| 40 | + */ | ||
| 41 | + String create(CreateFundOrderingUnitDetailVo vo); | ||
| 42 | + | ||
| 43 | + /** | ||
| 44 | + * 修改 | ||
| 45 | + * @param vo | ||
| 46 | + */ | ||
| 47 | + void update(UpdateFundOrderingUnitDetailVo 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.detail; | ||
| 2 | + | ||
| 3 | +import javax.validation.constraints.NotBlank; | ||
| 4 | +import java.time.LocalDate; | ||
| 5 | +import com.lframework.starter.web.core.vo.BaseVo; | ||
| 6 | +import io.swagger.annotations.ApiModelProperty; | ||
| 7 | +import com.lframework.starter.web.core.components.validation.TypeMismatch; | ||
| 8 | +import org.hibernate.validator.constraints.Length; | ||
| 9 | +import java.io.Serializable; | ||
| 10 | +import lombok.Data; | ||
| 11 | + | ||
| 12 | +@Data | ||
| 13 | +public class CreateFundOrderingUnitDetailVo implements BaseVo, Serializable { | ||
| 14 | + | ||
| 15 | + private static final long serialVersionUID = 1L; | ||
| 16 | + | ||
| 17 | + /** | ||
| 18 | + * 资金协调手续订货单位关联表ID | ||
| 19 | + */ | ||
| 20 | + @ApiModelProperty(value = "资金协调手续订货单位关联表ID", required = true) | ||
| 21 | + @NotBlank(message = "请输入资金协调手续订货单位关联表ID!") | ||
| 22 | + @Length(message = "资金协调手续订货单位关联表ID最多允许32个字符!") | ||
| 23 | + private String fundOrderingUnitId; | ||
| 24 | + | ||
| 25 | + /** | ||
| 26 | + * 发货日期 | ||
| 27 | + */ | ||
| 28 | + @ApiModelProperty("发货日期") | ||
| 29 | + @TypeMismatch(message = "发货日期格式有误!") | ||
| 30 | + private LocalDate deliveryDate; | ||
| 31 | + | ||
| 32 | + /** | ||
| 33 | + * 应收款(元) | ||
| 34 | + */ | ||
| 35 | + @ApiModelProperty("应收款(元)") | ||
| 36 | + @Length(message = "应收款(元)最多允许50个字符!") | ||
| 37 | + private String accountsReceivable; | ||
| 38 | + | ||
| 39 | + /** | ||
| 40 | + * 当前欠款状态 | ||
| 41 | + */ | ||
| 42 | + @ApiModelProperty("当前欠款状态") | ||
| 43 | + @Length(message = "当前欠款状态最多允许20个字符!") | ||
| 44 | + private String status; | ||
| 45 | + | ||
| 46 | + /** | ||
| 47 | + * 应办理日期 | ||
| 48 | + */ | ||
| 49 | + @ApiModelProperty("应办理日期") | ||
| 50 | + @TypeMismatch(message = "应办理日期格式有误!") | ||
| 51 | + private LocalDate dueDate; | ||
| 52 | + | ||
| 53 | + /** | ||
| 54 | + * 已超时(天) | ||
| 55 | + */ | ||
| 56 | + @ApiModelProperty("已超时(天)") | ||
| 57 | + @Length(message = "已超时(天)最多允许20个字符!") | ||
| 58 | + private String timeout; | ||
| 59 | + | ||
| 60 | + /** | ||
| 61 | + * 协调办理日期 | ||
| 62 | + */ | ||
| 63 | + @ApiModelProperty("协调办理日期") | ||
| 64 | + @TypeMismatch(message = "协调办理日期格式有误!") | ||
| 65 | + private LocalDate coordinateHandleDate; | ||
| 66 | + | ||
| 67 | + /** | ||
| 68 | + * 实际超时(天) | ||
| 69 | + */ | ||
| 70 | + @ApiModelProperty("实际超时(天)") | ||
| 71 | + @Length(message = "实际超时(天)最多允许20个字符!") | ||
| 72 | + private String actualTimeout; | ||
| 73 | + | ||
| 74 | + /** | ||
| 75 | + * 备注 | ||
| 76 | + */ | ||
| 77 | + @ApiModelProperty("备注") | ||
| 78 | + @Length(message = "备注最多允许20个字符!") | ||
| 79 | + private String remark; | ||
| 80 | + | ||
| 81 | +} |
| 1 | +package com.lframework.xingyun.sc.vo.ledger.detail; | ||
| 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 QueryFundOrderingUnitDetailVo extends PageVo implements BaseVo, Serializable { | ||
| 11 | + | ||
| 12 | + private static final long serialVersionUID = 1L; | ||
| 13 | + | ||
| 14 | + /** | ||
| 15 | + * 资金协调手续订货单位关联表ID | ||
| 16 | + */ | ||
| 17 | + @ApiModelProperty("资金协调手续订货单位关联表ID") | ||
| 18 | + private String fundOrderingUnitId; | ||
| 19 | + | ||
| 20 | +} |
| 1 | +package com.lframework.xingyun.sc.vo.ledger.detail; | ||
| 2 | + | ||
| 3 | +import lombok.Data; | ||
| 4 | +import javax.validation.constraints.NotBlank; | ||
| 5 | +import com.lframework.starter.web.core.vo.BaseVo; | ||
| 6 | +import io.swagger.annotations.ApiModelProperty; | ||
| 7 | +import org.hibernate.validator.constraints.Length; | ||
| 8 | +import java.io.Serializable; | ||
| 9 | + | ||
| 10 | +@Data | ||
| 11 | +public class UpdateFundOrderingUnitDetailVo implements BaseVo, Serializable { | ||
| 12 | + | ||
| 13 | + private static final long serialVersionUID = 1L; | ||
| 14 | + | ||
| 15 | + /** | ||
| 16 | + * ID | ||
| 17 | + */ | ||
| 18 | + @ApiModelProperty(value = "ID", required = true) | ||
| 19 | + @NotBlank(message = "id不能为空!") | ||
| 20 | + private String id; | ||
| 21 | + | ||
| 22 | + /** | ||
| 23 | + * 备注 | ||
| 24 | + */ | ||
| 25 | + @ApiModelProperty("备注") | ||
| 26 | + @Length(message = "备注最多允许20个字符!") | ||
| 27 | + private String remark; | ||
| 28 | + | ||
| 29 | +} |
| 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.FundOrderingUnitDetailMapper"> | ||
| 4 | + | ||
| 5 | + <resultMap id="FundOrderingUnitDetail" type="com.lframework.xingyun.sc.entity.FundOrderingUnitDetail"> | ||
| 6 | + <id column="id" property="id"/> | ||
| 7 | + <result column="fund_ordering_unit_id" property="fundOrderingUnitId"/> | ||
| 8 | + <result column="delivery_date" property="deliveryDate"/> | ||
| 9 | + <result column="accounts_receivable" property="accountsReceivable"/> | ||
| 10 | + <result column="status" property="status"/> | ||
| 11 | + <result column="due_date" property="dueDate"/> | ||
| 12 | + <result column="timeout" property="timeout"/> | ||
| 13 | + <result column="coordinate_handle_date" property="coordinateHandleDate"/> | ||
| 14 | + <result column="actual_timeout" property="actualTimeout"/> | ||
| 15 | + <result column="remark" property="remark"/> | ||
| 16 | + <result column="create_by_id" property="createById"/> | ||
| 17 | + <result column="create_by" property="createBy"/> | ||
| 18 | + <result column="update_by_id" property="updateById"/> | ||
| 19 | + <result column="update_by" property="updateBy"/> | ||
| 20 | + <result column="create_time" property="createTime"/> | ||
| 21 | + <result column="update_time" property="updateTime"/> | ||
| 22 | + </resultMap> | ||
| 23 | + | ||
| 24 | + <sql id="FundOrderingUnitDetail_sql"> | ||
| 25 | + SELECT | ||
| 26 | + tb.id, | ||
| 27 | + tb.fund_ordering_unit_id, | ||
| 28 | + tb.delivery_date, | ||
| 29 | + tb.accounts_receivable, | ||
| 30 | + tb.status, | ||
| 31 | + tb.due_date, | ||
| 32 | + tb.timeout, | ||
| 33 | + tb.coordinate_handle_date, | ||
| 34 | + tb.actual_timeout, | ||
| 35 | + tb.remark, | ||
| 36 | + tb.create_by_id, | ||
| 37 | + tb.create_by, | ||
| 38 | + tb.update_by_id, | ||
| 39 | + tb.update_by, | ||
| 40 | + tb.create_time, | ||
| 41 | + tb.update_time | ||
| 42 | + FROM fund_ordering_unit_detail AS tb | ||
| 43 | + </sql> | ||
| 44 | + | ||
| 45 | + <select id="query" resultMap="FundOrderingUnitDetail"> | ||
| 46 | + <include refid="FundOrderingUnitDetail_sql"/> | ||
| 47 | + <where> | ||
| 48 | + <if test="vo.fundOrderingUnitId != null and vo.fundOrderingUnitId != ''"> | ||
| 49 | + AND tb.fund_ordering_unit_id = #{vo.fundOrderingUnitId} | ||
| 50 | + </if> | ||
| 51 | + </where> | ||
| 52 | + ORDER BY tb.actual_timeout DESC | ||
| 53 | + </select> | ||
| 54 | +</mapper> |