27 changed files with 347 additions and 9 deletions
@ -0,0 +1,44 @@ |
|||||
|
package com.qs.serve.modules.tbs.common.util; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
|
import com.qs.serve.common.util.SpringUtils; |
||||
|
import com.qs.serve.modules.sys.entity.SysConfig; |
||||
|
import com.qs.serve.modules.sys.service.SysConfigService; |
||||
|
import com.qs.serve.modules.tbs.entity.TbsActivity; |
||||
|
import org.springframework.beans.BeansException; |
||||
|
|
||||
|
import javax.swing.*; |
||||
|
import java.time.LocalDate; |
||||
|
|
||||
|
/** |
||||
|
* @author YenHex |
||||
|
* @since 2023/6/19 |
||||
|
*/ |
||||
|
public class TbsActivityUtil { |
||||
|
|
||||
|
public static void buildOverdue(LambdaQueryWrapper<TbsActivity> lqw,Integer queryState){ |
||||
|
if(queryState!=null){ |
||||
|
if(queryState.equals(0)){ |
||||
|
lqw.gt(TbsActivity::getActEndDate, LocalDate.now()); |
||||
|
}else if(queryState.equals(1)){ |
||||
|
lqw.le(TbsActivity::getActEndDate, LocalDate.now()); |
||||
|
}else if(queryState.equals(2)){ |
||||
|
LocalDate now = LocalDate.now(); |
||||
|
int sysConfOfWarningDays = 0; |
||||
|
try { |
||||
|
SysConfigService configService = SpringUtils.getBean(SysConfigService.class); |
||||
|
SysConfig config = configService.getByKey("ExpenseApplicationActivityWriteOffOverdueWarningDays"); |
||||
|
String val = config.getConfigValue(); |
||||
|
sysConfOfWarningDays = Integer.parseInt(val); |
||||
|
} catch (BeansException | NumberFormatException e) { |
||||
|
e.printStackTrace(); |
||||
|
} |
||||
|
LocalDate startNow = now.plusDays( - sysConfOfWarningDays ); |
||||
|
lqw.between(TbsActivity::getActEndDate,startNow , now); |
||||
|
}else { |
||||
|
lqw.eq(TbsActivity::getId,"0"); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,30 @@ |
|||||
|
package com.qs.serve.modules.tbs.entity.so; |
||||
|
|
||||
|
import com.fasterxml.jackson.annotation.JsonIgnore; |
||||
|
import com.fasterxml.jackson.annotation.JsonProperty; |
||||
|
import lombok.Data; |
||||
|
import org.springframework.format.annotation.DateTimeFormat; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.time.LocalDate; |
||||
|
import java.time.LocalDateTime; |
||||
|
|
||||
|
/** |
||||
|
* 费用申请 VO |
||||
|
* @author YenHex |
||||
|
* @since 2022-11-09 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class TbsCostApplySo implements Serializable { |
||||
|
|
||||
|
/** |
||||
|
* 0=>未逾期、1=>已逾期、2=>即将逾期 |
||||
|
*/ |
||||
|
Integer overdueState; |
||||
|
|
||||
|
LocalDate nowDate; |
||||
|
|
||||
|
LocalDate startNowDate; |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,96 @@ |
|||||
|
<?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.TbsCostApplyMapper"> |
||||
|
|
||||
|
<resultMap id="tbsCostApplyMap" type="com.qs.serve.modules.tbs.entity.TbsCostApply" > |
||||
|
<result property="id" column="id"/> |
||||
|
<result property="code" column="code"/> |
||||
|
<result property="chargeTheme" column="charge_theme"/> |
||||
|
<result property="supplierId" column="supplier_id"/> |
||||
|
<result property="supplierCode" column="supplier_code"/> |
||||
|
<result property="supplierName" column="supplier_name"/> |
||||
|
<result property="chargeState" column="charge_state"/> |
||||
|
<result property="submitTime" column="submit_time"/> |
||||
|
<result property="passTime" column="pass_time"/> |
||||
|
<result property="remark" column="remark"/> |
||||
|
<result property="userId" column="user_id"/> |
||||
|
<result property="userCode" column="user_code"/> |
||||
|
<result property="userName" column="user_name"/> |
||||
|
<result property="syFormId" column="sy_form_id"/> |
||||
|
<result property="syFlowId" column="sy_flow_id"/> |
||||
|
<result property="totalActivity" column="total_activity"/> |
||||
|
<result property="totalActivityAmount" column="total_activity_amount"/> |
||||
|
<result property="totalActivityUsedAmount" column="total_activity_used_amount"/> |
||||
|
<result property="contractFlag" column="contract_flag"/> |
||||
|
<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="templateId" column="template_id"/> |
||||
|
</resultMap> |
||||
|
|
||||
|
<sql id="tbsCostApplySql"> |
||||
|
tbs_cost_apply.`id`, |
||||
|
tbs_cost_apply.`code`, |
||||
|
tbs_cost_apply.`charge_theme`, |
||||
|
tbs_cost_apply.`supplier_id`, |
||||
|
tbs_cost_apply.`supplier_code`, |
||||
|
tbs_cost_apply.`supplier_name`, |
||||
|
tbs_cost_apply.`charge_state`, |
||||
|
tbs_cost_apply.`submit_time`, |
||||
|
tbs_cost_apply.`pass_time`, |
||||
|
tbs_cost_apply.`remark`, |
||||
|
tbs_cost_apply.`user_id`, |
||||
|
tbs_cost_apply.`user_code`, |
||||
|
tbs_cost_apply.`user_name`, |
||||
|
tbs_cost_apply.`sy_form_id`, |
||||
|
tbs_cost_apply.`sy_flow_id`, |
||||
|
tbs_cost_apply.`total_activity`, |
||||
|
tbs_cost_apply.`total_activity_amount`, |
||||
|
tbs_cost_apply.`total_activity_used_amount`, |
||||
|
tbs_cost_apply.`contract_flag`, |
||||
|
tbs_cost_apply.`create_time`, |
||||
|
tbs_cost_apply.`update_time`, |
||||
|
tbs_cost_apply.`tenant_id`, |
||||
|
tbs_cost_apply.`create_by`, |
||||
|
tbs_cost_apply.`update_by`, |
||||
|
tbs_cost_apply.`del_flag`, |
||||
|
tbs_cost_apply.`template_id` </sql> |
||||
|
|
||||
|
|
||||
|
|
||||
|
<select id="selectCostApplyList" parameterType="com.qs.serve.modules.tbs.entity.TbsCostApply" resultMap="tbsCostApplyMap"> |
||||
|
SELECT ${ew.sqlSelect} |
||||
|
FROM `tbs_cost_apply` `tbs_cost_apply` |
||||
|
left JOIN `tbs_activity` on `tbs_cost_apply`.id = `tbs_activity`.cost_apply_id |
||||
|
WHERE `tbs_cost_apply`.`del_flag` = 0 |
||||
|
and `tbs_activity`.`del_flag` = 0 |
||||
|
<if test="query!=null"> |
||||
|
<if test="query.overdueState!=null and query.overdueState==0"> |
||||
|
and `tbs_activity`.`activity_state` = 0 |
||||
|
and `tbs_cost_apply`.`charge_state` = 1 |
||||
|
and `tbs_activity`.act_end_date > #{query.nowDate} |
||||
|
</if> |
||||
|
<if test="query.overdueState!=null and query.overdueState==1"> |
||||
|
and `tbs_activity`.`activity_state` = 0 |
||||
|
and `tbs_cost_apply`.`charge_state` = 1 |
||||
|
and `tbs_activity`.act_end_date <= #{query.nowDate} |
||||
|
</if> |
||||
|
<if test="query.overdueState!=null and query.overdueState==2"> |
||||
|
and `tbs_activity`.`activity_state` = 0 |
||||
|
and `tbs_cost_apply`.`charge_state` = 1 |
||||
|
and `tbs_activity`.act_end_date >= #{query.startNowDate} |
||||
|
and `tbs_activity`.act_end_date < #{query.nowDate} |
||||
|
</if> |
||||
|
</if> |
||||
|
<if test="ew != null"> |
||||
|
<if test="ew.nonEmptyOfWhere"> |
||||
|
AND ${ew.sqlSegment} |
||||
|
</if> |
||||
|
</if> |
||||
|
</select> |
||||
|
|
||||
|
</mapper> |
||||
|
|
Loading…
Reference in new issue