21 changed files with 790 additions and 3 deletions
@ -0,0 +1,5 @@ |
|||||
|
|
||||
|
update tbs_budget_condition set brand_id = SUBSTRING_INDEX(target_level_path_ids,'_',1) |
||||
|
|
||||
|
update tbs_budget set center_combo = concat(center_type,'_',center_id) |
||||
|
|
@ -0,0 +1,80 @@ |
|||||
|
package com.qs.serve.modules.bir.controller; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
|
import com.qs.serve.common.model.dto.R; |
||||
|
import com.qs.serve.common.util.CollectionUtil; |
||||
|
import com.qs.serve.modules.tbs.entity.TbsSchedule; |
||||
|
import com.qs.serve.modules.tbs.entity.TbsScheduleItem; |
||||
|
import com.qs.serve.modules.tbs.entity.dto.TbsScheduleItemBudgetIdDto; |
||||
|
import com.qs.serve.modules.tbs.entity.dto.TbsScheduleItemWithAmount; |
||||
|
import com.qs.serve.modules.tbs.entity.so.TbsScheduleItemSearch; |
||||
|
import com.qs.serve.modules.tbs.mapper.TbsScheduleItemBudget2Mapper; |
||||
|
import com.qs.serve.modules.tbs.mapper.TbsScheduleItemMapper; |
||||
|
import com.qs.serve.modules.tbs.mapper.TbsScheduleMapper; |
||||
|
import com.qs.serve.modules.tbs.service.TbsScheduleItemBudgetService; |
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.stream.Collectors; |
||||
|
|
||||
|
/** |
||||
|
* @author YenHex |
||||
|
* @since 2023/12/27 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@AllArgsConstructor |
||||
|
@RestController |
||||
|
@RequestMapping("bir/budget") |
||||
|
public class BirBudgetScheduleController { |
||||
|
|
||||
|
private final TbsScheduleItemBudgetService scheduleItemBudgetService; |
||||
|
private final TbsScheduleItemBudget2Mapper scheduleItemBudget2Mapper; |
||||
|
private final TbsScheduleItemMapper tbsScheduleItemMapper; |
||||
|
private final TbsScheduleMapper tbsScheduleMapper; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 查询周期使用情况 |
||||
|
* @param query |
||||
|
* @return |
||||
|
*/ |
||||
|
@PostMapping("/budgetItemUsedList") |
||||
|
public R<List<TbsScheduleItemWithAmount>> queryBudgetItemUsed(@RequestBody TbsScheduleItemSearch query){ |
||||
|
query.initCenterCombo(); |
||||
|
if(CollectionUtil.isNotEmpty(query.getScheduleIds())){ |
||||
|
LambdaQueryWrapper<TbsScheduleItem> lqw = new LambdaQueryWrapper<>(); |
||||
|
lqw.in(TbsScheduleItem::getScheduleId,query.getScheduleIds()); |
||||
|
lqw.select(TbsScheduleItem::getId); |
||||
|
List<TbsScheduleItem> scheduleItemList = tbsScheduleItemMapper.selectList(lqw); |
||||
|
List<String> itemIds = scheduleItemList.stream().map(a->a.getId().toString()).collect(Collectors.toList()); |
||||
|
query.setScheduleItemIds(itemIds); |
||||
|
} |
||||
|
List<TbsScheduleItemBudgetIdDto> scheduleItemBudgetIdDtoList = scheduleItemBudget2Mapper.listItemBudgetIds(query); |
||||
|
List<Long> scheduleItemIds = scheduleItemBudgetIdDtoList.stream().map(TbsScheduleItemBudgetIdDto::getScheduleItemId).collect(Collectors.toList()); |
||||
|
if(CollectionUtil.isEmpty(scheduleItemIds)){ |
||||
|
return R.ok(); |
||||
|
} |
||||
|
List<TbsScheduleItem> scheduleItemList = tbsScheduleItemMapper.selectBatchIds(scheduleItemIds); |
||||
|
List<TbsSchedule> scheduleList = tbsScheduleMapper.selectList(new QueryWrapper<>()); |
||||
|
List<TbsScheduleItemWithAmount> scheduleItemWithAmounts = scheduleItemBudgetService.listScheduleItemAmountByIds(scheduleItemBudgetIdDtoList); |
||||
|
for (TbsScheduleItemWithAmount itemWithAmount : scheduleItemWithAmounts) { |
||||
|
for (TbsScheduleItem scheduleItem : scheduleItemList) { |
||||
|
if(itemWithAmount.getScheduleItemId().equals(scheduleItem.getId())){ |
||||
|
itemWithAmount.setScheduleItemName(scheduleItem.getItemName()); |
||||
|
for (TbsSchedule schedule : scheduleList) { |
||||
|
if(schedule.getId().equals(scheduleItem.getScheduleId())){ |
||||
|
itemWithAmount.setScheduleName(schedule.getName()); |
||||
|
break; |
||||
|
} |
||||
|
} |
||||
|
break; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
return R.ok(scheduleItemWithAmounts); |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,18 @@ |
|||||
|
package com.qs.serve.modules.tbs.entity.dto; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
|
||||
|
/** |
||||
|
* @author YenHex |
||||
|
* @since 2023/6/29 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class TbsScheduleItemBudgetIdDto { |
||||
|
|
||||
|
Long scheduleItemId; |
||||
|
|
||||
|
Long scheduleItemBudgetId; |
||||
|
|
||||
|
} |
@ -0,0 +1,63 @@ |
|||||
|
package com.qs.serve.modules.tbs.entity.dto; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
|
||||
|
/** |
||||
|
* @author YenHex |
||||
|
* @since 2023/6/29 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class TbsScheduleItemWithAmount { |
||||
|
|
||||
|
/** |
||||
|
* 周期项ID |
||||
|
*/ |
||||
|
Long scheduleItemId; |
||||
|
|
||||
|
String scheduleName; |
||||
|
|
||||
|
String scheduleItemName; |
||||
|
|
||||
|
/** |
||||
|
* 预算总额 |
||||
|
*/ |
||||
|
BigDecimal finalAmt = BigDecimal.ZERO; |
||||
|
|
||||
|
/** |
||||
|
* 当前占用中的预算 |
||||
|
*/ |
||||
|
BigDecimal allUsingAmt = BigDecimal.ZERO; |
||||
|
|
||||
|
/** |
||||
|
* 申请中的预算占用 |
||||
|
*/ |
||||
|
BigDecimal allCheckingAmt = BigDecimal.ZERO; |
||||
|
|
||||
|
/** |
||||
|
* 费用申请-申请中的预算 |
||||
|
*/ |
||||
|
BigDecimal costUsingAmt = BigDecimal.ZERO; |
||||
|
|
||||
|
/** |
||||
|
* 费用申请-申请中的预算 |
||||
|
*/ |
||||
|
BigDecimal costCheckingAmt = BigDecimal.ZERO; |
||||
|
|
||||
|
/** |
||||
|
* 政策-申请中的预算 |
||||
|
*/ |
||||
|
BigDecimal policyUsingAmt = BigDecimal.ZERO; |
||||
|
|
||||
|
/** |
||||
|
* 政策-申请中的预算 |
||||
|
*/ |
||||
|
BigDecimal policyCheckingAmt = BigDecimal.ZERO; |
||||
|
|
||||
|
/** |
||||
|
* 剩余预算(预算总额-当前占用的预算) |
||||
|
*/ |
||||
|
BigDecimal surplusAmt = BigDecimal.ZERO; |
||||
|
|
||||
|
} |
@ -0,0 +1,59 @@ |
|||||
|
package com.qs.serve.modules.tbs.entity.so; |
||||
|
|
||||
|
import com.qs.serve.common.util.CollectionUtil; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.stream.Collectors; |
||||
|
|
||||
|
/** |
||||
|
* @author YenHex |
||||
|
* @since 2023/12/27 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class TbsScheduleItemSearch { |
||||
|
|
||||
|
/** |
||||
|
* 成本中心组合值列表,格式:centerType_centerId |
||||
|
*/ |
||||
|
private List<String> centerCombos; |
||||
|
|
||||
|
/** |
||||
|
* 周期ID |
||||
|
*/ |
||||
|
private List<String> scheduleIds; |
||||
|
|
||||
|
/** |
||||
|
* 周期ID |
||||
|
*/ |
||||
|
private List<String> scheduleItemIds; |
||||
|
|
||||
|
/** |
||||
|
* 品牌ID |
||||
|
*/ |
||||
|
private List<Long> brandIds; |
||||
|
|
||||
|
/** |
||||
|
* 成本中心列表 |
||||
|
*/ |
||||
|
private List<CenterItem> centerList; |
||||
|
|
||||
|
@Data |
||||
|
public static class CenterItem{ |
||||
|
|
||||
|
private String centerType; |
||||
|
|
||||
|
private String centerId; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 调整数据结构 |
||||
|
*/ |
||||
|
public void initCenterCombo(){ |
||||
|
if(CollectionUtil.isNotEmpty(centerList)){ |
||||
|
this.centerCombos = centerList.stream().map(a-> a.getCenterType()+"_"+a.getCenterId()).collect(Collectors.toList()); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,27 @@ |
|||||
|
package com.qs.serve.modules.tbs.entity.vo; |
||||
|
|
||||
|
/** |
||||
|
* @author YenHex |
||||
|
* @since 2023/12/28 |
||||
|
*/ |
||||
|
public class TbsBudgetMatchMsgVo { |
||||
|
|
||||
|
/** 活动ID */ |
||||
|
private Long activityId; |
||||
|
|
||||
|
/** 活动编码 */ |
||||
|
private String activityCode; |
||||
|
|
||||
|
/** 活动标题 */ |
||||
|
private String activityTitle; |
||||
|
|
||||
|
/** 预算ID */ |
||||
|
private Long budgetId; |
||||
|
|
||||
|
/** 预算编码 */ |
||||
|
private String budgetCode; |
||||
|
|
||||
|
/** 预算标题 */ |
||||
|
private String budgetTitle; |
||||
|
|
||||
|
} |
@ -0,0 +1,72 @@ |
|||||
|
package com.qs.serve.modules.tbs.mapper; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.InterceptorIgnore; |
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import com.qs.serve.modules.tbs.entity.TbsScheduleItemBudget; |
||||
|
import com.qs.serve.modules.tbs.entity.dto.TbsBudgetLogPreAmount; |
||||
|
import com.qs.serve.modules.tbs.entity.dto.TbsBudgetLogWithAmount; |
||||
|
import com.qs.serve.modules.tbs.entity.dto.TbsScheduleItemBudgetAmount; |
||||
|
import com.qs.serve.modules.tbs.entity.dto.TbsScheduleItemBudgetIdDto; |
||||
|
import com.qs.serve.modules.tbs.entity.so.TbsScheduleItemSearch; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
import org.apache.ibatis.annotations.Select; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 预算考核期项 Mapper |
||||
|
* @author YenHex |
||||
|
* @date 2022-11-08 |
||||
|
*/ |
||||
|
public interface TbsScheduleItemBudget2Mapper extends BaseMapper<TbsScheduleItemBudget> { |
||||
|
|
||||
|
/** |
||||
|
* 查询TbsScheduleItemBudget.id |
||||
|
* @param query |
||||
|
* @return |
||||
|
*/ |
||||
|
List<TbsScheduleItemBudgetIdDto> listItemBudgetIds(@Param("query") TbsScheduleItemSearch query); |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 统计Schedule金额 |
||||
|
* @param ids scheduleItemIds |
||||
|
* @param optNumbers 包含 |
||||
|
* @return |
||||
|
*/ |
||||
|
@InterceptorIgnore(tenantLine = "true") |
||||
|
List<TbsBudgetLogWithAmount> getSumAmtInList(@Param("selectIds") List<Long> ids,@Param("optNumbers")List<Integer> optNumbers); |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 统计Schedule金额 |
||||
|
* @param ids scheduleItemIds |
||||
|
* @param optNumbers 不包含 |
||||
|
* @return |
||||
|
*/ |
||||
|
@InterceptorIgnore(tenantLine = "true") |
||||
|
List<TbsBudgetLogWithAmount> getSumAmtNotInList(@Param("selectIds") List<Long> ids,@Param("optNumbers")List<Integer> optNumbers); |
||||
|
|
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 统计审批中的政策,占用多少的预算 |
||||
|
* @param ids |
||||
|
* @param optNumbers |
||||
|
* @return |
||||
|
*/ |
||||
|
@InterceptorIgnore(tenantLine = "true") |
||||
|
List<TbsBudgetLogWithAmount> getPolicyCheckingList(@Param("selectIds") List<Long> ids,@Param("optNumbers")List<Integer> optNumbers); |
||||
|
|
||||
|
/** |
||||
|
* 统计审批中的费用,占用多少的预算 |
||||
|
* @param ids |
||||
|
* @param optNumbers |
||||
|
* @return |
||||
|
*/ |
||||
|
@InterceptorIgnore(tenantLine = "true") |
||||
|
List<TbsBudgetLogWithAmount> getCostCheckingList(@Param("selectIds") List<Long> ids,@Param("optNumbers")List<Integer> optNumbers); |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,19 @@ |
|||||
|
package com.qs.serve.modules.tbs.service; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author YenHex |
||||
|
* @since 2023/12/28 |
||||
|
*/ |
||||
|
public interface TbsBudgetManagerService { |
||||
|
|
||||
|
/** |
||||
|
* 对比活动和预算进行条件匹配,返回不符合的内容(以Budget为参照物,全量匹配) |
||||
|
* @param activityIds |
||||
|
* @param budgetIds |
||||
|
* @return |
||||
|
*/ |
||||
|
Object compare(List<Long> activityIds, List<Long> budgetIds); |
||||
|
|
||||
|
} |
@ -0,0 +1,96 @@ |
|||||
|
package com.qs.serve.modules.tbs.service.impl; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
|
import com.qs.serve.modules.tbs.entity.*; |
||||
|
import com.qs.serve.modules.tbs.mapper.*; |
||||
|
import com.qs.serve.modules.tbs.service.TbsActivityCenterGoodsService; |
||||
|
import com.qs.serve.modules.tbs.service.TbsBudgetManagerService; |
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
import java.util.stream.Collectors; |
||||
|
|
||||
|
/** |
||||
|
* @author YenHex |
||||
|
* @since 2023/12/28 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@Service |
||||
|
@AllArgsConstructor |
||||
|
public class TbsBudgetManagerServiceImpl implements TbsBudgetManagerService { |
||||
|
|
||||
|
private final TbsActivityMapper activityMapper; |
||||
|
private final TbsActivityCenterMapper activityCenterMapper; |
||||
|
private final TbsActivitySubjectMapper activitySubjectMapper; |
||||
|
private final TbsActivityCenterGoodsMapper activityCenterGoodsMapper; |
||||
|
private final TbsBudgetMapper budgetMapper; |
||||
|
private final TbsBudgetConditionMapper budgetConditionMapper; |
||||
|
private final TbsScheduleItemBudgetMapper scheduleItemBudgetMapper; |
||||
|
|
||||
|
@Override |
||||
|
public Object compare(List<Long> activityIds, List<Long> budgetIds) { |
||||
|
//加载基础数据
|
||||
|
QueryWrapper acgLqw = new QueryWrapper<>(); |
||||
|
acgLqw.in("activity_id",activityIds); |
||||
|
|
||||
|
List<TbsBudget> budgetList = budgetMapper.selectBatchIds(budgetIds); |
||||
|
List<TbsActivity> activityList = activityMapper.selectBatchIds(activityIds); |
||||
|
List<TbsActivityCenter> allCenterList = activityCenterMapper.selectList(acgLqw); |
||||
|
List<TbsActivitySubject> allSubjectList = activitySubjectMapper.selectList(acgLqw); |
||||
|
List<TbsActivityCenterGoods> allCenterGoodsList = activityCenterGoodsMapper.selectList(acgLqw); |
||||
|
|
||||
|
Map<Long,List<TbsActivityCenter>> centerListMap = allCenterList.stream().collect(Collectors.groupingBy(TbsActivityCenter::getActivityId)); |
||||
|
Map<Long,List<TbsActivitySubject>> subjectListMap = allSubjectList.stream().collect(Collectors.groupingBy(TbsActivitySubject::getActivityId)); |
||||
|
Map<Long,List<TbsActivityCenterGoods>> centerGoodsListMap = allCenterGoodsList.stream().collect(Collectors.groupingBy(TbsActivityCenterGoods::getActivityId)); |
||||
|
|
||||
|
LambdaQueryWrapper<TbsBudgetCondition> conditionLqw = new LambdaQueryWrapper<>(); |
||||
|
conditionLqw.in(TbsBudgetCondition::getBudgetId,budgetIds); |
||||
|
List<TbsBudgetCondition> allConditionList = budgetConditionMapper.selectList(conditionLqw); |
||||
|
|
||||
|
|
||||
|
Map<Long,List<TbsBudgetCondition>> conditionListMap = allConditionList.stream().collect(Collectors.groupingBy(TbsBudgetCondition::getBudgetId)); |
||||
|
|
||||
|
//匹对
|
||||
|
for (TbsBudget budget : budgetList) { |
||||
|
for (TbsActivity activity : activityList) { |
||||
|
Long budgetId = budget.getId(); |
||||
|
Long activityId = activity.getId(); |
||||
|
//判断科目
|
||||
|
if(!budget.getSubjectId().equals(0L)){ |
||||
|
List<TbsActivitySubject> subjectList = subjectListMap.get(activityId); |
||||
|
for (TbsActivitySubject subject : subjectList) { |
||||
|
if(!subject.getSubjectId().equals(budget.getSubjectId())){ |
||||
|
String msg = "无法匹配科目"; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
//判断成本中心
|
||||
|
List<TbsActivityCenter> centerList = centerListMap.get(activityId); |
||||
|
for (TbsActivityCenter center : centerList) { |
||||
|
if(!center.getCenterType().equals(budget.getCenterType())||center.getCenterId().equals(budget.getCenterId())){ |
||||
|
String msg = "无法匹配成本中心"; |
||||
|
} |
||||
|
} |
||||
|
//判断时间
|
||||
|
List<TbsBudgetCondition> budgetConditionList = conditionListMap.get(budgetId); |
||||
|
//判断品类
|
||||
|
|
||||
|
|
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
//
|
||||
|
|
||||
|
|
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,108 @@ |
|||||
|
package com.qs.serve.modules.third.util; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
import org.springframework.http.HttpEntity; |
||||
|
import org.springframework.http.HttpHeaders; |
||||
|
import org.springframework.http.client.SimpleClientHttpRequestFactory; |
||||
|
import org.springframework.web.client.RestTemplate; |
||||
|
|
||||
|
/** |
||||
|
* 日志平台工具类(Spring版本) |
||||
|
* @author YenHex |
||||
|
* @since 2023/12/21 |
||||
|
*/ |
||||
|
public class ThirdRequestLogUtil { |
||||
|
|
||||
|
/* |
||||
|
public static void main(String[] args) { |
||||
|
ThirtyRequestLog requestLog = new ThirtyRequestLog(); |
||||
|
requestLog.setTitle("test"); |
||||
|
requestLog.setModule("test"); |
||||
|
requestLog.setRequestJson("{}"); |
||||
|
requestLog.setResponseJson("{}"); |
||||
|
requestLog.setKey1("A100"); |
||||
|
requestLog.setKey2("A100"); |
||||
|
requestLog.setKey3("A100"); |
||||
|
requestLog.setErrorMsg("A100"); |
||||
|
requestLog.setLogLevel("info"); |
||||
|
requestLog.setSuccessStatus(1); |
||||
|
requestLog.setRemark("A100"); |
||||
|
requestLog.setExtValue1("A100"); |
||||
|
requestLog.setExtValue2("A100"); |
||||
|
requestLog.setExtValue3("A100"); |
||||
|
requestLog.setExtValue4("A100"); |
||||
|
|
||||
|
String rs = ThirdRequestLogUtil.post(requestLog); |
||||
|
System.out.println(rs); |
||||
|
}*/ |
||||
|
|
||||
|
private static final String SAVE_LOG_URL = "http://192.168.0.9:7100/api/reqLog/saveLog"; |
||||
|
|
||||
|
private static RestTemplate restTemplate; |
||||
|
|
||||
|
private static RestTemplate getRestTemplate(){ |
||||
|
if(restTemplate==null){ |
||||
|
SimpleClientHttpRequestFactory factory = new SimpleClientHttpRequestFactory(); |
||||
|
factory.setReadTimeout(5000); |
||||
|
factory.setConnectTimeout(15000); |
||||
|
restTemplate = new RestTemplate(factory); |
||||
|
} |
||||
|
return restTemplate; |
||||
|
} |
||||
|
|
||||
|
public static String post(ThirtyRequestLog requestLog) { |
||||
|
HttpHeaders headers = new HttpHeaders(); |
||||
|
HttpEntity<ThirtyRequestLog> formEntity = new HttpEntity<>(requestLog,headers); |
||||
|
return getRestTemplate().postForObject(SAVE_LOG_URL,formEntity, String.class); |
||||
|
} |
||||
|
|
||||
|
@Data |
||||
|
public static class ThirtyRequestLog{ |
||||
|
|
||||
|
/** 标题 长度255 */ |
||||
|
private String title; |
||||
|
|
||||
|
/** 业务模块 长度255 */ |
||||
|
private String module; |
||||
|
|
||||
|
/** 请求json 只接受json */ |
||||
|
private String requestJson; |
||||
|
|
||||
|
/** 返回json 只接受json */ |
||||
|
private String responseJson; |
||||
|
|
||||
|
/** 键id_1 长度255 */ |
||||
|
private String key1; |
||||
|
|
||||
|
/** 键id_2 长度255 */ |
||||
|
private String key2; |
||||
|
|
||||
|
/** 键id_3 长度255 */ |
||||
|
private String key3; |
||||
|
|
||||
|
/** 错误信息 长度不能超过1255字 */ |
||||
|
private String errorMsg; |
||||
|
|
||||
|
/** 严重程度:info,warning,error */ |
||||
|
private String logLevel; |
||||
|
|
||||
|
/** 状态:0-不成功,需要处理;1-成功 */ |
||||
|
private Integer successStatus; |
||||
|
|
||||
|
/** 备注 长度不能超过255字 */ |
||||
|
private String remark; |
||||
|
|
||||
|
/** 拓展1 长度不能超过255字 */ |
||||
|
private String extValue1; |
||||
|
|
||||
|
/** 拓展2 长度不能超过255字 */ |
||||
|
private String extValue2; |
||||
|
|
||||
|
/** 拓展3 长度不能超过255字 */ |
||||
|
private String extValue3; |
||||
|
|
||||
|
/** 拓展4 长度不能超过255字 */ |
||||
|
private String extValue4; |
||||
|
} |
||||
|
|
||||
|
} |
@ -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.tbs.mapper.TbsScheduleItemBudget2Mapper"> |
||||
|
|
||||
|
|
||||
|
<select id="listItemBudgetIds" resultType="com.qs.serve.modules.tbs.entity.dto.TbsScheduleItemBudgetIdDto"> |
||||
|
SELECT |
||||
|
tbs_schedule_item_budget.id as schedule_item_budget_id, |
||||
|
tbs_schedule_item_budget.schedule_item_id |
||||
|
FROM `tbs_schedule_item_budget` |
||||
|
LEFT JOIN tbs_budget on tbs_schedule_item_budget.budget_id = tbs_budget.id |
||||
|
LEFT JOIN tbs_budget_condition on tbs_budget_condition.budget_id = tbs_budget.id |
||||
|
where |
||||
|
tbs_schedule_item_budget.del_flag = 0 |
||||
|
and tbs_budget.del_flag = 0 |
||||
|
and tbs_budget.budget_state = 1 |
||||
|
<if test="query.centerCombos != null and query.centerCombos.size > 0"> |
||||
|
and tbs_budget.center_combo in |
||||
|
<foreach collection="query.centerCombos" item ="selectId" index="i" open="(" close=")" separator=","> |
||||
|
#{selectId} |
||||
|
</foreach> |
||||
|
</if> |
||||
|
<if test="query.brandIds != null and query.brandIds.size > 0"> |
||||
|
and |
||||
|
( |
||||
|
tbs_budget.condition_flag = 0 or tbs_budget_condition.brand_id in |
||||
|
<foreach collection="query.brandIds" item ="selectId" index="i" open="(" close=")" separator=","> |
||||
|
#{selectId} |
||||
|
</foreach> |
||||
|
) |
||||
|
</if> |
||||
|
and tbs_schedule_item_budget.schedule_item_id in |
||||
|
<foreach collection="query.scheduleItemIds" item ="selectId" index="i" open="(" close=")" separator=","> |
||||
|
#{selectId} |
||||
|
</foreach> |
||||
|
group by tbs_schedule_item_budget.id |
||||
|
</select> |
||||
|
|
||||
|
<select id="getSumAmtInList" resultType="com.qs.serve.modules.tbs.entity.dto.TbsBudgetLogWithAmount"> |
||||
|
select |
||||
|
schedule_item_id as id, |
||||
|
sum(amount) as amt |
||||
|
from tbs_budget_log |
||||
|
where |
||||
|
del_flag = 0 and opt_type in |
||||
|
<foreach collection="optNumbers" item ="selectId" index="i" open="(" close=")" separator=","> |
||||
|
#{selectId} |
||||
|
</foreach> |
||||
|
AND schedule_item_budget_id in |
||||
|
<foreach collection="selectIds" item ="selectId" index="i" open="(" close=")" separator=","> |
||||
|
#{selectId} |
||||
|
</foreach> |
||||
|
group by schedule_item_id |
||||
|
</select> |
||||
|
|
||||
|
<select id="getSumAmtNotInList" resultType="com.qs.serve.modules.tbs.entity.dto.TbsBudgetLogWithAmount"> |
||||
|
select |
||||
|
schedule_item_id as id, |
||||
|
sum(amount) as amt |
||||
|
from tbs_budget_log |
||||
|
where |
||||
|
del_flag = 0 and opt_type not in |
||||
|
<foreach collection="optNumbers" item ="selectId" index="i" open="(" close=")" separator=","> |
||||
|
#{selectId} |
||||
|
</foreach> |
||||
|
AND schedule_item_budget_id in |
||||
|
<foreach collection="selectIds" item ="selectId" index="i" open="(" close=")" separator=","> |
||||
|
#{selectId} |
||||
|
</foreach> |
||||
|
group by schedule_item_id |
||||
|
</select> |
||||
|
|
||||
|
<select id="getPolicyCheckingList" resultType="com.qs.serve.modules.tbs.entity.dto.TbsBudgetLogWithAmount"> |
||||
|
select |
||||
|
schedule_item_id as id, |
||||
|
sum(amount) as amt |
||||
|
from tbs_budget_log |
||||
|
left join tzc_policy on tbs_budget_log.policy_id = tzc_policy.id |
||||
|
where |
||||
|
tbs_budget_log.policy_id is not null |
||||
|
and tzc_policy.policy_status = 1 |
||||
|
and tbs_budget_log.del_flag = 0 |
||||
|
and tzc_policy.del_flag = 0 |
||||
|
and opt_type in |
||||
|
<foreach collection="optNumbers" item ="selectId" index="i" open="(" close=")" separator=","> |
||||
|
#{selectId} |
||||
|
</foreach> |
||||
|
AND schedule_item_budget_id in |
||||
|
<foreach collection="selectIds" item ="selectId" index="i" open="(" close=")" separator=","> |
||||
|
#{selectId} |
||||
|
</foreach> |
||||
|
group by schedule_item_id |
||||
|
</select> |
||||
|
|
||||
|
<select id="getCostCheckingList" resultType="com.qs.serve.modules.tbs.entity.dto.TbsBudgetLogWithAmount"> |
||||
|
select |
||||
|
schedule_item_id as id, |
||||
|
sum(amount) as amt |
||||
|
from tbs_budget_log |
||||
|
left join tbs_cost_apply on tbs_budget_log.cost_apply_id = tbs_cost_apply.id |
||||
|
where |
||||
|
tbs_budget_log.cost_apply_id is not null |
||||
|
and tbs_cost_apply.charge_state = 1 |
||||
|
and tbs_budget_log.del_flag = 0 |
||||
|
and tbs_cost_apply.del_flag = 0 |
||||
|
and opt_type in |
||||
|
<foreach collection="optNumbers" item ="selectId" index="i" open="(" close=")" separator=","> |
||||
|
#{selectId} |
||||
|
</foreach> |
||||
|
AND schedule_item_budget_id in |
||||
|
<foreach collection="selectIds" item ="selectId" index="i" open="(" close=")" separator=","> |
||||
|
#{selectId} |
||||
|
</foreach> |
||||
|
group by schedule_item_id |
||||
|
</select> |
||||
|
|
||||
|
</mapper> |
||||
|
|
Loading…
Reference in new issue