| | |
| | | import com.zy.asrs.mapper.WrkMastLogMapper; |
| | | import com.zy.asrs.service.WrkMastLogService; |
| | | import com.zy.asrs.service.WrkMastService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | |
| | | @Service("wrkMastLogService") |
| | | public class WrkMastLogServiceImpl extends ServiceImpl<WrkMastLogMapper, WrkMastLog> implements WrkMastLogService { |
| | | |
| | | @Autowired |
| | | private WrkMastService wrkMastService; |
| | | private final WrkMastService wrkMastService; |
| | | |
| | | public WrkMastLogServiceImpl(WrkMastService wrkMastService) { |
| | | this.wrkMastService = wrkMastService; |
| | | } |
| | | |
| | | @Override |
| | | public boolean save(Integer wrkNo) { |
| | | return saveRecord(wrkNo) != null; |
| | | } |
| | | |
| | | @Override |
| | | public WrkMastLog saveRecord(Integer wrkNo) { |
| | | WrkMast wrkMast = wrkMastService.selectByWorkNo(wrkNo); |
| | | if (wrkMast == null) { |
| | | return false; |
| | | return null; |
| | | } |
| | | |
| | | WrkMastLog wrkMastLog = new WrkMastLog(); |
| | | wrkMastLog.sync(wrkMast); |
| | | return this.baseMapper.insert(wrkMastLog) > 0; |
| | | return this.baseMapper.insert(wrkMastLog) > 0 ? wrkMastLog : null; |
| | | } |
| | | } |