| | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.core.common.Cools; |
| | | import com.zy.asrs.entity.LocMast; |
| | | import com.zy.asrs.entity.WrkMast; |
| | | import com.zy.asrs.entity.result.FindLocNoAttributeVo; |
| | | import com.zy.asrs.mapper.WrkMastLogMapper; |
| | | import com.zy.asrs.mapper.WrkMastMapper; |
| | | import com.zy.asrs.service.InboundCameraCaptureService; |
| | | import com.zy.asrs.service.LocMastService; |
| | | import com.zy.asrs.service.WrkMastService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | |
| | | @Autowired |
| | | private WrkMastLogMapper wrkMastLogMapper; |
| | | |
| | | @Autowired |
| | | private LocMastService locMastService; |
| | | |
| | | @Override |
| | | public boolean insert(WrkMast entity) { |
| | | fillAreaId(entity); |
| | | return super.insert(entity); |
| | | } |
| | | |
| | | @Override |
| | | public boolean updateById(WrkMast entity) { |
| | | fillAreaId(entity); |
| | | return super.updateById(entity); |
| | | } |
| | | |
| | | @Override |
| | | public int getWorkingMast(Integer devpNo) { |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void fillAreaId(WrkMast wrkMast) { |
| | | if (wrkMast == null) { |
| | | return; |
| | | } |
| | | LocMast locMast = resolveAreaLocMast(wrkMast); |
| | | if (locMast != null) { |
| | | wrkMast.setAreaId(locMast.getAreaId()); |
| | | } |
| | | } |
| | | |
| | | private LocMast resolveAreaLocMast(WrkMast wrkMast) { |
| | | boolean outbound = wrkMast.getIoType() != null && wrkMast.getIoType() >= 100; |
| | | LocMast primary = outbound |
| | | ? selectLocMast(wrkMast.getSourceLocNo()) |
| | | : selectLocMast(wrkMast.getLocNo()); |
| | | if (primary != null) { |
| | | return primary; |
| | | } |
| | | return outbound |
| | | ? selectLocMast(wrkMast.getLocNo()) |
| | | : selectLocMast(wrkMast.getSourceLocNo()); |
| | | } |
| | | |
| | | private LocMast selectLocMast(String locNo) { |
| | | if (Cools.isEmpty(locNo)) { |
| | | return null; |
| | | } |
| | | return locMastService.selectById(locNo); |
| | | } |
| | | } |