@ -1,5 +1,8 @@
package com.qs.serve.modules.tbs.service.impl ;
package com.qs.serve.modules.tbs.service.impl ;
import java.util.List ;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper ;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl ;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl ;
import com.qs.serve.common.config.properties.ProjectProperties ;
import com.qs.serve.common.config.properties.ProjectProperties ;
import com.qs.serve.common.model.dto.R ;
import com.qs.serve.common.model.dto.R ;
@ -15,9 +18,11 @@ import com.qs.serve.modules.sys.mapper.SysUserMapper;
import com.qs.serve.modules.tbs.common.TbsCommonCheckState ;
import com.qs.serve.modules.tbs.common.TbsCommonCheckState ;
import com.qs.serve.modules.tbs.common.TbsSeeYonConst ;
import com.qs.serve.modules.tbs.common.TbsSeeYonConst ;
import com.qs.serve.modules.tbs.entity.TbsBudget ;
import com.qs.serve.modules.tbs.entity.TbsBudget ;
import com.qs.serve.modules.tbs.entity.TbsCostApply ;
import com.qs.serve.modules.tbs.entity.TbsCostTodo ;
import com.qs.serve.modules.tbs.entity.TbsCostTodo ;
import com.qs.serve.modules.tbs.entity.bo.TbsAffairCommitBo ;
import com.qs.serve.modules.tbs.entity.bo.TbsAffairCommitBo ;
import com.qs.serve.modules.tbs.entity.bo.TbsSubmitToDoBo ;
import com.qs.serve.modules.tbs.entity.bo.TbsSubmitToDoBo ;
import com.qs.serve.modules.tbs.mapper.TbsCostApplyMapper ;
import com.qs.serve.modules.tbs.mapper.TbsCostTodoMapper ;
import com.qs.serve.modules.tbs.mapper.TbsCostTodoMapper ;
import com.qs.serve.modules.tbs.service.TbsCostTodoService ;
import com.qs.serve.modules.tbs.service.TbsCostTodoService ;
import lombok.AllArgsConstructor ;
import lombok.AllArgsConstructor ;
@ -26,6 +31,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional ;
import org.springframework.transaction.annotation.Transactional ;
import java.time.LocalDateTime ;
import java.time.LocalDateTime ;
import java.util.ArrayList ;
import java.util.HashMap ;
import java.util.HashMap ;
import java.util.Map ;
import java.util.Map ;
@ -40,6 +46,7 @@ import java.util.Map;
public class TbsCostTodoOperationServiceImpl implements SeeYonOperationService {
public class TbsCostTodoOperationServiceImpl implements SeeYonOperationService {
private final TbsCostTodoMapper tbsCostTodoMapper ;
private final TbsCostTodoMapper tbsCostTodoMapper ;
private final TbsCostApplyMapper tbsCostApplyMapper ;
private final SysUserMapper sysUserMapper ;
private final SysUserMapper sysUserMapper ;
private final ProjectProperties projectProperties ;
private final ProjectProperties projectProperties ;
private final SeeYonRequestService seeYonService ;
private final SeeYonRequestService seeYonService ;
@ -97,6 +104,11 @@ public class TbsCostTodoOperationServiceImpl implements SeeYonOperationService {
costTodo . setAttachDesc ( param . getAttachDesc ( ) ) ;
costTodo . setAttachDesc ( param . getAttachDesc ( ) ) ;
tbsCostTodoMapper . updateById ( costTodo ) ;
tbsCostTodoMapper . updateById ( costTodo ) ;
TbsCostApply costApply = new TbsCostApply ( ) ;
costApply . setId ( costTodo . getCostApplyId ( ) ) ;
costApply . setAgreeCheckStatus ( 1 ) ;
tbsCostApplyMapper . updateById ( costApply ) ;
}
}
@Override
@Override
@ -119,6 +131,7 @@ public class TbsCostTodoOperationServiceImpl implements SeeYonOperationService {
costTodo . setId ( Long . parseLong ( param . getTargetId ( ) ) ) ;
costTodo . setId ( Long . parseLong ( param . getTargetId ( ) ) ) ;
costTodo . setCheckStatus ( TbsCommonCheckState . State_3_setback ) ;
costTodo . setCheckStatus ( TbsCommonCheckState . State_3_setback ) ;
tbsCostTodoMapper . updateById ( costTodo ) ;
tbsCostTodoMapper . updateById ( costTodo ) ;
this . updateAgreeStatus ( param . getTargetId ( ) ) ;
return null ;
return null ;
}
}
@ -130,6 +143,7 @@ public class TbsCostTodoOperationServiceImpl implements SeeYonOperationService {
costTodo . setFinishedFlag ( 1 ) ;
costTodo . setFinishedFlag ( 1 ) ;
costTodo . setCheckStatus ( TbsCommonCheckState . State_2_finished ) ;
costTodo . setCheckStatus ( TbsCommonCheckState . State_2_finished ) ;
tbsCostTodoMapper . updateById ( costTodo ) ;
tbsCostTodoMapper . updateById ( costTodo ) ;
this . updateAgreeStatus ( param . getTargetId ( ) ) ;
return null ;
return null ;
}
}
@ -139,9 +153,42 @@ public class TbsCostTodoOperationServiceImpl implements SeeYonOperationService {
costTodo . setId ( Long . parseLong ( param . getTargetId ( ) ) ) ;
costTodo . setId ( Long . parseLong ( param . getTargetId ( ) ) ) ;
costTodo . setCheckStatus ( TbsCommonCheckState . State_4_stop ) ;
costTodo . setCheckStatus ( TbsCommonCheckState . State_4_stop ) ;
tbsCostTodoMapper . updateById ( costTodo ) ;
tbsCostTodoMapper . updateById ( costTodo ) ;
this . updateAgreeStatus ( param . getTargetId ( ) ) ;
return null ;
return null ;
}
}
/ * *
* 更新活动的验收状态
* @param targetId
* /
private void updateAgreeStatus ( String targetId ) {
TbsCostTodo obj = tbsCostTodoMapper . selectById ( targetId ) ;
Long costId = obj . getCostApplyId ( ) ;
LambdaQueryWrapper < TbsCostTodo > lqw = new LambdaQueryWrapper < > ( ) ;
lqw . eq ( TbsCostTodo : : getCostApplyId , costId ) ;
List < TbsCostTodo > costTodoList = tbsCostTodoMapper . selectList ( lqw ) ;
boolean unfinished = false ;
boolean finished = false ;
for ( TbsCostTodo todo : costTodoList ) {
if ( ! todo . getCheckStatus ( ) . equals ( TbsCommonCheckState . State_2_finished ) ) {
unfinished = true ;
} else {
finished = true ;
}
}
TbsCostApply costApply = new TbsCostApply ( ) ;
costApply . setId ( costId ) ;
if ( finished & & ! unfinished ) {
costApply . setAgreeCheckStatus ( 3 ) ;
} else if ( finished ) {
costApply . setAgreeCheckStatus ( 2 ) ;
} else if ( unfinished ) {
costApply . setAgreeCheckStatus ( 0 ) ;
}
costApply . setAgreeCheckStatus ( 2 ) ;
tbsCostApplyMapper . updateById ( costApply ) ;
}
@Override
@Override
public boolean checkSyFormIdIsNotNull ( String targetId ) {
public boolean checkSyFormIdIsNotNull ( String targetId ) {
TbsCostTodo obj = tbsCostTodoMapper . selectById ( targetId ) ;
TbsCostTodo obj = tbsCostTodoMapper . selectById ( targetId ) ;