优化
This commit is contained in:
@ -11,6 +11,7 @@ import org.dromara.common.mybatis.core.page.PageQuery;
|
|||||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
import org.dromara.common.satoken.utils.LoginHelper;
|
import org.dromara.common.satoken.utils.LoginHelper;
|
||||||
import org.dromara.contractor.domain.SubConstructionUser;
|
import org.dromara.contractor.domain.SubConstructionUser;
|
||||||
|
import org.dromara.contractor.domain.dto.constructionuser.AllocateDto;
|
||||||
import org.dromara.contractor.domain.dto.constructionuser.SubConstructionUserAuthenticationReq;
|
import org.dromara.contractor.domain.dto.constructionuser.SubConstructionUserAuthenticationReq;
|
||||||
import org.dromara.contractor.domain.dto.constructionuser.SubConstructionUserQueryReq;
|
import org.dromara.contractor.domain.dto.constructionuser.SubConstructionUserQueryReq;
|
||||||
import org.dromara.contractor.domain.vo.constructionuser.SubConstructionUserAppVo;
|
import org.dromara.contractor.domain.vo.constructionuser.SubConstructionUserAppVo;
|
||||||
@ -148,12 +149,21 @@ public class SubConstructionUserAppController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加项目班组
|
* 添加项目班组(有项目的)
|
||||||
*/
|
*/
|
||||||
@RepeatSubmit()
|
@RepeatSubmit()
|
||||||
@PostMapping("/addTeam")
|
@PostMapping("/addTeam")
|
||||||
public R<Long> add(@Validated(AddGroup.class) @RequestBody BusProjectTeamMemberCreateReq req) {
|
public R<Long> add(@RequestBody BusProjectTeamMemberCreateReq req) {
|
||||||
return R.ok(busProjectTeamMemberService.insertByBo(req));
|
return R.ok(busProjectTeamMemberService.insertByBo(req));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加项目班组(无项目的)
|
||||||
|
*/
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PutMapping("/allocate")
|
||||||
|
public R<Boolean> allocate(@Validated @RequestBody AllocateDto req) {
|
||||||
|
return R.ok(constructionUserService.allocate(req));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,10 +1,14 @@
|
|||||||
package org.dromara.contractor.controller.app;
|
package org.dromara.contractor.controller.app;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import org.dromara.common.core.domain.R;
|
import org.dromara.common.core.domain.R;
|
||||||
import org.dromara.common.web.core.BaseController;
|
import org.dromara.common.web.core.BaseController;
|
||||||
|
import org.dromara.contractor.domain.SubContractor;
|
||||||
import org.dromara.contractor.domain.vo.contractor.SubContractorManagerVo;
|
import org.dromara.contractor.domain.vo.contractor.SubContractorManagerVo;
|
||||||
|
import org.dromara.contractor.domain.vo.contractor.SubContractorVo;
|
||||||
import org.dromara.contractor.domain.vo.contractor.SubManagerVo;
|
import org.dromara.contractor.domain.vo.contractor.SubManagerVo;
|
||||||
import org.dromara.contractor.service.ISubContractorService;
|
import org.dromara.contractor.service.ISubContractorService;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
@ -46,4 +50,15 @@ public class SubContractorAppController extends BaseController {
|
|||||||
@PathVariable Long id) {
|
@PathVariable Long id) {
|
||||||
return R.ok(contractorService.queryManagerListById(id));
|
return R.ok(contractorService.queryManagerListById(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据项目id查询分包方管理人员信息列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/list/{projectId}")
|
||||||
|
public R<List<SubContractorVo>> list(@NotNull(message = "项目id不能为空")
|
||||||
|
@PathVariable Long projectId) {
|
||||||
|
List<SubContractor> list = contractorService.list(Wrappers.lambdaQuery(SubContractor.class)
|
||||||
|
.eq(SubContractor::getProjectId, projectId));
|
||||||
|
return R.ok(BeanUtil.copyToList(list, SubContractorVo.class));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -82,4 +82,7 @@ public class SubConstructionUserAppVo implements Serializable {
|
|||||||
* 用户性别(0男 1女 2未知)
|
* 用户性别(0男 1女 2未知)
|
||||||
*/
|
*/
|
||||||
private String sex;
|
private String sex;
|
||||||
|
|
||||||
|
|
||||||
|
private String sfzSite;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1467,9 +1467,11 @@ public class SubConstructionUserServiceImpl extends ServiceImpl<SubConstructionU
|
|||||||
lqw.eq(ObjectUtils.isNotEmpty(typeOfWork), SubConstructionUser::getTypeOfWork, typeOfWork);
|
lqw.eq(ObjectUtils.isNotEmpty(typeOfWork), SubConstructionUser::getTypeOfWork, typeOfWork);
|
||||||
|
|
||||||
lqw.isNull(SubConstructionUser::getTeamId);
|
lqw.isNull(SubConstructionUser::getTeamId);
|
||||||
lqw.and(wrapper -> wrapper.isNull(SubConstructionUser::getProjectId)
|
if(req.getProjectId() == null){
|
||||||
.or().eq(SubConstructionUser::getProjectId, req.getProjectId())
|
lqw.isNull(SubConstructionUser::getProjectId);
|
||||||
);
|
}else{
|
||||||
|
lqw.eq(SubConstructionUser::getProjectId, req.getProjectId());
|
||||||
|
}
|
||||||
Page<SubConstructionUser> result = this.page(pageQuery.build(), lqw);
|
Page<SubConstructionUser> result = this.page(pageQuery.build(), lqw);
|
||||||
|
|
||||||
ArrayList<SubConstructionUserAppVo> list = new ArrayList<>();
|
ArrayList<SubConstructionUserAppVo> list = new ArrayList<>();
|
||||||
|
|||||||
@ -195,7 +195,7 @@ public class BusAttendanceAppController extends BaseController {
|
|||||||
if (firstDate.isAfter(LocalDate.now())) {
|
if (firstDate.isAfter(LocalDate.now())) {
|
||||||
daysCountVo.setEntryDays(0); // 防止未来日期导致负数
|
daysCountVo.setEntryDays(0); // 防止未来日期导致负数
|
||||||
} else {
|
} else {
|
||||||
long daysDifference = ChronoUnit.DAYS.between(firstDate, LocalDate.now());
|
long daysDifference = ChronoUnit.DAYS.between(firstDate, LocalDate.now())+1;
|
||||||
daysCountVo.setEntryDays((int) daysDifference);
|
daysCountVo.setEntryDays((int) daysDifference);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -830,11 +830,13 @@ public class SysUserServiceImpl implements ISysUserService, UserService {
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean updateAppUserType(Long userId, String appUserType) {
|
public Boolean updateAppUserType(Long userId, String appUserType) {
|
||||||
//直接添加权限 app用户类型 0-施工人员 1-管理人员 2-分包人员
|
//直接添加权限 app用户类型 0-施工人员 1-管理人员 2-分包人员
|
||||||
if("1".equals(appUserType)){
|
// if("1".equals(appUserType)){
|
||||||
|
// //清空app角色
|
||||||
}
|
// userRoleMapper.delete(new LambdaQueryWrapper<SysUserRole>()
|
||||||
|
// .eq(SysUserRole::getUserId, userId));
|
||||||
|
// //添加管理人员角色
|
||||||
|
//
|
||||||
|
// }
|
||||||
return baseMapper.update(null,
|
return baseMapper.update(null,
|
||||||
new LambdaUpdateWrapper<SysUser>()
|
new LambdaUpdateWrapper<SysUser>()
|
||||||
.set(SysUser::getAppUserType, appUserType)
|
.set(SysUser::getAppUserType, appUserType)
|
||||||
|
|||||||
@ -51,7 +51,7 @@ public class FlowAppController {
|
|||||||
Map<String, FlowHisTaskVo> map = list.stream().collect(Collectors.toMap(FlowHisTaskVo::getNodeCode, vo -> vo));
|
Map<String, FlowHisTaskVo> map = list.stream().collect(Collectors.toMap(FlowHisTaskVo::getNodeCode, vo -> vo));
|
||||||
|
|
||||||
|
|
||||||
String instanceId = (String) stringObjectMap.get("instanceId");
|
Long instanceId = (Long) stringObjectMap.get("instanceId");
|
||||||
String defJsonStr = ((Instance) FlowEngine.insService().getById(instanceId)).getDefJson();
|
String defJsonStr = ((Instance) FlowEngine.insService().getById(instanceId)).getDefJson();
|
||||||
DefJson defJson = (DefJson)FlowEngine.jsonConvert.strToBean(defJsonStr, DefJson.class);
|
DefJson defJson = (DefJson)FlowEngine.jsonConvert.strToBean(defJsonStr, DefJson.class);
|
||||||
ChartExtService chartExtService = (ChartExtService) FrameInvoker.getBean(ChartExtService.class);
|
ChartExtService chartExtService = (ChartExtService) FrameInvoker.getBean(ChartExtService.class);
|
||||||
@ -90,6 +90,8 @@ public class FlowAppController {
|
|||||||
appVo.setAuditName(auditName);
|
appVo.setAuditName(auditName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
appVoList.add(appVo);
|
||||||
}
|
}
|
||||||
|
|
||||||
return R.ok(appVoList);
|
return R.ok(appVoList);
|
||||||
|
|||||||
Reference in New Issue
Block a user