项目书-基本信息 功能添加 10.24

master
zhc077 4 weeks ago
parent 7ea02816b7
commit be89c3458c
  1. 8
      jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/project/controller/ProjectController.java
  2. 4
      jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/project/dto/ProjectShenBaoDto.java
  3. 2
      jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/project/service/IProjectService.java
  4. 34
      jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/project/service/impl/ProjectServiceImpl.java
  5. 16
      jeecgboot-vue3/src/views/projectApplication/kejigongguan/xiangmushu/JiBenXinXi.api.ts
  6. 8
      jeecgboot-vue3/src/views/projectApplication/kejigongguan/xiangmushu/JiBenXinXiDemo.vue

@ -141,6 +141,14 @@ public class ProjectController extends JeecgController<Project, IProjectService>
return Result.OK("添加成功!");
}
@AutoLog(value = "新增项目审报")
@ApiOperation(value = "新增项目审报", notes = "新增项目审报")
@PostMapping(value = "/update4shenbao")
public Result<String> update4shenbao(@RequestBody ProjectShenBaoDto dto) {
projectService.update4shenbao(dto);
return Result.OK("添加成功!");
}
/**
* 编辑
*

@ -31,8 +31,8 @@ public class ProjectShenBaoDto implements Serializable {
* 主键
*/
// @TableId(type = IdType.ASSIGN_ID)
// @ApiModelProperty(value = "主键")
// private String id;
@ApiModelProperty(value = "主键")
private String id;
/**
* 创建人
*/

@ -13,4 +13,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
public interface IProjectService extends IService<Project> {
void save4shenbao(ProjectShenBaoDto dto);
void update4shenbao(ProjectShenBaoDto dto);
}

@ -1,6 +1,7 @@
package org.jeecg.modules.demo.project.service.impl;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.SecurityUtils;
@ -80,4 +81,37 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
departExt.setProjectId(project.getId());
this.iDepartExtService.save(departExt);
}
@Override
public void update4shenbao(ProjectShenBaoDto dto) {
log.info(">>> the 修改项目书-文 reqParams:{}", JSON.toJSONString(dto));
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
iUserExtService.remove(new LambdaQueryWrapper<UserExt>().eq(UserExt::getProjectId,dto.getId()));
iDepartExtService.remove(new LambdaQueryWrapper<DepartExt>().eq(DepartExt::getProjectId,dto.getId()));
// SysDepart sysDepart = new SysDepart();
DepartExt departExt = new DepartExt();
// SysUser sysUser = new SysUser();
UserExt userExt = new UserExt();
Project project = new Project();
BeanUtils.copyProperties(dto, departExt);
// BeanUtils.copyProperties(dto, sysDepart);
// BeanUtils.copyProperties(dto, sysUser);
BeanUtils.copyProperties(dto, userExt);
BeanUtils.copyProperties(dto, project);
project.setSysOrgCode(loginUser.getOrgId());
//负责人
// project.setProjectCharger(loginUser.getId());
this.updateById(project);
userExt.setUserId(loginUser.getId());
userExt.setProjectId(project.getId());
this.iUserExtService.save(userExt);
departExt.setDepartId(loginUser.getOrgId());
departExt.setProjectId(project.getId());
this.iDepartExtService.save(departExt);
}
}

@ -9,7 +9,8 @@ enum Api {
userInfo = '/project/project/getUserInfo',
departInfo = '/project/project/getDepartInfo',
save = '/project/project/add',
shenbao = '/project/project/save4shenbao',
saveshenbao = '/project/project/save4shenbao',
updateshenbao = '/project/project/update4shenbao',
edit = '/project/project/edit',
deleteOne = '/project/project/delete',
deleteBatch = '/project/project/deleteBatch',
@ -82,9 +83,18 @@ export const saveOrUpdate = (params, isUpdate) => {
}
/**
* 保存或者更新
* 保存
* @param params
*/
export const save4shenbao = (params) => {
return defHttp.post({url: Api.shenbao, params});
return defHttp.post({url: Api.saveshenbao, params});
};
/**
* 更新
* @param params
*/
export const update4shenbao = (params) => {
return defHttp.post({url: Api.updateshenbao, params});
};

@ -23,7 +23,7 @@ import { PageWrapper } from '@/components/Page';
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 {save4shenbao,update4shenbao,getProjectById,getUserByProjectId,getDepartByProjectId} from './JiBenXinXi.api';
import {useRoute, useRouter} from 'vue-router';
export default defineComponent({
name: 'FormHightPage',
@ -97,10 +97,10 @@ export default defineComponent({
try {
Promise.all([validateProjectInfoForm(), formMethods.validate(), formMethods2.validate()]).then(function (results) {
const params = {...results[0], ...results[1], ...results[2]}
console.log('results', JSON.stringify(params));
save4shenbao(params);
params.id = route.query.id;
console.log('the update4shenbao req params:', JSON.stringify(params));
update4shenbao(params);
back();
// go_projectList;
});
} catch (error) {}
};

Loading…
Cancel
Save