This commit is contained in:
zds
2022-11-20 21:44:22 +08:00
parent 1cc0f75c6f
commit 02bc9d15c3

View File

@@ -15,11 +15,8 @@ import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.nl.exception.BadRequestException;
import org.nl.modules.security.service.dto.JwtUserDto;
import org.nl.pda.exception.PdaRequestException;
import org.nl.utils.SecurityUtils;
import org.nl.wms.pdm.service.FactoryCalendarService;
import org.nl.wms.pdm.service.ProductprocessrouteService;
import org.nl.wms.pdm.service.dto.ProductprocessrouteDto;
import org.nl.wql.WQL;
import org.nl.wql.core.bean.WQLObject;
import org.nl.wql.util.WqlUtil;
@@ -47,7 +44,9 @@ public class FactoryCalendarServiceImpl implements FactoryCalendarService {
HashMap<String, String> map = new HashMap<>(whereJson);
map.put("flag", "1");
if (StrUtil.isNotEmpty(search)) map.put("search", "%" + search + "%");
if (StrUtil.isNotEmpty(search)) {
map.put("search", "%" + search + "%");
}
JSONObject json = WQL.getWO("QPDM_FACTORYCALENDAR").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "update_time desc");
return json;
@@ -173,7 +172,7 @@ public class FactoryCalendarServiceImpl implements FactoryCalendarService {
//查询是否存在已经启用的日历
JSONObject mst = WQLObject.getWQLObject("PDM_BI_FactoryCalendar").query("is_active = '1' AND is_delete = '0' and device_id='"+whereJson.getString("device_id")+"'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(mst)) {
throw new PdaRequestException("同一个设备工厂日历只能启用一个!");
throw new BadRequestException("同一个设备工厂日历只能启用一个!");
}
}
WQLObject.getWQLObject("PDM_BI_FactoryCalendar").update(whereJson);