package com.slcf.service.impl;
|
|
import java.util.HashMap;
|
import java.util.List;
|
import java.util.Map;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Service;
|
import org.springframework.transaction.annotation.Transactional;
|
|
import com.slcf.bean.WaitCheckCondition;
|
import com.slcf.dao.WaitCheckDao;
|
import com.slcf.pojo.WaitCheckBean;
|
import com.slcf.service.WaitCheckService;
|
|
/**
|
* 盘点通知档接口实现
|
* @author admin
|
* @date 2020年1月14日
|
*/
|
@Service
|
public class WaitCheckServiceImpl implements WaitCheckService {
|
|
@Autowired
|
WaitCheckDao waitCheckDao;
|
|
/**
|
* 添加
|
*/
|
public int insertWaitCheck(WaitCheckBean waitCheck) {
|
int result=0;
|
try {
|
result=waitCheckDao.insertWaitCheck(waitCheck);
|
}catch(Exception e) {
|
System.out.println(e.getMessage());
|
}
|
return result;
|
}
|
|
// /**
|
// * 统计数量
|
// */
|
// public int queryWaitCheckCount(){
|
// int result = 0;
|
// try {
|
// result = waitCheckDao.getWaitCheckCount();
|
// }catch(Exception e) {
|
// System.out.println(e.getMessage());
|
// }
|
// return result;
|
// }
|
|
/**
|
* 分页查询所有
|
*/
|
public Map<String,Object> queryWaitCheckList(WaitCheckCondition waitCheckCon) {
|
try {
|
Map<String,Object> map=new HashMap<String, Object>();
|
List<WaitCheckBean> list=waitCheckDao.queryWaitCheckList(waitCheckCon);
|
int count =waitCheckDao.getWaitCheckCount(waitCheckCon);
|
map.put("rows", list);
|
map.put("total", count);
|
return map;
|
}catch(Exception e) {
|
System.out.println(e.getMessage());
|
return null;
|
}
|
}
|
// public List<WaitCheckBean> queryWaitCheckList(int spage, int epage) {
|
// try {
|
// return waitCheckDao.queryWaitCheckList(spage, epage);
|
// }catch(Exception e) {
|
// System.out.println(e.getMessage());
|
// return null;
|
// }
|
// }
|
|
/**
|
* 根据id查找
|
*/
|
public WaitCheckBean queryWaitCheckById(WaitCheckBean waitCheck) {
|
try {
|
return waitCheckDao.getWaitCheckById(waitCheck);
|
}catch(Exception e) {
|
System.out.println(e.getMessage());
|
return null;
|
}
|
}
|
|
//更新
|
public int upWaitCheck(WaitCheckBean waitCheck) {
|
int result=0;
|
try {
|
result=waitCheckDao.upWaitCheck(waitCheck);
|
}catch(Exception e) {
|
System.out.println(e.getMessage());
|
}
|
return result;
|
}
|
|
/**
|
* 根据id删除
|
*/
|
public int delWaitCheck(WaitCheckBean waitCheckBean) {
|
int result=0;
|
try {
|
result=waitCheckDao.delWaitCheckById(waitCheckBean);
|
}catch(Exception e) {
|
System.out.println(e.getMessage());
|
}
|
return result;
|
}
|
|
/**
|
* 查询所有
|
* @return
|
*/
|
public List<WaitCheckBean> getWaitCheckList() {
|
try {
|
return waitCheckDao.getWaitCheckList();
|
}catch(Exception e) {
|
System.out.println(e.getMessage());
|
return null;
|
}
|
}
|
|
/**
|
* 转历史档
|
*/
|
// @Transactional(propagation=Propagation.REQUIRED)
|
@Transactional
|
public int moveToLog(WaitCheckBean waitCheckBean) {
|
int result=0;
|
try {
|
result=waitCheckDao.insertLog(waitCheckBean);
|
result=waitCheckDao.delWaitCheckById(waitCheckBean);
|
}catch(Exception e) {
|
System.out.println(e.getMessage());
|
}
|
return result;
|
}
|
|
public List<WaitCheckBean> getApiWaitCheckList(String barcode) {
|
try {
|
return waitCheckDao.getApiWaitCheckList(barcode);
|
}catch(Exception e) {
|
System.out.println(e.getMessage());
|
return null;
|
}
|
}
|
}
|