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