Commit a097571e authored by dahai's avatar dahai

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

parents 95991ced b48ebe2b
......@@ -3,8 +3,11 @@ package com.yxproject.start.api;
import com.yxproject.start.service.ReceiptService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
@RestController
......@@ -22,6 +25,7 @@ public class ReceiptApi {
* @return
*/
@RequestMapping("createReceiptList")
@Transactional(rollbackFor = Exception.class)
public boolean createReceiptList(@Param("id") String id) {
//判断是否是特证
......@@ -81,4 +85,21 @@ public class ReceiptApi {
}
return true;
}
@RequestMapping("selectReceipt")
public Map<String,Object> selectReceipt(String id){
Map<String,Object> resultMap=receiptService.selectReceiptListOfSpecialCard(id);
if (resultMap==null){
resultMap= receiptService.selectReceiptList(id);
}
return resultMap;
}
@RequestMapping("selectDetailList")
public List<Map<String,Object>> selectDetailList(String receiptId){
List<Map<String, Object>> resultList = receiptService.selectDetailList(receiptId);
return resultList;
}
}
package com.yxproject.start.mapper;
import org.apache.ibatis.annotations.Mapper;
/**
* @auther zhangyusheng
* 2019/3/1 21:41
*/
@Mapper
public interface ReceiptListMapper {
}
......@@ -2,14 +2,12 @@ package com.yxproject.start.mapper;
import org.apache.ibatis.annotations.*;
import java.util.List;
import java.util.Map;
@Mapper
public interface ReceiptMapper {
//根据身份证号查询交接单信息
@Select("select prod_group_t.group_no,prod_card_t.accept_no,subStr(prod_card_t.UPLOAD_NO,0,9) as GAJG_DM,prod_group_t.valid_count\n" +
"from prod_card_t@PROD_LINK\n" +
......@@ -56,7 +54,7 @@ public interface ReceiptMapper {
"WHERE QR_CODE=#{GROUP_NO})-#{COUNT})")
public boolean detailedTallyDown(int COUNT,String GROUP_NO);
//根据身份证号查询特证表
//根据身份证号查询特证表count
@Select("select count(*) from SPECIAL_CARD \n" +
"left join prod_card_t@prod_link on special_card.accept_no = prod_card_t.accept_no\n" +
"where prod_card_t.id_no = #{id}")
......@@ -64,6 +62,23 @@ public interface ReceiptMapper {
//根据身份证号查询特证交接单
@Select("SELECT RECEIPT_LIST.* FROM RECEIPT_LIST \n" +
"LEFT JOIN PROD_CARD_T@PROD_LINK ON PROD_CARD_T.ACCEPT_NO =RECEIPT_LIST.QR_CODE\n" +
"WHERE PROD_CARD_T.ID_NO =#{id}")
public Map<String,Object>selectReceiptListOfSpecialCard (String id);
//根据身份证号查询普通证交接单
@Select("SELECT RECEIPT_LIST.* FROM RECEIPT_LIST \n" +
"LEFT JOIN PROD_CARD_T@PROD_LINK ON subStr(PROD_CARD_T.ACCEPT_NO,0,8) =RECEIPT_LIST.QR_CODE\n" +
"WHERE PROD_CARD_T.ID_NO =#{id}")
public Map<String,Object> selectReceiptList(String id);
//根据交接单号查详单信息
@Select("select * from detail_receipt_list where receipt=#{RECEIPT_ID}")
public List<Map<String,Object>> selectDetailList(String receiptId);
......
package com.yxproject.start.service;
/**
* @auther zhangyusheng
* 2019/3/1 21:41
*/
public interface ReceiptListService {
}
......@@ -2,6 +2,7 @@ package com.yxproject.start.service;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
public interface ReceiptService {
......@@ -21,4 +22,10 @@ public interface ReceiptService {
public int selectByGroupNo(String groupNo);
public int selectSpecialCardByAcceptNo(String id);
public Map<String,Object>selectReceiptListOfSpecialCard (String id);
public Map<String,Object> selectReceiptList(String id);
public List<Map<String,Object>> selectDetailList(String receiptId);
}
package com.yxproject.start.service.impl;
import com.yxproject.start.mapper.ReceiptListMapper;
import com.yxproject.start.service.ReceiptListService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @auther zhangyusheng
* 2019/3/1 21:42
*/
@Service
public class ReceiptListServiceImpl implements ReceiptListService {
@Autowired
private ReceiptListMapper receiptListMapper;
}
......@@ -5,6 +5,7 @@ import com.yxproject.start.service.ReceiptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
@Service
......@@ -60,5 +61,23 @@ public class ReceiptServiceImpl implements ReceiptService {
return countSpecial;
}
@Override
public Map<String, Object> selectReceiptListOfSpecialCard(String id) {
Map<String,Object> resultMap= receiptMapper.selectReceiptListOfSpecialCard(id);
return resultMap;
}
@Override
public Map<String, Object> selectReceiptList(String id) {
Map<String, Object> resultMap = receiptMapper.selectReceiptList(id);
return resultMap;
}
@Override
public List<Map<String, Object>> selectDetailList(String receiptId) {
List<Map<String, Object>> resultList = receiptMapper.selectDetailList(receiptId);
return resultList;
}
}
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