Commit 90c70513 authored by suichenguang's avatar suichenguang

交接单修改2.0

parent 7cb8e3c9
......@@ -39,9 +39,11 @@ public class ReceiptApi {
Map<String,Object> resultDate =receiptService.selectReceiptListDate(id);
String acceptNo = (String) resultDate.get("ACCEPT_NO");
String GAJG_DM = (String) resultDate.get("GAJG_DM");
int state = 0;
int count = (int) resultDate.get("COUNT");
//生成特证交接单
receiptService.createReceiptList(acceptNo, GAJG_DM, count);
receiptService.createReceiptList(acceptNo, GAJG_DM, count,state);
System.out.println("6666666666666666666666666666666生成成功");
//查询特证详单所需数据
Map<String,Object> detailedData= receiptService.selectDetailedData(id);
String uploadNo = (String) detailedData.get("UPLOAD_NO");
......@@ -58,12 +60,15 @@ public class ReceiptApi {
Map<String, Object> receiptListDate = receiptService.selectReceiptListDate(id);
String groupNo = (String) receiptListDate.get("GROUP_NO");
String GAJG_DM = (String) receiptListDate.get("GAJG_DM");
int count = Integer.valueOf(receiptListDate.get("VALID_COUNT").toString()) ;
int state = 0;
//查询这个组号是否生成了交接单
int countGroup = receiptService.selectByGroupNo(groupNo);
if (countGroup == 0) {
receiptService.createReceiptList(groupNo,GAJG_DM,count,state);
System.out.println("6666666666666666666666666666666生成成功");
Map<String,Object> detailedData= receiptService.selectDetailedData(id);
System.out.println("555555555555555555555555detailedData"+detailedData);
String uploadNo = (String) detailedData.get("UPLOAD_NO");
String acceptNo2 = (String) detailedData.get("ACCEPT_NO");
String name = (String) detailedData.get("NAME");
......@@ -88,9 +93,15 @@ public class ReceiptApi {
}
//查询有几个
int specialCardCount =receiptService.selectSpecialCard(groupNo);
receiptService.detailedTallyDown(specialCardCount,groupNo);
int finishCount= receiptService.selectCount(groupNo) -specialCardCount;
System.out.println("77777777777777777777777777777777"+finishCount);
receiptService.updateFinishCount(groupNo,finishCount);
System.out.println("..............................................111111");
}
System.out.println("9999999999999999999999999999999999999");
List<Map<String,Object>> resultList=receiptService.selectReceiptListOfSpecialCard();
System.out.println("33333333333333333333resultList"+resultList);
return resultList;
}
......
......@@ -21,9 +21,8 @@ public interface ReceiptMapper {
public int selectByGroupNo(String groupNo);
//生成交接单
@Insert("INSERT INTO RECEIPT_LIST(QR_CODE,POLICE_CODE,FINISH_COUNT,CHECK_DATE,CHECK_NAME,STATE)" +
"VALES(#{GROUP_NO},#{GAJG_DM},#{count},#{CHECK_DATE},#{CHECK_NAME},#{STATE})")
public boolean createReceiptList(@Param("GROUP_NO")String GROUP_NO,@Param("GAJG_DM")String GAJG_DM,@Param("count")int count);
@Insert("INSERT INTO RECEIPT_LIST(QR_CODE,POLICE_CODE,FINISH_COUNT,STATE)VALUES(#{GROUP_NO},#{GAJG_DM},#{count},#{state})")
public boolean createReceiptList(@Param("GROUP_NO")String GROUP_NO,@Param("GAJG_DM")String GAJG_DM,@Param("count")int count,@Param("state")int state);
......@@ -51,12 +50,12 @@ public interface ReceiptMapper {
public int selectSpecialCard(String GROUP_NO);
//交接单数量减count
@Update("UPDATE RECEIPT_LIST \n" +
"SET FINISH_COUNT=(\n" +
"(SELECT COUNT(*) FROM RECEIPT_LIST\n" +
"WHERE QR_CODE=#{GROUP_NO})-#{COUNT})")
public boolean detailedTallyDown(int COUNT,String GROUP_NO);
@Select("select FINISH_COUNT from RECEIPT_LIST where QR_CODE=#{GROUP_NO}")
public int selectCount(String GROUP_NO);
@Update("update RECEIPT_LIST set FINISH_COUNT=#{count} where QR_CODE=#{GROUP_NO}")
public boolean updateFinishCount(String GROUP_NO,int count);
//根据身份证号查询特证表count
@Select("select count(*) from SPECIAL_CARD \n" +
......
......@@ -10,7 +10,7 @@ public interface ReceiptService {
public Map<String,Object> selectReceiptListDate(String id);
public boolean createReceiptList(@Param("GROUP_NO")String GROUP_NO, @Param("GAJG_DM")String GAJG_DM, @Param("count")int count);
public boolean createReceiptList(@Param("GROUP_NO")String GROUP_NO, @Param("GAJG_DM")String GAJG_DM, @Param("count")int count,@Param("state")int state);
public Map<String,Object>selectDetailedData(String id);
......@@ -18,8 +18,6 @@ public interface ReceiptService {
public int selectSpecialCard(String GROUP_NO);
public boolean detailedTallyDown(int COUNT,String GROUP_NO);
public int selectByGroupNo(String groupNo);
public int selectSpecialCardByAcceptNo(String id);
......@@ -31,4 +29,8 @@ public interface ReceiptService {
public List<Map<String,Object>> selectDetailList(String receiptId);
public boolean updateReceiptList(int receiptId, String checkName, Date date);
public int selectCount(String GROUP_NO);
public boolean updateFinishCount(String GROUP_NO,int count);
}
......@@ -21,8 +21,8 @@ public class ReceiptServiceImpl implements ReceiptService {
}
@Override
public boolean createReceiptList(String GROUP_NO, String GAJG_DM, int count) {
receiptMapper.createReceiptList(GROUP_NO,GAJG_DM,count);
public boolean createReceiptList(String GROUP_NO, String GAJG_DM, int count,int state) {
receiptMapper.createReceiptList(GROUP_NO,GAJG_DM,count,state);
return true;
}
......@@ -44,11 +44,7 @@ public class ReceiptServiceImpl implements ReceiptService {
return count;
}
@Override
public boolean detailedTallyDown(int COUNT, String GROUP_NO) {
receiptMapper.detailedTallyDown(COUNT,GROUP_NO);
return true;
}
@Override
public int selectByGroupNo(String groupNo) {
......@@ -86,5 +82,17 @@ public class ReceiptServiceImpl implements ReceiptService {
return true;
}
@Override
public int selectCount(String GROUP_NO) {
int count= receiptMapper.selectCount(GROUP_NO);
return count;
}
@Override
public boolean updateFinishCount(String GROUP_NO, int count) {
receiptMapper.updateFinishCount(GROUP_NO,count);
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