| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.WrkDetl; |
| | | import com.zy.asrs.entity.WrkMast; |
| | | import com.zy.asrs.entity.WrkMastLog; |
| | | import com.zy.asrs.mapper.WrkDetlLogMapper; |
| | | import com.zy.asrs.entity.WrkDetlLog; |
| | | import com.zy.asrs.service.WrkDetlLogService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.zy.asrs.service.WrkDetlService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | @Slf4j |
| | | @Service("wrkDetlLogService") |
| | | public class WrkDetlLogServiceImpl extends ServiceImpl<WrkDetlLogMapper, WrkDetlLog> implements WrkDetlLogService { |
| | | |
| | | @Autowired |
| | | private WrkDetlService wrkDetlService; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean save(Integer workNo) { |
| | | List<WrkDetl> detlLogs = wrkDetlService.selectList(new EntityWrapper<WrkDetl>().eq("wrk_no", workNo)); |
| | | if (Objects.isNull(detlLogs) || detlLogs.isEmpty()) { |
| | | log.error("数据错误:任务不存在!!"); |
| | | // throw new CoolException("数据错误:任务不存在!!"); |
| | | } else { |
| | | detlLogs.forEach(WrkDetl -> { |
| | | WrkDetlLog detlLog = new WrkDetlLog(); |
| | | BeanUtils.copyProperties(WrkDetl, detlLog); |
| | | if (!this.insert(detlLog)) { |
| | | throw new CoolException("任务日志保存失败!!"); |
| | | } |
| | | }); |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | public List<WrkDetlLog> selectWrkDetlLogs(Integer wrkNo, String orderNo,String matnr,String specs,String zpallet,String batch,Double anfme, Date modiTimeStart, Date modiTimeEnd, Integer curr, Integer limit) { |
| | | return this.baseMapper.selectWrkDetlLogs(wrkNo, orderNo,matnr,specs,zpallet,batch,anfme, modiTimeStart, modiTimeEnd, curr, limit); |
| | | } |
| | | |
| | | @Override |
| | | public Long selectWrkDetlLogsTotal(Integer wrkNo, String orderNo,String matnr,String specs,String zpallet,String batch,Double anfme, Date modiTimeStart, Date modiTimeEnd) { |
| | | return this.baseMapper.selectWrkDetlLogsTotal(wrkNo, orderNo,matnr,specs,zpallet,batch,anfme, modiTimeStart, modiTimeEnd); |
| | | } |
| | | } |