Browse Source

fix: 修复我的退回列表

checkBack
Yen 1 year ago
parent
commit
76ba98a889
  1. 4
      src/main/java/com/qs/serve/modules/tbs/entity/so/VtbVerificationBatchQuery.java
  2. 24
      src/main/java/com/qs/serve/modules/vtb/controller/VtbVerificationBatchController.java
  3. 51
      src/main/resources/mapper/seeyon/CommonCheckMapper.xml
  4. 13
      src/main/resources/mapper/vtb/VtbVerificationBatchMapper.xml

4
src/main/java/com/qs/serve/modules/tbs/entity/so/VtbVerificationBatchQuery.java

@ -10,6 +10,7 @@ import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;
import java.util.List;
/**
* @author YenHex
@ -18,6 +19,7 @@ import java.time.LocalDateTime;
@Data
public class VtbVerificationBatchQuery {
private Integer loadChild;
/** 批次编码 */
private String vtbBatchCode;
@ -51,4 +53,6 @@ public class VtbVerificationBatchQuery {
/** 创建时间 */
private LocalDateTime batchEndTime;
private List<String> userIds;
}

24
src/main/java/com/qs/serve/modules/vtb/controller/VtbVerificationBatchController.java

@ -14,6 +14,7 @@ import com.qs.serve.modules.seeyon.entity.bo.CtpAddNodeParam;
import com.qs.serve.modules.seeyon.entity.dto.CtpAffairPageSo;
import com.qs.serve.modules.seeyon.service.SeeYonRequestService;
import com.qs.serve.modules.sys.entity.SysUser;
import com.qs.serve.modules.sys.service.SysPostUserService;
import com.qs.serve.modules.tbs.common.TbsSeeYonConst;
import com.qs.serve.modules.tbs.entity.TbsActivitySubjectYarn;
import com.qs.serve.modules.tbs.entity.TbsCostApply;
@ -49,6 +50,7 @@ import java.util.Map;
@RequestMapping("vtb/verificationBatch")
public class VtbVerificationBatchController {
private SysPostUserService postUserService;
private SeeYonRequestService seeYonService;
private VtbVerificationBatchService vtbVerificationBatchService;
private VtbVerificationService vtbVerificationService;
@ -81,6 +83,25 @@ public class VtbVerificationBatchController {
return R.byPageHelperList(list);
}
/**
* 翻页2(连表查询-left join tbs_cost_apply)
* @param query
* @return
*/
@GetMapping("/pageMy")
public R<PageVo<VtbVerificationBatchVo>> getPageMy(VtbVerificationBatchQuery query){
String userId = AuthContextUtils.getSysUserId();
List<String> userIds = new ArrayList<>();
if(query.getLoadChild()!=null&&query.getLoadChild().equals(1)){
userIds = postUserService.listByChildIds(userId);
query.setUserIds(userIds);
}
userIds.add(userId);
PageUtil.startPage();
List<VtbVerificationBatchVo> list = vtbVerificationBatchService.list2(query);
return R.byPageHelperList(list);
}
/**
* ID查询
* @param id
@ -89,9 +110,6 @@ public class VtbVerificationBatchController {
@GetMapping("/getById/{id}")
public R<VtbVerificationBatch> getById(@PathVariable("id") String id){
VtbVerificationBatch batch = vtbVerificationBatchService.getById(id);
if(batch.getVtbBatchStatus().equals(VtbVerificationBatch.BatchState.CHECKING)){
//TODO 补偿回调
}
List<VtbVerification> verificationList = vtbVerificationService
.list(new LambdaQueryWrapper<VtbVerification>()
.eq(VtbVerification::getBatchId,batch.getId()));

51
src/main/resources/mapper/seeyon/CommonCheckMapper.xml

@ -118,6 +118,32 @@
</if>
</if>
<if test="query.targetType == 'BatchCheckCost'">
select
'BatchCheckCost' as target_type,
vtb_verification_batch.id as target_id,
vtb_verification_batch.vtb_batch_code as target_code,
vtb_verification_batch.vtb_batch_code as title,
vtb_verification_batch.create_time as `time`
from vtb_verification_batch
where vtb_verification_batch.vtb_batch_status = 3
and vtb_verification_batch.user_id = #{query.userId}
and vtb_verification_batch.del_flag = 0
<if test="query.title !=null and query.title != ''">
and vtb_verification_batch.batch_title like concat('%',#{query.title},'%')
</if>
<if test="query.targetCode !=null and query.targetCode != ''">
and vtb_verification_batch.vtb_batch_code like concat('%',#{query.targetCode},'%')
</if>
<if test="query.startDate !=null">
and vtb_verification_batch.create_time &gt;= #{query.startDate}
</if>
<if test="query.endDate !=null">
and vtb_verification_batch.create_time &lt;= #{query.endDate}
</if>
</if>
<if test="query.targetType == null ">
select
'CostBill' as target_type,
@ -222,6 +248,29 @@
<if test="query.endDate !=null">
and budget_change.submit_time &lt;= #{query.endDate}
</if>
union
select
'BatchCheckCost' as target_type,
vtb_verification_batch.id as target_id,
vtb_verification_batch.vtb_batch_code as target_code,
vtb_verification_batch.vtb_batch_code as title,
vtb_verification_batch.create_time as `time`
from vtb_verification_batch
where vtb_verification_batch.vtb_batch_status = 3
and vtb_verification_batch.user_id = #{query.userId}
and vtb_verification_batch.del_flag = 0
<if test="query.title !=null and query.title != ''">
and vtb_verification_batch.batch_title like concat('%',#{query.title},'%')
</if>
<if test="query.targetCode !=null and query.targetCode != ''">
and vtb_verification_batch.vtb_batch_code like concat('%',#{query.targetCode},'%')
</if>
<if test="query.startDate !=null">
and vtb_verification_batch.create_time &gt;= #{query.startDate}
</if>
<if test="query.endDate !=null">
and vtb_verification_batch.create_time &lt;= #{query.endDate}
</if>
</if>
limit #{query.startRow},#{query.pageSize}
</select>
@ -397,7 +446,7 @@
and vtb_verification_batch.batch_title like concat('%',#{query.title},'%')
</if>
<if test="query.targetCode !=null and query.targetCode != ''">
and vtb_verification_batch.batch_code like concat('%',#{query.targetCode},'%')
and vtb_verification_batch.vtb_batch_code like concat('%',#{query.targetCode},'%')
</if>
<if test="query.startDate !=null">
and vtb_verification_batch.create_time &gt;= #{query.startDate}

13
src/main/resources/mapper/vtb/VtbVerificationBatchMapper.xml

@ -72,6 +72,7 @@
<include refid="vtbVerificationBatchSql"/>,
tbs_cost_apply.`code` as cost_code,
tbs_cost_apply.`charge_theme`,
tbs_cost_apply.`charge_state`,
tbs_cost_apply.`supplier_biz_region_first_name`,
tbs_cost_apply.`supplier_biz_region_second_name`,
tbs_cost_apply.`supplier_biz_region_third_name`,
@ -95,11 +96,23 @@
<if test="query.batchStartTime != null"> and `vtb_verification_batch`.`create_time` &gt;= #{query.batchStartTime}</if>
<if test="query.batchEndTime != null"> and `vtb_verification_batch`.`create_time` &lt;= #{query.batchEndTime}</if>
<if test="query.userIds!=null and query.userIds.size > 0">
and ( `vtb_verification_batch`.`user_id` in
<foreach collection="query.userIds" item="selectId" index="i" open="(" close=")" separator=",">
#{selectId}
</foreach>
or `vtb_verification_batch`.`ext_user_id` in
<foreach collection="query.userIds" item="selectId" index="i" open="(" close=")" separator=",">
#{selectId}
</foreach> )
</if>
<if test="query.costCode != null and query.costCode != ''"> and `tbs_cost_apply`.`code` like concat('%', #{query.costCode},'%')</if>
<if test="query.supplierBizRegionFirstName != null and query.supplierBizRegionFirstName != ''"> and `tbs_cost_apply`.`supplier_biz_region_first_name` like concat('%', #{query.supplierBizRegionFirstName},'%') </if>
<if test="query.supplierBizRegionSecondName != null and query.supplierBizRegionSecondName != ''"> and `tbs_cost_apply`.`supplier_biz_region_second_name` like concat('%',#{query.supplierBizRegionSecondName},'%') </if>
<if test="query.supplierBizRegionThirdName != null and query.supplierBizRegionThirdName != ''"> and `tbs_cost_apply`.`supplier_biz_region_third_name` like concat('%',#{query.supplierBizRegionThirdName},'%') </if>
</where>
order by vtb_verification_batch.id desc
</select>
</mapper>

Loading…
Cancel
Save