Merge remote-tracking branch 'origin/dev_2nd_LCYH' into dev_2nd_LCYH

This commit is contained in:
高嵩
2023-03-31 18:45:57 +08:00
7 changed files with 217 additions and 10 deletions
@@ -448,4 +448,8 @@ ALTER TABLE `project_version_info`
ALTER TABLE `project_version_info`
ADD COLUMN `project_laws_inventory_id` varchar(255) NULL COMMENT '法规清单数据id' AFTER `verify_flow_status`;
ALTER TABLE `project_version_info`
ADD COLUMN `applicable_supplement` varchar(255) NULL COMMENT '适用增补件' AFTER `project_laws_inventory_id`;
ADD COLUMN `applicable_supplement` varchar(255) NULL COMMENT '适用增补件' AFTER `project_laws_inventory_id`;
-- 虚拟认证清单-增加字段 2023-3-30 未同步生产环境
ALTER TABLE `auth_dummy_inventory_info`
ADD COLUMN `deliverable_template` varchar(500) NULL COMMENT '交付物模板' AFTER `auth_dummy_inventory_base_id`;
@@ -134,4 +134,12 @@ public class AuthDummyInventoryInfoEO implements Serializable {
/**值类型,对应SysCategoryValueTypeEnum中value**/
@TableField(exist = false)
private String valueType;
/**交付物模板*/
@ApiModelProperty(value = "交付物模板")
private String deliverableTemplate;
/**交付物模板名称**/
@TableField(exist = false)
@Excel(name = "交付物模板", width = 20)
private String deliverableTemplateName;
}
@@ -27,6 +27,7 @@ import com.jero.modules.dummy.entity.DummyInventoryInfoEO;
import com.jero.modules.dummy.enums.DummyInventoryBaseFieldEnum;
import com.jero.modules.dummy.service.impl.DummyLogEOServiceImpl;
import com.jero.modules.dummy.util.DeepCopyListUtil;
import com.jero.modules.oss.entity.OSSFile;
import com.jero.modules.oss.service.IOSSFileService;
import com.jero.modules.project.entity.ProjectCertificationInventoryEO;
import com.jero.modules.project.enums.ProjectInventoryFieldEnum;
@@ -1302,6 +1303,8 @@ public class AuthDummyInventoryInfoEOServiceImpl extends ServiceImpl<AuthDummyIn
if(CollectionUtils.isNotEmpty(datas)){
List<SysCategory> categoryList = this.sysCategoryService.list();
List<SysDictItem> sysDictItems = this.sysDictItemServiceImpl.getBaseMapper().selectItemsAll();
String deliverableTemplates = datas.stream().map(AuthDummyInventoryInfoEO::getDeliverableTemplate).distinct().collect(Collectors.joining(","));
List<OSSFile> deliverableTemplateFileList = iOSSFileService.getFileInfos(deliverableTemplates);
for (AuthDummyInventoryInfoEO data : datas) {
if(StringUtils.isNotEmpty(data.getDeliverableType())){
@@ -1312,6 +1315,20 @@ public class AuthDummyInventoryInfoEOServiceImpl extends ServiceImpl<AuthDummyIn
String dutyTerritoryName = this.sysDictItemService.disposeShowDictItemValue(sysDictItems,data.getDutyTerritory(),cut, ProjectInventoryFieldEnum.DUTY_TERRITORY.getValue());
data.setDutyTerritoryName(dutyTerritoryName);
}
if(StringUtils.isNotBlank(data.getDeliverableTemplate())){
String[] deliverableTemplateArr = data.getDeliverableTemplate().split(",");
String deliverableTemplateName = deliverableTemplateFileList.stream().filter(file -> {
boolean flag = false;
for (String deliverableTemplate : deliverableTemplateArr) {
if (StringUtils.equals(file.getId(),deliverableTemplate)) {
flag = true;
break;
}
}
return flag;
}).map(OSSFile::getFileName).collect(Collectors.joining(","));
data.setDeliverableTemplateName(deliverableTemplateName);
}
}
}
@@ -1311,6 +1311,17 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
List<String> dutyPersonIdList = projectCertificationInventoryEOList.stream().map(ProjectCertificationInventoryEO::getDutyPerson).distinct().collect(Collectors.toList());
List<SysUser> dutyPersonList = this.sysUserService.querySysUserListByIdList(dutyPersonIdList);
try {
// 给责任人分配待办中心的任务
List<ProcessInfoDetailEO> processInfoDetailEOList = new ArrayList<>();
for (ProjectCertificationInventoryEO projectCertificationInventoryEO : projectCertificationInventoryEOList) {
ProcessInfoDetailEO processInfoDetailEO = new ProcessInfoDetailEO();
processInfoDetailEO.setUserId(projectCertificationInventoryEO.getDutyPerson());
processInfoDetailEO.setEndTime(projectCertificationInventoryEO.getEndTime());
processInfoDetailEO.setProjectLawsInventoryId(projectCertificationInventoryEO.getId());
processInfoDetailEOList.add(processInfoDetailEO);
}
this.addProcessInfoDetailEO(processInfoDetailEOList,projectLibraryBase.getId(),CertificationFlowNodeEnum.ZRRTJRW.getKey());
// 更新数据状态为 审查退回
this.updateBatchById(projectCertificationInventoryEOList);
@@ -1494,7 +1505,7 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
detailUpdateWrap.eq(ProcessInfoDetailEO::getProcessInfoId,projectLibraryBase.getId());
detailUpdateWrap.eq(ProcessInfoDetailEO::getUserId,currentUser.getId());
detailUpdateWrap.eq(ProcessInfoDetailEO::getTaskDefinitionKey,CertificationFlowNodeEnum.ZRRTJRW.getKey());
detailUpdateWrap.eq(ProcessInfoDetailEO::getProjectLawsInventoryId,certificationIdList);
detailUpdateWrap.in(ProcessInfoDetailEO::getProjectLawsInventoryId,certificationIdList);
detailUpdateWrap.set(ProcessInfoDetailEO::getStatus,TaskStatusEnum.HAVE_DONE.getValue());
this.processInfoDetailEOService.update(detailUpdateWrap);
@@ -1580,7 +1591,7 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
detailUpdateWrap.eq(ProcessInfoDetailEO::getProcessInfoId,projectLibraryBase.getId());
detailUpdateWrap.eq(ProcessInfoDetailEO::getUserId,currentUser.getId());
detailUpdateWrap.eq(ProcessInfoDetailEO::getTaskDefinitionKey,CertificationFlowNodeEnum.ZRRJSRW.getKey());
detailUpdateWrap.eq(ProcessInfoDetailEO::getProjectLawsInventoryId,certificationIdList);
detailUpdateWrap.in(ProcessInfoDetailEO::getProjectLawsInventoryId,certificationIdList);
detailUpdateWrap.set(ProcessInfoDetailEO::getStatus,TaskStatusEnum.HAVE_DONE.getValue());
this.processInfoDetailEOService.update(detailUpdateWrap);
@@ -1686,11 +1697,13 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
String itemName = (String) standNameAndItemName.get("itemName");
try {
List<String> certificationIdList = projectCertificationInventoryEOList.stream().map(ProjectCertificationInventoryEO::getId).distinct().collect(Collectors.toList());
// 将当前责任人的待办任务转为已办
LambdaUpdateWrapper<ProcessInfoDetailEO> detailUpdateWrap = new LambdaUpdateWrapper<>();
detailUpdateWrap.eq(ProcessInfoDetailEO::getProcessInfoId,projectLibraryBase.getId());
detailUpdateWrap.eq(ProcessInfoDetailEO::getUserId,currentUser.getId());
detailUpdateWrap.eq(ProcessInfoDetailEO::getTaskDefinitionKey,CertificationFlowNodeEnum.ZRRJSRW.getKey());
detailUpdateWrap.in(ProcessInfoDetailEO::getProjectLawsInventoryId,certificationIdList);
detailUpdateWrap.set(ProcessInfoDetailEO::getStatus,TaskStatusEnum.HAVE_DONE.getValue());
this.processInfoDetailEOService.update(detailUpdateWrap);
@@ -145,6 +145,25 @@
</div>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="12">
<div class="box-title-text">
<div class="title-text">
<span class="title-text-text"
:title="$t('deliverableTemplate')">{{$t('deliverableTemplate')}}</span>
</div>
<a-form-model-item class="itemModel" prop="deliverableTemplate">
<a-button type="primary" class="button-text"
@click="clickButtonToUpload('deliverableTemplate',index,true)">
{{ (item.deliverableTemplate === 'null' || item.deliverableTemplate === ''
||
item.deliverableTemplate == null) ? $t('clickUpload') : $t('viewUploadedFiles')
}}
</a-button>
</a-form-model-item>
</div>
</a-col>
</a-row>
</div>
</a-form-model>
</a-spin>
@@ -154,12 +173,14 @@
</div>
</a-drawer>
<codeNumber ref="codeNumber" @regulation="regulation" />
<uploadFile ref="uploadFile" @uploadSuccess="uploadSuccess"/>
</div>
</template>
<script>
import codeNumber from './codeNumber'
import uploadFile from '@/components/uploadFile/file'
import { getAction, postAction } from '@/api/manage'
import { mapGetters } from 'vuex'
@@ -167,7 +188,8 @@ export default {
name:"addModel",
props: ['url'],
components:{
codeNumber
codeNumber,
uploadFile
},
data() {
return {
@@ -299,7 +321,45 @@ export default {
this.formInline = {... this.formInline}
this.$refs.ruleForm.validateField(['serialNumber'])
})
}
},
//交付物模板上传
clickButtonToUpload(item, index,isTrue) {
this.numIndex = index
this.$refs.uploadFile.perentHandleFunc()
this.$refs.uploadFile.visible = true
this.uploadName = item
let ids = ''
console.log(index)
if (isTrue){
ids = this.formInline.dataList[index][item]
}else{
ids = this.formInline[item]
}
console.log(this.formInline,1111)
getAction('sys/common/getFileInfos', { id: ids }).then((res) => {
if (res.success) {
this.$refs.uploadFile.perentHandleFunc(res.result)
} else {
this.$refs.uploadFile.perentHandleFunc()
}
})
},
/** 上传文件的回调 */
uploadSuccess(data) {
let attIdList = []
if (data && data.length > 0) {
data.map(item => {
attIdList.push(item.id || data.name)
})
}
/** 赋值给当前对应的表单文件 */
if (this.formInline.id) {
this.formInline[this.uploadName] = attIdList.join(',')
} else {
this.formInline.dataList[this.numIndex][this.uploadName] = attIdList.join(',')
}
this.formInline = { ...this.formInline }
},
}
}
</script>
@@ -366,4 +426,13 @@ export default {
font-size: 16px;
margin-right: 4px;
}
.button-text {
height: 38px;
width: calc(100% - 100px);
line-height: 38px;
background: #fff;
border: 1px #00B3BE solid;
color: #00B3BE;
}
</style>
@@ -127,6 +127,25 @@
</div>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="12">
<div class="box-title-text">
<div class="title-text">
<span class="title-text-text"
:title="$t('deliverableTemplate')">{{$t('deliverableTemplate')}}</span>
</div>
<a-form-model-item class="itemModel" prop="deliverableTemplate">
<a-button type="primary" class="button-text"
@click="clickButtonToUpload('deliverableTemplate')">
{{ (formInline.deliverableTemplate === 'null' || formInline.deliverableTemplate === ''
||
formInline.deliverableTemplate == null) ? $t('clickUpload') : $t('viewUploadedFiles')
}}
</a-button>
</a-form-model-item>
</div>
</a-col>
</a-row>
</a-form-model>
</a-spin>
<div class="drawer-bootom-button">
@@ -135,18 +154,21 @@
</div>
</a-drawer>
<codeNumber ref="codeNumber" @regulation="regulation" />
<uploadFile ref="uploadFile" @uploadSuccess="uploadSuccess"/>
</div>
</template>
<script>
import { getAction, postAction, downloadFile, deleteAction } from '@/api/manage'
import codeNumber from './codeNumber'
import uploadFile from '@/components/uploadFile/file'
export default {
name:'editModel',
props: ['url'],
components:{
codeNumber
codeNumber,
uploadFile
},
data() {
return {
@@ -276,7 +298,44 @@ export default {
this.formInline = {... this.formInline}
this.$refs.ruleForm.validateField(['serialNumber'])
})
}
},
//交付物模板
clickButtonToUpload(item, index,isTrue) {
this.numIndex = index
this.$refs.uploadFile.perentHandleFunc()
this.$refs.uploadFile.visible = true
this.uploadName = item
let ids = ''
console.log(index)
if (isTrue){
ids = this.formInline.dataList[index][item]
}else{
ids = this.formInline[item]
}
getAction('sys/common/getFileInfos', { id: ids }).then((res) => {
if (res.success) {
this.$refs.uploadFile.perentHandleFunc(res.result)
} else {
this.$refs.uploadFile.perentHandleFunc()
}
})
},
/** 上传文件的回调 */
uploadSuccess(data) {
let attIdList = []
if (data && data.length > 0) {
data.map(item => {
attIdList.push(item.id || data.name)
})
}
/** 赋值给当前对应的表单文件 */
if (this.formInline.id) {
this.formInline[this.uploadName] = attIdList.join(',')
} else {
this.formInline.dataList[this.numIndex][this.uploadName] = attIdList.join(',')
}
this.formInline = { ...this.formInline }
},
}
}
</script>
@@ -333,4 +392,13 @@ export default {
background: #fff;
border-radius: 0 0 2px 2px;
}
.button-text {
height: 38px;
width: calc(100% - 100px);
line-height: 38px;
background: #fff;
border: 1px #00B3BE solid;
color: #00B3BE;
}
</style>
@@ -206,9 +206,17 @@
@change="tableOnChange"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
:columns="columns">
<span slot="item" slot-scope="text,record">
<a @click="itemClick(record)">{{text}}</a>
<span slot="deliverableTemplate" slot-scope="text,result">
<span class="viewFile"
@click="viewFileClick(result.deliverableTemplate)"
v-if="result.deliverableTemplate">
{{$t('viewFile')}}
</span>
<span v-else>--</span>
</span>
<!-- <span slot="item" slot-scope="text,record">-->
<!-- <a @click="itemClick(record)">{{text}}</a>-->
<!-- </span>-->
<span slot="operation" slot-scope="text,record">
<a v-if="isTrue"
class="text-operation"
@@ -236,6 +244,7 @@
<addModel :url="url" ref="addModelRef" @addModelList="addModelList"/>
<edit-model :url="url" ref="editModelRef" @editModelList="editModelList"></edit-model>
<bat-setting :url="url" ref="batSettingRef" @batSettingList="batSettingList"></bat-setting>
<viewFileModel ref="viewFileModelRef"/>
</div>
</template>
@@ -250,6 +259,7 @@
import addModel from '../components/addModel'
import editModel from '../components/editModel'
import batSetting from '../components/batSetting'
import viewFileModel from '@/components/viewFileModel/index'
import { ResizeHeader, ResizeColumnProvide } from '@/mixins/header'
export default {
@@ -261,7 +271,8 @@
transferList,
addModel,
editModel,
batSetting
batSetting,
viewFileModel
},
mixins: [ResizeHeader, ResizeColumnProvide],
data() {
@@ -340,6 +351,14 @@
width: 330,
ellipsis: true
},
{
title: this.$t('deliverableTemplate'),
align: 'left',
dataIndex: 'deliverableTemplate',
width: 330,
ellipsis: true,
scopedSlots: { customRender: 'deliverableTemplate' }
},
{
title: this.$t('operation'),
align: 'left',
@@ -536,6 +555,10 @@
})
}
})
},
// 交付物模板
viewFileClick(item) {
this.$refs.viewFileModelRef.clickButtonToUpload(item)
}
}
}
@@ -668,4 +691,9 @@
::v-deep .ant-table-placeholder {
margin-top: 8px !important;
}
.viewFile {
color: #00B3BE;
cursor: pointer;
}
</style>