Commit f1c4a868 authored by tangwei's avatar tangwei

Merge branch 'developer' of http://172.16.10.76/moa/amos-boot-biz into developer

parents 25e96276 032f2f40
package com.yeejoin.amos.boot.module.common.api.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 救援装备
*
* @author system_generator
* @date 2021-07-23
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="RescueEquipmentDto", description="救援装备")
public class RescueEquipmentDto extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "车辆类型")
private String vehicleType;
@ApiModelProperty(value = "车辆类型code")
private String vehicleCode;
@ApiModelProperty(value = "人数")
private Long personNumber;
@ApiModelProperty(value = "单位名称")
private String company;
@ApiModelProperty(value = "单位id")
private Long companyId;
}
package com.yeejoin.amos.boot.module.common.api.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 特岗人员
*
* @author system_generator
* @date 2021-07-23
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "SpecialPositionStaffDto", description = "特岗人员")
public class SpecialPositionStaffDto extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "岗位名称")
private String positionName;
@ApiModelProperty(value = "岗位名称code")
private String positionNameCode;
@ApiModelProperty(value = "人数")
private Long personNumber;
@ApiModelProperty(value = "单位名称")
private String company;
@ApiModelProperty(value = "单位id")
private Long companyId;
@ApiModelProperty(value = "更新人名称")
private String recUserName;
}
package com.yeejoin.amos.boot.module.common.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
/**
* 救援装备
*
* @author system_generator
* @date 2021-07-23
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("cb_rescue_equipment")
public class RescueEquipment extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 车辆类型
*/
@TableField("vehicle_type")
private String vehicleType;
/**
* 车辆类型code
*/
@TableField("vehicle_code")
private String vehicleCode;
/**
* 人数
*/
@TableField("person_number")
private Long personNumber;
/**
* 单位名称
*/
@TableField("company")
private String company;
/**
* 单位id
*/
@TableField("company_id")
private Long companyId;
}
package com.yeejoin.amos.boot.module.common.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
/**
* 特岗人员
*
* @author system_generator
* @date 2021-07-23
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("cb_special_position_staff")
public class SpecialPositionStaff extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 岗位名称
*/
@TableField("position_name")
private String positionName;
/**
* 岗位名称code
*/
@TableField("position_name_code")
private String positionNameCode;
/**
* 人数
*/
@TableField("person_number")
private Long personNumber;
/**
* 单位名称
*/
@TableField("company")
private String company;
/**
* 单位id
*/
@TableField("company_id")
private Long companyId;
}
package com.yeejoin.amos.boot.module.common.api.mapper;
import com.yeejoin.amos.boot.module.common.api.entity.RescueEquipment;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* 救援装备 Mapper 接口
*
* @author system_generator
* @date 2021-07-23
*/
public interface RescueEquipmentMapper extends BaseMapper<RescueEquipment> {
}
package com.yeejoin.amos.boot.module.common.api.mapper;
import com.yeejoin.amos.boot.module.common.api.dto.SpecialPositionStaffDto;
import com.yeejoin.amos.boot.module.common.api.entity.SpecialPositionStaff;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.List;
/**
* 特岗人员 Mapper 接口
*
* @author system_generator
* @date 2021-07-23
*/
public interface SpecialPositionStaffMapper extends BaseMapper<SpecialPositionStaff> {
List<SpecialPositionStaff> getPositionStaffList(boolean isDelete);
List<Long> getPositionStaffCodeList(boolean isDelete);
}
package com.yeejoin.amos.boot.module.common.api.service;
import com.yeejoin.amos.boot.biz.common.utils.MenuFrom;
import java.util.List;
/**
* 数据字典 服务类
*
* @author tb
* @date 2021-06-07
*/
* 数据字典 服务类
*
* @author tb
* @date 2021-06-07
*/
public interface IDataDictionaryService {
Object getFireChemical(String type) throws Exception;
Object gwmcDataDictionary(String type)throws Exception;
Object gwmcDataDictionary(String type) throws Exception;
List<MenuFrom> getGWMCDataDictionary(String type) throws Exception;
}
package com.yeejoin.amos.boot.module.common.api.service;
/**
* 救援装备接口类
*
* @author system_generator
* @date 2021-07-23
*/
public interface IRescueEquipmentService {
}
package com.yeejoin.amos.boot.module.common.api.service;
/**
* 特岗人员接口类
*
* @author system_generator
* @date 2021-07-23
*/
public interface ISpecialPositionStaffService {
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.common.api.mapper.RescueEquipmentMapper">
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.common.api.mapper.SpecialPositionStaffMapper">
<select id="getPositionStaffList"
resultType="com.yeejoin.amos.boot.module.common.api.entity.SpecialPositionStaff">
select distinct position_name, position_name_code
from cb_special_position_staff
where is_delete = #{isDelete}
</select>
<select id="getPositionStaffCodeList" resultType="java.lang.Long">
select distinct position_name_code
from cb_special_position_staff
where is_delete = #{isDelete}
</select>
</mapper>
package com.yeejoin.amos.boot.module.common.biz.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.List;
import com.yeejoin.amos.boot.module.common.biz.service.impl.RescueEquipmentServiceImpl;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.common.api.dto.RescueEquipmentDto;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
/**
* 救援装备
*
* @author system_generator
* @date 2021-07-23
*/
@RestController
@Api(tags = "救援装备Api")
@RequestMapping(value = "/common/rescue-equipment")
public class RescueEquipmentController extends BaseController {
@Autowired
RescueEquipmentServiceImpl rescueEquipmentServiceImpl;
/**
* 新增救援装备
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增救援装备", notes = "新增救援装备")
public ResponseModel<RescueEquipmentDto> save(@RequestBody RescueEquipmentDto model) {
model = rescueEquipmentServiceImpl.createWithModel(model);
return ResponseHelper.buildResponse(model);
}
/**
* 根据sequenceNbr更新
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新救援装备", notes = "根据sequenceNbr更新救援装备")
public ResponseModel<RescueEquipmentDto> updateBySequenceNbrRescueEquipment(@RequestBody RescueEquipmentDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
model.setSequenceNbr(sequenceNbr);
return ResponseHelper.buildResponse(rescueEquipmentServiceImpl.updateWithModel(model));
}
/**
* 根据sequenceNbr删除
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@DeleteMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除救援装备", notes = "根据sequenceNbr删除救援装备")
public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @PathVariable(value = "sequenceNbr") Long sequenceNbr){
return ResponseHelper.buildResponse(rescueEquipmentServiceImpl.removeById(sequenceNbr));
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个救援装备", notes = "根据sequenceNbr查询单个救援装备")
public ResponseModel<RescueEquipmentDto> selectOne(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(rescueEquipmentServiceImpl.queryBySeq(sequenceNbr));
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "救援装备分页查询", notes = "救援装备分页查询")
public ResponseModel<Page<RescueEquipmentDto>> queryForPage(@RequestParam(value = "current") int current,@RequestParam
(value = "size") int size) {
Page<RescueEquipmentDto> page = new Page<RescueEquipmentDto>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(rescueEquipmentServiceImpl.queryForRescueEquipmentPage(page));
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "救援装备列表全部数据查询", notes = "救援装备列表全部数据查询")
@GetMapping(value = "/list")
public ResponseModel<List<RescueEquipmentDto>> selectForList() {
return ResponseHelper.buildResponse(rescueEquipmentServiceImpl.queryForRescueEquipmentList());
}
}
package com.yeejoin.amos.boot.module.common.biz.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.HashMap;
import java.util.List;
import com.yeejoin.amos.boot.module.common.biz.service.impl.SpecialPositionStaffServiceImpl;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.common.api.dto.SpecialPositionStaffDto;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
/**
* 特岗人员
*
* @author system_generator
* @date 2021-07-23
*/
@RestController
@Api(tags = "特岗人员Api")
@RequestMapping(value = "/common/special-position-staff")
public class SpecialPositionStaffController extends BaseController {
@Autowired
SpecialPositionStaffServiceImpl specialPositionStaffServiceImpl;
/**
* 新增特岗人员
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增特岗人员", notes = "新增特岗人员")
public ResponseModel<SpecialPositionStaffDto> save(@RequestBody SpecialPositionStaffDto model) {
model = specialPositionStaffServiceImpl.createWithModel(model);
return ResponseHelper.buildResponse(model);
}
/**
* 根据sequenceNbr更新
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新特岗人员", notes = "根据sequenceNbr更新特岗人员")
public ResponseModel<SpecialPositionStaffDto> updateBySequenceNbrSpecialPositionStaff(@RequestBody SpecialPositionStaffDto model, @PathVariable(value = "sequenceNbr") Long sequenceNbr) {
model.setSequenceNbr(sequenceNbr);
return ResponseHelper.buildResponse(specialPositionStaffServiceImpl.updateWithModel(model));
}
/**
* 根据sequenceNbr删除
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@DeleteMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除特岗人员", notes = "根据sequenceNbr删除特岗人员")
public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request,
@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
return ResponseHelper.buildResponse(specialPositionStaffServiceImpl.removeById(sequenceNbr));
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET", value = "根据sequenceNbr查询单个特岗人员", notes = "根据sequenceNbr查询单个特岗人员")
public ResponseModel<SpecialPositionStaffDto> selectOne(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(specialPositionStaffServiceImpl.queryBySeq(sequenceNbr));
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET", value = "特岗人员分页查询", notes = "特岗人员分页查询")
public ResponseModel<Page<SpecialPositionStaffDto>> queryForPage(@RequestParam(value = "current") int current,
@RequestParam
(value = "size") int size) {
Page<SpecialPositionStaffDto> page = new Page<SpecialPositionStaffDto>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(specialPositionStaffServiceImpl.queryForSpecialPositionStaffPage(page));
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "特岗人员列表全部数据查询", notes = "特岗人员列表全部数据查询")
@GetMapping(value = "/list")
public ResponseModel<List<SpecialPositionStaffDto>> selectForList() {
return ResponseHelper.buildResponse(specialPositionStaffServiceImpl.queryForSpecialPositionStaffList());
}
/**
* 批量删除特岗人员
*
* @param
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@DeleteMapping(value = "/delete_batch")
@ApiOperation(httpMethod = "DELETE", value = "批量删除合同信息", notes = "批量删除合同信息")
public ResponseModel<Boolean> batchDeleteBySequenceNbrList(@RequestParam(value = "sequenceNbrList") List<Long> sequenceNbrList) {
return ResponseHelper.buildResponse(specialPositionStaffServiceImpl.batchDelete(sequenceNbrList));
}
/**
* 查询没有数据的岗位类型
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "查询没有数据的岗位类型", notes = "查询没有数据的岗位类型")
@GetMapping(value = "/gwmc_list")
public ResponseModel<HashMap<Object, Object>> getSpecialPositionStaffList() throws Exception {
return ResponseHelper.buildResponse(specialPositionStaffServiceImpl.getSpecialPositionStaffList());
}
}
......@@ -19,13 +19,13 @@ import java.util.Collection;
import java.util.List;
/**
* 数据字典 服务实现类
*
* @author tb
* @date 2021-06-07
*/
* 数据字典 服务实现类
*
* @author tb
* @date 2021-06-07
*/
@Service
public class DataDictionaryServiceImpl extends BaseService<DataDictionaryDto,DataDictionary,DataDictionaryMapper> implements IDataDictionaryService {
public class DataDictionaryServiceImpl extends BaseService<DataDictionaryDto, DataDictionary, DataDictionaryMapper> implements IDataDictionaryService {
@Autowired
RedisUtils redisUtils;
......@@ -55,7 +55,7 @@ public class DataDictionaryServiceImpl extends BaseService<DataDictionaryDto,Dat
}
@Override
public Object gwmcDataDictionary(String type) throws Exception{
public Object gwmcDataDictionary(String type) throws Exception {
QueryWrapper<DataDictionary> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("type", type);
queryWrapper.orderByAsc("sort_num");
......@@ -71,4 +71,16 @@ public class DataDictionaryServiceImpl extends BaseService<DataDictionaryDto,Dat
return menus;
}
}
public List<MenuFrom> getGWMCDataDictionary(String type) throws Exception {
QueryWrapper<DataDictionary> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("type", type);
queryWrapper.orderByAsc("sort_num");
Collection<DataDictionary> list = this.list(queryWrapper);
List<MenuFrom> menus = TreeParser.getTreexin(null, list, DataDictionary.class.getName(), "getCode", 0, "getName"
, "getParent", null);
return menus;
}
}
package com.yeejoin.amos.boot.module.common.biz.service.impl;
import com.yeejoin.amos.boot.module.common.api.entity.RescueEquipment;
import com.yeejoin.amos.boot.module.common.api.mapper.RescueEquipmentMapper;
import com.yeejoin.amos.boot.module.common.api.service.IRescueEquipmentService;
import com.yeejoin.amos.boot.module.common.api.dto.RescueEquipmentDto;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List;
/**
* 救援装备服务实现类
*
* @author system_generator
* @date 2021-07-23
*/
@Service
public class RescueEquipmentServiceImpl extends BaseService<RescueEquipmentDto,RescueEquipment,RescueEquipmentMapper> implements IRescueEquipmentService {
/**
* 分页查询
*/
public Page<RescueEquipmentDto> queryForRescueEquipmentPage(Page<RescueEquipmentDto> page) {
return this.queryForPage(page, null, false);
}
/**
* 列表查询 示例
*/
public List<RescueEquipmentDto> queryForRescueEquipmentList() {
return this.queryForList("" , false);
}
}
\ No newline at end of file
package com.yeejoin.amos.boot.module.common.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.biz.common.utils.MenuFrom;
import com.yeejoin.amos.boot.module.common.api.entity.SpecialPositionStaff;
import com.yeejoin.amos.boot.module.common.api.mapper.SpecialPositionStaffMapper;
import com.yeejoin.amos.boot.module.common.api.service.ISpecialPositionStaffService;
import com.yeejoin.amos.boot.module.common.api.dto.SpecialPositionStaffDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.HashMap;
import java.util.List;
/**
* 特岗人员服务实现类
*
* @author system_generator
* @date 2021-07-23
*/
@Service
public class SpecialPositionStaffServiceImpl extends BaseService<SpecialPositionStaffDto, SpecialPositionStaff,
SpecialPositionStaffMapper> implements ISpecialPositionStaffService {
@Autowired
DataDictionaryServiceImpl dataDictionaryService;
/**
* 分页查询
*/
public Page<SpecialPositionStaffDto> queryForSpecialPositionStaffPage(Page<SpecialPositionStaffDto> page) {
return this.queryForPage(page, null, false);
}
/**
* 列表查询 示例
*/
public List<SpecialPositionStaffDto> queryForSpecialPositionStaffList() {
return this.queryForList("", false);
}
/**
* 批量删除
*
* @param sequenceNbrList
* @return
*/
public Boolean batchDelete(List<Long> sequenceNbrList) {
List<SpecialPositionStaff> positionStaffList =
list(new LambdaQueryWrapper<SpecialPositionStaff>().in(SpecialPositionStaff::getSequenceNbr,
sequenceNbrList));
positionStaffList.forEach(item -> item.setIsDelete(true));
boolean update = updateBatchById(positionStaffList);
return update;
}
public HashMap<Object, Object> getSpecialPositionStaffList() throws Exception {
// 查询所有岗位类型
List<MenuFrom> menuList = dataDictionaryService.getGWMCDataDictionary("GWMC");
// 查询已有数据的岗位类型
List<Long> positionStaffCodeList = this.baseMapper.getPositionStaffCodeList(false);
// 排除已有数据的,返回
for (int i = 0; i < menuList.size(); i++) {
if (positionStaffCodeList.contains(Long.valueOf(menuList.get(i).getKey()))) {
menuList.remove(i);
i--;
}
}
HashMap<Object, Object> objectObjectHashMap = new HashMap<>();
objectObjectHashMap.put("GWMC", menuList);
return objectObjectHashMap;
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment