Commit 22eaaef0 authored by chenhao's avatar chenhao

提交隐患导入

parent d13f0a47
......@@ -32,6 +32,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -401,5 +402,11 @@ public class LatentDangerController extends BaseController {
String loginOrgCode = getOrgCode(reginParams);
return ResponseHelper.buildResponse(iLatentDangerService.currentLandgerCount(null,loginOrgCode));
}
@ApiOperation(value = "修改隐患状态", notes = "修改隐患状态")
@GetMapping(value = "/web/updateStatusByUserIdAndPlandIdLike/{userId}/{plandId}")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public ResponseModel updateStatusByUserIdAndPlandIdLike(@PathVariable String userId,@PathVariable String plandId) {
iLatentDangerService.updateStatusByUserIdAndPlandIdLike(userId,plandId);
return ResponseHelper.buildResponse(null);
}
}
......@@ -88,4 +88,6 @@ public interface LatentDangerMapper extends BaseMapper<LatentDanger> {
Integer selectUnFinishedCountByParam(@Param("bizType") String bizType,
@Param("dangerState") List<String> dangerState,
String orgCode);
List<LatentDanger> updateStatusByUserIdAndPlandIdLike(String userId,String planId);
}
......@@ -2596,4 +2596,15 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
resultMap.put("count", count);
return resultMap;
}
public void updateStatusByUserIdAndPlandIdLike(String userId,String plandId){
String plandId1 ="planId\""+":"+"\""+plandId;
List<LatentDanger> list =latentDangerMapper.updateStatusByUserIdAndPlandIdLike(userId, plandId1);
list.stream().forEach(i->{
i.setDangerState(LatentDangerState.SupervisionDangerStateEnum.提交隐患.getCode());
i.setDangerStateName(LatentDangerState.SupervisionDangerStateEnum.提交隐患.getName());
});
this.saveOrUpdateBatch(list);
}
}
\ No newline at end of file
......@@ -194,4 +194,6 @@ public interface ILatentDangerService {
Map<String, Integer> getUnFinishedDangerCountMap( String loginOrgCode);
public Map<String, Integer> currentLandgerCount(String companyId,String loginOrgCode);
void updateStatusByUserIdAndPlandIdLike(String userId, String planId);
}
package com.yeejoin.amos.supervision.business.feign;
import com.baomidou.mybatisplus.core.metadata.IPage;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel;
import com.yeejoin.amos.supervision.core.common.dto.CheckReportDangerDto;
import com.yeejoin.amos.supervision.core.common.dto.DangerDto;
import org.apache.ibatis.annotations.Delete;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import java.util.Collection;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* @author DELL
......@@ -95,4 +99,8 @@ public interface DangerFeignClient {
FeignClientResult<Map<String, List<CheckReportDangerDto>>> getReviewInfoList(@RequestParam String orgCode,
@RequestParam String t1,
@RequestParam String t2);
@GetMapping(value = "/web/updateStatusByUserIdAndPlandIdLike/{userId}/{plandId}")
public ResponseModel<Object> updateStatusByUserIdAndPlandIdLike(@PathVariable String userId,@PathVariable String plandId) ;
}
......@@ -7,6 +7,7 @@ import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.supervision.business.dao.repository.IPlanAuditDao;
import com.yeejoin.amos.supervision.business.dao.repository.IPlanAuditLogDao;
import com.yeejoin.amos.supervision.business.dao.repository.IPlanDao;
import com.yeejoin.amos.supervision.business.feign.DangerFeignClient;
import com.yeejoin.amos.supervision.business.feign.JCSFeignClient;
import com.yeejoin.amos.supervision.business.service.intfc.IPlanAuditService;
import com.yeejoin.amos.supervision.business.service.intfc.IPlanTaskService;
......@@ -55,6 +56,8 @@ public class PlanAuditServiceImpl implements IPlanAuditService {
JCSFeignClient jcsFeignClient;
@Autowired
IPlanTaskService planTaskService;
@Autowired
DangerFeignClient latentDangerFeignClient;
@Override
@Transactional
public Boolean auditWorkFlow(PlanAuditLog planAuditLog, Integer status, String condition, ReginParams reginParams) throws Exception {
......@@ -86,10 +89,12 @@ public class PlanAuditServiceImpl implements IPlanAuditService {
planAuditLog.setFlowJson(condition);
planAuditLog.setRoleName(roleName);
planAuditLogDao.save(planAuditLog);
if("导入外部监查隐患".equals(planAuditLog.getFlowTaskName())) {
if("导入外部监查隐患".equals(planAuditLog.getFlowTaskName()) && plan.getCheckLevel().equals("3")) {
latentDangerFeignClient.updateStatusByUserIdAndPlandIdLike(userId, planAuditLog.getPlanId().toString());
planTaskService.taskExecutionImportPlan(planAuditLog.getPlanId());
}
planService.getUserIdsByWorkflow(plan, instanceId, status, planAuditLog.getExcuteState());
return Boolean.TRUE;
}
}
......
......@@ -1080,4 +1080,15 @@
</foreach>
</if>
</select>
<select id="updateStatusByUserIdAndPlandIdLike" resultType="com.yeejoin.amos.latentdanger.dao.entity.LatentDanger">
SELECT
*
FROM
p_latent_danger
WHERE
(
discoverer_user_id = #{userId}
AND biz_info LIKE concat('%',#{planId},'%')
)
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment