工程类型
This commit is contained in:
parent
bcdc03d944
commit
e1a19795ce
|
|
@ -12,6 +12,7 @@ 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.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
@ -77,7 +78,7 @@ public class BmAssetAttributesController extends BaseController {
|
||||||
@RequiresPermissions("basic:asset:add")
|
@RequiresPermissions("basic:asset:add")
|
||||||
@SysLog(title = "资产属性管理", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增资产属性管理")
|
@SysLog(title = "资产属性管理", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增资产属性管理")
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@RequestBody BmAssetAttributes bmAssetAttributes) {
|
public AjaxResult add(@Validated @RequestBody BmAssetAttributes bmAssetAttributes) {
|
||||||
return bmAssetAttributesService.insert(bmAssetAttributes);
|
return bmAssetAttributesService.insert(bmAssetAttributes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -92,7 +93,7 @@ public class BmAssetAttributesController extends BaseController {
|
||||||
@RequiresPermissions("basic:asset:edit")
|
@RequiresPermissions("basic:asset:edit")
|
||||||
@SysLog(title = "资产属性管理", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->修改资产属性管理")
|
@SysLog(title = "资产属性管理", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->修改资产属性管理")
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public AjaxResult edit(@RequestBody BmAssetAttributes bmAssetAttributes) {
|
public AjaxResult edit(@Validated @RequestBody BmAssetAttributes bmAssetAttributes) {
|
||||||
return bmAssetAttributesService.update(bmAssetAttributes);
|
return bmAssetAttributesService.update(bmAssetAttributes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ import com.bonus.material.common.utils.HttpClient;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.PutMapping;
|
import org.springframework.web.bind.annotation.PutMapping;
|
||||||
|
|
@ -89,7 +90,7 @@ public class BmProjectController extends BaseController
|
||||||
@RequiresPermissions("basic:project:add")
|
@RequiresPermissions("basic:project:add")
|
||||||
@SysLog(title = "标段工程管理", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增标段工程管理")
|
@SysLog(title = "标段工程管理", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增标段工程管理")
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@RequestBody BmProject bmProject)
|
public AjaxResult add(@Validated @RequestBody BmProject bmProject)
|
||||||
{
|
{
|
||||||
return bmProjectService.insertBmProject(bmProject);
|
return bmProjectService.insertBmProject(bmProject);
|
||||||
}
|
}
|
||||||
|
|
@ -102,7 +103,7 @@ public class BmProjectController extends BaseController
|
||||||
@RequiresPermissions("basic:project:edit")
|
@RequiresPermissions("basic:project:edit")
|
||||||
@SysLog(title = "标段工程管理", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改标段工程管理")
|
@SysLog(title = "标段工程管理", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改标段工程管理")
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public AjaxResult edit(@RequestBody BmProject bmProject)
|
public AjaxResult edit(@Validated @RequestBody BmProject bmProject)
|
||||||
{
|
{
|
||||||
return bmProjectService.updateBmProject(bmProject);
|
return bmProjectService.updateBmProject(bmProject);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,14 @@
|
||||||
package com.bonus.material.basic.controller;
|
package com.bonus.material.basic.controller;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.annotation.Resource;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import com.bonus.common.log.enums.OperaType;
|
import com.bonus.common.log.enums.OperaType;
|
||||||
import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
||||||
import com.bonus.system.api.RemoteDictDataService;
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.PutMapping;
|
import org.springframework.web.bind.annotation.PutMapping;
|
||||||
|
|
@ -88,7 +87,7 @@ public class BmUnitController extends BaseController
|
||||||
@RequiresPermissions("basic:unit:add")
|
@RequiresPermissions("basic:unit:add")
|
||||||
@SysLog(title = "往来单位管理", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增往来单位管理")
|
@SysLog(title = "往来单位管理", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增往来单位管理")
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@RequestBody BmUnit bmUnit)
|
public AjaxResult add(@Validated @RequestBody BmUnit bmUnit)
|
||||||
{
|
{
|
||||||
return bmUnitService.insertBmUnit(bmUnit);
|
return bmUnitService.insertBmUnit(bmUnit);
|
||||||
}
|
}
|
||||||
|
|
@ -101,7 +100,7 @@ public class BmUnitController extends BaseController
|
||||||
@RequiresPermissions("basic:unit:edit")
|
@RequiresPermissions("basic:unit:edit")
|
||||||
@SysLog(title = "往来单位管理", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改往来单位管理")
|
@SysLog(title = "往来单位管理", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改往来单位管理")
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public AjaxResult edit(@RequestBody BmUnit bmUnit)
|
public AjaxResult edit(@Validated @RequestBody BmUnit bmUnit)
|
||||||
{
|
{
|
||||||
return bmUnitService.updateBmUnit(bmUnit);
|
return bmUnitService.updateBmUnit(bmUnit);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,7 @@ public class BmProject extends BaseEntity
|
||||||
|
|
||||||
/** 工程类型(0线路,1变电,2业务,3其他) */
|
/** 工程类型(0线路,1变电,2业务,3其他) */
|
||||||
@ApiModelProperty(value = "工程类型(0线路,1变电,2业务,3其他)")
|
@ApiModelProperty(value = "工程类型(0线路,1变电,2业务,3其他)")
|
||||||
|
@NotBlank(message = "工程类型不能为空")
|
||||||
private String proTypeId;
|
private String proTypeId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "实施单位")
|
@ApiModelProperty(value = "实施单位")
|
||||||
|
|
@ -57,7 +58,6 @@ public class BmProject extends BaseEntity
|
||||||
|
|
||||||
@ApiModelProperty(value = "工程类型")
|
@ApiModelProperty(value = "工程类型")
|
||||||
@Excel(name = "工程类型")
|
@Excel(name = "工程类型")
|
||||||
@NotBlank(message = "工程类型不能为空")
|
|
||||||
private String proType;
|
private String proType;
|
||||||
|
|
||||||
@ApiModelProperty(value = "工程编号")
|
@ApiModelProperty(value = "工程编号")
|
||||||
|
|
@ -98,10 +98,13 @@ public class BmProject extends BaseEntity
|
||||||
private String telphone;
|
private String telphone;
|
||||||
|
|
||||||
@ApiModelProperty(value = "工程状态")
|
@ApiModelProperty(value = "工程状态")
|
||||||
@Excel(name = "工程状态")
|
|
||||||
@NotBlank(message = "工程状态不能为空")
|
@NotBlank(message = "工程状态不能为空")
|
||||||
private String proStatus;
|
private String proStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "工程状态名称")
|
||||||
|
@Excel(name = "工程状态")
|
||||||
|
private String proStatusName;
|
||||||
|
|
||||||
/** 计划开工日期 */
|
/** 计划开工日期 */
|
||||||
@ApiModelProperty(value = "计划开工日期")
|
@ApiModelProperty(value = "计划开工日期")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
|
@ -129,6 +132,9 @@ public class BmProject extends BaseEntity
|
||||||
@NotBlank(message = "工程性质不能为空")
|
@NotBlank(message = "工程性质不能为空")
|
||||||
private String proNature;
|
private String proNature;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "工程性质名称")
|
||||||
|
private String proNatureName;
|
||||||
|
|
||||||
@ApiModelProperty(value = "所属项目中心")
|
@ApiModelProperty(value = "所属项目中心")
|
||||||
@Size(max=60, message = "所属项目中心长度不能超过60")
|
@Size(max=60, message = "所属项目中心长度不能超过60")
|
||||||
private String proCenter;
|
private String proCenter;
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ package com.bonus.material.basic.service.impl;
|
||||||
|
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
import cn.hutool.core.util.PhoneUtil;
|
import cn.hutool.core.util.PhoneUtil;
|
||||||
|
|
@ -12,6 +13,7 @@ import com.bonus.common.core.constant.SecurityConstants;
|
||||||
import com.bonus.common.core.utils.DateUtils;
|
import com.bonus.common.core.utils.DateUtils;
|
||||||
import com.bonus.common.core.web.domain.AjaxResult;
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
import com.bonus.common.security.utils.SecurityUtils;
|
import com.bonus.common.security.utils.SecurityUtils;
|
||||||
|
import com.bonus.material.purchase.config.RemoteConfig;
|
||||||
import com.bonus.system.api.RemoteDeptService;
|
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;
|
||||||
|
|
@ -25,8 +27,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业务层处理
|
||||||
|
|
@ -44,6 +44,9 @@ public class BmProjectServiceImpl implements IBmProjectService
|
||||||
@Resource
|
@Resource
|
||||||
private RemoteDeptService remoteDeptService;
|
private RemoteDeptService remoteDeptService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private RemoteConfig remoteConfig;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询标段工程管理
|
* 查询标段工程管理
|
||||||
*
|
*
|
||||||
|
|
@ -55,9 +58,32 @@ public class BmProjectServiceImpl implements IBmProjectService
|
||||||
{
|
{
|
||||||
BmProject project = bmProjectMapper.selectBmProjectByProId(proId);
|
BmProject project = bmProjectMapper.selectBmProjectByProId(proId);
|
||||||
extractedImpUnit(project);
|
extractedImpUnit(project);
|
||||||
|
extractProject(project);
|
||||||
return project;
|
return project;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 方法抽取
|
||||||
|
* @param project
|
||||||
|
*/
|
||||||
|
private void extractProject(BmProject project) {
|
||||||
|
Map<String, String> typeMap = remoteConfig.getDictValue("bm_project_type");
|
||||||
|
Map<String, String> natureMap = remoteConfig.getDictValue("bm_project_nature");
|
||||||
|
Map<String, String> statusMap = remoteConfig.getDictValue("bm_project_status");
|
||||||
|
if (StringUtils.isNotBlank(project.getProTypeId())) {
|
||||||
|
String type = typeMap.get(project.getProTypeId());
|
||||||
|
project.setProType(StringUtils.isBlank(type) ? "" : type);
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotBlank(project.getProNature())) {
|
||||||
|
String nature = natureMap.get(project.getProNature());
|
||||||
|
project.setProNatureName(StringUtils.isBlank(nature) ? "" : nature);
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotBlank(project.getProStatus())) {
|
||||||
|
String status = statusMap.get(project.getProStatus());
|
||||||
|
project.setProStatusName(StringUtils.isBlank(status) ? "" : status);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 实施单位方法抽取
|
* 实施单位方法抽取
|
||||||
* @param project
|
* @param project
|
||||||
|
|
@ -94,59 +120,35 @@ 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);
|
|
||||||
});
|
});
|
||||||
|
extracted(list);
|
||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 方法抽取
|
* 方法抽取
|
||||||
* @param item
|
* @param list
|
||||||
*/
|
*/
|
||||||
private void extracted(BmProject item) {
|
private void extracted(List<BmProject> list) {
|
||||||
if (item.getProTypeId() != null) {
|
Map<String, String> typeMap = remoteConfig.getDictValue("bm_project_type");
|
||||||
if (ZERO_CONSTANT.equals(Integer.valueOf(item.getProTypeId()))) {
|
Map<String, String> natureMap = remoteConfig.getDictValue("bm_project_nature");
|
||||||
item.setProType("线路工程");
|
Map<String, String> statusMap = remoteConfig.getDictValue("bm_project_status");
|
||||||
} else if (ONE_CONSTANT.equals(Integer.valueOf(item.getProTypeId()))) {
|
for (BmProject item : list) {
|
||||||
item.setProType("变电工程");
|
if (StringUtils.isNotBlank(item.getProTypeId())) {
|
||||||
} else if (TWO_CONSTANT.equals(Integer.valueOf(item.getProTypeId()))) {
|
String type = typeMap.get(item.getProTypeId());
|
||||||
item.setProType("业务工程");
|
item.setProType(StringUtils.isBlank(type) ? "" : type);
|
||||||
} else if (THREE_CONSTANT.equals(Integer.valueOf(item.getProTypeId()))) {
|
|
||||||
item.setProType("其他工程");
|
|
||||||
} else {
|
|
||||||
item.setProType("未知工程类型");
|
|
||||||
}
|
}
|
||||||
}
|
if (StringUtils.isNotBlank(item.getProNature())) {
|
||||||
if (item.getProNature() != null) {
|
String nature = natureMap.get(item.getProNature());
|
||||||
if (ZERO_CONSTANT.equals(Integer.valueOf(item.getProNature()))) {
|
item.setProNatureName(StringUtils.isBlank(nature) ? "" : nature);
|
||||||
item.setProNature("基建");
|
|
||||||
} else if (ONE_CONSTANT.equals(Integer.valueOf(item.getProNature()))) {
|
|
||||||
item.setProNature("用户工程");
|
|
||||||
} else if (TWO_CONSTANT.equals(Integer.valueOf(item.getProNature()))){
|
|
||||||
item.setProNature("技修大改");
|
|
||||||
} else if (THREE_CONSTANT.equals(Integer.valueOf(item.getProNature()))) {
|
|
||||||
item.setProNature("其他");
|
|
||||||
} else {
|
|
||||||
item.setProNature("未知工程性质");
|
|
||||||
}
|
}
|
||||||
}
|
if (StringUtils.isNotBlank(item.getProStatus())) {
|
||||||
if (item.getProStatus() != null) {
|
String status = statusMap.get(item.getProStatus());
|
||||||
if (ZERO_CONSTANT.equals(Integer.valueOf(item.getProStatus()))) {
|
item.setProStatusName(StringUtils.isBlank(status) ? "" : status);
|
||||||
item.setProStatus("开工准备");
|
|
||||||
} else if (ONE_CONSTANT.equals(Integer.valueOf(item.getProStatus()))) {
|
|
||||||
item.setProStatus("在建");
|
|
||||||
} else if (TWO_CONSTANT.equals(Integer.valueOf(item.getProStatus()))){
|
|
||||||
item.setProStatus("停工");
|
|
||||||
} else if (THREE_CONSTANT.equals(Integer.valueOf(item.getProStatus()))){
|
|
||||||
item.setProStatus("完工未竣工");
|
|
||||||
} else if (FOUR_CONSTANT.equals(Integer.valueOf(item.getProStatus()))) {
|
|
||||||
item.setProStatus("竣工");
|
|
||||||
} else {
|
|
||||||
item.setProStatus("未知工程状态");
|
|
||||||
}
|
}
|
||||||
|
item.setIsMatchI8(StringUtils.isNotEmpty(item.getExternalId()) ? "匹配" : "不匹配");
|
||||||
}
|
}
|
||||||
item.setIsMatchI8(StringUtils.isNotEmpty(item.getExternalId()) ? "匹配" : "不匹配");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue