Commit b6981d1b authored by dahai's avatar dahai

push

parent 5f62b562
...@@ -14,10 +14,7 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -14,10 +14,7 @@ import org.springframework.web.bind.annotation.RestController;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.*;
import java.util.Date;
import java.util.List;
import java.util.Map;
@RestController @RestController
@RequestMapping("ReceiptApi") @RequestMapping("ReceiptApi")
...@@ -37,13 +34,13 @@ public class ReceiptApi { ...@@ -37,13 +34,13 @@ public class ReceiptApi {
*/ */
@RequestMapping("createReceiptList") @RequestMapping("createReceiptList")
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public boolean createReceiptList(@RequestParam("id") String id) { public Map<String,Object> createReceiptList(@RequestParam("id") String id) {
//判断是否是特证 //判断是否是特证
if (receiptService.selectSpecialCardByAcceptNo(id) == 1) { if (receiptService.selectSpecialCardByAcceptNo(id) == 1) {
//查询这个受理号是否生成了交接单 //查询这个受理号是否生成了交接单
int countAccept = receiptService.selectCountById(id); List<Map<String, Object>> mapList = receiptService.selectCountById(id);
//判断是否生成了交接单 //判断是否生成了交接单
if (countAccept == 0) { if (mapList.size() == 0) {
//查询特证交接单所需数据 //查询特证交接单所需数据
Map<String, Object> resultDate = receiptService.selectReceiptListDate(id); Map<String, Object> resultDate = receiptService.selectReceiptListDate(id);
ReceiptListEntity receiptListEntity = new ReceiptListEntity(); ReceiptListEntity receiptListEntity = new ReceiptListEntity();
...@@ -57,7 +54,7 @@ public class ReceiptApi { ...@@ -57,7 +54,7 @@ public class ReceiptApi {
receiptListEntity.setQrCode(resultDate.get("ACCEPT_NO").toString()); receiptListEntity.setQrCode(resultDate.get("ACCEPT_NO").toString());
receiptListEntity.setState((long) 0); receiptListEntity.setState((long) 0);
//生成特证交接单 //生成特证交接单
Boolean S = receiptService.createReceiptList(receiptListEntity); long S = receiptService.createReceiptList(receiptListEntity);
//查询特证详单所需数据 //查询特证详单所需数据
Map<String, Object> detailedData = receiptService.selectDetailedData2(id); Map<String, Object> detailedData = receiptService.selectDetailedData2(id);
...@@ -70,13 +67,23 @@ public class ReceiptApi { ...@@ -70,13 +67,23 @@ public class ReceiptApi {
Long receiptId = receiptListEntity.getId(); Long receiptId = receiptListEntity.getId();
//生成特证详单 //生成特证详单
receiptService.createDetailedList(uploadNo, acceptNo2, name, id, gajg_dm, receiptId, sex, signGovt); receiptService.createDetailedList(uploadNo, acceptNo2, name, id, gajg_dm, receiptId, sex, signGovt);
Map<String,Object> map = new HashMap<>();
map.put("show",true);
map.put("msg","生成交接单");
map.put("id",S);
return map;
} else { } else {
//已经生成特证交接单,不做操作。 //已经生成特证交接单,不做操作。
Map<String,Object> map = new HashMap<>();
map.put("show",false);
map.put("msg","已生成交接单");
map.put("id",mapList.get(0).get("ID"));
return map;
} }
} else { } else {
//根据身份证号查组号 //根据身份证号查组号
String groupNo = receiptService.selectGroupNoById(id); String groupNo = receiptService.selectGroupNoById(id);
//查询交接单所需数据 //查询单所需数据
List<Map<String, Object>> receiptListDate = receiptService.selectReceiptListDate2(groupNo); List<Map<String, Object>> receiptListDate = receiptService.selectReceiptListDate2(groupNo);
for (int i = 0; i < receiptListDate.size(); i++) { for (int i = 0; i < receiptListDate.size(); i++) {
...@@ -94,13 +101,12 @@ public class ReceiptApi { ...@@ -94,13 +101,12 @@ public class ReceiptApi {
// 状态0未复核 // 状态0未复核
receiptListEntity.setState((long) 0); receiptListEntity.setState((long) 0);
//查询这个组号是否生成了交接单 //查询这个组号是否生成了交接单
int countGroup = receiptService.selectByGroupNo(receiptListDate.get(i).get("GROUP_NO").toString()); List<Map<String, Object>> mapList = receiptService.selectByGroupNo(receiptListDate.get(i).get("GROUP_NO").toString());
//没有生成交接单 //没有生成交接单
if (countGroup == 0) { if (mapList.size() == 0) {
//生成交接单 //生成交接单
receiptService.createReceiptList(receiptListEntity); long receiptList = receiptService.createReceiptList(receiptListEntity);
for (int n = 0; n < receiptListDate.size(); n++) { for (int n = 0; n < receiptListDate.size(); n++) {
// receiptService.
//查询这个身份证是否生成了详单 //查询这个身份证是否生成了详单
int receiptCount = receiptService.selectReceiptById(receiptListDate.get(n).get("ID_NO").toString()); int receiptCount = receiptService.selectReceiptById(receiptListDate.get(n).get("ID_NO").toString());
//没有生成交接单详单 //没有生成交接单详单
...@@ -119,12 +125,25 @@ public class ReceiptApi { ...@@ -119,12 +125,25 @@ public class ReceiptApi {
//不做操作 //不做操作
} }
} }
Map<String,Object> map = new HashMap<>();
map.put("show",true);
map.put("id",receiptList);
return map;
} else { } else {
//已生成交接单 //已生成交接单
Map<String,Object> map = new HashMap<>();
map.put("show",false);
map.put("msg","已生成交接单");
map.put("id",mapList.get(0).get("ID"));
return map;
} }
} }
Map<String,Object> map = new HashMap<>();
map.put("show",false);
map.put("msg","未查询出对应的信息");
return map;
} }
return true;
} }
......
...@@ -42,8 +42,8 @@ public interface ReceiptMapper { ...@@ -42,8 +42,8 @@ public interface ReceiptMapper {
public List<Map<String,Object>> selectReceiptListDate2(String id); public List<Map<String,Object>> selectReceiptListDate2(String id);
//查询这个组号是否已经生成交接单 //查询这个组号是否已经生成交接单
@Select("select count(*) from receipt_list where QR_CODE=#{groupNo}") @Select("select id from receipt_list where QR_CODE=#{groupNo}")
public int selectByGroupNo(String groupNo); public List<Map<String,Object>> selectByGroupNo(String groupNo);
//生成交接单 //生成交接单
@Insert("<script>" + @Insert("<script>" +
...@@ -57,7 +57,7 @@ public interface ReceiptMapper { ...@@ -57,7 +57,7 @@ public interface ReceiptMapper {
"</if> " + "</if> " +
") </script>") ") </script>")
@Options(useGeneratedKeys=true, keyProperty="id", keyColumn="ID") @Options(useGeneratedKeys=true, keyProperty="id", keyColumn="ID")
public boolean createReceiptList(ReceiptListEntity receiptListEntity); public long createReceiptList(ReceiptListEntity receiptListEntity);
//根据身份证号查询交接单详单信息 //根据身份证号查询交接单详单信息
@Select("select prod_card_t.upload_no," + @Select("select prod_card_t.upload_no," +
...@@ -142,8 +142,8 @@ public interface ReceiptMapper { ...@@ -142,8 +142,8 @@ public interface ReceiptMapper {
public boolean updateReceiptDateByReceiptId(@Param("receiptId") String receiptId); public boolean updateReceiptDateByReceiptId(@Param("receiptId") String receiptId);
//根据输入id查询交接单是否生成 //根据输入id查询交接单是否生成
@Select("select count(*) from RECEIPT_LIST where QR_CODE=(select accept_no from prod_card_t@prod_link where id_no=#{id})") @Select("select id from RECEIPT_LIST where QR_CODE=(select accept_no from prod_card_t@prod_link where id_no=#{id}) ")
public int selectCountById(@Param("id") String id); public List<Map<String,Object>> selectCountById(@Param("id") String id);
//根据输入id查询是否生成详单 //根据输入id查询是否生成详单
@Select("select count(*) from DETAIL_RECEIPT_LIST where ACCEPT_NO=(select accept_no from prod_card_t@prod_link where id_no=#{id})") @Select("select count(*) from DETAIL_RECEIPT_LIST where ACCEPT_NO=(select accept_no from prod_card_t@prod_link where id_no=#{id})")
......
...@@ -12,7 +12,7 @@ public interface ReceiptService { ...@@ -12,7 +12,7 @@ public interface ReceiptService {
public Map<String,Object> selectReceiptListDate(String id); public Map<String,Object> selectReceiptListDate(String id);
public boolean createReceiptList(ReceiptListEntity receiptListEntity); public long createReceiptList(ReceiptListEntity receiptListEntity);
public Map<String,Object>selectDetailedData(String id); public Map<String,Object>selectDetailedData(String id);
...@@ -20,7 +20,7 @@ public interface ReceiptService { ...@@ -20,7 +20,7 @@ public interface ReceiptService {
public int selectSpecialCard(String GROUP_NO); public int selectSpecialCard(String GROUP_NO);
public int selectByGroupNo(String groupNo); public List<Map<String,Object>> selectByGroupNo(String groupNo);
public int selectSpecialCardByAcceptNo(String id); public int selectSpecialCardByAcceptNo(String id);
...@@ -42,7 +42,7 @@ public interface ReceiptService { ...@@ -42,7 +42,7 @@ public interface ReceiptService {
//特证查询是否生成交接单 //特证查询是否生成交接单
public int selectCountById(@Param("id") String id); public List<Map<String, Object>> selectCountById(@Param("id") String id);
//查询是否已生成交接单详单 //查询是否已生成交接单详单
public int selectReceiptById(@Param("id") String id); public int selectReceiptById(@Param("id") String id);
......
...@@ -21,9 +21,9 @@ public class ReceiptServiceImpl implements ReceiptService { ...@@ -21,9 +21,9 @@ public class ReceiptServiceImpl implements ReceiptService {
} }
@Override @Override
public boolean createReceiptList(ReceiptListEntity receiptListEntity) { public long createReceiptList(ReceiptListEntity receiptListEntity) {
receiptMapper.createReceiptList(receiptListEntity);
return true; return receiptMapper.createReceiptList(receiptListEntity);
} }
@Override @Override
...@@ -47,8 +47,8 @@ public class ReceiptServiceImpl implements ReceiptService { ...@@ -47,8 +47,8 @@ public class ReceiptServiceImpl implements ReceiptService {
@Override @Override
public int selectByGroupNo(String groupNo) { public List<Map<String,Object>> selectByGroupNo(String groupNo) {
int countGroup= receiptMapper.selectByGroupNo(groupNo); List<Map<String,Object>> countGroup= receiptMapper.selectByGroupNo(groupNo);
return countGroup; return countGroup;
} }
...@@ -100,9 +100,9 @@ public class ReceiptServiceImpl implements ReceiptService { ...@@ -100,9 +100,9 @@ public class ReceiptServiceImpl implements ReceiptService {
} }
@Override @Override
public int selectCountById(String id) { public List<Map<String, Object>> selectCountById(String id) {
int countAccept= receiptMapper.selectCountById(id); List<Map<String, Object>> mapList = receiptMapper.selectCountById(id);
return countAccept; return mapList;
} }
@Override @Override
......
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