Browse Source

Merge remote-tracking branch 'origin/muti_db' into muti_db

checkBack
15989082884@163.com 1 year ago
parent
commit
e1a0e59a38
  1. 7
      src/main/java/com/qs/serve/common/util/HttpUtil.java
  2. 11
      src/main/java/com/qs/serve/modules/goods/controller/GoodsCustomerPriceController.java
  3. 2
      src/main/java/com/qs/serve/modules/goods/entity/dto/InventoryCusPrice.java
  4. 7
      src/main/java/com/qs/serve/modules/goods/service/GoodsCustomerPriceService.java
  5. 78
      src/main/java/com/qs/serve/modules/goods/service/impl/GoodsCustomerPriceServiceImpl.java
  6. 4
      src/main/java/com/qs/serve/modules/oms/controller/OmsOrderController.java
  7. 9
      src/main/java/com/qs/serve/modules/oms/controller/api/OmsOrderApi.java
  8. 1
      src/main/java/com/qs/serve/modules/oms/service/impl/OmsOrderServiceImpl.java
  9. 2
      src/main/java/com/qs/serve/modules/seeyon/service/impl/SeeYonRequestBaseService.java
  10. 1
      src/main/java/com/qs/serve/modules/tbs/common/TbsSeeYonConst.java
  11. 29
      src/main/java/com/qs/serve/modules/tbs/controller/TbsBudgetController.java
  12. 5
      src/main/java/com/qs/serve/modules/tbs/entity/TbsBudget.java
  13. 3
      src/main/java/com/qs/serve/modules/tbs/entity/TbsBudgetChangeScheduleItem.java
  14. 3
      src/main/java/com/qs/serve/modules/tbs/entity/bo/TbsBudgetBo.java
  15. 3
      src/main/java/com/qs/serve/modules/tbs/entity/bo/TbsBudgetStateBo.java
  16. 3
      src/main/java/com/qs/serve/modules/tbs/entity/so/TbsBudgetSo.java
  17. 58
      src/main/java/com/qs/serve/modules/tbs/entity/so/VtbVerificationBatchQuery.java
  18. 8
      src/main/java/com/qs/serve/modules/tbs/mapper/TbsBudgetMapper.java
  19. 3
      src/main/java/com/qs/serve/modules/tbs/service/TbsBudgetMatchApplication.java
  20. 256
      src/main/java/com/qs/serve/modules/tbs/service/impl/TbsBudgetBatchServiceImpl.java
  21. 2
      src/main/java/com/qs/serve/modules/tbs/service/impl/TbsBudgetChangeOperationServiceImpl.java
  22. 9
      src/main/java/com/qs/serve/modules/tbs/service/impl/TbsBudgetChangeServiceImpl.java
  23. 1
      src/main/java/com/qs/serve/modules/tbs/service/impl/TbsBudgetServiceImpl.java
  24. 25
      src/main/java/com/qs/serve/modules/tbs/service/impl/TbsCostApplyServiceImpl.java
  25. 2
      src/main/java/com/qs/serve/modules/tzc/service/impl/TzcPolicyApplicationServiceImpl.java
  26. 38
      src/main/java/com/qs/serve/modules/vtb/controller/VtbVerificationBatchController.java
  27. 3
      src/main/java/com/qs/serve/modules/vtb/entity/VtbVerificationBatch.java
  28. 51
      src/main/java/com/qs/serve/modules/vtb/entity/vo/VtbVerificationBatchVo.java
  29. 7
      src/main/java/com/qs/serve/modules/vtb/mapper/VtbVerificationBatchMapper.java
  30. 4
      src/main/java/com/qs/serve/modules/vtb/mapper/VtbVerificationMapper.java
  31. 4
      src/main/java/com/qs/serve/modules/vtb/service/VtbVerificationBatchService.java
  32. 8
      src/main/java/com/qs/serve/modules/vtb/service/impl/VtbVerificationBatchOperationServiceImpl.java
  33. 8
      src/main/java/com/qs/serve/modules/vtb/service/impl/VtbVerificationBatchServiceImpl.java
  34. 15
      src/main/java/com/qs/serve/modules/vtb/service/impl/VtbVerificationServiceImpl.java
  35. 8
      src/main/resources/mapper/goods/GoodsSpuMapper.xml
  36. 51
      src/main/resources/mapper/seeyon/CommonCheckMapper.xml
  37. 1
      src/main/resources/mapper/tbs/TbsBudgetMapper.xml
  38. 118
      src/main/resources/mapper/vtb/VtbVerificationBatchMapper.xml

7
src/main/java/com/qs/serve/common/util/HttpUtil.java

@ -8,6 +8,7 @@ import org.apache.http.HttpEntity;
import org.apache.http.ParseException;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
@ -54,6 +55,12 @@ public class HttpUtil {
post.addHeader(key,headers.get(key));
}
}
post.setConfig(
RequestConfig.custom()
//连接超时60秒
.setConnectTimeout(60*1000)
.build()
);
//执行post请求
response = client.execute(post);
//访问成功状态码为200

11
src/main/java/com/qs/serve/modules/goods/controller/GoodsCustomerPriceController.java

@ -115,5 +115,16 @@ public class GoodsCustomerPriceController {
return R.isTrue(result);
}
/**
* 同步客户特殊价
* @return
*/
@GetMapping("/sync")
public R<GoodsCustomerPrice> syncCusInvPrice(){
goodsCustomerPriceService.syncCustomerPrice();
return R.ok();
}
}

2
src/main/java/com/qs/serve/modules/goods/entity/dto/InventoryCusPrice.java

@ -13,6 +13,8 @@ import java.util.Date;
@Data
public class InventoryCusPrice {
private Long rowId;
private String cusCode;
private String invCode;

7
src/main/java/com/qs/serve/modules/goods/service/GoodsCustomerPriceService.java

@ -24,7 +24,14 @@ public interface GoodsCustomerPriceService extends IService<GoodsCustomerPrice>
GoodsCustomerPrice getBySupplierIdAndCode(String supplierId,String skuCode);
GoodsCustomerPrice getByCusCodeAndSkuCode(String supplierCode,String skuCode);
List<GoodsCustomerPrice> getBySupplierCodeAndCode(String supplierCode, List<String> skuCode);
/**
* 同步客户特殊价
*/
void syncCustomerPrice();
}

78
src/main/java/com/qs/serve/modules/goods/service/impl/GoodsCustomerPriceServiceImpl.java

@ -2,16 +2,24 @@ package com.qs.serve.modules.goods.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qs.serve.common.model.dto.R;
import com.qs.serve.common.util.Assert;
import com.qs.serve.common.util.AuthContextUtils;
import com.qs.serve.common.util.JsonUtil;
import com.qs.serve.modules.bms.entity.BmsSupplier;
import com.qs.serve.modules.bms.mapper.BmsSupplierMapper;
import com.qs.serve.modules.goods.entity.GoodsSku;
import com.qs.serve.modules.goods.entity.bo.GoodsCustomerPriceBo;
import com.qs.serve.modules.goods.entity.bo.GoodsCustomerPriceSingleBo;
import com.qs.serve.modules.goods.entity.dto.InventoryCusPrice;
import com.qs.serve.modules.goods.mapper.GoodsSkuMapper;
import com.qs.serve.modules.seeyon.service.SeeYonRequestService;
import com.qs.serve.modules.seeyon.service.impl.SeeYonRequestBaseService;
import com.qs.serve.modules.sys.entity.SysDictData;
import com.qs.serve.modules.sys.entity.SysUser;
import com.qs.serve.modules.sys.mapper.SysDictDataMapper;
import com.qs.serve.modules.sys.mapper.SysUserMapper;
import com.qs.serve.modules.tbs.common.TbsSeeYonConst;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@ -34,9 +42,11 @@ import java.util.stream.Collectors;
@AllArgsConstructor
public class GoodsCustomerPriceServiceImpl extends ServiceImpl<GoodsCustomerPriceMapper,GoodsCustomerPrice> implements GoodsCustomerPriceService {
private final SysDictDataMapper sysDictDataMapper;
private final BmsSupplierMapper bmsSupplierMapper;
private final GoodsSkuMapper goodsSkuMapper;
private final SysUserMapper sysUserMapper;
private final SeeYonRequestBaseService seeYonRequestBaseService;
@Override
public List<GoodsCustomerPrice> selectGoodsCustomerPriceList(GoodsCustomerPrice query) {
@ -125,6 +135,14 @@ public class GoodsCustomerPriceServiceImpl extends ServiceImpl<GoodsCustomerPric
return this.getOne(lqw,false);
}
@Override
public GoodsCustomerPrice getByCusCodeAndSkuCode(String supplierCode, String skuCode) {
LambdaQueryWrapper<GoodsCustomerPrice> lqw = new LambdaQueryWrapper<>();
lqw.eq(GoodsCustomerPrice::getSupplierCode,supplierCode)
.eq(GoodsCustomerPrice::getSkuCode,skuCode);
return this.getOne(lqw,false);
}
@Override
public List<GoodsCustomerPrice> getBySupplierCodeAndCode(String supplierCode, List<String> skuCodes) {
LambdaQueryWrapper<GoodsCustomerPrice> lqw = new LambdaQueryWrapper<>();
@ -133,5 +151,65 @@ public class GoodsCustomerPriceServiceImpl extends ServiceImpl<GoodsCustomerPric
return this.list(lqw);
}
@Override
public void syncCustomerPrice() {
final String DICT_KEY = "sync-customer-price-max-id";
SysDictData dictData = sysDictDataMapper
.selectOne(new LambdaQueryWrapper<SysDictData>()
.eq(SysDictData::getGroupKey,DICT_KEY));
Long maxId = 0L;
if(dictData!=null&&dictData.getKeyVal()!=null){
maxId = Long.parseLong(dictData.getKeyVal());
}
List<InventoryCusPrice> cusPriceList = new ArrayList<>();
R<String> res = seeYonRequestBaseService.postBase(TbsSeeYonConst.ERP_CUS_INV_LAST_UPD+"/"+maxId,null,"查询最近更新的客户特殊价");
if(res.getStatus().equals(200)){
cusPriceList = JsonUtil.jsonToList(res.getData(), InventoryCusPrice.class);
}
assert cusPriceList != null;
for (InventoryCusPrice cusPrice : cusPriceList) {
if(maxId==null || cusPrice.getRowId() > maxId){
maxId = cusPrice.getRowId();
}
GoodsCustomerPrice customerPrice = this.getByCusCodeAndSkuCode(cusPrice.getCusCode(),cusPrice.getInvCode());
if(customerPrice==null){
GoodsSku goodsSku = goodsSkuMapper.selectBySkuCode(cusPrice.getInvCode());
BmsSupplier supplier = bmsSupplierMapper.selectOne(new LambdaQueryWrapper<BmsSupplier>()
.eq(BmsSupplier::getCode,cusPrice.getCusCode()));
customerPrice = new GoodsCustomerPrice();
customerPrice.setSupplierId(supplier.getId());
customerPrice.setSupplierCode(supplier.getCode());
customerPrice.setSupplierName(supplier.getName());
customerPrice.setSkuId(goodsSku.getId()+"");
customerPrice.setSkuCode(goodsSku.getSkuCode());
customerPrice.setSkuName(goodsSku.getSkuName());
customerPrice.setSkuUnit(goodsSku.getUnitName());
customerPrice.setInitPrice(cusPrice.getPrice());
customerPrice.setRealPrice(cusPrice.getPrice());
this.save(customerPrice);
}else {
customerPrice.setRealPrice(cusPrice.getPrice());
this.updateById(customerPrice);
}
}
if(maxId!=0){
if(dictData==null){
dictData = new SysDictData();
dictData.setDictId(0L);
dictData.setGroupKey(DICT_KEY);
dictData.setKeyVal(maxId+"");
dictData.setLabel("同步客户特殊价最大值ID");
dictData.setSort(0);
dictData.setRemark("同步客户特殊价最大值ID");
sysDictDataMapper.insert(dictData);
}else {
dictData.setKeyVal(maxId+"");
sysDictDataMapper.updateById(dictData);
}
}
}
}

4
src/main/java/com/qs/serve/modules/oms/controller/OmsOrderController.java

@ -76,9 +76,9 @@ public class OmsOrderController {
Set<String> userIds = list.stream().map(OmsOrder::getCheckUserId).collect(Collectors.toSet());
List<SysUser> userList = sysUserService.listByIds(userIds);
Set<Long> orderIds = list.stream().map(OmsOrder::getId).collect(Collectors.toSet());
List<OmsOrderItem> orderItems = omsOrderItemService.list(new LambdaQueryWrapper<OmsOrderItem>().eq(OmsOrderItem::getOrderId,orderIds));
orderIds.add(0L);
List<OmsOrderItem> orderItems = omsOrderItemService.list(new LambdaQueryWrapper<OmsOrderItem>().in(OmsOrderItem::getOrderId,orderIds));
Map<Long,List<OmsOrderItem>> orderItemsMap = orderItems.stream().collect(Collectors.groupingBy(OmsOrderItem::getOrderId));
for (OmsOrder order : list) {
BmsSupplierAddress supplierAddress = null;

9
src/main/java/com/qs/serve/modules/oms/controller/api/OmsOrderApi.java

@ -142,9 +142,7 @@ public class OmsOrderApi {
PageUtil.startPage();
LambdaQueryWrapper<OmsOrder> orderWrapper = new LambdaQueryWrapper<>(param);
List<OmsOrder> list = omsOrderService.list(orderWrapper);
for (OmsOrder omsOrder : list) {
omsOrderService.checkMsOrderStatus(omsOrder);
}
this.buildOrderVoInfo(list);
return R.byPageHelperList(list);
}
@ -161,7 +159,11 @@ public class OmsOrderApi {
orderWrapper.eq(OmsOrder::getOrderType,param.getOrderType()==null?0:param.getOrderType());
orderWrapper.orderByDesc(OmsOrder::getId);
List<OmsOrder> list = omsOrderService.list(orderWrapper);
this.buildOrderVoInfo(list);
return R.byPageHelperList(list);
}
private void buildOrderVoInfo(List<OmsOrder> list) {
List<String> userIds = list.stream().map(OmsOrder::getCheckUserId).collect(Collectors.toList());
List<SysUser> sysUserList = new ArrayList<>();
if(userIds.size()>0){
@ -198,7 +200,6 @@ public class OmsOrderApi {
order.setOrderItems(itemsMap.get(order.getId()));
}
return R.byPageHelperList(list);
}
/**

1
src/main/java/com/qs/serve/modules/oms/service/impl/OmsOrderServiceImpl.java

@ -553,6 +553,7 @@ public class OmsOrderServiceImpl extends ServiceImpl<OmsOrderMapper, OmsOrder> i
order.setBrandRuleName(categoryRule.getLabel());
}
order.setOrderSource(confirmOrder.getOrderSource());
order.setCdOrderRemark(createOrderParam.getCdOrderRemark());
order.setOrderType(confirmOrder.getOrderType());
order.setSupplierId(Long.parseLong(supplier.getId()));

2
src/main/java/com/qs/serve/modules/seeyon/service/impl/SeeYonRequestBaseService.java

@ -48,7 +48,7 @@ public class SeeYonRequestBaseService {
if(result.getStatus()!=200){
log.error("致远服务失败[{},{}]\nParam:{}",title,result.getMsg(),JsonUtil.objectToJson(param));
}
log.debug("致远服务返回R<String>:{}",JsonUtil.objectToJson(result));
log.info("致远服务返回R<String>:{}",JsonUtil.objectToJson(result));
return result;
}

1
src/main/java/com/qs/serve/modules/tbs/common/TbsSeeYonConst.java

@ -105,6 +105,7 @@ public interface TbsSeeYonConst {
String ERP_CUS_AMOUNT = "/erp/customer/amount";
String ERP_CUS_AMOUNT_QUO = "/erp/customer/quoAmount";
String ERP_CUS_INV_PRICE = "/erp/inventory/invPrices";
String ERP_CUS_INV_LAST_UPD = "/erp/inventory/lastUpdateCusInvPrices";
String ERP_CUS_INV_STAND = "/erp/inventory/standList";
String ERP_CUS_INV_SYNC_PRICE = "/erp/inventory/syncPrice";
String ERP_CUS_INV_SPECIAL = "/erp/inventory/specialSyncCrm";

29
src/main/java/com/qs/serve/modules/tbs/controller/TbsBudgetController.java

@ -1,6 +1,7 @@
package com.qs.serve.modules.tbs.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.qs.serve.common.model.annotation.SysLog;
import com.qs.serve.common.model.enums.BudgetLogOptFlag;
import com.qs.serve.common.model.dto.PageVo;
@ -166,6 +167,12 @@ public class TbsBudgetController {
List<TbsBudgetVo> voList = new ArrayList<>();
for (TbsBudget budget : list) {
TbsBudgetVo budgetVo = tbsBudgetService.toVoEntity(budget);
if(budgetVo.getBudgetCheckState().equals(TbsCommonCheckState.State_2_finished)){
long count = tbsBudgetMapper.countLastChange(budgetVo.getId());
if(count>0){
budgetVo.setBudgetCheckState(TbsCommonCheckState.State_1_apply);
}
}
voList.add(budgetVo);
}
return R.byPageHelperList(list,voList);
@ -217,6 +224,19 @@ public class TbsBudgetController {
return R.ok();
}
/**
* 更新预算的不运作状态
* @param param
* @return
*/
@PostMapping("/updateInactiveFlag")
@SysLog(module = SystemModule.Budget, title = "预算不运作状态", biz = BizType.UPDATE)
public R<?> updateInactiveFlag(@RequestBody @Valid TbsBudgetStateBo param){
tbsBudgetService.update(new LambdaUpdateWrapper<TbsBudget>()
.set(TbsBudget::getInactiveFlag,param.getInactiveFlag())
.eq(TbsBudget::getId,param.getId()));
return R.ok();
}
/**
* 更新跨年状态
@ -436,6 +456,15 @@ public class TbsBudgetController {
if(tbsBudgetCostItemService.count(lqw)>0){
return R.error("预算已被使用");
}
long countUnPub = tbsBudgetService.count(
new LambdaQueryWrapper<TbsBudget>()
.in(TbsBudget::getId,idsLong)
.eq(TbsBudget::getBudgetState,0)
.eq(TbsBudget::getBudgetCheckState,TbsCommonCheckState.State_0_unPublish)
);
if(countUnPub>0){
return R.error("预算状态不支持删除");
}
boolean result = tbsBudgetService.removeByIds(idsLong);
//移除考核期预算
LambdaQueryWrapper<TbsScheduleItemBudget> rmItemBudget = new LambdaQueryWrapper<>();

5
src/main/java/com/qs/serve/modules/tbs/entity/TbsBudget.java

@ -43,7 +43,10 @@ public class TbsBudget implements Serializable {
/** 费用启用状态 0/1 */
private Integer budgetState;
/** 停用状态 0/1 */
/** 不活动的 0/1 用于随意关停预算 */
private Integer inactiveFlag;
/** 停用状态 0/1 用于标记跨年停用预算 */
private Integer stopFlag;
/** 是否允许跨年,控制停用状态 */

3
src/main/java/com/qs/serve/modules/tbs/entity/TbsBudgetChangeScheduleItem.java

@ -34,6 +34,9 @@ public class TbsBudgetChangeScheduleItem implements Serializable {
/** 更变记录id */
private Long changeId;
/** 和原来记录做对比,判断是否更变 */
private Integer changeFlag;
/** TbsScheduleItemBudget.id */
private Long sourceId;

3
src/main/java/com/qs/serve/modules/tbs/entity/bo/TbsBudgetBo.java

@ -41,6 +41,9 @@ public class TbsBudgetBo implements Serializable {
/** 是否允许跨年,控制停用状态 */
private Integer crossYearFlag;
/** 不活动的 0/1 */
private Integer inactiveFlag;
/**
* 成本中心类型
center,

3
src/main/java/com/qs/serve/modules/tbs/entity/bo/TbsBudgetStateBo.java

@ -22,4 +22,7 @@ public class TbsBudgetStateBo {
/** 是否允许跨年,控制停用状态 */
private Integer crossYearFlag;
/** 是否允许跨年,控制停用状态 */
private Integer inactiveFlag;
}

3
src/main/java/com/qs/serve/modules/tbs/entity/so/TbsBudgetSo.java

@ -31,6 +31,9 @@ public class TbsBudgetSo implements Serializable {
/** 停用状态 0/1 */
private Integer stopFlag;
/** 不活动的 0/1 */
private Integer inactiveFlag;
/** 是否允许跨年,控制停用状态 */
private Integer crossYearFlag;

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

@ -0,0 +1,58 @@
package com.qs.serve.modules.tbs.entity.so;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
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
* @since 2024/7/3
*/
@Data
public class VtbVerificationBatchQuery {
private Integer loadChild;
/** 批次编码 */
private String vtbBatchCode;
/** 状态:0-审批中;1-通过;2-拒绝;3-回退 */
private Integer vtbBatchStatus;
private String costCode;
/** 客户编码 */
private String supplierCode;
/** 客户名称 */
private String supplierName;
private String supplierBizRegionFirstName;
private String supplierBizRegionSecondName;
private String supplierBizRegionThirdName;
/** 申请人 */
private String userCode;
/** 申请人 */
private String userName;
/** 创建时间 */
private LocalDateTime batchStartTime;
/** 创建时间 */
private LocalDateTime batchEndTime;
private List<String> userIds;
}

8
src/main/java/com/qs/serve/modules/tbs/mapper/TbsBudgetMapper.java

@ -45,6 +45,14 @@ public interface TbsBudgetMapper extends BaseMapper<TbsBudget> {
@Update("update tbs_budget set center_combo = concat(center_type,'_',center_id) where id = #{budgetId}")
int updateBudgetComboCenter(@Param("budgetId")Long budgetId);
/**
* 查询最新的审批申请是否在审批中
* @param budgetId
* @return
*/
@Select("select count(1) from tbs_budget_change where budget_id = #{budgetId} and id = ( " +
" select max(id) from tbs_budget_change where budget_id = #{budgetId} and del_flag=0 ) and budget_check_state = 1")
long countLastChange(@Param("budgetId")Long budgetId);
@InterceptorIgnore(tenantLine = "true")
@Select("select tbs_budget.id from tbs_budget " +

3
src/main/java/com/qs/serve/modules/tbs/service/TbsBudgetMatchApplication.java

@ -98,7 +98,8 @@ public class TbsBudgetMatchApplication {
//不是回退和异动,需要过滤停用条件
if(!costApply.getChargeState().equals(TbsCostApplyState.State_4_refused.getCode())&&
!costApply.getChargeState().equals(TbsCostApplyState.State_7_changed.getCode())){
if(budget.getStopFlag().equals(1)){
//跨年和不运作状态时跳过
if(budget.getStopFlag().equals(1)||budget.getInactiveFlag().equals(1)){
continue;
}
}

256
src/main/java/com/qs/serve/modules/tbs/service/impl/TbsBudgetBatchServiceImpl.java

@ -279,7 +279,6 @@ public class TbsBudgetBatchServiceImpl extends ServiceImpl<TbsBudgetBatchMapper,
batchItem.setUserName(sysUser.getName());
batchItem.setRemark(paramItem.getRemark());
batchItems.add(batchItem);
}else {
//修改后为新增类型提交
this.toUpdateBudgetInfo(batchId,sysUser, scheduleMap, subjectMap, centerDtoMap, categoryMap, paramItem, budgetId);
@ -329,7 +328,9 @@ public class TbsBudgetBatchServiceImpl extends ServiceImpl<TbsBudgetBatchMapper,
return budgetBatch;
}
private void toUpdateBudgetInfo(Long batchId,SysUser sysUser, Map<String, TbsSchedule> scheduleMap, Map<String, BmsSubject> subjectMap, Map<String, TbsCenterDto> centerDtoMap, Map<String, GoodsCategory> categoryMap, TbsBudgetBatchBo.BudgetMain paramItem, Long budgetId) {
private void toUpdateBudgetInfo(Long batchId,SysUser sysUser, Map<String, TbsSchedule> scheduleMap,
Map<String, BmsSubject> subjectMap, Map<String, TbsCenterDto> centerDtoMap,
Map<String, GoodsCategory> categoryMap, TbsBudgetBatchBo.BudgetMain paramItem, Long budgetId) {
//tbsBudgetService.removeById(budgetId);
tbsBudgetConditionService.remove(
new LambdaQueryWrapper<TbsBudgetCondition>()
@ -363,19 +364,19 @@ public class TbsBudgetBatchServiceImpl extends ServiceImpl<TbsBudgetBatchMapper,
private void toSaveChangeCondition(Map<String, GoodsCategory> categoryMap, TbsBudget budget, TbsBudgetBatchBo.BudgetMain paramItem, Long budgetId, Long changeId) {
if(budget.getConditionFlag().equals(1)){
List<TbsBudgetCondition> existingConditionList = tbsBudgetConditionService
.list(new LambdaQueryWrapper<TbsBudgetCondition>()
.eq(TbsBudgetCondition::getBudgetId, budgetId));
// List<TbsBudgetCondition> existingConditionList = tbsBudgetConditionService
// .list(new LambdaQueryWrapper<TbsBudgetCondition>()
// .eq(TbsBudgetCondition::getBudgetId, budgetId));
String bandNames = paramItem.getBrandNames();
String categoryNames = paramItem.getCategoryNames();
String seriesNames = paramItem.getSeriesNames();
//设置changeConditionList参数
List<TbsBudgetChangeCondition> changeConditionList = new ArrayList<>();
this.buildChangeConditionList(categoryMap, budgetId, changeId, changeConditionList, existingConditionList,
this.buildChangeConditionList(categoryMap, budgetId, changeId, changeConditionList, null,
bandNames, TbsGoodsType.brand.name());
this.buildChangeConditionList(categoryMap, budgetId, changeId, changeConditionList, existingConditionList,
this.buildChangeConditionList(categoryMap, budgetId, changeId, changeConditionList, null,
categoryNames, TbsGoodsType.category.name());
this.buildChangeConditionList(categoryMap, budgetId, changeId, changeConditionList, existingConditionList,
this.buildChangeConditionList(categoryMap, budgetId, changeId, changeConditionList, null,
seriesNames, TbsGoodsType.series.name());
if(CollUtil.isNotEmpty(changeConditionList)){
tbsBudgetChangeConditionService.saveBatch(changeConditionList);
@ -407,18 +408,17 @@ public class TbsBudgetBatchServiceImpl extends ServiceImpl<TbsBudgetBatchMapper,
if(budgetAmount.getScheduleItemName().equals(itemBudget.getItemName())){
boolean ne1 = ! (itemBudget.getPreDispatchAmount().compareTo(budgetAmount.getPreDispatchAmount())==0);
boolean ne2 = ! (realAmt.compareTo(budgetAmount.getBudgetAmount())==0);
if(ne1 || ne2){
TbsBudgetChangeScheduleItem resultItem = TbsBudgetChangeScheduleItem.toNewObject(itemBudget);
resultItem.setChangeId(changeId);
resultItem.setBudgetAmount(realAmt);
resultItem.setNewBudgetAmount(budgetAmount.getBudgetAmount());
resultItem.setNewPreDispatchAmount(budgetAmount.getPreDispatchAmount());
resultItem.setCategoryNames(paramItem.getCategoryNames());
resultItem.setBrandNames(paramItem.getBrandNames());
resultItem.setSeriesNames(paramItem.getSeriesNames());
resultItem.setRemark(paramItem.getRemark());
changeScheduleItemList.add(resultItem);
}
TbsBudgetChangeScheduleItem resultItem = TbsBudgetChangeScheduleItem.toNewObject(itemBudget);
resultItem.setChangeId(changeId);
resultItem.setBudgetAmount(realAmt);
resultItem.setChangeFlag((ne1 || ne2)?1:0);
resultItem.setNewBudgetAmount(budgetAmount.getBudgetAmount());
resultItem.setNewPreDispatchAmount(budgetAmount.getPreDispatchAmount());
resultItem.setCategoryNames(paramItem.getCategoryNames());
resultItem.setBrandNames(paramItem.getBrandNames());
resultItem.setSeriesNames(paramItem.getSeriesNames());
resultItem.setRemark(paramItem.getRemark());
changeScheduleItemList.add(resultItem);
}
}
}
@ -428,23 +428,18 @@ public class TbsBudgetBatchServiceImpl extends ServiceImpl<TbsBudgetBatchMapper,
if(StringUtils.hasText(values)){
String[] valueArr = values.replace(",",",").split(",");
for (String val : valueArr) {
boolean exist = existingConditionList.stream().anyMatch(
a->a.getTargetName().equals(val)||a.getTargetCode().equals(val)
);
if(!exist){
GoodsCategory goodsCategory = categoryMap.get(val);
if(goodsCategory!=null){
TbsBudgetChangeCondition budgetChangeCondition = new TbsBudgetChangeCondition();
budgetChangeCondition.setChangeId(changeId);
budgetChangeCondition.setBudgetId(budgetId);
budgetChangeCondition.setTargetType(targetType);
budgetChangeCondition.setTargetId(goodsCategory.getId());
budgetChangeCondition.setTargetCode(goodsCategory.getCode());
budgetChangeCondition.setTargetName(goodsCategory.getName());
budgetChangeCondition.setTargetLevelPathIds(goodsCategory.getLevelPath());
budgetChangeCondition.setTargetLevelPathNames(goodsCategory.getLevelPathNames());
changeConditionList.add(budgetChangeCondition);
}
GoodsCategory goodsCategory = categoryMap.get(targetType+"_"+val);
if(goodsCategory!=null){
TbsBudgetChangeCondition budgetChangeCondition = new TbsBudgetChangeCondition();
budgetChangeCondition.setChangeId(changeId);
budgetChangeCondition.setBudgetId(budgetId);
budgetChangeCondition.setTargetType(targetType);
budgetChangeCondition.setTargetId(goodsCategory.getId());
budgetChangeCondition.setTargetCode(goodsCategory.getCode());
budgetChangeCondition.setTargetName(goodsCategory.getName());
budgetChangeCondition.setTargetLevelPathIds(goodsCategory.getLevelPath());
budgetChangeCondition.setTargetLevelPathNames(goodsCategory.getLevelPathNames());
changeConditionList.add(budgetChangeCondition);
}
}
}
@ -456,7 +451,7 @@ public class TbsBudgetBatchServiceImpl extends ServiceImpl<TbsBudgetBatchMapper,
if(StringUtils.hasText(paramItem.getBrandNames())){
String[] values = paramItem.getBrandNames().split(",");
for (String value : values) {
GoodsCategory category = categoryMap.get(value);
GoodsCategory category = categoryMap.get(TbsGoodsType.brand.name()+"_"+value);
TbsBudgetCondition budgetCondition = new TbsBudgetCondition();
budgetCondition.setBudgetId(budgetId);
budgetCondition.setTargetType(TbsGoodsType.brand.name());
@ -471,7 +466,7 @@ public class TbsBudgetBatchServiceImpl extends ServiceImpl<TbsBudgetBatchMapper,
if(StringUtils.hasText(paramItem.getCategoryNames())){
String[] values = paramItem.getCategoryNames().split(",");
for (String value : values) {
GoodsCategory category = categoryMap.get(value);
GoodsCategory category = categoryMap.get(TbsGoodsType.category.name()+"_"+value);
TbsBudgetCondition budgetCondition = new TbsBudgetCondition();
budgetCondition.setBudgetId(budgetId);
budgetCondition.setTargetType(TbsGoodsType.category.name());
@ -486,7 +481,7 @@ public class TbsBudgetBatchServiceImpl extends ServiceImpl<TbsBudgetBatchMapper,
if(StringUtils.hasText(paramItem.getSeriesNames())){
String[] values = paramItem.getSeriesNames().split(",");
for (String value : values) {
GoodsCategory category = categoryMap.get(value);
GoodsCategory category = categoryMap.get(TbsGoodsType.series.name()+"_"+value);
TbsBudgetCondition budgetCondition = new TbsBudgetCondition();
budgetCondition.setBudgetId(budgetId);
budgetCondition.setTargetType(TbsGoodsType.series.name());
@ -567,120 +562,121 @@ public class TbsBudgetBatchServiceImpl extends ServiceImpl<TbsBudgetBatchMapper,
*/
private Map<String,GoodsCategory> loadGoodsCategoryMap(TbsBudgetBatchBo param) {
List<TbsBudgetBatchBo.BudgetMain> paramBudgetList = param.getBudgetList();
Set<String> goodsCategoryNames = new HashSet<>();
//初始化三个维度的品类
List<String> allBandNameList = new ArrayList<>(),
allCategoryNameList = new ArrayList<>(),
allSeriesNameList = new ArrayList<>();
for (TbsBudgetBatchBo.BudgetMain budgetMain : paramBudgetList) {
String bandNames = budgetMain.getBrandNames();
String categoryNames = budgetMain.getCategoryNames();
String seriesNames = budgetMain.getSeriesNames();
initCategorySet(goodsCategoryNames, bandNames);
initCategorySet(goodsCategoryNames, categoryNames);
initCategorySet(goodsCategoryNames, seriesNames);
allBandNameList.addAll(initCategorySet(bandNames));
allCategoryNameList.addAll(initCategorySet(categoryNames));
allSeriesNameList.addAll(initCategorySet(seriesNames));
}
if(goodsCategoryNames.size()<1){
if(CollUtil.isEmpty(allBandNameList)
&& CollUtil.isEmpty(allCategoryNameList)
&& CollUtil.isEmpty(allSeriesNameList)){
return new HashMap<>();
}
List<GoodsCategory> goodsCategories = goodsCategoryService.list(
new LambdaQueryWrapper<GoodsCategory>()
.in(GoodsCategory::getName,goodsCategoryNames)
.or()
.in(GoodsCategory::getCode,goodsCategoryNames)
);
if(goodsCategories.size()!= goodsCategoryNames.size()){
for (String categoryName : goodsCategoryNames) {
List<GoodsCategory> tempList = goodsCategories.stream()
.filter(a->a.getName().equals(categoryName)).collect(Collectors.toList());
if(tempList.size()<1){
for (TbsBudgetBatchBo.BudgetMain budgetMain : paramBudgetList) {
boolean bandNamesFlag = budgetMain.getBrandNames() != null && budgetMain.getBrandNames().contains(categoryName);
boolean categoryNamesFlag = budgetMain.getCategoryNames() != null && budgetMain.getCategoryNames().contains(categoryName);
boolean seriesNamesFlag = budgetMain.getSeriesNames() != null && budgetMain.getSeriesNames().contains(categoryName);
if(bandNamesFlag){
budgetMain.getErrorInfos().add("无效的品牌:"+categoryName);
param.setErrorFlag(true);
break;
}
if(categoryNamesFlag){
budgetMain.getErrorInfos().add("无效的品类:"+categoryName);
param.setErrorFlag(true);
break;
}
if(seriesNamesFlag){
budgetMain.getErrorInfos().add("无效的系列:"+categoryName);
param.setErrorFlag(true);
break;
}
}
//查询类目
List<GoodsCategory> bandList = this.queryCategory(1,allBandNameList);
List<GoodsCategory> categoryList = this.queryCategory(2,allCategoryNameList);
List<GoodsCategory> seriesList = this.queryCategory(3,allSeriesNameList);
for (TbsBudgetBatchBo.BudgetMain budgetMain : paramBudgetList) {
String bandNames = budgetMain.getBrandNames();
String categoryNames = budgetMain.getCategoryNames();
String seriesNames = budgetMain.getSeriesNames();
List<String> bandNameItemList = initCategorySet(bandNames);
List<String> categoryNameItemList = initCategorySet(categoryNames);
List<String> seriesNameItemList = initCategorySet(seriesNames);
checkMchError(1,param, budgetMain,bandList, bandNameItemList);
checkMchError(2,param, budgetMain,categoryList, categoryNameItemList);
checkMchError(3,param, budgetMain,seriesList, seriesNameItemList);
}
Map<String,GoodsCategory> categoryMap = new HashMap<>();
for (GoodsCategory category : bandList) {
categoryMap.put(TbsGoodsType.brand.name()+"_"+category.getName(),category);
}
for (GoodsCategory category : categoryList) {
categoryMap.put(TbsGoodsType.category.name()+"_"+category.getName(),category);
}
for (GoodsCategory category : seriesList) {
categoryMap.put(TbsGoodsType.series.name()+"_"+category.getName(),category);
}
return categoryMap;
}
/**
* 校验查询结果
* @param level
* @param param
* @param budgetMain
* @param bandList
* @param cateNames
*/
private void checkMchError(int level,TbsBudgetBatchBo param,
TbsBudgetBatchBo.BudgetMain budgetMain,
List<GoodsCategory> bandList,
List<String> cateNames) {
for (String name : cateNames) {
boolean mch = false;
for (GoodsCategory category : bandList) {
if(name.equals(category.getName())){
mch = true;
break;
}
}
}else{
for (String categoryName : goodsCategoryNames) {
List<GoodsCategory> tempList = goodsCategories.stream()
.filter(a->a.getName().equals(categoryName)).collect(Collectors.toList());
for (TbsBudgetBatchBo.BudgetMain budgetMain : paramBudgetList) {
boolean bandNamesFlag = budgetMain.getBrandNames() != null && budgetMain.getBrandNames().contains(categoryName);
boolean categoryNamesFlag = budgetMain.getCategoryNames() != null && budgetMain.getCategoryNames().contains(categoryName);
boolean seriesNamesFlag = budgetMain.getSeriesNames() != null && budgetMain.getSeriesNames().contains(categoryName);
if(bandNamesFlag){
boolean isTrue = false;
for (GoodsCategory category : tempList) {
if(category.getLevel().equals(1)){
isTrue = true;
break;
}
}
if(!isTrue){
budgetMain.getErrorInfos().add("无效的品牌:"+categoryName);
param.setErrorFlag(true);
}
}
if(categoryNamesFlag){
boolean isTrue = false;
for (GoodsCategory category : tempList) {
if(category.getLevel().equals(2)){
isTrue = true;
break;
}
}
if(!isTrue){
budgetMain.getErrorInfos().add("无效的品类:"+categoryName);
param.setErrorFlag(true);
}
}
if(seriesNamesFlag){
boolean isTrue = false;
for (GoodsCategory category : tempList) {
if(category.getLevel().equals(3)){
isTrue = true;
break;
}
}
if(!isTrue){
budgetMain.getErrorInfos().add("无效的系列:"+categoryName);
param.setErrorFlag(true);
}
}
if(!mch){
if(level==1){
budgetMain.getErrorInfos().add("无效的品牌:"+name);
}else if (level==2){
budgetMain.getErrorInfos().add("无效的品类:"+name);
}else {
budgetMain.getErrorInfos().add("无效的系列:"+name);
}
param.setErrorFlag(true);
}
}
Map<String,GoodsCategory> categoryMap = new HashMap<>(goodsCategories.size());
for (GoodsCategory category : goodsCategories) {
categoryMap.put(category.getName(),category);
}
/**
* 查询品类
* @param level 等级1-品牌 2-类目 3-系列
* @param nameOrCodes
* @return
*/
private List<GoodsCategory> queryCategory(int level,List<String> nameOrCodes) {
if(CollUtil.isEmpty(nameOrCodes)){
return new ArrayList<>();
}
return categoryMap;
List<GoodsCategory> list = goodsCategoryService.list(
new LambdaQueryWrapper<GoodsCategory>()
.eq(GoodsCategory::getLevel,level)
.and(cn->{
cn.in(GoodsCategory::getName,nameOrCodes)
.or()
.in(GoodsCategory::getCode,nameOrCodes);
})
);
return list;
}
/**
* 初始化set
* @param goodsCategories
* @param categoryString
*/
private void initCategorySet(Set<String> goodsCategories, String categoryString) {
private List<String> initCategorySet(String categoryString) {
if(StringUtils.hasText(categoryString)){
String[] values = categoryString
.replace(",",",")
.split(",");
goodsCategories.addAll(Arrays.asList(values));
return Arrays.asList(values);
}
return new ArrayList<>();
}
private Map<String,TbsSchedule> loadScheduleMap(List<String> scheduleNames,TbsBudgetBatchBo param) {

2
src/main/java/com/qs/serve/modules/tbs/service/impl/TbsBudgetChangeOperationServiceImpl.java

@ -130,6 +130,8 @@ public class TbsBudgetChangeOperationServiceImpl implements SeeYonOperationServi
}
//更新金额
List<TbsBudgetChangeScheduleItem> changeScheduleItemList = tbsBudgetChangeScheduleItemService.listByChangeId(budgetChange.getId());
//过滤更变金额
changeScheduleItemList = changeScheduleItemList.stream().filter(a->a.getChangeFlag().equals(1)).collect(Collectors.toList());
if(CollectionUtil.isNotEmpty(changeScheduleItemList)){
List<Long> scheduleItemBudgetIds = changeScheduleItemList.stream().map(TbsBudgetChangeScheduleItem::getSourceId).collect(Collectors.toList());
List<TbsScheduleItemBudget> scheduleItemBudgetList = tbsScheduleItemBudgetService.listByIds(scheduleItemBudgetIds);

9
src/main/java/com/qs/serve/modules/tbs/service/impl/TbsBudgetChangeServiceImpl.java

@ -270,16 +270,21 @@ public class TbsBudgetChangeServiceImpl extends ServiceImpl<TbsBudgetChangeMappe
//设置金额
List<TbsBudgetAmtBo> budgetAmtUpdateList = param.getBudgetAmtUpdateList();
if(CollectionUtil.isNotEmpty(budgetAmtUpdateList)){
//更变的周期项
List<Long> budgetScheduleIds = budgetAmtUpdateList.stream().map(TbsBudgetAmtBo::getBudgetScheduleItemId).collect(Collectors.toList());
List<TbsBudgetLogWithAmount> budgetLogWithAmountList = tbsScheduleItemBudgetMapper.getSumAmtInList(budgetScheduleIds,Arrays.asList(0,2,3));
List<TbsScheduleItemBudget> scheduleItemBudgetList = tbsScheduleItemBudgetMapper.selectBatchIds(budgetScheduleIds);
//所有的周期项
List<TbsScheduleItemBudget> allScheduleItemBudgetList = tbsScheduleItemBudgetMapper
.selectList(new LambdaQueryWrapper<TbsScheduleItemBudget>().eq(TbsScheduleItemBudget::getBudgetId,budget.getId()));
List<TbsBudgetChangeScheduleItem> changeScheduleItemList = new ArrayList<>();
for (TbsScheduleItemBudget scheduleItemBudget : scheduleItemBudgetList) {
for (TbsScheduleItemBudget scheduleItemBudget : allScheduleItemBudgetList) {
if(!scheduleItemBudget.getBudgetId().equals(budget.getId())){
Assert.throwEx("参数异常!!");
}
boolean isChange = budgetScheduleIds.stream().anyMatch(a->a.equals(scheduleItemBudget.getId()));
TbsBudgetChangeScheduleItem resultItem = TbsBudgetChangeScheduleItem.toNewObject(scheduleItemBudget);
resultItem.setChangeId(changeId);
resultItem.setChangeFlag(isChange?1:0);
//设置当前项调整的最终金额
for (TbsBudgetLogWithAmount withAmount : budgetLogWithAmountList) {
if(withAmount.getId().equals(scheduleItemBudget.getId())){

1
src/main/java/com/qs/serve/modules/tbs/service/impl/TbsBudgetServiceImpl.java

@ -201,6 +201,7 @@ public class TbsBudgetServiceImpl extends ServiceImpl<TbsBudgetMapper,TbsBudget>
budget.setBudgetCode(budgetBo.getBudgetCode());
budget.setSubjectId(budgetBo.getSubjectId());
budget.setAttachIds(budgetBo.getAttachIds());
budget.setInactiveFlag(budgetBo.getInactiveFlag());
//设置指定模板
budget.setTemplateIds(new String[]{});
if(budgetBo.getTemplateFlag()!=null&&budgetBo.getTemplateFlag().equals(1)){

25
src/main/java/com/qs/serve/modules/tbs/service/impl/TbsCostApplyServiceImpl.java

@ -430,7 +430,26 @@ public class TbsCostApplyServiceImpl extends ServiceImpl<TbsCostApplyMapper,TbsC
R<String> flowIdResult = null;
//启用新方法开关
if( tbsCostApply.getContractFlag().equals(1)){
List<OaUploadFile> uploadFileList = new ArrayList<>();
List<String> actFileIds = new ArrayList<>();
for (TbsActivity activity : activityList) {
if (CollectionUtil.isNotEmpty(activity.getAttachIds())){
actFileIds.addAll(Arrays.asList(activity.getAttachIds()));
}
}
if(CollectionUtil.isNotEmpty(actFileIds)){
List<SysAttach> attachList = sysAttachService.listByIds(actFileIds);
for (SysAttach sysAttach : attachList) {
OaUploadFile uploadFile = new OaUploadFile();
uploadFile.setField("file");
uploadFile.setName("活动附件"+sysAttach.getName());
uploadFile.setUrl("https://qsjslservice.oss-cn-guangzhou.aliyuncs.com/"+sysAttach.getRelativePath());
uploadFileList.add(uploadFile);
}
}
if(CollectionUtil.isNotEmpty(oaAttachmentsIdList)){
List<SysAttach> attachList = sysAttachService.listByIds(oaAttachmentsIdList);
for (SysAttach sysAttach : attachList) {
@ -451,6 +470,7 @@ public class TbsCostApplyServiceImpl extends ServiceImpl<TbsCostApplyMapper,TbsC
uploadFileList.add(uploadFile);
}
}
OaFormMainProcess mainProcess = new OaFormMainProcess();
mainProcess.setTargetId(id);
mainProcess.setUploadFiles(uploadFileList);
@ -909,7 +929,10 @@ public class TbsCostApplyServiceImpl extends ServiceImpl<TbsCostApplyMapper,TbsC
* @param sysUser
* @param data
*/
private void buildContractApplyData(String id, TbsCostApply tbsCostApply, List<TbsActivity> activityList, List<TbsActivityPayCondition> payConditions, BmsSupplier supplier, SysUser sysUser, Map<String, Object> data,List<TbsCostContract> contracts,List<TbsCostTodo> costTodoList ,Map<String, Object> newWayData) {
private void buildContractApplyData(String id, TbsCostApply tbsCostApply, List<TbsActivity> activityList,
List<TbsActivityPayCondition> payConditions, BmsSupplier supplier, SysUser sysUser,
Map<String, Object> data,List<TbsCostContract> contracts,
List<TbsCostTodo> costTodoList ,Map<String, Object> newWayData) {
data.put("title", tbsCostApply.getChargeTheme());
data.put("orgId", tbsCostApply.getId().toString());
data.put("costApplyCode", tbsCostApply.getCode());

2
src/main/java/com/qs/serve/modules/tzc/service/impl/TzcPolicyApplicationServiceImpl.java

@ -673,6 +673,8 @@ public class TzcPolicyApplicationServiceImpl implements TzcPolicyApplicationServ
);
budgetLqw.in(TbsBudget::getCenterId,centerIds);
budgetLqw.eq(TbsBudget::getBudgetState,1);
budgetLqw.eq(TbsBudget::getStopFlag,0);
budgetLqw.eq(TbsBudget::getInactiveFlag,0);
budgetLqw.eq(TbsBudget::getTemplateFlag,0);
budgetList = tbsBudgetMapper.selectList(budgetLqw);
}else {

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

@ -14,14 +14,17 @@ 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;
import com.qs.serve.modules.tbs.entity.bo.TbsAffairCommitBo;
import com.qs.serve.modules.tbs.entity.so.VtbVerificationBatchQuery;
import com.qs.serve.modules.tbs.entity.vo.CtpAffairVo;
import com.qs.serve.modules.vtb.entity.VtbVerification;
import com.qs.serve.modules.vtb.entity.VtbVerificationYard;
import com.qs.serve.modules.vtb.entity.bo.VtbVerificationBatchBo;
import com.qs.serve.modules.vtb.entity.vo.VtbVerificationBatchVo;
import com.qs.serve.modules.vtb.service.*;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@ -47,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;
@ -67,6 +71,37 @@ public class VtbVerificationBatchController {
return R.byPageHelperList(list);
}
/**
* 翻页2(连表查询-left join tbs_cost_apply)
* @param query
* @return
*/
@GetMapping("/page2")
public R<PageVo<VtbVerificationBatchVo>> getPage2(VtbVerificationBatchQuery query){
PageUtil.startPage();
List<VtbVerificationBatchVo> list = vtbVerificationBatchService.list2(query);
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
@ -76,7 +111,8 @@ public class VtbVerificationBatchController {
public R<VtbVerificationBatch> getById(@PathVariable("id") String id){
VtbVerificationBatch batch = vtbVerificationBatchService.getById(id);
if(batch.getVtbBatchStatus().equals(VtbVerificationBatch.BatchState.CHECKING)){
//TODO 补偿回调
vtbVerificationBatchOperationService.runCompensate(id);
batch = vtbVerificationBatchService.getById(id);
}
List<VtbVerification> verificationList = vtbVerificationService
.list(new LambdaQueryWrapper<VtbVerification>()

3
src/main/java/com/qs/serve/modules/vtb/entity/VtbVerificationBatch.java

@ -107,6 +107,9 @@ public class VtbVerificationBatch implements Serializable {
/** 申请时的金额合计 */
private BigDecimal applyCheckAmount;
/** 申请时的金额合计 */
private BigDecimal resultCheckAmount;
/** 客户id */
@NotNull(message = "客户id不能为空")
private String supplierId;

51
src/main/java/com/qs/serve/modules/vtb/entity/vo/VtbVerificationBatchVo.java

@ -0,0 +1,51 @@
package com.qs.serve.modules.vtb.entity.vo;
import com.baomidou.mybatisplus.annotation.SqlCondition;
import com.baomidou.mybatisplus.annotation.TableField;
import com.qs.serve.modules.vtb.entity.VtbVerification;
import com.qs.serve.modules.vtb.entity.VtbVerificationBatch;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
/**
* @author YenHex
* @since 2024/7/3
*/
@Data
public class VtbVerificationBatchVo extends VtbVerificationBatch {
private String costCode;
/** 主题 */
private String chargeTheme;
/** 状态:0=未发布;1=审批中;2=待执行;3=完成;4-被驳回;5-中止;6-作废;7-异动 @{link TbsCostApplyState} */
private Integer chargeState;
private String supplierBizRegionFirstName;
private String supplierBizRegionSecondName;
private String supplierBizRegionThirdName;
/** 统计活动数量 */
private Integer totalActivity;
/** 统计所有活动申请的金额 */
private BigDecimal totalActivityAmount;
/** 统计所有活动预估发货的金额 */
private BigDecimal totalActivityPreAmount;
/** 统计所有活动预估不发货的金额 */
private BigDecimal totalActivityPreNotAmount;
/** 统计所有活动使用的金额 */
private BigDecimal totalActivityUsedAmount;
}

7
src/main/java/com/qs/serve/modules/vtb/mapper/VtbVerificationBatchMapper.java

@ -1,10 +1,14 @@
package com.qs.serve.modules.vtb.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qs.serve.modules.tbs.entity.so.VtbVerificationBatchQuery;
import com.qs.serve.modules.vtb.entity.VtbVerificationBatch;
import com.qs.serve.modules.vtb.entity.vo.VtbVerificationBatchVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import java.util.List;
/**
* Mapper
* @author YenHex
@ -25,5 +29,8 @@ public interface VtbVerificationBatchMapper extends BaseMapper<VtbVerificationBa
" and verification_state = 3 ")
void updateBackedItemToClose(@Param("batchId") Long batchId);
List<VtbVerificationBatchVo> selectList2(@Param("query") VtbVerificationBatchQuery query);
}

4
src/main/java/com/qs/serve/modules/vtb/mapper/VtbVerificationMapper.java

@ -18,6 +18,10 @@ import java.util.List;
*/
public interface VtbVerificationMapper extends BaseMapper<VtbVerification> {
@Select("select COALESCE(sum(amount),0) from vtb_verification where del_flag = 0 and batch_id = #{batchId} ")
BigDecimal totalVtbAmtByBatchId(@Param("batchId")Long batchId);
@Select("select COALESCE(sum(amount),0) from vtb_verification where del_flag = 0 and activity_id = #{activityId} and verification_state = 1")
BigDecimal totalActivityVerification(@Param("activityId")String activityId);

4
src/main/java/com/qs/serve/modules/vtb/service/VtbVerificationBatchService.java

@ -1,9 +1,11 @@
package com.qs.serve.modules.vtb.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.qs.serve.modules.tbs.entity.so.VtbVerificationBatchQuery;
import com.qs.serve.modules.vtb.entity.VtbVerification;
import com.qs.serve.modules.vtb.entity.VtbVerificationBatch;
import com.qs.serve.modules.vtb.entity.bo.VtbVerificationBatchBo;
import com.qs.serve.modules.vtb.entity.vo.VtbVerificationBatchVo;
import java.util.List;
@ -22,5 +24,7 @@ public interface VtbVerificationBatchService extends IService<VtbVerificationBat
List<VtbVerification> listVerifications(Long batchId);
List<VtbVerificationBatchVo> list2(VtbVerificationBatchQuery query);
}

8
src/main/java/com/qs/serve/modules/vtb/service/impl/VtbVerificationBatchOperationServiceImpl.java

@ -16,6 +16,7 @@ import com.qs.serve.modules.tbs.entity.vo.CtpAffairVo;
import com.qs.serve.modules.vtb.common.VtbVerificationState;
import com.qs.serve.modules.vtb.entity.*;
import com.qs.serve.modules.vtb.entity.vo.VtbVerificationActReleaseVo;
import com.qs.serve.modules.vtb.mapper.VtbVerificationMapper;
import com.qs.serve.modules.vtb.service.*;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@ -39,6 +40,7 @@ public class VtbVerificationBatchOperationServiceImpl implements VtbVerification
private final VtbVerificationBatchService vtbVerificationBatchService;
private final VtbVerificationService vtbVerificationService;
private final VtbVerificationMapper vtbVerificationMapper;
private final SysUserService sysUserService;
private final VtbVerificationApplication verificationApplication;
private final VtbVerificationSubjectCenterService vtbVerificationSubjectCenterService;
@ -80,11 +82,13 @@ public class VtbVerificationBatchOperationServiceImpl implements VtbVerification
List<VtbVerification> verificationList = vtbVerificationBatchService.listVerifications(batch.getId());
batch.setVtbBatchStatus(VtbVerificationBatch.BatchState.CHECK_OK);
batch.setBackedTime(LocalDateTime.now());
vtbVerificationBatchService.updateById(batch);
for (VtbVerification verification : verificationList) {
//循环调用每个核销
vtbVerificationService.successCommit(verification.getId());
}
BigDecimal totalAmt = vtbVerificationMapper.totalVtbAmtByBatchId(batch.getId());
batch.setResultCheckAmount(totalAmt);
vtbVerificationBatchService.updateById(batch);
return null;
}
@ -126,7 +130,7 @@ public class VtbVerificationBatchOperationServiceImpl implements VtbVerification
//保存到每个核销
for (VtbVerification verification : verificationList) {
DataAffairCommit affairCommit = CopierUtil.copy(dataAffairCommit,new DataAffairCommit());
affairCommit.setId(null);
affairCommit.setId(IdUtil.nanoId());
affairCommit.setTargetId(verification.getId()+"");
affairCommit.setTargetCode(verification.getVerificationCode());
dataAffairCommitMapper.insert(affairCommit);

8
src/main/java/com/qs/serve/modules/vtb/service/impl/VtbVerificationBatchServiceImpl.java

@ -35,6 +35,7 @@ import com.qs.serve.modules.tbs.entity.TbsActivityCenter;
import com.qs.serve.modules.tbs.entity.TbsActivitySubject;
import com.qs.serve.modules.tbs.entity.TbsCostApply;
import com.qs.serve.modules.tbs.entity.dto.TbsCostSubItem;
import com.qs.serve.modules.tbs.entity.so.VtbVerificationBatchQuery;
import com.qs.serve.modules.tbs.service.TbsActivityCenterService;
import com.qs.serve.modules.tbs.service.TbsActivityService;
import com.qs.serve.modules.tbs.service.TbsActivitySubjectService;
@ -44,6 +45,7 @@ import com.qs.serve.modules.vtb.common.VtbVerificationState;
import com.qs.serve.modules.vtb.entity.*;
import com.qs.serve.modules.vtb.entity.bo.*;
import com.qs.serve.modules.vtb.entity.dto.VtbSubjectDTO;
import com.qs.serve.modules.vtb.entity.vo.VtbVerificationBatchVo;
import com.qs.serve.modules.vtb.service.*;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@ -165,6 +167,7 @@ public class VtbVerificationBatchServiceImpl extends ServiceImpl<VtbVerification
verificationBatch.setRemark(submitBo.getRemark());
verificationBatch.setSupplierId(supplier.getId());
verificationBatch.setApplyCheckAmount(totalAmt);
verificationBatch.setResultCheckAmount(totalAmt);
verificationBatch.setSupplierCode(supplier.getCode());
verificationBatch.setSupplierName(supplier.getName());
verificationBatch.setUserId(sysUser.getId());
@ -568,5 +571,10 @@ public class VtbVerificationBatchServiceImpl extends ServiceImpl<VtbVerification
.list(new LambdaQueryWrapper<VtbVerification>()
.eq(VtbVerification::getBatchId,batchId));
}
@Override
public List<VtbVerificationBatchVo> list2(VtbVerificationBatchQuery query) {
return baseMapper.selectList2(query);
}
}

15
src/main/java/com/qs/serve/modules/vtb/service/impl/VtbVerificationServiceImpl.java

@ -1428,7 +1428,15 @@ public class VtbVerificationServiceImpl extends ServiceImpl<VtbVerificationMappe
activityUpdate.setId(verification.getActivityId());
activityService.updateById(activityUpdate);
}
//更新释放的核销(通过batchId区分旧版核销)
if(verification.getBatchId()!=null&&verification.getInputReleaseFlag()!=null&&verification.getInputReleaseFlag().equals(1)){
//更新活动状态
TbsActivity activityUpdate = new TbsActivity();
activityUpdate.setActivityState(TbsActivityState.STATE_4_Release);
activityUpdate.setReleaseTime(LocalDateTime.now());
activityUpdate.setId(verification.getActivityId());
activityService.updateById(activityUpdate);
}
BigDecimal totalCostApplyUsed = costApplyService.totalCostUsed(activity.getCostApplyId());
TbsCostApply updCost = new TbsCostApply();
@ -1576,6 +1584,11 @@ public class VtbVerificationServiceImpl extends ServiceImpl<VtbVerificationMappe
supplier.setCode(activity.getSupplierCode());
supplier.setName(activity.getSupplierName());
//无可用金额
if(verification.getAmount().compareTo(BigDecimal.ZERO)<=0){
return;
}
for (VtbVerificationSubject verificationSubject : verificationSubjects) {
subject.setSubjectCode(verificationSubject.getSubjectCode());
subject.setSubjectName(verificationSubject.getSubjectName());

8
src/main/resources/mapper/goods/GoodsSpuMapper.xml

@ -270,7 +270,7 @@
SELECT sku.*,ROW_NUMBER() OVER(PARTITION BY sku.spu_id ORDER BY sku.belong_sort) AS rn
FROM goods_sku sku
left join goods_spu spu on sku.spu_id = spu.id
WHERE sku.order_flag = 1 AND sku.special_flag = 0 and sku.del_flag = 0
WHERE sku.order_flag = 1 AND sku.special_flag = 0 and sku.del_flag = 0 and sku.enable = 1
<if test="query.keyword != null and query.keyword != '' ">
and (
`sku`.`sku_code` like concat('%', #{query.keyword},'%') or
@ -295,7 +295,7 @@
UNION ALL
SELECT sku.*,1 as rn FROM goods_sku sku
left join goods_spu spu on sku.spu_id = spu.id
WHERE sku.special_flag = 1 and sku.del_flag = 0
WHERE sku.special_flag = 1 and sku.del_flag = 0 and sku.enable = 1
<if test="query.keyword != null and query.keyword != '' ">
and (
`sku`.`sku_code` like concat('%', #{query.keyword},'%') or
@ -337,7 +337,7 @@
SELECT sku.*,ROW_NUMBER() OVER(PARTITION BY sku.spu_id ORDER BY sku.belong_sort) AS rn
FROM goods_sku sku
left join goods_spu spu on sku.spu_id = spu.id
WHERE sku.order_flag = 1 AND sku.special_flag = 0
WHERE sku.order_flag = 1 AND sku.special_flag = 0 and sku.enable = 1
<if test="query.keyword != null and query.keyword != '' ">
and (
`sku`.`sku_code` like concat('%', #{query.keyword},'%') or
@ -365,7 +365,7 @@
UNION ALL
SELECT sku.*,1 as rn FROM goods_sku sku
left join goods_spu spu on sku.spu_id = spu.id
WHERE sku.special_flag = 1
WHERE sku.special_flag = 1 and sku.enable = 1
<if test="query.keyword != null and query.keyword != '' ">
and (
`sku`.`sku_code` like concat('%', #{query.keyword},'%') or

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}

1
src/main/resources/mapper/tbs/TbsBudgetMapper.xml

@ -82,6 +82,7 @@
<if test="query.budgetNumber !=null and query.budgetNumber !='' "> and `tbs_budget`.`budget_number` like concat('%',#{query.budgetNumber},'%')</if>
<if test="query.budgetState !=null "> and `tbs_budget`.`budget_state` = #{query.budgetState}</if>
<if test="query.crossYearFlag !=null "> and `tbs_budget`.`cross_year_flag` = #{query.crossYearFlag}</if>
<if test="query.inactiveFlag !=null "> and `tbs_budget`.`inactive_flag` = #{query.inactiveFlag}</if>
<if test="query.budgetCheckState !=null "> and `tbs_budget`.`budget_check_state` = #{query.budgetCheckState}</if>
<if test="query.budgetCode != null and query.budgetCode != ''"> and `tbs_budget`.`budget_code` like concat('%',#{query.budgetCode},'%')</if>
<if test="query.subjectValue != null and query.subjectValue != ''">

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

@ -0,0 +1,118 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.qs.serve.modules.vtb.mapper.VtbVerificationBatchMapper">
<resultMap id="vtbVerificationBatchMap" type="com.qs.serve.modules.vtb.entity.VtbVerificationBatch" >
<result property="id" column="id"/>
<result property="vtbBatchCode" column="vtb_batch_code"/>
<result property="vtbBatchStatus" column="vtb_batch_status"/>
<result property="finishedTime" column="finished_time"/>
<result property="costApplyId" column="cost_apply_id"/>
<result property="remark" column="remark"/>
<result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time"/>
<result property="tenantId" column="tenant_id"/>
<result property="createBy" column="create_by"/>
<result property="updateBy" column="update_by"/>
<result property="delFlag" column="del_flag"/>
<result property="syFormId" column="sy_form_id"/>
<result property="syFlowId" column="sy_flow_id"/>
<result property="supplierId" column="supplier_id"/>
<result property="supplierCode" column="supplier_code"/>
<result property="supplierName" column="supplier_name"/>
<result property="userId" column="user_id"/>
<result property="userCode" column="user_code"/>
<result property="userName" column="user_name"/>
<result property="extUserId" column="ext_user_id"/>
<result property="extUserCode" column="ext_user_code"/>
<result property="extUserName" column="ext_user_name"/>
<result property="backedTime" column="backed_time"/>
<result property="refuseTime" column="refuse_time"/>
<result property="wayId" column="way_id"/>
<result property="wayTitle" column="way_title"/>
<result property="applyCheckAmount" column="apply_check_amount"/>
<result property="resultCheckAmount" column="result_check_amount"/>
</resultMap>
<sql id="vtbVerificationBatchSql">
vtb_verification_batch.`id`,
vtb_verification_batch.`vtb_batch_code`,
vtb_verification_batch.`vtb_batch_status`,
vtb_verification_batch.`finished_time`,
vtb_verification_batch.`cost_apply_id`,
vtb_verification_batch.`remark`,
vtb_verification_batch.`create_time`,
vtb_verification_batch.`update_time`,
vtb_verification_batch.`tenant_id`,
vtb_verification_batch.`create_by`,
vtb_verification_batch.`update_by`,
vtb_verification_batch.`del_flag`,
vtb_verification_batch.`sy_form_id`,
vtb_verification_batch.`sy_flow_id`,
vtb_verification_batch.`supplier_id`,
vtb_verification_batch.`supplier_code`,
vtb_verification_batch.`supplier_name`,
vtb_verification_batch.`user_id`,
vtb_verification_batch.`user_code`,
vtb_verification_batch.`user_name`,
vtb_verification_batch.`ext_user_id`,
vtb_verification_batch.`ext_user_code`,
vtb_verification_batch.`ext_user_name`,
vtb_verification_batch.`backed_time`,
vtb_verification_batch.`refuse_time`,
vtb_verification_batch.`way_id`,
vtb_verification_batch.`way_title`,
vtb_verification_batch.`apply_check_amount`,
vtb_verification_batch.`result_check_amount` </sql>
<select id="selectList2" resultType="com.qs.serve.modules.vtb.entity.vo.VtbVerificationBatchVo">
SELECT
<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`,
tbs_cost_apply.`total_activity`,
tbs_cost_apply.`total_activity_amount`,
tbs_cost_apply.`total_activity_pre_amount`,
tbs_cost_apply.`total_activity_pre_not_amount`,
tbs_cost_apply.`total_activity_used_amount`
FROM `vtb_verification_batch` `vtb_verification_batch`
left join tbs_cost_apply on tbs_cost_apply.id = vtb_verification_batch.cost_apply_id
<where>
and vtb_verification_batch.del_flag = 0
and tbs_cost_apply.del_flag = 0
<if test="query.vtbBatchCode != null and query.vtbBatchCode != ''"> and `vtb_verification_batch`.`vtb_batch_code` like concat('%',#{query.vtbBatchCode},'%') </if>
<if test="query.vtbBatchStatus != null"> and `vtb_verification_batch`.`vtb_batch_status` = #{query.vtbBatchStatus}</if>
<if test="query.supplierCode != null and query.supplierCode != ''"> and `vtb_verification_batch`.`supplier_code` like concat('%',#{query.supplierCode},'%') </if>
<if test="query.supplierName != null and query.supplierName != ''"> and `vtb_verification_batch`.`supplier_name` like concat('%',#{query.supplierName},'%') </if>
<if test="query.userCode != null and query.userCode != ''"> and `vtb_verification_batch`.`user_code` like concat('%',#{query.userCode},'%') </if>
<if test="query.userName != null and query.userName != ''"> and `vtb_verification_batch`.`user_name` like concat('%',#{query.userName},'%') </if>
<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