Commit 1f7d1575 authored by suichenguang's avatar suichenguang

余证更改

parent 80c2fe90
package com.yxproject.start.api;
import com.yxproject.start.entity.SpecialCardEntity;
import com.yxproject.start.entity.TaskEntity;
import com.yxproject.start.entity.TaskList.TaskListEntity;
import com.yxproject.start.service.FailedCardService;
......@@ -12,6 +13,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
......@@ -66,7 +68,6 @@ public class FailedCardApi {
@Transactional(rollbackFor = Exception.class)
public Boolean insertFailedCard(@RequestBody String jsonStr){
JSONArray jsonarray = JSONArray.fromObject(jsonStr);
System.out.println("11111111111111111111"+String.valueOf(jsonarray));
for (Object o:jsonarray){
JSONObject jsonObject =(JSONObject)o;
Map<String,Object> idMap= failedCardService.selectCountIdByCardId(jsonObject.getString("cardId"));
......@@ -98,29 +99,34 @@ public class FailedCardApi {
public Boolean insertRemaining(@RequestBody String jsonStr){
JSONObject jsonObject = JSONObject.fromObject(jsonStr);
JSONArray jsonarray = JSONArray.fromObject(jsonObject.get("list"));
String name =jsonObject.get("name").toString();
TaskEntity taskEntity = new TaskEntity();
for (int i=0;i<jsonarray.size();i++) {
/*查询生成任务单需要的数据*/
// JSONObject jsonObject2 =(JSONObject)o;
Map<String,Object> resultMap= failedCardService.selectTaskListDate((String) jsonarray.get(i));
System.out.println();
try {
//TODO 会报空指针异常
String countyCode = resultMap.get("COUNTY_CODE").toString();
Long cardType = (Long) resultMap.get("CARD_TYPE_ID");
Long cardType = Long.valueOf((BigDecimal) resultMap.get("CARD_TYPE_ID")+"");
String acceptNo = (String) resultMap.get("ACCEPT_NO");
taskEntity.setCountyCode(countyCode);
taskEntity.setCardType(cardType);
taskEntity.setTaskStateId((long) 1);
taskEntity.setSubmitName(name);
taskListService.saveTask(taskEntity);
/*特证表添加特证*/
failedCardService.addSpecialCard(acceptNo);
SpecialCardEntity specialCardEntity = new SpecialCardEntity() ;
specialCardEntity.setAcceptNo(acceptNo);
specialCardEntity.setInitiator(name);
specialCardEntity.setTaskId(taskEntity.getTaskId());
specialCardEntity.setGroupNo(acceptNo.substring(0,8));
failedCardService.addSpecialCard(specialCardEntity);
/*特证数+1*/
failedCardService.specialCardAdd(acceptNo);
}catch (NullPointerException e){
}
}
return true;
}
......@@ -181,4 +187,5 @@ public class FailedCardApi {
return true;
}
}
......@@ -34,7 +34,6 @@ public class ReceiptApi {
@RequestMapping("createReceiptList")
@Transactional(rollbackFor = Exception.class)
public boolean createReceiptList(@RequestParam("id") String id) {
try {
//判断是否是特证
if (receiptService.selectSpecialCardByAcceptNo(id) == 1) {
//查询这个受理号是否生成了交接单
......@@ -43,7 +42,6 @@ public class ReceiptApi {
if (countAccept == 0) {
//查询特证交接单所需数据
Map<String, Object> resultDate = receiptService.selectReceiptListDate(id);
System.out.println("111111111111111111111111resultDate"+resultDate);
String acceptNo = (String) resultDate.get("ACCEPT_NO");
String GAJG_DM = (String) resultDate.get("GAJG_DM");
int cardType = (int) resultDate.get("CARD_TYPE");
......@@ -126,9 +124,7 @@ public class ReceiptApi {
receiptService.updateFinishCount(groupNo, finishCount);
}
}catch (NullPointerException e){
return false;
}
return true;
}
......
package com.yxproject.start.mapper;
import com.yxproject.start.entity.FailedCardEntity;
import com.yxproject.start.entity.SpecialCardEntity;
import org.apache.ibatis.annotations.*;
import org.omg.CORBA.PUBLIC_MEMBER;
......@@ -42,7 +43,7 @@ public interface FailedCardMapper {
* @param note
* @return
*/
@Insert("INSERT INTO FAILED_CARD (FAILED_CARD_REASON_ID,ACCEPT_NO,TASK_ID,STATE,INITIATOR,NOTE) VALUES (#{failedCardReasonId},#{acceptNo},#{taskId},1,#{initiator},#{note})\n")
@Insert("INSERT INTO FAILED_CARD (FAILED_CARD_REASON_ID,ACCEPT_NO,TASK_ID,STATE,INITIATOR,NOTE) VALUES (#{failedCardReasonId},#{acceptNo},#{taskId},0,#{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);
......@@ -50,10 +51,7 @@ public interface FailedCardMapper {
"FROM PROD_CARD_T@PROD_LINK\n" +
"LEFT JOIN GROUP_NO ON GROUP_NO=subStr(PROD_CARD_T.ACCEPT_NO,0,8)\n" +
"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(@Param("cardId") String cardId);
/*余证*/
@Update("update group_no \n" +
......@@ -64,25 +62,26 @@ public interface FailedCardMapper {
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" +
@Insert("insert into SPECIAL_CARD (ACCEPT_NO,TASK_ID,SPECIAL_TYPE,GROUP_NO,INITIATOR,FILL_IN_DATE)\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);
"#{acceptNo},#{taskId},1," +
"#{groupNo},#{initiator},sysdate)\n")
public boolean addSpecialCard( SpecialCardEntity specialCardEntity);
@Select("select SPECIAL_CARD.SPECIAL_TYPE,prod_card_t.accept_no,subStr(prod_card_t.UPLOAD_NO,0,6),SPECIAL_CARD.INITIATOR,PREPRO_PERSON.CARD_TYPE_ID\n" +
@Select("select SPECIAL_CARD.SPECIAL_TYPE,prod_card_t.accept_no,subStr(prod_card_t.UPLOAD_NO,0,6) as COUNTY_CODE,SPECIAL_CARD.INITIATOR,PREPRO_PERSON.CARD_TYPE_ID\n" +
"from prod_card_t@prod_link\n" +
"left join SPECIAL_CARD on prod_card_t.accept_no = SPECIAL_CARD.accept_no\n" +
"left join PREPRO_PERSON on PREPRO_PERSON.JMSFZSLH=prod_card_t.UPLOAD_NO\n" +
"where prod_card_t.accept_no=#{acceptNo} or prod_card_t.ID_NO=#{acceptNo}")
public Map<String,Object> selectTaskListDate(String acceptNo);
public Map<String,Object> selectTaskListDate(@Param("acceptNo") String acceptNo);
/*历史回迁证*/
/*查询所有证件类型,用于下拉框*/
@Select("select CARD_TYPE from card_type_dic")
public List<String> selectCardType();
......@@ -90,25 +89,26 @@ public interface FailedCardMapper {
@Select("select substr(ACCEPT_NO,0,8) from PROD_CARD_T where ID_NO in" +
" (#{cardList})group by substr(ACCEPT_NO,0,8);")
public List<String> selectGroupNo(String cardIdList);
public List<String> selectGroupNo(@Param("cardIdList") String cardIdList);
@Select("select SPECIAL_CARD.SPECIAL_TYPE,prod_card_t.accept_no,subStr(prod_card_t.UPLOAD_NO,0,6),SPECIAL_CARD.INITIATOR,PREPRO_PERSON.CARD_TYPE_ID\n" +
@Select("select SPECIAL_CARD.SPECIAL_TYPE,prod_card_t.accept_no,subStr(prod_card_t.UPLOAD_NO,0,6) as COUNTY_CODE ," +
"SPECIAL_CARD.INITIATOR,PREPRO_PERSON.CARD_TYPE_ID\n" +
"from prod_card_t@prod_link\n" +
"left join SPECIAL_CARD on prod_card_t.accept_no = SPECIAL_CARD.accept_no\n" +
"left join PREPRO_PERSON on PREPRO_PERSON.JMSFZSLH=prod_card_t.UPLOAD_NO\n" +
"where prod_card_t.ID_NO=#{acceptNo}")
public Map<String,Object> selectTaskListById(String id);
public Map<String,Object> selectTaskListById(@Param("id") String id);
@Select("select prod_group_t.valid_count,prod_group_t.invalid_count from prod_group_t@prod_link \n" +
"where group_no=#{groupNo}")
public Map<String,Object> selectGroupDate(String groupNo);
public Map<String,Object> selectGroupDate(@Param("groupNo") String groupNo);
@Insert("insert into group_no (GROUP_NO,TASK_ID,VALID_COUNT,INVALID_COUNT)values('12345678','20190308073',79,1);")
@Insert("insert into group_no (GROUP_NO,TASK_ID,VALID_COUNT,INVALID_COUNT)values(#{GROUP_NO},#{TASK_ID},#{VALID_COUNT},#{INVALID_COUNT})")
public boolean insertGroupNo(@Param("GROUP_NO")String GROUP_NO,@Param("TASK_ID")String TASK_ID,@Param("VALID_COUNT")long VALID_COUNT,@Param("INVALID_COUNT")long INVALID_COUNT);
@Update("update FAILED_CARD set PRINT_DATE =sysdate ,state =#{state} where FAILED_CARD_ID = #{failedCardId}")
......@@ -121,4 +121,5 @@ public interface FailedCardMapper {
@Update("update FAILED_CARD set FINISH_DATE =sysdate ,state =#{state} where FAILED_CARD_ID = #{failedCardId}")
public boolean updateFailedState4(FailedCardEntity failedCardEntity);
}
package com.yxproject.start.service;
import com.yxproject.start.entity.FailedCardEntity;
import com.yxproject.start.entity.SpecialCardEntity;
import org.apache.ibatis.annotations.Param;
import java.util.List;
......@@ -18,7 +19,7 @@ public interface FailedCardService {
public boolean specialCardAdd(@Param("acceptNo") String acceptNo);
public boolean addSpecialCard(@Param("acceptNo")String acceptNo);
public boolean addSpecialCard(SpecialCardEntity specialCardEntity);
public Map<String, Object> selectTaskListDate(@Param("acceptNo")String acceptNo);
......@@ -33,4 +34,6 @@ public interface FailedCardService {
public boolean insertGroupNo(@Param("GROUP_NO")String GROUP_NO,@Param("TASK_ID")String TASK_ID,@Param("VALID_COUNT")long VALID_COUNT,@Param("INVALID_COUNT")long INVALID_COUNT);
public boolean updateFailedCardState(FailedCardEntity failedCardEntity);
}
package com.yxproject.start.service.impl;
import com.yxproject.start.entity.FailedCardEntity;
import com.yxproject.start.entity.SpecialCardEntity;
import com.yxproject.start.entity.TaskEntity;
import com.yxproject.start.mapper.FailedCardMapper;
import com.yxproject.start.service.FailedCardService;
......@@ -49,8 +50,8 @@ public class FailedCardServiceImpl implements FailedCardService {
}
@Override
public boolean addSpecialCard(String acceptNo) {
failedCardMapper.addSpecialCard(acceptNo);
public boolean addSpecialCard(SpecialCardEntity specialCardEntity) {
failedCardMapper.addSpecialCard(specialCardEntity);
return true;
}
......@@ -63,7 +64,7 @@ public class FailedCardServiceImpl implements FailedCardService {
@Override
public List<String> selectCardType() {
List<String> resultList = failedCardMapper.selectCardType();
return null;
return resultList;
}
@Override
......@@ -114,4 +115,7 @@ public class FailedCardServiceImpl implements FailedCardService {
}
return false;
}
}
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