Commit 6f50c5b4 authored by suichenguang's avatar suichenguang

数据核验

parent a097571e
......@@ -7,6 +7,9 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;
......@@ -102,4 +105,18 @@ public class ReceiptApi {
return resultList;
}
@RequestMapping("updateReceiptList")
public boolean updateReceiptList(@Param("receiptId")int receiptId,@Param("checkName") String chechName){
SimpleDateFormat dt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式
try {
Date date=dt.parse(dt.format(new Date()));
receiptService.updateReceiptList(receiptId,chechName,date);
} catch (ParseException e) {
e.printStackTrace();
}
return true;
}
}
package com.yxproject.start.api;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @auther zhangyusheng
* 2019/3/1 21:39
*/
@RestController
@RequestMapping("receiptList")
public class ReceiptListApi {
}
......@@ -2,6 +2,7 @@ package com.yxproject.start.mapper;
import org.apache.ibatis.annotations.*;
import java.util.Date;
import java.util.List;
import java.util.Map;
......@@ -81,5 +82,14 @@ public interface ReceiptMapper {
public List<Map<String,Object>> selectDetailList(String receiptId);
//根据传入的交接单ID和复核人ID插入复核人、复核时间
@Update("update receipt_list set \n" +
"check_date = #{date},\n" +
"check_name=#{checkName} \n" +
"where id=#{receiptId}")
public boolean updateReceiptList(int receiptId, String checkName, Date date);
}
......@@ -2,6 +2,7 @@ package com.yxproject.start.service;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
import java.util.Map;
......@@ -28,4 +29,6 @@ public interface ReceiptService {
public Map<String,Object> selectReceiptList(String id);
public List<Map<String,Object>> selectDetailList(String receiptId);
public boolean updateReceiptList(int receiptId, String checkName, Date date);
}
......@@ -5,6 +5,7 @@ import com.yxproject.start.service.ReceiptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
import java.util.Map;
......@@ -79,5 +80,11 @@ public class ReceiptServiceImpl implements ReceiptService {
return resultList;
}
@Override
public boolean updateReceiptList(int receiptId, String checkName, Date date) {
receiptMapper.updateReceiptList(receiptId, checkName, date);
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