Commit 773aac53 authored by limei's avatar limei

Merge branch 'develop_dl_plan6' of http://39.98.45.134:8090/moa/amos-boot-biz into develop_dl_plan6

parents c7bebd33 db52b87f
......@@ -19,6 +19,7 @@ import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.common.biz.service.impl.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -483,6 +484,9 @@ public class WaterResourceController extends BaseController {
@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode) {
ReginParams reginParams = getSelectedOrgInfo();
if (StringUtils.isEmpty(bizOrgCode)) {
if (ObjectUtils.isEmpty(reginParams) || ObjectUtils.isEmpty(reginParams.getPersonIdentity()) || StringUtils.isEmpty(reginParams.getPersonIdentity().getBizOrgCode())) {
return ResponseHelper.buildResponse(null);
}
bizOrgCode = reginParams.getPersonIdentity().getBizOrgCode();
}
Page<WaterResourceDto> page = new Page<>();
......
package com.yeejoin.equipmanage.controller;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
......@@ -8,6 +9,8 @@ import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.dto.OrgMenuDto;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.MediaType;
......@@ -38,6 +41,7 @@ import com.yeejoin.equipmanage.service.IFormInstanceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
/**
* @author ZeHua Li
......@@ -117,6 +121,9 @@ public class BuildingController extends AbstractBaseController {
@GetMapping(value = "/treeByName")
public List<BuildingTreeVo> treeByName(@RequestParam(required = false) String name) {
ReginParams reginParams = getSelectedOrgInfo();
if (ObjectUtils.isEmpty(reginParams) || ObjectUtils.isEmpty(reginParams.getPersonIdentity()) || StringUtils.isEmpty(reginParams.getPersonIdentity().getBizOrgCode())) {
return new ArrayList<>();
}
String bizOrgCode = reginParams.getPersonIdentity().getBizOrgCode();
return buildService.treeByName(bizOrgCode, name);
}
......
......@@ -514,11 +514,14 @@ public class FireFightingSystemController extends AbstractBaseController {
@RequestParam(value = "formGroupId", required = false) String formGroupId,
@RequestParam(value = "current") int current,
@RequestParam(value = "size") int pageSize,
@RequestParam(value = "size", required = false) String nameOrCode,
@RequestParam(value = "nameOrCode", required = false) String nameOrCode,
@ApiParam(value = "缺陷管理新增页面用,其余地方可忽略 1-是缺陷管理 0-不是") @RequestParam(required = false) Integer isDefect
) {
if (null != isDefect && 1 == isDefect) {
ReginParams reginParams = getSelectedOrgInfo();
if (org.apache.commons.lang3.ObjectUtils.isEmpty(reginParams) || org.apache.commons.lang3.ObjectUtils.isEmpty(reginParams.getPersonIdentity()) || StringUtils.isEmpty(reginParams.getPersonIdentity().getBizOrgCode())) {
return new HashMap<>();
}
if (StringUtils.isEmpty(bizOrgCode)) {
bizOrgCode = reginParams.getPersonIdentity().getBizOrgCode();
}
......
package com.yeejoin.equipmanage.controller;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.equipmanage.config.PersonIdentify;
import com.yeejoin.equipmanage.service.DutyDetailsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.*;
/**
* 获取用户信息
*
*/
@RestController
@RequestMapping(value = "/org/user")
@Api(tags = "用户信息api")
public class OrgUserController {
@Autowired
DutyDetailsService dutyDetailsService;
@Autowired
RedisUtils redisUtils;
/**
* 今日值班运维人员列表清单--分页
*
* @return ResponseModel
*/
@PersonIdentify
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "duty-person/page-list")
@ApiOperation(httpMethod = "GET", value = "今日值班运维人员列表清单", notes = "今日值班运维人员列表清单")
public ResponseModel<IPage<Map<String, Object>>> dutyPersonPageList(
@ApiParam(value = "当前页", required = true) @RequestParam(value = "current") int current,
@ApiParam(value = "页面大小", required = true) @RequestParam(value = "size") int size) {
ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
String bizOrgCode = reginParams.getPersonIdentity().getBizOrgCode();
return ResponseHelper.buildResponse(dutyDetailsService.dutyPersonPageList(current, size, bizOrgCode));
}
}
\ No newline at end of file
package com.yeejoin.equipmanage.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import java.util.Map;
public interface DutyDetailsMapper {
IPage<Map<String, Object>> selectDutyPersonList(Page page, @Param(value = "dutyDate") String dutyDate, @Param(value = "bizOrgCode") String bizOrgCode);
}
package com.yeejoin.equipmanage.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import java.util.Map;
/**
* 服务类
*
*/
public interface DutyDetailsService {
IPage<Map<String, Object>> dutyPersonPageList(int current, int size, String bizOrgCode);
}
package com.yeejoin.equipmanage.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.equipmanage.mapper.DutyDetailsMapper;
import com.yeejoin.equipmanage.service.DutyDetailsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Map;
@Service
public class DutyDetailsImpl implements DutyDetailsService {
@Autowired
private DutyDetailsMapper dutyDetailsMapper;
@Autowired
RedisUtils redisUtils;
@Override
public IPage<Map<String, Object>> dutyPersonPageList(int current, int size,String bizOrgCode) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String dutyDate = sdf.format(new Date());
Page page = new Page();
if (current > 0){
page.setCurrent((long) (current - 1) *size);
page.setSize(size);
}
return dutyDetailsMapper.selectDutyPersonList(page, dutyDate, bizOrgCode);
}
}
......@@ -73,6 +73,8 @@ public class EquipmentManageServiceImpl extends ServiceImpl<EquipmentManageMappe
map.clear();
map.put("dataList", dataList);
map.put("count", count);
map.put("current", current);
map.put("pageSize", pageSize);
return map;
}
......
<?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.equipmanage.mapper.DutyDetailsMapper">
<select id='selectDutyPersonList' resultType="java.util.Map">
SELECT
c.biz_org_name,
IFNULL(c.personImg,'') personImg,
IFNULL(c.job_title,'') job_title,
IFNULL(c.telephone,'') telephone,
d.duty_date
FROM
cb_org_usr c
RIGHT JOIN d_duty_details d ON c.amos_org_id = d.user_id
WHERE
d.duty_date like concat('%',#{dutyDate},'%')
<if test="bizOrgCode != null and bizOrgCode!='' ">
and c.biz_org_code like concat(#{bizOrgCode},'%')
</if>
ORDER BY
d.duty_date DESC
</select>
</mapper>
......@@ -4,54 +4,54 @@
<select id="queryEquipmenInfo" resultType="com.yeejoin.equipmanage.common.vo.EquipmentManageVo">
select
sys.id as id,
name as name,
code as code,
form_group_id,
instance_id,
date_format(install_date,'%Y-%m-%d') AS installDate,
date_format(first_maintenance_date,'%Y-%m-%d') AS firstMaintenanceDate,
charge_person_name as chargePerson,
sys.name as name,
sys.code as code,
sys.form_group_id,
sys.instance_id,
date_format(sys.install_date,'%Y-%m-%d') AS installDate,
date_format(sys.first_maintenance_date,'%Y-%m-%d') AS firstMaintenanceDate,
sys.charge_person_name as chargePerson,
(select name from wl_manufacturer_info where id = construction_unit) as constructionUnit,
(select name from wl_manufacturer_info where id = maintenance_unit) as maintenanceUnit,
(select name from wl_equipment_category where id = system_type) as systemType,
system_type as systemTypeCode,
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,
design_org,
lead_designer,
design_org_telephone,
sys.system_type as systemTypeCode,
sys.construction_unit as constructionUnitCode,
sys.maintenance_unit as maintenanceUnitCode,
sys.maintenance_frequency as maintenanceFrequency,
sys.biz_org_code as bizOrgCode,
sys.biz_org_name as bizOrgName,
sys.scene_id as sceneId,
sys.design_org,
sys.lead_designer,
sys.design_org_telephone,
(select count(1) from `wl_equipment_specific` es where find_in_set(sys.id,es.system_id) and es.single = true ) equipCount,
wws.full_name as fullName
from
f_fire_fighting_system as sys
left join wl_warehouse_structure wws on wws.id = sys.contro_box_build
where 1=1
<if test="equimentName != 'null' ">
AND NAME like CONCAT('%',#{equimentName},'%')
<if test="equimentName != null and equimentName !='' ">
AND sys.NAME like CONCAT('%',#{equimentName},'%')
</if>
<if test="equimentCode != 'null' ">
AND CODE like CONCAT('%',#{equimentCode},'%')
<if test="equimentCode != null and equimentCode !='' ">
AND sys.CODE like CONCAT('%',#{equimentCode},'%')
</if>
<if test="nameOrCode != null and nameOrCode != ''">
AND (CODE like CONCAT('%',#{nameOrCode},'%') or NAME like CONCAT('%',#{equimentName},'%'))
AND (sys.CODE like CONCAT('%',#{nameOrCode},'%') or sys.NAME like CONCAT('%',#{equimentName},'%'))
</if>
<if test="construction != 'all' ">
AND CONSTRUCTION_UNIT = #{construction}
AND sys.CONSTRUCTION_UNIT = #{construction}
</if>
<if test="maintenance != 'all' ">
AND MAINTENANCE_UNIT = #{maintenance}
AND sys.MAINTENANCE_UNIT = #{maintenance}
</if>
<if test="bizOrgCode != null and bizOrgCode != ''">
AND biz_org_code like CONCAT(#{bizOrgCode},'%')
AND sys.biz_org_code like CONCAT(#{bizOrgCode},'%')
</if>
<if test="formGroupId != null and formGroupId != '' and formGroupId != '-1'">
AND form_group_id = #{formGroupId}
AND sys.form_group_id = #{formGroupId}
</if>
order by id DESC
order by sys.id DESC
LIMIT #{spage},#{pageSize}
</select>
<select id="queryEquipmenCount" resultType="long">
......@@ -60,10 +60,10 @@
from
f_fire_fighting_system
where 1=1
<if test="equimentName != 'null' ">
<if test="equimentName != null and equimentName != '' ">
AND name like CONCAT('%',#{equimentName},'%')
</if>
<if test="equimentCode != 'null' ">
<if test="equimentCode != null and equimentCode != '' ">
AND code like CONCAT('%',#{equimentCode},'%')
</if>
<if test="construction != 'all' ">
......
......@@ -3396,9 +3396,21 @@
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='单位人员平台人员关系表';
</sql>
</changeSet>
<changeSet author="tianyiming" id="20220923-tianyiming">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="cb_data_dictionary" columnName="extend"/>
</not>
</preConditions>
<comment>modify table cb_data_dictionary add columns</comment>
<sql>
ALTER TABLE `cb_data_dictionary`
ADD COLUMN `extend` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL AFTER `type_desc`;
</sql>
</changeSet>
<changeSet author="tianyiming" id="2022-09-18-tianyiming">
<preConditions onFail="MARK_RAN">
<tableExists tableName="cb_data_dictionary" />
<not>
<primaryKeyExists primaryKeyName="sequence_nbr" tableName="cb_data_dictionary"/>
......
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