字段非空判断
This commit is contained in:
parent
413ba05302
commit
79f6a099a6
|
|
@ -46,7 +46,7 @@ public class BmProjectController extends BaseController
|
|||
* 查询标段工程管理列表
|
||||
*/
|
||||
@ApiOperation(value = "查询标段工程管理列表")
|
||||
//@RequiresPermissions("basic:project:list")
|
||||
@RequiresPermissions("basic:project:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(BmProject bmProject)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ public class BmUnitController extends BaseController
|
|||
* 查询往来单位管理列表
|
||||
*/
|
||||
@ApiOperation(value = "查询往来单位管理列表")
|
||||
//@RequiresPermissions("basic:unit:list")
|
||||
@RequiresPermissions("basic:unit:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(BmUnit bmUnit)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2,9 +2,10 @@ package com.bonus.material.basic.domain;
|
|||
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
|
|
@ -24,12 +25,16 @@ public class BmAssetAttributes extends BaseEntity implements Serializable {
|
|||
* 资产类型名称
|
||||
*/
|
||||
@Excel(name = "资产类型名称")
|
||||
@ApiModelProperty(value = "资产类型名称")
|
||||
@NotBlank(message = "资产类型名称不能为空")
|
||||
private String assetName;
|
||||
|
||||
/**
|
||||
* 资产编码
|
||||
*/
|
||||
@Excel(name = "资产编码")
|
||||
@ApiModelProperty(value = "资产编码")
|
||||
@NotBlank(message = "资产编码不能为空")
|
||||
private String assetCode;
|
||||
/**
|
||||
* 删除标志(0代表存在 2代表删除)
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@ import lombok.Data;
|
|||
import lombok.ToString;
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
/**
|
||||
* 标段工程管理对象 bm_project
|
||||
*
|
||||
|
|
@ -28,6 +30,7 @@ public class BmProject extends BaseEntity
|
|||
/** 工程项目名称 */
|
||||
@Excel(name = "工程项目名称")
|
||||
@ApiModelProperty(value = "工程项目名称")
|
||||
@NotBlank(message = "工程名称不能为空")
|
||||
private String proName;
|
||||
|
||||
/** 关联外部(第三方)的工程ID */
|
||||
|
|
@ -44,10 +47,12 @@ public class BmProject extends BaseEntity
|
|||
|
||||
@ApiModelProperty(value = "实施单位")
|
||||
@Excel(name = "实施单位")
|
||||
@NotBlank(message = "实施单位不能为空")
|
||||
private String impUnit;
|
||||
|
||||
@ApiModelProperty(value = "工程类型")
|
||||
@Excel(name = "工程类型")
|
||||
@NotBlank(message = "工程类型不能为空")
|
||||
private String proType;
|
||||
|
||||
@ApiModelProperty(value = "工程编码")
|
||||
|
|
@ -85,6 +90,7 @@ public class BmProject extends BaseEntity
|
|||
|
||||
@ApiModelProperty(value = "工程状态")
|
||||
@Excel(name = "工程状态")
|
||||
@NotBlank(message = "工程状态不能为空")
|
||||
private String proStatus;
|
||||
|
||||
/** 计划开工日期 */
|
||||
|
|
@ -111,6 +117,7 @@ public class BmProject extends BaseEntity
|
|||
private String delFlag;
|
||||
|
||||
@ApiModelProperty(value = "工程性质")
|
||||
@NotBlank(message = "工程性质不能为空")
|
||||
private String proNature;
|
||||
|
||||
@ApiModelProperty(value = "所属项目中心")
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@ import lombok.Data;
|
|||
import lombok.ToString;
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
/**
|
||||
* 往来单位管理对象 bm_unit
|
||||
*
|
||||
|
|
@ -26,6 +28,7 @@ public class BmUnit extends BaseEntity
|
|||
/** 单位类型名称 */
|
||||
@Excel(name = "单位名称")
|
||||
@ApiModelProperty(value = "单位类型名称")
|
||||
@NotBlank(message = "单位名称不能为空")
|
||||
private String unitName;
|
||||
|
||||
/** 帐号状态(0正常 1停用) */
|
||||
|
|
@ -33,6 +36,7 @@ public class BmUnit extends BaseEntity
|
|||
|
||||
/** 单位类型 */
|
||||
@ApiModelProperty(value = "单位类型")
|
||||
@NotBlank(message = "单位类型不能为空")
|
||||
private Long typeId;
|
||||
|
||||
@Excel(name = "单位类型")
|
||||
|
|
@ -42,6 +46,7 @@ public class BmUnit extends BaseEntity
|
|||
/** 所属分公司 */
|
||||
@Excel(name = "所属分公司")
|
||||
@ApiModelProperty(value = "所属分公司")
|
||||
@NotBlank(message = "所属分公司不能为空")
|
||||
private Long deptId;
|
||||
|
||||
/** 联系人 */
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ import com.bonus.system.api.RemoteDeptService;
|
|||
import com.bonus.system.api.domain.SysDept;
|
||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.bonus.material.basic.mapper.BmProjectMapper;
|
||||
|
|
@ -24,7 +25,6 @@ import com.bonus.material.basic.service.IBmProjectService;
|
|||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import static com.bonus.common.biz.constant.MaterialConstants.*;
|
||||
|
||||
/**
|
||||
* 标段工程管理Service业务层处理
|
||||
|
|
@ -33,6 +33,7 @@ import static com.bonus.common.biz.constant.MaterialConstants.*;
|
|||
* @date 2024-09-26
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class BmProjectServiceImpl implements IBmProjectService
|
||||
{
|
||||
@Resource
|
||||
|
|
@ -56,6 +57,7 @@ public class BmProjectServiceImpl implements IBmProjectService
|
|||
}
|
||||
|
||||
private void extractedImpUnit(BmProject project) {
|
||||
try {
|
||||
AjaxResult ajaxResult = remoteDeptService.getInfo(Long.parseLong(project.getImpUnit()), SecurityConstants.INNER);
|
||||
//健壮性判断
|
||||
if (ajaxResult.isSuccess()) {
|
||||
|
|
@ -68,6 +70,9 @@ public class BmProjectServiceImpl implements IBmProjectService
|
|||
project.setImpUnit(sysDept.getDeptName() == null ? "" : sysDept.getDeptName());
|
||||
}
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
log.error("远程调用查询失败:", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ import com.bonus.system.api.RemoteDictDataService;
|
|||
import com.bonus.system.api.domain.SysDictData;
|
||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.bonus.material.basic.mapper.BmUnitMapper;
|
||||
|
|
@ -33,6 +34,7 @@ import javax.annotation.Resource;
|
|||
* @date 2024-09-26
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class BmUnitServiceImpl implements IBmUnitService
|
||||
{
|
||||
@Autowired
|
||||
|
|
@ -68,6 +70,7 @@ public class BmUnitServiceImpl implements IBmUnitService
|
|||
}
|
||||
|
||||
private void extracted(List<BmUnit> bmUnitList) {
|
||||
try {
|
||||
AjaxResult ajaxResult = remoteDictDataService.dictType("bm_unit_type", SecurityConstants.INNER);
|
||||
if (ajaxResult.isSuccess()) {
|
||||
// 假设 ajaxResult.get("data") 返回的是 List<LinkedHashMap>
|
||||
|
|
@ -94,6 +97,9 @@ public class BmUnitServiceImpl implements IBmUnitService
|
|||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("远程调用查询失败:", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ public class MachineController extends BaseController {
|
|||
* 获取机具设备管理详细信息
|
||||
*/
|
||||
@ApiOperation(value = "获取机具设备管理详细信息")
|
||||
//@RequiresPermissions("ma:machine:query")
|
||||
@RequiresPermissions("ma:machine:query")
|
||||
@GetMapping(value = "/{maId}")
|
||||
public AjaxResult getInfo(@PathVariable("maId") Long maId)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ import lombok.Data;
|
|||
import lombok.ToString;
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
/**
|
||||
* 配件类型管理对象 ma_part_type
|
||||
*
|
||||
|
|
@ -27,6 +29,7 @@ public class PartType extends BaseEntity
|
|||
/** 类型名称 */
|
||||
@Excel(name = "名称")
|
||||
@ApiModelProperty(value = "类型名称")
|
||||
@NotBlank(message = "名称不能为空")
|
||||
private String paName;
|
||||
|
||||
/** 上级ID */
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ import com.bonus.system.api.RemoteUserService;
|
|||
import com.bonus.system.api.domain.SysUser;
|
||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.bonus.material.ma.mapper.MachineMapper;
|
||||
import com.bonus.material.ma.domain.Machine;
|
||||
|
|
@ -28,6 +29,7 @@ import javax.annotation.Resource;
|
|||
* @date 2024-09-27
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class MachineServiceImpl implements IMachineService
|
||||
{
|
||||
@Resource
|
||||
|
|
@ -52,6 +54,7 @@ public class MachineServiceImpl implements IMachineService
|
|||
}
|
||||
|
||||
private void setUserName(Long userId, Consumer<String> setNameFunction) {
|
||||
try {
|
||||
AjaxResult ajaxResult = remoteUserService.getInfo(userId, SecurityConstants.INNER);
|
||||
if (ajaxResult.isSuccess()) {
|
||||
// ajaxResult.get("data") 返回的是 LinkedHashMap
|
||||
|
|
@ -63,6 +66,9 @@ public class MachineServiceImpl implements IMachineService
|
|||
setNameFunction.accept(sysUser.getNickName() == null ? "" : sysUser.getNickName());
|
||||
}
|
||||
}
|
||||
} catch (IllegalArgumentException e) {
|
||||
log.error("远程调用查询失败:", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue