排班计划添加校验
This commit is contained in:
parent
3065ba2101
commit
1d934eb2d7
@ -5,7 +5,9 @@ import java.util.concurrent.Callable;
|
|||||||
import java.util.concurrent.Future;
|
import java.util.concurrent.Future;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import com.ktg.common.constant.UserConstants;
|
import com.ktg.common.constant.UserConstants;
|
||||||
|
import com.ktg.mes.cal.domain.CalPlanTeam;
|
||||||
import com.ktg.mes.cal.service.ICalPlanTeamService;
|
import com.ktg.mes.cal.service.ICalPlanTeamService;
|
||||||
import com.ktg.mes.cal.service.ICalShiftService;
|
import com.ktg.mes.cal.service.ICalShiftService;
|
||||||
import com.ktg.mes.cal.service.ICalTeamshiftService;
|
import com.ktg.mes.cal.service.ICalTeamshiftService;
|
||||||
@ -113,6 +115,16 @@ public class CalPlanController extends BaseController
|
|||||||
{
|
{
|
||||||
if(UserConstants.ORDER_STATUS_CONFIRMED.equals(calPlan.getStatus())){
|
if(UserConstants.ORDER_STATUS_CONFIRMED.equals(calPlan.getStatus())){
|
||||||
|
|
||||||
|
//检查班组配置
|
||||||
|
List<CalPlanTeam> teams = calPlanTeamService.selectCalPlanTeamListByPlanId(calPlan.getPlanId());
|
||||||
|
if(CollectionUtil.isEmpty(teams)){
|
||||||
|
return AjaxResult.error("请配置班组!");
|
||||||
|
} else if(teams.size() != 2 && UserConstants.CAL_SHIFT_TYPE_TWO.equals(calPlan.getShiftType())){
|
||||||
|
return AjaxResult.error("两班倒请配置两个班组!");
|
||||||
|
} else if(teams.size() !=3 && UserConstants.CAL_SHIFT_TYPE_THREE.equals(calPlan.getShiftType())){
|
||||||
|
return AjaxResult.error("三倒请配置三个班组!");
|
||||||
|
}
|
||||||
|
|
||||||
calTeamshiftService.genRecords(calPlan.getPlanId());
|
calTeamshiftService.genRecords(calPlan.getPlanId());
|
||||||
}
|
}
|
||||||
return toAjax(calPlanService.updateCalPlan(calPlan));
|
return toAjax(calPlanService.updateCalPlan(calPlan));
|
||||||
|
@ -43,6 +43,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="shiftCount != null "> and shift_count = #{shiftCount}</if>
|
<if test="shiftCount != null "> and shift_count = #{shiftCount}</if>
|
||||||
<if test="status !=null and status !='' "> and status = #{status}</if>
|
<if test="status !=null and status !='' "> and status = #{status}</if>
|
||||||
</where>
|
</where>
|
||||||
|
order by create_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectCalPlanByPlanId" parameterType="Long" resultMap="CalPlanResult">
|
<select id="selectCalPlanByPlanId" parameterType="Long" resultMap="CalPlanResult">
|
||||||
|
Loading…
Reference in New Issue
Block a user