Commit cb0a3685 authored by suichenguang's avatar suichenguang

数据核验

parent 587e973c
package com.yxproject.start.api;
import com.yxproject.start.entity.NewFilesEntity;
import com.yxproject.start.service.InfoManagementService;
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.List;
@RestController
@RequestMapping("InfoManagementApi")
public class InfoManagementApi {
@Autowired
private InfoManagementService infoManagementService;
@RequestMapping("selectInfoManagement")
public List<NewFilesEntity>selectInfoManagement(@Param("beginFileName")String beginFileName, @Param("endFileName")String endFileName, @Param("gajgMc") String gajgMc, @Param("beginDate")String beginDate, @Param("endDate")String endDate){
List<NewFilesEntity> resultList = infoManagementService.selectInfoManagement(beginFileName, endFileName, gajgMc, beginDate, endDate);
return resultList;
}
}
......@@ -5,6 +5,7 @@ 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.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.text.ParseException;
......@@ -29,7 +30,7 @@ public class ReceiptApi {
*/
@RequestMapping("createReceiptList")
@Transactional(rollbackFor = Exception.class)
public boolean createReceiptList(@Param("id") String id) {
public boolean createReceiptList(@RequestParam("id") String id) {
//判断是否是特证
if (receiptService.selectSpecialCardByAcceptNo(id)==1){
......@@ -95,7 +96,7 @@ public class ReceiptApi {
* @return
*/
@RequestMapping("selectReceipt")
public Map<String,Object> selectReceipt(String id){
public Map<String,Object> selectReceipt(@RequestParam("id") String id){
Map<String,Object> resultMap=receiptService.selectReceiptListOfSpecialCard(id);
if (resultMap==null){
resultMap= receiptService.selectReceiptList(id);
......@@ -109,7 +110,7 @@ public class ReceiptApi {
* @return
*/
@RequestMapping("selectDetailList")
public List<Map<String,Object>> selectDetailList(String receiptId){
public List<Map<String,Object>> selectDetailList(@RequestParam("receiptId") String receiptId){
List<Map<String, Object>> resultList = receiptService.selectDetailList(receiptId);
return resultList;
}
......@@ -117,15 +118,15 @@ public class ReceiptApi {
/**
* 数据核验
* @param receiptId
* @param chechName
* @param checkName
* @return
*/
@RequestMapping("updateReceiptList")
public boolean updateReceiptList(@Param("receiptId")int receiptId,@Param("checkName") String chechName){
public boolean updateReceiptList(@RequestParam("receiptId")int receiptId,@RequestParam("checkName") String checkName){
SimpleDateFormat dt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式
try {
Date date=dt.parse(dt.format(new Date()));
receiptService.updateReceiptList(receiptId,chechName,date);
receiptService.updateReceiptList(receiptId,checkName,date);
} catch (ParseException e) {
e.printStackTrace();
}
......
package com.yxproject.start.mapper;
import com.yxproject.start.entity.NewFilesEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
import java.util.Map;
@Mapper
public interface InfoManagementMapper {
@Select("<script> " +
"select * from new_files \n" +
"where 1=1\n" +
"<if test='beginFileName != null '>" +
"and (NEW_FILE_NAME between(#{beginFileName})and (#{endFileName}))\n" +
"</if>" +
"<if test='gajgMc != null '>" +
"and DWMC=#{gajgMc}\n" +
"</if>" +
"<if test='beginDate != null '>" +
"and (CREATE_DATE between(#{beginDate})and(#{endDate}))"+
"</if>" +
"</script>")
public List<NewFilesEntity> selectInfoManagement(@Param("beginFileName")String beginFileName, @Param("endFileName")String endFileName, @Param("gajgMc") String gajgMc, @Param("beginDate")String beginDate, @Param("endDate")String endDate);
}
package com.yxproject.start.service;
import com.yxproject.start.entity.NewFilesEntity;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface InfoManagementService {
public List<NewFilesEntity> selectInfoManagement(@Param("beginFileName")String beginFileName, @Param("endFileName")String endFileName, @Param("gajgMc") String gajgMc, @Param("beginDate")String beginDate, @Param("endDate")String endDate);
}
package com.yxproject.start.service.impl;
import com.yxproject.start.entity.NewFilesEntity;
import com.yxproject.start.mapper.InfoManagementMapper;
import com.yxproject.start.service.InfoManagementService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class InfoManagementServiceImpl implements InfoManagementService {
@Autowired
private InfoManagementMapper infoManagementMapper;
@Override
public List<NewFilesEntity> selectInfoManagement(String beginFileName, String endFileName, String gajgMc, String beginDate, String endDate) {
List<NewFilesEntity> newFilesEntities = infoManagementMapper.selectInfoManagement(beginFileName, endFileName, gajgMc, beginDate, endDate);
return newFilesEntities;
}
}
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