提交代码

main
姜玉琦 2024-02-26 01:09:29 +08:00
parent b1853ed84b
commit 1a776f79ea
5 changed files with 61 additions and 35 deletions

View File

@ -27,7 +27,7 @@ public class ProProjectApplyDetail extends BaseEntity
/** 大类主键 */
@Excel(name = "大类主键")
private Long superTypeId;
private String superTypeKey;
/** 大类名称 */
@Excel(name = "大类名称")
@ -96,14 +96,14 @@ public class ProProjectApplyDetail extends BaseEntity
{
return applyId;
}
public void setSuperTypeId(Long superTypeId)
public void setSuperTypeKey(String superTypeKey)
{
this.superTypeId = superTypeId;
this.superTypeKey = superTypeKey;
}
public Long getSuperTypeId()
public String getSuperTypeKey()
{
return superTypeId;
return superTypeKey;
}
public void setSuperTypeName(String superTypeName)
{
@ -219,7 +219,7 @@ public class ProProjectApplyDetail extends BaseEntity
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("applyId", getApplyId())
.append("superTypeId", getSuperTypeId())
.append("superTypeId", getSuperTypeKey())
.append("superTypeName", getSuperTypeName())
.append("typeId", getTypeId())
.append("typeName", getTypeName())

View File

@ -2,10 +2,15 @@ package com.yanzhu.project.service.impl;
import java.util.List;
import com.yanzhu.base.domain.BaseAssetsType;
import com.yanzhu.base.mapper.BaseAssetsTypeMapper;
import com.yanzhu.common.core.domain.entity.SysDictData;
import com.yanzhu.common.core.domain.entity.SysUser;
import com.yanzhu.common.enums.ShiFouEnum;
import com.yanzhu.common.utils.DateUtils;
import com.yanzhu.common.utils.DictUtils;
import com.yanzhu.common.utils.SecurityUtils;
import com.yanzhu.system.mapper.SysDictDataMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
@ -28,6 +33,9 @@ public class ProProjectApplyServiceImpl implements IProProjectApplyService
@Autowired
private ProProjectApplyMapper proProjectApplyMapper;
@Autowired
private BaseAssetsTypeMapper baseAssetsTypeMapper;
/**
*
*
@ -132,10 +140,21 @@ public class ProProjectApplyServiceImpl implements IProProjectApplyService
Long id = proProjectApply.getId();
if (StringUtils.isNotNull(proProjectApplyDetailList))
{
String superTypeName = DictUtils.getDictLabel("sys_process_category", proProjectApply.getApplyType());
List<ProProjectApplyDetail> list = new ArrayList<ProProjectApplyDetail>();
for (ProProjectApplyDetail proProjectApplyDetail : proProjectApplyDetailList)
{
proProjectApplyDetail.setApplyId(id);
proProjectApplyDetail.setSuperTypeKey(proProjectApply.getApplyType());
proProjectApplyDetail.setSuperTypeName(superTypeName);
//资产
BaseAssetsType baseAssetsType = baseAssetsTypeMapper.selectBaseAssetsTypeById(proProjectApplyDetail.getAssetsId());
proProjectApplyDetail.setAssetsName(baseAssetsType.getName());
//资产类型
BaseAssetsType parentAssetsType = baseAssetsTypeMapper.selectBaseAssetsTypeById(baseAssetsType.getParentId());
proProjectApplyDetail.setTypeId(parentAssetsType.getId());
proProjectApplyDetail.setTypeName(parentAssetsType.getName());
proProjectApplyDetail.setIsDel(ShiFouEnum.FOU.getCode());
list.add(proProjectApplyDetail);
}
if (list.size() > 0)

View File

@ -31,7 +31,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="ProProjectApplyDetail" id="ProProjectApplyDetailResult">
<result property="id" column="sub_id" />
<result property="applyId" column="sub_apply_id" />
<result property="superTypeId" column="sub_super_type_id" />
<result property="superTypeKey" column="sub_super_type_key" />
<result property="superTypeName" column="sub_super_type_name" />
<result property="typeId" column="sub_type_id" />
<result property="typeName" column="sub_type_name" />
@ -72,7 +72,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectProProjectApplyById" parameterType="Long" resultMap="ProProjectApplyProProjectApplyDetailResult">
select a.id, a.dept_id, a.proj_id, a.proj_name, a.par_proj_name, a.apply_type, a.apply_status, a.apply_reason, a.apply_files, a.apply_user, a.use_time, a.is_del, a.create_by, a.create_time, a.update_by, a.update_time, a.remark,
b.id as sub_id, b.apply_id as sub_apply_id, b.super_type_id as sub_super_type_id, b.super_type_name as sub_super_type_name, b.type_id as sub_type_id, b.type_name as sub_type_name, b.assets_id as sub_assets_id, b.assets_name as sub_assets_name, b.assets_unit as sub_assets_unit, b.number as sub_number, b.use_time as sub_use_time, b.use_reason as sub_use_reason, b.price as sub_price, b.total_price as sub_total_price, b.is_del as sub_is_del, b.create_by as sub_create_by, b.create_time as sub_create_time, b.update_by as sub_update_by, b.update_time as sub_update_time, b.remark as sub_remark
b.id as sub_id, b.apply_id as sub_apply_id, b.super_type_key as sub_super_type_key, b.super_type_name as sub_super_type_name, b.type_id as sub_type_id, b.type_name as sub_type_name, b.assets_id as sub_assets_id, b.assets_name as sub_assets_name, b.assets_unit as sub_assets_unit, b.number as sub_number, b.use_time as sub_use_time, b.use_reason as sub_use_reason, b.price as sub_price, b.total_price as sub_total_price, b.is_del as sub_is_del, b.create_by as sub_create_by, b.create_time as sub_create_time, b.update_by as sub_update_by, b.update_time as sub_update_time, b.remark as sub_remark
from pro_project_apply a
left join pro_project_apply_detail b on b.apply_id = a.id
where a.id = #{id}
@ -164,9 +164,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<insert id="batchProProjectApplyDetail">
insert into pro_project_apply_detail( id, apply_id, super_type_id, super_type_name, type_id, type_name, assets_id, assets_name, assets_unit, number, use_time, use_reason, price, total_price, is_del, create_by, create_time, update_by, update_time, remark) values
insert into pro_project_apply_detail( id, apply_id, super_type_key, super_type_name, type_id, type_name, assets_id, assets_name, assets_unit, number, use_time, use_reason, price, total_price, is_del, create_by, create_time, update_by, update_time, remark) values
<foreach item="item" index="index" collection="list" separator=",">
( #{item.id}, #{item.applyId}, #{item.superTypeId}, #{item.superTypeName}, #{item.typeId}, #{item.typeName}, #{item.assetsId}, #{item.assetsName}, #{item.assetsUnit}, #{item.number}, #{item.useTime}, #{item.useReason}, #{item.price}, #{item.totalPrice}, #{item.isDel}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime}, #{item.remark})
( #{item.id}, #{item.applyId}, #{item.superTypeKey}, #{item.superTypeName}, #{item.typeId}, #{item.typeName}, #{item.assetsId}, #{item.assetsName}, #{item.assetsUnit}, #{item.number}, #{item.useTime}, #{item.useReason}, #{item.price}, #{item.totalPrice}, #{item.isDel}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime}, #{item.remark})
</foreach>
</insert>
</mapper>

View File

@ -569,17 +569,19 @@ export default {
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.procInsId || this.ids; //
const that = this;
this.$confirm('是否确认删除流程定义编号为"' + ids + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
that.loading = true;
return delDeployment(ids);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
that.getList();
that.$modal.msgSuccess("删除成功");
});
},
/** 导出按钮操作 */

View File

@ -65,9 +65,7 @@
:fileType="['pdf', 'png', 'jpg', 'jpeg', 'doc', 'docx', 'xls', 'xlsx']"
/>
</el-form-item>
<el-divider content-position="left" style="margin-left"
>项目申请明细信息</el-divider
>
<el-divider content-position="left" style="margin-left">申请明细信息</el-divider>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
@ -110,17 +108,13 @@
>
<el-option-group
v-for="group in AssetsTypeOptions"
:key="group.id + ''"
:label="
group.name + ' [' + group.deptId ? '项目自定义' : '系统默认' + '] '
"
:key="group.id"
:label="group.name"
>
<el-option
v-for="item in group.childrenAssetsTypeList"
:key="item.id"
:label="
item.name + ' [' + group.deptId ? '项目自定义' : '系统默认' + '] '
"
:label="item.name"
:value="item.id"
>
</el-option>
@ -144,7 +138,7 @@
filterable
>
<el-option
v-for="(item, index) in unitOptions"
v-for="(item, index) in getUnitOptions(scope.row.assetsId)"
:key="index"
:label="item"
:value="item"
@ -250,7 +244,6 @@ export default {
options: {},
taskTitle: null,
taskOpen: false,
daterangeMarksTime: [],
proProjectApplyDetailList: [],
//
checkedProProjectApplyDetail: [],
@ -273,7 +266,7 @@ export default {
this.projectOptions = response.data;
if (response.data.length > 0) {
this.form.projId = response.data[0].id;
this.form.projName = response.data[0].projName;
this.form.projName = response.data[0].name;
}
}
});
@ -290,7 +283,7 @@ export default {
projectChage(val) {
for (let i = 0; i < this.projectOptions.length; i++) {
if (this.projectOptions[i].id == val) {
this.form.projName = this.projectOptions[i].projName;
this.form.projName = this.projectOptions[i].name;
return false;
}
}
@ -298,12 +291,20 @@ export default {
doCanel() {
this.onOpen = false;
},
reset() {
this.checkedProProjectApplyDetail = [];
this.proProjectApplyDetailList = [];
this.form = {};
},
show(options) {
this.reset();
this.options = options;
this.initMyProject();
//
if (options.category == 1) {
this.showAssetsVersion = true;
} else {
this.showAssetsVersion = false;
}
this.initCategoryAssetsType(options.category);
this.title = options.name;
@ -415,19 +416,23 @@ export default {
x++
) {
if (this.AssetsTypeOptions[i].childrenAssetsTypeList[x].id == val) {
this.unitOptions = this.AssetsTypeOptions[i].childrenAssetsTypeList[x].unit;
if (this.unitOptions.length > 0) {
if (this.getUnitOptions(val) == null) {
this.unitOptions.push({
id: val,
data: this.AssetsTypeOptions[i].childrenAssetsTypeList[x].unit.split(","),
});
}
}
}
}
this.AssetsTypeOptions.forEach((item) => {
item.userinfoList.forEach((u) => {
if (u.phonenumber == val) {
this.form.superviseUserName = u.nickName + " [" + u.jobTypeName + "] ";
}
});
});
},
getUnitOptions(val) {
for (let i = 0; i < this.unitOptions.length; i++) {
if (this.unitOptions[i].id == val) {
return this.unitOptions[i].data;
}
}
return null;
},
},
};