Commit 96be5c0e authored by liboyang's avatar liboyang

Merge remote-tracking branch 'origin/dev' into dev

parents ca1272d0 fead1be7
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.LinkedHashMap;
import java.util.List;
......@@ -69,7 +71,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"));
......@@ -101,29 +102,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;
}
......@@ -184,4 +190,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;
}
......
......@@ -182,7 +182,7 @@ public class TaskListApi {
*/
@RequestMapping("queryByCountyAtAuxiliaryState1")
public Map queryByCountyAtAuxiliaryState1(@RequestParam("process") String process, HttpServletResponse resp) {
Map map = taskListService.selectByCountyAtAuxiliary2(Long.valueOf(process) - 1);
Map map = taskListService.selectByCountyAtAuxiliary2(Long.valueOf(process));
return map;
}
......
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);
}
......@@ -152,7 +152,7 @@ public interface TaskListMapper {
"from group_no left join task on group_no.task_id= task.TASK_ID\n" +
"left join CARD_TYPE_DIC on CARD_TYPE_DIC.CARD_TYPE_ID = task.CARD_TYPE\n" +
"left join COUNTY_DIC on COUNTY_DIC.COUNTY_CODE = task.COUNTY_CODE\n" +
"left join (select task_id, nvl(count(*),0) faileCount from FAILED_CARD where FAILED_CARD.state =#{process2} and FAILED_CARD.state != FAILED_CARD.INITIATOR group by task_id ) fc on fc.TASK_ID = task.TASK_ID\n" +
"left join (select task_id, nvl(count(*),0) faileCount from FAILED_CARD where FAILED_CARD.state <#{process2} and FAILED_CARD.state != FAILED_CARD.INITIATOR group by task_id ) fc on fc.TASK_ID = task.TASK_ID\n" +
"where task.TASK_STATE_ID = #{process} order by group_no.GROUP_NO")
public List<Map<String,Object>> selectByCountyAtAuxiliary_common(@Param("process") long process,@Param("process2") long process2);
......@@ -339,7 +339,7 @@ public interface TaskListMapper {
"from group_no left join task on group_no.task_id= task.TASK_ID\n" +
"left join CARD_TYPE_DIC on CARD_TYPE_DIC.CARD_TYPE_ID = task.CARD_TYPE\n" +
"left join COUNTY_DIC on COUNTY_DIC.COUNTY_CODE = task.COUNTY_CODE\n" +
"left join (select task_id, nvl(count(*),0) faileCount from FAILED_CARD where FAILED_CARD.state =#{process2} and FAILED_CARD.state != FAILED_CARD.INITIATOR \n" +
"left join (select task_id, nvl(count(*),0) faileCount from FAILED_CARD where FAILED_CARD.state < #{process2} and FAILED_CARD.state != FAILED_CARD.INITIATOR \n" +
"group by task_id ) fc \n" +
"on fc.TASK_ID = task.TASK_ID\n" +
"left join prod_trace_t@PROD_LINK on SUBSTR(prod_trace_t.ACCEPT_NO,0,8) = group_no.GROUP_NO\n" +
......@@ -603,13 +603,13 @@ public interface TaskListMapper {
* 辅助库 废证
* @return
*/
@Select("select task.task_id,task.COUNTY_CODE,task.SUBMIT_DATE,task.SUBMIT_NAME,task.ISSUED_DATE,task.ISSUED_NAME,\n" +
@Select("select FAILED_CARD.FAILED_CARD_ID task_id,task.COUNTY_CODE,task.SUBMIT_DATE,task.SUBMIT_NAME,task.ISSUED_DATE,task.ISSUED_NAME,\n" +
"FAILED_CARD.PRINT_DATE PRINT_OUT_DATE,'' PRINT_OUT_NAME,'废证' CARD_TYPE ,'100' CARD_TYPE_ID,COUNTY_DIC.COUNTYNAME, \n" +
"1 VALID_COUNT,0 INVALID_COUNT, 0 SPECIAL_CARD_COUNT,FAILED_CARD.ACCEPT_NO GROUP_NO from FAILED_CARD \n" +
"left join task on FAILED_CARD.task_id= task.TASK_ID \n" +
"left join CARD_TYPE_DIC on CARD_TYPE_DIC.CARD_TYPE_ID = task.CARD_TYPE \n" +
"left join COUNTY_DIC on COUNTY_DIC.COUNTY_CODE = task.COUNTY_CODE\n" +
"where to_char(PRINT_DATE,'yyyyMMdd') = #{date} order by FAILED_CARD.ACCEPT_NO")
"where to_char(FAILED_CARD.PRINT_DATE,'yyyyMMdd') = #{date} order by FAILED_CARD.ACCEPT_NO")
public List<Map<String,Object>> selectHistoryTaskAtAuxiliary_failed2(@Param("date") String date);
......@@ -637,13 +637,13 @@ public interface TaskListMapper {
* 辅助库 废证
* @return
*/
@Select("select task.task_id,task.COUNTY_CODE,task.SUBMIT_DATE,task.SUBMIT_NAME,task.ISSUED_DATE,task.ISSUED_NAME,\n" +
@Select("select FAILED_CARD.FAILED_CARD_ID task_id,task.COUNTY_CODE,task.SUBMIT_DATE,task.SUBMIT_NAME,task.ISSUED_DATE,task.ISSUED_NAME,\n" +
"FAILED_CARD.PRINT_DATE PRINT_OUT_DATE,'' PRINT_OUT_NAME,FAILED_CARD.POSITION_DATE POSITION_DATE,'' POSITION_NAME,'废证' CARD_TYPE ,'100' CARD_TYPE_ID,COUNTY_DIC.COUNTYNAME, \n" +
"1 VALID_COUNT,0 INVALID_COUNT, 0 SPECIAL_CARD_COUNT,FAILED_CARD.ACCEPT_NO GROUP_NO from FAILED_CARD \n" +
"left join task on FAILED_CARD.task_id= task.TASK_ID \n" +
"left join CARD_TYPE_DIC on CARD_TYPE_DIC.CARD_TYPE_ID = task.CARD_TYPE \n" +
"left join COUNTY_DIC on COUNTY_DIC.COUNTY_CODE = task.COUNTY_CODE\n" +
"where to_char(POSITION_DATE,'yyyyMMdd') = #{date} order by FAILED_CARD.ACCEPT_NO")
"where to_char(FAILED_CARD.POSITION_DATE,'yyyyMMdd') = #{date} order by FAILED_CARD.ACCEPT_NO")
public List<Map<String,Object>> selectHistoryTaskAtAuxiliary_failed3(@Param("date") String date);
......@@ -671,15 +671,15 @@ public interface TaskListMapper {
* 辅助库 废证
* @return
*/
@Select("select task.task_id,task.COUNTY_CODE,task.SUBMIT_DATE,task.SUBMIT_NAME,task.ISSUED_DATE,task.ISSUED_NAME,\n" +
@Select("select FAILED_CARD.FAILED_CARD_ID task_id,task.COUNTY_CODE,task.SUBMIT_DATE,task.SUBMIT_NAME,task.ISSUED_DATE,task.ISSUED_NAME,\n" +
"FAILED_CARD.PRINT_DATE PRINT_OUT_DATE,'' PRINT_OUT_NAME,FAILED_CARD.POSITION_DATE POSITION_DATE,'' POSITION_NAME," +
" FAILED_CARD.ALLOT_DATE CONCORA_CRUSH_DATE ,'' CONCORA_CRUSH_NAME " +
"'废证' CARD_TYPE ,'100' CARD_TYPE_ID,COUNTY_DIC.COUNTYNAME, \n" +
",'废证' CARD_TYPE ,'100' CARD_TYPE_ID,COUNTY_DIC.COUNTYNAME, \n" +
"1 VALID_COUNT,0 INVALID_COUNT, 0 SPECIAL_CARD_COUNT,FAILED_CARD.ACCEPT_NO GROUP_NO from FAILED_CARD \n" +
"left join task on FAILED_CARD.task_id= task.TASK_ID \n" +
"left join CARD_TYPE_DIC on CARD_TYPE_DIC.CARD_TYPE_ID = task.CARD_TYPE \n" +
"left join COUNTY_DIC on COUNTY_DIC.COUNTY_CODE = task.COUNTY_CODE\n" +
"where to_char(ALLOT_DATE,'yyyyMMdd') = #{date} order by FAILED_CARD.ACCEPT_NO")
"where to_char(FAILED_CARD.ALLOT_DATE,'yyyyMMdd') = #{date} order by FAILED_CARD.ACCEPT_NO")
public List<Map<String,Object>> selectHistoryTaskAtAuxiliary_failed4(@Param("date") String date);
......
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;
}
}
......@@ -282,11 +282,11 @@ public class TaskListServiceImpl implements TaskListService {
@Transactional(rollbackFor = Exception.class)
public Map selectByCountyAtAuxiliary2(long process) {
//查询普通组号列表 在辅助库中
List<Map<String, Object>> mapList_common = taskListMapper.selectByCountyAtAuxiliary_common(process,process-2);
List<Map<String, Object>> mapList_common = taskListMapper.selectByCountyAtAuxiliary_common(process-1,process-2);
//查询快证组号列表 在辅助库中
List<Map<String, Object>> mapList_fast = taskListMapper.selectByCountyAtAuxiliary_fast(process,process-2);
List<Map<String, Object>> mapList_fast = taskListMapper.selectByCountyAtAuxiliary_fast(process-1,process-2);
//查询余证组号列表 在辅助库中
List<Map<String, Object>> mapList_remaind = taskListMapper.selectByCountyAtAuxiliary_remaind(process,process-2);
List<Map<String, Object>> mapList_remaind = taskListMapper.selectByCountyAtAuxiliary_remaind(process-1,process-2);
//查询废证组号列表 在辅助库中
List<Map<String, Object>> mapList_failed = taskListMapper.selectByCountyAtAuxiliary_failed(process-2);
......
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