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.WaitPakOutCondition;
|
import com.slcf.dao.WaitPakOutDao;
|
import com.slcf.dao.WorkFileDao;
|
import com.slcf.pojo.WaitPakOutBean;
|
import com.slcf.pojo.WorkDetailBean;
|
import com.slcf.pojo.WorkMastBean;
|
import com.slcf.service.WaitPakOutService;
|
|
/**
|
* 入库通知档接口实现
|
* @author admin
|
* @date 2018年11月17日
|
*/
|
@Service
|
public class WaitPakOutServiceImpl implements WaitPakOutService {
|
|
@Autowired
|
WaitPakOutDao WaitPakOutDao;
|
|
@Autowired
|
WorkFileDao workFileDao;
|
/**
|
* 添加
|
*/
|
public int insertWaitPakOut(WaitPakOutBean waitPakOut) {
|
int result=0;
|
try {
|
result=WaitPakOutDao.insertWaitPakOut(waitPakOut);
|
}catch(Exception e) {
|
System.out.println(e.getMessage());
|
}
|
return result;
|
}
|
|
// /**
|
// * 统计数量
|
// */
|
// public int queryWaitPakOutCount(){
|
// int result = 0;
|
// try {
|
// result = WaitPakOutDao.getWaitPakOutCount();
|
// }catch(Exception e) {
|
// System.out.println(e.getMessage());
|
// }
|
// return result;
|
// }
|
|
/**
|
* 分页查询所有
|
*/
|
public Map<String,Object> queryWaitPakOutList(WaitPakOutCondition waitPakOutCon) {
|
try {
|
Map<String,Object> map=new HashMap<String, Object>();
|
List<WaitPakOutBean> list=WaitPakOutDao.queryWaitPakOutList(waitPakOutCon);
|
int count =WaitPakOutDao.getWaitPakOutCount(waitPakOutCon);
|
map.put("rows", list);
|
map.put("total", count);
|
return map;
|
}catch(Exception e) {
|
System.out.println(e.getMessage());
|
return null;
|
}
|
}
|
// public List<WaitPakOutBean> queryWaitPakOutList(int spage, int epage) {
|
// try {
|
// return WaitPakOutDao.queryWaitPakOutList(spage, epage);
|
// }catch(Exception e) {
|
// System.out.println(e.getMessage());
|
// return null;
|
// }
|
// }
|
|
/**
|
* 根据id查找
|
*/
|
public WaitPakOutBean queryWaitPakOutById(String sheet_no,String mat_no) {
|
try {
|
return WaitPakOutDao.getWaitPakOutById(sheet_no,mat_no);
|
}catch(Exception e) {
|
System.out.println(e.getMessage());
|
return null;
|
}
|
}
|
|
/**
|
* 根据库位号查找
|
*/
|
public WaitPakOutBean queryWaitPakOutByLocNo(String loc_no) {
|
try {
|
return WaitPakOutDao.getWaitPakOutByLocNo(loc_no);
|
}catch(Exception e) {
|
System.out.println(e.getMessage());
|
return null;
|
}
|
}
|
|
/**
|
* 根据物料号号查找
|
*/
|
public WaitPakOutBean queryWaitPakOutByMatNo(String mat_no) {
|
try {
|
return WaitPakOutDao.getWaitPakOutByMatNo(mat_no);
|
}catch(Exception e) {
|
System.out.println(e.getMessage());
|
return null;
|
}
|
}
|
|
//更新
|
public int upWaitPakOut(WaitPakOutBean WaitPakOut, int type) {
|
int result=0;
|
try {
|
result=WaitPakOutDao.upWaitPakOut(WaitPakOut);
|
// if(type==2) {
|
// //如果工作档有数据,调整工作档优先级
|
// WorkDetailBean workDetail = workFileDao.getWorkDetlByMatNo(WaitPakOut.getMat_no());
|
// if(workDetail!=null) {
|
// WorkMastBean workMast = workFileDao.getWorkMastById(workDetail.getWrk_no());
|
// if(workMast!=null) {
|
// workMast.setIo_pri(WaitPakOut.getCtns());
|
// workFileDao.upWorkMast(workMast);
|
// }
|
// }
|
//
|
// }
|
}catch(Exception e) {
|
// System.out.println("TQSTQS---" + e.getMessage());
|
System.out.println(e.getMessage());
|
}
|
return result;
|
}
|
|
//更新
|
public int upWaitPakOutByLocNo(WaitPakOutBean WaitPakOut) {
|
int result=0;
|
try {
|
result=WaitPakOutDao.upWaitPakOutByLocNo(WaitPakOut);
|
}catch(Exception e) {
|
System.out.println(e.getMessage());
|
}
|
return result;
|
}
|
|
/**
|
* 根据id删除
|
*/
|
public int delWaitPakOut(WaitPakOutBean WaitPakOut) {
|
int result=0;
|
try {
|
result=WaitPakOutDao.delWaitPakOutById(WaitPakOut);
|
}catch(Exception e) {
|
System.out.println(e.getMessage());
|
}
|
return result;
|
}
|
|
/**
|
* 查询所有
|
* @return
|
*/
|
public List<WaitPakOutBean> getWaitPakOutList() {
|
try {
|
return WaitPakOutDao.getWaitPakOutList();
|
}catch(Exception e) {
|
System.out.println(e.getMessage());
|
return null;
|
}
|
}
|
|
/**
|
* 转历史档
|
*/
|
// @Transactional(propagation=Propagation.REQUIRED)
|
@Transactional
|
public int moveToLog(WaitPakOutBean WaitPakOut) {
|
int result=0;
|
try {
|
result=WaitPakOutDao.insertLog(WaitPakOut);
|
result=WaitPakOutDao.delWaitPakOutById(WaitPakOut);
|
}catch(Exception e) {
|
System.out.println(e.getMessage());
|
}
|
return result;
|
}
|
|
/**
|
* 查询所有单号
|
* @return
|
*/
|
public List<WaitPakOutBean> getSheetNoList() {
|
try {
|
return WaitPakOutDao.getSheetNoList();
|
}catch(Exception e) {
|
System.out.println(e.getMessage());
|
return null;
|
}
|
}
|
|
/**
|
* 根据编号、行号查
|
*/
|
public WaitPakOutBean queryWaitPakOutByNum(WaitPakOutBean waitPakOutBean) {
|
try {
|
return WaitPakOutDao.getWaitPakOutByNum(waitPakOutBean);
|
}catch(Exception e) {
|
System.out.println(e.getMessage());
|
return null;
|
}
|
}
|
|
/**
|
* 查询最早一笔待反馈SAP数据
|
*/
|
public WaitPakOutBean queryWaitPakOutFnh() {
|
try {
|
return WaitPakOutDao.getWaitPakOutFnh();
|
}catch(Exception e) {
|
System.out.println(e.getMessage());
|
return null;
|
}
|
}
|
|
/**
|
* 查询最早一笔待打印标签数据
|
*/
|
public WaitPakOutBean getWaitPakOutPrint() {
|
try {
|
return WaitPakOutDao.getWaitPakOutPrint();
|
}catch(Exception e) {
|
System.out.println(e.getMessage());
|
return null;
|
}
|
}
|
}
|