| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | 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.core.common.Cools; |
| | | import com.zy.asrs.entity.WrkDetl; |
| | | import com.zy.asrs.entity.WrkDetlLog; |
| | | import com.zy.asrs.mapper.WrkDetlLogMapper; |
| | | import com.zy.asrs.service.WrkDetlLogService; |
| | | import com.zy.asrs.service.WrkDetlService; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @Service("wrkDetlLogService") |
| | | public class WrkDetlLogServiceImpl extends ServiceImpl<WrkDetlLogMapper, WrkDetlLog> implements WrkDetlLogService { |
| | | @Resource |
| | | private WrkDetlLogMapper wrkDetlLogMapper; |
| | | @Resource |
| | | private WrkDetlService wrkDetlService; |
| | | |
| | | @Override |
| | | @Transactional |
| | | public boolean save(Integer workNo) { |
| | | return this.baseMapper.save(workNo)>0; |
| | | List<WrkDetl> detls = wrkDetlService.selectByWrkNo(workNo); |
| | | if (Cools.isEmpty(detls)) { |
| | | return false; |
| | | } |
| | | Integer num = 0; |
| | | try { |
| | | for (WrkDetl d : detls) { |
| | | WrkDetlLog detlLog = new WrkDetlLog(d); |
| | | num += wrkDetlLogMapper.insert(detlLog); |
| | | } |
| | | return num > 0; |
| | | } catch (Exception e) { |
| | | System.out.println("转明细失败"); |
| | | e.printStackTrace(); |
| | | return false; |
| | | } |
| | | |
| | | // return wrkDetlLogMapper.save(workNo) > 0; |
| | | } |
| | | } |