Showing
12 changed files
with
907 additions
and
1 deletions
| ... | ... | @@ -316,6 +316,7 @@ CREATE TABLE IF NOT EXISTS `purchase_order_info` |
| 316 | 316 | `contract_id` varchar(50) DEFAULT NULL COMMENT '合同ID', |
| 317 | 317 | `execution_standard_remarks` varchar(500) DEFAULT NULL COMMENT '执行标准备注', |
| 318 | 318 | `replenishment_order_id` varchar(32) DEFAULT NULL COMMENT '补货单ID', |
| 319 | + `freeze` bool DEFAULT false COMMENT '是否冻结', | |
| 319 | 320 | PRIMARY KEY (`id`), |
| 320 | 321 | KEY `idx_ordering_unit` (`ordering_unit`), |
| 321 | 322 | KEY `idx_order_no` (`order_no`), |
| ... | ... | @@ -1001,7 +1002,7 @@ CREATE TABLE `fund_coordination` ( |
| 1001 | 1002 | `dept_and_role` varchar(100) DEFAULT NULL COMMENT '资金清收责任人部门和角色', |
| 1002 | 1003 | `application_date` date DEFAULT NULL COMMENT '申请日期', |
| 1003 | 1004 | `ordering_unit_name` text DEFAULT NULL COMMENT '订货单位', |
| 1004 | - `customer_short_id` varchar(32) DEFAULT NULL COMMENT '客户简称ID', | |
| 1005 | + `customer_short_name` varchar(100) DEFAULT NULL COMMENT '客户简称', | |
| 1005 | 1006 | `customer_type` varchar(50) DEFAULT NULL COMMENT '客户类型', |
| 1006 | 1007 | `unlimited_guarantee_letter` varchar(500) DEFAULT NULL COMMENT '无限担保书', |
| 1007 | 1008 | `settlement_period` varchar(100) DEFAULT NULL COMMENT '结算期限', |
| ... | ... | @@ -1012,6 +1013,8 @@ CREATE TABLE `fund_coordination` ( |
| 1012 | 1013 | `overdue_receivables` varchar(100) DEFAULT NULL COMMENT '超期应收款', |
| 1013 | 1014 | `agreed_internal_receivables` varchar(100) DEFAULT NULL COMMENT '约定内应收款', |
| 1014 | 1015 | `requirement_specification` text DEFAULT NULL COMMENT '协调事由需求说明', |
| 1016 | + `requested_shipment_quantity` varchar(100) DEFAULT NULL COMMENT '申请发货量(吨)', | |
| 1017 | + `type` varchar(20) DEFAULT NULL COMMENT '贸易类型:外贸: OUTSIDE 内贸:INSIDE', | |
| 1015 | 1018 | `office_clerk` varchar(32) DEFAULT NULL COMMENT '办事处内勤ID', |
| 1016 | 1019 | `office_clerk_opinion` text DEFAULT NULL COMMENT '办事处内勤审核意见', |
| 1017 | 1020 | `office_supervisor` varchar(32) DEFAULT NULL COMMENT '办事处主管ID', |
| ... | ... | @@ -1073,3 +1076,19 @@ CREATE TABLE `fund_ordering_unit_detail`( |
| 1073 | 1076 | `update_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间', |
| 1074 | 1077 | PRIMARY KEY (`id`) |
| 1075 | 1078 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='资金协调手续订货单位应收款明细' |
| 1079 | + | |
| 1080 | +CREATE TABLE `pending_delivery_order` ( | |
| 1081 | + `id` varchar(32) NOT NULL COMMENT 'ID', | |
| 1082 | + `fund_id` varchar(32) DEFAULT NULL COMMENT '资金协调手续主键', | |
| 1083 | + `purchase_order_id` varchar(32) DEFAULT NULL COMMENT '订货单ID', | |
| 1084 | + `total_quantity` varchar(50) DEFAULT NULL COMMENT '总数量(吨)', | |
| 1085 | + `dispatched_quantity` varchar(50) DEFAULT NULL COMMENT '已发货数量(吨)', | |
| 1086 | + `requested_shipment_quantity` varchar(50) DEFAULT NULL COMMENT '申请发货数量(吨)', | |
| 1087 | + `create_by_id` varchar(32) NOT NULL COMMENT '创建人ID', | |
| 1088 | + `create_by` varchar(20) NOT NULL COMMENT '创建人', | |
| 1089 | + `update_by_id` varchar(32) NOT NULL COMMENT '更新人ID', | |
| 1090 | + `update_by` varchar(20) NOT NULL COMMENT '更新人', | |
| 1091 | + `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', | |
| 1092 | + `update_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间', | |
| 1093 | + PRIMARY KEY (`id`) | |
| 1094 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='待交付订单' | ... | ... |
xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/ledger/pending/GetPendingDeliveryOrderBo.java
0 → 100644
| 1 | +package com.lframework.xingyun.sc.bo.ledger.pending; | |
| 2 | + | |
| 3 | +import com.baomidou.mybatisplus.annotation.TableField; | |
| 4 | +import com.lframework.starter.web.core.bo.BaseBo; | |
| 5 | +import com.lframework.xingyun.sc.entity.PendingDeliveryOrder; | |
| 6 | +import io.swagger.annotations.ApiModelProperty; | |
| 7 | + | |
| 8 | +import lombok.Data; | |
| 9 | + | |
| 10 | +/** | |
| 11 | + * <p> | |
| 12 | + * 待交付订单 GetBo | |
| 13 | + * </p> | |
| 14 | + * | |
| 15 | + */ | |
| 16 | +@Data | |
| 17 | +public class GetPendingDeliveryOrderBo extends BaseBo<PendingDeliveryOrder> { | |
| 18 | + | |
| 19 | + /** | |
| 20 | + * ID | |
| 21 | + */ | |
| 22 | + @ApiModelProperty("ID") | |
| 23 | + private String id; | |
| 24 | + | |
| 25 | + /** | |
| 26 | + * 资金协调手续主键 | |
| 27 | + */ | |
| 28 | + @ApiModelProperty("资金协调手续主键") | |
| 29 | + private String fundId; | |
| 30 | + | |
| 31 | + /** | |
| 32 | + * 订货单ID | |
| 33 | + */ | |
| 34 | + @ApiModelProperty("订货单ID") | |
| 35 | + private String purchaseOrderId; | |
| 36 | + | |
| 37 | + /** | |
| 38 | + * 订单编号 | |
| 39 | + */ | |
| 40 | + @ApiModelProperty("订单编号") | |
| 41 | + private String orderNo; | |
| 42 | + | |
| 43 | + /** | |
| 44 | + * 订货单位名称 | |
| 45 | + */ | |
| 46 | + @ApiModelProperty("订货单位名称") | |
| 47 | + private String orderingUnitName; | |
| 48 | + | |
| 49 | + /** | |
| 50 | + * 生产厂名称 | |
| 51 | + */ | |
| 52 | + @ApiModelProperty("生产厂名称") | |
| 53 | + private String workshopName; | |
| 54 | + | |
| 55 | + /** | |
| 56 | + * 办事处名称 | |
| 57 | + */ | |
| 58 | + @ApiModelProperty("办事处名称") | |
| 59 | + private String deptName; | |
| 60 | + | |
| 61 | + /** | |
| 62 | + * 总数量(吨) | |
| 63 | + */ | |
| 64 | + @ApiModelProperty("总数量(吨)") | |
| 65 | + private String totalQuantity; | |
| 66 | + | |
| 67 | + /** | |
| 68 | + * 已发货数量(吨) | |
| 69 | + */ | |
| 70 | + @ApiModelProperty("已发货数量(吨)") | |
| 71 | + private String dispatchedQuantity; | |
| 72 | + | |
| 73 | + /** | |
| 74 | + * 申请发货数量(吨) | |
| 75 | + */ | |
| 76 | + @ApiModelProperty("申请发货数量(吨)") | |
| 77 | + private String requestedShipmentQuantity; | |
| 78 | + | |
| 79 | + public GetPendingDeliveryOrderBo() { | |
| 80 | + | |
| 81 | + } | |
| 82 | + | |
| 83 | + public GetPendingDeliveryOrderBo(PendingDeliveryOrder dto) { | |
| 84 | + | |
| 85 | + super(dto); | |
| 86 | + } | |
| 87 | + | |
| 88 | + @Override | |
| 89 | + public BaseBo<PendingDeliveryOrder> convert(PendingDeliveryOrder dto) { | |
| 90 | + return super.convert(dto); | |
| 91 | + } | |
| 92 | + | |
| 93 | + @Override | |
| 94 | + protected void afterInit(PendingDeliveryOrder dto) { | |
| 95 | + | |
| 96 | + } | |
| 97 | +} | ... | ... |
| 1 | +package com.lframework.xingyun.sc.bo.ledger.pending; | |
| 2 | + | |
| 3 | +import com.lframework.starter.web.core.bo.BaseBo; | |
| 4 | +import com.lframework.xingyun.sc.entity.PendingDeliveryOrder; | |
| 5 | +import io.swagger.annotations.ApiModelProperty; | |
| 6 | + | |
| 7 | +import lombok.Data; | |
| 8 | + | |
| 9 | +/** | |
| 10 | + * <p> | |
| 11 | + * 待交付订单 QueryBo | |
| 12 | + * </p> | |
| 13 | + * | |
| 14 | + */ | |
| 15 | +@Data | |
| 16 | +public class QueryPendingDeliveryOrderBo extends BaseBo<PendingDeliveryOrder> { | |
| 17 | + | |
| 18 | + /** | |
| 19 | + * ID | |
| 20 | + */ | |
| 21 | + @ApiModelProperty("ID") | |
| 22 | + private String id; | |
| 23 | + | |
| 24 | + /** | |
| 25 | + * 资金协调手续主键 | |
| 26 | + */ | |
| 27 | + @ApiModelProperty("资金协调手续主键") | |
| 28 | + private String fundId; | |
| 29 | + | |
| 30 | + /** | |
| 31 | + * 订货单ID | |
| 32 | + */ | |
| 33 | + @ApiModelProperty("订货单ID") | |
| 34 | + private String purchaseOrderId; | |
| 35 | + | |
| 36 | + /** | |
| 37 | + * 订单编号 | |
| 38 | + */ | |
| 39 | + @ApiModelProperty("订单编号") | |
| 40 | + private String orderNo; | |
| 41 | + | |
| 42 | + /** | |
| 43 | + * 订货单位名称 | |
| 44 | + */ | |
| 45 | + @ApiModelProperty("订货单位名称") | |
| 46 | + private String orderingUnitName; | |
| 47 | + | |
| 48 | + /** | |
| 49 | + * 生产厂名称 | |
| 50 | + */ | |
| 51 | + @ApiModelProperty("生产厂名称") | |
| 52 | + private String workshopName; | |
| 53 | + | |
| 54 | + /** | |
| 55 | + * 办事处名称 | |
| 56 | + */ | |
| 57 | + @ApiModelProperty("办事处名称") | |
| 58 | + private String deptName; | |
| 59 | + | |
| 60 | + /** | |
| 61 | + * 总数量(吨) | |
| 62 | + */ | |
| 63 | + @ApiModelProperty("总数量(吨)") | |
| 64 | + private String totalQuantity; | |
| 65 | + | |
| 66 | + /** | |
| 67 | + * 已发货数量(吨) | |
| 68 | + */ | |
| 69 | + @ApiModelProperty("已发货数量(吨)") | |
| 70 | + private String dispatchedQuantity; | |
| 71 | + | |
| 72 | + /** | |
| 73 | + * 申请发货数量(吨) | |
| 74 | + */ | |
| 75 | + @ApiModelProperty("申请发货数量(吨)") | |
| 76 | + private String requestedShipmentQuantity; | |
| 77 | + | |
| 78 | + public QueryPendingDeliveryOrderBo() { | |
| 79 | + | |
| 80 | + } | |
| 81 | + | |
| 82 | + public QueryPendingDeliveryOrderBo(PendingDeliveryOrder dto) { | |
| 83 | + | |
| 84 | + super(dto); | |
| 85 | + } | |
| 86 | + | |
| 87 | + @Override | |
| 88 | + public BaseBo<PendingDeliveryOrder> convert(PendingDeliveryOrder dto) { | |
| 89 | + return super.convert(dto); | |
| 90 | + } | |
| 91 | + | |
| 92 | + @Override | |
| 93 | + protected void afterInit(PendingDeliveryOrder dto) { | |
| 94 | + | |
| 95 | + } | |
| 96 | +} | ... | ... |
| 1 | +package com.lframework.xingyun.sc.controller.ledger; | |
| 2 | + | |
| 3 | +import com.lframework.starter.web.core.controller.DefaultBaseController; | |
| 4 | +import com.lframework.starter.web.core.utils.PageResultUtil; | |
| 5 | +import com.lframework.starter.web.core.components.resp.PageResult; | |
| 6 | +import com.lframework.starter.web.core.components.resp.InvokeResult; | |
| 7 | +import javax.validation.constraints.NotBlank; | |
| 8 | +import com.lframework.xingyun.sc.bo.ledger.pending.GetPendingDeliveryOrderBo; | |
| 9 | +import com.lframework.xingyun.sc.bo.ledger.pending.QueryPendingDeliveryOrderBo; | |
| 10 | +import com.lframework.xingyun.sc.entity.PendingDeliveryOrder; | |
| 11 | +import com.lframework.xingyun.sc.service.ledger.PendingDeliveryOrderService; | |
| 12 | +import com.lframework.xingyun.sc.vo.ledger.pending.CreatePendingDeliveryOrderVo; | |
| 13 | +import com.lframework.xingyun.sc.vo.ledger.pending.QueryPendingDeliveryOrderVo; | |
| 14 | +import com.lframework.xingyun.sc.vo.ledger.pending.UpdatePendingDeliveryOrderVo; | |
| 15 | +import io.swagger.annotations.ApiImplicitParam; | |
| 16 | +import com.lframework.starter.web.core.components.resp.InvokeResultBuilder; | |
| 17 | +import com.lframework.starter.common.exceptions.impl.DefaultClientException; | |
| 18 | +import io.swagger.annotations.ApiOperation; | |
| 19 | +import com.lframework.starter.common.utils.CollectionUtil; | |
| 20 | +import io.swagger.annotations.Api; | |
| 21 | +import org.springframework.web.bind.annotation.DeleteMapping; | |
| 22 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 23 | +import org.springframework.validation.annotation.Validated; | |
| 24 | +import org.springframework.web.bind.annotation.*; | |
| 25 | +import javax.validation.Valid; | |
| 26 | +import java.util.List; | |
| 27 | +import java.util.stream.Collectors; | |
| 28 | + | |
| 29 | +/** | |
| 30 | + * 待交付订单 Controller | |
| 31 | + * | |
| 32 | + */ | |
| 33 | +@Api(tags = "待交付订单") | |
| 34 | +@Validated | |
| 35 | +@RestController | |
| 36 | +@RequestMapping("/pendingDeliveryOrder") | |
| 37 | +public class PendingDeliveryOrderController extends DefaultBaseController { | |
| 38 | + | |
| 39 | + @Autowired | |
| 40 | + private PendingDeliveryOrderService pendingDeliveryOrderService; | |
| 41 | + | |
| 42 | + /** | |
| 43 | + * 查询列表 | |
| 44 | + */ | |
| 45 | + @ApiOperation("查询列表") | |
| 46 | + @GetMapping("/query") | |
| 47 | + public InvokeResult<PageResult<QueryPendingDeliveryOrderBo>> query(@Valid QueryPendingDeliveryOrderVo vo) { | |
| 48 | + | |
| 49 | + PageResult<PendingDeliveryOrder> pageResult = pendingDeliveryOrderService.query(getPageIndex(vo), getPageSize(vo), vo); | |
| 50 | + | |
| 51 | + List<PendingDeliveryOrder> datas = pageResult.getDatas(); | |
| 52 | + List<QueryPendingDeliveryOrderBo> results = null; | |
| 53 | + | |
| 54 | + if (!CollectionUtil.isEmpty(datas)) { | |
| 55 | + results = datas.stream().map(QueryPendingDeliveryOrderBo::new).collect(Collectors.toList()); | |
| 56 | + } | |
| 57 | + | |
| 58 | + return InvokeResultBuilder.success(PageResultUtil.rebuild(pageResult, results)); | |
| 59 | + } | |
| 60 | + | |
| 61 | + /** | |
| 62 | + * 根据ID查询 | |
| 63 | + */ | |
| 64 | + @ApiOperation("根据ID查询") | |
| 65 | + @ApiImplicitParam(value = "id", name = "id", paramType = "query", required = true) | |
| 66 | + @GetMapping | |
| 67 | + public InvokeResult<GetPendingDeliveryOrderBo> get(@NotBlank(message = "id不能为空!") String id) { | |
| 68 | + | |
| 69 | + PendingDeliveryOrder data = pendingDeliveryOrderService.findById(id); | |
| 70 | + if (data == null) { | |
| 71 | + throw new DefaultClientException("待交付订单不存在!"); | |
| 72 | + } | |
| 73 | + | |
| 74 | + GetPendingDeliveryOrderBo result = new GetPendingDeliveryOrderBo(data); | |
| 75 | + | |
| 76 | + return InvokeResultBuilder.success(result); | |
| 77 | + } | |
| 78 | + | |
| 79 | + /** | |
| 80 | + * 新增 | |
| 81 | + */ | |
| 82 | + @ApiOperation("新增") | |
| 83 | + @PostMapping | |
| 84 | + public InvokeResult<Void> create(@Valid CreatePendingDeliveryOrderVo vo) { | |
| 85 | + | |
| 86 | + pendingDeliveryOrderService.create(vo); | |
| 87 | + | |
| 88 | + return InvokeResultBuilder.success(); | |
| 89 | + } | |
| 90 | + | |
| 91 | + /** | |
| 92 | + * 修改 | |
| 93 | + */ | |
| 94 | + @ApiOperation("修改") | |
| 95 | + @PutMapping | |
| 96 | + public InvokeResult<Void> update(@Valid UpdatePendingDeliveryOrderVo vo) { | |
| 97 | + | |
| 98 | + pendingDeliveryOrderService.update(vo); | |
| 99 | + | |
| 100 | + return InvokeResultBuilder.success(); | |
| 101 | + } | |
| 102 | + | |
| 103 | + /** | |
| 104 | + * 根据ID删除 | |
| 105 | + */ | |
| 106 | + @ApiOperation("根据ID删除") | |
| 107 | + @ApiImplicitParam(value = "id", name = "id", paramType = "query", required = true) | |
| 108 | + @DeleteMapping | |
| 109 | + public InvokeResult<Void> deleteById(@NotBlank(message = "id不能为空!") String id) { | |
| 110 | + | |
| 111 | + pendingDeliveryOrderService.deleteById(id); | |
| 112 | + | |
| 113 | + return InvokeResultBuilder.success(); | |
| 114 | + } | |
| 115 | +} | ... | ... |
| 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.LocalDateTime; | |
| 6 | +import com.baomidou.mybatisplus.annotation.FieldFill; | |
| 7 | +import com.lframework.starter.web.core.entity.BaseEntity; | |
| 8 | +import com.baomidou.mybatisplus.annotation.TableField; | |
| 9 | +import io.swagger.annotations.ApiModelProperty; | |
| 10 | +import lombok.Data; | |
| 11 | + | |
| 12 | +/** | |
| 13 | + * <p> | |
| 14 | + * 待交付订单 | |
| 15 | + * </p> | |
| 16 | + * | |
| 17 | + */ | |
| 18 | +@Data | |
| 19 | +@TableName("pending_delivery_order") | |
| 20 | +public class PendingDeliveryOrder extends BaseEntity implements BaseDto { | |
| 21 | + | |
| 22 | + private static final long serialVersionUID = 1L; | |
| 23 | + | |
| 24 | + public static final String CACHE_NAME = "PendingDeliveryOrder"; | |
| 25 | + | |
| 26 | + /** | |
| 27 | + * ID | |
| 28 | + */ | |
| 29 | + private String id; | |
| 30 | + | |
| 31 | + /** | |
| 32 | + * 资金协调手续主键 | |
| 33 | + */ | |
| 34 | + private String fundId; | |
| 35 | + | |
| 36 | + /** | |
| 37 | + * 订货单ID | |
| 38 | + */ | |
| 39 | + private String purchaseOrderId; | |
| 40 | + | |
| 41 | + /** | |
| 42 | + * 订单编号 | |
| 43 | + */ | |
| 44 | + @TableField(exist = false) | |
| 45 | + private String orderNo; | |
| 46 | + | |
| 47 | + /** | |
| 48 | + * 订货单位名称 | |
| 49 | + */ | |
| 50 | + @TableField(exist = false) | |
| 51 | + private String orderingUnitName; | |
| 52 | + | |
| 53 | + /** | |
| 54 | + * 生产厂名称 | |
| 55 | + */ | |
| 56 | + @TableField(exist = false) | |
| 57 | + private String workshopName; | |
| 58 | + | |
| 59 | + /** | |
| 60 | + * 办事处名称 | |
| 61 | + */ | |
| 62 | + @TableField(exist = false) | |
| 63 | + private String deptName; | |
| 64 | + | |
| 65 | + /** | |
| 66 | + * 总数量(吨) | |
| 67 | + */ | |
| 68 | + private String totalQuantity; | |
| 69 | + | |
| 70 | + /** | |
| 71 | + * 已发货数量(吨) | |
| 72 | + */ | |
| 73 | + private String dispatchedQuantity; | |
| 74 | + | |
| 75 | + /** | |
| 76 | + * 申请发货数量(吨) | |
| 77 | + */ | |
| 78 | + private String requestedShipmentQuantity; | |
| 79 | + | |
| 80 | + /** | |
| 81 | + * 创建人ID | |
| 82 | + */ | |
| 83 | + @TableField(fill = FieldFill.INSERT) | |
| 84 | + private String createById; | |
| 85 | + | |
| 86 | + /** | |
| 87 | + * 创建人 | |
| 88 | + */ | |
| 89 | + @TableField(fill = FieldFill.INSERT) | |
| 90 | + private String createBy; | |
| 91 | + | |
| 92 | + /** | |
| 93 | + * 更新人ID | |
| 94 | + */ | |
| 95 | + @TableField(fill = FieldFill.INSERT_UPDATE) | |
| 96 | + private String updateById; | |
| 97 | + | |
| 98 | + /** | |
| 99 | + * 更新人 | |
| 100 | + */ | |
| 101 | + @TableField(fill = FieldFill.INSERT_UPDATE) | |
| 102 | + private String updateBy; | |
| 103 | + | |
| 104 | + /** | |
| 105 | + * 创建时间 | |
| 106 | + */ | |
| 107 | + @TableField(fill = FieldFill.INSERT) | |
| 108 | + private LocalDateTime createTime; | |
| 109 | + | |
| 110 | + /** | |
| 111 | + * 更新时间 | |
| 112 | + */ | |
| 113 | + @TableField(fill = FieldFill.INSERT_UPDATE) | |
| 114 | + private LocalDateTime updateTime; | |
| 115 | + | |
| 116 | +} | ... | ... |
xingyun-sc/src/main/java/com/lframework/xingyun/sc/impl/ledger/PendingDeliveryOrderServiceImpl.java
0 → 100644
| 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.components.security.SecurityUtil; | |
| 7 | +import com.lframework.starter.web.core.impl.BaseMpServiceImpl; | |
| 8 | +import com.lframework.starter.web.core.utils.PageResultUtil; | |
| 9 | +import com.lframework.starter.web.core.components.resp.PageResult; | |
| 10 | +import com.lframework.starter.web.core.utils.OpLogUtil; | |
| 11 | +import com.lframework.starter.common.utils.StringUtil; | |
| 12 | +import com.lframework.starter.common.exceptions.impl.DefaultClientException; | |
| 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.PendingDeliveryOrder; | |
| 20 | +import com.lframework.xingyun.sc.mappers.PendingDeliveryOrderMapper; | |
| 21 | +import com.lframework.xingyun.sc.service.ledger.PendingDeliveryOrderService; | |
| 22 | +import com.lframework.xingyun.sc.vo.ledger.pending.CreatePendingDeliveryOrderVo; | |
| 23 | +import com.lframework.xingyun.sc.vo.ledger.pending.QueryPendingDeliveryOrderVo; | |
| 24 | +import com.lframework.xingyun.sc.vo.ledger.pending.UpdatePendingDeliveryOrderVo; | |
| 25 | +import org.apache.commons.collections4.CollectionUtils; | |
| 26 | +import org.springframework.transaction.annotation.Transactional; | |
| 27 | +import org.springframework.stereotype.Service; | |
| 28 | + | |
| 29 | +import java.io.Serializable; | |
| 30 | +import java.time.LocalDateTime; | |
| 31 | +import java.util.ArrayList; | |
| 32 | +import java.util.List; | |
| 33 | + | |
| 34 | +@Service | |
| 35 | +public class PendingDeliveryOrderServiceImpl extends BaseMpServiceImpl<PendingDeliveryOrderMapper, PendingDeliveryOrder> implements PendingDeliveryOrderService { | |
| 36 | + | |
| 37 | + @Override | |
| 38 | + public PageResult<PendingDeliveryOrder> query(Integer pageIndex, Integer pageSize, QueryPendingDeliveryOrderVo vo) { | |
| 39 | + | |
| 40 | + Assert.greaterThanZero(pageIndex); | |
| 41 | + Assert.greaterThanZero(pageSize); | |
| 42 | + | |
| 43 | + PageHelperUtil.startPage(pageIndex, pageSize); | |
| 44 | + List<PendingDeliveryOrder> datas = this.query(vo); | |
| 45 | + | |
| 46 | + return PageResultUtil.convert(new PageInfo<>(datas)); | |
| 47 | + } | |
| 48 | + | |
| 49 | + @Override | |
| 50 | + public List<PendingDeliveryOrder> query(QueryPendingDeliveryOrderVo vo) { | |
| 51 | + | |
| 52 | + return getBaseMapper().query(vo); | |
| 53 | + } | |
| 54 | + | |
| 55 | + @Override | |
| 56 | + public PendingDeliveryOrder findById(String id) { | |
| 57 | + | |
| 58 | + return getBaseMapper().selectById(id); | |
| 59 | + } | |
| 60 | + | |
| 61 | + @OpLog(type = OtherOpLogType.class, name = "新增待交付订单,ID:{}", params = {"#id"}) | |
| 62 | + @Transactional(rollbackFor = Exception.class) | |
| 63 | + @Override | |
| 64 | + public String create(CreatePendingDeliveryOrderVo vo) { | |
| 65 | + | |
| 66 | + PendingDeliveryOrder data = new PendingDeliveryOrder(); | |
| 67 | + data.setId(IdUtil.getId()); | |
| 68 | + data.setPurchaseOrderId(vo.getPurchaseOrderId()); | |
| 69 | + if (!StringUtil.isBlank(vo.getTotalQuantity())) { | |
| 70 | + data.setTotalQuantity(vo.getTotalQuantity()); | |
| 71 | + } | |
| 72 | + if (!StringUtil.isBlank(vo.getDispatchedQuantity())) { | |
| 73 | + data.setDispatchedQuantity(vo.getDispatchedQuantity()); | |
| 74 | + } | |
| 75 | + if (!StringUtil.isBlank(vo.getRequestedShipmentQuantity())) { | |
| 76 | + data.setRequestedShipmentQuantity(vo.getRequestedShipmentQuantity()); | |
| 77 | + } | |
| 78 | + | |
| 79 | + getBaseMapper().insert(data); | |
| 80 | + | |
| 81 | + OpLogUtil.setVariable("id", data.getId()); | |
| 82 | + OpLogUtil.setExtra(vo); | |
| 83 | + | |
| 84 | + return data.getId(); | |
| 85 | + } | |
| 86 | + | |
| 87 | + @OpLog(type = OtherOpLogType.class, name = "修改待交付订单,ID:{}", params = {"#id"}) | |
| 88 | + @Transactional(rollbackFor = Exception.class) | |
| 89 | + @Override | |
| 90 | + public void update(UpdatePendingDeliveryOrderVo vo) { | |
| 91 | + | |
| 92 | + PendingDeliveryOrder data = getBaseMapper().selectById(vo.getId()); | |
| 93 | + if (ObjectUtil.isNull(data)) { | |
| 94 | + throw new DefaultClientException("待交付订单不存在!"); | |
| 95 | + } | |
| 96 | + | |
| 97 | + LambdaUpdateWrapper<PendingDeliveryOrder> updateWrapper = Wrappers.lambdaUpdate(PendingDeliveryOrder.class) | |
| 98 | + .set(PendingDeliveryOrder::getPurchaseOrderId, vo.getPurchaseOrderId()) | |
| 99 | + .set(PendingDeliveryOrder::getTotalQuantity, StringUtil.isBlank(vo.getTotalQuantity()) ? null : vo.getTotalQuantity()) | |
| 100 | + .set(PendingDeliveryOrder::getDispatchedQuantity, StringUtil.isBlank(vo.getDispatchedQuantity()) ? null : vo.getDispatchedQuantity()) | |
| 101 | + .set(PendingDeliveryOrder::getRequestedShipmentQuantity, StringUtil.isBlank(vo.getRequestedShipmentQuantity()) ? null : vo.getRequestedShipmentQuantity()) | |
| 102 | + .eq(PendingDeliveryOrder::getId, vo.getId()); | |
| 103 | + | |
| 104 | + getBaseMapper().update(updateWrapper); | |
| 105 | + | |
| 106 | + OpLogUtil.setVariable("id", data.getId()); | |
| 107 | + OpLogUtil.setExtra(vo); | |
| 108 | + } | |
| 109 | + | |
| 110 | + @OpLog(type = OtherOpLogType.class, name = "删除待交付订单,ID:{}", params = {"#id"}) | |
| 111 | + @Transactional(rollbackFor = Exception.class) | |
| 112 | + @Override | |
| 113 | + public void deleteById(String id) { | |
| 114 | + | |
| 115 | + getBaseMapper().deleteById(id); | |
| 116 | + } | |
| 117 | + | |
| 118 | + @Override | |
| 119 | + public void batchAdd(List<CreatePendingDeliveryOrderVo> createPendingDeliveryOrderVoList) { | |
| 120 | + if (CollectionUtils.isEmpty(createPendingDeliveryOrderVoList)) { | |
| 121 | + return; | |
| 122 | + } | |
| 123 | + String userId = SecurityUtil.getCurrentUser().getId(); | |
| 124 | + List<PendingDeliveryOrder> pendingDeliveryOrderList = new ArrayList<>(); | |
| 125 | + for (CreatePendingDeliveryOrderVo vo : createPendingDeliveryOrderVoList) { | |
| 126 | + PendingDeliveryOrder pendingDeliveryOrder = new PendingDeliveryOrder(); | |
| 127 | + pendingDeliveryOrder.setId(IdUtil.getId()); | |
| 128 | + pendingDeliveryOrder.setPurchaseOrderId(vo.getPurchaseOrderId()); | |
| 129 | + pendingDeliveryOrder.setTotalQuantity(vo.getTotalQuantity()); | |
| 130 | + pendingDeliveryOrder.setDispatchedQuantity(vo.getDispatchedQuantity()); | |
| 131 | + pendingDeliveryOrder.setRequestedShipmentQuantity(vo.getRequestedShipmentQuantity()); | |
| 132 | + pendingDeliveryOrder.setCreateById(userId); | |
| 133 | + pendingDeliveryOrder.setUpdateById(userId); | |
| 134 | + pendingDeliveryOrder.setCreateTime(LocalDateTime.now()); | |
| 135 | + pendingDeliveryOrder.setUpdateTime(LocalDateTime.now()); | |
| 136 | + pendingDeliveryOrderList.add(pendingDeliveryOrder); | |
| 137 | + } | |
| 138 | + getBaseMapper().batchAdd(pendingDeliveryOrderList); | |
| 139 | + } | |
| 140 | + | |
| 141 | + @Override | |
| 142 | + public void cleanCacheByKey(Serializable key) { | |
| 143 | + | |
| 144 | + } | |
| 145 | +} | ... | ... |
xingyun-sc/src/main/java/com/lframework/xingyun/sc/mappers/PendingDeliveryOrderMapper.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.entity.PendingDeliveryOrder; | |
| 6 | +import com.lframework.xingyun.sc.vo.ledger.pending.QueryPendingDeliveryOrderVo; | |
| 7 | +import org.apache.ibatis.annotations.Param; | |
| 8 | + | |
| 9 | +import java.util.List; | |
| 10 | + | |
| 11 | +/** | |
| 12 | + * <p> | |
| 13 | + * 待交付订单 Mapper 接口 | |
| 14 | + * </p> | |
| 15 | + * | |
| 16 | + */ | |
| 17 | +public interface PendingDeliveryOrderMapper extends BaseMapper<PendingDeliveryOrder> { | |
| 18 | + | |
| 19 | + /** | |
| 20 | + * 查询列表 | |
| 21 | + * @param vo | |
| 22 | + * @return | |
| 23 | + */ | |
| 24 | + List<PendingDeliveryOrder> query(@Param("vo") QueryPendingDeliveryOrderVo vo); | |
| 25 | + | |
| 26 | + void batchAdd(@Param("list") List<PendingDeliveryOrder> list); | |
| 27 | +} | ... | ... |
xingyun-sc/src/main/java/com/lframework/xingyun/sc/service/ledger/PendingDeliveryOrderService.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.PendingDeliveryOrder; | |
| 6 | +import com.lframework.xingyun.sc.vo.ledger.pending.CreatePendingDeliveryOrderVo; | |
| 7 | +import com.lframework.xingyun.sc.vo.ledger.pending.QueryPendingDeliveryOrderVo; | |
| 8 | +import com.lframework.xingyun.sc.vo.ledger.pending.UpdatePendingDeliveryOrderVo; | |
| 9 | +import java.util.List; | |
| 10 | + | |
| 11 | +/** | |
| 12 | + * 待交付订单 Service | |
| 13 | + */ | |
| 14 | +public interface PendingDeliveryOrderService extends BaseMpService<PendingDeliveryOrder> { | |
| 15 | + | |
| 16 | + /** | |
| 17 | + * 查询列表 | |
| 18 | + * @return | |
| 19 | + */ | |
| 20 | + PageResult<PendingDeliveryOrder> query(Integer pageIndex, Integer pageSize, QueryPendingDeliveryOrderVo vo); | |
| 21 | + | |
| 22 | + /** | |
| 23 | + * 查询列表 | |
| 24 | + * @param vo | |
| 25 | + * @return | |
| 26 | + */ | |
| 27 | + List<PendingDeliveryOrder> query(QueryPendingDeliveryOrderVo vo); | |
| 28 | + | |
| 29 | + /** | |
| 30 | + * 根据ID查询 | |
| 31 | + * @param id | |
| 32 | + * @return | |
| 33 | + */ | |
| 34 | + PendingDeliveryOrder findById(String id); | |
| 35 | + | |
| 36 | + /** | |
| 37 | + * 创建 | |
| 38 | + * @param vo | |
| 39 | + * @return | |
| 40 | + */ | |
| 41 | + String create(CreatePendingDeliveryOrderVo vo); | |
| 42 | + | |
| 43 | + /** | |
| 44 | + * 修改 | |
| 45 | + * @param vo | |
| 46 | + */ | |
| 47 | + void update(UpdatePendingDeliveryOrderVo vo); | |
| 48 | + | |
| 49 | + /** | |
| 50 | + * 根据ID删除 | |
| 51 | + * @param id | |
| 52 | + * @return | |
| 53 | + */ | |
| 54 | + void deleteById(String id); | |
| 55 | + | |
| 56 | + /** | |
| 57 | + * 批量新增 | |
| 58 | + */ | |
| 59 | + void batchAdd(List<CreatePendingDeliveryOrderVo> createPendingDeliveryOrderVoList); | |
| 60 | +} | ... | ... |
| 1 | +package com.lframework.xingyun.sc.vo.ledger.pending; | |
| 2 | + | |
| 3 | +import javax.validation.constraints.NotBlank; | |
| 4 | +import com.lframework.starter.web.core.vo.BaseVo; | |
| 5 | +import io.swagger.annotations.ApiModelProperty; | |
| 6 | +import org.hibernate.validator.constraints.Length; | |
| 7 | +import java.io.Serializable; | |
| 8 | +import lombok.Data; | |
| 9 | + | |
| 10 | +@Data | |
| 11 | +public class CreatePendingDeliveryOrderVo implements BaseVo, Serializable { | |
| 12 | + | |
| 13 | + private static final long serialVersionUID = 1L; | |
| 14 | + | |
| 15 | + /** | |
| 16 | + * 资金协调手续主键 | |
| 17 | + */ | |
| 18 | + @ApiModelProperty("资金协调手续主键") | |
| 19 | + @Length(message = "资金协调手续主键最多允许32个字符!") | |
| 20 | + private String fundId; | |
| 21 | + | |
| 22 | + /** | |
| 23 | + * 订货单ID | |
| 24 | + */ | |
| 25 | + @ApiModelProperty(value = "订货单ID", required = true) | |
| 26 | + @NotBlank(message = "请输入订货单ID!") | |
| 27 | + @Length(message = "订货单ID最多允许32个字符!") | |
| 28 | + private String purchaseOrderId; | |
| 29 | + | |
| 30 | + /** | |
| 31 | + * 总数量(吨) | |
| 32 | + */ | |
| 33 | + @ApiModelProperty("总数量(吨)") | |
| 34 | + @Length(message = "总数量(吨)最多允许50个字符!") | |
| 35 | + private String totalQuantity; | |
| 36 | + | |
| 37 | + /** | |
| 38 | + * 已发货数量(吨) | |
| 39 | + */ | |
| 40 | + @ApiModelProperty("已发货数量(吨)") | |
| 41 | + @Length(message = "已发货数量(吨)最多允许50个字符!") | |
| 42 | + private String dispatchedQuantity; | |
| 43 | + | |
| 44 | + /** | |
| 45 | + * 申请发货数量(吨) | |
| 46 | + */ | |
| 47 | + @ApiModelProperty("申请发货数量(吨)") | |
| 48 | + @Length(message = "申请发货数量(吨)最多允许50个字符!") | |
| 49 | + private String requestedShipmentQuantity; | |
| 50 | + | |
| 51 | +} | ... | ... |
| 1 | +package com.lframework.xingyun.sc.vo.ledger.pending; | |
| 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 QueryPendingDeliveryOrderVo extends PageVo implements BaseVo, Serializable { | |
| 11 | + | |
| 12 | + private static final long serialVersionUID = 1L; | |
| 13 | + | |
| 14 | + | |
| 15 | + /** | |
| 16 | + * 资金协调手续主键 | |
| 17 | + */ | |
| 18 | + @ApiModelProperty("资金协调手续主键") | |
| 19 | + private String fundId; | |
| 20 | + | |
| 21 | + /** | |
| 22 | + * 订货单ID | |
| 23 | + */ | |
| 24 | + @ApiModelProperty("订货单ID") | |
| 25 | + private String purchaseOrderId; | |
| 26 | + | |
| 27 | +} | ... | ... |
| 1 | +package com.lframework.xingyun.sc.vo.ledger.pending; | |
| 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 UpdatePendingDeliveryOrderVo 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 | + */ | |
| 26 | + @ApiModelProperty(value = "资金协调手续主键", required = true) | |
| 27 | + @NotBlank(message = "资金协调手续主键!") | |
| 28 | + @Length(message = "资金协调手续主键最多允许32个字符!") | |
| 29 | + private String fundId; | |
| 30 | + | |
| 31 | + /** | |
| 32 | + * 订货单ID | |
| 33 | + */ | |
| 34 | + @ApiModelProperty(value = "订货单ID", required = true) | |
| 35 | + @NotBlank(message = "请输入订货单ID!") | |
| 36 | + @Length(message = "订货单ID最多允许32个字符!") | |
| 37 | + private String purchaseOrderId; | |
| 38 | + | |
| 39 | + /** | |
| 40 | + * 总数量(吨) | |
| 41 | + */ | |
| 42 | + @ApiModelProperty("总数量(吨)") | |
| 43 | + @Length(message = "总数量(吨)最多允许50个字符!") | |
| 44 | + private String totalQuantity; | |
| 45 | + | |
| 46 | + /** | |
| 47 | + * 已发货数量(吨) | |
| 48 | + */ | |
| 49 | + @ApiModelProperty("已发货数量(吨)") | |
| 50 | + @Length(message = "已发货数量(吨)最多允许50个字符!") | |
| 51 | + private String dispatchedQuantity; | |
| 52 | + | |
| 53 | + /** | |
| 54 | + * 申请发货数量(吨) | |
| 55 | + */ | |
| 56 | + @ApiModelProperty("申请发货数量(吨)") | |
| 57 | + @Length(message = "申请发货数量(吨)最多允许50个字符!") | |
| 58 | + private String requestedShipmentQuantity; | |
| 59 | + | |
| 60 | +} | ... | ... |
| 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.PendingDeliveryOrderMapper"> | |
| 4 | + | |
| 5 | + <resultMap id="PendingDeliveryOrder" type="com.lframework.xingyun.sc.entity.PendingDeliveryOrder"> | |
| 6 | + <id column="id" property="id"/> | |
| 7 | + <result column="fund_id" property="fundId"/> | |
| 8 | + <result column="purchase_order_id" property="purchaseOrderId"/> | |
| 9 | + <result column="order_no" property="orderNo"/> | |
| 10 | + <result column="ordering_unit_name" property="orderingUnitName"/> | |
| 11 | + <result column="workshop_name" property="workshopName"/> | |
| 12 | + <result column="dept_name" property="deptName"/> | |
| 13 | + <result column="total_quantity" property="totalQuantity"/> | |
| 14 | + <result column="dispatched_quantity" property="dispatchedQuantity"/> | |
| 15 | + <result column="requested_shipment_quantity" property="requestedShipmentQuantity"/> | |
| 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="PendingDeliveryOrder_sql"> | |
| 25 | + SELECT | |
| 26 | + tb.id, | |
| 27 | + tb.fund_id, | |
| 28 | + tb.purchase_order_id, | |
| 29 | + poi.order_no, | |
| 30 | + cu.name AS ordering_unit_name, | |
| 31 | + ws.name AS workshop_name, | |
| 32 | + sd.name AS dept_name, | |
| 33 | + tb.total_quantity, | |
| 34 | + tb.dispatched_quantity, | |
| 35 | + tb.requested_shipment_quantity, | |
| 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 pending_delivery_order AS tb | |
| 43 | + left join purchase_order_info as poi on poi.id = tb.purchase_order_id | |
| 44 | + left join base_data_customer as cu on cu.id = poi.ordering_unit | |
| 45 | + left join sys_dept as sd on sd.id = poi.dept_id | |
| 46 | + left join base_data_workshop as ws on ws.id = poi.workshop_id | |
| 47 | + </sql> | |
| 48 | + | |
| 49 | + <select id="query" resultMap="PendingDeliveryOrder"> | |
| 50 | + <include refid="PendingDeliveryOrder_sql"/> | |
| 51 | + <where> | |
| 52 | + <if test="vo.purchaseOrderId != null and vo.purchaseOrderId != ''"> | |
| 53 | + AND tb.purchase_order_id = #{vo.purchaseOrderId} | |
| 54 | + </if> | |
| 55 | + <if test="vo.fundId != null and vo.fundId != ''"> | |
| 56 | + AND tb.fund_id = #{vo.fundId} | |
| 57 | + </if> | |
| 58 | + </where> | |
| 59 | + </select> | |
| 60 | + | |
| 61 | + <insert id="batchAdd"> | |
| 62 | + INSERT INTO pending_delivery_order ( | |
| 63 | + id, | |
| 64 | + fund_id, | |
| 65 | + purchase_order_id, | |
| 66 | + total_quantity, | |
| 67 | + dispatched_quantity, | |
| 68 | + requested_shipment_quantity, | |
| 69 | + create_by_id, | |
| 70 | + create_by, | |
| 71 | + update_by_id, | |
| 72 | + update_by, | |
| 73 | + create_time, | |
| 74 | + update_time | |
| 75 | + ) VALUES | |
| 76 | + <foreach collection="list" item="item" separator=","> | |
| 77 | + ( | |
| 78 | + #{item.id}, | |
| 79 | + #{item.fundId}, | |
| 80 | + #{item.purchaseOrderId}, | |
| 81 | + #{item.totalQuantity}, | |
| 82 | + #{item.dispatchedQuantity}, | |
| 83 | + #{item.requestedShipmentQuantity}, | |
| 84 | + #{item.createById}, | |
| 85 | + #{item.createBy}, | |
| 86 | + #{item.updateById}, | |
| 87 | + #{item.updateBy}, | |
| 88 | + #{item.createTime}, | |
| 89 | + #{item.updateTime} | |
| 90 | + ) | |
| 91 | + </foreach> | |
| 92 | + </insert> | |
| 93 | +</mapper> | ... | ... |