Merge remote-tracking branch 'origin/master-hlq-20240925material' into test
This commit is contained in:
commit
75f2b9ff7a
|
|
@ -403,6 +403,18 @@ public class MaterialMainApi extends BaseApi {
|
|||
return materialMainService.updateProjectType(paramDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
* 申请人才允许更新
|
||||
* @param paramDto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("updateGeneralLevel")
|
||||
@ApiOperation("更新通用程度")
|
||||
public ResultVO<String> updateGeneralLevel(@RequestBody MaterialMainDTO paramDto) {
|
||||
return materialMainService.updateGeneralLevel(paramDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 手动执行计算推荐度
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import com.nflg.product.base.core.exception.NflgBusinessException;
|
|||
import com.nflg.product.material.pojo.dto.MaterialStateUpExcelDTO;
|
||||
import com.nflg.product.material.pojo.dto.MaterialUpdateBillDTO;
|
||||
import com.nflg.product.material.pojo.dto.TwentyMaterialTemplateExcelDTO;
|
||||
import com.nflg.product.material.pojo.entity.MaterialAttrValueI18nEntity;
|
||||
import com.nflg.product.material.pojo.entity.MaterialUpdateBillEntity;
|
||||
import com.nflg.product.material.pojo.entity.MaterialUpdateImportTaskEntity;
|
||||
import com.nflg.product.material.pojo.query.MaterialUpdateBillQuery;
|
||||
|
|
@ -198,4 +199,14 @@ public class MaterialUpdateBillApi extends BaseApi {
|
|||
public ResultVO<List<MaterialUpdateImportTaskEntity>> getMaterialUpdateImportTaskList() {
|
||||
return ResultVO.success(materialUpdateBillService.getMaterialUpdateImportTaskList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取制作物料名称国际化表
|
||||
* @param
|
||||
*/
|
||||
@GetMapping("getI18nForUpdate")
|
||||
@ApiOperation("获取制作物料名称国际化表")
|
||||
public ResultVO<MaterialAttrValueI18nEntity> materialUpdateBillService(@RequestParam("attrValueCn") String attrValueCn, @RequestParam("type") String type) {
|
||||
return materialUpdateBillService.materialUpdateBillService(attrValueCn, type);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -190,5 +190,11 @@ public class MaterialMainDTO implements Serializable {
|
|||
@ApiModelProperty(value = "申请部门")
|
||||
private String applyDeptName;
|
||||
|
||||
/**
|
||||
* 通用程度
|
||||
*/
|
||||
@ApiModelProperty("通用程度")
|
||||
private String generalLevel;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -369,6 +369,13 @@ public class MaterialMainEntity implements Serializable {
|
|||
@ApiModelProperty(value = "近两年使用量(新)")
|
||||
private BigDecimal twoYearsUsage;
|
||||
|
||||
/**
|
||||
* 通用程度
|
||||
*/
|
||||
@TableField(value = "general_level")
|
||||
@ApiModelProperty("通用程度")
|
||||
private String generalLevel;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.nflg.product.material.pojo.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.nflg.product.material.pojo.dto.MaterialMainAttrDTO;
|
||||
import com.nflg.product.material.pojo.entity.MaterialFilesEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
|
|
@ -12,6 +13,7 @@ import org.ttzero.excel.annotation.ExcelColumn;
|
|||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -438,4 +440,38 @@ public class MaterialMainVO implements Serializable {
|
|||
*/
|
||||
@ApiModelProperty(value = "项目类别")
|
||||
private String projectType;
|
||||
|
||||
/**
|
||||
* 通用程度
|
||||
*/
|
||||
@ApiModelProperty("通用程度")
|
||||
private String generalLevel;
|
||||
|
||||
// 变更弹窗字段 start
|
||||
/**
|
||||
* 变更人
|
||||
*/
|
||||
@ApiModelProperty(value = "变更人")
|
||||
private String updateCreatedByName;
|
||||
|
||||
/**
|
||||
* 变更部门
|
||||
*/
|
||||
@ApiModelProperty(value = "变更部门")
|
||||
private String updateApplyDeptName;
|
||||
|
||||
/**
|
||||
* 申请变更时间
|
||||
*/
|
||||
@ApiModelProperty(value = "申请变更时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date updateCreatedTime;
|
||||
|
||||
/**
|
||||
* 变更生效时间
|
||||
*/
|
||||
@ApiModelProperty(value = "变更生效时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date updateEffectTime;
|
||||
// 变更弹窗字段 end
|
||||
}
|
||||
|
|
|
|||
|
|
@ -238,8 +238,8 @@ public class MaterialExcelService {
|
|||
throw new NflgBusinessException(STATE.ParamErr, StrUtil.join(",", diff).concat("分类代码在系统中不存在"));
|
||||
}
|
||||
|
||||
// 校验项目类别
|
||||
checkProjectType(datas);
|
||||
// // 校验项目类别
|
||||
// checkProjectType(datas);
|
||||
|
||||
//验证21 物料
|
||||
check21Droring(datas);
|
||||
|
|
|
|||
|
|
@ -1325,10 +1325,10 @@ public class MaterialMainService extends ServiceImpl<MaterialMainMapper, Materia
|
|||
}
|
||||
}
|
||||
|
||||
ResultVO<String> projectTypeResult = checkProjectType(materialCategoryEntity.getRelCategoryCode(), paramDto);
|
||||
if (Objects.nonNull(projectTypeResult)) {
|
||||
return projectTypeResult;
|
||||
}
|
||||
// ResultVO<String> projectTypeResult = checkProjectType(materialCategoryEntity.getRelCategoryCode(), paramDto);
|
||||
// if (Objects.nonNull(projectTypeResult)) {
|
||||
// return projectTypeResult;
|
||||
// }
|
||||
|
||||
// 工具工装,只验证图号是否重名,不验证前缀
|
||||
if (materialCategoryEntity.getRelCategoryCode().equals(MaterialRelCategoryCodeEnum.relCategoryCode_71.getRelCategoryCode())) {
|
||||
|
|
@ -1602,7 +1602,7 @@ public class MaterialMainService extends ServiceImpl<MaterialMainMapper, Materia
|
|||
}
|
||||
|
||||
MaterialCategoryEntity materialCategoryEntity = materialCategoryService.lambdaQuery().eq(MaterialCategoryEntity::getCategoryCode, paramDto.getMaterialCategoryCode()).one();
|
||||
checkProjectType(materialCategoryEntity.getRelCategoryCode(), paramDto);
|
||||
// checkProjectType(materialCategoryEntity.getRelCategoryCode(), paramDto);
|
||||
|
||||
//效验21物料图片
|
||||
check21And31DrawingNo(paramDto, paramDto.getRowId());
|
||||
|
|
@ -2335,6 +2335,24 @@ public class MaterialMainService extends ServiceImpl<MaterialMainMapper, Materia
|
|||
return ResultVO.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新通用程度
|
||||
* 申请人才允许更新
|
||||
* @param paramDto
|
||||
* @return
|
||||
*/
|
||||
public ResultVO<String> updateGeneralLevel(MaterialMainDTO paramDto) {
|
||||
// 暂且和更新项目类别权限一致
|
||||
if (!checkUpdateProjectTypeByDept(paramDto)) {
|
||||
return ResultVO.error("无法更新本部门外申请物料的通用程度");
|
||||
}
|
||||
MaterialMainEntity entity = new MaterialMainEntity();
|
||||
entity.setRowId(paramDto.getRowId());
|
||||
entity.setGeneralLevel(paramDto.getGeneralLevel());
|
||||
this.updateById(entity);
|
||||
return ResultVO.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过部门判断是否有修改项目类别的权限,以下满足一个即可:
|
||||
* 1、自己申请的物料
|
||||
|
|
|
|||
|
|
@ -20,8 +20,7 @@ import com.nflg.product.base.core.conmon.util.SessionUtil;
|
|||
import com.nflg.product.base.core.exception.NflgBusinessException;
|
||||
import com.nflg.product.base.core.vo.PageVO;
|
||||
import com.nflg.product.material.constant.*;
|
||||
import com.nflg.product.material.mapper.master.MaterialUpdateBillMapper;
|
||||
import com.nflg.product.material.mapper.master.MaterialUpdateImportTaskMapper;
|
||||
import com.nflg.product.material.mapper.master.*;
|
||||
import com.nflg.product.material.pojo.dto.ExcelDTO.MaterialStateUpExcelDTO;
|
||||
import com.nflg.product.material.pojo.dto.ExcelDTO.TwentyMaterialTemplateExcelDTO;
|
||||
import com.nflg.product.material.pojo.dto.MaterialMainAddAttrParamDTO;
|
||||
|
|
@ -96,6 +95,13 @@ public class MaterialUpdateBillService extends ServiceImpl<MaterialUpdateBillMap
|
|||
@Resource
|
||||
private MaterialUpdateImportTaskMapper materialUpdateImportTaskMapper;
|
||||
|
||||
@Resource
|
||||
private MaterialAttrValueMapper materialAttrValueMapper;
|
||||
@Resource
|
||||
private MaterialAttrValueI18nMapper materialAttrValueI18nMapper;
|
||||
@Resource
|
||||
private MaterialAttrValueI18n21Mapper materialAttrValueI18n21Mapper;
|
||||
|
||||
private static final String PREFIX = "frontend:material";
|
||||
|
||||
/**
|
||||
|
|
@ -1058,6 +1064,11 @@ public class MaterialUpdateBillService extends ServiceImpl<MaterialUpdateBillMap
|
|||
}
|
||||
materialMainVO.setReplaceMaterialNo(materialUpdateBillEntity.getReplaceMaterialNo());
|
||||
materialMainVO.setRemark(ent.getRemark());
|
||||
materialMainVO.setMaterialDescEn(materialUpdateBillEntity.getMaterialDescEn());
|
||||
materialMainVO.setUpdateCreatedByName(materialUpdateBillEntity.getCreatedByName());
|
||||
materialMainVO.setUpdateApplyDeptName(materialUpdateBillEntity.getApplyDeptName());
|
||||
materialMainVO.setUpdateCreatedTime(materialUpdateBillEntity.getCreatedTime());
|
||||
materialMainVO.setUpdateEffectTime(materialUpdateBillEntity.getEffectTime());
|
||||
}
|
||||
return materialMainVO;
|
||||
}
|
||||
|
|
@ -1202,4 +1213,25 @@ public class MaterialUpdateBillService extends ServiceImpl<MaterialUpdateBillMap
|
|||
public List<MaterialUpdateImportTaskEntity> getMaterialUpdateImportTaskList() {
|
||||
return materialUpdateImportTaskMapper.getMaterialUpdateImportTaskList(SessionUtil.getUserCode());
|
||||
}
|
||||
|
||||
public ResultVO<MaterialAttrValueI18nEntity> materialUpdateBillService(String attrValueCn, String type) {
|
||||
// 查询制作物料英文
|
||||
if ("20".equals(type)) {
|
||||
LambdaQueryWrapper<MaterialAttrValueI18n21Entity> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(MaterialAttrValueI18n21Entity::getAttrValueCn, attrValueCn).eq(MaterialAttrValueI18n21Entity::getEnableState, 1);
|
||||
MaterialAttrValueI18n21Entity i18n21Entity = materialAttrValueI18n21Mapper.selectOne(queryWrapper);
|
||||
return ResultVO.success(Convert.convert(MaterialAttrValueI18nEntity.class, i18n21Entity));
|
||||
} else {
|
||||
// 查询采购物料英文
|
||||
LambdaQueryWrapper<MaterialAttrValueEntity> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(MaterialAttrValueEntity::getAttrRowId, 1).eq(MaterialAttrValueEntity::getAttrValueName, attrValueCn);
|
||||
MaterialAttrValueEntity materialAttrValueEntity = materialAttrValueMapper.selectOne(queryWrapper);
|
||||
if (ObjectUtil.isNotEmpty(materialAttrValueEntity)) {
|
||||
LambdaQueryWrapper<MaterialAttrValueI18nEntity> i18nQueryWrapper = new LambdaQueryWrapper<>();
|
||||
i18nQueryWrapper.eq(MaterialAttrValueI18nEntity::getAttrValueRowId, materialAttrValueEntity.getRowId());
|
||||
return ResultVO.success(materialAttrValueI18nMapper.selectOne(i18nQueryWrapper));
|
||||
}
|
||||
}
|
||||
return ResultVO.success();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue