Merge remote-tracking branch 'origin/master'

master
王家东 4 weeks ago
commit a00e380d83
  1. 34
      jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/project/controller/ProjectController.java
  2. 8
      jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/project/entity/Project.java
  3. 6
      jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/project/service/impl/ProjectServiceImpl.java
  4. 26
      jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/projectType/controller/ProjectTypeController.java
  5. 2
      jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/projectType/entity/ProjectType.java
  6. 21
      jeecgboot-vue3/src/views/projectApplication/kejigongguan/data.ts
  7. 41
      jeecgboot-vue3/src/views/projectApplication/kejigongguan/xiangmushu/JiBenXinXi.ts
  8. 5
      jeecgboot-vue3/src/views/projectApplication/project/Project.api.ts
  9. 44
      jeecgboot-vue3/src/views/projectApplication/project/ProjectList.vue

@ -7,20 +7,21 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.exception.JeecgBootException;
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.common.system.vo.LoginUser;
import org.jeecg.modules.demo.departext.entity.DepartExt;
import org.jeecg.modules.demo.departext.service.IDepartExtService;
import org.jeecg.modules.demo.project.dto.DepartExtDto;
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.projectType.entity.ProjectType;
import org.jeecg.modules.demo.projectType.service.IProjectTypeService;
import org.jeecg.modules.demo.userext.entity.UserExt;
import org.jeecg.modules.demo.userext.service.IUserExtService;
import org.jeecg.modules.system.entity.SysDepart;
@ -64,6 +65,9 @@ public class ProjectController extends JeecgController<Project, IProjectService>
@Autowired
private ISysDepartService iSysDepartService;
@Autowired
private IProjectTypeService iProjectTypeService;
/**
* 分页列表查询
*
@ -94,13 +98,19 @@ public class ProjectController extends JeecgController<Project, IProjectService>
@ApiOperation(value = "项目表-根据id查询", notes = "项目表-根据id查询")
@GetMapping(value = "/getById")
public Result<Project> getById(Project project,HttpServletRequest req) {
return Result.OK(projectService.getById(project.getId()));
public Result<Project> getById(Project param, HttpServletRequest req) {
Project project = projectService.getById(param.getId());
ProjectType projectType = iProjectTypeService.getById(project.getProjectTypeid());
project.setAnnualName(projectType.getAnnualName());
project.setProjectTypeName(projectType.getTypeName());
project.setAnnualName(projectType.getAnnualName());
project.setProjectTypeName(projectType.getTypeName());
return Result.OK(project);
}
@ApiOperation(value = "获取项目负责人信息", notes = "获取项目负责人信息")
@GetMapping(value = "/getUserInfo")
public Result<UserExt> getUserInfo(Project para,HttpServletRequest req) {
public Result<UserExt> getUserInfo(Project para, HttpServletRequest req) {
// LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
Project project = projectService.getById(para.getId());
SysUser sysUser = iSysUserService.getById(project.getProjectCharger());
@ -115,7 +125,7 @@ public class ProjectController extends JeecgController<Project, IProjectService>
@ApiOperation(value = "获取申请单位信息", notes = "获取申请单位信息")
@GetMapping(value = "/getDepartInfo")
public Result<DepartExtDto> getDepartInfo(Project para,HttpServletRequest req) {
public Result<DepartExtDto> getDepartInfo(Project para, HttpServletRequest req) {
Project project = projectService.getById(para.getId());
SysUser sysUser = iSysUserService.getById(project.getProjectCharger());
SysDepart sysDepart = iSysDepartService.getOne(new LambdaQueryWrapper<SysDepart>().eq(SysDepart::getOrgCode, sysUser.getOrgCode()));
@ -124,8 +134,8 @@ public class ProjectController extends JeecgController<Project, IProjectService>
.eq(DepartExt::getProjectId, para.getId())
);
DepartExtDto dto = new DepartExtDto();
BeanUtils.copyProperties(sysDepart,dto);
BeanUtils.copyProperties(departExt,dto);
BeanUtils.copyProperties(sysDepart, dto);
BeanUtils.copyProperties(departExt, dto);
return Result.OK(dto);
}
@ -148,6 +158,10 @@ public class ProjectController extends JeecgController<Project, IProjectService>
@ApiOperation(value = "新增项目审报", notes = "新增项目审报")
@PostMapping(value = "/save4shenbao")
public Result<String> save4shenbao(@RequestBody ProjectShenBaoDto dto) {
long count = projectService.count(new LambdaQueryWrapper<Project>().eq(Project::getProjectTypeid, dto.getProjectTypeid()));
if (count > 0) {
throw new JeecgBootException("该项目类型,当年已填报,不能重复填报!");
}
projectService.save4shenbao(dto);
return Result.OK("添加成功!");
}
@ -187,8 +201,8 @@ public class ProjectController extends JeecgController<Project, IProjectService>
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
projectService.removeById(id);
iUserExtService.remove(new LambdaQueryWrapper<UserExt>().eq(UserExt::getProjectId,id));
iDepartExtService.remove(new LambdaQueryWrapper<DepartExt>().eq(DepartExt::getProjectId,id));
iUserExtService.remove(new LambdaQueryWrapper<UserExt>().eq(UserExt::getProjectId, id));
iDepartExtService.remove(new LambdaQueryWrapper<DepartExt>().eq(DepartExt::getProjectId, id));
return Result.OK("删除成功!");
}

@ -1,6 +1,7 @@
package org.jeecg.modules.demo.project.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
@ -234,6 +235,13 @@ public class Project implements Serializable {
@ApiModelProperty(value = "项目类别表id")
@Dict(dictTable = "project_type",dicCode = "id",dicText = "type_name")
private String projectTypeid;
@TableField(exist = false)
private String projectTypeName;
@TableField(exist = false)
private String annualName;
/**
* 批次
*/

@ -1,6 +1,7 @@
package org.jeecg.modules.demo.project.service.impl;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
@ -72,6 +73,10 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
project.setProjectStatus("5");
// 预算书不存在
project.setBudgetStatus("10");
// ProjectType projectType = iProjectTypeService.getById(project.getProjectTypeid());
// project.setAnnualName(projectType.getAnnualName());
// project.setProjectTypeName(projectType.getTypeName());
this.save(project);
userExt.setUserId(loginUser.getId());
userExt.setProjectId(project.getId());
@ -80,7 +85,6 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
departExt.setProjectId(project.getId());
this.iDepartExtService.save(departExt);
sysDepart.setId(loginUser.getOrgId());
updateDepart4ShenBao(sysDepart);
}

@ -1,17 +1,21 @@
package org.jeecg.modules.demo.projectType.controller;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
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;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecg.common.api.vo.Result;
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.modules.demo.annual.entity.Annual;
import org.jeecg.modules.demo.annual.service.IAnnualService;
import org.jeecg.modules.demo.projectType.entity.ProjectType;
import org.jeecg.modules.demo.projectType.service.IProjectTypeService;
import org.springframework.beans.factory.annotation.Autowired;
@ -21,6 +25,7 @@ import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
import java.util.List;
/**
* @Description: 项目类型
@ -36,6 +41,9 @@ public class ProjectTypeController extends JeecgController<ProjectType, IProject
@Autowired
private IProjectTypeService projectTypeService;
@Autowired
private IAnnualService iAnnualService;
/**
* 分页列表查询
*
@ -70,6 +78,10 @@ public class ProjectTypeController extends JeecgController<ProjectType, IProject
@PostMapping(value = "/add")
public Result<String> add(@RequestBody ProjectType projectType) {
projectType.setStatus(projectType.getStatus_dictText());
if (StrUtil.isNotBlank(projectType.getAnnualId())) {
Annual annual = iAnnualService.getById(projectType.getAnnualId());
projectType.setAnnualName(annual.getAnnualName());
}
projectTypeService.save(projectType);
return Result.OK("添加成功!");
}
@ -86,9 +98,13 @@ public class ProjectTypeController extends JeecgController<ProjectType, IProject
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<String> edit(@RequestBody ProjectType projectType) {
projectType.setStatus(projectType.getStatus_dictText());
if(projectType.getStatus().equals("0")){
if (projectType.getStatus().equals("0")) {
projectType.setAnnualId("");
}
if (StrUtil.isNotBlank(projectType.getAnnualId())) {
Annual annual = iAnnualService.getById(projectType.getAnnualId());
projectType.setAnnualName(annual.getAnnualName());
}
projectTypeService.updateById(projectType);
return Result.OK("编辑成功!");
}
@ -148,6 +164,12 @@ public class ProjectTypeController extends JeecgController<ProjectType, IProject
return Result.OK(projectType);
}
@GetMapping(value = "/getProjectTypeList")
public Result<List<ProjectType>> getProjectTypeList() {
List<ProjectType> list = projectTypeService.list(new LambdaQueryWrapper<ProjectType>().eq(ProjectType::getStatus, "1"));
return Result.OK(list);
}
/**
* 导出excel
*

@ -97,6 +97,8 @@ public class ProjectType implements Serializable {
@ApiModelProperty(value = "年度id")
private String annualId;
private String annualName;
@TableField(exist = false)
private String status_dictText;
}

@ -6,7 +6,12 @@ export const projectBaseInfoSchemas: FormSchema[] = [
{
label: '项目类别',
field: 'projectTypeid',
component: 'Input',
// component: 'Input',
component: 'JDictSelectTag',
componentProps: {
dictCode: 'project_type,type_name,id',
// stringToNumber: true,
},
dynamicDisabled: true,
// defaultValue: '',
defaultValue: '1846744340708184065',
@ -158,9 +163,9 @@ export const departSchemas: FormSchema[] = [
field: 'orgName',
component: 'Input',
label: '单位名称',
required: true,
// required: true,
defaultValue: useUserStore().getUserInfo?.orgCode,
dynamicDisabled: true,
// dynamicDisabled: true,
},
{
field: 'category',
@ -198,16 +203,6 @@ export const departSchemas: FormSchema[] = [
// },
// width: 200,
},
// {
// field: 'date',
// label: '2',
// component: 'DatePicker',
// editComponentProps: {
// valueFormat: 'YYYY-MM-DD',
// format: 'YYYY-MM-DD',
// },
// width: 200,
// },
{
field: 'departNameAbbr',
component: 'Input',

@ -5,10 +5,10 @@ import { useUserStore } from '/@/store/modules/user';
export const projectBaseInfoSchemas: FormSchema[] = [
{
label: '项目类别',
field: 'projectTypeid',
field: 'projectTypeName',
component: 'Input',
dynamicDisabled: true,
defaultValue: '科技攻关',
// defaultValue: '',
// defaultValue: '1846744340708184065',
},
/*{
@ -16,12 +16,19 @@ export const projectBaseInfoSchemas: FormSchema[] = [
field: 'projectTypeid',
component: 'Input',
},*/
{
/*{
field: 'annualId',
component: 'Input',
label: '计划年度',
dynamicDisabled: true,
defaultValue: '2025',
},*/
{
field: 'annualName',
component: 'Input',
label: '年度',
dynamicDisabled: true,
// defaultValue: '2025',
},
{
field: 'batchNo',
@ -258,17 +265,35 @@ export const projectBaseInfoSchemas: FormSchema[] = [
{
label: '申请专利数',
field: 'applyPatentNumber',
component: 'Input',
component: 'InputNumber',
dynamicRules: ({model,schema}) => {
return [
{ required: false},
{ pattern: /^(([1-9][0-9]*))$/, message: '请输入正确的人数!'},
];
},
},
{
label: '发明专利数',
field: 'invevtionPatentNumber',
component: 'Input',
component: 'InputNumber',
dynamicRules: ({model,schema}) => {
return [
{ required: false},
{ pattern: /^(([1-9][0-9]*))$/, message: '请输入正确的人数!'},
];
},
},
{
label: '授权专利数',
field: 'creditPatentNumber',
component: 'Input',
component: 'InputNumber',
dynamicRules: ({model,schema}) => {
return [
{ required: false},
{ pattern: /^(([1-9][0-9]*))$/, message: '请输入正确的人数!'},
];
},
},
];
@ -379,9 +404,9 @@ export const departSchemas: FormSchema[] = [
field: 'orgName',
component: 'Input',
label: '单位名称',
required: true,
// required: true,
defaultValue: useUserStore().getUserInfo?.orgCode,
dynamicDisabled: true,
// dynamicDisabled: true,
},
{
field: 'category',

@ -5,6 +5,7 @@ const {createConfirm} = useMessage();
enum Api {
list = '/project/project/list',
projectType = '/projectType/getProjectTypeList',
save = '/project/project/add',
edit = '/project/project/edit',
deleteOne = '/project/project/delete',
@ -29,6 +30,10 @@ export const getImportUrl = Api.importExcel;
export const list = (params) =>
defHttp.get({url: Api.list, params});
export const getProjectTypeList = (params) =>
defHttp.get({url: Api.projectType, params});
/**
* 删除单个
*/

@ -4,7 +4,7 @@
<BasicTable @register="registerTable" :rowSelection="rowSelection">
<!--插槽:table标题-->
<template #tableTitle>
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
<!-- <a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>-->
<!-- <a-button type="primary" @click="go_xinjianshenbao" preIcon="ant-design:plus-outlined"> 新建审报书</a-button>-->
<a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
<!-- <j-upload-button type="primary" v-auth="'project:project:importExcel'" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>-->
@ -15,6 +15,9 @@
<Icon icon="ant-design:plus-outlined"></Icon>
科技攻关
</a-menu-item>
<!-- <a-menu-item v-for="opt of RANGE_OPTIONS" :key="opt.key">
{{ opt.label }}
</a-menu-item>-->
<!--<a-menu-item key="1" @click="go_xinjianshenbao">
<Icon icon="ant-design:plus-outlined"></Icon>
xxx
@ -48,12 +51,20 @@ import {useModal} from '/@/components/Modal';
import { useListPage } from '/@/hooks/system/useListPage'
import ProjectModal from './components/ProjectModal.vue'
import {columns, searchFormSchema, superQuerySchema} from './Project.data';
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './Project.api';
import {
list,
deleteOne,
batchDelete,
getImportUrl,
getExportUrl,
getProjectTypeList
} from './Project.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import { useGo } from '/@/hooks/web/usePage';
import { useUserStore } from '/@/store/modules/user';
import {getUserData} from "@/views/system/usersetting/UserSetting.api";
import {useTimeoutFn} from "@/hooks/core/useTimeout";
const go = useGo();
const queryParam = reactive<any>({});
@ -97,11 +108,34 @@ const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({
},
})
//
//
const RANGE_OPTIONS = [
{key: 'TODAY', label: '今天'},
{key: 'YESTERDAY', label: '昨天'},
{key: 'TOMORROW', label: '明天'},
{key: 'THIS_WEEK', label: '本周'},
{key: 'LAST_WEEK', label: '上周'},
{key: 'NEXT_WEEK', label: '下周'},
{key: 'LAST_7_DAYS', label: '过去七天'},
{key: 'THIS_MONTH', label: '本月'},
{key: 'LAST_MONTH', label: '上月'},
{key: 'NEXT_MONTH', label: '下月'},
];
const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext
//
const superQueryConfig = reactive(superQuerySchema);
// onMounted(() => {
// let typeList = getProjectTypeList();
// console.log('typeList',typeList)
// RANGE_OPTIONS = typeList;
// });
/**
* 高级查询事件
*/
@ -124,7 +158,7 @@ function handleAdd() {
//
function go_xinjianshenbao() {
// go('/comp/jeecg/basic');
go('/projectApplication/index');
go('/projectApplication/index?projectTypeId='+'1846744340708184065');
}
//
@ -207,12 +241,12 @@ function getTableAction(record){
// auth: 'projecttype:project_type:delete'
}];
//
if (record.projectStatus == 5) {
/*if (record.projectStatus == 5) {
actions.unshift({
label: '编辑',
onClick: handleEdit.bind(null, record),
});
}
}*/
return actions;
}
/**

Loading…
Cancel
Save