Commit 5c186111 authored by dahai's avatar dahai

push

parent a744ac7f
......@@ -62,13 +62,13 @@ public class ExportExcelApi {
* 导出交接单
*/
@RequestMapping("printReceiptExcelData")
public List<Map<String, Object>> printReceiptExcelData(@RequestBody String list, HttpServletResponse response) {
public Map<String, Object> printReceiptExcelData(@RequestBody String list, HttpServletResponse response) {
JSONObject jsonObject = JSONObject.fromObject(list);
JSONArray jsonArray = JSONArray.fromObject(jsonObject.get("list"));
String startDate = jsonObject.get("startDate").toString();
String endDate = jsonObject.get("endDate").toString();
String type = jsonObject.get("type").toString();
List<Map<String, Object>> mapList = receiptService.selectReceiptList(jsonArray, replaceDate(startDate),replaceDate(endDate), Long.valueOf(type));
Map<String, Object> map = receiptService.selectReceiptList(jsonArray, replaceDate(startDate),replaceDate(endDate), Long.valueOf(type));
// response.setContentType("application/x-download");
// response.setCharacterEncoding("UTF-8");
// String dateTime = DateFormatUtils.format(new Date(), "yyyy_MM_dd");
......@@ -92,7 +92,7 @@ public class ExportExcelApi {
// e.printStackTrace();
// }
// return null;
return mapList;
return map;
}
......
......@@ -186,7 +186,7 @@ public interface ReceiptMapper {
"left join CARD_TYPE_DIC on CARD_TYPE_DIC.CARD_TYPE_ID = decode(RECEIPT_LIST.Old_CARD_TYPE_ID,null,RECEIPT_LIST.CARD_TYPE_ID,RECEIPT_LIST.Old_CARD_TYPE_ID)\n" +
"left join GAJG_DM on GAJG_DM.GAJG_DM = RECEIPT_LIST.POLICE_CODE\n" +
"left join COUNTY_DIC on substr(RECEIPT_LIST.POLICE_CODE,0,6) = COUNTY_DIC.COUNTY_CODE" +
" where to_char(CHECK_DATE,'yyyyMMddhhmmss') BETWEEN ${startDate} and ${endDate} ")
" where to_char(CHECK_DATE,'yyyyMMddhhmmss') BETWEEN ${startDate} and ${endDate} and receipt_date is null ")
public List<Map<String,Object>> selectReceiptDateByCheckDate(@Param("startDate") String startDate,@Param("endDate") String endDate);
......@@ -208,7 +208,7 @@ public interface ReceiptMapper {
"left join CARD_TYPE_DIC on CARD_TYPE_DIC.CARD_TYPE_ID = decode(RECEIPT_LIST.Old_CARD_TYPE_ID,null,RECEIPT_LIST.CARD_TYPE_ID,RECEIPT_LIST.Old_CARD_TYPE_ID)\n" +
"left join GAJG_DM on GAJG_DM.GAJG_DM = RECEIPT_LIST.POLICE_CODE\n" +
"left join COUNTY_DIC on substr(RECEIPT_LIST.POLICE_CODE,0,6) = COUNTY_DIC.COUNTY_CODE" +
" where to_char(CHECK_DATE,'yyyyMMddhhmmss') BETWEEN ${startDate} and ${endDate} and RECEIPT_LIST.POLICE_CODE in (${string}) and CARD_TYPE_DIC.CARD_TYPE_ID=${type} ")
" where to_char(CHECK_DATE,'yyyyMMddhhmmss') BETWEEN ${startDate} and ${endDate} and RECEIPT_LIST.POLICE_CODE in (${string}) and CARD_TYPE_DIC.CARD_TYPE_ID=${type} and receipt_date is null ")
public List<Map<String,Object>> selectReceiptDate(@Param("startDate") String startDate,@Param("endDate") String endDate,@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}")
......@@ -226,7 +226,7 @@ public interface ReceiptMapper {
* @param type 制证类型
* @return
*/
@Update("update RECEIPT_LIST set IS_PRINT = 1,RECEIPT_DATE = sysdate where to_char(CHECK_DATE,'yyyyMMddhhmmss') BETWEEN ${startDate} and ${endDate} and RECEIPT_LIST.POLICE_CODE in (${string}) and CARD_TYPE_ID=${type}")
@Update("update RECEIPT_LIST set IS_PRINT = 1,RECEIPT_DATE = sysdate where to_char(CHECK_DATE,'yyyyMMddhhmmss') BETWEEN ${startDate} and ${endDate} and RECEIPT_LIST.POLICE_CODE in (${string}) and CARD_TYPE_ID=${type} and receipt_date is null")
public boolean updateReceiptDate(@Param("startDate") String startDate,@Param("endDate") String endDate,@Param("string") String string,@Param("type") long type);
@Select("select RECEIPT_LIST.POLICE_CODE,sum(RECEIPT_LIST.FINISH_COUNT),GAJG_DM.GAJG_MC from RECEIPT_LIST \n" +
......
......@@ -64,7 +64,7 @@ public interface ReceiptService {
public boolean updateDetail(String accept,String note);
public List<Map<String,Object>> selectReceiptList(List<String> stringList,String startDate,String endDate,long typeCode);
public Map<String, Object> selectReceiptList(List<String> stringList,String startDate,String endDate,long typeCode);
public Map<String,Object>selectDetailedData2(String id,String beginDate,String expireDate);
......
......@@ -4,9 +4,12 @@ import com.yxproject.start.entity.DetailReceiptListEntity;
import com.yxproject.start.entity.ReceiptListEntity;
import com.yxproject.start.mapper.ReceiptMapper;
import com.yxproject.start.service.ReceiptService;
import org.apache.xmlbeans.impl.jam.mutable.MPackage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.persistence.criteria.CriteriaBuilder;
import java.text.SimpleDateFormat;
import java.util.*;
@Service
......@@ -162,7 +165,7 @@ public class ReceiptServiceImpl implements ReceiptService {
}
@Override
public List<Map<String, Object>> selectReceiptList(List<String> stringList, String startDate,String endDate, long typeCode) {
public Map<String, Object> selectReceiptList(List<String> stringList, String startDate,String endDate, long typeCode) {
String str ="";
for (int i =0;i<stringList.size();i++){
if (i==stringList.size()-1){
......@@ -171,9 +174,27 @@ public class ReceiptServiceImpl implements ReceiptService {
str+="'"+stringList.get(i)+"',";
}
}
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
//更改交接单已打印状态
List<Map<String, Object>> mapList = receiptMapper.selectReceiptDate(startDate, endDate, str, typeCode);
Map<String,Object> map = new HashMap<>();
if ("null".equals(mapList.get(0).get("RECEIPT_DATE")+"")){
map.put("date",simpleDateFormat.format(new Date()));
}else {
map.put("date",mapList.get(0).get("RECEIPT_DATE"));
}
int total =0;
for (Map<String,Object> map2:mapList){
total+= Integer.valueOf(map2.get("FINISH_COUNT").toString());
}
map.put("list",mapList);
map.put("total",total);
boolean b = receiptMapper.updateReceiptDate(startDate,endDate, str, typeCode);
return receiptMapper.selectReceiptDate(startDate,endDate,str,typeCode);
// return receiptMapper.selectReceiptDate(startDate,endDate,str,typeCode);
return map;
}
@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