Commit dbbb4ef4 by 涂亚平

准备周六在家加班......

1 parent 1687837a
Showing with 185 additions and 36 deletions
This diff could not be displayed because it is too large.
......@@ -45,7 +45,7 @@ public class PositionAloneInfoController {
@PostMapping("addRequirement")
@ApiOperation("添加独立职位需求管理 {companyId positionStatus requireCount positionName recruitType jobSortId" +
"positionId province city county address jobId positionDesc positionRequire startSalary endSalary infoOrigin}")
"positionId province city county address jobId positionDesc positionRequire startSalary endSalary infoOrigin stationId}")
public ResponseVO addRequirement(@RequestBody AddAloneDTO addAloneDTO){
return ResponseData.generateCreatedResponse(0,positionAloneInfoService.addRequirement(addAloneDTO));
}
......
......@@ -50,7 +50,7 @@ public class PositionRequireItemController {
}
@PostMapping("addRequirements")
@ApiOperation("添加需求 id userId module itemName itemStatus companyId jobId infoOrigin province city county")
@ApiOperation("添加需求 id userId module itemName itemStatus companyId jobId infoOrigin province city county stationId")
public ResponseVO addRequirements(@RequestBody AddRequirementsDTO addRequirementsDTO) {
return ResponseData.generateCreatedResponse(0, positionRequireItemService.addRequirements(addRequirementsDTO));
}
......
......@@ -2,7 +2,6 @@ package com.laowu.controller;
import com.laowu.dto.team.*;
import com.laowu.model.LibGeoLocationDO;
import com.laowu.model.TeamDictDO;
import com.laowu.service.TeamDictService;
import com.laowu.util.ResponseData;
......@@ -115,10 +114,4 @@ public class TeamDictController {
return ResponseData.generateCreatedResponse(0,teamDictService.memberManagementCount(memberManagementDTO));
}
@PostMapping("homepage")
@ApiOperation("主页 province city county")
public ResponseVO homepage(@RequestBody LibGeoLocationDO libGeoLocationDO){
return ResponseData.generateCreatedResponse(0,teamDictService.homepage(libGeoLocationDO));
}
}
package com.laowu.controller;
import com.laowu.dto.station.ProvinceStationsDTO;
import com.laowu.dto.station.StationAccountDTO;
import com.laowu.dto.station.StationsDTO;
import com.laowu.dto.station.UpdateAdministerDTO;
......@@ -71,8 +72,8 @@ public class WorkstationDictController {
@PostMapping("provinceStations")
@ApiOperation("以省为单位查看工作站 ")
public ResponseVO provinceStations(){
return ResponseData.generateCreatedResponse(0,workstationDictService.provinceStations());
public ResponseVO provinceStations(@RequestBody ProvinceStationsDTO provinceStationsDTO){
return ResponseData.generateCreatedResponse(0,workstationDictService.provinceStations(provinceStationsDTO));
}
@PostMapping("updateAdminister")
......@@ -87,4 +88,11 @@ public class WorkstationDictController {
return ResponseData.generateCreatedResponse(0,workstationDictService.addAdminister(updateAdministerDTO));
}
@PostMapping("homepage")
@ApiOperation("主页 id 工作站id")
public ResponseVO homepage(@RequestBody WorkstationDictDO workstationDictDO){
return ResponseData.generateCreatedResponse(0,workstationDictService.homepage(workstationDictDO));
}
}
......@@ -10,4 +10,5 @@ public class AddAloneDTO extends PositionAloneInfoDO {
private String module;
private Long stationId;
}
......@@ -9,4 +9,6 @@ public class AddRequirementsDTO extends PositionRequireItemDO {
private Long userId;
private String module;
private Long stationId;
}
package com.laowu.dto.station;
import lombok.Data;
@Data
public class ProvinceStationsDTO {
private Long userId;
}
......@@ -24,7 +24,6 @@ public interface WorkstationAdministersMapper extends BaseMapper<WorkstationAdmi
*/
List<AdministerVO> administers(Long id);
/**
* 根据人去找工作站信息
*/
......
......@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.laowu.model.WorkstationDictDO;
import com.laowu.vo.station.StationAccountVO;
import com.laowu.vo.station.StationsVO;
import com.laowu.vo.team.HomepageVO;
import org.springframework.stereotype.Repository;
import java.util.List;
......@@ -35,7 +36,11 @@ public interface WorkstationDictMapper extends BaseMapper<WorkstationDictDO> {
/**
* 工作站主页
*/
void homepage(Long stationId);
HomepageVO homepage(Long stationId);
/**
* 站长id 省 去查询工作站
*/
List<WorkstationDictDO> administerProvinceStations(String province,Long administerId);
}
......@@ -15,4 +15,6 @@ import org.springframework.stereotype.Repository;
@Repository
public interface WorkstationMemberMappingMapper extends BaseMapper<WorkstationMemberMappingDO> {
}
......@@ -107,4 +107,9 @@ public class PositionAloneInfoDO extends BaseModel {
*/
private String infoOrigin;
/**
* 源
*/
private Long originId;
}
......@@ -28,4 +28,5 @@ public interface AdministerService extends IService<AdministerDO> {
String updateAdminister(AdministerDO administerDO);
String deleteAdminister(AdministerDO administerDO);
}
......@@ -3,7 +3,6 @@ package com.laowu.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.laowu.dto.team.*;
import com.laowu.model.LibGeoLocationDO;
import com.laowu.model.MemberDictDO;
import com.laowu.model.TeamDictDO;
import com.laowu.vo.team.*;
......@@ -48,6 +47,6 @@ public interface TeamDictService extends IService<TeamDictDO> {
TotalTeamsVO memberManagementCount(MemberManagementDTO memberManagementDTO);
HomepageVO homepage(LibGeoLocationDO libGeoLocationDO);
}
......@@ -2,6 +2,7 @@ package com.laowu.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.laowu.dto.station.ProvinceStationsDTO;
import com.laowu.dto.station.StationAccountDTO;
import com.laowu.dto.station.StationsDTO;
import com.laowu.dto.station.UpdateAdministerDTO;
......@@ -9,6 +10,7 @@ import com.laowu.model.AdministerDO;
import com.laowu.model.WorkstationDictDO;
import com.laowu.vo.station.OneStationAccountVO;
import com.laowu.vo.station.ProvinceStationsVO;
import com.laowu.vo.team.HomepageVO;
import java.util.List;
......@@ -34,9 +36,11 @@ public interface WorkstationDictService extends IService<WorkstationDictDO> {
OneStationAccountVO oneStationAccount(AdministerDO administerDO);
List<ProvinceStationsVO> provinceStations();
List<ProvinceStationsVO> provinceStations(ProvinceStationsDTO provinceStationsDTO);
String updateAdminister(UpdateAdministerDTO updateAdministerDTO);
String addAdminister(UpdateAdministerDTO updateAdministerDTO);
HomepageVO homepage(WorkstationDictDO workstationDictDO);
}
......@@ -8,8 +8,10 @@ import com.laowu.common.exception.HttpException;
import com.laowu.dto.administer.AllDTO;
import com.laowu.mapper.AdministerMapper;
import com.laowu.mapper.RoleAdministerMappingMapper;
import com.laowu.mapper.WorkstationAdministersMapper;
import com.laowu.model.AdministerDO;
import com.laowu.model.RoleAdministerMappingDO;
import com.laowu.model.WorkstationDictDO;
import com.laowu.service.AdministerService;
import com.laowu.util.ConstantUtils;
import com.laowu.util.JwtUtil;
......@@ -38,6 +40,9 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
@Autowired
private RoleAdministerMappingMapper roleAdministerMappingMapper;
@Autowired
private WorkstationAdministersMapper workstationAdministersMapper;
public LoginVO login(AdministerDO administerDO) {
LoginVO login = new LoginVO();
......@@ -93,6 +98,21 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
if (null != roleAdministerMappingDO) {
administerPermissionVO.setRole(roleAdministerMappingDO.getRoleId());
}
//是不是管理员
int count = roleAdministerMappingMapper.selectCount(new QueryWrapper<RoleAdministerMappingDO>()
.lambda()
.eq(RoleAdministerMappingDO::getAdministerId,administerDO.getId())
.eq(RoleAdministerMappingDO::getRoleId,1));
if (count >0){
administerPermissionVO.setIsRole(true);
}else {
administerPermissionVO.setIsRole(false);
//站长所有的工作站
List<WorkstationDictDO> workstationDictDOS = workstationAdministersMapper.workstations(administerDO.getId());
administerPermissionVO.setWorkstationDictDOS(workstationDictDOS);
}
return administerPermissionVO;
}
......@@ -113,6 +133,12 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
administerDO.setStatus("正常");
administerDO.setPassword("123456");
this.baseMapper.insert(administerDO);
RoleAdministerMappingDO roleAdministerMappingDO = new RoleAdministerMappingDO();
roleAdministerMappingDO.setAdministerId(administerDO.getId());
roleAdministerMappingDO.setRoleId(2L);
roleAdministerMappingMapper.insert(roleAdministerMappingDO);
return ConstantUtils.ADD_SUCCESS;
}
......
......@@ -16,6 +16,7 @@ import com.laowu.vo.position.OneAloneRequirementVO;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
......@@ -68,6 +69,7 @@ public class PositionAloneInfoServiceImpl extends ServiceImpl<PositionAloneInfoM
return ConstantUtils.DELETE_SUCCESS;
}
@Transactional(rollbackFor = Exception.class)
public String addRequirement(AddAloneDTO addAloneDTO) {
PositionAloneInfoDO positionAloneInfoDO = new PositionAloneInfoDO();
......@@ -81,6 +83,15 @@ public class PositionAloneInfoServiceImpl extends ServiceImpl<PositionAloneInfoM
positionAloneHistoryDO.setRequireId(positionAloneInfoDO.getId());
positionAloneHistoryDO.setOpr("创建了独立职位需求信息");
positionAloneHistoryMapper.insert(positionAloneHistoryDO);
//添加映射
if (null != addAloneDTO.getStationId()){
WorkstationAloneMappingDO workstationAloneMappingDO = new WorkstationAloneMappingDO();
workstationAloneMappingDO.setStationId(addAloneDTO.getStationId());
workstationAloneMappingDO.setAloneId(positionAloneInfoDO.getId());
workstationAloneMappingMapper.insert(workstationAloneMappingDO);
}
return ConstantUtils.ADD_SUCCESS;
}
......
......@@ -14,6 +14,7 @@ import com.laowu.vo.position.*;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
......@@ -132,12 +133,18 @@ public class PositionRequireItemServiceImpl extends ServiceImpl<PositionRequireI
return ConstantUtils.SUCCESS_UPDATE;
}
@Transactional(rollbackFor = Exception.class)
public String addRequirements(AddRequirementsDTO addRequirementsDTO) {
PositionRequireItemDO positionRequireItemDO = new PositionRequireItemDO();
BeanUtils.copyProperties(addRequirementsDTO,positionRequireItemDO);
this.baseMapper.insert(positionRequireItemDO);
WorkstationRequireMappingDO workstationRequireMappingDO = new WorkstationRequireMappingDO();
workstationRequireMappingDO.setStationId(addRequirementsDTO.getStationId());
workstationRequireMappingDO.setRequireId(positionRequireItemDO.getId());
workstationRequireMappingMapper.insert(workstationRequireMappingDO);
PositionRequireHistoryDO positionRequireHistoryDO = new PositionRequireHistoryDO();
positionRequireHistoryDO.setRequireId(positionRequireHistoryDO.getId());
positionRequireHistoryDO.setAdministerId(addRequirementsDTO.getUserId());
......
......@@ -269,11 +269,4 @@ public class TeamDictServiceImpl extends ServiceImpl<TeamDictMapper, TeamDictDO>
return totalTeamsVO;
}
public HomepageVO homepage(LibGeoLocationDO libGeoLocationDO) {
HomepageVO homepageVO = new HomepageVO();
return homepageVO;
}
}
......@@ -5,18 +5,22 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.laowu.common.exception.HttpException;
import com.laowu.dto.station.ProvinceStationsDTO;
import com.laowu.dto.station.StationAccountDTO;
import com.laowu.dto.station.StationsDTO;
import com.laowu.dto.station.UpdateAdministerDTO;
import com.laowu.mapper.AdministerMapper;
import com.laowu.mapper.RoleAdministerMappingMapper;
import com.laowu.mapper.WorkstationAdministersMapper;
import com.laowu.mapper.WorkstationDictMapper;
import com.laowu.model.AdministerDO;
import com.laowu.model.RoleAdministerMappingDO;
import com.laowu.model.WorkstationAdministersDO;
import com.laowu.model.WorkstationDictDO;
import com.laowu.service.WorkstationDictService;
import com.laowu.util.ConstantUtils;
import com.laowu.vo.station.*;
import com.laowu.vo.team.HomepageVO;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -41,6 +45,9 @@ public class WorkstationDictServiceImpl extends ServiceImpl<WorkstationDictMappe
@Autowired
private AdministerMapper administerMapper;
@Autowired
private RoleAdministerMappingMapper roleAdministerMappingMapper;
public IPage<StationsVO> stations(StationsDTO stationsDTO) {
Page pager = new Page(stationsDTO.getPageNum(), stationsDTO.getPageSize());
......@@ -111,13 +118,19 @@ public class WorkstationDictServiceImpl extends ServiceImpl<WorkstationDictMappe
return oneStationAccountVO;
}
public List<ProvinceStationsVO> provinceStations() {
public List<ProvinceStationsVO> provinceStations(ProvinceStationsDTO provinceStationsDTO) {
List<ProvinceStationsVO> provinceStationsVOS = new ArrayList<>();
//判断该角色是管理员还是站长
int count = roleAdministerMappingMapper.selectCount(new QueryWrapper<RoleAdministerMappingDO>()
.lambda()
.eq(RoleAdministerMappingDO::getAdministerId,provinceStationsDTO.getUserId())
.eq(RoleAdministerMappingDO::getRoleId,1));
List<ProvinceStationsVO> provinceStationsVOS = new ArrayList<>();
//先查出所有省
List<String> provinces = this.baseMapper.provinces();
if (count > 0){
//管理员
//省下面的工作站
for (String province : provinces) {
ProvinceStationsVO provinceStationsVO = new ProvinceStationsVO();
......@@ -129,6 +142,17 @@ public class WorkstationDictServiceImpl extends ServiceImpl<WorkstationDictMappe
provinceStationsVO.setWorkstationDictDOS(workstationDictDOS);
provinceStationsVOS.add(provinceStationsVO);
}
}else {
//站长
for (String province : provinces) {
ProvinceStationsVO provinceStationsVO = new ProvinceStationsVO();
provinceStationsVO.setProvince(province);
List<WorkstationDictDO> workstationDictDOS = this.baseMapper.administerProvinceStations(province,provinceStationsDTO.getUserId());
provinceStationsVO.setWorkstationDictDOS(workstationDictDOS);
provinceStationsVOS.add(provinceStationsVO);
}
}
return provinceStationsVOS;
}
......@@ -190,4 +214,10 @@ public class WorkstationDictServiceImpl extends ServiceImpl<WorkstationDictMappe
return ConstantUtils.ADD_SUCCESS;
}
public HomepageVO homepage(WorkstationDictDO workstationDictDO) {
return this.baseMapper.homepage(workstationDictDO.getId());
}
}
......@@ -8,14 +8,17 @@ import com.laowu.dto.station.RequiresDTO;
import com.laowu.dto.station.ShareDTO;
import com.laowu.mapper.PositionItemInfoMapper;
import com.laowu.mapper.PositionItemJobMappingMapper;
import com.laowu.mapper.PositionRequireItemMapper;
import com.laowu.mapper.WorkstationRequireMappingMapper;
import com.laowu.model.LibJobSortDO;
import com.laowu.model.PositionRequireItemDO;
import com.laowu.model.WorkstationRequireMappingDO;
import com.laowu.service.WorkstationRequireMappingService;
import com.laowu.util.ConstantUtils;
import com.laowu.vo.position.PositionCountsVO;
import com.laowu.vo.station.RequireStationsVO;
import com.laowu.vo.station.RequiresVO;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -39,6 +42,9 @@ public class WorkstationRequireMappingServiceImpl extends ServiceImpl<Workstatio
@Autowired
private PositionItemJobMappingMapper positionItemJobMappingMapper;
@Autowired
private PositionRequireItemMapper positionRequireItemMapper;
public IPage<RequiresVO> requires(RequiresDTO requiresDTO) {
Page pager = new Page(requiresDTO.getPageNum(), requiresDTO.getPageSize());
......@@ -81,8 +87,15 @@ public class WorkstationRequireMappingServiceImpl extends ServiceImpl<Workstatio
if (newIds.size()>0){
for (Long id : newIds){
PositionRequireItemDO positionRequireItemDO = positionRequireItemMapper.selectById(requireId);
PositionRequireItemDO positionRequireItemDO1 = new PositionRequireItemDO();
BeanUtils.copyProperties(positionRequireItemDO1,positionRequireItemDO);
positionRequireItemMapper.insert(positionRequireItemDO1);
WorkstationRequireMappingDO workstationRequireMappingDO = new WorkstationRequireMappingDO();
workstationRequireMappingDO.setRequireId(requireId);
workstationRequireMappingDO.setRequireId(positionRequireItemDO1.getId());
workstationRequireMappingDO.setStationId(id);
this.baseMapper.insert(workstationRequireMappingDO);
}
......
package com.laowu.vo.admin;
import com.laowu.model.WorkstationDictDO;
import lombok.Data;
import java.util.List;
......@@ -18,4 +19,6 @@ public class AdministerPermissionVO {
private Boolean isRole;
private List<PermissionsVO> permissions;
private List<WorkstationDictDO> workstationDictDOS ;
}
......@@ -4,4 +4,23 @@ import lombok.Data;
@Data
public class HomepageVO {
private String workstationName;
private String province;
private String city;
private String county;
private String memberCnt;
private String leaderCnt;
private String teamCnt;
private String companyCnt;
private String requireCnt;
}
......@@ -61,10 +61,12 @@
administer t1
LEFT JOIN workstation_administers t2 ON t1.id = t2.administer_id
LEFT JOIN workstation_dict t3 ON t2.workstation_id = t3.id
left join role_administer_mapping t4 on t1.id = t4.administer_id
WHERE
t1.delete_date IS NULL
AND t2.delete_date IS NULL
AND t3.delete_date IS NULL
and t4.role_id != 1
<if test=" workingstationName!= null and workingstationName != ''">
AND t3.workstation_name LIKE concat('%', #{workingstationName}, '%')
</if>
......@@ -82,15 +84,17 @@
</select>
<select id="homepage" parameterType="long">
<select id="homepage" parameterType="long" resultType="com.laowu.vo.team.HomepageVO">
SELECT
t1.workstation_name,
CONCAT( t1.province, "-", t1.city, "-", t1.county ),
IFNULL( t4.ct1, 0 ),
IFNULL( t5.ct2, 0 ),
IFNULL( t6.ct3, 0 ),
IFNULL( t7.ct4, 0 ),
IFNULL( t8.ct5, 0 )
t1.province,
t1.city,
t1.county,
IFNULL( t4.ct1, 0 ) AS memberCnt,
IFNULL( t5.ct2, 0 ) AS leaderCnt,
IFNULL( t6.ct3, 0 ) AS teamCnt,
IFNULL( t7.ct4, 0 ) AS companyCnt,
IFNULL( t8.ct5, 0 ) AS requireCnt
FROM
workstation_dict t1
LEFT JOIN (
......@@ -148,7 +152,7 @@
LEFT JOIN position_alone_info t3 ON t2.alone_id = t3.id
LEFT JOIN company_dict t4 ON t3.company_id = t4.id
WHERE
t1.id = 1
t1.id = #{stationId}
AND t1.delete_date IS NULL
AND t2.delete_date IS NULL
AND t3.delete_date IS NULL
......@@ -203,7 +207,21 @@
AND t4.delete_date IS NULL
) t5
) t8 ON t1.id = t8.id
where t1.id = #{stationId}
WHERE
t1.id = #{stationId}
</select>
<select id="administerProvinceStations" resultType="com.laowu.model.WorkstationDictDO">
SELECT
t.id,
t.workstation_name
FROM
workstation_dict t
LEFT JOIN workstation_administers t2 ON t.id = t2.workstation_id
WHERE
t.delete_date IS NULL
AND t2.delete_date IS NULL
and t2.administer_id = #{administerId}
and t.province = #{province}
</select>
</mapper>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!