提交 afc09cf7 编写于 作者: doc_wei's avatar doc_wei

多项填空题选项删除完成

上级 f9992be7
此差异已折叠。
......@@ -352,4 +352,20 @@ public class DwSurveyDirectoryController {
dwSurveyDirectoryService.deleteQuestionOrderOptionMationById(inputObject, outputObject);
}
/**
*
* @Title: deleteQuestionMultiFillblankOptionMationById
* @Description: 删除多项填空题选项
* @param @param inputObject
* @param @param outputObject
* @param @throws Exception 参数
* @return void 返回类型
* @throws
*/
@RequestMapping("/post/DwSurveyDirectoryController/deleteQuestionMultiFillblankOptionMationById")
@ResponseBody
public void deleteQuestionMultiFillblankOptionMationById(InputObject inputObject, OutputObject outputObject) throws Exception{
dwSurveyDirectoryService.deleteQuestionMultiFillblankOptionMationById(inputObject, outputObject);
}
}
......@@ -106,4 +106,10 @@ public interface DwSurveyDirectoryDao {
public int deleteLogicQuestionOrderOptionMationById(Map<String, Object> map) throws Exception;
public Map<String, Object> queryQuestionMultiFillblankOptionById(Map<String, Object> map) throws Exception;
public int deleteQuestionMultiFillblankOptionMationById(Map<String, Object> map) throws Exception;
public int deleteLogicQuestionMultiFillblankOptionMationById(Map<String, Object> map) throws Exception;
}
......@@ -47,4 +47,6 @@ public interface DwSurveyDirectoryService {
public void deleteQuestionOrderOptionMationById(InputObject inputObject, OutputObject outputObject) throws Exception;
public void deleteQuestionMultiFillblankOptionMationById(InputObject inputObject, OutputObject outputObject) throws Exception;
}
......@@ -962,7 +962,28 @@ public class DwSurveyDirectoryServiceImpl implements DwSurveyDirectoryService{
}
}
}
/**
*
* @Title: deleteQuestionMultiFillblankOptionMationById
* @Description: 删除多项填空题选项
* @param @param inputObject
* @param @param outputObject
* @param @throws Exception 参数
* @return void 返回类型
* @throws
*/
@Override
public void deleteQuestionMultiFillblankOptionMationById(InputObject inputObject, OutputObject outputObject) throws Exception {
Map<String, Object> map = inputObject.getParams();
Map<String, Object> option = dwSurveyDirectoryDao.queryQuestionMultiFillblankOptionById(map);
if(option != null){
if(option.get("surveyState").toString().equals("0")){//设计状态
dwSurveyDirectoryDao.deleteQuestionMultiFillblankOptionMationById(map);//执行物理删除
}else{//执行中或者结束
dwSurveyDirectoryDao.deleteLogicQuestionMultiFillblankOptionMationById(map);//执行逻辑删除问题
}
}
}
}
......@@ -666,4 +666,36 @@
id = #{quItemId}
</delete>
<select id="queryQuestionMultiFillblankOptionById" parameterType="java.util.Map" resultType="java.util.Map">
SELECT
a.id,
c.survey_state surveyState
FROM
dw_qu_multi_fillblank a,
dw_question b,
dw_survey_directory c
WHERE a.id = #{quItemId}
AND a.visibility = '1'
AND a.qu_id = b.id
AND b.visibility = '1'
AND c.visibility = '1'
AND b.belong_id = c.id
</select>
<update id="deleteLogicQuestionMultiFillblankOptionMationById" parameterType="java.util.Map">
UPDATE dw_qu_multi_fillblank
<set>
visibility = '0',
</set>
WHERE id = #{quItemId}
</update>
<delete id="deleteQuestionMultiFillblankOptionMationById" parameterType="java.util.Map">
DELETE
FROM
dw_qu_multi_fillblank
WHERE
id = #{quItemId}
</delete>
</mapper>
\ No newline at end of file
......@@ -181,6 +181,9 @@
<url id="dwsurveydirectory021" path="/post/DwSurveyDirectoryController/deleteQuestionOrderOptionMationById" val="删除排序选项" allUse="1">
<property id="quItemId" name="quItemId" ref="required" var="选项id"/>
</url>
<url id="dwsurveydirectory022" path="/post/DwSurveyDirectoryController/deleteQuestionMultiFillblankOptionMationById" val="删除多项填空题选项" allUse="1">
<property id="quItemId" name="quItemId" ref="required" var="选项id"/>
</url>
<!-- 问卷调查结束 -->
</controller>
\ No newline at end of file
......@@ -2325,25 +2325,21 @@ layui.config({
}
return newEditObj;
}
/** 删除多项填空题选项 **/
/**
* 删除多项填空题选项
*/
function deleteMultiFillblankOption() {
var optionParent = null;
optionParent = $(curEditObj).parents("tr.mFillblankTableTr");
var quOptionId = $(optionParent).find("input[name='quItemId']").val();
if(quOptionId != "" && quOptionId != "0") {
var url = reqBasePath + "/design/qu-multi-fillblank!ajaxDelete.action";
var data = "quItemId=" + quOptionId;
$.ajax({
url: url,
data: data,
type: "post",
success: function(msg) {
if(msg == "true") {
delQuOptionCallBack(optionParent);
}
}
});
AjaxPostUtil.request({url:reqBasePath + "dwsurveydirectory022", params:{quItemId: quOptionId}, type:'json', callback:function(json){
if(json.returnCode == 0){
delQuOptionCallBack(optionParent);
}else{
top.winui.window.msg(json.returnMessage, {icon: 2,time: 2000});
}
}});
} else {
delQuOptionCallBack(optionParent);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册