Commit dcc058a6 authored by liboyang's avatar liboyang

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

parents 480917d9 d5101242
......@@ -118,7 +118,6 @@ public class LogApi {
logService.changeFileState(fileId);
//查询身份数据
List<Map<String, Object>> dataList = logService.selectIdData(fileId);
System.out.println("0000000000000000000000000000000000"+dataList);
//将身份数据插入到邮寄表中
for (int i=0;i<dataList.size();i++){
logService.insertIdData((String) dataList.get(i).get("GMSFHM"),(String) dataList.get(i).get("SSXQDM"),(String) dataList.get(i).get("YXQQSRQ"),(String) dataList.get(i).get("YXQJZRQ"), (String) dataList.get(i).get("JMSFZSLH"));
......
package com.yxproject.start.api;
import com.yxproject.start.entity.CardBodyEntity;
import com.yxproject.start.entity.PlasticFilmEntity;
import com.yxproject.start.service.MaterialManagementService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping("MaterialManagementApi")
public class MaterialManagementApi {
@Autowired
private MaterialManagementService materialManagementService;
/**
* 插入膜耗材数据
* @param totalCount
* @param plasticFilmType
* @param note
* @return
*/
@RequestMapping("insertFilm")
public boolean insertFilm(@Param("totalCount")String totalCount, @Param("plasticFilmType")String plasticFilmType, @Param("note")String note){
boolean result = materialManagementService.insertFilm(totalCount, plasticFilmType, note);
return result;
}
/**
* 插入卡体耗材数据
* @param cardType
* @param totalCount
* @param note
* @return
*/
@RequestMapping("insertCardBody")
public boolean insertCardBody(@Param("cardType")String cardType,@Param("totalCount")String totalCount,@Param("note")String note){
boolean result = materialManagementService.insertCardBody(cardType, totalCount, note);
return result;
}
/**
* 查询耗材统计数据
* @param beginDate
* @param endDate
* @return
*/
@RequestMapping("selectMaterialManagement")
public Map<String,Object> selectMaterialManagement(@Param("beginDate")String beginDate,@Param("endDate")String endDate){
Map<String,Object> resultMap = new HashMap<>();
List<CardBodyEntity> cardBodyEntities = materialManagementService.selectCardBody(replaceDate(beginDate),replaceDate(endDate));
List<PlasticFilmEntity> plasticFilmEntities = materialManagementService.selectFilm(replaceDate(beginDate),replaceDate(endDate));
String cardCount1 = materialManagementService.selectCardCount1(beginDate,endDate);
String cardCount2 = materialManagementService.selectCardCount2(beginDate,endDate);
String plasticFilmCount1=materialManagementService.selectFilmCount1(beginDate,endDate);
String plasticFilmCount2=materialManagementService.selectFilmCount2(beginDate,endDate);
resultMap.put("cardBody",cardBodyEntities);
resultMap.put("cardCount1",cardCount1);
resultMap.put("cardCount2",cardCount2);
resultMap.put("plasticFilm",plasticFilmEntities);
resultMap.put("plasticFilmCount1",plasticFilmCount1);
resultMap.put("plasticFilmCount2",plasticFilmCount2);
return resultMap;
}
/**
* 去除字符串中中线
* @param str
* @return
*/
private String replaceDate(String str){
return str.replace("-","").replace(" ","");
}
}
......@@ -70,7 +70,7 @@ public class ReceiptApi {
String gajg_dm = (String) detailedData.get("GAJG_DM");
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);
} else {
//已经生成特证交接单,不做操作。
}
......@@ -117,30 +117,21 @@ public class ReceiptApi {
String gajg_dm = (String) detailedData.get("GAJG_DM");
int receiptId = Integer.parseInt((BigDecimal) detailedData.get("ID") + "");
//生成详单
receiptService.createDetailedList(uploadNo, acceptNo2, name, receiptListDate.get(n).get("ID_NO").toString(), gajg_dm, receiptId, sex,signGovt);
receiptService.createDetailedList(uploadNo, acceptNo2, name, receiptListDate.get(n).get("ID_NO").toString(), gajg_dm, receiptId, sex, signGovt);
} else {
//不做操作
}
}
} else {
//已生成交接单
}
// //查询有几个特证
// int specialCardCount = receiptService.selectSpecialCard(receiptListDate.get(i).get("GROUP_NO").toString());
// //减去特证个数
// int finishCount = receiptService.selectCount(receiptListDate.get(i).get("GROUP_NO").toString()) - specialCardCount;
// receiptService.updateFinishCount(receiptListDate.get(i).get("GROUP_NO").toString(), finishCount);
}
}
return true;
}
......@@ -156,19 +147,18 @@ public class ReceiptApi {
List<Map<String, Object>> resultMap = receiptService.selectReceiptListOfSpecialCard();
for (int i = 0; i < resultMap.size(); i++) {
String groupNo = (String) resultMap.get(i).get("QR_CODE");
if (groupNo.length()==10){
//判断是否是特证
if (groupNo.length() == 10) {
Map<String, Object> map = receiptService.selectCountTimeT(groupNo);
resultMap.get(i).put("download", map.get("DOWNLOAD"));
resultMap.get(i).put("checkerCount", map.get("CHECKERCOUNT"));
resultMap.get(i).put("electricCount", map.get("ELECTRICCOUNT"));
}else {
} else {
Map<String, Object> map = receiptService.selectCountTime(groupNo);
resultMap.get(i).put("download", map.get("DOWNLOAD"));
resultMap.get(i).put("checkerCount", map.get("CHECKERCOUNT"));
resultMap.get(i).put("electricCount", map.get("ELECTRICCOUNT"));
}
}
return resultMap;
}
......@@ -215,6 +205,7 @@ public class ReceiptApi {
/**
* 根据受理号查询详单信息
*
* @param jsonStr
* @return
*/
......@@ -231,6 +222,7 @@ public class ReceiptApi {
/**
* 更改备注信息
*
* @param jsonStr
* @return
*/
......
package com.yxproject.start.mapper;
import com.yxproject.start.entity.CardBodyEntity;
import com.yxproject.start.entity.PlasticFilmEntity;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.Date;
import java.util.List;
import java.util.Map;
@Mapper
public interface MaterialManagementMapper {
@Insert("INSERT INTO PLASTIC_FILM (TOTAL_COUNT,PLASTIC_FILM_TYPE,NOTE)VALUES(#{totalCount},#{plasticFilmType},#{note})")
public boolean insertFilm(@Param("totalCount")String totalCount,@Param("plasticFilmType")String plasticFilmType,@Param("note")String note);
@Select("select * from plastic_film where to_char(save_date,'yyyyMMdd') BETWEEN #{beginDate} and #{endDate}")
public List<PlasticFilmEntity> selectFilm(@Param("beginDate") String beginDate,@Param("endDate")String endDate);
@Select("select sum(TOTAL_COUNT) PLASTIC_FILM_TYPE1 from plastic_film where to_char(save_date,'yyyyMMdd') BETWEEN #{beginDate} and #{endDate} and PLASTIC_FILM_TYPE=1 ")
public String selectFilmCount1(@Param("beginDate") String beginDate,@Param("endDate")String endDate);
@Select("select sum(TOTAL_COUNT) PLASTIC_FILM_TYPE1 from plastic_film where to_char(save_date,'yyyyMMdd') BETWEEN #{beginDate} and #{endDate} and PLASTIC_FILM_TYPE=2")
public String selectFilmCount2(@Param("beginDate") String beginDate,@Param("endDate")String endDate);
@Insert("INSERT INTO CARD_BODY (CARD_TYPE,TOTAL_COUNT,NOTE)VALUES(#{cardType},#{totalCount},#{note})")
public boolean insertCardBody(@Param("cardType")String cardType,@Param("totalCount")String totalCount,@Param("note")String note);
@Select("select * from CARD_BODY where to_char(SAVE_DATE,'yyyyMMdd') between #{beginDate} and #{endDate}")
public List<CardBodyEntity> selectCardBody(@Param("beginDate")String beginDate,@Param("endDate")String endDate);
@Select("select sum(TOTAL_COUNT) cardType1 from CARD_BODY where to_char(save_date,'yyyyMMdd') BETWEEN #{beginDate} and #{endDate} and CARD_TYPE=1")
public String selectCardCount1(@Param("beginDate")String beginDate,@Param("endDate")String endDate);
@Select("select sum(TOTAL_COUNT) cardType2 from CARD_BODY where to_char(save_date,'yyyyMMdd') BETWEEN #{beginDate} and #{endDate} and CARD_TYPE=2")
public String selectCardCount2(@Param("beginDate")String beginDate,@Param("endDate")String endDate);
}
......@@ -59,7 +59,6 @@ public interface ReceiptMapper {
@Options(useGeneratedKeys=true, keyProperty="id", keyColumn="ID")
public boolean createReceiptList(ReceiptListEntity receiptListEntity);
//根据身份证号查询交接单详单信息
@Select("select prod_card_t.upload_no," +
"PROD_CARD_T.ACCEPT_NO," +
......@@ -92,15 +91,11 @@ public interface ReceiptMapper {
"where prod_card_t.id_no=#{id}")
public Map<String,Object>selectDetailedData2(String id);
//生成交接单详单
@Insert("INSERT INTO DETAIL_RECEIPT_LIST (UPLOAD_NO,accept_no,name,card_id,POLICE_CODE,RECEIPT_ID,SEX,SIGN_GOVT)" +
"VALUES(#{UPLOAD_NO},#{ACCEPT_NO},#{NAME},#{CARD_ID},#{GAJG_DM},#{RECEIPT_ID},#{SEX},#{signGovt})")
public boolean createDetailedList(@Param("UPLOAD_NO")String UPLOAD_NO,@Param("ACCEPT_NO")String ACCEPT_NO,@Param("NAME")String NAME,@Param("CARD_ID")String CARD_ID,@Param("GAJG_DM")String GAJG_DM,@Param("RECEIPT_ID")long RECEIPT_ID,@Param("SEX")String SEX,@Param("signGovt")String signGovt);
//根据组号查询特证表
@Select("SELECT count(*) FROM SPECIAL_CARD WHERE subStr(ACCEPT_NO,0,8) =#{GROUP_NO}")
public int selectSpecialCard(@Param("GROUP_NO") String GROUP_NO);
......@@ -112,15 +107,12 @@ public interface ReceiptMapper {
@Update("update RECEIPT_LIST set FINISH_COUNT=#{count} where QR_CODE=#{GROUP_NO}")
public boolean updateFinishCount(@Param("GROUP_NO") String GROUP_NO,@Param("count") int count);
//根据身份证号查询特证表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}")
public int selectSpecialCardByAcceptNo(@Param("id") String id);
//查询未复核交接单
@Select("SELECT RECEIPT_LIST.* ,GAJG_DM.GAJG_MC FROM RECEIPT_LIST LEFT JOIN GAJG_DM ON RECEIPT_LIST.POLICE_CODE=GAJG_DM.GAJG_DM where state=0\n")
public List<Map<String,Object>>selectReceiptListOfSpecialCard ();
......@@ -131,12 +123,10 @@ public interface ReceiptMapper {
"WHERE PROD_CARD_T.ID_NO =#{id}")
public Map<String,Object> selectReceiptList(@Param("id") String id);
//根据交接单号查详单信息
@Select("select * from detail_receipt_list where receipt_id=#{receiptId}")
public List<Map<String,Object>> selectDetailList(@Param("receiptId") String receiptId);
//根据传入的交接单ID和复核人ID插入复核人、复核时间、更改状态
@Update("update receipt_list set \n" +
"check_date = #{date},\n" +
......@@ -155,12 +145,10 @@ public interface ReceiptMapper {
@Select("select count(*) 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);
//根据输入id查询是否生成详单
@Select("select count(*) from DETAIL_RECEIPT_LIST where ACCEPT_NO=(select accept_no from prod_card_t@prod_link where id_no=#{id})")
public int selectReceiptById(@Param("id") String id);
@Select("select \n" +
"count(prod_trace_t.download_no)as download,\n" +
"count(prod_trace_t.checker_no) as checkerCount,\n" +
......@@ -169,8 +157,6 @@ public interface ReceiptMapper {
"WHERE (subStr(ACCEPT_NO,0,8) = #{groupNo} or ACCEPT_NO=#{groupNo}) and prod_trace_t.accept_no not in (select special_card.accept_no from special_card ) ")
public Map<String,Object> selectCountTime(@Param("groupNo") String groupNo);
@Select("select \n" +
"count(prod_trace_t.download_no)as download,\n" +
"count(prod_trace_t.checker_no) as checkerCount,\n" +
......@@ -179,7 +165,6 @@ public interface ReceiptMapper {
"WHERE ACCEPT_NO=#{groupNo}")
public Map<String,Object> selectCountTimeT(@Param("groupNo") String groupNo);
@Select("select \n" +
"prod_trace_t.DOWNLOAD_DATE as downloadDate,\n" +
"prod_trace_t.CHECK_DATE as checkDate,\n" +
......@@ -206,7 +191,6 @@ public interface ReceiptMapper {
" where to_char(CHECK_DATE,'yyyyMMdd') = ${date} and RECEIPT_LIST.POLICE_CODE in (${string}) and CARD_TYPE_DIC.CARD_TYPE_ID=${type} ")
public List<Map<String,Object>> selectReceiptDate(@Param("date") String date,@Param("string") String string,@Param("type") long type);
@Select("select DETAIL_RECEIPT_LIST.* , GAJG_DM.GAJG_MC from DETAIL_RECEIPT_LIST LEFT JOIN GAJG_DM ON GAJG_DM.GAJG_DM =DETAIL_RECEIPT_LIST.POLICE_CODE where ACCEPT_NO=#{acceptNo} or card_id=#{acceptNo}")
@Options(useGeneratedKeys=true, keyProperty="gajg_mc", keyColumn="GAJG_MC")
public DetailReceiptListEntity selectDetailByAcceptNo(@Param("acceptNo") String acceptNo);
......
package com.yxproject.start.service;
import com.yxproject.start.entity.CardBodyEntity;
import com.yxproject.start.entity.PlasticFilmEntity;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
import java.util.Map;
public interface MaterialManagementService {
public boolean insertFilm( @Param("totalCount")String totalCount, @Param("plasticFilmType")String plasticFilmType, @Param("note")String note);
public List<PlasticFilmEntity> selectFilm(@Param("beginDate") String beginDate, @Param("endDate")String endDate);
public boolean insertCardBody(@Param("cardType")String cardType,@Param("totalCount")String totalCount,@Param("note")String note);
public List<CardBodyEntity> selectCardBody(@Param("beginDate")String beginDate, @Param("endDate")String endDate);
public String selectFilmCount1(@Param("beginDate") String beginDate,@Param("endDate")String endDate);
public String selectFilmCount2(@Param("beginDate") String beginDate,@Param("endDate")String endDate);
public String selectCardCount1(@Param("beginDate")String beginDate,@Param("endDate")String endDate);
public String selectCardCount2(@Param("beginDate")String beginDate,@Param("endDate")String endDate);
}
package com.yxproject.start.service.impl;
import com.yxproject.start.entity.CardBodyEntity;
import com.yxproject.start.entity.PlasticFilmEntity;
import com.yxproject.start.mapper.MaterialManagementMapper;
import com.yxproject.start.service.MaterialManagementService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
import java.util.Map;
@Service
public class MaterialManagementServiceImpl implements MaterialManagementService {
@Autowired
private MaterialManagementMapper materialManagementMapper;
@Override
public boolean insertFilm( String totalCount, String plasticFilmType, String note) {
materialManagementMapper.insertFilm(totalCount,plasticFilmType,note);
return true;
}
@Override
public List<PlasticFilmEntity> selectFilm(String beginDate, String endDate) {
List<PlasticFilmEntity> resultList = materialManagementMapper.selectFilm(beginDate, endDate);
return resultList;
}
@Override
public boolean insertCardBody( String cardType, String totalCount, String note) {
materialManagementMapper.insertCardBody(cardType,totalCount,note);
return true;
}
@Override
public List<CardBodyEntity> selectCardBody(String beginDate, String endDate) {
List<CardBodyEntity> resultList = materialManagementMapper.selectCardBody(beginDate, endDate);
return resultList;
}
@Override
public String selectFilmCount1(String beginDate, String endDate) {
String result = materialManagementMapper.selectFilmCount1(beginDate, endDate);
return result;
}
@Override
public String selectFilmCount2(String beginDate, String endDate) {
String result = materialManagementMapper.selectFilmCount2(beginDate, endDate);
return result;
}
@Override
public String selectCardCount1(String beginDate, String endDate) {
String result = materialManagementMapper.selectCardCount1(beginDate, endDate);
return result;
}
@Override
public String selectCardCount2(String beginDate, String endDate) {
String result = materialManagementMapper.selectCardCount2(beginDate, endDate);
return result;
}
}
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