|
|
|
@ -13,8 +13,10 @@ import org.springblade.core.mp.base.BaseServiceImpl; |
|
|
|
import org.springblade.core.secure.BladeUser; |
|
|
|
import org.springblade.core.secure.BladeUser; |
|
|
|
import org.springblade.core.secure.utils.AuthUtil; |
|
|
|
import org.springblade.core.secure.utils.AuthUtil; |
|
|
|
import org.springblade.desk.basic.pojo.entity.Oem; |
|
|
|
import org.springblade.desk.basic.pojo.entity.Oem; |
|
|
|
|
|
|
|
import org.springblade.desk.basic.pojo.entity.RelTeamSetUser; |
|
|
|
import org.springblade.desk.basic.pojo.entity.TeamSet; |
|
|
|
import org.springblade.desk.basic.pojo.entity.TeamSet; |
|
|
|
import org.springblade.desk.basic.service.IOemService; |
|
|
|
import org.springblade.desk.basic.service.IOemService; |
|
|
|
|
|
|
|
import org.springblade.desk.basic.service.IRelTeamSetUserService; |
|
|
|
import org.springblade.desk.basic.service.ITeamSetService; |
|
|
|
import org.springblade.desk.basic.service.ITeamSetService; |
|
|
|
import org.springblade.desk.dashboard.pojo.entity.BsTeamSetEntity; |
|
|
|
import org.springblade.desk.dashboard.pojo.entity.BsTeamSetEntity; |
|
|
|
import org.springblade.desk.dashboard.pojo.entity.DsPartEntity; |
|
|
|
import org.springblade.desk.dashboard.pojo.entity.DsPartEntity; |
|
|
|
@ -40,6 +42,7 @@ import java.time.LocalDateTime; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 镀前镀后 服务实现类 |
|
|
|
* 镀前镀后 服务实现类 |
|
|
|
@ -69,18 +72,24 @@ public class PlateAroundServiceImpl extends BaseServiceImpl<PlateAroundMapper, P |
|
|
|
|
|
|
|
|
|
|
|
private final IOemStatementService oemStatementService; |
|
|
|
private final IOemStatementService oemStatementService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final IRelTeamSetUserService relTeamSetUserService; |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public IPage<PlateAroundVO> queryByReadStatus(IPage<PlateAroundVO> page, PlateAroundDto plateAroundDto) { |
|
|
|
public IPage<PlateAroundVO> queryByReadStatus(IPage<PlateAroundVO> page, PlateAroundDto plateAroundDto) { |
|
|
|
return page.setRecords(baseMapper.queryByReadStatus(page, plateAroundDto)); |
|
|
|
return page.setRecords(baseMapper.queryByReadStatus(page, plateAroundDto)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public WorkPlan getBeforePlatInCardNo(String cardNo, List<Long> tsIds) { |
|
|
|
public WorkPlan getBeforePlatInCardNo(String cardNo) { |
|
|
|
WorkOrder wo = workOrderService.getWorkOrderByCardNo(cardNo); |
|
|
|
WorkOrder wo = workOrderService.getWorkOrderByCardNo(cardNo); |
|
|
|
if (wo == null) { |
|
|
|
if (wo == null) { |
|
|
|
throw new ServiceException("车间订单不存在!"); |
|
|
|
throw new ServiceException("车间订单不存在!"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
List<Long> tsIds = getTsIds(); |
|
|
|
WorkPlan beforePlatInCardNo = baseMapper.getBeforePlatInCardNo(wo.getId(), tsIds, AuthUtil.getUserId()); |
|
|
|
WorkPlan beforePlatInCardNo = baseMapper.getBeforePlatInCardNo(wo.getId(), tsIds, AuthUtil.getUserId()); |
|
|
|
|
|
|
|
if (beforePlatInCardNo == null) { |
|
|
|
|
|
|
|
throw new ServiceException("未查询到订单!"); |
|
|
|
|
|
|
|
} |
|
|
|
long count = this.count(Wrappers.lambdaQuery(PlateAround.class).eq(PlateAround::getWpId, beforePlatInCardNo.getId()).eq(PlateAround::getPaType, PlateAround.BEFORE_PLAT_IN)); |
|
|
|
long count = this.count(Wrappers.lambdaQuery(PlateAround.class).eq(PlateAround::getWpId, beforePlatInCardNo.getId()).eq(PlateAround::getPaType, PlateAround.BEFORE_PLAT_IN)); |
|
|
|
if (count > 0) { |
|
|
|
if (count > 0) { |
|
|
|
throw new ServiceException("此订单已存在镀前入库记录!"); |
|
|
|
throw new ServiceException("此订单已存在镀前入库记录!"); |
|
|
|
@ -89,12 +98,16 @@ public class PlateAroundServiceImpl extends BaseServiceImpl<PlateAroundMapper, P |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public PlateAround getBeforePlatOutCardNo(String cardNo, List<Long> tsIds) { |
|
|
|
public PlateAround getBeforePlatOutCardNo(String cardNo) { |
|
|
|
WorkOrder wo = workOrderService.getWorkOrderByCardNo(cardNo); |
|
|
|
WorkOrder wo = workOrderService.getWorkOrderByCardNo(cardNo); |
|
|
|
if (wo == null) { |
|
|
|
if (wo == null) { |
|
|
|
throw new ServiceException("车间订单不存在!"); |
|
|
|
throw new ServiceException("车间订单不存在!"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
List<Long> tsIds = getTsIds(); |
|
|
|
PlateAround plateAround = baseMapper.getBeforePlatOutCardNo(wo.getId(), tsIds, AuthUtil.getUserId()); |
|
|
|
PlateAround plateAround = baseMapper.getBeforePlatOutCardNo(wo.getId(), tsIds, AuthUtil.getUserId()); |
|
|
|
|
|
|
|
if (plateAround == null) { |
|
|
|
|
|
|
|
throw new ServiceException("未查询到订单!"); |
|
|
|
|
|
|
|
} |
|
|
|
long count = this.count(Wrappers.lambdaQuery(PlateAround.class).eq(PlateAround::getWpId, plateAround.getWpId()).eq(PlateAround::getPaType, PlateAround.BEFORE_PLAN_OUT)); |
|
|
|
long count = this.count(Wrappers.lambdaQuery(PlateAround.class).eq(PlateAround::getWpId, plateAround.getWpId()).eq(PlateAround::getPaType, PlateAround.BEFORE_PLAN_OUT)); |
|
|
|
if (count > 0) { |
|
|
|
if (count > 0) { |
|
|
|
throw new ServiceException("此订单已存在镀前出库记录!"); |
|
|
|
throw new ServiceException("此订单已存在镀前出库记录!"); |
|
|
|
@ -103,12 +116,12 @@ public class PlateAroundServiceImpl extends BaseServiceImpl<PlateAroundMapper, P |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public AfterPlateInVO getAfterPlatInCardNo(String cardNo, List<Long> tsIds) { |
|
|
|
public AfterPlateInVO getAfterPlatInCardNo(String cardNo) { |
|
|
|
WorkOrder wo = workOrderService.getWorkOrderByCardNo(cardNo); |
|
|
|
WorkOrder wo = workOrderService.getWorkOrderByCardNo(cardNo); |
|
|
|
if (wo == null) { |
|
|
|
if (wo == null) { |
|
|
|
throw new ServiceException("车间订单不存在!"); |
|
|
|
throw new ServiceException("车间订单不存在!"); |
|
|
|
} |
|
|
|
} |
|
|
|
WorkPlan wp = baseMapper.getAfterPlatInCardNo(wo.getId(), tsIds); |
|
|
|
WorkPlan wp = baseMapper.getAfterPlatInCardNo(wo.getId(), getTsIds()); |
|
|
|
if (wp == null) { |
|
|
|
if (wp == null) { |
|
|
|
throw new ServiceException("未找到镀后入库工序,无法入库!"); |
|
|
|
throw new ServiceException("未找到镀后入库工序,无法入库!"); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -146,6 +159,10 @@ public class PlateAroundServiceImpl extends BaseServiceImpl<PlateAroundMapper, P |
|
|
|
return afterPlateInVO; |
|
|
|
return afterPlateInVO; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private List<Long> getTsIds() { |
|
|
|
|
|
|
|
return relTeamSetUserService.list(Wrappers.lambdaQuery(RelTeamSetUser.class).eq(RelTeamSetUser::getUserId, AuthUtil.getUserId())).stream().map(RelTeamSetUser::getTeamSetId).collect(Collectors.toList()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public boolean savePlateAround(SavePlateAroundDto plateAroundDto) { |
|
|
|
public boolean savePlateAround(SavePlateAroundDto plateAroundDto) { |
|
|
|
List<PlateAround> plateArounds = plateAroundDto.getPlateArounds(); |
|
|
|
List<PlateAround> plateArounds = plateAroundDto.getPlateArounds(); |
|
|
|
|