Commit 44f67834 authored by Administrator's avatar Administrator

添加异常状态从写死的改为动态的

parent 367a9b41
...@@ -505,13 +505,10 @@ public class UserApi { ...@@ -505,13 +505,10 @@ public class UserApi {
*/ */
@RequestMapping("addExceptionState") @RequestMapping("addExceptionState")
// @RequiresPermissions("userInfo.add")//权限管理; // @RequiresPermissions("userInfo.add")//权限管理;
public String addExceptionState(@RequestParam("exception_Information") String exception_Information, HttpServletResponse resp) { public String addExceptionState(@RequestParam("taskId") String taskId,@RequestParam("exceptionInformation") String exceptionInformation, HttpServletResponse resp) {
String map = "{\"task_Id\":\"20181016001\",\"exception_Information\":0} "; int i = taskService.addExceptionState(taskId,exceptionInformation);
JSONObject jsonObject = JSONObject.fromObject(map);
TaskEntity taskEntity = (TaskEntity) JSONObject.toBean(jsonObject, TaskEntity.class);
YXJSONResponse yxjsonResponse = new YXJSONResponse(); YXJSONResponse yxjsonResponse = new YXJSONResponse();
resp.setCharacterEncoding("UTF-8"); resp.setCharacterEncoding("UTF-8");
int i = taskService.addExceptionState(taskEntity);
yxjsonResponse.outPutSuccess(i + "更新成功"); yxjsonResponse.outPutSuccess(i + "更新成功");
return yxjsonResponse.toJSONString(); return yxjsonResponse.toJSONString();
} }
......
...@@ -17,7 +17,8 @@ public interface TaskMapper { ...@@ -17,7 +17,8 @@ public interface TaskMapper {
public int updateTaskEntity(TaskEntity taskEntity); public int updateTaskEntity(TaskEntity taskEntity);
public List<TaskEntity> findTaskEntityByAcceptNo(String acceptNo); public List<TaskEntity> findTaskEntityByAcceptNo(String acceptNo);
public List<TaskEntity> findTaskEntityByState(int state); public List<TaskEntity> findTaskEntityByState(int state);
public int replaceExceptionInformation(TaskEntity taskEntity); public int updateTaskIsException(@Param("taskId") String taskId,@Param("exceptionInformation") String exceptionInformation,@Param("isException")String isException);
public int replaceExceptionInformation(@Param("taskId")String taskId,@Param("isException")String isException);
public List<TypeListEntity> findTypeListByTaskStateId(String taskStateId); public List<TypeListEntity> findTypeListByTaskStateId(String taskStateId);
public List <CityListEntity> findCityList(@Param("taskStateId") String taskStateId,@Param("cardType") String cardType); public List <CityListEntity> findCityList(@Param("taskStateId") String taskStateId,@Param("cardType") String cardType);
public int updateOutStorageDate(String taskId); public int updateOutStorageDate(String taskId);
......
...@@ -26,7 +26,7 @@ public interface TaskService { ...@@ -26,7 +26,7 @@ public interface TaskService {
public List<Map<String,Object>> findProductionTaskListEntityByState(int state); public List<Map<String,Object>> findProductionTaskListEntityByState(int state);
public int addExceptionState(TaskEntity state); public int addExceptionState(String taskId, String exceptionInformation);
// public int updateStorageDate(String taskListId,String inStorageCount,String outStorageCount); // public int updateStorageDate(String taskListId,String inStorageCount,String outStorageCount);
......
...@@ -420,15 +420,16 @@ public class TaskServiceImpl implements TaskService { ...@@ -420,15 +420,16 @@ public class TaskServiceImpl implements TaskService {
* @return * @return
*/ */
@Override @Override
public int addExceptionState(TaskEntity taskEntity) { public int addExceptionState(String taskId, String exceptionInformation) {
int i =0; int i =0;
if(taskEntity.getException_Information()!=null) { String isException;
taskEntity.setIs_Exception((long)1); if(Integer.parseInt(exceptionInformation) != 0) {
i=taskMapper.updateTaskEntity(taskEntity); isException =String.valueOf(1);
i=taskMapper.updateTaskIsException(taskId,exceptionInformation,isException);
} else { } else {
taskEntity.setIs_Exception((long)0); isException =String.valueOf(0);
i=taskMapper.replaceExceptionInformation(taskEntity); i=taskMapper.replaceExceptionInformation(taskId,isException);
} }
return i; return i;
} }
......
...@@ -68,8 +68,12 @@ ...@@ -68,8 +68,12 @@
select * from TASK where TASK_STATE_ID =#{task_State_Id} select * from TASK where TASK_STATE_ID =#{task_State_Id}
</select> </select>
<update id="replaceExceptionInformation" parameterType="com.yxproject.start.entity.TaskEntity" > <update id="updateTaskIsException" parameterType="String" >
update TASK set exception_Information = NULL and IS_EXCEPTION =#{is_Exception} where TASK_ID =#{task_Id} update TASK set EXCEPTION_INFORMATION = #{exceptionInformation},IS_EXCEPTION = #{isException} where TASK_ID =#{taskId}
</update>
<update id="replaceExceptionInformation" parameterType="String" >
update TASK set EXCEPTION_INFORMATION = NULL,IS_EXCEPTION = #{isException} where TASK_ID =#{taskId}
</update> </update>
<update id="updateOutStorageDate"> <update id="updateOutStorageDate">
......
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