Commit 675cdd1b authored by tangwei's avatar tangwei

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

parents 5dc4c319 4b6f8dc1
......@@ -19,7 +19,7 @@
and s.duty_date >= #{beginDate}
and s.duty_date <![CDATA[<=]]> #{endDate}
and s.app_Key = #{appKey}
GROUP BY s.duty_date
GROUP BY s.duty_date,s.shift_id <!--增添分组条件 根据班次分组技术 -->
) a) as maxDutyPersonNumDay,
(select
IFNULL(max(num),0)
......
<?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.FirefightersMapper">
namespace="com.yeejoin.amos.boot.module.common.api.mapper.FirefightersMapper">
<select id="getFirefightersJobTitleCount" resultType="com.yeejoin.amos.boot.biz.common.utils.FirefightersTreeDto">
select COUNT(a.sequence_nbr) num, a.job_title_code jobTitleCode
from cb_firefighters a
where a.is_delete = 0
GROUP BY a.job_title_code
</select>
<!--消防队员列表按时间倒叙排列add desc 2021-09-08 by kongfm -->
<select id="getFirefighters"
resultType="com.yeejoin.amos.boot.module.common.api.dto.FirefightersZhDto">
select a.*,b.areas_expertise areasExpertise ,b.areas_expertise_code areasExpertiseCode from cb_firefighters a LEFT JOIN cb_firefighters_post b on
a.sequence_nbr=b.firefighters_id where a.is_delete=0
<if test='par.postQualification!=null'>and b.post_qualification_code = #{par.postQualification}</if>
<if test='par.areasExpertise!=null'>and b.areas_expertise_code= #{par.areasExpertise}</if>
<if test='par.name!=null'>and a.name like concat ('%',#{par.name},'%')</if>
<if test='par.state!=null'>and a.state_code= #{par.state}</if>
<if test='par.fireTeamId!=null'>and a.fire_team_id= #{par.fireTeamId}</if>
<if test='par.jobTitle!=null'>and a.job_title_code =#{par.jobTitle}</if>
<if test='par.areasExpertiseCode!=null and par.areasExpertiseCode!="0"'>and b.areas_expertise_code =#{par.areasExpertiseCode}</if>
<if test='par.areasExpertiseCode=="0"'>and b.areas_expertise_code is not null</if>
ORDER BY a.rec_date desc limit #{pageNum},#{pageSize}
</select>
<!--消防队员列表按时间倒叙排列add desc 2021-09-08 by kongfm -->
<select id="getFirefightersCount" resultType="Map">
select COUNT(a.sequence_nbr) num from cb_firefighters a LEFT JOIN
cb_firefighters_post b on a.sequence_nbr=b.firefighters_id where
a.is_delete=0
<if test='par.postQualification!=null'>and b.post_qualification_code = #{par.postQualification}</if>
<if test='par.areasExpertise!=null'>and b.areas_expertise_code= #{par.areasExpertise}</if>
<if test='par.name!=null'>and a.name like concat ('%',#{par.name},'%')</if>
<if test='par.state!=null'>and a.state_code= #{par.state}</if>
<if test='par.fireTeamId!=null'>and a.fire_team_id= #{par.fireTeamId}</if>
<if test='par.jobTitle!=null'>and a.job_title_code =#{par.jobTitle}</if>
<if test='par.areasExpertiseCode!=null and par.areasExpertiseCode!="0"'>and b.areas_expertise_code =#{par.areasExpertiseCode}</if>
<if test='par.areasExpertiseCode=="0"'>and b.areas_expertise_code is not null</if>
<select id="getFirefightersJobTitleCount"
resultType="com.yeejoin.amos.boot.biz.common.utils.FirefightersTreeDto">
select COUNT(a.sequence_nbr) num, a.job_title_code jobTitleCode
from cb_firefighters a
where a.is_delete = 0
GROUP BY a.job_title_code
</select>
<!--消防队员列表按时间倒叙排列add desc 2021-09-08 by kongfm -->
<select id="getFirefighters"
resultType="com.yeejoin.amos.boot.module.common.api.dto.FirefightersZhDto">
select a.*,b.areas_expertise areasExpertise ,b.areas_expertise_code
areasExpertiseCode from cb_firefighters a LEFT JOIN
cb_firefighters_post b on
a.sequence_nbr=b.firefighters_id where a.is_delete=0
<if test='par.postQualification!=null'>and b.post_qualification_code = #{par.postQualification}</if>
<if test='par.areasExpertise!=null'>and b.areas_expertise_code= #{par.areasExpertise}</if>
<if test='par.name!=null'>and a.name like concat ('%',#{par.name},'%')</if>
<if test='par.state!=null'>and a.state_code= #{par.state}</if>
<if test='par.fireTeamId!=null'>and a.fire_team_id= #{par.fireTeamId}</if>
<if test='par.jobTitle!=null'>and a.job_title_code =#{par.jobTitle}</if>
<if
test='par.areasExpertiseCode!=null and par.areasExpertiseCode!="0"'>and b.areas_expertise_code =#{par.areasExpertiseCode}</if>
<if test='par.areasExpertiseCode=="0"'>and b.areas_expertise_code is not null</if>
ORDER BY a.rec_date desc limit #{pageNum},#{pageSize}
</select>
<!--消防队员列表按时间倒叙排列add desc 2021-09-08 by kongfm -->
<select id="getFirefightersCount" resultType="Map">
select COUNT(a.sequence_nbr) num from cb_firefighters a LEFT JOIN
cb_firefighters_post b on a.sequence_nbr=b.firefighters_id where
a.is_delete=0
<if test='par.postQualification!=null'>and b.post_qualification_code = #{par.postQualification}</if>
<if test='par.areasExpertise!=null'>and b.areas_expertise_code= #{par.areasExpertise}</if>
<if test='par.name!=null'>and a.name like concat ('%',#{par.name},'%')</if>
<if test='par.state!=null'>and a.state_code= #{par.state}</if>
<if test='par.fireTeamId!=null'>and a.fire_team_id= #{par.fireTeamId}</if>
<if test='par.jobTitle!=null'>and a.job_title_code =#{par.jobTitle}</if>
<if
test='par.areasExpertiseCode!=null and par.areasExpertiseCode!="0"'>and b.areas_expertise_code =#{par.areasExpertiseCode}</if>
<if test='par.areasExpertiseCode=="0"'>and b.areas_expertise_code is not null</if>
ORDER BY a.rec_date desc
</select>
ORDER BY a.rec_date desc
</select>
<select id="listToSelectById" resultType="Map">
SELECT IFNULL(a.personnel_photos, '') personnelPhotos,
a.sequence_nbr
sequenceNbr,
IFNULL(a.`name`, '无') `name`,
IFNULL(a.job_title, '无')
jobTitle,
IFNULL(b.administrative_position, '无')
administrativePosition,
IFNULL(c.`name`, '无') fireTeamName,
IFNULL(a.state, '无') state,
IFNULL(b.employee_hierarchy, '无')
employeeHierarchy,
IFNULL(b.areas_expertise, '无') areasExpertise,
IFNULL(a.gender, '无') gender,
IFNULL(b.post_qualification, '无')
postQualification, year ( from_days( datediff( now( ),
a.birthday_time))) age
FROM cb_firefighters a LEFT JOIN cb_firefighters_post b
ON a.sequence_nbr
= b.firefighters_id LEFT JOIN cb_fire_team c on
c.sequence_nbr=a.fire_team_id
WHERE a.is_delete =0
and a.sequence_nbr=#{id}
</select>
<select id="listToSelectById" resultType="Map">
SELECT IFNULL(a.personnel_photos, '') personnelPhotos,
a.sequence_nbr
sequenceNbr,
IFNULL(a.`name`, '无') `name`,
IFNULL(a.job_title, '无')
jobTitle,
IFNULL(b.administrative_position, '无')
administrativePosition,
IFNULL(c.`name`, '无') fireTeamName,
IFNULL(a.state, '无') state,
IFNULL(b.employee_hierarchy, '无')
employeeHierarchy,
IFNULL(b.areas_expertise, '无') areasExpertise,
IFNULL(a.gender, '无') gender,
IFNULL(b.post_qualification, '无')
postQualification, year ( from_days( datediff( now( ),
a.birthday_time))) age
FROM cb_firefighters a LEFT JOIN cb_firefighters_post b
ON a.sequence_nbr
= b.firefighters_id LEFT JOIN cb_fire_team c on
c.sequence_nbr=a.fire_team_id
WHERE a.is_delete =0
and a.sequence_nbr=#{id}
</select>
<!-- BUG3553 BY kongfm 人员关系显示汉字-->
<select id="exportToExcel" resultType="com.yeejoin.amos.boot.module.common.api.dto.FirefightersExcelDto">
select f.*,
(select cb_fire_team.name from cb_fire_team where cb_fire_team.sequence_nbr=f.fire_team_id) fireTeam,
emergency_contact, (select da.name from cb_data_dictionary da where da.code = fc.relationship) as relationship , emergency_contact_phone
from cb_firefighters f
left join cb_firefighters_contacts fc on f.sequence_nbr = fc.firefighters_id
where f.is_delete = #{isDelete}
</select>
<!-- BUG3553 BY kongfm 人员关系显示汉字 -->
<select id="exportToExcel"
resultType="com.yeejoin.amos.boot.module.common.api.dto.FirefightersExcelDto">
SELECT
f.*,
( SELECT cb_fire_team.NAME FROM cb_fire_team WHERE
cb_fire_team.sequence_nbr = f.fire_team_id ) fireTeam,
emergency_contact,
da.NAME AS relationship,
emergency_contact_phone
FROM
cb_firefighters f
LEFT JOIN cb_firefighters_contacts fc ON f.sequence_nbr =
fc.firefighters_id
left join cb_data_dictionary da on da.CODE = fc.relationship
where f.is_delete = #{isDelete}
</select>
</mapper>
......@@ -79,7 +79,7 @@ public class OrgPersonController {
@ApiOperation(httpMethod = "PUT", value = "更新单位数据", notes = "更新单位数据")
public ResponseModel<?> updateByIdOrgUsr(HttpServletRequest request, @RequestBody OrgPersonDto OrgPersonVo,
@PathVariable Long id) throws Exception {
//OrgPersonVo.setBizOrgType(CommonConstant.BIZ_ORG_TYPE_PERSON);
OrgPersonVo.setBizOrgType(CommonConstant.BIZ_ORG_TYPE_PERSON);
iOrgUsrService.updateByIdOrgPerson(OrgPersonVo, id);
return ResponseHelper.buildResponse(null);
}
......
......@@ -87,7 +87,10 @@ public class OrgUsrController extends BaseController {
return ResponseHelper.buildResponse("-1");
}
}
iOrgUsrService.update(new UpdateWrapper<OrgUsr>().eq("sequence_nbr", id).set("is_delete", CommonConstant.IS_DELETE_01));
// iOrgUsrService.update(new UpdateWrapper<OrgUsr>().eq("sequence_nbr", id).set("is_delete", CommonConstant.IS_DELETE_01));
/*bug 2812 一次删除多条数据 传入类型修改为string 问题解决 2021-09-09 陈召 开始*/
iOrgUsrService.update(new UpdateWrapper<OrgUsr>().eq("sequence_nbr", String.valueOf(id)).set("is_delete", CommonConstant.IS_DELETE_01));
/*bug 2812 一次删除多条数据 传入类型修改为string 问题解决 2021-09-09 陈召 结束*/
try {
eSOrgUsrService.deleteById(id);
emqKeeper.getMqttClient().publish(airportDeleteTopic, JSON.toJSONString(id).getBytes(), 2, false);
......@@ -108,6 +111,7 @@ public class OrgUsrController extends BaseController {
@RequestMapping(value = "/{id}", method = RequestMethod.PUT)
@ApiOperation(httpMethod = "PUT", value = "更新单位数据", notes = "更新单位数据")
public ResponseModel<?> updateByIdOrgUsr(HttpServletRequest request, @RequestBody OrgUsrDto OrgUsrVo, @PathVariable Long id) throws Exception {
OrgUsrVo.setBizOrgType(CommonConstant.BIZ_ORG_TYPE_COMPANY);
iOrgUsrService.updateByIdOrgUsr(OrgUsrVo, id);
return ResponseHelper.buildResponse(null);
......
......@@ -100,7 +100,6 @@ public class WaterResourceController extends BaseController {
model.setLongitude(Double.valueOf(address.getString(BizConstant.LONGITUDE)));
model.setLatitude(Double.valueOf(address.getString(BizConstant.LATITUDE)));
}*/
if (!StringUtils.isEmpty(resourceType)) {
switch (resourceType) {
case "hydrant":
......@@ -176,8 +175,6 @@ public class WaterResourceController extends BaseController {
model.setLongitude(Double.valueOf(address.getString(BizConstant.LONGITUDE)));
model.setLatitude(Double.valueOf(address.getString(BizConstant.LATITUDE)));
}*/
// 更新基本信息
model.setSequenceNbr(sequenceNbr);
model.setRealityImg(JSONArray.toJSONString(model.getRealityImgList()));
......
......@@ -85,16 +85,43 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
}
private void fillDutyShiftData(String beginDate, String endDate, Map<String, Object> m) throws ParseException {
// 获取值班的实例id
String instanceId = m.get("instanceId").toString();
// 根据appkey 获取未删除的值班班次
List<DutyShift> dutyShifts = dutyShiftService.list(new LambdaQueryWrapper<DutyShift>()
.eq(BaseEntity::getIsDelete, false).eq(DutyShift::getAppKey, RequestContext.getAppKey()));
// 根据id 保存成key -value
Map<Long, DutyShift> keyNameMap = dutyShifts.stream()
.collect(Collectors.toMap(BaseEntity::getSequenceNbr, Function.identity()));
// 根据时间 查询值班关系表
// BUG 2806 获取月份第一天和最后一天 2021-09-09 by kongfm
if(beginDate != null ) {
Calendar c = Calendar.getInstance();
c.setTime(DateUtils.longStr2Date(beginDate));
c.set(Calendar.DAY_OF_MONTH, 1);
c.set(Calendar.HOUR_OF_DAY,0);
c.set(Calendar.MINUTE,0);
c.set(Calendar.SECOND,0);
beginDate = DateUtils.date2LongStr(c.getTime());
}
if(endDate != null ) {
Calendar c = Calendar.getInstance();
c.setTime(DateUtils.longStr2Date(beginDate));
c.add(Calendar.MONTH, 1);
c.set(Calendar.DAY_OF_MONTH, 1);
c.add(Calendar.DATE, -1);
c.set(Calendar.HOUR_OF_DAY,23);
c.set(Calendar.MINUTE,59);
c.set(Calendar.SECOND,59);
endDate = DateUtils.date2LongStr(c.getTime());
}
List<DutyPersonShiftDto> personShiftList = dutyPersonShiftService
.list(new LambdaQueryWrapper<DutyPersonShift>().eq(DutyPersonShift::getInstanceId, instanceId)
.ge(beginDate != null, DutyPersonShift::getDutyDate, beginDate)
.le(endDate != null, DutyPersonShift::getDutyDate, endDate))
.stream().map(e -> {
// 值班关系查询到以后 重新封装
DutyPersonShiftDto dto = new DutyPersonShiftDto();
Bean.copyExistPropertis(e, dto);
// 没值班信息,默认休
......@@ -152,6 +179,7 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
public List<Map<String, Object>> list(Long teamId, String beginDate, String endDate) throws ParseException {
// 1.已column为准 进行返回
String groupCode = this.getGroupCode();
// 动态表单查询所有值班信息
List<Map<String, Object>> list = dynamicFormInstanceService.listAll(groupCode);
// 2.组织值班数据
......@@ -299,6 +327,9 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
@Override
public Boolean deleteDutyData(Long instanceId) {
// 一个人共用一个 instanceId
dynamicFormInstanceService.remove(
new LambdaQueryWrapper<DynamicFormInstance>().eq(DynamicFormInstance::getInstanceId, instanceId));
dutyPersonShiftService
......
spring.application.name=JCS-chenhao
spring.application.name=JCS
server.servlet.context-path=/jcs
server.port=11100
spring.profiles.active=dev
......@@ -7,10 +7,10 @@ spring.jackson.time-zone=GMT+8
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
logging.config=classpath:logback-${spring.profiles.active}.xml
## mybatis-plus配置控制台打印完整带参数SQL语句
## mybatis-plus配置控制台打印完整带参数SQL语句
mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
## redis失效时间
## redis失效时间
redis.cache.failure.time=10800
## unit(h)
......@@ -52,13 +52,13 @@ spring.redis.lettuce.pool.min-idle=0
spring.redis.expire.time=300
#在重启服务的过程中是否清空缓存的标识符 --2021-09-09
my.spring.redis.cache.isclean=false
## mqtt-警情初报消息主题
## mqtt-警情初报消息主题
mqtt.topic.alert.reporting=alertReporting
## 实战指挥新警情�?�报主题
## 实战指挥新警情主题
mqtt.topic.command.alert.notice=alertNotice
## 跑马灯地震,天气预警信息
## 跑马灯地震、天气预警信息
mqtt.topic.command.meteorological.notice=meteorological
mqtt.topic.command.power.deployment=power
......@@ -72,8 +72,8 @@ iot.fegin.name=AMOS-API-IOT
equip.fegin.name=AMOS-EQUIPMANAGE
## 设备联动服务(车库门、广播、警铃)
## 设备联动服务(车库门、广播、警铃)
control.fegin.name=JCS-API-CONTROL
## 故障报修流程
## 故障报修流程
failure.work.flow.processDefinitionKey=malfunction_repair
\ 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