Commit e76bebe6 authored by dahai's avatar dahai

添加并修改 添加、查询、删除重做返回证 API

parent a8cde0fe
...@@ -337,6 +337,73 @@ public class TaskListApi { ...@@ -337,6 +337,73 @@ public class TaskListApi {
return map; return map;
} }
/**
* 生成重做返回证任务单
* name 提交人姓名
* acceptNo 受理组号
* countyCode 区县代码
*
* @return
*/
@RequestMapping("createRedoTask")
@Transactional
public Map<String, Object> createRedoTask(@RequestBody String object) {
// JSONObject jsonObject = JSONObject.fromObject(object);
JSONArray jsonArray = JSONArray.fromObject(object);
for(Object o :jsonArray){
JSONObject jsonObject = JSONObject.fromObject(o);
String acceptNo = jsonObject.getString("acceptNo");
String countyCode = jsonObject.getString("countyCode");
String name = jsonObject.getString("name");
if ("null".equals(countyCode.substring(0, 4))) {
countyCode = "000000";
}
//添加重做返回证任务单
TaskEntity taskEntity = new TaskEntity();
taskEntity.setCardType((long) 1);
taskEntity.setCountyCode(countyCode);
taskEntity.setTaskStateId((long) 0);
taskEntity.setSubmitName(name);
taskListService.saveTask(taskEntity);
GroupNoEntity groupNoEntity = new GroupNoEntity();
groupNoEntity.setGroupNo(acceptNo);
groupNoEntity.setInvalidCount((long) 0);
groupNoEntity.setValidCount((long) 1);
groupNoEntity.setSpecialCardCount((long) 0);
groupNoEntity.setTaskId(taskEntity.getTaskId());
groupNoService.saveGroupNo(groupNoEntity);
}
Map<String, Object> map = new LinkedHashMap<>();
map.put("msg", "成功添加重做返回证任务单");
return map;
}
/**
* 查询重做返回登记任务单
* @param date
* @return
*/
@RequestMapping("queryRedoTask")
public List<Map<String, Object>> queryRedoTask( @RequestParam("date")String date){
List<Map<String, Object>> maps = taskListService.selectRedoTask(replaceDate(date));
return maps;
}
/**
* 删除重做返回登记任务单
* @param taskId 任务单ID
* @return
*/
@RequestMapping("deleteRedoTask")
public boolean deleteRedoTask( @RequestParam("taskId")String taskId){
return taskListService.deleteRedoTask(Long.valueOf(taskId));
}
/** /**
* 生成退证 * 生成退证
* name 提交人姓名 * name 提交人姓名
......
...@@ -41,11 +41,13 @@ public interface FailedCardMapper { ...@@ -41,11 +41,13 @@ public interface FailedCardMapper {
/** /**
* 生成废证 * 生成废证
* @param failedCardReasonId * @param failedCardReasonId 废证原因
* @param acceptNo * @param acceptNo 受理组号
* @param taskId * @param taskId 任务单ID
* @param initiator * @param initiator 发起工序
* @param note * @param note 备注
* @param workGroup 工作组
* @param name 提交人姓名
* @return * @return
*/ */
@Insert("INSERT INTO FAILED_CARD (FAILED_CARD_REASON_ID,ACCEPT_NO,TASK_ID,STATE,INITIATOR,NOTE,work_group,name) VALUES (#{failedCardReasonId},#{acceptNo},#{taskId},0,#{initiator},#{note},#{workGroup},#{name})\n") @Insert("INSERT INTO FAILED_CARD (FAILED_CARD_REASON_ID,ACCEPT_NO,TASK_ID,STATE,INITIATOR,NOTE,work_group,name) VALUES (#{failedCardReasonId},#{acceptNo},#{taskId},0,#{initiator},#{note},#{workGroup},#{name})\n")
...@@ -125,9 +127,9 @@ public interface FailedCardMapper { ...@@ -125,9 +127,9 @@ public interface FailedCardMapper {
@Update("update FAILED_CARD set ALLOT_DATE =sysdate ,state =#{state} where FAILED_CARD_ID = #{failedCardId}") @Update("update FAILED_CARD set ALLOT_DATE =sysdate ,state =#{state} where FAILED_CARD_ID = #{failedCardId}")
public boolean updateFailedState3(FailedCardEntity failedCardEntity); public boolean updateFailedState3(FailedCardEntity failedCardEntity);
@Update("update FAILED_CARD set FINISH_DATE =sysdate ,state =#{state} where FAILED_CARD_ID = #{failedCardId}") @Update("update FAILED_CARD set FINISH_DATE =sysdate ,state =#{state} where FAILED_CARD_ID = #{failedCardId}")
public boolean updateFailedState4(FailedCardEntity failedCardEntity); // public boolean updateFailedState4(FailedCardEntity failedCardEntity);
@Update("update FAILED_CARD set FINISH_DATE =sysdate ,state =#{state} where FAILED_CARD_ID = #{failedCardId}") // @Update("update FAILED_CARD set FINISH_DATE =sysdate ,state =#{state} where FAILED_CARD_ID = #{failedCardId}")
public boolean updateFailedState5(FailedCardEntity failedCardEntity); // public boolean updateFailedState5(FailedCardEntity failedCardEntity);
/** /**
......
...@@ -68,4 +68,12 @@ public interface GroupNoMapper { ...@@ -68,4 +68,12 @@ public interface GroupNoMapper {
"UNION ALL \n" + "UNION ALL \n" +
"SELECT ID_NO,ACCEPT_NO FROM PROD_CARD_T@PRODYD_LINK WHERE ID_NO =#{idCard} OR ACCEPT_NO =#{idCard}") "SELECT ID_NO,ACCEPT_NO FROM PROD_CARD_T@PRODYD_LINK WHERE ID_NO =#{idCard} OR ACCEPT_NO =#{idCard}")
public List<Map<String,Object>> selectAcceptNo(String idCard); public List<Map<String,Object>> selectAcceptNo(String idCard);
/**
* 删除重做登记的任务单
* @param taskId 任务单编号
* @return
*/
@Delete("delete group_no where task_id = ${taskId}")
public boolean deleteGroupNoByTaskId(@Param("taskId")long taskId);
} }
...@@ -1525,6 +1525,20 @@ public interface TaskListMapper { ...@@ -1525,6 +1525,20 @@ public interface TaskListMapper {
@Update("update failed_card set work_group = ${workGroup} where failed_card_ID = ${taskId}") @Update("update failed_card set work_group = ${workGroup} where failed_card_ID = ${taskId}")
public boolean updateFailedCardWorkGroup(@Param("taskId")String taskId,@Param("workGroup") long workGroup); public boolean updateFailedCardWorkGroup(@Param("taskId")String taskId,@Param("workGroup") long workGroup);
/**
* 查询重做返回登记证件
* @param date 查询登记时间
* @return
*/
@Select("select * from task left join group_no on task.task_id = group_no.task_id where card_type = 2 and to_char(submit_date,'yyyyMMdd') = #{date} order by task.task_id")
public List<Map<String, Object>> selectRedoTask(@Param("date")String date);
/**
* 删除重做返回任务单
* @param taskId 任务单编号
* @return
*/
@Delete("delete task where task_id = ${taskId}")
public boolean deleteTaskByTaskId(@Param("taskId")long taskId);
} }
...@@ -105,4 +105,8 @@ public interface TaskListService { ...@@ -105,4 +105,8 @@ public interface TaskListService {
public List<Map<String,Object>> selectRemainderCardInfo(String date ,String name); public List<Map<String,Object>> selectRemainderCardInfo(String date ,String name);
public boolean updateFailedCardWorkGroup(List<String> list, String workGroup); public boolean updateFailedCardWorkGroup(List<String> list, String workGroup);
public List<Map<String,Object>> selectRedoTask(String date);
public boolean deleteRedoTask(long taskId);
} }
...@@ -993,6 +993,18 @@ public class TaskListServiceImpl implements TaskListService { ...@@ -993,6 +993,18 @@ public class TaskListServiceImpl implements TaskListService {
return true; return true;
} }
@Override
public List<Map<String, Object>> selectRedoTask(String date) {
return taskListMapper.selectRedoTask(date);
}
@Override
public boolean deleteRedoTask(long taskId) {
groupNoMapper.deleteGroupNoByTaskId(taskId);
taskListMapper.deleteTaskByTaskId(taskId);
return true;
}
private String createGroupNo(List<Integer> c, List<Integer> nsList) { private String createGroupNo(List<Integer> c, List<Integer> nsList) {
try { try {
String groupNo = ""; String groupNo = "";
......
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