修改UAT问题 修改代替标准逻辑

This commit is contained in:
高嵩
2023-03-17 15:12:51 +08:00
parent e370d479aa
commit 658f1ded2f
4 changed files with 79 additions and 14 deletions
@@ -83,6 +83,20 @@ public class BussDocumentLibraryEO implements Serializable {
@ApiModelProperty(value = "对应标准")
private java.lang.String correspondingStandard;
/**代替标准*/
@ApiModelProperty(value = "代替标准")
@Dict(dicCode ="replace_standard")
private java.lang.String replaceStandard;
/**被代替标准*/
@ApiModelProperty(value = "被代替标准")
@Dict(dicCode ="replaced_standard")
private java.lang.String replacedStandard;
@TableField(exist = false)
private java.lang.String cut;
@@ -1726,6 +1726,9 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
String key = entry.getKey();
Object value = entry.getValue();
if(key.equals("replace_standard_id")){
continue;
}
//es全文新增数据(数据转换)
esFullText(cut, fieldList, categoryList, dictItemList, mapList, sbCn,sbEn, entry);
@@ -1929,6 +1932,26 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
String insertField = mustFields + fieldsBuilder.toString();
String insertValue = mustValues + valuesBuilder.toString();
bussDocumentLibraryEOMapper.insertInfo(insertField, insertValue);
//处理代替标准和被代替标准逻辑
Object repObj = map.get("replace_standard_id");
if(null != repObj) {
String[] replace_standard_list = repObj.toString().split(",");
for (String rs : replace_standard_list) {
BussDocumentLibraryEO bl = bussDocumentLibraryEOMapper.selectById(rs);
if (null != bl) {
String repStr = bl.getReplacedStandard();
if (StringUtils.isNotBlank(repStr)) {
if (!repStr.contains(idTemp)) {
repStr = repStr + "," + idTemp;
}
} else {
repStr = idTemp;
}
bl.setReplacedStandard(repStr);
bussDocumentLibraryEOMapper.updateById(bl);
}
}
}
String replaceStandard = StringUtils.valueOf(map.get("replace_standard"));
if (StringUtils.isNotBlank(replaceStandard)) {
@@ -2622,6 +2645,28 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
//删除文档库数据
bussDocumentLibraryEOMapper.deleteById((String) map.get("id"));
bussDocumentLibraryEOMapper.insertInfo(insertField, insertValue);
//处理代替标准和被代替标准逻辑
String docId = (String) map.get("id");
Object repObj = map.get("replace_standard_id");
if(null != repObj){
String[] replace_standard_list = repObj.toString().split(",");
for (String rs : replace_standard_list) {
BussDocumentLibraryEO bl = bussDocumentLibraryEOMapper.selectById(rs);
if (null != bl) {
String repStr = bl.getReplacedStandard();
if (StringUtils.isNotBlank(repStr)) {
if (!repStr.contains(docId)) {
repStr = repStr + "," + docId;
}
} else {
repStr = docId;
}
bl.setReplacedStandard(repStr);
bussDocumentLibraryEOMapper.updateById(bl);
}
}
}
//开始更新ES
map.put("module_type", "文档库");
map.put("module_type_flag", ModuleTypeFlagEnum.DOCUMENT_LIBRARY.getValue());
map.put("create_time", new Date());
@@ -83,6 +83,7 @@
visible: false,
confirmLoading: false,
selectedRowKeys: [],
selectedRowList: [],
content: [],
loading: false,
queryParam: {},
@@ -149,16 +150,17 @@
this.visible = false
},
handleSubmit() {
let content = []
// let replace_standard_id = []
let serial_number = []
let replace_standard_id = []
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
let content = JSON.parse(JSON.stringify(this.selectedRowKeys))
// this.content.forEach(res => {
// content.push(res.serial_number)
// replace_standard_id.push(res.id)
// })
this.$emit('input', content.join(','))
// this.$emit('change', this.query.db_field_name, replace_standard_id.join(','))
// let content = JSON.parse(JSON.stringify(this.selectedRowList))
this.selectedRowList.forEach(res => {
serial_number.push(res.serial_number)
replace_standard_id.push(res.id)
})
this.$emit('input', serial_number.join(','))
console.log(replace_standard_id)
this.$emit('change', this.query.db_field_name, replace_standard_id.join(','))
// this.$emit('changecontent', this.content)
this.visible = false
} else {
@@ -168,9 +170,11 @@
indexclick(event) {
this.$emit('input', event.target.value)
},
onSelectChange(value) {
onSelectChange(value,row) {
console.log(value)
console.log(row)
this.selectedRowKeys = value
this.selectedRowList = row
// this.content = []
// value.forEach(val => {
// this.dataList.forEach((res) => {
@@ -169,6 +169,7 @@
<Standardselection :query="item"
:disabled="disabled"
:standard="formInline"
@change="StandardselectionChange"
v-model="formInline[item.db_field_name]"/>
</a-form-model-item>
</div>
@@ -494,10 +495,11 @@
this.type = 'add'
this.getForm()
},
// StandardselectionChange(value, id) {
// this.formInline[value + '_id'] = id
// this.formInline = { ...this.formInline }
// },
StandardselectionChange(value, id) {
console.log(id)
this.formInline[value + '_id'] = id
this.formInline = { ...this.formInline }
},
PersonnelSelectionChange(value, id) {
this.formInline[value + '_id'] = id
this.formInline = { ...this.formInline }