✨ 凭证管理关联运单批次查询支持项目筛选并返回项目名称
- waybill-batches 接口新增 projectId 筛选项 - 分页结果增加 projectName,同一批次跨多个项目时返回「多个项目」
This commit is contained in:
+4
-3
@@ -135,9 +135,10 @@ public class VoucherManageController extends BladeController {
|
|||||||
@ApiOperationSupport(order = 7)
|
@ApiOperationSupport(order = 7)
|
||||||
@Operation(summary = "可关联运输批次")
|
@Operation(summary = "可关联运输批次")
|
||||||
public R<IPage<Map<String, Object>>> waybillBatches(Query query, @RequestParam(required = false) String batchNo,
|
public R<IPage<Map<String, Object>>> waybillBatches(Query query, @RequestParam(required = false) String batchNo,
|
||||||
@RequestParam(required = false) String createUser, @RequestParam(required = false) Integer waybillCount,
|
@RequestParam(required = false) Long projectId, @RequestParam(required = false) String createUser,
|
||||||
@RequestParam(required = false) String createTimeStart, @RequestParam(required = false) String createTimeEnd) {
|
@RequestParam(required = false) Integer waybillCount, @RequestParam(required = false) String createTimeStart,
|
||||||
return R.data(voucherManageService.selectableWaybillBatches(Condition.getPage(query), batchNo, createUser, waybillCount, createTimeStart, createTimeEnd));
|
@RequestParam(required = false) String createTimeEnd) {
|
||||||
|
return R.data(voucherManageService.selectableWaybillBatches(Condition.getPage(query), batchNo, projectId, createUser, waybillCount, createTimeStart, createTimeEnd));
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/audit-pass")
|
@PostMapping("/audit-pass")
|
||||||
|
|||||||
+3
-2
@@ -13,8 +13,9 @@ import org.apache.ibatis.annotations.Delete;
|
|||||||
public interface VoucherWaybillBatchMapper extends BaseMapper<VoucherWaybillBatch> {
|
public interface VoucherWaybillBatchMapper extends BaseMapper<VoucherWaybillBatch> {
|
||||||
@Delete("DELETE FROM blade_voucher_waybill_batch WHERE voucher_id = #{voucherId}")
|
@Delete("DELETE FROM blade_voucher_waybill_batch WHERE voucher_id = #{voucherId}")
|
||||||
int deletePhysicalByVoucherId(@Param("voucherId") Long voucherId);
|
int deletePhysicalByVoucherId(@Param("voucherId") Long voucherId);
|
||||||
IPage<Map<String, Object>> selectVoucherWaybillBatchPage(IPage<?> page, @Param("tenantId") String tenantId, @Param("batchNo") String batchNo, @Param("createUser") String createUser,
|
IPage<Map<String, Object>> selectVoucherWaybillBatchPage(IPage<?> page, @Param("tenantId") String tenantId, @Param("batchNo") String batchNo,
|
||||||
@Param("waybillCount") Integer waybillCount, @Param("createTimeStart") String createTimeStart, @Param("createTimeEnd") String createTimeEnd,
|
@Param("projectId") Long projectId, @Param("createUser") String createUser, @Param("waybillCount") Integer waybillCount,
|
||||||
|
@Param("createTimeStart") String createTimeStart, @Param("createTimeEnd") String createTimeEnd,
|
||||||
@Param("restrictCarrier") boolean restrictCarrier, @Param("carrierName") String carrierName);
|
@Param("restrictCarrier") boolean restrictCarrier, @Param("carrierName") String carrierName);
|
||||||
List<Map<String, Object>> selectWaybillBatchesByIds(@Param("tenantId") String tenantId, @Param("ids") List<Long> ids,
|
List<Map<String, Object>> selectWaybillBatchesByIds(@Param("tenantId") String tenantId, @Param("ids") List<Long> ids,
|
||||||
@Param("restrictCarrier") boolean restrictCarrier, @Param("carrierName") String carrierName);
|
@Param("restrictCarrier") boolean restrictCarrier, @Param("carrierName") String carrierName);
|
||||||
|
|||||||
+2
@@ -4,12 +4,14 @@
|
|||||||
<select id="selectVoucherWaybillBatchPage" resultType="java.util.LinkedHashMap">
|
<select id="selectVoucherWaybillBatchPage" resultType="java.util.LinkedHashMap">
|
||||||
SELECT MIN(w.id) AS id, MAX(w.create_time) AS createTime, MAX(w.create_user) AS createUser,
|
SELECT MIN(w.id) AS id, MAX(w.create_time) AS createTime, MAX(w.create_user) AS createUser,
|
||||||
MAX(u.real_name) AS createUserName, COUNT(*) AS waybillCount,
|
MAX(u.real_name) AS createUserName, COUNT(*) AS waybillCount,
|
||||||
|
CASE WHEN COUNT(DISTINCT COALESCE(w.project_id, -1)) > 1 THEN '多个项目' ELSE MAX(w.project_name) END AS projectName,
|
||||||
COALESCE(NULLIF(w.batch_no, ''), '未分批运单') AS batchNo
|
COALESCE(NULLIF(w.batch_no, ''), '未分批运单') AS batchNo
|
||||||
FROM blade_waybill w
|
FROM blade_waybill w
|
||||||
LEFT JOIN blade_user u ON u.id = w.create_user
|
LEFT JOIN blade_user u ON u.id = w.create_user
|
||||||
WHERE w.is_deleted = 0 AND w.tenant_id = #{tenantId}
|
WHERE w.is_deleted = 0 AND w.tenant_id = #{tenantId}
|
||||||
<if test="restrictCarrier">AND w.carrier_name = #{carrierName}</if>
|
<if test="restrictCarrier">AND w.carrier_name = #{carrierName}</if>
|
||||||
<if test="batchNo != null and batchNo != ''">AND w.batch_no LIKE CONCAT('%', #{batchNo}, '%')</if>
|
<if test="batchNo != null and batchNo != ''">AND w.batch_no LIKE CONCAT('%', #{batchNo}, '%')</if>
|
||||||
|
<if test="projectId != null">AND w.project_id = #{projectId}</if>
|
||||||
<if test="createUser != null and createUser != ''">AND w.create_user = #{createUser}</if>
|
<if test="createUser != null and createUser != ''">AND w.create_user = #{createUser}</if>
|
||||||
<if test="createTimeStart != null and createTimeStart != ''">AND w.create_time <![CDATA[>=]]> #{createTimeStart}</if>
|
<if test="createTimeStart != null and createTimeStart != ''">AND w.create_time <![CDATA[>=]]> #{createTimeStart}</if>
|
||||||
<if test="createTimeEnd != null and createTimeEnd != ''">AND w.create_time <![CDATA[<=]]> #{createTimeEnd}</if>
|
<if test="createTimeEnd != null and createTimeEnd != ''">AND w.create_time <![CDATA[<=]]> #{createTimeEnd}</if>
|
||||||
|
|||||||
+1
-1
@@ -30,7 +30,7 @@ public interface IVoucherManageService extends BaseService<VoucherManage> {
|
|||||||
void processUploadedVoucher(Long voucherId);
|
void processUploadedVoucher(Long voucherId);
|
||||||
void reprocessUploadedVoucher(Long voucherId);
|
void reprocessUploadedVoucher(Long voucherId);
|
||||||
void removeVoucher(Long id);
|
void removeVoucher(Long id);
|
||||||
IPage<Map<String, Object>> selectableWaybillBatches(IPage<?> page, String batchNo, String createUser, Integer waybillCount, String createTimeStart, String createTimeEnd);
|
IPage<Map<String, Object>> selectableWaybillBatches(IPage<?> page, String batchNo, Long projectId, String createUser, Integer waybillCount, String createTimeStart, String createTimeEnd);
|
||||||
void auditPass(Long id);
|
void auditPass(Long id);
|
||||||
void auditReject(Long id, String rejectReason);
|
void auditReject(Long id, String rejectReason);
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -1331,8 +1331,8 @@ public class VoucherManageServiceImpl extends BaseServiceImpl<VoucherManageMappe
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IPage<Map<String, Object>> selectableWaybillBatches(IPage<?> page, String batchNo, String createUser, Integer waybillCount, String createTimeStart, String createTimeEnd) {
|
public IPage<Map<String, Object>> selectableWaybillBatches(IPage<?> page, String batchNo, Long projectId, String createUser, Integer waybillCount, String createTimeStart, String createTimeEnd) {
|
||||||
return voucherWaybillBatchMapper.selectVoucherWaybillBatchPage(page, AuthUtil.getTenantId(), batchNo, createUser, waybillCount, createTimeStart, createTimeEnd,
|
return voucherWaybillBatchMapper.selectVoucherWaybillBatchPage(page, AuthUtil.getTenantId(), batchNo, projectId, createUser, waybillCount, createTimeStart, createTimeEnd,
|
||||||
!TransportBusinessSupport.isAdministrator(), currentCarrierName());
|
!TransportBusinessSupport.isAdministrator(), currentCarrierName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user