11 changed files with 412 additions and 23 deletions
@ -0,0 +1,86 @@ |
|||||
|
package com.qs.serve.modules.sys.entity; |
||||
|
|
||||
|
import java.time.LocalDate; |
||||
|
import java.io.Serializable; |
||||
|
import java.math.BigDecimal; |
||||
|
import java.time.LocalDateTime; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.*; |
||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
|
import com.fasterxml.jackson.annotation.JsonIgnore; |
||||
|
import com.fasterxml.jackson.annotation.JsonProperty; |
||||
|
import lombok.Data; |
||||
|
import org.hibernate.validator.constraints.Length; |
||||
|
import org.springframework.format.annotation.DateTimeFormat; |
||||
|
|
||||
|
import javax.validation.constraints.NotNull; |
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
|
||||
|
/** |
||||
|
* 删除日志 实体类 |
||||
|
* @author YenHex |
||||
|
* @since 2023-12-08 |
||||
|
*/ |
||||
|
@Data |
||||
|
@TableName("sys_delete_log") |
||||
|
public class SysDeleteLog implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** id */ |
||||
|
@TableId(type = IdType.AUTO) |
||||
|
private Long id; |
||||
|
|
||||
|
/** 删除批次 */ |
||||
|
private String batchCode; |
||||
|
|
||||
|
/** 选项类型 */ |
||||
|
@Length(max = 50,message = "选项类型长度不能超过50字") |
||||
|
private String targetTable; |
||||
|
|
||||
|
/** 目标id */ |
||||
|
@Length(max = 100,message = "目标id长度不能超过100字") |
||||
|
private String targetId; |
||||
|
|
||||
|
/** 目标编码 */ |
||||
|
@Length(max = 100,message = "目标编码长度不能超过100字") |
||||
|
private String targetCode; |
||||
|
|
||||
|
/** 备注 */ |
||||
|
@Length(max = 255,message = "备注长度不能超过255字") |
||||
|
private String remark; |
||||
|
|
||||
|
/** 创建时间 */ |
||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
||||
|
@TableField(fill = FieldFill.INSERT) |
||||
|
private LocalDateTime createTime; |
||||
|
|
||||
|
/** 创建人 */ |
||||
|
@TableField(fill = FieldFill.INSERT) |
||||
|
private String createBy; |
||||
|
|
||||
|
/** 更新时间 */ |
||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
||||
|
@TableField(fill = FieldFill.UPDATE) |
||||
|
private LocalDateTime updateTime; |
||||
|
|
||||
|
/** 更新人 */ |
||||
|
@TableField(fill = FieldFill.UPDATE) |
||||
|
private String updateBy; |
||||
|
|
||||
|
/** 租户id */ |
||||
|
@JsonIgnore |
||||
|
@JsonProperty |
||||
|
private String tenantId; |
||||
|
|
||||
|
/** 删除标识 */ |
||||
|
@JsonIgnore |
||||
|
@JsonProperty |
||||
|
private Boolean delFlag; |
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,14 @@ |
|||||
|
package com.qs.serve.modules.sys.mapper; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import com.qs.serve.modules.sys.entity.SysDeleteLog; |
||||
|
|
||||
|
/** |
||||
|
* 删除日志 Mapper |
||||
|
* @author YenHex |
||||
|
* @date 2023-12-08 |
||||
|
*/ |
||||
|
public interface SysDeleteLogMapper extends BaseMapper<SysDeleteLog> { |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,21 @@ |
|||||
|
package com.qs.serve.modules.sys.service; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.extension.service.IService; |
||||
|
import com.qs.serve.modules.sys.entity.SysDeleteLog; |
||||
|
|
||||
|
/** |
||||
|
* 删除日志 服务接口 |
||||
|
* @author YenHex |
||||
|
* @date 2023-12-08 |
||||
|
*/ |
||||
|
public interface SysDeleteLogService extends IService<SysDeleteLog> { |
||||
|
|
||||
|
/** |
||||
|
* 删除费用申请相关所有数据 |
||||
|
* @param costApplyId |
||||
|
* @param remark |
||||
|
*/ |
||||
|
void deleteCostApply(Long costApplyId,String remark); |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,117 @@ |
|||||
|
package com.qs.serve.modules.sys.service.impl; |
||||
|
import java.time.LocalDateTime; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
|
import com.qs.serve.common.util.IdUtil; |
||||
|
import com.qs.serve.modules.tbs.entity.TbsCostApply; |
||||
|
import com.qs.serve.modules.tbs.entity.TbsCostTodo; |
||||
|
import com.qs.serve.modules.tbs.mapper.TbsCostApplyMapper; |
||||
|
import com.qs.serve.modules.tbs.mapper.TbsCostApplyRemoveMapper; |
||||
|
import com.qs.serve.modules.tbs.mapper.TbsCostTodoMapper; |
||||
|
import com.qs.serve.modules.vtb.entity.VtbVerification; |
||||
|
import com.qs.serve.modules.vtb.mapper.VtbVerificationMapper; |
||||
|
import com.qs.serve.modules.vtb.service.VtbVerificationService; |
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import com.qs.serve.modules.sys.entity.SysDeleteLog; |
||||
|
import com.qs.serve.modules.sys.service.SysDeleteLogService; |
||||
|
import com.qs.serve.modules.sys.mapper.SysDeleteLogMapper; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
|
||||
|
import java.util.ArrayList; |
||||
|
import java.util.List; |
||||
|
/** |
||||
|
* 删除日志 服务实现类 |
||||
|
* @author YenHex |
||||
|
* @since 2023-12-08 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@Service |
||||
|
@AllArgsConstructor |
||||
|
public class SysDeleteLogServiceImpl extends ServiceImpl<SysDeleteLogMapper,SysDeleteLog> implements SysDeleteLogService { |
||||
|
|
||||
|
private final TbsCostApplyRemoveMapper tbsCostApplyRemoveMapper; |
||||
|
private final TbsCostApplyMapper tbsCostApplyMapper; |
||||
|
private final VtbVerificationMapper verificationMapper; |
||||
|
private final TbsCostTodoMapper tbsCostTodoMapper; |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void deleteCostApply(Long costApplyId,String remark) { |
||||
|
TbsCostApply costApply = tbsCostApplyMapper.selectById(costApplyId); |
||||
|
String batchCode = System.currentTimeMillis()+""; |
||||
|
List<SysDeleteLog> deleteLogList = new ArrayList<>(); |
||||
|
if(costApply!=null){ |
||||
|
SysDeleteLog deleteLog = new SysDeleteLog(); |
||||
|
deleteLog.setBatchCode(batchCode); |
||||
|
deleteLog.setTargetTable("tbs_cost_apply"); |
||||
|
deleteLog.setTargetId(costApply.getId()+""); |
||||
|
deleteLog.setTargetCode(costApply.getCode()); |
||||
|
deleteLog.setRemark(remark); |
||||
|
deleteLogList.add(deleteLog); |
||||
|
} |
||||
|
|
||||
|
tbsCostApplyRemoveMapper.tbs_cost_apply(costApplyId); |
||||
|
|
||||
|
tbsCostApplyRemoveMapper.tbs_activity(costApplyId); |
||||
|
tbsCostApplyRemoveMapper.tbs_activity_center(costApplyId); |
||||
|
tbsCostApplyRemoveMapper.tbs_activity_center_goods(costApplyId); |
||||
|
tbsCostApplyRemoveMapper.tbs_activity_goods(costApplyId); |
||||
|
tbsCostApplyRemoveMapper.tbs_activity_channel(costApplyId); |
||||
|
tbsCostApplyRemoveMapper.tbs_activity_channel_point(costApplyId); |
||||
|
tbsCostApplyRemoveMapper.tbs_activity_pay_condition(costApplyId); |
||||
|
tbsCostApplyRemoveMapper.tbs_activity_slotting_fee(costApplyId); |
||||
|
tbsCostApplyRemoveMapper.tbs_activity_subject(costApplyId); |
||||
|
tbsCostApplyRemoveMapper.tbs_activity_subject_yarn(costApplyId); |
||||
|
//记录进行中的核销
|
||||
|
LambdaQueryWrapper<VtbVerification> verificationLqw = new LambdaQueryWrapper<>(); |
||||
|
verificationLqw.eq(VtbVerification::getCostApplyId,costApplyId); |
||||
|
List<VtbVerification> vtbVerificationList = verificationMapper.selectList(verificationLqw); |
||||
|
for (VtbVerification verification : vtbVerificationList) { |
||||
|
SysDeleteLog deleteLog = new SysDeleteLog(); |
||||
|
deleteLog.setBatchCode(batchCode); |
||||
|
deleteLog.setTargetTable("vtb_verification"); |
||||
|
deleteLog.setTargetId(verification.getId()+""); |
||||
|
deleteLog.setTargetCode(verification.getVerificationCode()); |
||||
|
deleteLog.setRemark(remark); |
||||
|
deleteLogList.add(deleteLog); |
||||
|
} |
||||
|
tbsCostApplyRemoveMapper.vtb_verification(costApplyId); |
||||
|
tbsCostApplyRemoveMapper.pay_payment(costApplyId); |
||||
|
tbsCostApplyRemoveMapper.pay_payment_item(costApplyId); |
||||
|
tbsCostApplyRemoveMapper.tbs_budget_log(costApplyId); |
||||
|
tbsCostApplyRemoveMapper.tbs_budget_cost_item(costApplyId); |
||||
|
tbsCostApplyRemoveMapper.tbs_budget_cost_item_split(costApplyId); |
||||
|
tbsCostApplyRemoveMapper.vtb_fund_flow(costApplyId); |
||||
|
tbsCostApplyRemoveMapper.bir_activity_center_goods(costApplyId); |
||||
|
tbsCostApplyRemoveMapper.bir_base_activity(costApplyId); |
||||
|
tbsCostApplyRemoveMapper.bir_payment_item(costApplyId); |
||||
|
tbsCostApplyRemoveMapper.vtb_verification_subject(costApplyId); |
||||
|
tbsCostApplyRemoveMapper.vtb_verification_yard_item(costApplyId); |
||||
|
tbsCostApplyRemoveMapper.vtb_verification_yard_center_item(costApplyId); |
||||
|
tbsCostApplyRemoveMapper.vtb_verification_subject_center(costApplyId); |
||||
|
tbsCostApplyRemoveMapper.vtb_verification_channel_point(costApplyId); |
||||
|
tbsCostApplyRemoveMapper.vtb_verification_channel(costApplyId); |
||||
|
tbsCostApplyRemoveMapper.tbs_cost_contract(costApplyId); |
||||
|
tbsCostApplyRemoveMapper.tbs_cost_percent(costApplyId); |
||||
|
//记录进行中的协议条款
|
||||
|
LambdaQueryWrapper<TbsCostTodo> todoLqw = new LambdaQueryWrapper<>(); |
||||
|
todoLqw.eq(TbsCostTodo::getCostApplyId,costApplyId); |
||||
|
List<TbsCostTodo> costTodoList = tbsCostTodoMapper.selectList(todoLqw); |
||||
|
for (TbsCostTodo costTodo : costTodoList) { |
||||
|
SysDeleteLog deleteLog = new SysDeleteLog(); |
||||
|
deleteLog.setBatchCode(batchCode); |
||||
|
deleteLog.setTargetTable("tbs_cost_todo"); |
||||
|
deleteLog.setTargetId(costTodo.getId()+""); |
||||
|
deleteLog.setTargetCode(costTodo.getTodoCode()); |
||||
|
deleteLog.setRemark(remark); |
||||
|
deleteLogList.add(deleteLog); |
||||
|
} |
||||
|
tbsCostApplyRemoveMapper.tbs_cost_todo(costApplyId); |
||||
|
this.saveBatch(deleteLogList); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,101 @@ |
|||||
|
package com.qs.serve.modules.tbs.mapper; |
||||
|
|
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
import org.apache.ibatis.annotations.Update; |
||||
|
|
||||
|
/** |
||||
|
* @author YenHex |
||||
|
* @since 2023/12/8 |
||||
|
*/ |
||||
|
public interface TbsCostApplyRemoveMapper { |
||||
|
|
||||
|
@Update("update tbs_cost_apply set del_flag = 0 where id = #{costApplyId}") |
||||
|
int tbs_cost_apply(@Param("costApplyId") Long costId); |
||||
|
|
||||
|
@Update("update tbs_activity set del_flag = 0 where cost_apply_id = #{costApplyId}") |
||||
|
int tbs_activity(@Param("costApplyId") Long costId); |
||||
|
|
||||
|
@Update("update tbs_activity_center set del_flag = 0 where cost_apply_id = #{costApplyId}") |
||||
|
int tbs_activity_center(@Param("costApplyId") Long costId); |
||||
|
|
||||
|
@Update("update tbs_activity_center_goods set del_flag = 0 where cost_apply_id = #{costApplyId}") |
||||
|
int tbs_activity_center_goods(@Param("costApplyId") Long costId); |
||||
|
|
||||
|
@Update("update tbs_activity_goods set del_flag = 0 where cost_apply_id = #{costApplyId}") |
||||
|
int tbs_activity_goods(@Param("costApplyId") Long costId); |
||||
|
|
||||
|
@Update("update tbs_activity_channel set del_flag = 0 where cost_apply_id = #{costApplyId}") |
||||
|
int tbs_activity_channel(@Param("costApplyId") Long costId); |
||||
|
|
||||
|
@Update("update tbs_activity_channel_point set del_flag = 0 where cost_apply_id = #{costApplyId}") |
||||
|
int tbs_activity_channel_point(@Param("costApplyId") Long costId); |
||||
|
|
||||
|
@Update("update tbs_activity_pay_condition set del_flag = 0 where cost_apply_id = #{costApplyId}") |
||||
|
int tbs_activity_pay_condition(@Param("costApplyId") Long costId); |
||||
|
|
||||
|
@Update("update tbs_activity_slotting_fee set del_flag = 0 where cost_apply_id = #{costApplyId}") |
||||
|
int tbs_activity_slotting_fee(@Param("costApplyId") Long costId); |
||||
|
|
||||
|
@Update("update tbs_activity_subject set del_flag = 0 where cost_apply_id = #{costApplyId}") |
||||
|
int tbs_activity_subject(@Param("costApplyId") Long costId); |
||||
|
|
||||
|
@Update("update tbs_activity_subject_yarn set del_flag = 0 where cost_apply_id = #{costApplyId}") |
||||
|
int tbs_activity_subject_yarn(@Param("costApplyId") Long costId); |
||||
|
|
||||
|
@Update("update vtb_verification set del_flag = 0 where cost_apply_id = #{costApplyId}") |
||||
|
int vtb_verification(@Param("costApplyId") Long costId); |
||||
|
|
||||
|
@Update("update pay_payment set del_flag = 0 where cost_apply_id = #{costApplyId}") |
||||
|
int pay_payment(@Param("costApplyId") Long costId); |
||||
|
|
||||
|
@Update("update pay_payment_item set del_flag = 0 where cost_apply_id = #{costApplyId}") |
||||
|
int pay_payment_item(@Param("costApplyId") Long costId); |
||||
|
|
||||
|
@Update("update tbs_budget_log set del_flag = 0 where cost_apply_id = #{costApplyId}") |
||||
|
int tbs_budget_log(@Param("costApplyId") Long costId); |
||||
|
|
||||
|
@Update("update tbs_budget_cost_item set del_flag = 0 where cost_apply_id = #{costApplyId}") |
||||
|
int tbs_budget_cost_item(@Param("costApplyId") Long costId); |
||||
|
|
||||
|
@Update("update tbs_budget_cost_item_split set del_flag = 0 where cost_apply_id = #{costApplyId}") |
||||
|
int tbs_budget_cost_item_split(@Param("costApplyId") Long costId); |
||||
|
|
||||
|
@Update("update vtb_fund_flow set del_flag = 0 where cost_apply_id = #{costApplyId}") |
||||
|
int vtb_fund_flow(@Param("costApplyId") Long costId); |
||||
|
|
||||
|
@Update("update bir_activity_center_goods set del_flag = 0 where cost_apply_id = #{costApplyId}") |
||||
|
int bir_activity_center_goods(@Param("costApplyId") Long costId); |
||||
|
|
||||
|
@Update("update bir_base_activity set del_flag = 0 where cost_apply_id = #{costApplyId}") |
||||
|
int bir_base_activity(@Param("costApplyId") Long costId); |
||||
|
|
||||
|
@Update("update bir_payment_item set del_flag = 0 where cost_apply_id = #{costApplyId}") |
||||
|
int bir_payment_item(@Param("costApplyId") Long costId); |
||||
|
|
||||
|
@Update("update vtb_verification_subject set del_flag = 0 where cost_apply_id = #{costApplyId}") |
||||
|
int vtb_verification_subject(@Param("costApplyId") Long costId); |
||||
|
|
||||
|
@Update("update vtb_verification_yard_item set del_flag = 0 where cost_apply_id = #{costApplyId}") |
||||
|
int vtb_verification_yard_item(@Param("costApplyId") Long costId); |
||||
|
|
||||
|
@Update("update vtb_verification_yard_center_item set del_flag = 0 where cost_apply_id = #{costApplyId}") |
||||
|
int vtb_verification_yard_center_item(@Param("costApplyId") Long costId); |
||||
|
|
||||
|
@Update("update vtb_verification_subject_center set del_flag = 0 where cost_apply_id = #{costApplyId}") |
||||
|
int vtb_verification_subject_center(@Param("costApplyId") Long costId); |
||||
|
|
||||
|
@Update("update vtb_verification_channel_point set del_flag = 0 where cost_apply_id = #{costApplyId}") |
||||
|
int vtb_verification_channel_point(@Param("costApplyId") Long costId); |
||||
|
|
||||
|
@Update("update vtb_verification_channel set del_flag = 0 where cost_apply_id = #{costApplyId}") |
||||
|
int vtb_verification_channel(@Param("costApplyId") Long costId); |
||||
|
|
||||
|
@Update("update tbs_cost_contract set del_flag = 0 where cost_apply_id = #{costApplyId}") |
||||
|
int tbs_cost_contract(@Param("costApplyId") Long costId); |
||||
|
|
||||
|
@Update("update tbs_cost_percent set del_flag = 0 where cost_apply_id = #{costApplyId}") |
||||
|
int tbs_cost_percent(@Param("costApplyId") Long costId); |
||||
|
|
||||
|
@Update("update tbs_cost_todo set del_flag = 0 where cost_apply_id = #{costApplyId}") |
||||
|
int tbs_cost_todo(@Param("costApplyId") Long costId); |
||||
|
} |
Loading…
Reference in new issue