diff --git a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/project/controller/ProjectController.java b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/project/controller/ProjectController.java index 6eaabe8..78c2f94 100644 --- a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/project/controller/ProjectController.java +++ b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/project/controller/ProjectController.java @@ -1,5 +1,6 @@ package org.jeecg.modules.demo.project.controller; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; @@ -12,9 +13,17 @@ import org.jeecg.common.aspect.annotation.AutoLog; import org.jeecg.common.system.base.controller.JeecgController; import org.jeecg.common.system.query.QueryGenerator; import org.jeecg.common.system.query.QueryRuleEnum; +import org.jeecg.modules.demo.departext.entity.DepartExt; +import org.jeecg.modules.demo.departext.service.IDepartExtService; import org.jeecg.modules.demo.project.dto.ProjectShenBaoDto; import org.jeecg.modules.demo.project.entity.Project; import org.jeecg.modules.demo.project.service.IProjectService; +import org.jeecg.modules.demo.userext.entity.UserExt; +import org.jeecg.modules.demo.userext.service.IUserExtService; +import org.jeecg.modules.system.entity.SysDepart; +import org.jeecg.modules.system.entity.SysUser; +import org.jeecg.modules.system.service.ISysDepartService; +import org.jeecg.modules.system.service.ISysUserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import org.springframework.web.servlet.ModelAndView; @@ -39,6 +48,18 @@ public class ProjectController extends JeecgController @Autowired private IProjectService projectService; + @Autowired + private IUserExtService userExtService; + + @Autowired + private ISysUserService iSysUserService; + + @Autowired + private IDepartExtService iDepartExtService; + + @Autowired + private ISysDepartService iSysDepartService; + /** * 分页列表查询 * @@ -70,7 +91,25 @@ public class ProjectController extends JeecgController @ApiOperation(value = "项目表-根据id查询", notes = "项目表-根据id查询") @GetMapping(value = "/getById") public Result getById(Project project,HttpServletRequest req) { - return Result.OK(projectService.getById("1847214041989091329")); + return Result.OK(projectService.getById(project.getId())); + } + + @ApiOperation(value = "获取项目负责人信息", notes = "获取项目负责人信息") + @GetMapping(value = "/getUserInfo") + public Result getUserInfo(Project para,HttpServletRequest req) { + Project project = projectService.getById(para.getId()); + UserExt userExt = userExtService.getOne(new LambdaQueryWrapper().eq(UserExt::getUserId, project.getProjectCharger())); + return Result.OK(userExt); + } + + @ApiOperation(value = "获取申请单位信息", notes = "获取申请单位信息") + @GetMapping(value = "/getDepartInfo") + public Result getDepartInfo(Project para,HttpServletRequest req) { + Project project = projectService.getById(para.getId()); + SysUser sysUser = iSysUserService.getById(project.getProjectCharger()); + SysDepart sysDepart = iSysDepartService.getOne(new LambdaQueryWrapper().eq(SysDepart::getOrgCode, sysUser.getOrgCode())); + DepartExt departExt = iDepartExtService.getOne(new LambdaQueryWrapper().eq(DepartExt::getDepartId, sysDepart.getId())); + return Result.OK(departExt); } /** diff --git a/jeecgboot-vue3/src/views/projectApplication/kejigongguan/xiangmushu/jiBenXinXi.api.ts b/jeecgboot-vue3/src/views/projectApplication/kejigongguan/xiangmushu/JiBenXinXi.api.ts similarity index 95% rename from jeecgboot-vue3/src/views/projectApplication/kejigongguan/xiangmushu/jiBenXinXi.api.ts rename to jeecgboot-vue3/src/views/projectApplication/kejigongguan/xiangmushu/JiBenXinXi.api.ts index e29114a..824208f 100644 --- a/jeecgboot-vue3/src/views/projectApplication/kejigongguan/xiangmushu/jiBenXinXi.api.ts +++ b/jeecgboot-vue3/src/views/projectApplication/kejigongguan/xiangmushu/JiBenXinXi.api.ts @@ -6,8 +6,8 @@ const {createConfirm} = useMessage(); enum Api { list = '/project/project/list', projectInfo = '/project/project/getById', - userInfo = '/project/project/getById', - departInfo = '/project/project/getById', + userInfo = '/project/project/getUserInfo', + departInfo = '/project/project/getDepartInfo', save = '/project/project/add', shenbao = '/project/project/save4shenbao', edit = '/project/project/edit', diff --git a/jeecgboot-vue3/src/views/projectApplication/kejigongguan/xiangmushu/jiBenXinXi.ts b/jeecgboot-vue3/src/views/projectApplication/kejigongguan/xiangmushu/JiBenXinXi.ts similarity index 100% rename from jeecgboot-vue3/src/views/projectApplication/kejigongguan/xiangmushu/jiBenXinXi.ts rename to jeecgboot-vue3/src/views/projectApplication/kejigongguan/xiangmushu/JiBenXinXi.ts diff --git a/jeecgboot-vue3/src/views/projectApplication/kejigongguan/xiangmushu/JiBenXinXiDemo.vue b/jeecgboot-vue3/src/views/projectApplication/kejigongguan/xiangmushu/JiBenXinXiDemo.vue index d067d06..9472115 100644 --- a/jeecgboot-vue3/src/views/projectApplication/kejigongguan/xiangmushu/JiBenXinXiDemo.vue +++ b/jeecgboot-vue3/src/views/projectApplication/kejigongguan/xiangmushu/JiBenXinXiDemo.vue @@ -20,17 +20,20 @@ import { BasicForm, useForm } from '@/components/Form'; import {defineComponent, ref} from 'vue'; import { PageWrapper } from '@/components/Page'; -import { projectBaseInfoSchemas, userSchemas, departSchemas } from './jiBenXinXi'; +import { projectBaseInfoSchemas, userSchemas, departSchemas } from './JiBenXinXi'; import { Card } from 'ant-design-vue'; import {defHttp} from "@/utils/http/axios"; -import {save4shenbao,getProjectById,getUserByProjectId,getDepartByProjectId} from './jiBenXinXi.api'; -import { useRouter } from 'vue-router'; - +import {save4shenbao,getProjectById,getUserByProjectId,getDepartByProjectId} from './JiBenXinXi.api'; +import {useRoute, useRouter} from 'vue-router'; export default defineComponent({ name: 'FormHightPage', components: { BasicForm, PageWrapper, [Card.name]: Card }, setup() { - const { currentRoute, back } = useRouter(); + const route = useRoute(); + const {back } = useRouter(); + let params = { + id: route.query.id, + } const [registerProjectInfo, { validate: validateProjectInfoForm ,setFieldsValue}] = useForm({ baseColProps: { span: 6, @@ -41,14 +44,14 @@ export default defineComponent({ showActionButtonGroup: false, }); const uploadValue = async() => { - const baseInfoObj = await getProjectById(); - console.log('baseInfoObj',JSON.stringify(baseInfoObj)) - await setFieldsValue(baseInfoObj) + const projectObj = await getProjectById(params); + console.log('projectObj',JSON.stringify(projectObj)) + await setFieldsValue(projectObj) } setTimeout(()=>{ uploadValue() - },0) + const [registerUser, formMethods] = useForm({ baseColProps: { span: 6, @@ -60,16 +63,16 @@ export default defineComponent({ }); const setFieldValues = formMethods.setFieldsValue; const uploadValue2 = async() => { - console.log( formMethods.setFieldsValue,' formMethods.setFieldsValue') - const userInfoObj = await getUserByProjectId(); + // console.log( formMethods.setFieldsValue,' formMethods.setFieldsValue') + const userInfoObj = await getUserByProjectId(params); console.log('userInfoObj',JSON.stringify(userInfoObj)) // await setFieldValues({currentPerfession:1}) - await setFieldValues({userInfoObj}) + await setFieldValues(userInfoObj) } setTimeout(()=>{ uploadValue2() - },200) + const [registerDepart, formMethods2] = useForm({ baseColProps: { span: 6, @@ -81,11 +84,11 @@ export default defineComponent({ }); const setFieldValues2 = formMethods2.setFieldsValue; const uploadValue3 = async() => { - console.log( formMethods2.setFieldsValue,' formMethods.setFieldsValue') - const departInfoObj = await getDepartByProjectId(); + // console.log( formMethods2.setFieldsValue,' formMethods.setFieldsValue') + const departInfoObj = await getDepartByProjectId(params); console.log('departInfoObj',JSON.stringify(departInfoObj)) // await setFieldValues2({bankNo:1,category:'2'}) - await setFieldValues2({departInfoObj}) + await setFieldValues2(departInfoObj) } setTimeout(()=>{ uploadValue3()