Commit 3d24c563 authored by suichenguang's avatar suichenguang

废证修改

parent dbf066eb
package com.yxproject.start.api; package com.yxproject.start.api;
import com.yxproject.start.entity.TaskList.TaskListEntity;
import com.yxproject.start.service.FailedCardService; import com.yxproject.start.service.FailedCardService;
import net.sf.json.JSON; import com.yxproject.start.service.TaskListService;
import net.sf.json.JSONArray; import net.sf.json.JSONArray;
import net.sf.json.JSONObject; import net.sf.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -21,6 +22,8 @@ import java.util.Map; ...@@ -21,6 +22,8 @@ import java.util.Map;
public class FailedCardApi { public class FailedCardApi {
@Autowired @Autowired
private FailedCardService failedCardService; private FailedCardService failedCardService;
@Autowired
private TaskListService taskListService;
/** /**
* 查询所有废证类型 * 查询所有废证类型
...@@ -58,9 +61,33 @@ public class FailedCardApi { ...@@ -58,9 +61,33 @@ public class FailedCardApi {
JSONArray jsonarray = JSONArray.fromObject(jsonStr); JSONArray jsonarray = JSONArray.fromObject(jsonStr);
for (Object o:jsonarray){ for (Object o:jsonarray){
JSONObject jsonObject =(JSONObject)o; JSONObject jsonObject =(JSONObject)o;
Map<String,Object> idMap= failedCardService.selectCountIdByCardId(jsonObject.get("cardId").toString()); Map<String,Object> idMap= failedCardService.selectCountIdByCardId(jsonObject.getString("cardId"));
failedCardService.insertFailedCard(jsonObject.get("failedCardReasonId").toString(),idMap.get("acceptNo").toString(),idMap.get("taskId").toString(),jsonObject.get("initiator").toString(),jsonObject.get("note").toString()); failedCardService.insertFailedCard(jsonObject.getString("failedCardReasonId"),idMap.get("ACCEPT_NO").toString(),idMap.get("TASK_ID").toString(),jsonObject.getString("initiator"),jsonObject.getString("note"));
}
return true;
}
/**
* 生成余证
* @param jsonStr
* @return
*/
@RequestMapping("insertRemaining")
public Boolean insertRemaining(@RequestBody String jsonStr){
JSONArray jsonarray = JSONArray.fromObject(jsonStr);
for (Object o:jsonarray) {
JSONObject jsonObject =(JSONObject)o;
// failedCardService.addSpecialCard(acceptNo);
// failedCardService.specialCardAdd(acceptNo);
// taskListService.createTaskList(submitDate,countyCode,Gajg);
// List<TaskListEntity> resultList= taskListService.selectACCU(submitDate,countyCode,Gajg);
// taskListService.createTaskList(resultList);
} }
return true; return true;
} }
......
package com.yxproject.start.mapper; package com.yxproject.start.mapper;
import org.apache.ibatis.annotations.Insert; import org.apache.ibatis.annotations.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.omg.CORBA.PUBLIC_MEMBER; import org.omg.CORBA.PUBLIC_MEMBER;
import java.util.List; import java.util.List;
...@@ -44,7 +41,7 @@ public interface FailedCardMapper { ...@@ -44,7 +41,7 @@ public interface FailedCardMapper {
* @param note * @param note
* @return * @return
*/ */
@Insert("INSERT INTO FAILED_CARD (FAILED_CARD_REASON_ID,ACCEPT_NO,TASK_ID,STATE,INITIATOR,NOTE) VALUES (#{failedCardReasonId},#{acceptNo},#{taskId},0,#{initiator},#{note})\n") @Insert("INSERT INTO FAILED_CARD (FAILED_CARD_REASON_ID,ACCEPT_NO,TASK_ID,STATE,INITIATOR,NOTE) VALUES (#{failedCardReasonId},#{acceptNo},#{taskId},1,#{initiator},#{note})\n")
public boolean insertFailedCard(@Param("failedCardReasonId")String failedCardReasonId,@Param("acceptNo")String acceptNo,@Param("taskId")String taskId,@Param("initiator")String initiator,@Param("note")String note); public boolean insertFailedCard(@Param("failedCardReasonId")String failedCardReasonId,@Param("acceptNo")String acceptNo,@Param("taskId")String taskId,@Param("initiator")String initiator,@Param("note")String note);
...@@ -54,4 +51,32 @@ public interface FailedCardMapper { ...@@ -54,4 +51,32 @@ public interface FailedCardMapper {
"WHERE PROD_CARD_T.ID_NO=#{cardId} or PROD_CARD_T.ACCEPT_NO=#{cardId}") "WHERE PROD_CARD_T.ID_NO=#{cardId} or PROD_CARD_T.ACCEPT_NO=#{cardId}")
public Map<String,Object> selectCountIdByCardId(String cardId); public Map<String,Object> selectCountIdByCardId(String cardId);
/*余证*/
@Update("update group_no \n" +
"set group_no.SPECIAL_CARD_COUNT=group_no.SPECIAL_CARD_COUNT+1 \n" +
"where group_no.group_no=(select group_no from PROD_CARD_T@PROD_LINK \n" +
"left join group_no on group_no.GROUP_NO=subStr(PROD_CARD_T.ACCEPT_NO,0,8)\n" +
"where PROD_CARD_T.accept_no =#{acceptNo}) ")
public boolean specialCardAdd(@Param("acceptNo")String acceptNo);
@Insert("insert into SPECIAL_CARD (ACCEPT_NO,TASK_ID,SPECIAL_TYPE,GROUP_NO,INITIATOR,FILL_IN_DATE,REMARK)\n" +
"values(\n" +
"#{acceptNo},(select TASK_ID from group_no where group_no=subStr(#{acceptNo})),1," +
"subStr(#{acceptNo}),#{initiator},#{date},#{remark})\n")
public boolean addSpecialCard(@Param("acceptNo")String acceptNo);
public List<Map<String,Object>> selectTaskListDate(String acceptNo);
} }
...@@ -15,4 +15,8 @@ public interface FailedCardService { ...@@ -15,4 +15,8 @@ public interface FailedCardService {
public boolean insertFailedCard(@Param("failedCardReasonId")String failedCardReasonId,@Param("acceptNo")String acceptNo,@Param("taskId")String taskId,@Param("initiator")String initiator,@Param("note")String note); public boolean insertFailedCard(@Param("failedCardReasonId")String failedCardReasonId,@Param("acceptNo")String acceptNo,@Param("taskId")String taskId,@Param("initiator")String initiator,@Param("note")String note);
public Map<String,Object> selectCountIdByCardId(String cardId); public Map<String,Object> selectCountIdByCardId(String cardId);
public boolean specialCardAdd(@Param("acceptNo") String acceptNo);
public boolean addSpecialCard(@Param("acceptNo")String acceptNo);
} }
...@@ -35,4 +35,18 @@ public class FailedCardServiceImpl implements FailedCardService { ...@@ -35,4 +35,18 @@ public class FailedCardServiceImpl implements FailedCardService {
Map<String, Object> result= failedCardMapper.selectCountIdByCardId(cardId); Map<String, Object> result= failedCardMapper.selectCountIdByCardId(cardId);
return result; return result;
} }
@Override
public boolean specialCardAdd(String acceptNo) {
failedCardMapper.specialCardAdd(acceptNo);
return true;
}
@Override
public boolean addSpecialCard(String acceptNo) {
failedCardMapper.addSpecialCard(acceptNo);
return true;
}
} }
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