资产修改

main
dongdingding 2 months ago
parent 95fe875751
commit 62b6610647

@ -47,4 +47,11 @@ public class AssestTaskXqresponse {
*/ */
@ApiModelProperty("审核状态0待核查1待审核3审核通过4审核不通过5已报废") @ApiModelProperty("审核状态0待核查1待审核3审核通过4审核不通过5已报废")
private String status; private String status;
/**
*
*/
@ApiModelProperty("不通过原因")
private String btgyy;
} }

@ -5,6 +5,7 @@ import com.ruoyi.tc.entity.po.AssetCurrentCpPo;
import org.apache.ibatis.annotations.Delete; import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import java.util.List; import java.util.List;
@ -16,15 +17,11 @@ import java.util.List;
*/ */
public interface AssetCurrentCpMapper extends BaseMapper<AssetCurrentCpPo> { public interface AssetCurrentCpMapper extends BaseMapper<AssetCurrentCpPo> {
/** /**
*
* @param assetId * @param assetId
* @param taskId * @param taskId
*/ */
@Delete("delete from asset_current_cp where id=#{assetId} and task_id =#{taskId} ") @Delete("delete from asset_current_cp where id=#{assetId} and task_id =#{taskId} ")
void deletByAssetIdandTaskId(@Param("assetId") Long assetId, @Param("taskId")int taskId); void deletByAssetIdandTaskId(@Param("assetId") Long assetId, @Param("taskId") int taskId);
/** /**
@ -35,5 +32,16 @@ public interface AssetCurrentCpMapper extends BaseMapper<AssetCurrentCpPo> {
*/ */
@Select("select * from asset_current_cp where task_id=#{taskId}") @Select("select * from asset_current_cp where task_id=#{taskId}")
List<AssetCurrentCpPo> findByTaskId(int taskId); List<AssetCurrentCpPo> findByTaskId(int taskId);
/**
*
*
* @param assetId id
* @param taskId id
* @param btgyy
*/
@Update("update asset_current_cp set btgyy=#{btgyy} where id=#{assetId} and task_id =#{taskId} ")
void updateByAssetId(@Param("assetId") Integer assetId, @Param("taskId") Integer taskId, @Param("btgyy") String btgyy);
} }

@ -165,7 +165,7 @@ public interface AssetTaskMapper extends BaseMapper<AssetTask> {
* @return * @return
*/ */
int updateByTaskId(@Param("taskStatus") Integer taskStatus, @Param("taskId") Integer taskId, @Param("finishTime") LocalDateTime finishTime,@Param("btgyy")String btgyy); int updateByTaskId(@Param("taskStatus") Integer taskStatus, @Param("taskId") Integer taskId, @Param("finishTime") LocalDateTime finishTime);
/** /**

@ -30,5 +30,15 @@ public interface AssetCurrentCpService extends IService<AssetCurrentCpPo> {
*/ */
List<AssetCurrentCpPo> findByTaskId(int taskId); List<AssetCurrentCpPo> findByTaskId(int taskId);
/**
*
*
* @param assetId id
* @param taskId id
* @param btgyy
*/
void updateByAssetId(Integer assetId, Integer taskId, String btgyy);
} }

@ -29,5 +29,10 @@ public class AssetCurrentCpServiceImpl extends ServiceImpl<AssetCurrentCpMapper,
public List<AssetCurrentCpPo> findByTaskId(int taskId) { public List<AssetCurrentCpPo> findByTaskId(int taskId) {
return assetCurrentCpMapper.findByTaskId(taskId); return assetCurrentCpMapper.findByTaskId(taskId);
} }
@Override
public void updateByAssetId(Integer assetId, Integer taskId, String btgyy) {
assetCurrentCpMapper.updateByAssetId(assetId,taskId,btgyy);
}
} }

@ -291,12 +291,14 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
} else if (allApproved && !hasPendingApproval && !hasRejected && hasExpired) { } else if (allApproved && !hasPendingApproval && !hasRejected && hasExpired) {
// 资产状态全部为已通过,资产完成时间有超期的为超期完成 // 资产状态全部为已通过,资产完成时间有超期的为超期完成
taskStatus = 3; taskStatus = 3;
btgyy=req.getBtgyy();
finishTime = LocalDateTime.now(); finishTime = LocalDateTime.now();
taskSaveOrDelete(req); taskSaveOrDelete(req);
} else if (hasRejected) { } else if (hasRejected) {
// 审核不通过 // 审核不通过
taskStatus = 1; taskStatus = 1;
btgyy=req.getBtgyy();
//修改不通过原因
assetCurrentCpService.updateByAssetId(req.getAssetId(), req.getTaskId(), btgyy);
} else if (hased && !hasRejected && !hasExpired) { } else if (hased && !hasRejected && !hasExpired) {
//存在已报废并且其他都已完成 且未超期 //存在已报废并且其他都已完成 且未超期
taskStatus = 2; taskStatus = 2;
@ -312,7 +314,7 @@ public class AssetTaskServiceImpl extends ServiceImpl<AssetTaskMapper, AssetTask
taskStatus = 3; taskStatus = 3;
} }
//修改主表任务状态 //修改主表任务状态
assetTaskDao.updateByTaskId(taskStatus, req.getTaskId(), finishTime,btgyy); assetTaskDao.updateByTaskId(taskStatus, req.getTaskId(), finishTime);
return a; return a;
} }

@ -210,7 +210,8 @@
b.dwmc as zcdwmc, b.dwmc as zcdwmc,
b.status, b.status,
b.id , b.id ,
b.task_id b.task_id,
b.btgyy
from asset_task a from asset_task a
LEFT JOIN LEFT JOIN
asset_current_cp b ON FIND_IN_SET(b.dwmc, a.dwmc) asset_current_cp b ON FIND_IN_SET(b.dwmc, a.dwmc)
@ -406,10 +407,6 @@
<if test="finishTime != null "> <if test="finishTime != null ">
task_finish_time=#{finishTime} task_finish_time=#{finishTime}
</if> </if>
<if test="btgyy != btgyy and btgyy!='' ">
btgyy=#{btgyy}
</if>
btgyy
</set> </set>
where id =#{taskId} where id =#{taskId}

Loading…
Cancel
Save