Commit ce9f2b33 authored by KeYong's avatar KeYong

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

parents 5f860c63 deaeaa62
......@@ -122,4 +122,12 @@ public class FireStationDto extends BaseDto {
@ApiModelProperty(value = "战备车辆数量")
private Integer carNum;
@ExcelIgnore
@ApiModelProperty(value = "机构/部门名称")
private String bizOrgName;
@ExcelIgnore
@ApiModelProperty(value = "机构编码")
private String bizOrgCode;
}
\ No newline at end of file
package com.yeejoin.amos.boot.module.common.api.entity;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
......@@ -87,4 +88,10 @@ public class FireStation extends BaseEntity {
@ApiModelProperty(value = "更新时间")
@TableField(fill = FieldFill.UPDATE)
private Date updateTime;
@ApiModelProperty(value = "机构/部门名称")
private String bizOrgName;
@ApiModelProperty(value = "机构编码")
private String bizOrgCode;
}
......@@ -28,6 +28,7 @@ public interface FireStationMapper extends BaseMapper<FireStation> {
+ "<if test='par.bizCompanyId!=null'> and a.biz_company_id = #{par.bizCompanyId} </if>"
+ "<if test='par.bizCompanyCode!=null'> and a.biz_company_code like CONCAT('',#{par.bizCompanyCode},'%') </if>"
+ "<if test='par.address!=null'> and a.address like CONCAT('',#{par.address},'%') </if>"
+ "<if test='par.bizOrgCode != null'> and a.biz_org_code like CONCAT(#{par.bizOrgCode},'%') </if>"
+" order by a.rec_date desc limit #{pageNum},#{pageSize}"
+ "</script>")
List<FireStationDto>getFireStation(@Param("pageNum")int pageNum,@Param("pageSize")int pageSize,@Param("par")FireStationDto par);
......@@ -37,6 +38,7 @@ public interface FireStationMapper extends BaseMapper<FireStation> {
+ "<if test='par.bizCompanyId!=null'> and cb_fire_station.biz_company_id = #{par.bizCompanyId} </if>"
+ "<if test='par.bizCompanyCode!=null'> and cb_fire_station.biz_company_code like CONCAT('',#{par.bizCompanyCode},'%') </if>"
+ "<if test='par.address!=null'> and cb_fire_station.address like CONCAT('',#{par.address},'%') </if>"
+ "<if test='par.bizOrgCode != null'> and biz_org_code like CONCAT(#{par.bizOrgCode},'%') </if>"
+ "</script>")
Map<String, Long> getFireStationCount(@Param("par")FireStationDto par);
......
......@@ -766,6 +766,7 @@ LEFT JOIN (
AND ( usr.biz_org_type = 'COMPANY' OR usr.biz_org_type = 'DEPARTMENT')
</otherwise>
</choose>
and usr.is_delete = false
</where>
</select>
</mapper>
......@@ -117,4 +117,8 @@ public class EquipmentManageVo implements Serializable {
private Integer equipCount;
private Long instanceId;
private String bizOrgCode;
private String bizOrgName;
}
package com.yeejoin.amos.boot.module.common.biz.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.MenuFrom;
import com.yeejoin.amos.boot.module.common.api.core.framework.PersonIdentify;
import com.yeejoin.amos.boot.module.common.api.dto.FireStationDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgMenuDto;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FireStationServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -35,12 +39,15 @@ import java.util.List;
*/
@RestController
@Api(tags = "微型消防站Api")
@RequestMapping(value = "/common/fire-station")
@RequestMapping(value = "/common/fire-station")
public class FireStationController extends BaseController {
@Autowired
FireStationServiceImpl fireStationServiceImpl;
@Autowired
OrgUsrServiceImpl iOrgUsrService;
/**
* 新增微型消防站
*
......@@ -70,7 +77,7 @@ public class FireStationController extends BaseController {
}
/**
* 根据sequenceNbr删除
* 根据sequenceNbr删除
*
* @param sequenceNbr 主键
* @return
......@@ -107,11 +114,11 @@ public class FireStationController extends BaseController {
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET", value = "微型消防站分页查询", notes = "微型消防站分页查询")
public ResponseModel<Page<FireStationDto>> queryForPage(@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size) {
@RequestParam(value = "size") int size,String bizOrgCode) {
Page<FireStationDto> page = new Page<FireStationDto>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(fireStationServiceImpl.queryForFireStationPage(page));
return ResponseHelper.buildResponse(fireStationServiceImpl.queryForFireStationPage(page,bizOrgCode));
}
/**
......@@ -142,8 +149,8 @@ public class FireStationController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "微型消防站列表全部数据查询", notes = "微型消防站列表全部数据查询")
@GetMapping(value = "/list")
public ResponseModel<List<FireStationDto>> selectForList() {
return ResponseHelper.buildResponse(fireStationServiceImpl.queryForFireStationList(false,null,null));
public ResponseModel<List<FireStationDto>> selectForList(String bizOrgCode) {
return ResponseHelper.buildResponse(fireStationServiceImpl.queryForFireStationList(false,null,null,bizOrgCode));
}
/**
......@@ -159,4 +166,20 @@ public class FireStationController extends BaseController {
List<MenuFrom> menus = fireStationServiceImpl.getCompanyTeamTree();
return ResponseHelper.buildResponse(menus);
}
/**
* 微型消防站单位部门树
*
* @param
* @return
*/
@PersonIdentify
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/tree/companyTreeByUserAndType")
@ApiOperation(httpMethod = "GET", value = "微型消防站单位部门树", notes = "微型消防站单位部门树")
public ResponseModel<List<OrgMenuDto>> companyTreeByUserAndType(@RequestParam(required = false) String type) {
// 获取登陆人角色
ReginParams reginParams = getSelectedOrgInfo();
return ResponseHelper.buildResponse(iOrgUsrService.companyTreeByUserAndType(reginParams,type));
}
}
......@@ -48,15 +48,15 @@ public class FireStationServiceImpl extends BaseService<FireStationDto, FireStat
/**
* 分页查询
*/
public Page<FireStationDto> queryForFireStationPage(Page<FireStationDto> page) {
return this.queryForPage(page, null, false);
public Page<FireStationDto> queryForFireStationPage(Page<FireStationDto> page,String bizOrgCode) {
return this.queryForPage(page, null, false,bizOrgCode);
}
/**
* 列表查询 示例
*/
public List<FireStationDto> queryForFireStationList(@Condition(Operator.eq) Boolean isDelete,@Condition(Operator.eq) Long bizCompanyId,@Condition(Operator.like) String name) {
return this.queryForList("", false, isDelete,bizCompanyId,name);
public List<FireStationDto> queryForFireStationList(@Condition(Operator.eq) Boolean isDelete,@Condition(Operator.eq) Long bizCompanyId,@Condition(Operator.like) String name,@Condition(Operator.eq) String bizOrgCode) {
return this.queryForList("", false, isDelete,bizCompanyId,name,bizOrgCode);
}
/**
......
......@@ -10,20 +10,17 @@ import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.module.common.api.core.framework.PersonIdentify;
import com.yeejoin.amos.boot.module.common.api.dto.OrgMenuDto;
import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Lazy;
import org.springframework.http.MediaType;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
......@@ -84,6 +81,8 @@ public class EquipmentDetailController extends AbstractBaseController {
IStockService iStockService;
@Autowired
private ManufacturerInfoMapper manufacturerInfoMapper;
@Autowired
OrgUsrServiceImpl iOrgUsrService;
@Autowired
private IEquipmentSpecificIndexSerivce equipmentSpecificIndexSerivce;
......@@ -591,5 +590,20 @@ public class EquipmentDetailController extends AbstractBaseController {
//
// return ;
// }
/**
* 消防装备单位部门树
*
* @param
* @return
*/
@PersonIdentify
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/companyTreeByUserAndType")
@ApiOperation(httpMethod = "GET", value = "消防装备单位部门树", notes = "消防装备单位部门树")
public ResponseModel<List<OrgMenuDto>> companyTreeByUserAndType(@RequestParam(required = false) String type) {
// 获取登陆人角色
ReginParams reginParams = getSelectedOrgInfo();
return ResponseHelper.buildResponse(iOrgUsrService.companyTreeByUserAndType(reginParams,type));
}
}
......@@ -52,10 +52,11 @@ public class EquipmentManageController extends AbstractBaseController{
@RequestParam(value = "construction",required = false) String construction,
@RequestParam(value = "maintenance",required = false) String maintenance,
@RequestParam(value = "maintenance",required = false) String bizOrgCode,
@RequestParam(value = "maintenance",required = false) String formGroupId,
@RequestParam(value = "current") int current,
@RequestParam(value = "size") int pageSize
) {
return equipmentManageService.queryEquipmenInfoAndCount(equipmentName,equipmentCode,construction,maintenance,bizOrgCode,current,pageSize);
return equipmentManageService.queryEquipmenInfoAndCount(equipmentName,equipmentCode,construction,maintenance,bizOrgCode,formGroupId,current,pageSize);
}
@GetMapping(value = "/getUtils")
......
......@@ -328,10 +328,11 @@ public class FireFightingSystemController extends AbstractBaseController {
@RequestParam(value = "construction", required = false) String construction,
@RequestParam(value = "maintenance", required = false) String maintenance,
@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode,
@RequestParam(value = "formGroupId", required = false) String formGroupId,
@RequestParam(value = "current") int current,
@RequestParam(value = "size") int pageSize
) {
return fireFightingSystemService.queryEquipmenInfoAndCount(equipmentName, equipmentCode, construction, maintenance, bizOrgCode, current, pageSize);
return fireFightingSystemService.queryEquipmenInfoAndCount(equipmentName, equipmentCode, construction, maintenance, bizOrgCode, formGroupId, current, pageSize);
}
/**
......
......@@ -26,7 +26,7 @@ public interface EquipmentManageService extends IService<EquipmentManageEntity>
* @param pageSize
* @return
*/
Map<String, Object> queryEquipmenInfoAndCount(String equimentName, String equimentCode, String construction, String maintenance, String bizOrgCode, int spage, int pageSize);
Map<String, Object> queryEquipmenInfoAndCount(String equimentName, String equimentCode, String construction, String maintenance, String bizOrgCode, String formGroupId , int spage, int pageSize);
/**
* 获取下拉菜单数据
......
......@@ -33,7 +33,7 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
* @param pageSize
* @return
*/
Map<String, Object> queryEquipmenInfoAndCount(String equimentName, String equimentCode, String construction, String maintenance, String bizOrgCode, int current, int pageSize);
Map<String, Object> queryEquipmenInfoAndCount(String equimentName, String equimentCode, String construction, String maintenance, String bizOrgCode, String formGroupId, int current, int pageSize);
FireFightingSystemEntity getOneById(Long id);
/**
......
......@@ -62,7 +62,8 @@ public class EquipmentManageServiceImpl extends ServiceImpl<EquipmentManageMappe
private String fireSystemId;
@Override
public Map<String, Object> queryEquipmenInfoAndCount(String equimentName, String equimentCode, String construction, String maintenance, String bizOrgCode, int current, int pageSize) {
public Map<String, Object> queryEquipmenInfoAndCount(String equimentName, String equimentCode, String construction, String maintenance,
String bizOrgCode, String formGroupId, int current, int pageSize) {
HttpServletRequest request = null;
Map map = new HashMap<String, Object>();
map.put("equimentName", equimentName);
......@@ -72,6 +73,7 @@ public class EquipmentManageServiceImpl extends ServiceImpl<EquipmentManageMappe
map.put("spage", current);
map.put("pageSize", pageSize);
map.put("bizOrgCode", bizOrgCode);
map.put("formGroupId", formGroupId);
List<EquipmentManageVo> dataList = equipmentManageMapper.queryEquipmenInfo(map);
Long count = equipmentManageMapper.queryEquipmenCount(map);
map.clear();
......
......@@ -153,8 +153,8 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
}
@Override
public Map<String, Object> queryEquipmenInfoAndCount(String equimentName, String equimentCode, String construction, String maintenance, String bizOrgCode, int current, int pageSize) {
Map<String, Object> map = equipmentManageService.queryEquipmenInfoAndCount(equimentName, equimentCode, construction, maintenance, bizOrgCode, current, pageSize);
public Map<String, Object> queryEquipmenInfoAndCount(String equimentName, String equimentCode, String construction, String maintenance, String bizOrgCode, String formGroupId, int current, int pageSize) {
Map<String, Object> map = equipmentManageService.queryEquipmenInfoAndCount(equimentName, equimentCode, construction, maintenance, bizOrgCode, formGroupId, current, pageSize);
List<EquipmentManageVo> dataList = (List<EquipmentManageVo>) map.get("dataList");
StringBuilder stb = new StringBuilder();
dataList.forEach(y -> {
......
......@@ -251,7 +251,7 @@ public class ExcelServiceImpl {
nameString =par.containsKey("name")?par.get("name").toString():null;
bizCompanyId =par.containsKey("bizCompanyId")?Long.parseLong(par.get("bizCompanyId").toString()):null;;
}
List<FireStationDto> fireStationDtoList = fireStationService.queryForFireStationList(false, bizCompanyId,nameString);
List<FireStationDto> fireStationDtoList = fireStationService.queryForFireStationList(false, bizCompanyId,nameString,par.containsKey("bizOrgCode")?par.get("bizOrgCode").toString():null);
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), fireStationDtoList,
FireStationDto.class, null, false);
break;
......@@ -1637,7 +1637,7 @@ public class ExcelServiceImpl {
FireTeamDto.class, dataSourcesImpl, false);
break;
case "WXXFZ":
List<FireStationDto> fireStationDtoList = fireStationService.queryForFireStationList(false,null,null);
List<FireStationDto> fireStationDtoList = fireStationService.queryForFireStationList(false,null,null,null);
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), fireStationDtoList,
FireStationDto.class, null, false);
break;
......
......@@ -18,6 +18,8 @@
construction_unit as constructionUnitCode,
maintenance_unit as maintenanceUnitCode,
maintenance_frequency as maintenanceFrequency,
biz_org_code as bizOrgCode,
biz_org_name as bizOrgName,
scene_id as sceneId,
(select count(1) from `wl_equipment_specific` es where find_in_set(sys.id,es.system_id) and es.single = true ) equipCount
from
......@@ -35,9 +37,12 @@
<if test="maintenance != 'all' ">
AND MAINTENANCE_UNIT = #{maintenance}
</if>
<if test="bizOrgCode != 'null' and bizOrgCode != ''">
<if test="bizOrgCode != null and bizOrgCode != ''">
AND biz_org_code like CONCAT(#{bizOrgCode},'%')
</if>
<if test="formGroupId != null and formGroupId != '' and formGroupId != '-1'">
AND form_group_id = #{formGroupId}
</if>
order by id DESC
LIMIT #{spage},#{pageSize}
</select>
......@@ -59,9 +64,12 @@
<if test="maintenance != 'all' ">
AND maintenance_unit = #{maintenance}
</if>
<if test="bizOrgCode != 'null' and bizOrgCode != ''">
<if test="bizOrgCode != null and bizOrgCode != ''">
AND biz_org_code like CONCAT(#{bizOrgCode},'%')
</if>
<if test="formGroupId != null and formGroupId != '' and formGroupId != '-1'">
AND form_group_id = #{formGroupId}
</if>
</select>
<select id="getUtils" resultType="com.yeejoin.equipmanage.common.vo.EquipmentManageVo">
select
......
## DB properties:
spring.datasource.url=jdbc:mysql://172.16.6.60:3306/amos-jcs-biz?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8
spring.datasource.url=jdbc:mysql://172.16.10.85:3306/amos-jcs-biz?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8
spring.datasource.username=root
spring.datasource.password=root_123
spring.datasource.password=Amos2019Mysql8
## eureka properties:
eureka.client.serviceUrl.defaultZone=http://172.16.10.72:10001/eureka/
......
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