Compare commits

..

2 Commits

  1. 2
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualCompPoint/controller/AnnualCompPointController.java
  2. 10
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualCompPoint/service/impl/AnnualCompPointServiceImpl.java
  3. 17
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcompaward/controller/AnnualCompAwardController.java
  4. 76
      jeecg-boot-master/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysUserController.java
  5. 7
      jeecg-boot-master/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/ISysUserService.java
  6. 25
      jeecg-boot-master/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysUserServiceImpl.java
  7. 2
      jeecgboot-vue3-master/src/views/annualCompPoint/department/AnnualCompPoint.data.ts
  8. 4
      jeecgboot-vue3-master/src/views/annualCompPoint/department/AnnualCompPointList.vue
  9. 4
      jeecgboot-vue3-master/src/views/annualCompPoint/department/components/AnnualCompPointForm.vue
  10. 4
      jeecgboot-vue3-master/src/views/annualcomp/school/AnnualComp.data.ts
  11. 4
      jeecgboot-vue3-master/src/views/annualcomp/uncommitted/AnnualCompList.vue
  12. 16
      jeecgboot-vue3-master/src/views/annualcompaward/AnnualCompAwardList.vue
  13. 14
      jeecgboot-vue3-master/src/views/system/userZJ/user.data.ts
  14. 4
      jeecgboot-vue3-master/src/views/system/userdep/userYX.api.ts

@ -856,7 +856,7 @@ public class AnnualCompPointController extends JeecgController<AnnualCompPoint,
* @param request
* @param annualCompPoint
*/
@RequiresPermissions("annualCompPoint:annual_comp_point:exportXls")
/* @RequiresPermissions("annualCompPoint:annual_comp_point:exportXls")*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, AnnualCompPoint annualCompPoint) {
return super.exportXls(request, annualCompPoint, AnnualCompPoint.class, "年度比赛项目管理");

@ -11,6 +11,8 @@ import org.jeecg.modules.demo.annualCompPoint.mapper.AnnualCompPointMapper;
import org.jeecg.modules.demo.annualCompPoint.service.IAnnualCompPointService;
import org.jeecg.modules.demo.annualcomp.entity.AnnualComp;
import org.jeecg.modules.demo.annualcomp.service.impl.AnnualCompServiceImpl;
import org.jeecg.modules.demo.annualcompaward.entity.AnnualCompAward;
import org.jeecg.modules.demo.annualcompaward.mapper.AnnualCompAwardMapper;
import org.jeecg.modules.demo.objLevel.entity.ObjLevel;
import org.jeecg.modules.demo.objLevel.service.impl.ObjLevelServiceImpl;
import org.jeecg.modules.demo.projectlevel.entity.Projectlevel;
@ -45,6 +47,9 @@ public class AnnualCompPointServiceImpl extends ServiceImpl<AnnualCompPointMappe
@Autowired
private AnnualCompPointMapper annualCompPointMapper;
//奖项
@Autowired
private AnnualCompAwardMapper annualCompAwardMapper;
/**
* 年度比赛项目 添加
@ -238,9 +243,14 @@ public class AnnualCompPointServiceImpl extends ServiceImpl<AnnualCompPointMappe
annualCompPoint.setScoreEndTime(null);
}
// 项目开关默认开启
annualCompPoint.setAnnualCompSwitch("Y");
this.save(annualCompPoint);
//比赛奖项设置
AnnualCompAward annualCompAward=new AnnualCompAward();
annualCompAward.setAnnucompid(annualCompPoint.getId());
annualCompAwardMapper.insert(annualCompAward);
return Result.OK("新增成功");
}

@ -82,29 +82,38 @@ public class AnnualCompAwardController extends JeecgController<AnnualCompAward,
// 获取当前登录用户
LoginUser loginUser = (LoginUser) subject.getPrincipal();
List<SysRole> roleList = iSysUserRoleService.getUserRoleByUserId(loginUser.getId());
Map<String, String> roleMap = Optional.ofNullable(roleList).orElse(new LinkedList<>()).stream().collect(Collectors.toMap(SysRole::getRoleCode, SysRole::getRoleCode));
// Map<String, String> roleMap = Optional.ofNullable(roleList).orElse(new LinkedList<>()).stream().collect(Collectors.toMap(SysRole::getRoleCode, SysRole::getRoleCode));
//角色编码 管理员&组委会&教务处 可以看到所有,其它用户可见到所属自己数据
Map<String, String> efficientRoleMap = new LinkedHashMap<>();
efficientRoleMap.put("admin", "admin");
efficientRoleMap.put("committee", "committee");
efficientRoleMap.put("superAdmin", "superAdmin");
boolean containsEfficientRole = roleList.stream()
.map(SysRole::getRoleCode)
.anyMatch(efficientRoleMap::containsKey);
LambdaQueryWrapper<AnnualCompAward> queryWrapper = new LambdaQueryWrapper<>();
Page<AnnualCompAward> page = new Page<AnnualCompAward>(pageNo, pageSize);
// 查询所属当前登录用户数据
if (!efficientRoleMap.containsValue(roleMap.get("admin"))
&& !efficientRoleMap.containsValue(roleMap.get("committee"))
&& !efficientRoleMap.containsValue(roleMap.get("superAdmin"))) {
if (containsEfficientRole)
{
//根据比赛管理员查询 对应必比赛
List<Comp> compList = iCompService.list(new LambdaQueryWrapper<Comp>().eq(Comp::getCompAdmin, loginUser.getUsername()));
if (ObjectUtils.isEmpty(compList)) {
return Result.OK(page);
}
//获取比赛ID
Set<String> compIds = compList.stream().map(c -> c.getId()).collect(Collectors.toSet());
//根据比赛ID查询年度必死啊
List<AnnualComp> annualCompList = annualCompService.list(new LambdaQueryWrapper<AnnualComp>().in(AnnualComp::getCompid, compIds));
if (!ObjectUtils.isEmpty(annualCompList)) {
//得到年度比赛ID
Set<String> annualCompIds = annualCompList.stream().map(d -> d.getId()).collect(Collectors.toSet());
//根据年度比赛ID查询年度比赛项目
List<AnnualCompPoint> annualCompPointList = annualCompPointService.list(new LambdaQueryWrapper<AnnualCompPoint>().in(AnnualCompPoint::getAnnualCompId, annualCompIds));
if (!ObjectUtils.isEmpty(annualCompPointList)) {
//根据年度比赛ID查询奖项ID
Set<String> annualCompPointIds = annualCompPointList.stream().map(e -> e.getId()).collect(Collectors.toSet());
queryWrapper.in(AnnualCompAward::getAnnucompid, annualCompPointIds);
}

@ -256,6 +256,41 @@ public class SysUserController {
return result;
}
@RequestMapping(value = "/adddep", method = RequestMethod.POST)
public Result<SysUser> adddep(@RequestBody JSONObject jsonObject) {
Result<SysUser> result = new Result<SysUser>();
String selectedRoles = jsonObject.getString("selectedroles");
String selectedDeparts = jsonObject.getString("selecteddeparts");
try {
boolean rs=sysUserService.isDepCode(selectedDeparts);
if(!rs)
{
result.error500("不能添加非院系用户");
return result;
}
SysUser user = JSON.parseObject(jsonObject.toJSONString(), SysUser.class);
user.setCreateTime(new Date());//设置创建时间
String salt = oConvertUtils.randomGen(8);
user.setSalt(salt);
String passwordEncode = PasswordUtil.encrypt(user.getUsername(), user.getPassword(), salt);
user.setPassword(passwordEncode);
user.setStatus(1);
user.setDelFlag(CommonConstant.DEL_FLAG_0);
//用户表字段org_code不能在这里设置他的值
user.setOrgCode(null);
// 保存用户走一个service 保证事务
//获取租户ids
String relTenantIds = jsonObject.getString("relTenantIds");
sysUserService.saveUser(user, selectedRoles, selectedDeparts, relTenantIds);
baseCommonService.addLog("添加用户,username: " +user.getUsername() ,CommonConstant.LOG_TYPE_2, 2);
result.success("添加成功!");
} catch (Exception e) {
log.error(e.getMessage(), e);
result.error500("操作失败");
}
return result;
}
//@RequiresPermissions("system:user:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<SysUser> edit(@RequestBody JSONObject jsonObject) {
@ -291,6 +326,47 @@ public class SysUserController {
return result;
}
//@RequiresPermissions("system:user:edit")
@RequestMapping(value = "/editdep", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<SysUser> editdep(@RequestBody JSONObject jsonObject) {
Result<SysUser> result = new Result<SysUser>();
try {
SysUser sysUser = sysUserService.getById(jsonObject.getString("id"));
baseCommonService.addLog("编辑用户,username: " +sysUser.getUsername() ,CommonConstant.LOG_TYPE_2, 2);
if(sysUser==null) {
result.error500("未找到对应实体");
}else {
SysUser user = JSON.parseObject(jsonObject.toJSONString(), SysUser.class);
user.setUpdateTime(new Date());
//String passwordEncode = PasswordUtil.encrypt(user.getUsername(), user.getPassword(), sysUser.getSalt());
user.setPassword(sysUser.getPassword());
String roles = jsonObject.getString("selectedroles");
String departs = jsonObject.getString("selecteddeparts");
boolean rs=sysUserService.isDepCode(departs);
if(!rs)
{
result.error500("不能添加非院系用户");
return result;
}
if(oConvertUtils.isEmpty(departs)){
//vue3.0前端只传递了departIds
departs=user.getDepartIds();
}
//用户表字段org_code不能在这里设置他的值
user.setOrgCode(null);
// 修改用户走一个service 保证事务
//获取租户ids
String relTenantIds = jsonObject.getString("relTenantIds");
sysUserService.editUser(user, roles, departs, relTenantIds);
result.success("修改成功!");
}
} catch (Exception e) {
log.error(e.getMessage(), e);
result.error500("操作失败");
}
return result;
}
/**
* 删除用户
*/

@ -413,5 +413,12 @@ public interface ISysUserService extends IService<SysUser> {
*/
Result<IPage<SysUser>> queryPageListYx(HttpServletRequest req, QueryWrapper<SysUser> queryWrapper, Integer pageSize, Integer pageNo);
/**
* 不能添加非院系用户
* @param selectedDeparts
* @return
*/
boolean isDepCode(String selectedDeparts);
// void getById();
}

@ -1351,6 +1351,31 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
return result;
}
/**
* 不能添加非院系用户
* @param selectedDeparts
* @return
*/
@Override
public boolean isDepCode(String selectedDeparts) {
boolean result=true;
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
String code=loginUser.getOrgCode();
//step.3 保存所属部门
if(oConvertUtils.isNotEmpty(selectedDeparts)) {
String[] arr = selectedDeparts.split(",");
for (String deaprtId : arr) {
SysDepart item=sysDepartMapper.selectById(deaprtId);
if(!item.getOrgCode().startsWith(code))
{
result=false;
break;
}
}
}
return result;
}
/**
* 修改租户下的部门
* @param departs

@ -127,7 +127,7 @@ export const formSchema: FormSchema[] = [
fieldConfig: [
{source: 'name', target: 'annualCompId'},
],
multi: true
multi: false
}
},

@ -16,9 +16,9 @@
</a-button>
<a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出
</a-button>
<j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls">
<!-- <j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls">
导入
</j-upload-button>
</j-upload-button>-->
<a-dropdown v-if="selectedRowKeys.length > 0">
<template #overlay>
<a-menu>

@ -13,7 +13,7 @@
{ source: 'name', target: 'annualCompId_dictText' },
{ source: 'id', target: 'annualCompId' },
]"
:multi="true"
:multi="false"
:setFieldsValue="setFieldsValue"
:disabled="disabled"/>
</a-form-item>
@ -41,7 +41,7 @@
</a-col>
<a-col :span="12">
<a-form-item label="项目层次" v-bind="validateInfos.objLevel" :labelCol="labelCol" :wrapperCol="wrapperCol7">
<j-dict-select-tag type="radio" v-model:value="formData.objLevel" placeholder="请选择项目层次" dict-code="obj_lever" />
<j-dict-select-tag type="radio" v-model:value="formData.objLevel" placeholder="请选择项目层次" dictCode="projectlevel,name,id" />
</a-form-item>
</a-col>
</a-row>

@ -32,7 +32,7 @@ export const columns: BasicColumn[] = [
];
//查询数据
export const searchFormSchema: FormSchema[] = [
{
/* {
label: '比赛名称',
field: 'compid',
component: 'JPopup',
@ -47,7 +47,7 @@ export const searchFormSchema: FormSchema[] = [
},
colProps: { span: 6 },
},
},*/
{
label: '年度名称',
field: 'annualid',

@ -7,7 +7,7 @@
<a-button type="primary" @click="handleAdd" 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" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
<a-dropdown v-if="selectedRowKeys.length > 0">
<!-- <a-dropdown v-if="selectedRowKeys.length > 0">
<template #overlay>
<a-menu>
<a-menu-item key="1" @click="batchHandleDelete">
@ -20,7 +20,7 @@
>批量操作
<Icon icon="mdi:chevron-down" />
</a-button>
</a-dropdown>
</a-dropdown>-->
</template>
<!--操作栏-->
<template #action="{ record }">

@ -4,10 +4,10 @@
<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" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
<j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
<a-dropdown v-if="selectedRowKeys.length > 0">
<j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>-->
<!-- <a-dropdown v-if="selectedRowKeys.length > 0">
<template #overlay>
<a-menu>
<a-menu-item key="1" @click="batchHandleDelete">
@ -20,7 +20,7 @@
>批量操作
<Icon icon="mdi:chevron-down" />
</a-button>
</a-dropdown>
</a-dropdown>-->
</template>
<!--操作栏-->
<template #action="{ record }">
@ -68,8 +68,8 @@
formConfig: {
//labelWidth: 120,
schemas: searchFormSchema,
autoSubmitOnEnter: true,
showAdvancedButton: true,
autoSubmitOnEnter: false,
showAdvancedButton: false,
fieldMapToNumber: [],
fieldMapToTime: [],
},
@ -153,10 +153,10 @@ const route = useRoute()
label: '编辑',
onClick: handleEdit.bind(null, record),
},
{
/* {
label: '删除',
onClick: handleDelete.bind(null, record),
},
},*/
];
}
/**

@ -367,10 +367,22 @@ export const formSchema: FormSchema[] = [
},
},*/
{
label: '状态',
label: '比赛状态',
field: 'stat',
component: 'JSwitch',
componentProps:{
//开关大小,可选值:default small
size:'default',
//非选中时的内容
unCheckedChildren:'开启',
//非选中时的值
unCheckedValue:'Y',
//选中时的内容
checkedChildren:'关闭',
//选中时的值
checkedValue:'N',
//是否禁用
disabled: false
},
},
];

@ -6,8 +6,8 @@ enum Api {
listNoCareYXTenant = '/sys/user/lisYxtAll',
listzdzx = '/sys/user/listzdzx',
list = '/sys/user/list',
save = '/sys/user/add',
edit = '/sys/user/edit',
save = '/sys/user/adddep',
edit = '/sys/user/editdep',
saveZJ = '/expert/expert/addZJ',
editZJ = '/expert/expert/editZJ',
queryExpertById = '/expert/expert/queryById',

Loading…
Cancel
Save