Commit 9fa78665ae9d9ce8f9eeaea30d43824976d9f3bb
1 parent
b485c690
试样订单:订货单新增试样订单字段、生成试样订单;撤销单、变更单、补货单排除试样订单
Showing
14 changed files
with
195 additions
and
21 deletions
| ... | ... | @@ -1224,3 +1224,10 @@ ALTER TABLE tbl_contract_std_processing_line |
| 1224 | 1224 | ALTER TABLE tbl_contract_distributor_line |
| 1225 | 1225 | ADD COLUMN sample_order boolean DEFAULT FALSE COMMENT '是否为试样订单'; |
| 1226 | 1226 | |
| 1227 | +--订货单、订货单物料行新增字段 | |
| 1228 | +ALTER TABLE purchase_order_info | |
| 1229 | + ADD COLUMN sample_order boolean DEFAULT FALSE COMMENT '是否为试样订单'; | |
| 1230 | + | |
| 1231 | +ALTER TABLE tbl_purchase_order_line | |
| 1232 | + ADD COLUMN sample_order boolean DEFAULT FALSE COMMENT '是否为试样订单'; | |
| 1233 | + | ... | ... |
| ... | ... | @@ -320,6 +320,12 @@ public class GetPurchaseOrderInfoBo extends BaseBo<PurchaseOrderInfo> { |
| 320 | 320 | @ApiModelProperty("是否冻结") |
| 321 | 321 | private boolean freeze; |
| 322 | 322 | |
| 323 | + /** | |
| 324 | + * 是否为试样订单 | |
| 325 | + */ | |
| 326 | + @ApiModelProperty("是否为试样订单") | |
| 327 | + private boolean sampleOrder; | |
| 328 | + | |
| 323 | 329 | |
| 324 | 330 | public GetPurchaseOrderInfoBo() { |
| 325 | 331 | ... | ... |
| ... | ... | @@ -153,6 +153,12 @@ public class GetPurchaseOrderLineBo extends BaseBo<PurchaseOrderLine> { |
| 153 | 153 | @ApiModelProperty("是否已发货") |
| 154 | 154 | private Boolean shipment; |
| 155 | 155 | |
| 156 | + /** | |
| 157 | + * 是否为试样订单 | |
| 158 | + */ | |
| 159 | + @ApiModelProperty("是否为试样订单") | |
| 160 | + private boolean sampleOrder; | |
| 161 | + | |
| 156 | 162 | public GetPurchaseOrderLineBo() { |
| 157 | 163 | |
| 158 | 164 | } | ... | ... |
| ... | ... | @@ -280,6 +280,11 @@ public class PurchaseOrderInfo extends BaseEntity implements BaseDto { |
| 280 | 280 | private Integer freezeCount; |
| 281 | 281 | |
| 282 | 282 | /** |
| 283 | + * 是否为试样订单 | |
| 284 | + */ | |
| 285 | + private boolean sampleOrder; | |
| 286 | + | |
| 287 | + /** | |
| 283 | 288 | * 下单人(非持久化字段) |
| 284 | 289 | */ |
| 285 | 290 | @TableField(exist = false) | ... | ... |
| ... | ... | @@ -265,6 +265,11 @@ public class PurchaseOrderLine extends BaseEntity implements BaseDto { |
| 265 | 265 | private Boolean delFlag; |
| 266 | 266 | |
| 267 | 267 | /** |
| 268 | + * 是否为试样订单 | |
| 269 | + */ | |
| 270 | + private boolean sampleOrder; | |
| 271 | + | |
| 272 | + /** | |
| 268 | 273 | * 新增/删除/变更 |
| 269 | 274 | */ |
| 270 | 275 | @TableField(exist = false) | ... | ... |
| ... | ... | @@ -35,6 +35,8 @@ import com.lframework.xingyun.sc.service.shipments.delay.DelayedShipmentDetailSe |
| 35 | 35 | import com.lframework.xingyun.sc.service.shipments.delay.DelayedShipmentService; |
| 36 | 36 | import com.lframework.xingyun.sc.vo.customer.credit.QueryCorePersonnelHistoryVo; |
| 37 | 37 | import com.lframework.xingyun.sc.vo.customer.credit.UpdateCustomerCreditVo; |
| 38 | +import com.lframework.xingyun.sc.vo.order.CreatePurchaseOrderInfoVo; | |
| 39 | +import com.lframework.xingyun.sc.vo.order.CreatePurchaseOrderLineVo; | |
| 38 | 40 | import com.lframework.xingyun.sc.vo.order.QueryPurchaseOrderLineVo; |
| 39 | 41 | import com.lframework.xingyun.sc.vo.order.QueryPurchaseOrderRevokeLineVo; |
| 40 | 42 | import com.lframework.xingyun.sc.vo.shipments.car.CreateCarRequestPlanVo; |
| ... | ... | @@ -274,6 +276,8 @@ public class BusinessDataHandlerServiceImpl implements BusinessDataHandlerServic |
| 274 | 276 | if (FlowInstanceStatus.APPROVE_PASS.getCode().equals(flowStatus) |
| 275 | 277 | || FlowInstanceStatus.FINISH.getCode().equals(flowStatus)) { |
| 276 | 278 | purchaseOrderInfoService.updateStatus(businessId, "PASS"); |
| 279 | + //审核通过,物料行存在试样订单的需要对当前订单拆分 | |
| 280 | + packPurchaseOrderInfo(businessId); | |
| 277 | 281 | } else if (FlowInstanceStatus.REVOKE.getCode().equals(flowStatus) |
| 278 | 282 | || FlowInstanceStatus.REFUSE.getCode().equals(flowStatus) |
| 279 | 283 | || FlowInstanceStatus.TERMINATION.getCode().equals(flowStatus)) { |
| ... | ... | @@ -675,4 +679,100 @@ public class BusinessDataHandlerServiceImpl implements BusinessDataHandlerServic |
| 675 | 679 | messageHandler.sendMsg(null, roleCodes, businessType, businessId, null); |
| 676 | 680 | } |
| 677 | 681 | } |
| 682 | + | |
| 683 | + /** | |
| 684 | + * 处理订货单数据 | |
| 685 | + * | |
| 686 | + * @param businessId 订货单ID | |
| 687 | + */ | |
| 688 | + private void packPurchaseOrderInfo(String businessId) { | |
| 689 | + PurchaseOrderInfo purchaseOrderInfo = purchaseOrderInfoService.findById(businessId); | |
| 690 | + | |
| 691 | + QueryPurchaseOrderLineVo vo1 = new QueryPurchaseOrderLineVo(); | |
| 692 | + vo1.setPurchaseOrderId(purchaseOrderInfo.getId()); | |
| 693 | + List<PurchaseOrderLine> lineVoList = purchaseOrderLineService.query(vo1); | |
| 694 | + if (CollectionUtils.isNotEmpty(lineVoList)) { | |
| 695 | + Map<Boolean, List<PurchaseOrderLine>> partitioned = lineVoList.stream() | |
| 696 | + .collect(Collectors.partitioningBy(PurchaseOrderLine::isSampleOrder)); | |
| 697 | + | |
| 698 | + List<PurchaseOrderLine> sampleOrders = partitioned.get(true); // 是试样订单 | |
| 699 | + if (CollectionUtils.isEmpty(sampleOrders)) { | |
| 700 | + return; | |
| 701 | + } | |
| 702 | + | |
| 703 | + CreatePurchaseOrderInfoVo vo = new CreatePurchaseOrderInfoVo(); | |
| 704 | + vo.setContractId(purchaseOrderInfo.getContractId()); | |
| 705 | + vo.setOrderNo(purchaseOrderInfo.getOrderNo() + "xp01"); | |
| 706 | + vo.setSupplyUnit(purchaseOrderInfo.getSupplyUnit()); | |
| 707 | + vo.setOrderingUnit(purchaseOrderInfo.getOrderingUnit()); | |
| 708 | + vo.setOrderDate(purchaseOrderInfo.getOrderDate()); | |
| 709 | + vo.setSettlementTerms(purchaseOrderInfo.getSettlementTerms()); | |
| 710 | + vo.setDeliveryMethod(purchaseOrderInfo.getDeliveryMethod()); | |
| 711 | + vo.setPriceListNo(purchaseOrderInfo.getPriceListNo()); | |
| 712 | + vo.setExecutionStandard(purchaseOrderInfo.getExecutionStandard()); | |
| 713 | + vo.setExecutionStandardRemarks(purchaseOrderInfo.getExecutionStandardRemarks()); | |
| 714 | + vo.setInvoicingStatus(purchaseOrderInfo.getInvoicingStatus()); | |
| 715 | + vo.setShippingCost(purchaseOrderInfo.getShippingCost()); | |
| 716 | + vo.setPieceWeightHeader(purchaseOrderInfo.getPieceWeightHeader()); | |
| 717 | + vo.setSurface(purchaseOrderInfo.getSurface()); | |
| 718 | + vo.setTolerance(purchaseOrderInfo.getTolerance()); | |
| 719 | + vo.setPerformance(purchaseOrderInfo.getPerformance()); | |
| 720 | + vo.setElement(purchaseOrderInfo.getElement()); | |
| 721 | + vo.setPackaging(purchaseOrderInfo.getPackaging()); | |
| 722 | + vo.setRemarks(purchaseOrderInfo.getRemarks()); | |
| 723 | + vo.setStatus(purchaseOrderInfo.getStatus()); | |
| 724 | + vo.setExamineStatus(purchaseOrderInfo.getExamineStatus()); | |
| 725 | + vo.setProductionProcess(purchaseOrderInfo.getProductionProcess()); | |
| 726 | + vo.setDeptId(purchaseOrderInfo.getDeptId()); | |
| 727 | + vo.setRegion(purchaseOrderInfo.getRegion()); | |
| 728 | + vo.setStockUpCompanyId(purchaseOrderInfo.getStockUpCompanyId()); | |
| 729 | + vo.setWorkshopId(purchaseOrderInfo.getWorkshopId()); | |
| 730 | + vo.setType(purchaseOrderInfo.getType()); | |
| 731 | + vo.setPackagingFee(purchaseOrderInfo.getPackagingFee()); | |
| 732 | + vo.setContractCreateById(purchaseOrderInfo.getContractCreateById()); | |
| 733 | + vo.setSampleOrder(true); | |
| 734 | + vo.setNoFlowInstance(true); | |
| 735 | + | |
| 736 | + List<CreatePurchaseOrderLineVo> list = new ArrayList<>(); | |
| 737 | + BigDecimal totalQuantity = new BigDecimal(0); | |
| 738 | + for (PurchaseOrderLine purchaseOrderLine : sampleOrders) { | |
| 739 | + CreatePurchaseOrderLineVo createPurchaseOrderLineVo = new CreatePurchaseOrderLineVo(); | |
| 740 | + createPurchaseOrderLineVo.setIndustry(purchaseOrderLine.getIndustry()); | |
| 741 | + createPurchaseOrderLineVo.setQuality(purchaseOrderLine.getQuality()); | |
| 742 | + createPurchaseOrderLineVo.setBrand(purchaseOrderLine.getBrand()); | |
| 743 | + createPurchaseOrderLineVo.setThickness(purchaseOrderLine.getThickness()); | |
| 744 | + createPurchaseOrderLineVo.setThicknessTolPos(purchaseOrderLine.getThicknessTolPos()); | |
| 745 | + createPurchaseOrderLineVo.setThicknessTolNeg(purchaseOrderLine.getThicknessTolNeg()); | |
| 746 | + createPurchaseOrderLineVo.setWidth(purchaseOrderLine.getWidth()); | |
| 747 | + createPurchaseOrderLineVo.setWidthTolPos(purchaseOrderLine.getWidthTolPos()); | |
| 748 | + createPurchaseOrderLineVo.setWidthTolNeg(purchaseOrderLine.getWidthTolNeg()); | |
| 749 | + createPurchaseOrderLineVo.setLength(purchaseOrderLine.getLength()); | |
| 750 | + createPurchaseOrderLineVo.setLengthTolPos(purchaseOrderLine.getLengthTolPos()); | |
| 751 | + createPurchaseOrderLineVo.setLengthTolNeg(purchaseOrderLine.getLengthTolNeg()); | |
| 752 | + createPurchaseOrderLineVo.setStatus(purchaseOrderLine.getStatus()); | |
| 753 | + createPurchaseOrderLineVo.setQuantity(purchaseOrderLine.getQuantity()); | |
| 754 | + createPurchaseOrderLineVo.setSalesPrice(purchaseOrderLine.getSalesPrice()); | |
| 755 | + createPurchaseOrderLineVo.setDeliveryDate(purchaseOrderLine.getDeliveryDate()); | |
| 756 | + createPurchaseOrderLineVo.setShowOrder(purchaseOrderLine.getShowOrder()); | |
| 757 | + createPurchaseOrderLineVo.setAssessmentExceedsAgreement(purchaseOrderLine.getAssessmentExceedsAgreement()); | |
| 758 | + createPurchaseOrderLineVo.setPackagingFee(purchaseOrderLine.getPackagingFee()); | |
| 759 | + createPurchaseOrderLineVo.setSampleOrder(purchaseOrderLine.isSampleOrder()); | |
| 760 | + list.add(createPurchaseOrderLineVo); | |
| 761 | + | |
| 762 | + totalQuantity = totalQuantity.add(purchaseOrderLine.getQuantity()); | |
| 763 | + //删除原来的关联关系 | |
| 764 | + purchaseOrderLineService.deleteById(purchaseOrderLine.getId()); | |
| 765 | + } | |
| 766 | + | |
| 767 | + vo.setTotalQuantity(totalQuantity); | |
| 768 | + vo.setCreatePurchaseOrderLineVoList(list); | |
| 769 | + purchaseOrderInfoService.create(vo); | |
| 770 | + | |
| 771 | + //更新原来订货单总数量 | |
| 772 | + if (purchaseOrderInfo.getTotalQuantity() != null) { | |
| 773 | + BigDecimal result = purchaseOrderInfo.getTotalQuantity().subtract(totalQuantity); | |
| 774 | + purchaseOrderInfoService.updateTotalQuantity(businessId, result); | |
| 775 | + } | |
| 776 | + } | |
| 777 | + } | |
| 678 | 778 | } | ... | ... |
| ... | ... | @@ -731,6 +731,7 @@ public class ContractDistributorStandardServiceImpl extends |
| 731 | 731 | createPurchaseOrderLineVo.setSalesPrice(contractDistributorLine.getUnitPrice()); |
| 732 | 732 | createPurchaseOrderLineVo.setDeliveryDate(contractDistributorLine.getDeliveryDate()); |
| 733 | 733 | createPurchaseOrderLineVo.setShowOrder(contractDistributorLine.getShowOrder()); |
| 734 | + createPurchaseOrderLineVo.setSampleOrder(contractDistributorLine.getSampleOrder()); | |
| 734 | 735 | createPurchaseOrderLineVoList.add(createPurchaseOrderLineVo); |
| 735 | 736 | }); |
| 736 | 737 | } |
| ... | ... | @@ -755,6 +756,7 @@ public class ContractDistributorStandardServiceImpl extends |
| 755 | 756 | createPurchaseOrderLineVo.setSalesPrice(contractStdProcessingLine.getUnitPrice()); |
| 756 | 757 | createPurchaseOrderLineVo.setDeliveryDate(contractStdProcessingLine.getDeliveryDate()); |
| 757 | 758 | createPurchaseOrderLineVo.setShowOrder(contractStdProcessingLine.getShowOrder()); |
| 759 | + createPurchaseOrderLineVo.setSampleOrder(contractStdProcessingLine.getSampleOrder()); | |
| 758 | 760 | createPurchaseOrderLineVoList.add(createPurchaseOrderLineVo); |
| 759 | 761 | }); |
| 760 | 762 | } | ... | ... |
| ... | ... | @@ -240,6 +240,7 @@ public class PurchaseOrderInfoServiceImpl extends BaseMpServiceImpl<PurchaseOrde |
| 240 | 240 | if (!StringUtil.isBlank(vo.getContractCreateById())) { |
| 241 | 241 | data.setContractCreateById(vo.getContractCreateById()); |
| 242 | 242 | } |
| 243 | + data.setSampleOrder(vo.isSampleOrder()); | |
| 243 | 244 | |
| 244 | 245 | |
| 245 | 246 | getBaseMapper().insert(data); |
| ... | ... | @@ -263,7 +264,9 @@ public class PurchaseOrderInfoServiceImpl extends BaseMpServiceImpl<PurchaseOrde |
| 263 | 264 | data.setWorkshopCode(workshop.getCode()); |
| 264 | 265 | } |
| 265 | 266 | } |
| 266 | - flowInstanceWrapperService.startInstance(BPM_FLAG, data.getId(), BPM_FLAG, data); | |
| 267 | + if (vo.isNoFlowInstance()) { | |
| 268 | + flowInstanceWrapperService.startInstance(BPM_FLAG, data.getId(), BPM_FLAG, data); | |
| 269 | + } | |
| 267 | 270 | |
| 268 | 271 | return data.getId(); |
| 269 | 272 | } | ... | ... |
| ... | ... | @@ -128,6 +128,7 @@ public class PurchaseOrderLineServiceImpl extends BaseMpServiceImpl<PurchaseOrde |
| 128 | 128 | if (vo.getPackagingFee() != null) { |
| 129 | 129 | data.setPackagingFee(vo.getPackagingFee()); |
| 130 | 130 | } |
| 131 | + data.setSampleOrder(vo.isSampleOrder()); | |
| 131 | 132 | |
| 132 | 133 | getBaseMapper().insert(data); |
| 133 | 134 | |
| ... | ... | @@ -168,6 +169,7 @@ public class PurchaseOrderLineServiceImpl extends BaseMpServiceImpl<PurchaseOrde |
| 168 | 169 | .set(PurchaseOrderLine::getShowOrder, vo.getShowOrder() == null ? null : vo.getShowOrder()) |
| 169 | 170 | .set(PurchaseOrderLine::getAssessmentExceedsAgreement, StringUtil.isBlank(vo.getAssessmentExceedsAgreement()) ? null : vo.getAssessmentExceedsAgreement()) |
| 170 | 171 | .set(PurchaseOrderLine::getPackagingFee, vo.getPackagingFee() == null ? null : vo.getPackagingFee()) |
| 172 | + .set(PurchaseOrderLine::isSampleOrder, vo.isSampleOrder()) | |
| 171 | 173 | .eq(PurchaseOrderLine::getId, vo.getId()); |
| 172 | 174 | |
| 173 | 175 | getBaseMapper().update(updateWrapper); | ... | ... |
| ... | ... | @@ -237,4 +237,16 @@ public class CreatePurchaseOrderInfoVo implements BaseVo, Serializable { |
| 237 | 237 | @ApiModelProperty("合同创建人ID") |
| 238 | 238 | private String contractCreateById; |
| 239 | 239 | |
| 240 | + /** | |
| 241 | + * 是否为试样订单 | |
| 242 | + */ | |
| 243 | + @ApiModelProperty("是否为试样订单") | |
| 244 | + private boolean sampleOrder; | |
| 245 | + | |
| 246 | + /** | |
| 247 | + * 不走审核流程 | |
| 248 | + */ | |
| 249 | + @ApiModelProperty("不走审核流程") | |
| 250 | + private boolean noFlowInstance = false; | |
| 251 | + | |
| 240 | 252 | } | ... | ... |
| ... | ... | @@ -176,4 +176,10 @@ public class CreatePurchaseOrderLineVo implements BaseVo, Serializable { |
| 176 | 176 | @IsNumberPrecision(message = "包装费最多允许4位小数!", value = 4) |
| 177 | 177 | private BigDecimal packagingFee; |
| 178 | 178 | |
| 179 | + /** | |
| 180 | + * 是否为试样订单 | |
| 181 | + */ | |
| 182 | + @ApiModelProperty("是否为试样订单") | |
| 183 | + private boolean sampleOrder; | |
| 184 | + | |
| 179 | 185 | } | ... | ... |
| ... | ... | @@ -119,6 +119,12 @@ public class QueryPurchaseOrderInfoVo extends PageVo implements BaseVo, Serializ |
| 119 | 119 | private boolean freeze; |
| 120 | 120 | |
| 121 | 121 | /** |
| 122 | + * 是否为试样订单 | |
| 123 | + */ | |
| 124 | + @ApiModelProperty("是否为试样订单") | |
| 125 | + private boolean sampleOrder; | |
| 126 | + | |
| 127 | + /** | |
| 122 | 128 | * 订货单位主键集合 |
| 123 | 129 | */ |
| 124 | 130 | @ApiModelProperty("订货单位主键集合") | ... | ... |
| ... | ... | @@ -176,4 +176,10 @@ public class UpdatePurchaseOrderLineVo implements BaseVo, Serializable { |
| 176 | 176 | @IsNumberPrecision(message = "包装费最多允许4位小数!", value = 4) |
| 177 | 177 | private BigDecimal packagingFee; |
| 178 | 178 | |
| 179 | + /** | |
| 180 | + * 是否为试样订单 | |
| 181 | + */ | |
| 182 | + @ApiModelProperty("是否为试样订单") | |
| 183 | + private boolean sampleOrder; | |
| 184 | + | |
| 179 | 185 | } | ... | ... |
| ... | ... | @@ -46,6 +46,7 @@ |
| 46 | 46 | <result column="packaging_fee" property="packagingFee"/> |
| 47 | 47 | <result column="contract_create_by_id" property="contractCreateById"/> |
| 48 | 48 | <result column="contract_create_by_name" property="contractCreateByName"/> |
| 49 | + <result column="sample_order" property="sampleOrder"/> | |
| 49 | 50 | <result column="create_by_id" property="createById"/> |
| 50 | 51 | <result column="create_by" property="createBy"/> |
| 51 | 52 | <result column="update_by_id" property="updateById"/> |
| ... | ... | @@ -100,6 +101,7 @@ |
| 100 | 101 | tb.contract_create_by_id, |
| 101 | 102 | su.name as contract_create_by_name, |
| 102 | 103 | tb.freeze, |
| 104 | + tb.sample_order, | |
| 103 | 105 | tb.create_by_id, |
| 104 | 106 | tb.create_by, |
| 105 | 107 | tb.update_by_id, |
| ... | ... | @@ -157,6 +159,9 @@ |
| 157 | 159 | <if test="vo.freeze != null and vo.freeze != ''"> |
| 158 | 160 | AND tb.freeze = #{vo.freeze} |
| 159 | 161 | </if> |
| 162 | + <if test="vo.sampleOrder != null and vo.sampleOrder != ''"> | |
| 163 | + AND tb.sample_order = #{vo.sampleOrder} | |
| 164 | + </if> | |
| 160 | 165 | <if test="vo.orderingUnitNameOrOrderNo != null and vo.orderingUnitNameOrOrderNo != ''"> |
| 161 | 166 | AND (cu.name LIKE CONCAT('%', #{vo.orderingUnitNameOrOrderNo},'%') |
| 162 | 167 | or tb.order_no LIKE CONCAT('%', #{vo.orderingUnitNameOrOrderNo},'%')) |
| ... | ... | @@ -215,26 +220,29 @@ |
| 215 | 220 | AND tb.workshop_id = #{vo.workshopId} |
| 216 | 221 | </if> |
| 217 | 222 | <choose> |
| 218 | - <when test="vo.queryType == 'REVOKE'"> | |
| 219 | - AND (tb.revoke_status = '' OR tb.revoke_status = null OR tb.revoke_status='CANCEL' OR | |
| 220 | - tb.revoke_status='PARTIAL' OR tb.revoke_status IS NULL) | |
| 221 | - AND (tb.status='ISSUED' OR tb.status='WAIT' OR tb.status='TRANSIT') | |
| 222 | - AND tb.examine_status = 'PASS' | |
| 223 | - AND (tb.spec_change_status != 'IN_PROGRESS' OR tb.spec_change_status IS NULL) | |
| 224 | - </when> | |
| 225 | - <when test="vo.queryType == 'CHANGE'"> | |
| 226 | - AND tb.examine_status = 'PASS' | |
| 227 | - AND tb.status NOT IN ('SHIPPED', 'DELIVERED', 'CANCEL') | |
| 228 | - AND (tb.revoke_status != 'UNDOING' OR tb.revoke_status IS NULL) | |
| 229 | - AND (tb.spec_change_status != 'IN_PROGRESS' OR tb.spec_change_status IS NULL) | |
| 230 | - </when> | |
| 231 | - <when test="vo.queryType == 'REPLENISHMENT'"> | |
| 232 | - AND tb.examine_status = 'PASS' | |
| 233 | - AND tb.status IN ('TRANSIT', 'SHIPPED', 'DELIVERED') | |
| 234 | - </when> | |
| 235 | - <otherwise> | |
| 236 | - AND 1 = 0 <!-- 确保查询不到任何数据 --> | |
| 237 | - </otherwise> | |
| 223 | + <when test="vo.queryType == 'REVOKE'"> | |
| 224 | + AND (tb.revoke_status = '' OR tb.revoke_status = null OR tb.revoke_status='CANCEL' OR | |
| 225 | + tb.revoke_status='PARTIAL' OR tb.revoke_status IS NULL) | |
| 226 | + AND (tb.status='ISSUED' OR tb.status='WAIT' OR tb.status='TRANSIT') | |
| 227 | + AND tb.examine_status = 'PASS' | |
| 228 | + AND tb.sample_order = false | |
| 229 | + AND (tb.spec_change_status != 'IN_PROGRESS' OR tb.spec_change_status IS NULL) | |
| 230 | + </when> | |
| 231 | + <when test="vo.queryType == 'CHANGE'"> | |
| 232 | + AND tb.examine_status = 'PASS' | |
| 233 | + AND tb.sample_order = false | |
| 234 | + AND tb.status NOT IN ('SHIPPED', 'DELIVERED', 'CANCEL') | |
| 235 | + AND (tb.revoke_status != 'UNDOING' OR tb.revoke_status IS NULL) | |
| 236 | + AND (tb.spec_change_status != 'IN_PROGRESS' OR tb.spec_change_status IS NULL) | |
| 237 | + </when> | |
| 238 | + <when test="vo.queryType == 'REPLENISHMENT'"> | |
| 239 | + AND tb.examine_status = 'PASS' | |
| 240 | + AND tb.sample_order = false | |
| 241 | + AND tb.status IN ('TRANSIT', 'SHIPPED', 'DELIVERED') | |
| 242 | + </when> | |
| 243 | + <otherwise> | |
| 244 | + AND 1 = 0 <!-- 确保查询不到任何数据 --> | |
| 245 | + </otherwise> | |
| 238 | 246 | </choose> |
| 239 | 247 | </where> |
| 240 | 248 | ORDER BY tb.update_time DESC | ... | ... |