Commit d7078f0f authored by 王果's avatar 王果

维保备案未选择设备,不可暂存

parent cefcb636
......@@ -42,6 +42,7 @@ import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.*;
......@@ -302,6 +303,9 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC
public List<JgMaintenanceContract> saveOrSubmit(String submit, Map<String, Object> map, ReginParams reginParams) {
JgMaintenanceContractDto contractDto = JSON.parseObject(JSON.toJSONString(map), JgMaintenanceContractDto.class);
List<Map<String, Object>> equipmentLists = (List<Map<String, Object>>) map.get("equipmentLists");
if (CollectionUtils.isEmpty(equipmentLists)) {
throw new BadRequest("请选择设备");
}
CompanyBo company = reginParams.getCompany();
contractDto.setCreateDate(new Date());
contractDto.setPromoter(reginParams.getUserModel().getUserId());
......@@ -309,7 +313,7 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC
ResponseModel<List<String>> listResponseModel = tzsServiceFeignClient.applicationFormCode(ApplicationFormTypeEnum.WBBA.getCode(), 1);
if (!ObjectUtils.isEmpty(listResponseModel) && listResponseModel.getStatus() != HttpStatus.OK.value()) {
log.error("告知单获取失败");
return null;
throw new BadRequest("告知单获取失败");
}
String wbApplyNo = listResponseModel.getResult().get(0);
contractDto.setApplyNo(wbApplyNo);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment