|
|
@ -1,10 +1,14 @@ |
|
|
|
package com.win.module.wms.service.countPlan; |
|
|
|
|
|
|
|
import cn.hutool.core.exceptions.UtilException; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.win.framework.common.pojo.CustomConditions; |
|
|
|
import com.win.module.wms.controller.countPlan.vo.CountPlanMainCreateReqVO; |
|
|
|
import com.win.module.wms.controller.countPlan.vo.CountPlanMainExportReqVO; |
|
|
|
import com.win.module.wms.controller.countPlan.vo.CountPlanMainPageReqVO; |
|
|
|
import com.win.module.wms.controller.countPlan.vo.CountPlanMainUpdateReqVO; |
|
|
|
import com.win.module.wms.dal.dataobject.countPlan.CountPlanDetailDO; |
|
|
|
import com.win.module.wms.dal.mysql.countPlan.CountPlanDetailMapper; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import javax.annotation.Resource; |
|
|
|
import org.springframework.validation.annotation.Validated; |
|
|
@ -32,6 +36,9 @@ public class CountPlanMainServiceImpl implements CountPlanMainService { |
|
|
|
@Resource |
|
|
|
private CountPlanMainMapper countPlanMainMapper; |
|
|
|
|
|
|
|
@Resource |
|
|
|
private CountPlanDetailMapper countPlanDetailMapper; |
|
|
|
|
|
|
|
@Override |
|
|
|
public Long createCountPlanMain(CountPlanMainCreateReqVO createReqVO) { |
|
|
|
// 插入
|
|
|
@ -87,4 +94,28 @@ public class CountPlanMainServiceImpl implements CountPlanMainService { |
|
|
|
return countPlanMainMapper.selectList(exportReqVO); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public CountPlanDetailDO selectCountPlanExist(String pnumber){ |
|
|
|
QueryWrapper queryWrapperMain = new QueryWrapper(); |
|
|
|
queryWrapperMain.eq("number",pnumber); |
|
|
|
queryWrapperMain.eq("available","TRUE"); |
|
|
|
CountPlanMainDO countPlanMainDO = countPlanMainMapper.selectOne(queryWrapperMain); |
|
|
|
if(countPlanMainDO != null){ |
|
|
|
if(!"ClOSE".equals(countPlanMainDO.getStatus())){ |
|
|
|
QueryWrapper queryWrapperDetail = new QueryWrapper(); |
|
|
|
queryWrapperDetail.eq("number",pnumber); |
|
|
|
queryWrapperDetail.eq("available","TRUE"); |
|
|
|
CountPlanDetailDO countPlanDetailDO = countPlanDetailMapper.selectOne(queryWrapperDetail); |
|
|
|
if(countPlanDetailDO != null){ |
|
|
|
return countPlanDetailDO; |
|
|
|
}else { |
|
|
|
throw new UtilException("盘点计划" + pnumber + "无效"); |
|
|
|
} |
|
|
|
}else { |
|
|
|
throw new UtilException("盘点计划" + pnumber + "已关闭"); |
|
|
|
} |
|
|
|
}else { |
|
|
|
throw new UtilException("盘点计划" + pnumber + "无效"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|