Commit 44f67834 authored by Administrator's avatar Administrator

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

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