@@ -26,12 +26,12 @@ public interface InvwWarehouseRepo extends AbstractJpaRepo<InvwWarehouse, String | |||
List<InvwWarehouse> findBroByParentIdAndStatus(String parentId, EnableStatus status); | |||
//查询子级仓库 | |||
@Query(value = "from InvwWarehouse where parentId = ?1 and status = ?2") | |||
@Query(value = "from InvwWarehouse where parentId = ?1 and status = ?2 order by code, insertTime ") | |||
List<InvwWarehouse> findChiByIdAndStatus(String id, EnableStatus status); | |||
//查询父、同级仓库 | |||
@Query(value = "from InvwWarehouse where parentId = ?1 or id = ?1 and status = ?2 order by code, insertTime ") | |||
List<InvwWarehouse> findParBroByParentId(String parentId, EnableStatus status); | |||
@Query(value = "from InvwWarehouse where parentId = ?1 or id = ?2 and status = ?3 order by code, insertTime ") | |||
List<InvwWarehouse> findParBroByParentId(String parentId, String Id, EnableStatus status); | |||
//查询同、子级仓库 | |||
@Query(value = "from InvwWarehouse where parentId = ?1 or parentId = ?2 and status = ?3 order by code, insertTime ") |
@@ -12,9 +12,12 @@ import lombok.experimental.Accessors; | |||
@Setter | |||
@Accessors(chain = true) | |||
public class InvwWarehouseIdNameRequestDTO extends AbstractStaffBizRequestDTO { | |||
@ApiModelProperty(value = "仓库ID 空-查所有") | |||
@ApiModelProperty(value = "仓库ID 与仓库编号二选一 空-查所有") | |||
private String id; | |||
@ApiModelProperty(value = "仓库编号 与仓库ID号二选一 空-查所有") | |||
private String code; | |||
@ApiModelProperty(value = "查询类型 id为空查所有 1-查父 2-查兄 3-查子 4-查父兄 5-查兄子 6-查父子 7-查父兄子") | |||
private String type; | |||
} |
@@ -268,14 +268,18 @@ public class InvwWarehouseManagerImpl extends AbstractInvwManager implements Inv | |||
InvwWarehouseIdNameResponseDTO response = new InvwWarehouseIdNameResponseDTO(); | |||
InvwWarehouse warehouse = null; | |||
if (hasText(req.getId())) { | |||
warehouse = warehouseRepo.findById(req.getId()).orElse(null); | |||
warehouse = warehouseRepo.findByIdAndStatus(req.getId(), EnableStatus.ENABLE); | |||
} else if(hasText(req.getCode())){ | |||
warehouse = warehouseRepo.findByCodeAndStatus(req.getCode(), EnableStatus.ENABLE); | |||
} else { | |||
warehouseList = warehouseRepo.findAllByStatus(EnableStatus.ENABLE); | |||
} | |||
if(hasText(req.getType())) { | |||
/** 1-查父 2-查兄 3-查子 4-查父兄 5-查兄子 6-查父子 7-查父兄子*/ | |||
if(hasText(req.getType()) && (hasText(req.getId()) || hasText(req.getCode()))) { | |||
switch (req.getType()) { | |||
case "1": | |||
warehouseList = warehouseRepo.findParByParentIdAndStatus(req.getId(), EnableStatus.ENABLE); | |||
warehouseList = warehouseRepo.findParByParentIdAndStatus(warehouse.getParentId(), EnableStatus.ENABLE); | |||
break; | |||
case "2": | |||
if (warehouse != null) { | |||
@@ -285,20 +289,18 @@ public class InvwWarehouseManagerImpl extends AbstractInvwManager implements Inv | |||
} | |||
break; | |||
case "3": | |||
warehouseList = warehouseRepo.findChiByIdAndStatus(req.getId(), EnableStatus.ENABLE); | |||
warehouseList = warehouseRepo.findChiByIdAndStatus(warehouse.getId(), EnableStatus.ENABLE); | |||
break; | |||
case "4": | |||
if (warehouse != null) { | |||
if (hasText(warehouse.getParentId())) { | |||
warehouseList = warehouseRepo.findParBroByParentId(warehouse.getParentId(), EnableStatus.ENABLE); | |||
warehouseList = warehouseRepo.findParBroByParentId(warehouse.getParentId(), warehouse.getParentId(), EnableStatus.ENABLE); | |||
} | |||
} | |||
break; | |||
case "5": | |||
if (warehouse != null) { | |||
if (hasText(warehouse.getParentId())) { | |||
warehouseList = warehouseRepo.findBroChiByParentIdOrId(warehouse.getParentId(), warehouse.getId(), EnableStatus.ENABLE); | |||
} | |||
warehouseList = warehouseRepo.findBroChiByParentIdOrId(warehouse.getParentId(), warehouse.getId(), EnableStatus.ENABLE); | |||
} | |||
break; | |||
case "6": |
@@ -80,6 +80,7 @@ public class IssueOrderRefundManagerImpl extends AbstractSettlewManager implemen | |||
//发起退费申请 | |||
orderFoundApply(orderRefund); | |||
orderRefund.setStatus(RefundStatus.APPLY); | |||
orderRefund.setRefundTime(LocalDateTime.now()); | |||
}else if (RefundOperateType.BANK.equals(orderRefund.getOperateType())){ | |||
if (dto.getPaymentBankType() == null){ | |||
throw new ManagerException("银行卡退费时付费银行必填!"); | |||
@@ -100,6 +101,7 @@ public class IssueOrderRefundManagerImpl extends AbstractSettlewManager implemen | |||
orderRefund.setUpdateTime(now); | |||
orderRefund.setAuditTime(now); | |||
orderRefund.setSalesmanOpenId(findOpenIdByToken(dto.getAccessToken())); | |||
orderRefund.setSettlementOpenId(findOpenIdByToken(dto.getAccessToken())); | |||
repo.merge(orderRefund); | |||
//记录日志 | |||
persistOperateLog(OperateType.ORDER_REFUND_CONFIRM,orderRefund.getId(),dto.getOrderSource(),findOpenIdByToken(dto.getAccessToken()),"结算退费审核结果:"+dto.getCensorResult()); |