Commit be5b8ac8 authored by 高建强's avatar 高建强

Merge remote-tracking branch 'origin/develop_dl_plan6_temp' into develop_dl_plan6_temp

parents 2f4fdd5d 06fbba14
......@@ -163,19 +163,6 @@ public class CheckController extends AbstractBaseController {
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "保存巡检记录<font color='blue'>手机app</font>", notes = "保存巡检记录<font color='blue'>手机app</font>")
@RequestMapping(value = "/saveRecordNew", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
......@@ -188,6 +175,10 @@ public class CheckController extends AbstractBaseController {
int statu = -1;
PlanTask planTask =null;
if(requestParam.getPlanTaskId()!=null && requestParam.getPlanTaskId() !=0){
Map<String, Object> map = checkService.selectCheckById(requestParam.getPlanTaskId());
if (!ObjectUtils.isEmpty(map)) {
checkService.delCheckByTaskId(requestParam.getPlanTaskId(), Long.valueOf((String) map.get("id")));
}
planTask = planTaskService.selectPlanTaskStatus(requestParam.getPlanTaskId());
}
AgencyUserModel user = getUserInfo();
......
......@@ -4,6 +4,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.yeejoin.amos.patrol.dao.entity.Check;
import org.apache.ibatis.annotations.Param;
import com.yeejoin.amos.patrol.business.entity.mybatis.CheckDetailBo;
......@@ -282,4 +283,10 @@ public interface CheckMapper extends BaseMapper {
//Map<String, String> queryUserInfoByIds(@Param(value = "userIds") String userIds);
int delCheckByTaskId(@Param(value = "taskId") Long taskId);
int delCheckInputByCheckId(@Param(value = "checkId") Long checkId);
Map<String, Object> selectCheckById(@Param(value = "taskId") Long taskId);
}
......@@ -606,6 +606,7 @@ public class CheckServiceImpl implements ICheckService {
}
// check = checkDao.save(check);
try {
check = checkDao.save(check);
} catch (Exception e) {
e.printStackTrace();
......@@ -733,6 +734,17 @@ public class CheckServiceImpl implements ICheckService {
checkDao.deleteBatch(list);
}
@Override
public Map<String, Object> selectCheckById(Long id) {
return checkMapper.selectCheckById(id);
}
@Override
public void delCheckByTaskId(Long id, Long checkId) {
checkMapper.delCheckByTaskId(id);
checkMapper.delCheckInputByCheckId(checkId);
}
private CheckInput paraseText(CheckInput checkInput, String json, CheckInputParam item, String isScore) {
JSONObject jsonObject = JSONObject.parseObject(json);
String checkType = jsonObject.getString("CheckType");
......
......@@ -52,8 +52,13 @@ public interface ICheckService {
* @param ids
*/
@Transactional(rollbackFor = {YeeException.class, Exception.class})
void delCheckById(List<Long> ids);
void delCheckByTaskId(Long id, Long checkId);
Map<String, Object> selectCheckById(Long id);
/**
* 获取检查结果中所有不合格检查项
*
......
......@@ -193,7 +193,7 @@
<select id="selectOilDrainage" resultType="java.util.Map">
SELECT
wes.id,
'1' as type ,
'1' as type,
(SELECT wei.emergency_level FROM wl_equipment_index wei LEFT JOIN wl_equipment_specific_index wesi on wei.id = wesi.equipment_index_id
WHERE wesi.equipment_specific_id = wes.id AND wesi.equipment_index_key = wes.realtime_iot_index_key) as level,
wes.equipment_code as code ,
......
......@@ -2159,4 +2159,23 @@
d.date
</select>
<select id="delCheckByTaskId" resultType="int">
DELETE FROM
p_check pc
WHERE pc.plan_task_id = #{taskId}
</select>
<select id="delCheckInputByCheckId" resultType="int">
DELETE FROM
p_check_input pci
WHERE pci.check_id = #{checkId}
</select>
<select id="selectCheckById" resultType="java.util.HashMap">
SELECT *
FROM
p_check pc
WHERE pc.plan_task_id = #{taskId}
</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