Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
014996b1fe
|
|
@ -10,6 +10,7 @@ import com.bonus.common.security.annotation.RequiresPermissions;
|
||||||
import com.bonus.material.basic.domain.BmAssetAttributes;
|
import com.bonus.material.basic.domain.BmAssetAttributes;
|
||||||
import com.bonus.material.basic.service.BmAssetAttributesService;
|
import com.bonus.material.basic.service.BmAssetAttributesService;
|
||||||
import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
|
@ -23,6 +24,7 @@ import java.util.List;
|
||||||
* @author makejava
|
* @author makejava
|
||||||
* @since 2024-10-15 10:38:58
|
* @since 2024-10-15 10:38:58
|
||||||
*/
|
*/
|
||||||
|
@Api(tags = "资产属性管理接口")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/bm_asset_attributes")
|
@RequestMapping("/bm_asset_attributes")
|
||||||
public class BmAssetAttributesController extends BaseController {
|
public class BmAssetAttributesController extends BaseController {
|
||||||
|
|
@ -38,12 +40,17 @@ public class BmAssetAttributesController extends BaseController {
|
||||||
* @param bmAssetAttributes 筛选条件
|
* @param bmAssetAttributes 筛选条件
|
||||||
* @return 查询结果
|
* @return 查询结果
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation(value = "查询资产属性管理列表")
|
||||||
@RequiresPermissions("basic:asset:list")
|
@RequiresPermissions("basic:asset:list")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo queryByPage(BmAssetAttributes bmAssetAttributes) {
|
public AjaxResult queryByPage(BmAssetAttributes bmAssetAttributes) {
|
||||||
|
//判断是否分页,用于下拉选
|
||||||
|
if (bmAssetAttributes.getIsAll() != null) {
|
||||||
|
return AjaxResult.success(bmAssetAttributesService.queryByPage(bmAssetAttributes));
|
||||||
|
}
|
||||||
startPage();
|
startPage();
|
||||||
List<BmAssetAttributes> list = bmAssetAttributesService.queryByPage(bmAssetAttributes);
|
List<BmAssetAttributes> list = bmAssetAttributesService.queryByPage(bmAssetAttributes);
|
||||||
return getDataTable(list);
|
return AjaxResult.success(getDataTable(list));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -52,6 +59,7 @@ public class BmAssetAttributesController extends BaseController {
|
||||||
* @param id 主键
|
* @param id 主键
|
||||||
* @return 单条数据
|
* @return 单条数据
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation(value = "查询资产属性管理详细信息")
|
||||||
@RequiresPermissions("basic:asset:query")
|
@RequiresPermissions("basic:asset:query")
|
||||||
@GetMapping("/{id}")
|
@GetMapping("/{id}")
|
||||||
public AjaxResult queryById(@PathVariable("id") Long id) {
|
public AjaxResult queryById(@PathVariable("id") Long id) {
|
||||||
|
|
@ -64,6 +72,7 @@ public class BmAssetAttributesController extends BaseController {
|
||||||
* @param bmAssetAttributes 实体
|
* @param bmAssetAttributes 实体
|
||||||
* @return 新增结果
|
* @return 新增结果
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation(value = "新增资产属性")
|
||||||
@PreventRepeatSubmit
|
@PreventRepeatSubmit
|
||||||
@RequiresPermissions("basic:asset:add")
|
@RequiresPermissions("basic:asset:add")
|
||||||
@SysLog(title = "资产属性管理", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增资产属性管理")
|
@SysLog(title = "资产属性管理", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增资产属性管理")
|
||||||
|
|
@ -78,6 +87,7 @@ public class BmAssetAttributesController extends BaseController {
|
||||||
* @param bmAssetAttributes 实体
|
* @param bmAssetAttributes 实体
|
||||||
* @return 编辑结果
|
* @return 编辑结果
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation(value = "修改资产属性")
|
||||||
@PreventRepeatSubmit
|
@PreventRepeatSubmit
|
||||||
@RequiresPermissions("basic:asset:edit")
|
@RequiresPermissions("basic:asset:edit")
|
||||||
@SysLog(title = "资产属性管理", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->修改资产属性管理")
|
@SysLog(title = "资产属性管理", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->修改资产属性管理")
|
||||||
|
|
@ -92,6 +102,7 @@ public class BmAssetAttributesController extends BaseController {
|
||||||
* @param id 主键
|
* @param id 主键
|
||||||
* @return 删除是否成功
|
* @return 删除是否成功
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation(value = "删除资产属性")
|
||||||
@PreventRepeatSubmit
|
@PreventRepeatSubmit
|
||||||
@RequiresPermissions("basic:asset:remove")
|
@RequiresPermissions("basic:asset:remove")
|
||||||
@SysLog(title = "资产属性管理", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除资产属性管理")
|
@SysLog(title = "资产属性管理", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除资产属性管理")
|
||||||
|
|
|
||||||
|
|
@ -41,9 +41,6 @@ public class BmUnitController extends BaseController
|
||||||
@Autowired
|
@Autowired
|
||||||
private IBmUnitService bmUnitService;
|
private IBmUnitService bmUnitService;
|
||||||
|
|
||||||
@Resource
|
|
||||||
private RemoteDictDataService remoteDictDataService;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询往来单位管理列表
|
* 查询往来单位管理列表
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,11 @@ package com.bonus.material.basic.domain;
|
||||||
|
|
||||||
import com.bonus.common.core.annotation.Excel;
|
import com.bonus.common.core.annotation.Excel;
|
||||||
import com.bonus.common.core.web.domain.BaseEntity;
|
import com.bonus.common.core.web.domain.BaseEntity;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.util.Date;
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.Size;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -24,17 +26,28 @@ public class BmAssetAttributes extends BaseEntity implements Serializable {
|
||||||
* 资产类型名称
|
* 资产类型名称
|
||||||
*/
|
*/
|
||||||
@Excel(name = "资产类型名称")
|
@Excel(name = "资产类型名称")
|
||||||
|
@ApiModelProperty(value = "资产类型名称")
|
||||||
|
@NotBlank(message = "资产类型名称不能为空")
|
||||||
|
@Size(max=50, message = "资产类型名称长度不能超过50")
|
||||||
private String assetName;
|
private String assetName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 资产编码
|
* 资产编码
|
||||||
*/
|
*/
|
||||||
@Excel(name = "资产编码")
|
@Excel(name = "资产编码")
|
||||||
|
@ApiModelProperty(value = "资产编码")
|
||||||
|
@NotBlank(message = "资产编码不能为空")
|
||||||
|
@Size(max=50, message = "资产编码名称长度不能超过50")
|
||||||
private String assetCode;
|
private String assetCode;
|
||||||
/**
|
/**
|
||||||
* 删除标志(0代表存在 2代表删除)
|
* 删除标志(0代表存在 2代表删除)
|
||||||
*/
|
*/
|
||||||
private String delFlag;
|
private String delFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否分页
|
||||||
|
*/
|
||||||
|
private Integer isAll;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,9 @@ import lombok.Data;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import com.bonus.common.core.web.domain.BaseEntity;
|
import com.bonus.common.core.web.domain.BaseEntity;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.Size;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 标段工程管理对象 bm_project
|
* 标段工程管理对象 bm_project
|
||||||
*
|
*
|
||||||
|
|
@ -28,6 +31,8 @@ public class BmProject extends BaseEntity
|
||||||
/** 工程项目名称 */
|
/** 工程项目名称 */
|
||||||
@Excel(name = "工程项目名称")
|
@Excel(name = "工程项目名称")
|
||||||
@ApiModelProperty(value = "工程项目名称")
|
@ApiModelProperty(value = "工程项目名称")
|
||||||
|
@NotBlank(message = "工程名称不能为空")
|
||||||
|
@Size(max=255, message = "工程名称长度不能超过255")
|
||||||
private String proName;
|
private String proName;
|
||||||
|
|
||||||
/** 关联外部(第三方)的工程ID */
|
/** 关联外部(第三方)的工程ID */
|
||||||
|
|
@ -44,14 +49,17 @@ public class BmProject extends BaseEntity
|
||||||
|
|
||||||
@ApiModelProperty(value = "实施单位")
|
@ApiModelProperty(value = "实施单位")
|
||||||
@Excel(name = "实施单位")
|
@Excel(name = "实施单位")
|
||||||
|
@NotBlank(message = "实施单位不能为空")
|
||||||
private String impUnit;
|
private String impUnit;
|
||||||
|
|
||||||
@ApiModelProperty(value = "工程类型")
|
@ApiModelProperty(value = "工程类型")
|
||||||
@Excel(name = "工程类型")
|
@Excel(name = "工程类型")
|
||||||
|
@NotBlank(message = "工程类型不能为空")
|
||||||
private String proType;
|
private String proType;
|
||||||
|
|
||||||
@ApiModelProperty(value = "工程编码")
|
@ApiModelProperty(value = "工程编码")
|
||||||
@Excel(name = "i8工程编码")
|
@Excel(name = "i8工程编码")
|
||||||
|
@Size(max=60, message = "工程编号长度不能超过60")
|
||||||
private String proCode;
|
private String proCode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -63,6 +71,7 @@ public class BmProject extends BaseEntity
|
||||||
|
|
||||||
@ApiModelProperty(value = "合同主体")
|
@ApiModelProperty(value = "合同主体")
|
||||||
@Excel(name = "合同主体")
|
@Excel(name = "合同主体")
|
||||||
|
@Size(max=60, message = "合同主体长度不能超过60")
|
||||||
private String contractPart;
|
private String contractPart;
|
||||||
|
|
||||||
/** 经度 */
|
/** 经度 */
|
||||||
|
|
@ -76,15 +85,18 @@ public class BmProject extends BaseEntity
|
||||||
/** 项目经理 */
|
/** 项目经理 */
|
||||||
@Excel(name = "项目经理")
|
@Excel(name = "项目经理")
|
||||||
@ApiModelProperty(value = "项目经理")
|
@ApiModelProperty(value = "项目经理")
|
||||||
|
@Size(max=64, message = "项目经理长度不能超过64")
|
||||||
private String proManager;
|
private String proManager;
|
||||||
|
|
||||||
/** 联系方式 */
|
/** 联系电话 */
|
||||||
@Excel(name = "联系方式")
|
@Excel(name = "联系电话")
|
||||||
@ApiModelProperty(value = "联系方式")
|
@ApiModelProperty(value = "联系电话")
|
||||||
|
@Size(max=64, message = "联系电话长度不能超过64")
|
||||||
private String telphone;
|
private String telphone;
|
||||||
|
|
||||||
@ApiModelProperty(value = "工程状态")
|
@ApiModelProperty(value = "工程状态")
|
||||||
@Excel(name = "工程状态")
|
@Excel(name = "工程状态")
|
||||||
|
@NotBlank(message = "工程状态不能为空")
|
||||||
private String proStatus;
|
private String proStatus;
|
||||||
|
|
||||||
/** 计划开工日期 */
|
/** 计划开工日期 */
|
||||||
|
|
@ -111,8 +123,10 @@ public class BmProject extends BaseEntity
|
||||||
private String delFlag;
|
private String delFlag;
|
||||||
|
|
||||||
@ApiModelProperty(value = "工程性质")
|
@ApiModelProperty(value = "工程性质")
|
||||||
|
@NotBlank(message = "工程性质不能为空")
|
||||||
private String proNature;
|
private String proNature;
|
||||||
|
|
||||||
@ApiModelProperty(value = "所属项目中心")
|
@ApiModelProperty(value = "所属项目中心")
|
||||||
|
@Size(max=60, message = "所属项目中心长度不能超过60")
|
||||||
private String proCenter;
|
private String proCenter;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,9 @@ import lombok.Data;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import com.bonus.common.core.web.domain.BaseEntity;
|
import com.bonus.common.core.web.domain.BaseEntity;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.Size;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 往来单位管理对象 bm_unit
|
* 往来单位管理对象 bm_unit
|
||||||
*
|
*
|
||||||
|
|
@ -26,6 +29,8 @@ public class BmUnit extends BaseEntity
|
||||||
/** 单位类型名称 */
|
/** 单位类型名称 */
|
||||||
@Excel(name = "单位名称")
|
@Excel(name = "单位名称")
|
||||||
@ApiModelProperty(value = "单位类型名称")
|
@ApiModelProperty(value = "单位类型名称")
|
||||||
|
@NotBlank(message = "单位名称不能为空")
|
||||||
|
@Size(max=30, message = "单位名称长度不能超过30")
|
||||||
private String unitName;
|
private String unitName;
|
||||||
|
|
||||||
/** 帐号状态(0正常 1停用) */
|
/** 帐号状态(0正常 1停用) */
|
||||||
|
|
@ -33,6 +38,7 @@ public class BmUnit extends BaseEntity
|
||||||
|
|
||||||
/** 单位类型 */
|
/** 单位类型 */
|
||||||
@ApiModelProperty(value = "单位类型")
|
@ApiModelProperty(value = "单位类型")
|
||||||
|
@NotBlank(message = "单位类型不能为空")
|
||||||
private Long typeId;
|
private Long typeId;
|
||||||
|
|
||||||
@Excel(name = "单位类型")
|
@Excel(name = "单位类型")
|
||||||
|
|
@ -42,16 +48,19 @@ public class BmUnit extends BaseEntity
|
||||||
/** 所属分公司 */
|
/** 所属分公司 */
|
||||||
@Excel(name = "所属分公司")
|
@Excel(name = "所属分公司")
|
||||||
@ApiModelProperty(value = "所属分公司")
|
@ApiModelProperty(value = "所属分公司")
|
||||||
|
@NotBlank(message = "所属分公司不能为空")
|
||||||
private Long deptId;
|
private Long deptId;
|
||||||
|
|
||||||
/** 联系人 */
|
/** 联系人 */
|
||||||
@Excel(name = "联系人")
|
@Excel(name = "联系人")
|
||||||
@ApiModelProperty(value = "联系人")
|
@ApiModelProperty(value = "联系人")
|
||||||
|
@Size(max=64, message = "联系人长度不能超过64")
|
||||||
private String linkMan;
|
private String linkMan;
|
||||||
|
|
||||||
/** 联系方式 */
|
/** 联系方式 */
|
||||||
@Excel(name = "联系方式")
|
@Excel(name = "联系方式")
|
||||||
@ApiModelProperty(value = "联系方式")
|
@ApiModelProperty(value = "联系方式")
|
||||||
|
@Size(max=64, message = "联系方式长度不能超过64")
|
||||||
private String telphone;
|
private String telphone;
|
||||||
|
|
||||||
/** 删除标志(0代表存在 2代表删除) */
|
/** 删除标志(0代表存在 2代表删除) */
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ import com.bonus.system.api.RemoteDeptService;
|
||||||
import com.bonus.system.api.domain.SysDept;
|
import com.bonus.system.api.domain.SysDept;
|
||||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.bonus.material.basic.mapper.BmProjectMapper;
|
import com.bonus.material.basic.mapper.BmProjectMapper;
|
||||||
|
|
@ -24,7 +25,6 @@ import com.bonus.material.basic.service.IBmProjectService;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
import static com.bonus.common.biz.constant.MaterialConstants.*;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 标段工程管理Service业务层处理
|
* 标段工程管理Service业务层处理
|
||||||
|
|
@ -33,6 +33,7 @@ import static com.bonus.common.biz.constant.MaterialConstants.*;
|
||||||
* @date 2024-09-26
|
* @date 2024-09-26
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
|
@Slf4j
|
||||||
public class BmProjectServiceImpl implements IBmProjectService
|
public class BmProjectServiceImpl implements IBmProjectService
|
||||||
{
|
{
|
||||||
@Resource
|
@Resource
|
||||||
|
|
@ -52,19 +53,25 @@ public class BmProjectServiceImpl implements IBmProjectService
|
||||||
{
|
{
|
||||||
BmProject project = bmProjectMapper.selectBmProjectByProId(proId);
|
BmProject project = bmProjectMapper.selectBmProjectByProId(proId);
|
||||||
extractedImpUnit(project);
|
extractedImpUnit(project);
|
||||||
extracted(project);
|
|
||||||
return project;
|
return project;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void extractedImpUnit(BmProject project) {
|
private void extractedImpUnit(BmProject project) {
|
||||||
AjaxResult ajaxResult = remoteDeptService.getInfo(Long.parseLong(project.getImpUnit()), SecurityConstants.INNER);
|
try {
|
||||||
// ajaxResult.get("data") 返回的是 LinkedHashMap
|
AjaxResult ajaxResult = remoteDeptService.getInfo(Long.parseLong(project.getImpUnit()), SecurityConstants.INNER);
|
||||||
LinkedHashMap rawDataList = (LinkedHashMap) ajaxResult.get("data");
|
//健壮性判断
|
||||||
ObjectMapper objectMapper = new ObjectMapper();
|
if (ajaxResult.isSuccess()) {
|
||||||
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
// ajaxResult.get("data") 返回的是 LinkedHashMap
|
||||||
if (rawDataList != null) {
|
LinkedHashMap rawDataList = (LinkedHashMap) ajaxResult.get("data");
|
||||||
SysDept sysDept = objectMapper.convertValue(rawDataList, SysDept.class);
|
ObjectMapper objectMapper = new ObjectMapper();
|
||||||
project.setImpUnit(sysDept.getDeptName() == null ? "" : sysDept.getDeptName());
|
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
||||||
|
if (rawDataList != null) {
|
||||||
|
SysDept sysDept = objectMapper.convertValue(rawDataList, SysDept.class);
|
||||||
|
project.setImpUnit(sysDept.getDeptName() == null ? "" : sysDept.getDeptName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
log.error("远程调用查询失败:", e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -81,61 +88,11 @@ public class BmProjectServiceImpl implements IBmProjectService
|
||||||
if (CollectionUtils.isNotEmpty(list)) {
|
if (CollectionUtils.isNotEmpty(list)) {
|
||||||
list.forEach(item -> {
|
list.forEach(item -> {
|
||||||
extractedImpUnit(item);
|
extractedImpUnit(item);
|
||||||
extracted(item);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 方法抽取
|
|
||||||
* @param item
|
|
||||||
*/
|
|
||||||
private void extracted(BmProject item) {
|
|
||||||
if (item.getProTypeId() != null) {
|
|
||||||
if (ZERO_CONSTANT.equals(item.getProTypeId())) {
|
|
||||||
item.setProType("线路工程");
|
|
||||||
} else if (ONE_CONSTANT.equals(item.getProTypeId())) {
|
|
||||||
item.setProType("变电工程");
|
|
||||||
} else if (TWO_CONSTANT.equals(item.getProTypeId())) {
|
|
||||||
item.setProType("业务工程");
|
|
||||||
} else if (THREE_CONSTANT.equals(item.getProTypeId())) {
|
|
||||||
item.setProType("其他工程");
|
|
||||||
} else {
|
|
||||||
item.setProType("未知工程类型");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (item.getProNature() != null) {
|
|
||||||
if (ZERO_CONSTANT.equals(item.getProNature())) {
|
|
||||||
item.setProNature("基建");
|
|
||||||
} else if (ONE_CONSTANT.equals(item.getProNature())) {
|
|
||||||
item.setProNature("用户工程");
|
|
||||||
} else if (TWO_CONSTANT.equals(item.getProNature())){
|
|
||||||
item.setProNature("技修大改");
|
|
||||||
} else if (THREE_CONSTANT.equals(item.getProNature())) {
|
|
||||||
item.setProNature("其他");
|
|
||||||
} else {
|
|
||||||
item.setProNature("未知工程性质");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (item.getProStatus() != null) {
|
|
||||||
if (ZERO_CONSTANT.equals(item.getProStatus())) {
|
|
||||||
item.setProStatus("开工准备");
|
|
||||||
} else if (ONE_CONSTANT.equals(item.getProStatus())) {
|
|
||||||
item.setProStatus("在建");
|
|
||||||
} else if (TWO_CONSTANT.equals(item.getProStatus())){
|
|
||||||
item.setProStatus("停工");
|
|
||||||
} else if (THREE_CONSTANT.equals(item.getProStatus())){
|
|
||||||
item.setProStatus("完工未竣工");
|
|
||||||
} else if (FOUR_CONSTANT.equals(item.getProStatus())) {
|
|
||||||
item.setProStatus("竣工");
|
|
||||||
} else {
|
|
||||||
item.setProStatus("未知工程状态");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
item.setIsMatchI8(StringUtils.isNotEmpty(item.getExternalId()) ? "匹配" : "不匹配");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增标段工程管理
|
* 新增标段工程管理
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ import com.bonus.system.api.RemoteDictDataService;
|
||||||
import com.bonus.system.api.domain.SysDictData;
|
import com.bonus.system.api.domain.SysDictData;
|
||||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.bonus.material.basic.mapper.BmUnitMapper;
|
import com.bonus.material.basic.mapper.BmUnitMapper;
|
||||||
|
|
@ -33,6 +34,7 @@ import javax.annotation.Resource;
|
||||||
* @date 2024-09-26
|
* @date 2024-09-26
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
|
@Slf4j
|
||||||
public class BmUnitServiceImpl implements IBmUnitService
|
public class BmUnitServiceImpl implements IBmUnitService
|
||||||
{
|
{
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|
@ -68,29 +70,35 @@ public class BmUnitServiceImpl implements IBmUnitService
|
||||||
}
|
}
|
||||||
|
|
||||||
private void extracted(List<BmUnit> bmUnitList) {
|
private void extracted(List<BmUnit> bmUnitList) {
|
||||||
AjaxResult ajaxResult = remoteDictDataService.dictType("bm_unit_type", SecurityConstants.INNER);
|
try {
|
||||||
// 假设 ajaxResult.get("data") 返回的是 List<LinkedHashMap>
|
AjaxResult ajaxResult = remoteDictDataService.dictType("bm_unit_type", SecurityConstants.INNER);
|
||||||
List<LinkedHashMap> rawData = (List<LinkedHashMap>) ajaxResult.get("data");
|
if (ajaxResult.isSuccess()) {
|
||||||
ObjectMapper objectMapper = new ObjectMapper();
|
// 假设 ajaxResult.get("data") 返回的是 List<LinkedHashMap>
|
||||||
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
List<LinkedHashMap> rawData = (List<LinkedHashMap>) ajaxResult.get("data");
|
||||||
// 将 rawData 转换为 SysDictData 列表
|
ObjectMapper objectMapper = new ObjectMapper();
|
||||||
List<SysDictData> dataList = rawData.stream()
|
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
||||||
.map(rawDatum -> objectMapper.convertValue(rawDatum, SysDictData.class))
|
// 将 rawData 转换为 SysDictData 列表
|
||||||
.collect(Collectors.toList());
|
List<SysDictData> dataList = rawData.stream()
|
||||||
// 使用 Map 存储字典数据以提高查找速度
|
.map(rawDatum -> objectMapper.convertValue(rawDatum, SysDictData.class))
|
||||||
Map<String, String> dictMap = dataList.stream()
|
.collect(Collectors.toList());
|
||||||
.collect(Collectors.toMap(SysDictData::getDictValue, SysDictData::getDictLabel));
|
// 使用 Map 存储字典数据以提高查找速度
|
||||||
if (CollectionUtils.isNotEmpty(bmUnitList)) {
|
Map<String, String> dictMap = dataList.stream()
|
||||||
for (BmUnit unit : bmUnitList) {
|
.collect(Collectors.toMap(SysDictData::getDictValue, SysDictData::getDictLabel));
|
||||||
if (unit.getUnitId() != null) {
|
if (CollectionUtils.isNotEmpty(bmUnitList)) {
|
||||||
//根据单位id去人员绑定中查询是否绑定,赋值绑定状态
|
for (BmUnit unit : bmUnitList) {
|
||||||
unit.setIsBind(bmUnitMapper.selectBmUnitPersonByUnitId(unit.getUnitId()) > 0 ? 1 : 0);
|
if (unit.getUnitId() != null) {
|
||||||
}
|
//根据单位id去人员绑定中查询是否绑定,赋值绑定状态
|
||||||
String typeName = dictMap.get(unit.getTypeId().toString());
|
unit.setIsBind(bmUnitMapper.selectBmUnitPersonByUnitId(unit.getUnitId()) > 0 ? 1 : 0);
|
||||||
if (typeName != null) {
|
}
|
||||||
unit.setTypeName(typeName);
|
String typeName = dictMap.get(unit.getTypeId().toString());
|
||||||
|
if (typeName != null) {
|
||||||
|
unit.setTypeName(typeName);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("远程服务调用查询失败:", e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,9 @@ import lombok.Data;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import com.bonus.common.core.web.domain.BaseEntity;
|
import com.bonus.common.core.web.domain.BaseEntity;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.Size;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 配件类型管理对象 ma_part_type
|
* 配件类型管理对象 ma_part_type
|
||||||
*
|
*
|
||||||
|
|
@ -27,6 +30,8 @@ public class PartType extends BaseEntity
|
||||||
/** 类型名称 */
|
/** 类型名称 */
|
||||||
@Excel(name = "名称")
|
@Excel(name = "名称")
|
||||||
@ApiModelProperty(value = "类型名称")
|
@ApiModelProperty(value = "类型名称")
|
||||||
|
@NotBlank(message = "名称不能为空")
|
||||||
|
@Size(max=30, message = "名称长度不能超过30")
|
||||||
private String paName;
|
private String paName;
|
||||||
|
|
||||||
/** 上级ID */
|
/** 上级ID */
|
||||||
|
|
@ -44,11 +49,13 @@ public class PartType extends BaseEntity
|
||||||
/** 计量单位名称 */
|
/** 计量单位名称 */
|
||||||
@Excel(name = "计量单位")
|
@Excel(name = "计量单位")
|
||||||
@ApiModelProperty(value = "计量单位名称")
|
@ApiModelProperty(value = "计量单位名称")
|
||||||
|
@Size(max=64, message = "计量单位长度不能超过64")
|
||||||
private String unitName;
|
private String unitName;
|
||||||
|
|
||||||
/** 原值 */
|
/** 原值 */
|
||||||
@Excel(name = "购置价格(元)")
|
@Excel(name = "购置价格(元)")
|
||||||
@ApiModelProperty(value = "原值")
|
@ApiModelProperty(value = "原值")
|
||||||
|
@Size(max=10, message = "购置价格长度不能超过10")
|
||||||
private BigDecimal buyPrice;
|
private BigDecimal buyPrice;
|
||||||
|
|
||||||
/** 实时库存 */
|
/** 实时库存 */
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ package com.bonus.material.ma.service.impl;
|
||||||
|
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
import com.bonus.common.biz.enums.HttpCodeEnum;
|
import com.bonus.common.biz.enums.HttpCodeEnum;
|
||||||
import com.bonus.common.core.constant.SecurityConstants;
|
import com.bonus.common.core.constant.SecurityConstants;
|
||||||
|
|
@ -13,6 +14,7 @@ import com.bonus.system.api.RemoteUserService;
|
||||||
import com.bonus.system.api.domain.SysUser;
|
import com.bonus.system.api.domain.SysUser;
|
||||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.bonus.material.ma.mapper.MachineMapper;
|
import com.bonus.material.ma.mapper.MachineMapper;
|
||||||
import com.bonus.material.ma.domain.Machine;
|
import com.bonus.material.ma.domain.Machine;
|
||||||
|
|
@ -27,6 +29,7 @@ import javax.annotation.Resource;
|
||||||
* @date 2024-09-27
|
* @date 2024-09-27
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
|
@Slf4j
|
||||||
public class MachineServiceImpl implements IMachineService
|
public class MachineServiceImpl implements IMachineService
|
||||||
{
|
{
|
||||||
@Resource
|
@Resource
|
||||||
|
|
@ -45,26 +48,29 @@ public class MachineServiceImpl implements IMachineService
|
||||||
public MachineVo selectMachineByMaId(Long maId)
|
public MachineVo selectMachineByMaId(Long maId)
|
||||||
{
|
{
|
||||||
MachineVo machineVo = machineMapper.selectMachineByMaId(maId);
|
MachineVo machineVo = machineMapper.selectMachineByMaId(maId);
|
||||||
AjaxResult ajaxResult = remoteUserService.getInfo(machineVo.getKeeperId(), SecurityConstants.INNER);
|
setUserName(machineVo.getKeeperId(), machineVo::setKeeperName);
|
||||||
// ajaxResult.get("data") 返回的是 LinkedHashMap
|
setUserName(machineVo.getRepairId(), machineVo::setRepairName);
|
||||||
LinkedHashMap rawDataList = (LinkedHashMap) ajaxResult.get("data");
|
|
||||||
ObjectMapper objectMapper = new ObjectMapper();
|
|
||||||
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
|
||||||
if (rawDataList != null) {
|
|
||||||
SysUser sysUser = objectMapper.convertValue(rawDataList, SysUser.class);
|
|
||||||
machineVo.setKeeperName(sysUser.getNickName() == null ? "" : sysUser.getNickName());
|
|
||||||
}
|
|
||||||
AjaxResult info = remoteUserService.getInfo(machineVo.getRepairId(), SecurityConstants.INNER);
|
|
||||||
// ajaxResult.get("data") 返回的是 LinkedHashMap
|
|
||||||
LinkedHashMap dataList = (LinkedHashMap) info.get("data");
|
|
||||||
if (dataList != null) {
|
|
||||||
SysUser sysUser = objectMapper.convertValue(dataList, SysUser.class);
|
|
||||||
machineVo.setRepairName(sysUser.getNickName() == null ? "" : sysUser.getNickName());
|
|
||||||
}
|
|
||||||
|
|
||||||
return machineVo;
|
return machineVo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void setUserName(Long userId, Consumer<String> setNameFunction) {
|
||||||
|
try {
|
||||||
|
AjaxResult ajaxResult = remoteUserService.getInfo(userId, SecurityConstants.INNER);
|
||||||
|
if (ajaxResult.isSuccess()) {
|
||||||
|
// ajaxResult.get("data") 返回的是 LinkedHashMap
|
||||||
|
LinkedHashMap<String, Object> rawDataList = (LinkedHashMap<String, Object>) ajaxResult.get("data");
|
||||||
|
ObjectMapper objectMapper = new ObjectMapper();
|
||||||
|
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
||||||
|
if (rawDataList != null) {
|
||||||
|
SysUser sysUser = objectMapper.convertValue(rawDataList, SysUser.class);
|
||||||
|
setNameFunction.accept(sysUser.getNickName() == null ? "" : sysUser.getNickName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (IllegalArgumentException e) {
|
||||||
|
log.error("远程调用查询失败:", e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询机具设备管理列表
|
* 查询机具设备管理列表
|
||||||
*
|
*
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue